comparison data/model/SparseOneDimensionalModel.h @ 1643:7a23dfe65d66 single-point

Update NoteModel to use EventSeries. This is incomplete and won't provide enough to update svgui for it yet; must also refactor to avoid duplication of nasty APIs when updating the rest of the models
author Chris Cannam
date Wed, 13 Mar 2019 14:50:10 +0000
parents 24dc8cb42755
children 5b7b01da430a
comparison
equal deleted inserted replaced
1642:d591836e47ef 1643:7a23dfe65d66
16 #ifndef SV_SPARSE_ONE_DIMENSIONAL_MODEL_H 16 #ifndef SV_SPARSE_ONE_DIMENSIONAL_MODEL_H
17 #define SV_SPARSE_ONE_DIMENSIONAL_MODEL_H 17 #define SV_SPARSE_ONE_DIMENSIONAL_MODEL_H
18 18
19 #include "SparseModel.h" 19 #include "SparseModel.h"
20 #include "base/NoteData.h" 20 #include "base/NoteData.h"
21 #include "base/NoteExportable.h"
21 #include "base/PlayParameterRepository.h" 22 #include "base/PlayParameterRepository.h"
22 #include "base/RealTime.h" 23 #include "base/RealTime.h"
23 24
24 #include <QStringList> 25 #include <QStringList>
25 26
186 /** 187 /**
187 * NoteExportable methods. 188 * NoteExportable methods.
188 */ 189 */
189 190
190 NoteList getNotes() const override { 191 NoteList getNotes() const override {
191 return getNotesWithin(getStartFrame(), getEndFrame()); 192 return getNotesStartingWithin(getStartFrame(),
192 } 193 getEndFrame() - getStartFrame());
193 194 }
194 NoteList getNotesWithin(sv_frame_t startFrame, sv_frame_t endFrame) const override { 195
196 NoteList getNotesActiveAt(sv_frame_t frame) const override {
197 return getNotesStartingWithin(frame, 1);
198 }
199
200 NoteList getNotesStartingWithin(sv_frame_t startFrame,
201 sv_frame_t duration) const override {
195 202
196 PointList points = getPoints(startFrame, endFrame); 203 PointList points = getPoints(startFrame, startFrame + duration);
197 NoteList notes; 204 NoteList notes;
198 205
199 for (PointList::iterator pli = 206 for (PointList::iterator pli =
200 points.begin(); pli != points.end(); ++pli) { 207 points.begin(); pli != points.end(); ++pli) {
201 208