comparison layer/LayerFactory.cpp @ 623:49afde2dd704 tonioni

put the FlexiNote layer before the note layer to see what happens -- not much
author matthiasm
date Tue, 26 Mar 2013 20:14:08 +0000
parents e7352a4c0a05
children 1336439dc055
comparison
equal deleted inserted replaced
622:765bb3774c4f 623:49afde2dd704
159 if (dynamic_cast<SparseTimeValueModel *>(model)) { 159 if (dynamic_cast<SparseTimeValueModel *>(model)) {
160 types.insert(TimeValues); 160 types.insert(TimeValues);
161 } 161 }
162 162
163 if (dynamic_cast<NoteModel *>(model)) { 163 if (dynamic_cast<NoteModel *>(model)) {
164 types.insert(FlexiNotes);
164 types.insert(Notes); 165 types.insert(Notes);
165 } 166 }
166 167
167 if (dynamic_cast<FlexiNoteModel *>(model)) { 168 if (dynamic_cast<FlexiNoteModel *>(model)) {
168 types.insert(FlexiNotes); 169 types.insert(FlexiNotes);
170 types.insert(Notes);
169 } 171 }
170 172
171 if (dynamic_cast<RegionModel *>(model)) { 173 if (dynamic_cast<RegionModel *>(model)) {
172 types.insert(Regions); 174 types.insert(Regions);
173 } 175 }
194 LayerFactory::getValidEmptyLayerTypes() 196 LayerFactory::getValidEmptyLayerTypes()
195 { 197 {
196 LayerTypeSet types; 198 LayerTypeSet types;
197 types.insert(TimeInstants); 199 types.insert(TimeInstants);
198 types.insert(TimeValues); 200 types.insert(TimeValues);
201 types.insert(FlexiNotes);
199 types.insert(Notes); 202 types.insert(Notes);
200 types.insert(FlexiNotes);
201 types.insert(Regions); 203 types.insert(Regions);
202 types.insert(Text); 204 types.insert(Text);
203 types.insert(Image); 205 types.insert(Image);
204 //!!! and in principle Colour3DPlot -- now that's a challenge 206 //!!! and in principle Colour3DPlot -- now that's a challenge
205 return types; 207 return types;
211 if (dynamic_cast<const WaveformLayer *>(layer)) return Waveform; 213 if (dynamic_cast<const WaveformLayer *>(layer)) return Waveform;
212 if (dynamic_cast<const SpectrogramLayer *>(layer)) return Spectrogram; 214 if (dynamic_cast<const SpectrogramLayer *>(layer)) return Spectrogram;
213 if (dynamic_cast<const TimeRulerLayer *>(layer)) return TimeRuler; 215 if (dynamic_cast<const TimeRulerLayer *>(layer)) return TimeRuler;
214 if (dynamic_cast<const TimeInstantLayer *>(layer)) return TimeInstants; 216 if (dynamic_cast<const TimeInstantLayer *>(layer)) return TimeInstants;
215 if (dynamic_cast<const TimeValueLayer *>(layer)) return TimeValues; 217 if (dynamic_cast<const TimeValueLayer *>(layer)) return TimeValues;
218 if (dynamic_cast<const FlexiNoteLayer *>(layer)) return FlexiNotes;
216 if (dynamic_cast<const NoteLayer *>(layer)) return Notes; 219 if (dynamic_cast<const NoteLayer *>(layer)) return Notes;
217 if (dynamic_cast<const FlexiNoteLayer *>(layer)) return FlexiNotes;
218 if (dynamic_cast<const RegionLayer *>(layer)) return Regions; 220 if (dynamic_cast<const RegionLayer *>(layer)) return Regions;
219 if (dynamic_cast<const TextLayer *>(layer)) return Text; 221 if (dynamic_cast<const TextLayer *>(layer)) return Text;
220 if (dynamic_cast<const ImageLayer *>(layer)) return Image; 222 if (dynamic_cast<const ImageLayer *>(layer)) return Image;
221 if (dynamic_cast<const Colour3DPlotLayer *>(layer)) return Colour3DPlot; 223 if (dynamic_cast<const Colour3DPlotLayer *>(layer)) return Colour3DPlot;
222 if (dynamic_cast<const SpectrumLayer *>(layer)) return Spectrum; 224 if (dynamic_cast<const SpectrumLayer *>(layer)) return Spectrum;
255 case Spectrogram: return "spectrogram"; 257 case Spectrogram: return "spectrogram";
256 case TimeRuler: return "timeruler"; 258 case TimeRuler: return "timeruler";
257 case TimeInstants: return "timeinstants"; 259 case TimeInstants: return "timeinstants";
258 case TimeValues: return "timevalues"; 260 case TimeValues: return "timevalues";
259 case Notes: return "notes"; 261 case Notes: return "notes";
260 case FlexiNotes: return "flexible notes"; 262 case FlexiNotes: return "flexinotes";
261 case Regions: return "regions"; 263 case Regions: return "regions";
262 case Text: return "text"; 264 case Text: return "text";
263 case Image: return "image"; 265 case Image: return "image";
264 case Colour3DPlot: return "colour3dplot"; 266 case Colour3DPlot: return "colour3dplot";
265 case Spectrum: return "spectrum"; 267 case Spectrum: return "spectrum";
276 if (name == "waveform") return Waveform; 278 if (name == "waveform") return Waveform;
277 if (name == "spectrogram") return Spectrogram; 279 if (name == "spectrogram") return Spectrogram;
278 if (name == "timeruler") return TimeRuler; 280 if (name == "timeruler") return TimeRuler;
279 if (name == "timeinstants") return TimeInstants; 281 if (name == "timeinstants") return TimeInstants;
280 if (name == "timevalues") return TimeValues; 282 if (name == "timevalues") return TimeValues;
281 if (name == "flexible notes") return FlexiNotes; 283 if (name == "flexinotes") return FlexiNotes;
282 if (name == "regions") return Regions; 284 if (name == "regions") return Regions;
283 if (name == "text") return Text; 285 if (name == "text") return Text;
284 if (name == "image") return Image; 286 if (name == "image") return Image;
285 if (name == "colour3dplot") return Colour3DPlot; 287 if (name == "colour3dplot") return Colour3DPlot;
286 if (name == "spectrum") return Spectrum; 288 if (name == "spectrum") return Spectrum;
345 { 347 {
346 if (layerType == TimeInstants) { 348 if (layerType == TimeInstants) {
347 return new SparseOneDimensionalModel(baseModel->getSampleRate(), 1); 349 return new SparseOneDimensionalModel(baseModel->getSampleRate(), 1);
348 } else if (layerType == TimeValues) { 350 } else if (layerType == TimeValues) {
349 return new SparseTimeValueModel(baseModel->getSampleRate(), 1, true); 351 return new SparseTimeValueModel(baseModel->getSampleRate(), 1, true);
352 } else if (layerType == FlexiNotes) {
353 return new FlexiNoteModel(baseModel->getSampleRate(), 1, true);
350 } else if (layerType == Notes) { 354 } else if (layerType == Notes) {
351 return new NoteModel(baseModel->getSampleRate(), 1, true);
352 } else if (layerType == FlexiNotes) {
353 return new NoteModel(baseModel->getSampleRate(), 1, true); 355 return new NoteModel(baseModel->getSampleRate(), 1, true);
354 } else if (layerType == Regions) { 356 } else if (layerType == Regions) {
355 return new RegionModel(baseModel->getSampleRate(), 1, true); 357 return new RegionModel(baseModel->getSampleRate(), 1, true);
356 } else if (layerType == Text) { 358 } else if (layerType == Text) {
357 return new TextModel(baseModel->getSampleRate(), 1, true); 359 return new TextModel(baseModel->getSampleRate(), 1, true);
416 418
417 case TimeValues: 419 case TimeValues:
418 layer = new TimeValueLayer; 420 layer = new TimeValueLayer;
419 break; 421 break;
420 422
423 case FlexiNotes:
424 layer = new FlexiNoteLayer;
425 break;
426
421 case Notes: 427 case Notes:
422 layer = new NoteLayer; 428 layer = new NoteLayer;
423 break;
424
425 case FlexiNotes:
426 layer = new FlexiNoteLayer;
427 break; 429 break;
428 430
429 case Regions: 431 case Regions:
430 layer = new RegionLayer; 432 layer = new RegionLayer;
431 break; 433 break;