From 34b0577f3b54098e8b12de0c658b6c8481f3fc69 Mon Sep 17 00:00:00 2001 From: AlexandreRouma Date: Tue, 11 Oct 2022 17:40:38 +0200 Subject: [PATCH] more work on the new recorder --- misc_modules/recorder/src/main.cpp | 42 +++++++++++++++--------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/misc_modules/recorder/src/main.cpp b/misc_modules/recorder/src/main.cpp index 04dcf1c5..9d06bafc 100644 --- a/misc_modules/recorder/src/main.cpp +++ b/misc_modules/recorder/src/main.cpp @@ -98,7 +98,7 @@ public: } void postInit() { - selectStream("Radio"); + selectStream(selectedStreamName); } void enable() { @@ -179,26 +179,6 @@ public: recording = false; } - void selectStream(std::string name) { - std::lock_guard lck(recMtx); - deselectStream(); - audioStream = sigpath::sinkManager.bindStream(name); - if (!audioStream) { return; } - selectedStreamName = name; - volume.setInput(audioStream); - startAudioPath(); - } - - void deselectStream() { - std::lock_guard lck(recMtx); - if (selectedStreamName.empty() || !audioStream) { return; } - if (recording && recMode == RECORDER_MODE_AUDIO) { stop(); } - stopAudioPath(); - sigpath::sinkManager.unbindStream(selectedStreamName, audioStream); - selectedStreamName = ""; - audioStream = NULL; - } - private: static void menuHandler(void* ctx) { RecorderModule* _this = (RecorderModule*)ctx; @@ -303,6 +283,26 @@ private: } } + void selectStream(std::string name) { + std::lock_guard lck(recMtx); + deselectStream(); + audioStream = sigpath::sinkManager.bindStream(name); + if (!audioStream) { return; } + selectedStreamName = name; + volume.setInput(audioStream); + startAudioPath(); + } + + void deselectStream() { + std::lock_guard lck(recMtx); + if (selectedStreamName.empty() || !audioStream) { return; } + if (recording && recMode == RECORDER_MODE_AUDIO) { stop(); } + stopAudioPath(); + sigpath::sinkManager.unbindStream(selectedStreamName, audioStream); + selectedStreamName = ""; + audioStream = NULL; + } + void startAudioPath() { volume.start(); splitter.start();