# HG changeset patch # User Chris Cannam # Date 1480073960 0 # Node ID ffc3daf092ddddd1fb74a3cb2c8d93b4301cee5b # Parent e83df965c56cc83868323c9e9b734f493e556a80# Parent 5b639a383e58001b8c425ea0ef628ed54037ccd0 Merge diff -r e83df965c56c -r ffc3daf092dd .hgsubstate --- a/.hgsubstate Fri Nov 25 11:38:37 2016 +0000 +++ b/.hgsubstate Fri Nov 25 11:39:20 2016 +0000 @@ -7,7 +7,7 @@ 68ae618c6b0e442d08a71d39217784a08f2a8de3 icons/scalable 3257ddb6fff110cc88f3ffeaeefa0f29d5eb3b6f piper-cpp e1712f7d74a455337591091a57beba2f0443b9dd sv-dependency-builds -36aa947ec9629108da8abe39b37fb97c1e989514 svapp +630c4a9885cac11c40ee4907f4e7cde612a8e988 svapp 5cc969b236b0c71dbb44be44c9756264e6c16a82 svcore 958e352919a587f0e9702b0d43f5667b8167e71c svgui 0eebd22a081a824067bf3d5de65326696feab653 vamp-plugin-sdk diff -r e83df965c56c -r ffc3daf092dd main/MainWindow.cpp --- a/main/MainWindow.cpp Fri Nov 25 11:38:37 2016 +0000 +++ b/main/MainWindow.cpp Fri Nov 25 11:39:20 2016 +0000 @@ -842,6 +842,20 @@ connect(this, SIGNAL(canRenumberInstants(bool)), action, SLOT(setEnabled(bool))); // m_keyReference->registerShortcut(action); menu->addAction(action); + + menu->addSeparator(); + + action = new QAction(tr("Subdivide Selected Instants..."), this); + action->setStatusTip(tr("Add new instants at regular intervals between the selected instants")); + connect(action, SIGNAL(triggered()), this, SLOT(subdivideInstants())); + connect(this, SIGNAL(canSubdivideInstants(bool)), action, SLOT(setEnabled(bool))); + menu->addAction(action); + + action = new QAction(tr("Winnow Selected Instants..."), this); + action->setStatusTip(tr("Remove subdivisions, leaving only every Nth instant")); + connect(action, SIGNAL(triggered()), this, SLOT(winnowInstants())); + connect(this, SIGNAL(canWinnowInstants(bool)), action, SLOT(setEnabled(bool))); + menu->addAction(action); } void @@ -4392,6 +4406,50 @@ } void +MainWindow::subdivideInstants() +{ + QSettings settings; + settings.beginGroup("MainWindow"); + int n = settings.value("subdivisions", 4).toInt(); + + bool ok; + + n = QInputDialog::getInt(this, + tr("Subdivide instants"), + tr("Number of subdivisions:"), + n, 2, 96, 1, &ok); + + if (ok) { + settings.setValue("subdivisions", n); + subdivideInstantsBy(n); + } + + settings.endGroup(); +} + +void +MainWindow::winnowInstants() +{ + QSettings settings; + settings.beginGroup("MainWindow"); + int n = settings.value("winnow-subdivisions", 4).toInt(); + + bool ok; + + n = QInputDialog::getInt(this, + tr("Winnow instants"), + tr("Remove all instants apart from multiples of:"), + n, 2, 96, 1, &ok); + + if (ok) { + settings.setValue("winnow-subdivisions", n); + winnowInstantsBy(n); + } + + settings.endGroup(); +} + +void MainWindow::modelGenerationFailed(QString transformName, QString message) { emit hideSplash(); diff -r e83df965c56c -r ffc3daf092dd main/MainWindow.h --- a/main/MainWindow.h Fri Nov 25 11:38:37 2016 +0000 +++ b/main/MainWindow.h Fri Nov 25 11:39:20 2016 +0000 @@ -90,6 +90,8 @@ virtual void setInstantsCounterCycle(); virtual void setInstantsCounters(); virtual void resetInstantsCounters(); + virtual void subdivideInstants(); + virtual void winnowInstants(); virtual void modelGenerationFailed(QString, QString); virtual void modelGenerationWarning(QString, QString);