# HG changeset patch # User Chris Cannam # Date 1444658762 -3600 # Node ID 7c779438edc37f74f297bc3b634f99161295a523 # Parent 2f5ffd36879b02ce2471fcb60302558838499eb4 Suspend audio driver when stopping recording from record button diff -r 2f5ffd36879b -r 7c779438edc3 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; }