mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-01-24 16:54:45 +01:00
more work on the new recorder
This commit is contained in:
parent
f4bd483410
commit
34b0577f3b
@ -98,7 +98,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void postInit() {
|
void postInit() {
|
||||||
selectStream("Radio");
|
selectStream(selectedStreamName);
|
||||||
}
|
}
|
||||||
|
|
||||||
void enable() {
|
void enable() {
|
||||||
@ -179,26 +179,6 @@ public:
|
|||||||
recording = false;
|
recording = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void selectStream(std::string name) {
|
|
||||||
std::lock_guard<std::recursive_mutex> lck(recMtx);
|
|
||||||
deselectStream();
|
|
||||||
audioStream = sigpath::sinkManager.bindStream(name);
|
|
||||||
if (!audioStream) { return; }
|
|
||||||
selectedStreamName = name;
|
|
||||||
volume.setInput(audioStream);
|
|
||||||
startAudioPath();
|
|
||||||
}
|
|
||||||
|
|
||||||
void deselectStream() {
|
|
||||||
std::lock_guard<std::recursive_mutex> lck(recMtx);
|
|
||||||
if (selectedStreamName.empty() || !audioStream) { return; }
|
|
||||||
if (recording && recMode == RECORDER_MODE_AUDIO) { stop(); }
|
|
||||||
stopAudioPath();
|
|
||||||
sigpath::sinkManager.unbindStream(selectedStreamName, audioStream);
|
|
||||||
selectedStreamName = "";
|
|
||||||
audioStream = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static void menuHandler(void* ctx) {
|
static void menuHandler(void* ctx) {
|
||||||
RecorderModule* _this = (RecorderModule*)ctx;
|
RecorderModule* _this = (RecorderModule*)ctx;
|
||||||
@ -303,6 +283,26 @@ private:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void selectStream(std::string name) {
|
||||||
|
std::lock_guard<std::recursive_mutex> lck(recMtx);
|
||||||
|
deselectStream();
|
||||||
|
audioStream = sigpath::sinkManager.bindStream(name);
|
||||||
|
if (!audioStream) { return; }
|
||||||
|
selectedStreamName = name;
|
||||||
|
volume.setInput(audioStream);
|
||||||
|
startAudioPath();
|
||||||
|
}
|
||||||
|
|
||||||
|
void deselectStream() {
|
||||||
|
std::lock_guard<std::recursive_mutex> 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() {
|
void startAudioPath() {
|
||||||
volume.start();
|
volume.start();
|
||||||
splitter.start();
|
splitter.start();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user