Mercurial > hg > sonic-visualiser
comparison main/MainWindow.cpp @ 220:474ddd0f4bb4
* Remove sharpen button as well, when using RubberBand (because it isn't
connected up anyway)
author | Chris Cannam |
---|---|
date | Thu, 29 Nov 2007 10:50:13 +0000 |
parents | 0f635e16881d |
children | 0ebfc1e392f1 |
comparison
equal
deleted
inserted
replaced
219:0f635e16881d | 220:474ddd0f4bb4 |
---|---|
217 connect(m_playSpeed, SIGNAL(mouseEntered()), this, SLOT(mouseEnteredWidget())); | 217 connect(m_playSpeed, SIGNAL(mouseEntered()), this, SLOT(mouseEnteredWidget())); |
218 connect(m_playSpeed, SIGNAL(mouseLeft()), this, SLOT(mouseLeftWidget())); | 218 connect(m_playSpeed, SIGNAL(mouseLeft()), this, SLOT(mouseLeftWidget())); |
219 | 219 |
220 IconLoader il; | 220 IconLoader il; |
221 | 221 |
222 #ifndef HAVE_RUBBERBAND | |
222 m_playSharpen = new NotifyingPushButton(frame); | 223 m_playSharpen = new NotifyingPushButton(frame); |
223 m_playSharpen->setToolTip(tr("Sharpen percussive transients")); | 224 m_playSharpen->setToolTip(tr("Sharpen percussive transients")); |
224 m_playSharpen->setFixedSize(20, 20); | 225 m_playSharpen->setFixedSize(20, 20); |
225 m_playSharpen->setEnabled(false); | 226 m_playSharpen->setEnabled(false); |
226 m_playSharpen->setCheckable(true); | 227 m_playSharpen->setCheckable(true); |
228 m_playSharpen->setIcon(il.load("sharpen")); | 229 m_playSharpen->setIcon(il.load("sharpen")); |
229 connect(m_playSharpen, SIGNAL(clicked()), this, SLOT(playSharpenToggled())); | 230 connect(m_playSharpen, SIGNAL(clicked()), this, SLOT(playSharpenToggled())); |
230 connect(m_playSharpen, SIGNAL(mouseEntered()), this, SLOT(mouseEnteredWidget())); | 231 connect(m_playSharpen, SIGNAL(mouseEntered()), this, SLOT(mouseEnteredWidget())); |
231 connect(m_playSharpen, SIGNAL(mouseLeft()), this, SLOT(mouseLeftWidget())); | 232 connect(m_playSharpen, SIGNAL(mouseLeft()), this, SLOT(mouseLeftWidget())); |
232 | 233 |
233 #ifndef HAVE_RUBBERBAND | |
234 m_playMono = new NotifyingPushButton(frame); | 234 m_playMono = new NotifyingPushButton(frame); |
235 m_playMono->setToolTip(tr("Run time stretcher in mono only")); | 235 m_playMono->setToolTip(tr("Run time stretcher in mono only")); |
236 m_playMono->setFixedSize(20, 20); | 236 m_playMono->setFixedSize(20, 20); |
237 m_playMono->setEnabled(false); | 237 m_playMono->setEnabled(false); |
238 m_playMono->setCheckable(true); | 238 m_playMono->setCheckable(true); |
243 connect(m_playMono, SIGNAL(mouseLeft()), this, SLOT(mouseLeftWidget())); | 243 connect(m_playMono, SIGNAL(mouseLeft()), this, SLOT(mouseLeftWidget())); |
244 #endif | 244 #endif |
245 | 245 |
246 QSettings settings; | 246 QSettings settings; |
247 settings.beginGroup("MainWindow"); | 247 settings.beginGroup("MainWindow"); |
248 #ifndef HAVE_RUBBERBAND | |
248 m_playSharpen->setChecked(settings.value("playsharpen", true).toBool()); | 249 m_playSharpen->setChecked(settings.value("playsharpen", true).toBool()); |
249 #ifndef HAVE_RUBBERBAND | |
250 m_playMono->setChecked(settings.value("playmono", false).toBool()); | 250 m_playMono->setChecked(settings.value("playmono", false).toBool()); |
251 #endif | 251 #endif |
252 settings.endGroup(); | 252 settings.endGroup(); |
253 | 253 |
254 layout->setSpacing(4); | 254 layout->setSpacing(4); |
255 layout->addWidget(scroll, 0, 0, 1, 5); | 255 layout->addWidget(scroll, 0, 0, 1, 5); |
256 layout->addWidget(m_overview, 1, 0); | 256 layout->addWidget(m_overview, 1, 0); |
257 layout->addWidget(m_fader, 1, 1); | 257 layout->addWidget(m_fader, 1, 1); |
258 layout->addWidget(m_playSpeed, 1, 2); | 258 layout->addWidget(m_playSpeed, 1, 2); |
259 #ifndef HAVE_RUBBERBAND | |
259 layout->addWidget(m_playSharpen, 1, 3); | 260 layout->addWidget(m_playSharpen, 1, 3); |
260 #ifndef HAVE_RUBBERBAND | |
261 layout->addWidget(m_playMono, 1, 4); | 261 layout->addWidget(m_playMono, 1, 4); |
262 #endif | 262 #endif |
263 | 263 |
264 m_paneStack->setPropertyStackMinWidth | 264 m_paneStack->setPropertyStackMinWidth |
265 (m_fader->width() + m_playSpeed->width() + m_playSharpen->width() | 265 (m_fader->width() + m_playSpeed->width() |
266 #ifndef HAVE_RUBBERBAND | 266 #ifndef HAVE_RUBBERBAND |
267 + m_playSharpen->width() | |
267 + m_playMono->width() | 268 + m_playMono->width() |
268 #endif | 269 #endif |
269 + layout->spacing() * 4); | 270 + layout->spacing() * 4); |
270 | 271 |
271 layout->setColumnStretch(0, 10); | 272 layout->setColumnStretch(0, 10); |
3017 contextHelpChanged(tr("Playback speed: %1%2%") | 3018 contextHelpChanged(tr("Playback speed: %1%2%") |
3018 .arg(position > 100 ? "+" : "") | 3019 .arg(position > 100 ? "+" : "") |
3019 .arg(pc)); | 3020 .arg(pc)); |
3020 } | 3021 } |
3021 | 3022 |
3023 #ifdef HAVE_RUBBERBAND | |
3024 bool mono = false; | |
3025 bool sharpen = true; | |
3026 #else | |
3022 m_playSharpen->setEnabled(something); | 3027 m_playSharpen->setEnabled(something); |
3023 bool sharpen = (something && m_playSharpen->isChecked()); | 3028 bool sharpen = (something && m_playSharpen->isChecked()); |
3024 | |
3025 #ifdef HAVE_RUBBERBAND | |
3026 bool mono = false; | |
3027 #else | |
3028 m_playMono->setEnabled(something); | 3029 m_playMono->setEnabled(something); |
3029 bool mono = (something && m_playMono->isChecked()); | 3030 bool mono = (something && m_playMono->isChecked()); |
3030 #endif | 3031 #endif |
3031 | 3032 |
3032 m_playSource->setTimeStretch(factor, sharpen, mono); | 3033 m_playSource->setTimeStretch(factor, sharpen, mono); |
3033 | 3034 |
3034 updateMenuStates(); | 3035 updateMenuStates(); |
3035 } | 3036 } |
3036 | 3037 |
3038 #ifndef HAVE_RUBBERBAND | |
3037 void | 3039 void |
3038 MainWindow::playSharpenToggled() | 3040 MainWindow::playSharpenToggled() |
3039 { | 3041 { |
3040 QSettings settings; | 3042 QSettings settings; |
3041 settings.beginGroup("MainWindow"); | 3043 settings.beginGroup("MainWindow"); |
3043 settings.endGroup(); | 3045 settings.endGroup(); |
3044 | 3046 |
3045 playSpeedChanged(m_playSpeed->value()); | 3047 playSpeedChanged(m_playSpeed->value()); |
3046 } | 3048 } |
3047 | 3049 |
3048 #ifndef HAVE_RUBBERBAND | |
3049 void | 3050 void |
3050 MainWindow::playMonoToggled() | 3051 MainWindow::playMonoToggled() |
3051 { | 3052 { |
3052 QSettings settings; | 3053 QSettings settings; |
3053 settings.beginGroup("MainWindow"); | 3054 settings.beginGroup("MainWindow"); |
3311 | 3312 |
3312 if (w == m_fader) { | 3313 if (w == m_fader) { |
3313 contextHelpChanged(tr("Adjust the master playback level")); | 3314 contextHelpChanged(tr("Adjust the master playback level")); |
3314 } else if (w == m_playSpeed) { | 3315 } else if (w == m_playSpeed) { |
3315 contextHelpChanged(tr("Adjust the master playback speed")); | 3316 contextHelpChanged(tr("Adjust the master playback speed")); |
3317 #ifndef HAVE_RUBBERBAND | |
3316 } else if (w == m_playSharpen && w->isEnabled()) { | 3318 } else if (w == m_playSharpen && w->isEnabled()) { |
3317 contextHelpChanged(tr("Toggle transient sharpening for playback time scaling")); | 3319 contextHelpChanged(tr("Toggle transient sharpening for playback time scaling")); |
3318 #ifndef HAVE_RUBBERBAND | |
3319 } else if (w == m_playMono && w->isEnabled()) { | 3320 } else if (w == m_playMono && w->isEnabled()) { |
3320 contextHelpChanged(tr("Toggle mono mode for playback time scaling")); | 3321 contextHelpChanged(tr("Toggle mono mode for playback time scaling")); |
3321 #endif | 3322 #endif |
3322 } | 3323 } |
3323 } | 3324 } |