comparison framework/MainWindowBase.cpp @ 485:21d3cf5c8f21 tony-2.0-integration

Add status bar "Recording" message and timer while recording
author Chris Cannam
date Wed, 16 Sep 2015 12:04:26 +0100
parents 01aeda073720
children 6eb28350050d
comparison
equal deleted inserted replaced
484:01aeda073720 485:21d3cf5c8f21
229 m_playSource = new AudioCallbackPlaySource(m_viewManager, 229 m_playSource = new AudioCallbackPlaySource(m_viewManager,
230 QApplication::applicationName()); 230 QApplication::applicationName());
231 if (m_soundOptions & WithAudioInput) { 231 if (m_soundOptions & WithAudioInput) {
232 m_recordTarget = new AudioRecordTarget(m_viewManager, 232 m_recordTarget = new AudioRecordTarget(m_viewManager,
233 QApplication::applicationName()); 233 QApplication::applicationName());
234 connect(m_recordTarget, SIGNAL(recordDurationChanged(sv_frame_t, sv_samplerate_t)),
235 this, SLOT(recordDurationChanged(sv_frame_t, sv_samplerate_t)));
234 } 236 }
235 237
236 connect(m_playSource, SIGNAL(sampleRateMismatch(sv_samplerate_t, sv_samplerate_t, bool)), 238 connect(m_playSource, SIGNAL(sampleRateMismatch(sv_samplerate_t, sv_samplerate_t, bool)),
237 this, SLOT(sampleRateMismatch(sv_samplerate_t, sv_samplerate_t, bool))); 239 this, SLOT(sampleRateMismatch(sv_samplerate_t, sv_samplerate_t, bool)));
238 connect(m_playSource, SIGNAL(audioOverloadPluginDisabled()), 240 connect(m_playSource, SIGNAL(audioOverloadPluginDisabled()),
3355 3357
3356 getStatusLabel()->setText(m_myStatusMessage); 3358 getStatusLabel()->setText(m_myStatusMessage);
3357 } 3359 }
3358 3360
3359 void 3361 void
3362 MainWindowBase::recordDurationChanged(sv_frame_t frame, sv_samplerate_t rate)
3363 {
3364 RealTime duration = RealTime::frame2RealTime(frame, rate);
3365 QString durStr = duration.toSecText().c_str();
3366
3367 m_myStatusMessage = tr("Recording: %1").arg(durStr);
3368
3369 getStatusLabel()->setText(m_myStatusMessage);
3370 }
3371
3372 void
3360 MainWindowBase::globalCentreFrameChanged(sv_frame_t ) 3373 MainWindowBase::globalCentreFrameChanged(sv_frame_t )
3361 { 3374 {
3362 if ((m_playSource && m_playSource->isPlaying()) || !getMainModel()) return; 3375 if ((m_playSource && m_playSource->isPlaying()) || !getMainModel()) return;
3363 Pane *p = 0; 3376 Pane *p = 0;
3364 if (!m_paneStack || !(p = m_paneStack->getCurrentPane())) return; 3377 if (!m_paneStack || !(p = m_paneStack->getCurrentPane())) return;