comparison framework/MainWindowBase.cpp @ 646:3168deb50199 single-point

Updates for single-point changes, including removal of FlexiNoteModel
author Chris Cannam
date Thu, 14 Mar 2019 15:33:40 +0000
parents 6fd0ebfd2bbe
children 25554f7a5b0d
comparison
equal deleted inserted replaced
645:6240788893e7 646:3168deb50199
20 #include "view/PaneStack.h" 20 #include "view/PaneStack.h"
21 #include "data/model/ReadOnlyWaveFileModel.h" 21 #include "data/model/ReadOnlyWaveFileModel.h"
22 #include "data/model/WritableWaveFileModel.h" 22 #include "data/model/WritableWaveFileModel.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"
26 #include "data/model/Labeller.h" 25 #include "data/model/Labeller.h"
27 #include "data/model/TabularModel.h" 26 #include "data/model/TabularModel.h"
28 #include "view/ViewManager.h" 27 #include "view/ViewManager.h"
29 28
30 #include "layer/WaveformLayer.h" 29 #include "layer/WaveformLayer.h"
1247 return; 1246 return;
1248 } 1247 }
1249 1248
1250 NoteModel *nm = dynamic_cast<NoteModel *>(layer->getModel()); 1249 NoteModel *nm = dynamic_cast<NoteModel *>(layer->getModel());
1251 if (nm) { 1250 if (nm) {
1252 NoteModel::Point point(alignedStart, 1251 Event point(alignedStart,
1253 nm->getValueMinimum(), 1252 nm->getValueMinimum(),
1254 alignedDuration, 1253 alignedDuration,
1255 1.f, 1254 1.f,
1256 ""); 1255 "");
1257 NoteModel::EditCommand *command = 1256 NoteModel::EditCommand *command = new NoteModel::EditCommand(nm, name);
1258 new NoteModel::EditCommand(nm, tr("Add Point")); 1257 command->add(point);
1259 command->addPoint(point);
1260 command->setName(name);
1261 c = command->finish(); 1258 c = command->finish();
1262 } 1259 }
1263 1260
1264 if (c) {
1265 CommandHistory::getInstance()->addCommand(c, false);
1266 return;
1267 }
1268
1269 FlexiNoteModel *fnm = dynamic_cast<FlexiNoteModel *>(layer->getModel());
1270 if (fnm) {
1271 FlexiNoteModel::Point point(alignedStart,
1272 fnm->getValueMinimum(),
1273 alignedDuration,
1274 1.f,
1275 "");
1276 FlexiNoteModel::EditCommand *command =
1277 new FlexiNoteModel::EditCommand(fnm, tr("Add Point"));
1278 command->addPoint(point);
1279 command->setName(name);
1280 c = command->finish();
1281 }
1282
1283 if (c) { 1261 if (c) {
1284 CommandHistory::getInstance()->addCommand(c, false); 1262 CommandHistory::getInstance()->addCommand(c, false);
1285 return; 1263 return;
1286 } 1264 }
1287 } 1265 }