Added stream name

This commit is contained in:
Ryzerth 2021-02-28 16:32:57 +01:00
parent fcb1d94946
commit 4fc55f75a8
2 changed files with 8 additions and 1 deletions

View File

@ -165,6 +165,7 @@ private:
unsigned int bufferFrames = sampleRate / 60; unsigned int bufferFrames = sampleRate / 60;
RtAudio::StreamOptions opts; RtAudio::StreamOptions opts;
opts.flags = RTAUDIO_MINIMIZE_LATENCY; opts.flags = RTAUDIO_MINIMIZE_LATENCY;
opts.streamName = _streamName;
stereoPacker.setSampleCount(bufferFrames); stereoPacker.setSampleCount(bufferFrames);

View File

@ -26,6 +26,7 @@ SDRPP_MOD_INFO {
/* Max instances */ -1 /* Max instances */ -1
}; };
ConfigManager config;
std::string expandString(std::string input) { std::string expandString(std::string input) {
input = std::regex_replace(input, std::regex("%ROOT%"), options::opts.root); input = std::regex_replace(input, std::regex("%ROOT%"), options::opts.root);
@ -313,6 +314,10 @@ MOD_EXPORT void _INIT_() {
spdlog::error("Could not create recordings directory"); spdlog::error("Could not create recordings directory");
} }
} }
json def = json({});
config.setPath(options::opts.root + "/radio_config.json");
config.load(def);
config.enableAutoSave();
} }
MOD_EXPORT ModuleManager::Instance* _CREATE_INSTANCE_(std::string name) { MOD_EXPORT ModuleManager::Instance* _CREATE_INSTANCE_(std::string name) {
@ -324,5 +329,6 @@ MOD_EXPORT void _DELETE_INSTANCE_(ModuleManager::Instance* inst) {
} }
MOD_EXPORT void _END_(RecorderContext_t* ctx) { MOD_EXPORT void _END_(RecorderContext_t* ctx) {
config.disableAutoSave();
config.save();
} }