mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-06-25 20:07:51 +02:00
Switched to new cleaner argument system
This commit is contained in:
@ -5,7 +5,6 @@
|
||||
#include <gui/style.h>
|
||||
#include <core.h>
|
||||
#include <thread>
|
||||
#include <options.h>
|
||||
#include <radio_interface.h>
|
||||
#include <signal_path/signal_path.h>
|
||||
#include <vector>
|
||||
@ -831,7 +830,7 @@ MOD_EXPORT void _INIT_() {
|
||||
def["lists"]["General"]["showOnWaterfall"] = true;
|
||||
def["lists"]["General"]["bookmarks"] = json::object();
|
||||
|
||||
config.setPath(options::opts.root + "/frequency_manager_config.json");
|
||||
config.setPath(core::args["root"].s() + "/frequency_manager_config.json");
|
||||
config.load(def);
|
||||
config.enableAutoSave();
|
||||
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include <gui/style.h>
|
||||
#include <gui/widgets/volume_meter.h>
|
||||
#include <regex>
|
||||
#include <options.h>
|
||||
#include <gui/widgets/folder_select.h>
|
||||
#include <recorder_interface.h>
|
||||
#include <core.h>
|
||||
@ -29,11 +28,6 @@ SDRPP_MOD_INFO{
|
||||
|
||||
ConfigManager config;
|
||||
|
||||
std::string expandString(std::string input) {
|
||||
input = std::regex_replace(input, std::regex("%ROOT%"), options::opts.root);
|
||||
return std::regex_replace(input, std::regex("//"), "/");
|
||||
}
|
||||
|
||||
std::string genFileName(std::string prefix, bool isVfo, std::string name = "") {
|
||||
time_t now = time(0);
|
||||
tm* ltm = localtime(&now);
|
||||
@ -52,6 +46,8 @@ public:
|
||||
RecorderModule(std::string name) : folderSelect("%ROOT%/recordings") {
|
||||
this->name = name;
|
||||
|
||||
root = core::args["root"];
|
||||
|
||||
// Load config
|
||||
config.acquire();
|
||||
bool created = false;
|
||||
@ -462,6 +458,11 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
std::string expandString(std::string input) {
|
||||
input = std::regex_replace(input, std::regex("%ROOT%"), root);
|
||||
return std::regex_replace(input, std::regex("//"), "/");
|
||||
}
|
||||
|
||||
|
||||
std::string name;
|
||||
bool enabled = true;
|
||||
@ -496,6 +497,7 @@ private:
|
||||
std::string streamNamesTxt;
|
||||
int streamId = 0;
|
||||
std::string selectedStreamName = "";
|
||||
std::string root;
|
||||
|
||||
// Baseband path
|
||||
dsp::stream<dsp::complex_t> basebandStream;
|
||||
@ -516,14 +518,15 @@ struct RecorderContext_t {
|
||||
|
||||
MOD_EXPORT void _INIT_() {
|
||||
// Create default recording directory
|
||||
if (!std::filesystem::exists(options::opts.root + "/recordings")) {
|
||||
std::string root = core::args["root"];
|
||||
if (!std::filesystem::exists(root + "/recordings")) {
|
||||
spdlog::warn("Recordings directory does not exist, creating it");
|
||||
if (!std::filesystem::create_directory(options::opts.root + "/recordings")) {
|
||||
if (!std::filesystem::create_directory(root + "/recordings")) {
|
||||
spdlog::error("Could not create recordings directory");
|
||||
}
|
||||
}
|
||||
json def = json({});
|
||||
config.setPath(options::opts.root + "/recorder_config.json");
|
||||
config.setPath(root + "/recorder_config.json");
|
||||
config.load(def);
|
||||
config.enableAutoSave();
|
||||
}
|
||||
|
@ -8,7 +8,6 @@
|
||||
#include <recorder_interface.h>
|
||||
#include <meteor_demodulator_interface.h>
|
||||
#include <config.h>
|
||||
#include <options.h>
|
||||
#include <cctype>
|
||||
#include <radio_interface.h>
|
||||
#define CONCAT(a, b) ((std::string(a) + b).c_str())
|
||||
@ -734,7 +733,7 @@ private:
|
||||
};
|
||||
|
||||
MOD_EXPORT void _INIT_() {
|
||||
config.setPath(options::opts.root + "/rigctl_server_config.json");
|
||||
config.setPath(core::args["root"].s() + "/rigctl_server_config.json");
|
||||
config.load(json::object());
|
||||
config.enableAutoSave();
|
||||
}
|
||||
|
Reference in New Issue
Block a user