comparison framework/MainWindowBase.cpp @ 267:98993f4904df tonioni

added references to new FlexiNote layer and model
author matthiasm
date Tue, 26 Mar 2013 14:47:08 +0000
parents 7ee215c095dd
children 1f8251b3ad5d
comparison
equal deleted inserted replaced
266:7b11d68cf143 267:98993f4904df
20 #include "view/Pane.h" 20 #include "view/Pane.h"
21 #include "view/PaneStack.h" 21 #include "view/PaneStack.h"
22 #include "data/model/WaveFileModel.h" 22 #include "data/model/WaveFileModel.h"
23 #include "data/model/SparseOneDimensionalModel.h" 23 #include "data/model/SparseOneDimensionalModel.h"
24 #include "data/model/NoteModel.h" 24 #include "data/model/NoteModel.h"
25 #include "data/model/FlexiNoteModel.h"
25 #include "data/model/Labeller.h" 26 #include "data/model/Labeller.h"
26 #include "data/model/TabularModel.h" 27 #include "data/model/TabularModel.h"
27 #include "view/ViewManager.h" 28 #include "view/ViewManager.h"
28 29
29 #include "layer/WaveformLayer.h" 30 #include "layer/WaveformLayer.h"
33 #include "layer/Colour3DPlotLayer.h" 34 #include "layer/Colour3DPlotLayer.h"
34 #include "layer/SliceLayer.h" 35 #include "layer/SliceLayer.h"
35 #include "layer/SliceableLayer.h" 36 #include "layer/SliceableLayer.h"
36 #include "layer/ImageLayer.h" 37 #include "layer/ImageLayer.h"
37 #include "layer/NoteLayer.h" 38 #include "layer/NoteLayer.h"
39 #include "layer/FlexiNoteLayer.h"
38 #include "layer/RegionLayer.h" 40 #include "layer/RegionLayer.h"
39 41
40 #include "widgets/ListInputDialog.h" 42 #include "widgets/ListInputDialog.h"
41 #include "widgets/CommandHistory.h" 43 #include "widgets/CommandHistory.h"
42 #include "widgets/ProgressDialog.h" 44 #include "widgets/ProgressDialog.h"
422 (haveCurrentLayer && 424 (haveCurrentLayer &&
423 dynamic_cast<TimeInstantLayer *>(currentLayer)); 425 dynamic_cast<TimeInstantLayer *>(currentLayer));
424 bool haveCurrentDurationLayer = 426 bool haveCurrentDurationLayer =
425 (haveCurrentLayer && 427 (haveCurrentLayer &&
426 (dynamic_cast<NoteLayer *>(currentLayer) || 428 (dynamic_cast<NoteLayer *>(currentLayer) ||
429 dynamic_cast<FlexiNoteLayer *>(currentLayer) ||
427 dynamic_cast<RegionLayer *>(currentLayer))); 430 dynamic_cast<RegionLayer *>(currentLayer)));
428 bool haveCurrentColour3DPlot = 431 bool haveCurrentColour3DPlot =
429 (haveCurrentLayer && 432 (haveCurrentLayer &&
430 dynamic_cast<Colour3DPlotLayer *>(currentLayer)); 433 dynamic_cast<Colour3DPlotLayer *>(currentLayer));
431 bool haveClipboardContents = 434 bool haveClipboardContents =
1006 1009
1007 if (c) { 1010 if (c) {
1008 CommandHistory::getInstance()->addCommand(c, false); 1011 CommandHistory::getInstance()->addCommand(c, false);
1009 return; 1012 return;
1010 } 1013 }
1014
1015 FlexiNoteModel *nm = dynamic_cast<FlexiNoteModel *>(layer->getModel());
1016 if (nm) {
1017 FlexiNoteModel::Point point(alignedStart,
1018 rm->getValueMinimum(),
1019 alignedDuration,
1020 1.f,
1021 "");
1022 FlexiNoteModel::EditCommand *command =
1023 new FlexiNoteModel::EditCommand(nm, tr("Add Point"));
1024 command->addPoint(point);
1025 command->setName(name);
1026 c = command->finish();
1027 }
1028
1029 if (c) {
1030 CommandHistory::getInstance()->addCommand(c, false);
1031 return;
1032 }
1011 } 1033 }
1012 1034
1013 void 1035 void
1014 MainWindowBase::renumberInstants() 1036 MainWindowBase::renumberInstants()
1015 { 1037 {