Mercurial > hg > svgui
comparison layer/LayerFactory.cpp @ 1513:0586e6492785 time-frequency-boxes
Shorten name (Boxes -> Box)
author | Chris Cannam |
---|---|
date | Fri, 20 Sep 2019 11:25:22 +0100 |
parents | 0fa155b84bac |
children | e4629d449688 |
comparison
equal
deleted
inserted
replaced
1512:0fa155b84bac | 1513:0586e6492785 |
---|---|
76 case TimeInstants: return Layer::tr("Time Instants"); | 76 case TimeInstants: return Layer::tr("Time Instants"); |
77 case TimeValues: return Layer::tr("Time Values"); | 77 case TimeValues: return Layer::tr("Time Values"); |
78 case Notes: return Layer::tr("Notes"); | 78 case Notes: return Layer::tr("Notes"); |
79 case FlexiNotes: return Layer::tr("Flexible Notes"); | 79 case FlexiNotes: return Layer::tr("Flexible Notes"); |
80 case Regions: return Layer::tr("Regions"); | 80 case Regions: return Layer::tr("Regions"); |
81 case TimeFrequencyBoxes: return Layer::tr("Time-Frequency Boxes"); | 81 case TimeFrequencyBox: return Layer::tr("Time-Frequency Box"); |
82 case Text: return Layer::tr("Text"); | 82 case Text: return Layer::tr("Text"); |
83 case Image: return Layer::tr("Images"); | 83 case Image: return Layer::tr("Images"); |
84 case Colour3DPlot: return Layer::tr("Colour 3D Plot"); | 84 case Colour3DPlot: return Layer::tr("Colour 3D Plot"); |
85 case Spectrum: return Layer::tr("Spectrum"); | 85 case Spectrum: return Layer::tr("Spectrum"); |
86 case Slice: return Layer::tr("Time Slice"); | 86 case Slice: return Layer::tr("Time Slice"); |
175 if (ModelById::getAs<RegionModel>(modelId)) { | 175 if (ModelById::getAs<RegionModel>(modelId)) { |
176 types.insert(Regions); | 176 types.insert(Regions); |
177 } | 177 } |
178 | 178 |
179 if (ModelById::getAs<TimeFrequencyBoxModel>(modelId)) { | 179 if (ModelById::getAs<TimeFrequencyBoxModel>(modelId)) { |
180 types.insert(TimeFrequencyBoxes); | 180 types.insert(TimeFrequencyBox); |
181 } | 181 } |
182 | 182 |
183 if (ModelById::getAs<TextModel>(modelId)) { | 183 if (ModelById::getAs<TextModel>(modelId)) { |
184 types.insert(Text); | 184 types.insert(Text); |
185 } | 185 } |
208 // to show in a menu -- it should not contain FlexiNotes; the | 208 // to show in a menu -- it should not contain FlexiNotes; the |
209 // layer isn't meaningfully editable in SV | 209 // layer isn't meaningfully editable in SV |
210 // types.insert(FlexiNotes); | 210 // types.insert(FlexiNotes); |
211 types.insert(Notes); | 211 types.insert(Notes); |
212 types.insert(Regions); | 212 types.insert(Regions); |
213 types.insert(TimeFrequencyBoxes); | 213 types.insert(TimeFrequencyBox); |
214 types.insert(Text); | 214 types.insert(Text); |
215 types.insert(Image); | 215 types.insert(Image); |
216 //!!! and in principle Colour3DPlot -- now that's a challenge | 216 //!!! and in principle Colour3DPlot -- now that's a challenge |
217 return types; | 217 return types; |
218 } | 218 } |
226 if (dynamic_cast<const TimeInstantLayer *>(layer)) return TimeInstants; | 226 if (dynamic_cast<const TimeInstantLayer *>(layer)) return TimeInstants; |
227 if (dynamic_cast<const TimeValueLayer *>(layer)) return TimeValues; | 227 if (dynamic_cast<const TimeValueLayer *>(layer)) return TimeValues; |
228 if (dynamic_cast<const FlexiNoteLayer *>(layer)) return FlexiNotes; | 228 if (dynamic_cast<const FlexiNoteLayer *>(layer)) return FlexiNotes; |
229 if (dynamic_cast<const NoteLayer *>(layer)) return Notes; | 229 if (dynamic_cast<const NoteLayer *>(layer)) return Notes; |
230 if (dynamic_cast<const RegionLayer *>(layer)) return Regions; | 230 if (dynamic_cast<const RegionLayer *>(layer)) return Regions; |
231 if (dynamic_cast<const TimeFrequencyBoxLayer *>(layer)) return TimeFrequencyBoxes; | 231 if (dynamic_cast<const TimeFrequencyBoxLayer *>(layer)) return TimeFrequencyBox; |
232 if (dynamic_cast<const TextLayer *>(layer)) return Text; | 232 if (dynamic_cast<const TextLayer *>(layer)) return Text; |
233 if (dynamic_cast<const ImageLayer *>(layer)) return Image; | 233 if (dynamic_cast<const ImageLayer *>(layer)) return Image; |
234 if (dynamic_cast<const Colour3DPlotLayer *>(layer)) return Colour3DPlot; | 234 if (dynamic_cast<const Colour3DPlotLayer *>(layer)) return Colour3DPlot; |
235 if (dynamic_cast<const SpectrumLayer *>(layer)) return Spectrum; | 235 if (dynamic_cast<const SpectrumLayer *>(layer)) return Spectrum; |
236 if (dynamic_cast<const SliceLayer *>(layer)) return Slice; | 236 if (dynamic_cast<const SliceLayer *>(layer)) return Slice; |
247 case TimeInstants: return "instants"; | 247 case TimeInstants: return "instants"; |
248 case TimeValues: return "values"; | 248 case TimeValues: return "values"; |
249 case Notes: return "notes"; | 249 case Notes: return "notes"; |
250 case FlexiNotes: return "flexinotes"; | 250 case FlexiNotes: return "flexinotes"; |
251 case Regions: return "regions"; | 251 case Regions: return "regions"; |
252 case TimeFrequencyBoxes: return "timefrequencyboxes"; | 252 case TimeFrequencyBox: return "timefrequencybox"; |
253 case Text: return "text"; | 253 case Text: return "text"; |
254 case Image: return "image"; | 254 case Image: return "image"; |
255 case Colour3DPlot: return "colour3d"; | 255 case Colour3DPlot: return "colour3d"; |
256 case Spectrum: return "spectrum"; | 256 case Spectrum: return "spectrum"; |
257 case Slice: return "spectrum"; | 257 case Slice: return "spectrum"; |
274 case TimeInstants: return "timeinstants"; | 274 case TimeInstants: return "timeinstants"; |
275 case TimeValues: return "timevalues"; | 275 case TimeValues: return "timevalues"; |
276 case Notes: return "notes"; | 276 case Notes: return "notes"; |
277 case FlexiNotes: return "flexinotes"; | 277 case FlexiNotes: return "flexinotes"; |
278 case Regions: return "regions"; | 278 case Regions: return "regions"; |
279 case TimeFrequencyBoxes: return "timefrequencyboxes"; | 279 case TimeFrequencyBox: return "timefrequencybox"; |
280 case Text: return "text"; | 280 case Text: return "text"; |
281 case Image: return "image"; | 281 case Image: return "image"; |
282 case Colour3DPlot: return "colour3dplot"; | 282 case Colour3DPlot: return "colour3dplot"; |
283 case Spectrum: return "spectrum"; | 283 case Spectrum: return "spectrum"; |
284 case Slice: return "slice"; | 284 case Slice: return "slice"; |
300 if (name == "timeinstants") return TimeInstants; | 300 if (name == "timeinstants") return TimeInstants; |
301 if (name == "timevalues") return TimeValues; | 301 if (name == "timevalues") return TimeValues; |
302 if (name == "notes") return Notes; | 302 if (name == "notes") return Notes; |
303 if (name == "flexinotes") return FlexiNotes; | 303 if (name == "flexinotes") return FlexiNotes; |
304 if (name == "regions") return Regions; | 304 if (name == "regions") return Regions; |
305 if (name == "timefrequencyboxes") return TimeFrequencyBoxes; | 305 if (name == "timefrequencybox") return TimeFrequencyBox; |
306 if (name == "text") return Text; | 306 if (name == "text") return Text; |
307 if (name == "image") return Image; | 307 if (name == "image") return Image; |
308 if (name == "colour3dplot") return Colour3DPlot; | 308 if (name == "colour3dplot") return Colour3DPlot; |
309 if (name == "spectrum") return Spectrum; | 309 if (name == "spectrum") return Spectrum; |
310 if (name == "slice") return Slice; | 310 if (name == "slice") return Slice; |
373 return std::make_shared<NoteModel>(rate, 1, true); | 373 return std::make_shared<NoteModel>(rate, 1, true); |
374 } else if (layerType == Notes) { | 374 } else if (layerType == Notes) { |
375 return std::make_shared<NoteModel>(rate, 1, true); | 375 return std::make_shared<NoteModel>(rate, 1, true); |
376 } else if (layerType == Regions) { | 376 } else if (layerType == Regions) { |
377 return std::make_shared<RegionModel>(rate, 1, true); | 377 return std::make_shared<RegionModel>(rate, 1, true); |
378 } else if (layerType == TimeFrequencyBoxes) { | 378 } else if (layerType == TimeFrequencyBox) { |
379 return std::make_shared<TimeFrequencyBoxModel>(rate, 1, true); | 379 return std::make_shared<TimeFrequencyBoxModel>(rate, 1, true); |
380 } else if (layerType == Text) { | 380 } else if (layerType == Text) { |
381 return std::make_shared<TextModel>(rate, 1, true); | 381 return std::make_shared<TextModel>(rate, 1, true); |
382 } else if (layerType == Image) { | 382 } else if (layerType == Image) { |
383 return std::make_shared<ImageModel>(rate, 1, true); | 383 return std::make_shared<ImageModel>(rate, 1, true); |
452 | 452 |
453 case Regions: | 453 case Regions: |
454 layer = new RegionLayer; | 454 layer = new RegionLayer; |
455 break; | 455 break; |
456 | 456 |
457 case TimeFrequencyBoxes: | 457 case TimeFrequencyBox: |
458 layer = new TimeFrequencyBoxLayer; | 458 layer = new TimeFrequencyBoxLayer; |
459 break; | 459 break; |
460 | 460 |
461 case Text: | 461 case Text: |
462 layer = new TextLayer; | 462 layer = new TextLayer; |