mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2024-11-10 04:37:37 +01:00
more work on recorder
This commit is contained in:
parent
5b8b344142
commit
3421aae9a2
@ -76,6 +76,12 @@ public:
|
||||
}
|
||||
config.release();
|
||||
|
||||
// Init audio path
|
||||
splitter.init(NULL);
|
||||
splitter.bindStream(&meterStream);
|
||||
meter.init(&meterStream);
|
||||
meter.start();
|
||||
|
||||
// Init sinks
|
||||
basebandSink.init(NULL, complexHandler, this);
|
||||
stereoSink.init(NULL, stereoHandler, this);
|
||||
@ -85,6 +91,9 @@ public:
|
||||
}
|
||||
|
||||
~RecorderModule() {
|
||||
stop();
|
||||
deselectStream();
|
||||
meter.stop();
|
||||
gui::menu.removeEntry(name);
|
||||
}
|
||||
|
||||
@ -170,6 +179,22 @@ public:
|
||||
recording = false;
|
||||
}
|
||||
|
||||
void selectStream(std::string name) {
|
||||
deselectStream();
|
||||
audioStream = sigpath::sinkManager.bindStream(name);
|
||||
if (!audioStream) { return; }
|
||||
splitter.setInput(audioStream);
|
||||
splitter.start();
|
||||
}
|
||||
|
||||
void deselectStream() {
|
||||
if (selectedStreamName.empty() || !audioStream) { return; }
|
||||
splitter.stop();
|
||||
sigpath::sinkManager.unbindStream(selectedStreamName, audioStream);
|
||||
selectedStreamName = "";
|
||||
audioStream = NULL;
|
||||
}
|
||||
|
||||
private:
|
||||
static void menuHandler(void* ctx) {
|
||||
RecorderModule* _this = (RecorderModule*)ctx;
|
||||
@ -241,7 +266,7 @@ private:
|
||||
|
||||
if (_this->recording) { style::beginDisabled(); }
|
||||
if (ImGui::Checkbox(CONCAT("Stereo##_recorder_stereo_", _this->name), &_this->stereo)) {
|
||||
config.acquire();
|
||||
config.acquire();audioStream
|
||||
config.conf[_this->name]["stereo"] = _this->stereo;
|
||||
config.release(true);
|
||||
}
|
||||
@ -344,6 +369,11 @@ private:
|
||||
dsp::sink::Handler<dsp::stereo_t> stereoSink;
|
||||
dsp::sink::Handler<float> monoSink;
|
||||
|
||||
dsp::stream<dsp::stereo_t>* audioStream = NULL;
|
||||
dsp::routing::Splitter<dsp::stereo_t> splitter;
|
||||
dsp::stream<dsp::stereo_t> meterStream;
|
||||
dsp::bench::PeakLevelMeter<dsp::stereo_t> meter;
|
||||
|
||||
uint64_t samplerate = 48000;
|
||||
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user