Mercurial > hg > svgui
changeset 621:e7352a4c0a05 tonioni
added references to new layer type FlexiNoteLayer and corresponding FlexiNoteModel
author | matthiasm |
---|---|
date | Tue, 26 Mar 2013 14:46:06 +0000 |
parents | fde7e2fae256 |
children | 765bb3774c4f |
files | layer/LayerFactory.cpp layer/layer.pro svgui.pro |
diffstat | 3 files changed, 25 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/layer/LayerFactory.cpp Tue Mar 26 14:15:42 2013 +0000 +++ b/layer/LayerFactory.cpp Tue Mar 26 14:46:06 2013 +0000 @@ -21,6 +21,7 @@ #include "TimeInstantLayer.h" #include "TimeValueLayer.h" #include "NoteLayer.h" +#include "FlexiNoteLayer.h" #include "RegionLayer.h" #include "TextLayer.h" #include "ImageLayer.h" @@ -36,6 +37,7 @@ #include "data/model/SparseOneDimensionalModel.h" #include "data/model/SparseTimeValueModel.h" #include "data/model/NoteModel.h" +#include "data/model/FlexiNoteModel.h" #include "data/model/RegionModel.h" #include "data/model/TextModel.h" #include "data/model/ImageModel.h" @@ -73,6 +75,7 @@ case TimeInstants: return Layer::tr("Time Instants"); case TimeValues: return Layer::tr("Time Values"); case Notes: return Layer::tr("Notes"); + case FlexiNotes: return Layer::tr("flexible Notes"); case Regions: return Layer::tr("Regions"); case Text: return Layer::tr("Text"); case Image: return Layer::tr("Images"); @@ -161,6 +164,10 @@ types.insert(Notes); } + if (dynamic_cast<FlexiNoteModel *>(model)) { + types.insert(FlexiNotes); + } + if (dynamic_cast<RegionModel *>(model)) { types.insert(Regions); } @@ -190,6 +197,7 @@ types.insert(TimeInstants); types.insert(TimeValues); types.insert(Notes); + types.insert(FlexiNotes); types.insert(Regions); types.insert(Text); types.insert(Image); @@ -206,6 +214,7 @@ if (dynamic_cast<const TimeInstantLayer *>(layer)) return TimeInstants; if (dynamic_cast<const TimeValueLayer *>(layer)) return TimeValues; if (dynamic_cast<const NoteLayer *>(layer)) return Notes; + if (dynamic_cast<const FlexiNoteLayer *>(layer)) return FlexiNotes; if (dynamic_cast<const RegionLayer *>(layer)) return Regions; if (dynamic_cast<const TextLayer *>(layer)) return Text; if (dynamic_cast<const ImageLayer *>(layer)) return Image; @@ -225,6 +234,7 @@ case TimeInstants: return "instants"; case TimeValues: return "values"; case Notes: return "notes"; + case FlexiNotes: return "flexible notes"; case Regions: return "regions"; case Text: return "text"; case Image: return "image"; @@ -247,6 +257,7 @@ case TimeInstants: return "timeinstants"; case TimeValues: return "timevalues"; case Notes: return "notes"; + case FlexiNotes: return "flexible notes"; case Regions: return "regions"; case Text: return "text"; case Image: return "image"; @@ -267,7 +278,7 @@ if (name == "timeruler") return TimeRuler; if (name == "timeinstants") return TimeInstants; if (name == "timevalues") return TimeValues; - if (name == "notes") return Notes; + if (name == "flexible notes") return FlexiNotes; if (name == "regions") return Regions; if (name == "text") return Text; if (name == "image") return Image; @@ -304,6 +315,9 @@ if (trySetModel<NoteLayer, NoteModel>(layer, model)) return; + if (trySetModel<FlexiNoteLayer, FlexiNoteModel>(layer, model)) + return; + if (trySetModel<RegionLayer, RegionModel>(layer, model)) return; @@ -335,6 +349,8 @@ return new SparseTimeValueModel(baseModel->getSampleRate(), 1, true); } else if (layerType == Notes) { return new NoteModel(baseModel->getSampleRate(), 1, true); + } else if (layerType == FlexiNotes) { + return new NoteModel(baseModel->getSampleRate(), 1, true); } else if (layerType == Regions) { return new RegionModel(baseModel->getSampleRate(), 1, true); } else if (layerType == Text) { @@ -406,6 +422,10 @@ layer = new NoteLayer; break; + case FlexiNotes: + layer = new FlexiNoteLayer; + break; + case Regions: layer = new RegionLayer; break;
--- a/layer/layer.pro Tue Mar 26 14:15:42 2013 +0000 +++ b/layer/layer.pro Tue Mar 26 14:46:06 2013 +0000 @@ -22,6 +22,7 @@ Layer.h \ LayerFactory.h \ NoteLayer.h \ + FlexiNoteLayer.h \ PaintAssistant.h \ RegionLayer.h \ SingleColourLayer.h \ @@ -42,6 +43,7 @@ Layer.cpp \ LayerFactory.cpp \ NoteLayer.cpp \ + FlexiNoteLayer.cpp \ PaintAssistant.cpp \ RegionLayer.cpp \ SingleColourLayer.cpp \
--- a/svgui.pro Tue Mar 26 14:15:42 2013 +0000 +++ b/svgui.pro Tue Mar 26 14:46:06 2013 +0000 @@ -21,6 +21,7 @@ layer/Layer.h \ layer/LayerFactory.h \ layer/NoteLayer.h \ + layer/FlexiNoteLayer.h \ layer/PaintAssistant.h \ layer/RegionLayer.h \ layer/SingleColourLayer.h \ @@ -41,6 +42,7 @@ layer/Layer.cpp \ layer/LayerFactory.cpp \ layer/NoteLayer.cpp \ + layer/FlexiNoteLayer.cpp \ layer/PaintAssistant.cpp \ layer/RegionLayer.cpp \ layer/SingleColourLayer.cpp \