comparison layer/LayerFactory.cpp @ 777:c2291e22bf0c tonioni

implemented move by one note (replacing big jumps left/right)
author matthiasm
date Thu, 22 May 2014 17:49:58 +0100
parents 6a8d922f991d
children ddae586bc47b
comparison
equal deleted inserted replaced
775:a6b87176b259 777:c2291e22bf0c
195 LayerFactory::getValidEmptyLayerTypes() 195 LayerFactory::getValidEmptyLayerTypes()
196 { 196 {
197 LayerTypeSet types; 197 LayerTypeSet types;
198 types.insert(TimeInstants); 198 types.insert(TimeInstants);
199 types.insert(TimeValues); 199 types.insert(TimeValues);
200 types.insert(FlexiNotes); 200 types.insert(FlexiNotes);
201 types.insert(Notes); 201 types.insert(Notes);
202 types.insert(Regions); 202 types.insert(Regions);
203 types.insert(Text); 203 types.insert(Text);
204 types.insert(Image); 204 types.insert(Image);
205 //!!! and in principle Colour3DPlot -- now that's a challenge 205 //!!! and in principle Colour3DPlot -- now that's a challenge
212 if (dynamic_cast<const WaveformLayer *>(layer)) return Waveform; 212 if (dynamic_cast<const WaveformLayer *>(layer)) return Waveform;
213 if (dynamic_cast<const SpectrogramLayer *>(layer)) return Spectrogram; 213 if (dynamic_cast<const SpectrogramLayer *>(layer)) return Spectrogram;
214 if (dynamic_cast<const TimeRulerLayer *>(layer)) return TimeRuler; 214 if (dynamic_cast<const TimeRulerLayer *>(layer)) return TimeRuler;
215 if (dynamic_cast<const TimeInstantLayer *>(layer)) return TimeInstants; 215 if (dynamic_cast<const TimeInstantLayer *>(layer)) return TimeInstants;
216 if (dynamic_cast<const TimeValueLayer *>(layer)) return TimeValues; 216 if (dynamic_cast<const TimeValueLayer *>(layer)) return TimeValues;
217 if (dynamic_cast<const FlexiNoteLayer *>(layer)) return FlexiNotes; 217 if (dynamic_cast<const FlexiNoteLayer *>(layer)) return FlexiNotes;
218 if (dynamic_cast<const NoteLayer *>(layer)) return Notes; 218 if (dynamic_cast<const NoteLayer *>(layer)) return Notes;
219 if (dynamic_cast<const RegionLayer *>(layer)) return Regions; 219 if (dynamic_cast<const RegionLayer *>(layer)) return Regions;
220 if (dynamic_cast<const TextLayer *>(layer)) return Text; 220 if (dynamic_cast<const TextLayer *>(layer)) return Text;
221 if (dynamic_cast<const ImageLayer *>(layer)) return Image; 221 if (dynamic_cast<const ImageLayer *>(layer)) return Image;
222 if (dynamic_cast<const Colour3DPlotLayer *>(layer)) return Colour3DPlot; 222 if (dynamic_cast<const Colour3DPlotLayer *>(layer)) return Colour3DPlot;
233 case Spectrogram: return "spectrogram"; 233 case Spectrogram: return "spectrogram";
234 case TimeRuler: return "timeruler"; 234 case TimeRuler: return "timeruler";
235 case TimeInstants: return "instants"; 235 case TimeInstants: return "instants";
236 case TimeValues: return "values"; 236 case TimeValues: return "values";
237 case Notes: return "notes"; 237 case Notes: return "notes";
238 case FlexiNotes: return "flexinotes"; 238 case FlexiNotes: return "flexible notes";
239 case Regions: return "regions"; 239 case Regions: return "regions";
240 case Text: return "text"; 240 case Text: return "text";
241 case Image: return "image"; 241 case Image: return "image";
242 case Colour3DPlot: return "colour3d"; 242 case Colour3DPlot: return "colour3d";
243 case Spectrum: return "spectrum"; 243 case Spectrum: return "spectrum";
347 { 347 {
348 if (layerType == TimeInstants) { 348 if (layerType == TimeInstants) {
349 return new SparseOneDimensionalModel(baseModel->getSampleRate(), 1); 349 return new SparseOneDimensionalModel(baseModel->getSampleRate(), 1);
350 } else if (layerType == TimeValues) { 350 } else if (layerType == TimeValues) {
351 return new SparseTimeValueModel(baseModel->getSampleRate(), 1, true); 351 return new SparseTimeValueModel(baseModel->getSampleRate(), 1, true);
352 } else if (layerType == FlexiNotes) { 352 } else if (layerType == FlexiNotes) {
353 return new FlexiNoteModel(baseModel->getSampleRate(), 1, true); 353 return new FlexiNoteModel(baseModel->getSampleRate(), 1, true);
354 } else if (layerType == Notes) { 354 } else if (layerType == Notes) {
355 return new NoteModel(baseModel->getSampleRate(), 1, true); 355 return new NoteModel(baseModel->getSampleRate(), 1, true);
356 } else if (layerType == Regions) { 356 } else if (layerType == Regions) {
357 return new RegionModel(baseModel->getSampleRate(), 1, true); 357 return new RegionModel(baseModel->getSampleRate(), 1, true);