LMMS
Loading...
Searching...
No Matches
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
34namespace lmms
35{
36
37class AutomationClip;
38class InstrumentTrack;
39
40namespace gui
41{
42
44
45}
46
47
48class LMMS_EXPORT TrackContainer : public Model, public JournallingObject
49{
50 Q_OBJECT
51public:
52 using TrackList = std::vector<Track*>;
53 enum class Type
54 {
55 Pattern,
57 } ;
58
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 {
97 }
98
99 virtual AutomatedValueMap automatedValuesAt(TimePos time, int clipNum = -1) const;
100
101signals:
102 void trackAdded( lmms::Track * _track );
105
106protected:
107 static AutomatedValueMap automatedValuesFromTracks(const TrackList &tracks, TimePos timeStart, int clipNum = -1);
108
109 mutable QReadWriteLock m_tracksMutex;
110
111private:
113
115
116
118 friend class Track;
119
120} ;
121
122} // namespace lmms
123
124#endif // LMMS_TRACK_CONTAINER_H
Definition AutomationClip.h:52
Definition InstrumentTrack.h:62
JournallingObject()
Definition JournallingObject.cpp:36
Model(Model *parent, QString displayName=QString(), bool defaultConstructed=false)
Definition Model.cpp:30
Definition Song.h:65
Definition TimePos.h:68
Definition TrackContainer.h:49
Type m_TrackContainerType
Definition TrackContainer.h:114
TrackContainer()
Definition TrackContainer.cpp:48
Type type() const
Definition TrackContainer.h:94
std::vector< Track * > TrackList
Definition TrackContainer.h:52
void setType(Type newType)
Definition TrackContainer.h:89
void trackAdded(lmms::Track *_track)
QReadWriteLock m_tracksMutex
Definition TrackContainer.h:109
const TrackList & tracks() const
Definition TrackContainer.h:77
Type
Definition TrackContainer.h:54
friend class Track
Definition TrackContainer.h:118
TrackList m_tracks
Definition TrackContainer.h:112
static const QString classNodeName()
Definition TrackContainer.h:84
static AutomatedValueMap automatedValuesFromTracks(const TrackList &tracks, TimePos timeStart, int clipNum=-1)
Definition TrackContainer.cpp:267
Base-class for all tracks.
Definition Track.h:68
Type
Definition Track.h:76
@ Count
Definition Track.h:84
Definition TrackContainerView.h:71
Definition AudioPortAudio.cpp:223
Definition AudioAlsa.cpp:35
QMap< AutomatableModel *, float > AutomatedValueMap
Definition AutomatableModel.h:511