lmms
Cross-platform music production software
Toggle main menu visibility
Loading...
Searching...
No Matches
include
TrackContainer.h
Go to the documentation of this file.
1
/*
2
* TrackContainer.h - base-class for all track-containers like Song-Editor,
3
* Pattern Editor...
4
*
5
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
6
*
7
* This file is part of LMMS - https://lmms.io
8
*
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.
13
*
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.
18
*
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.
23
*
24
*/
25
26
#ifndef LMMS_TRACK_CONTAINER_H
27
#define LMMS_TRACK_CONTAINER_H
28
29
#include <QReadWriteLock>
30
31
#include "
Track.h
"
32
#include "
JournallingObject.h
"
33
34
namespace
lmms
35
{
36
37
class
AutomationClip
;
38
class
InstrumentTrack
;
39
40
namespace
gui
41
{
42
43
class
TrackContainerView
;
44
45
}
46
47
48
class
LMMS_EXPORT
TrackContainer
:
public
Model
,
public
JournallingObject
49
{
50
Q_OBJECT
51
public
:
52
using
TrackList
= std::vector<Track*>;
53
enum class
Type
54
{
55
Pattern,
56
Song
57
} ;
58
59
TrackContainer
();
60
~TrackContainer
()
override
;
61
62
void
saveSettings( QDomDocument & _doc, QDomElement & _parent )
override
;
63
64
void
loadSettings(
const
QDomElement & _this )
override
;
65
66
int
countTracks(
Track::Type
_tt =
Track::Type::Count
)
const
;
67
68
69
void
addTrack(
Track
* _track );
70
void
removeTrack(
Track
* _track );
71
void
moveTrack(
Track
* track,
int
indexTo);
72
73
virtual
void
updateAfterTrackAdd();
74
75
void
clearAllTracks();
76
77
const
TrackList
&
tracks
()
const
78
{
79
return
m_tracks
;
80
}
81
82
bool
isEmpty()
const
;
83
84
static
const
QString
classNodeName
()
85
{
86
return
"trackcontainer"
;
87
}
88
89
inline
void
setType
(
Type
newType )
90
{
91
m_TrackContainerType
= newType;
92
}
93
94
inline
Type
type
()
const
95
{
96
return
m_TrackContainerType
;
97
}
98
99
virtual
AutomatedValueMap
automatedValuesAt(
TimePos
time,
int
clipNum = -1)
const
;
100
101
signals:
102
void
trackAdded
(
lmms::Track
* _track );
103
void
trackRemoved
();
104
void
trackMoved
();
105
106
protected
:
107
static
AutomatedValueMap
automatedValuesFromTracks
(
const
TrackList
&
tracks
,
TimePos
timeStart,
int
clipNum = -1);
108
109
mutable
QReadWriteLock
m_tracksMutex
;
110
111
private
:
112
TrackList
m_tracks
;
113
114
Type
m_TrackContainerType
;
115
116
117
friend
class
gui::TrackContainerView
;
118
friend
class
Track
;
119
120
} ;
121
122
}
// namespace lmms
123
124
#endif
// LMMS_TRACK_CONTAINER_H
JournallingObject.h
Track.h
lmms::AutomationClip
Definition
AutomationClip.h:52
lmms::InstrumentTrack
Definition
InstrumentTrack.h:62
lmms::JournallingObject::JournallingObject
JournallingObject()
Definition
JournallingObject.cpp:36
lmms::Model::Model
Model(Model *parent, QString displayName=QString(), bool defaultConstructed=false)
Definition
Model.cpp:30
lmms::Song
Definition
Song.h:67
lmms::TimePos
Definition
TimePos.h:68
lmms::TrackContainer
Definition
TrackContainer.h:49
lmms::TrackContainer::m_TrackContainerType
Type m_TrackContainerType
Definition
TrackContainer.h:114
lmms::TrackContainer::TrackContainer
TrackContainer()
Definition
TrackContainer.cpp:48
lmms::TrackContainer::type
Type type() const
Definition
TrackContainer.h:94
lmms::TrackContainer::TrackList
std::vector< Track * > TrackList
Definition
TrackContainer.h:52
lmms::TrackContainer::setType
void setType(Type newType)
Definition
TrackContainer.h:89
lmms::TrackContainer::trackAdded
void trackAdded(lmms::Track *_track)
lmms::TrackContainer::m_tracksMutex
QReadWriteLock m_tracksMutex
Definition
TrackContainer.h:109
lmms::TrackContainer::tracks
const TrackList & tracks() const
Definition
TrackContainer.h:77
lmms::TrackContainer::Type
Type
Definition
TrackContainer.h:54
lmms::TrackContainer::trackMoved
void trackMoved()
lmms::TrackContainer::trackRemoved
void trackRemoved()
lmms::TrackContainer::Track
friend class Track
Definition
TrackContainer.h:118
lmms::TrackContainer::m_tracks
TrackList m_tracks
Definition
TrackContainer.h:112
lmms::TrackContainer::classNodeName
static const QString classNodeName()
Definition
TrackContainer.h:84
lmms::TrackContainer::automatedValuesFromTracks
static AutomatedValueMap automatedValuesFromTracks(const TrackList &tracks, TimePos timeStart, int clipNum=-1)
Definition
TrackContainer.cpp:267
lmms::Track
Base-class for all tracks.
Definition
Track.h:67
lmms::Track::Type
Type
Definition
Track.h:75
lmms::Track::Type::Count
@ Count
Definition
Track.h:83
lmms::gui::TrackContainerView
Definition
TrackContainerView.h:71
lmms::gui
Definition
AudioPortAudio.cpp:209
lmms
Definition
RemotePluginBase.cpp:34
lmms::AutomatedValueMap
QMap< AutomatableModel *, float > AutomatedValueMap
Definition
AutomatableModel.h:516
Generated on
for lmms by
1.18.0