# HG changeset patch # User Chris Cannam # Date 1444658762 -3600 # Node ID 40e7b4e1b5698c15f08e6269a9d35192cd0ef985 # Parent 0ce24bb965a85f1e133ca914b761bc094d938db3 Suspend audio driver when stopping recording from record button diff -r 0ce24bb965a8 -r 40e7b4e1b569 framework/MainWindowBase.cpp --- a/framework/MainWindowBase.cpp Mon Oct 12 13:51:59 2015 +0100 +++ b/framework/MainWindowBase.cpp Mon Oct 12 15:06:02 2015 +0100 @@ -2681,10 +2681,14 @@ if (!m_audioIO) { createAudioIO(); } + + if (!m_audioIO) { + //!!! report + return; + } if (m_recordTarget->isRecording()) { - m_recordTarget->stopRecording(); - emit audioFileLoaded(); + stop(); return; } @@ -2697,7 +2701,7 @@ } } - if (m_audioIO) m_audioIO->resume(); + m_audioIO->resume(); WritableWaveFileModel *model = m_recordTarget->startRecording(); if (!model) { @@ -2709,6 +2713,7 @@ if (!model->isOK()) { m_recordTarget->stopRecording(); + m_audioIO->suspend(); delete model; return; } @@ -2726,6 +2731,7 @@ FileOpenStatus tplStatus = openSessionTemplate(templateName); if (tplStatus == FileOpenCancelled) { m_recordTarget->stopRecording(); + m_audioIO->suspend(); PlayParameterRepository::getInstance()->removePlayable(model); return; }