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>
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.
30 #include <QtCore/QObject>
31 #include <QtCore/QMap>
35 class trackLabelButton
;
39 class bbTCO
: public trackContentObject
42 bbTCO( track
* _track
, unsigned int _color
= 0 );
45 virtual void saveSettings( QDomDocument
& _doc
, QDomElement
& _parent
);
46 virtual void loadSettings( const QDomElement
& _this
);
47 inline virtual QString
nodeName() const
52 inline unsigned int color() const
57 virtual trackContentObjectView
* createView( trackView
* _tv
);
64 friend class bbTCOView
;
70 class bbTCOView
: public trackContentObjectView
74 bbTCOView( trackContentObject
* _tco
, trackView
* _tv
);
79 return( m_bbTCO
->m_color
);
81 void setColor( QColor _new_color
);
85 void openInBBEditor();
92 void paintEvent( QPaintEvent
* );
93 void mouseDoubleClickEvent( QMouseEvent
* _me
);
94 virtual void constructContextMenu( QMenu
* );
105 class EXPORT bbTrack
: public track
109 bbTrack( trackContainer
* _tc
);
112 virtual bool play( const midiTime
& _start
,
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
);
142 inline virtual QString
nodeName() const
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
165 bbTrackView( bbTrack
* _bbt
, trackContainerView
* _tcv
);
166 virtual ~bbTrackView();
168 virtual bool close();
170 const bbTrack
* getBBTrack() const
177 void clickedTrackLabel();
182 trackLabelButton
* m_trackLabel
;