# HG changeset patch # User Chris Cannam # Date 1196084024 0 # Node ID e6b581c7c246a2820ef192e53f692e78ba5a914f # Parent 69f83e36b8e59ae243d73b3c7a0b5460ee341b82 * Add support for Rubber Band timestretcher diff -r 69f83e36b8e5 -r e6b581c7c246 main/MainWindow.cpp --- a/main/MainWindow.cpp Fri Nov 23 16:48:23 2007 +0000 +++ b/main/MainWindow.cpp Mon Nov 26 13:33:44 2007 +0000 @@ -230,6 +230,7 @@ connect(m_playSharpen, SIGNAL(mouseEntered()), this, SLOT(mouseEnteredWidget())); connect(m_playSharpen, SIGNAL(mouseLeft()), this, SLOT(mouseLeftWidget())); +#ifndef HAVE_RUBBERBAND m_playMono = new NotifyingPushButton(frame); m_playMono->setToolTip(tr("Run time stretcher in mono only")); m_playMono->setFixedSize(20, 20); @@ -240,11 +241,14 @@ connect(m_playMono, SIGNAL(clicked()), this, SLOT(playMonoToggled())); connect(m_playMono, SIGNAL(mouseEntered()), this, SLOT(mouseEnteredWidget())); connect(m_playMono, SIGNAL(mouseLeft()), this, SLOT(mouseLeftWidget())); +#endif QSettings settings; settings.beginGroup("MainWindow"); m_playSharpen->setChecked(settings.value("playsharpen", true).toBool()); +#ifndef HAVE_RUBBERBAND m_playMono->setChecked(settings.value("playmono", false).toBool()); +#endif settings.endGroup(); layout->setSpacing(4); @@ -253,11 +257,16 @@ layout->addWidget(m_fader, 1, 1); layout->addWidget(m_playSpeed, 1, 2); layout->addWidget(m_playSharpen, 1, 3); +#ifndef HAVE_RUBBERBAND layout->addWidget(m_playMono, 1, 4); +#endif m_paneStack->setPropertyStackMinWidth - (m_fader->width() + m_playSpeed->width() + m_playSharpen->width() + - m_playMono->width() + layout->spacing() * 4); + (m_fader->width() + m_playSpeed->width() + m_playSharpen->width() +#ifndef HAVE_RUBBERBAND + + m_playMono->width() +#endif + + layout->spacing() * 4); layout->setColumnStretch(0, 10); @@ -2995,9 +3004,15 @@ } m_playSharpen->setEnabled(something); + bool sharpen = (something && m_playSharpen->isChecked()); + +#ifdef HAVE_RUBBERBAND + bool mono = false; +#else m_playMono->setEnabled(something); - bool sharpen = (something && m_playSharpen->isChecked()); bool mono = (something && m_playMono->isChecked()); +#endif + m_playSource->setTimeStretch(factor, sharpen, mono); updateMenuStates(); @@ -3014,6 +3029,7 @@ playSpeedChanged(m_playSpeed->value()); } +#ifndef HAVE_RUBBERBAND void MainWindow::playMonoToggled() { @@ -3024,6 +3040,7 @@ playSpeedChanged(m_playSpeed->value()); } +#endif void MainWindow::speedUpPlayback() @@ -3288,8 +3305,10 @@ contextHelpChanged(tr("Adjust the master playback speed")); } else if (w == m_playSharpen && w->isEnabled()) { contextHelpChanged(tr("Toggle transient sharpening for playback time scaling")); +#ifndef HAVE_RUBBERBAND } else if (w == m_playMono && w->isEnabled()) { contextHelpChanged(tr("Toggle mono mode for playback time scaling")); +#endif } } diff -r 69f83e36b8e5 -r e6b581c7c246 main/MainWindow.h --- a/main/MainWindow.h Fri Nov 23 16:48:23 2007 +0000 +++ b/main/MainWindow.h Mon Nov 26 13:33:44 2007 +0000 @@ -132,7 +132,9 @@ virtual void playSpeedChanged(int); virtual void playSharpenToggled(); +#ifndef HAVE_RUBBERBAND virtual void playMonoToggled(); +#endif virtual void playSoloToggled(); virtual void alignToggled(); @@ -165,7 +167,9 @@ Fader *m_fader; AudioDial *m_playSpeed; QPushButton *m_playSharpen; +#ifndef HAVE_RUBBERBAND QPushButton *m_playMono; +#endif WaveformLayer *m_panLayer; bool m_mainMenusCreated;