changeset 501:c82cae9a9e74 3.0-integration

Merge from branch "tony-2.0-integration"
author Chris Cannam
date Wed, 14 Oct 2015 10:18:58 +0100
parents dcd2afbc1bb7 (current diff) d1c70c680fa9 (diff)
children bfe468c89d30 0fe07a89fbbb
files audio/AudioRecordTarget.cpp audio/AudioRecordTarget.h framework/MainWindowBase.cpp
diffstat 3 files changed, 17 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/audio/AudioRecordTarget.cpp	Wed Oct 14 10:17:32 2015 +0100
+++ b/audio/AudioRecordTarget.cpp	Wed Oct 14 10:18:58 2015 +0100
@@ -168,12 +168,13 @@
         return;
     }
 
-    m_model->setCompletion(100);
+    m_model->writeComplete();
     m_model = 0;
     m_recording = false;
     }
 
     emit recordStatusChanged(false);
+    emit recordCompleted();
 }
 
 
--- a/audio/AudioRecordTarget.h	Wed Oct 14 10:17:32 2015 +0100
+++ b/audio/AudioRecordTarget.h	Wed Oct 14 10:18:58 2015 +0100
@@ -62,6 +62,7 @@
 signals:
     void recordStatusChanged(bool recording);
     void recordDurationChanged(sv_frame_t, sv_samplerate_t); // emitted occasionally
+    void recordCompleted();
 
 protected slots:
     void modelAboutToBeDeleted();
--- a/framework/MainWindowBase.cpp	Wed Oct 14 10:17:32 2015 +0100
+++ b/framework/MainWindowBase.cpp	Wed Oct 14 10:18:58 2015 +0100
@@ -2661,6 +2661,7 @@
         QAction *action = qobject_cast<QAction *>(sender());
         if (action) action->setChecked(false);
     } else {
+        if (m_audioIO) m_audioIO->resume();
         playbackFrameChanged(m_viewManager->getPlaybackFrame());
 	m_playSource->play(m_viewManager->getPlaybackFrame());
     }
@@ -2701,6 +2702,15 @@
         }
     }
 
+    QAction *action = qobject_cast<QAction *>(sender());
+    
+    if (m_audioRecordMode == RecordReplaceSession) {
+        if (!checkSaveModified()) {
+            if (action) action->setChecked(false);
+            return;
+        }
+    }
+
     m_audioIO->resume();
     WritableWaveFileModel *model = m_recordTarget->startRecording();
     if (!model) {
@@ -2800,6 +2810,8 @@
     updateMenuStates();
     m_recentFiles.addFile(model->getLocation());
     currentPaneChanged(m_paneStack->getCurrentPane());
+
+    emit audioFileLoaded();
 }
 
 void
@@ -3032,11 +3044,12 @@
 {
     if (m_recordTarget->isRecording()) {
         m_recordTarget->stopRecording();
-        emit audioFileLoaded();
     }
         
     m_playSource->stop();
 
+    if (m_audioIO) m_audioIO->suspend();
+    
     if (m_paneStack && m_paneStack->getCurrentPane()) {
         updateVisibleRangeDisplay(m_paneStack->getCurrentPane());
     } else {