RemoteVstPlugin: fixed too short arrays for preset names
[lmms.git] / include / bb_track.h
blobd64c8e35bb835d20a563143940fb3e86d9af8cd5
1 /*
2 * bb_track.h - class bbTrack, a wrapper for using bbEditor
3 * (which is a singleton-class) as track
5 * Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
6 *
7 * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public
11 * License as published by the Free Software Foundation; either
12 * version 2 of the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
19 * You should have received a copy of the GNU General Public
20 * License along with this program (see COPYING); if not, write to the
21 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 * Boston, MA 02110-1301 USA.
27 #ifndef _BB_TRACK_H
28 #define _BB_TRACK_H
30 #include <QtCore/QObject>
31 #include <QtCore/QMap>
33 #include "track.h"
35 class trackLabelButton;
36 class trackContainer;
39 class bbTCO : public trackContentObject
41 public:
42 bbTCO( track * _track, unsigned int _color = 0 );
43 virtual ~bbTCO();
45 virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent );
46 virtual void loadSettings( const QDomElement & _this );
47 inline virtual QString nodeName() const
49 return( "bbtco" );
52 inline unsigned int color() const
54 return( m_color );
57 virtual trackContentObjectView * createView( trackView * _tv );
60 private:
61 unsigned int m_color;
64 friend class bbTCOView;
66 } ;
70 class bbTCOView : public trackContentObjectView
72 Q_OBJECT
73 public:
74 bbTCOView( trackContentObject * _tco, trackView * _tv );
75 virtual ~bbTCOView();
77 QColor color() const
79 return( m_bbTCO->m_color );
81 void setColor( QColor _new_color );
84 protected slots:
85 void openInBBEditor();
86 void resetName();
87 void changeName();
88 void changeColor();
91 protected:
92 void paintEvent( QPaintEvent * );
93 void mouseDoubleClickEvent( QMouseEvent * _me );
94 virtual void constructContextMenu( QMenu * );
97 private:
98 bbTCO * m_bbTCO;
105 class EXPORT bbTrack : public track
107 Q_OBJECT
108 public:
109 bbTrack( trackContainer * _tc );
110 virtual ~bbTrack();
112 virtual bool play( const midiTime & _start,
113 const fpp_t _frames,
114 const f_cnt_t _frame_base,
115 Sint16 _tco_num = -1 );
116 virtual trackView * createView( trackContainerView * _tcv );
117 virtual trackContentObject * createTCO( const midiTime & _pos );
119 virtual void saveTrackSpecificSettings( QDomDocument & _doc,
120 QDomElement & _parent );
121 virtual void loadTrackSpecificSettings( const QDomElement & _this );
123 static bbTrack * findBBTrack( int _bb_num );
124 static int numOfBBTrack( track * _track );
125 static void swapBBTracks( track * _track1, track * _track2 );
127 bool automationDisabled( track * _track )
129 return( m_disabledTracks.contains( _track ) );
131 void disableAutomation( track * _track )
133 m_disabledTracks.append( _track );
135 void enableAutomation( track * _track )
137 m_disabledTracks.removeAll( _track );
141 protected:
142 inline virtual QString nodeName() const
144 return( "bbtrack" );
148 private:
149 QList<track *> m_disabledTracks;
151 typedef QMap<bbTrack *, int> infoMap;
152 static infoMap s_infoMap;
155 friend class bbTrackView;
161 class bbTrackView : public trackView
163 Q_OBJECT
164 public:
165 bbTrackView( bbTrack * _bbt, trackContainerView * _tcv );
166 virtual ~bbTrackView();
168 virtual bool close();
170 const bbTrack * getBBTrack() const
172 return( m_bbTrack );
176 public slots:
177 void clickedTrackLabel();
180 private:
181 bbTrack * m_bbTrack;
182 trackLabelButton * m_trackLabel;
188 #endif