Mercurial > hg > svcore
comparison data/model/NoteModel.h @ 1659:8bf3a52a1604 single-point
Work on start/end frame stuff to match API description
author | Chris Cannam |
---|---|
date | Thu, 21 Mar 2019 11:35:30 +0000 |
parents | 31b46a5647db |
children | 82d03c9661f9 |
comparison
equal
deleted
inserted
replaced
1658:5b7b01da430a | 1659:8bf3a52a1604 |
---|---|
94 PlayParameterRepository::getInstance()->removePlayable(this); | 94 PlayParameterRepository::getInstance()->removePlayable(this); |
95 } | 95 } |
96 | 96 |
97 QString getTypeName() const override { return tr("Note"); } | 97 QString getTypeName() const override { return tr("Note"); } |
98 Subtype getSubtype() const { return m_subtype; } | 98 Subtype getSubtype() const { return m_subtype; } |
99 | 99 bool isSparse() const { return true; } |
100 bool isOK() const override { return true; } | 100 bool isOK() const override { return true; } |
101 sv_frame_t getStartFrame() const override { return m_events.getStartFrame(); } | 101 |
102 sv_frame_t getEndFrame() const override { return m_events.getEndFrame(); } | 102 sv_frame_t getStartFrame() const override { |
103 return m_events.getStartFrame(); | |
104 } | |
105 sv_frame_t getEndFrame() const override { | |
106 if (m_events.isEmpty()) return 0; | |
107 sv_frame_t e = m_events.getEndFrame(); | |
108 if (e % m_resolution == 0) return e; | |
109 else return (e / m_resolution + 1) * m_resolution; | |
110 } | |
111 | |
103 sv_samplerate_t getSampleRate() const override { return m_sampleRate; } | 112 sv_samplerate_t getSampleRate() const override { return m_sampleRate; } |
104 int getResolution() const { return m_resolution; } | 113 int getResolution() const { return m_resolution; } |
105 | 114 |
106 bool canPlay() const override { return true; } | 115 bool canPlay() const override { return true; } |
107 QString getDefaultPlayClipId() const override { | 116 QString getDefaultPlayClipId() const override { |