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