diff 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
line wrap: on
line diff
--- a/framework/MainWindowBase.cpp	Fri Mar 08 13:37:51 2019 +0000
+++ b/framework/MainWindowBase.cpp	Thu Mar 14 15:33:40 2019 +0000
@@ -22,7 +22,6 @@
 #include "data/model/WritableWaveFileModel.h"
 #include "data/model/SparseOneDimensionalModel.h"
 #include "data/model/NoteModel.h"
-#include "data/model/FlexiNoteModel.h"
 #include "data/model/Labeller.h"
 #include "data/model/TabularModel.h"
 #include "view/ViewManager.h"
@@ -1249,15 +1248,13 @@
 
     NoteModel *nm = dynamic_cast<NoteModel *>(layer->getModel());
     if (nm) {
-        NoteModel::Point point(alignedStart,
-                               nm->getValueMinimum(),
-                               alignedDuration,
-                               1.f,
-                               "");
-        NoteModel::EditCommand *command =
-            new NoteModel::EditCommand(nm, tr("Add Point"));
-        command->addPoint(point);
-        command->setName(name);
+        Event  point(alignedStart,
+                     nm->getValueMinimum(),
+                     alignedDuration,
+                     1.f,
+                     "");
+        NoteModel::EditCommand *command = new NoteModel::EditCommand(nm, name);
+        command->add(point);
         c = command->finish();
     }
 
@@ -1265,25 +1262,6 @@
         CommandHistory::getInstance()->addCommand(c, false);
         return;
     }
-
-    FlexiNoteModel *fnm = dynamic_cast<FlexiNoteModel *>(layer->getModel());
-    if (fnm) {
-        FlexiNoteModel::Point point(alignedStart,
-                                    fnm->getValueMinimum(),
-                                    alignedDuration,
-                                    1.f,
-                                    "");
-        FlexiNoteModel::EditCommand *command =
-            new FlexiNoteModel::EditCommand(fnm, tr("Add Point"));
-        command->addPoint(point);
-        command->setName(name);
-        c = command->finish();
-    }
-    
-    if (c) {
-        CommandHistory::getInstance()->addCommand(c, false);
-        return;
-    }
 }
 
 void