Mercurial > hg > svapp
comparison framework/MainWindowBase.cpp @ 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 |
comparison
equal
deleted
inserted
replaced
647:25554f7a5b0d | 648:eec0c50bb44f |
---|---|
1228 Layer *layer = pane->getSelectedLayer(); | 1228 Layer *layer = pane->getSelectedLayer(); |
1229 if (!layer) return; | 1229 if (!layer) return; |
1230 | 1230 |
1231 RegionModel *rm = dynamic_cast<RegionModel *>(layer->getModel()); | 1231 RegionModel *rm = dynamic_cast<RegionModel *>(layer->getModel()); |
1232 if (rm) { | 1232 if (rm) { |
1233 RegionModel::Point point(alignedStart, | 1233 Event point(alignedStart, |
1234 rm->getValueMaximum() + 1, | 1234 rm->getValueMaximum() + 1, |
1235 alignedDuration, | 1235 alignedDuration, |
1236 ""); | 1236 ""); |
1237 RegionModel::EditCommand *command = | 1237 ChangeEventsCommand *command = new ChangeEventsCommand(rm, name); |
1238 new RegionModel::EditCommand(rm, tr("Add Point")); | 1238 command->add(point); |
1239 command->addPoint(point); | |
1240 command->setName(name); | |
1241 c = command->finish(); | 1239 c = command->finish(); |
1242 } | 1240 } |
1243 | 1241 |
1244 if (c) { | 1242 if (c) { |
1245 CommandHistory::getInstance()->addCommand(c, false); | 1243 CommandHistory::getInstance()->addCommand(c, false); |
1246 return; | 1244 return; |
1247 } | 1245 } |
1248 | 1246 |
1249 NoteModel *nm = dynamic_cast<NoteModel *>(layer->getModel()); | 1247 NoteModel *nm = dynamic_cast<NoteModel *>(layer->getModel()); |
1250 if (nm) { | 1248 if (nm) { |
1251 Event point(alignedStart, | 1249 Event point(alignedStart, |
1252 nm->getValueMinimum(), | 1250 nm->getValueMinimum(), |
1253 alignedDuration, | 1251 alignedDuration, |
1254 1.f, | 1252 1.f, |
1255 ""); | 1253 ""); |
1256 ChangeEventsCommand *command = new ChangeEventsCommand(nm, name); | 1254 ChangeEventsCommand *command = new ChangeEventsCommand(nm, name); |
1257 command->add(point); | 1255 command->add(point); |
1258 c = command->finish(); | 1256 c = command->finish(); |
1259 } | 1257 } |
1260 | 1258 |