changeset 648:eec0c50bb44f single-point

Update following RegionModel API change
author Chris Cannam
date Fri, 15 Mar 2019 14:24:46 +0000
parents 25554f7a5b0d
children 284cb118368e
files framework/MainWindowBase.cpp framework/SVFileReader.cpp
diffstat 2 files changed, 12 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/framework/MainWindowBase.cpp	Fri Mar 15 11:09:34 2019 +0000
+++ b/framework/MainWindowBase.cpp	Fri Mar 15 14:24:46 2019 +0000
@@ -1230,14 +1230,12 @@
 
     RegionModel *rm = dynamic_cast<RegionModel *>(layer->getModel());
     if (rm) {
-        RegionModel::Point point(alignedStart,
-                                 rm->getValueMaximum() + 1,
-                                 alignedDuration,
-                                 "");
-        RegionModel::EditCommand *command =
-            new RegionModel::EditCommand(rm, tr("Add Point"));
-        command->addPoint(point);
-        command->setName(name);
+        Event point(alignedStart,
+                    rm->getValueMaximum() + 1,
+                    alignedDuration,
+                    "");
+        ChangeEventsCommand *command = new ChangeEventsCommand(rm, name);
+        command->add(point);
         c = command->finish();
     }
 
@@ -1248,11 +1246,11 @@
 
     NoteModel *nm = dynamic_cast<NoteModel *>(layer->getModel());
     if (nm) {
-        Event  point(alignedStart,
-                     nm->getValueMinimum(),
-                     alignedDuration,
-                     1.f,
-                     "");
+        Event point(alignedStart,
+                    nm->getValueMinimum(),
+                    alignedDuration,
+                    1.f,
+                    "");
         ChangeEventsCommand *command = new ChangeEventsCommand(nm, name);
         command->add(point);
         c = command->finish();
--- a/framework/SVFileReader.cpp	Fri Mar 15 11:09:34 2019 +0000
+++ b/framework/SVFileReader.cpp	Fri Mar 15 14:24:46 2019 +0000
@@ -1129,7 +1129,7 @@
         int duration = 0;
         duration = attributes.value("duration").trimmed().toInt(&ok);
         QString label = attributes.value("label");
-        rm->addPoint(RegionModel::Point(frame, value, duration, label));
+        rm->add(Event(frame, value, duration, label));
         return ok;
     }