comparison framework/MainWindowBase.cpp @ 572:4c1ab4f9e116 3.0-integration

Ah, there already was a mechanism for that (recordDurationChanged()). But in any case we are better off prompting the model to update I think.
author Chris Cannam
date Wed, 04 Jan 2017 14:21:24 +0000
parents 5369359351cb
children b3c35447ef31
comparison
equal deleted inserted replaced
571:5369359351cb 572:4c1ab4f9e116
156 m_labeller(0), 156 m_labeller(0),
157 m_lastPlayStatusSec(0), 157 m_lastPlayStatusSec(0),
158 m_initialDarkBackground(false), 158 m_initialDarkBackground(false),
159 m_defaultFfwdRwdStep(2, 0), 159 m_defaultFfwdRwdStep(2, 0),
160 m_audioRecordMode(RecordCreateAdditionalModel), 160 m_audioRecordMode(RecordCreateAdditionalModel),
161 m_audioRecordUpdateTimer(this),
162 m_statusLabel(0), 161 m_statusLabel(0),
163 m_iconsVisibleInMenus(true), 162 m_iconsVisibleInMenus(true),
164 m_menuShortcutMapper(0) 163 m_menuShortcutMapper(0)
165 { 164 {
166 Profiler profiler("MainWindowBase::MainWindowBase"); 165 Profiler profiler("MainWindowBase::MainWindowBase");
229 this, SLOT(paneDropAccepted(Pane *, QStringList))); 228 this, SLOT(paneDropAccepted(Pane *, QStringList)));
230 connect(m_paneStack, SIGNAL(dropAccepted(Pane *, QString)), 229 connect(m_paneStack, SIGNAL(dropAccepted(Pane *, QString)),
231 this, SLOT(paneDropAccepted(Pane *, QString))); 230 this, SLOT(paneDropAccepted(Pane *, QString)));
232 connect(m_paneStack, SIGNAL(paneDeleteButtonClicked(Pane *)), 231 connect(m_paneStack, SIGNAL(paneDeleteButtonClicked(Pane *)),
233 this, SLOT(paneDeleteButtonClicked(Pane *))); 232 this, SLOT(paneDeleteButtonClicked(Pane *)));
234
235 connect(&m_audioRecordUpdateTimer, SIGNAL(timeout()),
236 m_paneStack, SLOT(update()));
237 233
238 m_playSource = new AudioCallbackPlaySource(m_viewManager, 234 m_playSource = new AudioCallbackPlaySource(m_viewManager,
239 QApplication::applicationName()); 235 QApplication::applicationName());
240 if (m_soundOptions & WithAudioInput) { 236 if (m_soundOptions & WithAudioInput) {
241 m_recordTarget = new AudioRecordTarget(m_viewManager, 237 m_recordTarget = new AudioRecordTarget(m_viewManager,
242 QApplication::applicationName()); 238 QApplication::applicationName());
243 connect(m_recordTarget, SIGNAL(recordDurationChanged(sv_frame_t, sv_samplerate_t)), 239 connect(m_recordTarget,
244 this, SLOT(recordDurationChanged(sv_frame_t, sv_samplerate_t))); 240 SIGNAL(recordDurationChanged(sv_frame_t, sv_samplerate_t)),
241 this,
242 SLOT(recordDurationChanged(sv_frame_t, sv_samplerate_t)));
245 } 243 }
246 244
247 connect(m_playSource, SIGNAL(sampleRateMismatch(sv_samplerate_t, sv_samplerate_t, bool)), 245 connect(m_playSource, SIGNAL(sampleRateMismatch(sv_samplerate_t, sv_samplerate_t, bool)),
248 this, SLOT(sampleRateMismatch(sv_samplerate_t, sv_samplerate_t, bool))); 246 this, SLOT(sampleRateMismatch(sv_samplerate_t, sv_samplerate_t, bool)));
249 connect(m_playSource, SIGNAL(channelCountIncreased(int)), 247 connect(m_playSource, SIGNAL(channelCountIncreased(int)),
3016 updateMenuStates(); 3014 updateMenuStates();
3017 m_recentFiles.addFile(model->getLocation()); 3015 m_recentFiles.addFile(model->getLocation());
3018 currentPaneChanged(m_paneStack->getCurrentPane()); 3016 currentPaneChanged(m_paneStack->getCurrentPane());
3019 3017
3020 emit audioFileLoaded(); 3018 emit audioFileLoaded();
3021
3022 m_audioRecordUpdateTimer.start(1000);
3023 } 3019 }
3024 3020
3025 void 3021 void
3026 MainWindowBase::ffwd() 3022 MainWindowBase::ffwd()
3027 { 3023 {
3266 updateVisibleRangeDisplay(m_paneStack->getCurrentPane()); 3262 updateVisibleRangeDisplay(m_paneStack->getCurrentPane());
3267 } else { 3263 } else {
3268 m_myStatusMessage = ""; 3264 m_myStatusMessage = "";
3269 getStatusLabel()->setText(""); 3265 getStatusLabel()->setText("");
3270 } 3266 }
3271
3272 m_audioRecordUpdateTimer.stop();
3273 } 3267 }
3274 3268
3275 MainWindowBase::AddPaneCommand::AddPaneCommand(MainWindowBase *mw) : 3269 MainWindowBase::AddPaneCommand::AddPaneCommand(MainWindowBase *mw) :
3276 m_mw(mw), 3270 m_mw(mw),
3277 m_pane(0), 3271 m_pane(0),