# HG changeset patch # User Chris Cannam # Date 1480066733 0 # Node ID 86cd0e81ed07a60cc55b57f0f63757b6077000f5 # Parent ae68ebb5fbe83248f9dac9c3f54c14a39aadbe79 Implement "Subdivide Selected Instants". Also add the relabel command to the history, which I previously forgot to do! diff -r ae68ebb5fbe8 -r 86cd0e81ed07 .hgsubstate --- a/.hgsubstate Thu Nov 24 17:10:40 2016 +0000 +++ b/.hgsubstate Fri Nov 25 09:38:53 2016 +0000 @@ -7,7 +7,7 @@ 68ae618c6b0e442d08a71d39217784a08f2a8de3 icons/scalable 3257ddb6fff110cc88f3ffeaeefa0f29d5eb3b6f piper-cpp e1712f7d74a455337591091a57beba2f0443b9dd sv-dependency-builds -36aa947ec9629108da8abe39b37fb97c1e989514 svapp -fa574c909c3db7dc9ef6f2294e100315553b0498 svcore +dd195633fc9fd3735dcf49fb71c9d881ad55e1ce svapp +22f66068b464abca422ba876d42ef08c9477de86 svcore 958e352919a587f0e9702b0d43f5667b8167e71c svgui 0eebd22a081a824067bf3d5de65326696feab653 vamp-plugin-sdk diff -r ae68ebb5fbe8 -r 86cd0e81ed07 main/MainWindow.cpp --- a/main/MainWindow.cpp Thu Nov 24 17:10:40 2016 +0000 +++ b/main/MainWindow.cpp Fri Nov 25 09:38:53 2016 +0000 @@ -842,6 +842,12 @@ connect(this, SIGNAL(canRenumberInstants(bool)), action, SLOT(setEnabled(bool))); // m_keyReference->registerShortcut(action); menu->addAction(action); + + 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); } void @@ -4392,6 +4398,28 @@ } 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::modelGenerationFailed(QString transformName, QString message) { emit hideSplash(); diff -r ae68ebb5fbe8 -r 86cd0e81ed07 main/MainWindow.h --- a/main/MainWindow.h Thu Nov 24 17:10:40 2016 +0000 +++ b/main/MainWindow.h Fri Nov 25 09:38:53 2016 +0000 @@ -90,6 +90,7 @@ virtual void setInstantsCounterCycle(); virtual void setInstantsCounters(); virtual void resetInstantsCounters(); + virtual void subdivideInstants(); virtual void modelGenerationFailed(QString, QString); virtual void modelGenerationWarning(QString, QString);