From 36a6f7ee81e036eb6de354125868edc63556040c Mon Sep 17 00:00:00 2001 From: Josh Siegle Date: Thu, 29 Aug 2024 11:54:02 -0700 Subject: [PATCH] Start audio callbacks after starting acquisition --- Source/UI/ControlPanel.cpp | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/Source/UI/ControlPanel.cpp b/Source/UI/ControlPanel.cpp index a08acc542..b536ff8db 100755 --- a/Source/UI/ControlPanel.cpp +++ b/Source/UI/ControlPanel.cpp @@ -528,27 +528,26 @@ void ControlPanel::startAcquisition(bool recordingShouldAlsoStart) graph->updateConnections(); - if (audio->beginCallbacks()) // starts acquisition callbacks + graph->startAcquisition(); // inform processors acquisition is starting + + if (recordingShouldAlsoStart) { - if (recordingShouldAlsoStart) - { - startRecording(); - playButton->setToggleState(true, dontSendNotification); - } + startRecording(); + playButton->setToggleState(true, dontSendNotification); + } - playButton->getNormalImage()->replaceColour(defaultButtonColour, Colours::yellow); + playButton->getNormalImage()->replaceColour(defaultButtonColour, Colours::yellow); - clock->start(); // starts the clock - audioEditor->disable(); + clock->start(); // starts the clock + audioEditor->disable(); - stopTimer(); - startTimer(250); // refresh every 250 ms + stopTimer(); + startTimer(250); // refresh every 250 ms - recordSelector->setEnabled(false); // why is this outside the "if" statement? - recordOptionsButton->setEnabled(false); - - graph->startAcquisition(); // start data flow - } + recordSelector->setEnabled(false); // why is this outside the "if" statement? + recordOptionsButton->setEnabled(false); + + audio->beginCallbacks(); } }