comparison framework/MainWindowBase.cpp @ 509:7cf6f5501212 tony-2.0-integration

Trim suspend/resume calls
author Chris Cannam
date Wed, 14 Oct 2015 16:02:09 +0100
parents 74fa499d5f3c
children 68ab0fe3bce4
comparison
equal deleted inserted replaced
508:b84d9b512dbd 509:7cf6f5501212
2201 m_audioIO->suspend(); // start in suspended state 2201 m_audioIO->suspend(); // start in suspended state
2202 m_playSource->setSystemPlaybackTarget(m_audioIO); 2202 m_playSource->setSystemPlaybackTarget(m_audioIO);
2203 } else { 2203 } else {
2204 m_playTarget = breakfastquay::AudioFactory:: 2204 m_playTarget = breakfastquay::AudioFactory::
2205 createCallbackPlayTarget(m_playSource); 2205 createCallbackPlayTarget(m_playSource);
2206 m_playTarget->suspend(); // start in suspended state
2206 m_playSource->setSystemPlaybackTarget(m_playTarget); 2207 m_playSource->setSystemPlaybackTarget(m_playTarget);
2207 } 2208 }
2208 2209
2209 if (!m_playTarget && !m_audioIO) { 2210 if (!m_playTarget && !m_audioIO) {
2210 emit hideSplash(); 2211 emit hideSplash();
2659 stop(); 2660 stop();
2660 QAction *action = qobject_cast<QAction *>(sender()); 2661 QAction *action = qobject_cast<QAction *>(sender());
2661 if (action) action->setChecked(false); 2662 if (action) action->setChecked(false);
2662 } else { 2663 } else {
2663 if (m_audioIO) m_audioIO->resume(); 2664 if (m_audioIO) m_audioIO->resume();
2665 else if (m_playTarget) m_playTarget->resume();
2664 playbackFrameChanged(m_viewManager->getPlaybackFrame()); 2666 playbackFrameChanged(m_viewManager->getPlaybackFrame());
2665 m_playSource->play(m_viewManager->getPlaybackFrame()); 2667 m_playSource->play(m_viewManager->getPlaybackFrame());
2666 } 2668 }
2667 } 2669 }
2668 2670
2700 return; 2702 return;
2701 } 2703 }
2702 } 2704 }
2703 2705
2704 m_audioIO->resume(); 2706 m_audioIO->resume();
2707
2705 WritableWaveFileModel *model = m_recordTarget->startRecording(); 2708 WritableWaveFileModel *model = m_recordTarget->startRecording();
2706 if (!model) { 2709 if (!model) {
2707 cerr << "ERROR: MainWindowBase::record: Recording failed" << endl; 2710 cerr << "ERROR: MainWindowBase::record: Recording failed" << endl;
2708 //!!! report 2711 //!!! report
2709 if (action) action->setChecked(false); 2712 if (action) action->setChecked(false);
3037 } 3040 }
3038 3041
3039 m_playSource->stop(); 3042 m_playSource->stop();
3040 3043
3041 if (m_audioIO) m_audioIO->suspend(); 3044 if (m_audioIO) m_audioIO->suspend();
3045 else if (m_playTarget) m_playTarget->suspend();
3042 3046
3043 if (m_paneStack && m_paneStack->getCurrentPane()) { 3047 if (m_paneStack && m_paneStack->getCurrentPane()) {
3044 updateVisibleRangeDisplay(m_paneStack->getCurrentPane()); 3048 updateVisibleRangeDisplay(m_paneStack->getCurrentPane());
3045 } else { 3049 } else {
3046 m_myStatusMessage = ""; 3050 m_myStatusMessage = "";