comparison framework/MainWindowBase.cpp @ 499:a4d90cf2bb79 3.0-integration

Merge from recording branch
author Chris Cannam
date Mon, 12 Oct 2015 12:43:06 +0100
parents 111e976f9ed4 cd9dec2f47e8
children dcd2afbc1bb7
comparison
equal deleted inserted replaced
489:111e976f9ed4 499:a4d90cf2bb79
2198 if (m_soundOptions & WithAudioInput) { 2198 if (m_soundOptions & WithAudioInput) {
2199 m_audioIO = breakfastquay::AudioFactory:: 2199 m_audioIO = breakfastquay::AudioFactory::
2200 createCallbackIO(m_recordTarget, m_playSource); 2200 createCallbackIO(m_recordTarget, m_playSource);
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 m_recordTarget->setSystemRecordSource(m_audioIO);
2203 } else { 2204 } else {
2204 m_playTarget = breakfastquay::AudioFactory:: 2205 m_playTarget = breakfastquay::AudioFactory::
2205 createCallbackPlayTarget(m_playSource); 2206 createCallbackPlayTarget(m_playSource);
2206 m_playSource->setSystemPlaybackTarget(m_playTarget); 2207 m_playSource->setSystemPlaybackTarget(m_playTarget);
2207 } 2208 }
2658 if (m_recordTarget->isRecording() || m_playSource->isPlaying()) { 2659 if (m_recordTarget->isRecording() || m_playSource->isPlaying()) {
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 playbackFrameChanged(m_viewManager->getPlaybackFrame()); 2664 playbackFrameChanged(m_viewManager->getPlaybackFrame());
2665 m_playSource->play(m_viewManager->getPlaybackFrame()); 2665 m_playSource->play(m_viewManager->getPlaybackFrame());
2666 } 2666 }
2667 } 2667 }
2668 2668
2689 } 2689 }
2690 2690
2691 if (m_audioRecordMode == RecordReplaceSession) { 2691 if (m_audioRecordMode == RecordReplaceSession) {
2692 if (!checkSaveModified()) return; 2692 if (!checkSaveModified()) return;
2693 } 2693 }
2694
2695 if (m_audioIO) m_audioIO->resume();
2696 2694
2697 WritableWaveFileModel *model = m_recordTarget->startRecording(); 2695 WritableWaveFileModel *model = m_recordTarget->startRecording();
2698 if (!model) { 2696 if (!model) {
2699 cerr << "ERROR: MainWindowBase::record: Recording failed" << endl; 2697 cerr << "ERROR: MainWindowBase::record: Recording failed" << endl;
2700 //!!! report 2698 //!!! report
3023 emit audioFileLoaded(); 3021 emit audioFileLoaded();
3024 } 3022 }
3025 3023
3026 m_playSource->stop(); 3024 m_playSource->stop();
3027 3025
3028 if (m_audioIO) m_audioIO->suspend();
3029
3030 if (m_paneStack && m_paneStack->getCurrentPane()) { 3026 if (m_paneStack && m_paneStack->getCurrentPane()) {
3031 updateVisibleRangeDisplay(m_paneStack->getCurrentPane()); 3027 updateVisibleRangeDisplay(m_paneStack->getCurrentPane());
3032 } else { 3028 } else {
3033 m_myStatusMessage = ""; 3029 m_myStatusMessage = "";
3034 getStatusLabel()->setText(""); 3030 getStatusLabel()->setText("");