-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathtimeline.h
49 lines (35 loc) · 1.12 KB
/
timeline.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef TIMELINE
#define TIMELINE
#include <memory>
#include <QString>
#include <QVector>
#include "timelinelayer.h"
class Timeline : public QObject
{
Q_OBJECT
public:
Timeline();
std::shared_ptr<TimelineLayer> createLayer();
void removeLayer(int idx);
void clearLayers();
void setBackingTrack(const QString& path);
void setBPM(double bpm);
// getters
inline const QString& backingTrack() const { return mBackingTrack; }
inline double bpm() const { return mBPM; }
inline const QVector< std::shared_ptr<TimelineLayer> >& layers() const { return mLayers; }
inline std::shared_ptr<TimelineLayer> layer(int idx) { return mLayers.at(idx); }
QJsonObject toJSON() const;
void fromJSON(const QJsonObject& timeline);
std::shared_ptr<Timeline> process() const;
signals:
void layerAdded(int idx, std::shared_ptr<TimelineLayer> layer);
void layerRemoved(int idx);
void backingTrackChanged(const QString& track);
void bpmChanged(double bpm);
private:
QString mBackingTrack;
double mBPM;
QVector< std::shared_ptr<TimelineLayer> > mLayers;
};
#endif // TIMELINE