# HG changeset patch # User Chris Cannam # Date 1563368459 -3600 # Node ID b5000a78249a90dbb7f6a6ee2696850062012a83 # Parent 3c5dc95bea91319763e4d97ed51b8edb1e32ce0b Fix up labelling commands diff -r 3c5dc95bea91 -r b5000a78249a framework/MainWindowBase.cpp --- a/framework/MainWindowBase.cpp Wed Jul 17 13:28:37 2019 +0100 +++ b/framework/MainWindowBase.cpp Wed Jul 17 14:00:59 2019 +0100 @@ -1352,8 +1352,10 @@ if (!layer) return; MultiSelection ms(m_viewManager->getSelection()); + + ModelId modelId = layer->getModel(); - auto sodm = ModelById::getAs(layer->getModel()); + auto sodm = ModelById::getAs(modelId); if (!sodm) return; if (!m_labeller) return; @@ -1361,10 +1363,8 @@ Labeller labeller(*m_labeller); labeller.setSampleRate(sodm->getSampleRate()); - /*!!! - Command *c = labeller.labelAll(sodm->getId().untyped, &ms); + Command *c = labeller.labelAll(modelId.untyped, &ms, sodm->getAllEvents()); if (c) CommandHistory::getInstance()->addCommand(c, false); -*/ } void @@ -1377,8 +1377,10 @@ if (!layer) return; MultiSelection ms(m_viewManager->getSelection()); + + ModelId modelId = layer->getModel(); - auto sodm = ModelById::getAs(layer->getModel()); + auto sodm = ModelById::getAs(modelId); if (!sodm) return; if (!m_labeller) return; @@ -1386,11 +1388,8 @@ Labeller labeller(*m_labeller); labeller.setSampleRate(sodm->getSampleRate()); - (void)n; - /*!!! - Command *c = labeller.subdivide(sodm->getId().untyped, &ms, n); + Command *c = labeller.subdivide(modelId.untyped, &ms, sodm->getAllEvents(), n); if (c) CommandHistory::getInstance()->addCommand(c, false); - */ } void @@ -1403,8 +1402,10 @@ if (!layer) return; MultiSelection ms(m_viewManager->getSelection()); + + ModelId modelId = layer->getModel(); - auto sodm = ModelById::getAs(layer->getModel()); + auto sodm = ModelById::getAs(modelId); if (!sodm) return; if (!m_labeller) return; @@ -1412,12 +1413,8 @@ Labeller labeller(*m_labeller); labeller.setSampleRate(sodm->getSampleRate()); - (void)n; - //!!! to update: (and the above two functions) - /* - Command *c = labeller.winnow(sodm->getId.untyped, &ms, n); + Command *c = labeller.winnow(modelId.untyped, &ms, sodm->getAllEvents(), n); if (c) CommandHistory::getInstance()->addCommand(c, false); - */ } MainWindowBase::FileOpenStatus