Mercurial > hg > svgui
comparison layer/LayerFactory.cpp @ 1426:e1a08da75427 single-point
Update following FlexiNoteModel removal, using new NoteModel API where flexi was previously used
author | Chris Cannam |
---|---|
date | Thu, 14 Mar 2019 15:32:58 +0000 |
parents | 62e908518c71 |
children | 9e846af73f3e |
comparison
equal
deleted
inserted
replaced
1425:f9e3126d223c | 1426:e1a08da75427 |
---|---|
35 #include "data/model/RangeSummarisableTimeValueModel.h" | 35 #include "data/model/RangeSummarisableTimeValueModel.h" |
36 #include "data/model/DenseTimeValueModel.h" | 36 #include "data/model/DenseTimeValueModel.h" |
37 #include "data/model/SparseOneDimensionalModel.h" | 37 #include "data/model/SparseOneDimensionalModel.h" |
38 #include "data/model/SparseTimeValueModel.h" | 38 #include "data/model/SparseTimeValueModel.h" |
39 #include "data/model/NoteModel.h" | 39 #include "data/model/NoteModel.h" |
40 #include "data/model/FlexiNoteModel.h" | |
41 #include "data/model/RegionModel.h" | 40 #include "data/model/RegionModel.h" |
42 #include "data/model/TextModel.h" | 41 #include "data/model/TextModel.h" |
43 #include "data/model/ImageModel.h" | 42 #include "data/model/ImageModel.h" |
44 #include "data/model/DenseThreeDimensionalModel.h" | 43 #include "data/model/DenseThreeDimensionalModel.h" |
45 #include "data/model/WaveFileModel.h" | 44 #include "data/model/WaveFileModel.h" |
160 if (dynamic_cast<SparseTimeValueModel *>(model)) { | 159 if (dynamic_cast<SparseTimeValueModel *>(model)) { |
161 types.insert(TimeValues); | 160 types.insert(TimeValues); |
162 } | 161 } |
163 | 162 |
164 if (dynamic_cast<NoteModel *>(model)) { | 163 if (dynamic_cast<NoteModel *>(model)) { |
165 types.insert(Notes); | 164 NoteModel *nm = dynamic_cast<NoteModel *>(model); |
166 } | 165 if (nm->getSubtype() == NoteModel::FLEXI_NOTE) { |
167 | 166 types.insert(FlexiNotes); |
168 // NOTE: GF: types is a set, so order of insertion does not matter | 167 } else { |
169 if (dynamic_cast<FlexiNoteModel *>(model)) { | 168 types.insert(Notes); |
170 types.insert(FlexiNotes); | 169 } |
171 } | 170 } |
172 | 171 |
173 if (dynamic_cast<RegionModel *>(model)) { | 172 if (dynamic_cast<RegionModel *>(model)) { |
174 types.insert(Regions); | 173 types.insert(Regions); |
175 } | 174 } |
325 return; | 324 return; |
326 | 325 |
327 if (trySetModel<NoteLayer, NoteModel>(layer, model)) | 326 if (trySetModel<NoteLayer, NoteModel>(layer, model)) |
328 return; | 327 return; |
329 | 328 |
330 // GF: added FlexiNoteLayer | 329 if (trySetModel<FlexiNoteLayer, NoteModel>(layer, model)) |
331 if (trySetModel<FlexiNoteLayer, FlexiNoteModel>(layer, model)) | |
332 return; | 330 return; |
333 | 331 |
334 if (trySetModel<RegionLayer, RegionModel>(layer, model)) | 332 if (trySetModel<RegionLayer, RegionModel>(layer, model)) |
335 return; | 333 return; |
336 | 334 |
359 if (layerType == TimeInstants) { | 357 if (layerType == TimeInstants) { |
360 return new SparseOneDimensionalModel(baseModel->getSampleRate(), 1); | 358 return new SparseOneDimensionalModel(baseModel->getSampleRate(), 1); |
361 } else if (layerType == TimeValues) { | 359 } else if (layerType == TimeValues) { |
362 return new SparseTimeValueModel(baseModel->getSampleRate(), 1, true); | 360 return new SparseTimeValueModel(baseModel->getSampleRate(), 1, true); |
363 } else if (layerType == FlexiNotes) { | 361 } else if (layerType == FlexiNotes) { |
364 return new FlexiNoteModel(baseModel->getSampleRate(), 1, true); | 362 return new NoteModel(baseModel->getSampleRate(), 1, true); |
365 } else if (layerType == Notes) { | 363 } else if (layerType == Notes) { |
366 return new NoteModel(baseModel->getSampleRate(), 1, true); | 364 return new NoteModel(baseModel->getSampleRate(), 1, true); |
367 } else if (layerType == Regions) { | 365 } else if (layerType == Regions) { |
368 return new RegionModel(baseModel->getSampleRate(), 1, true); | 366 return new RegionModel(baseModel->getSampleRate(), 1, true); |
369 } else if (layerType == Text) { | 367 } else if (layerType == Text) { |