Added persistent recorder volume

pull/490/head^2
AlexandreRouma 2021-11-23 22:35:09 +01:00
rodzic fc7d902c1d
commit e394b64ad3
2 zmienionych plików z 11 dodań i 1 usunięć

Wyświetl plik

@ -288,6 +288,7 @@ namespace dsp {
void init(stream<T>* in, float volume) {
_in = in;
_volume = volume;
level = powf(_volume, 2);
generic_block<Volume<T>>::registerInput(_in);
generic_block<Volume<T>>::registerOutput(&out);
generic_block<Volume<T>>::_block_init = true;

Wyświetl plik

@ -60,16 +60,22 @@ public:
config.conf[name]["mode"] = RECORDER_MODE_AUDIO;
config.conf[name]["recPath"] = "%ROOT%/recordings";
config.conf[name]["audioStream"] = "Radio";
config.conf[name]["audioVolume"] = 1.0;
created = true;
}
if (!config.conf[name].contains("audioVolume")) {
config.conf[name]["audioVolume"] = 1.0;
}
recMode = config.conf[name]["mode"];
folderSelect.setPath(config.conf[name]["recPath"]);
selectedStreamName = config.conf[name]["audioStream"];
audioVolume = config.conf[name]["audioVolume"];
config.release(created);
// Init audio path
vol.init(&dummyStream, 1.0f);
vol.init(&dummyStream, audioVolume);
audioSplit.init(&vol.out);
audioSplit.bindStream(&meterStream);
meter.init(&meterStream);
@ -278,6 +284,9 @@ private:
if (ImGui::SliderFloat(CONCAT("##_recorder_vol_", name), &audioVolume, 0, 1, "")) {
vol.setVolume(audioVolume);
config.acquire();
config.conf[name]["audioVolume"] = audioVolume;
config.release(true);
}
ImGui::PopItemWidth();