Line data Source code
1 : #ifndef MU_IMPORTEXPORT_GPMASTERTRACKS_H
2 : #define MU_IMPORTEXPORT_GPMASTERTRACKS_H
3 :
4 : #include <stddef.h>
5 : #include <vector>
6 :
7 : #include "types/string.h"
8 :
9 : namespace mu::iex::guitarpro {
10 : class GPMasterTracks
11 : {
12 : public:
13 : struct Automation {
14 : enum class Type {
15 : tempo, volume, pan
16 : };
17 : int bar{ 0 };
18 : Type type{ Type::tempo };
19 : float position{ 0 };
20 : bool linear{ false };
21 : double value{ 0 };
22 : int tempoUnit{ 0 };
23 : muse::String text;
24 : friend bool operator<(const Automation& l, const Automation& r) { return l.bar < r.bar; }
25 : };
26 :
27 221 : GPMasterTracks() = default;
28 221 : ~GPMasterTracks() = default;
29 : GPMasterTracks(const GPMasterTracks& masterTrack) = default;
30 : GPMasterTracks(GPMasterTracks&& masterTrack) = default;
31 : GPMasterTracks& operator=(const GPMasterTracks& mT) = default;
32 : GPMasterTracks& operator=(GPMasterTracks&& mT) = default;
33 :
34 221 : void setTempoMap(std::vector<Automation>&& tM) { _tempoMap.swap(tM); }
35 221 : const std::vector<Automation>& tempoMap() const { return _tempoMap; }
36 221 : void setTracksCount(size_t tc) { _tracksCount = tc; }
37 : size_t tracksCount() { return _tracksCount; }
38 :
39 : private:
40 : std::vector<Automation> _tempoMap;
41 : size_t _tracksCount;
42 : };
43 : } // namespace mu::iex::guitarpro
44 :
45 : #endif // MU_IMPORTEXPORT_GPMASTERTRACKS_H
|