mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 03:50:11 +02:00
Rearrange the configuration options
This commit is contained in:
@@ -78,7 +78,13 @@ Configuration::Configuration(const fs::path& config_path,
|
||||
// their defaults. At this point I'd really wish C++ could do pattern
|
||||
// matching.
|
||||
for (const auto& [key, value] : table) {
|
||||
if (key == "cache_time_info") {
|
||||
if (key == "group") {
|
||||
if (const auto parsed_value = value.as_string()) {
|
||||
group = parsed_value->get();
|
||||
} else {
|
||||
invalid_options.push_back(key);
|
||||
}
|
||||
} else if (key == "cache_time_info") {
|
||||
if (const auto parsed_value = value.as_boolean()) {
|
||||
cache_time_info = parsed_value->get();
|
||||
} else {
|
||||
@@ -113,12 +119,6 @@ Configuration::Configuration(const fs::path& config_path,
|
||||
} else {
|
||||
invalid_options.push_back(key);
|
||||
}
|
||||
} else if (key == "group") {
|
||||
if (const auto parsed_value = value.as_string()) {
|
||||
group = parsed_value->get();
|
||||
} else {
|
||||
invalid_options.push_back(key);
|
||||
}
|
||||
} else if (key == "vst3_no_scaling") {
|
||||
if (const auto parsed_value = value.as_boolean()) {
|
||||
vst3_no_scaling = parsed_value->get();
|
||||
|
||||
@@ -74,6 +74,13 @@ class Configuration {
|
||||
Configuration(const boost::filesystem::path& config_path,
|
||||
const boost::filesystem::path& yabridge_path);
|
||||
|
||||
/**
|
||||
* The name of the plugin group that should be used for the plugin this
|
||||
* configuration object was created for. If not set, then the plugin should
|
||||
* be hosted individually instead.
|
||||
*/
|
||||
std::optional<std::string> group;
|
||||
|
||||
/**
|
||||
* If set to `true`, then after an `audioMasterGetTime()` call all
|
||||
* subsequent calls to that function during a single processing cycle will
|
||||
@@ -151,13 +158,6 @@ class Configuration {
|
||||
*/
|
||||
bool vst3_prefer_32bit = false;
|
||||
|
||||
/**
|
||||
* The name of the plugin group that should be used for the plugin this
|
||||
* configuration object was created for. If not set, then the plugin should
|
||||
* be hosted individually instead.
|
||||
*/
|
||||
std::optional<std::string> group;
|
||||
|
||||
/**
|
||||
* The path to the configuration file that was parsed.
|
||||
*/
|
||||
@@ -189,6 +189,9 @@ class Configuration {
|
||||
|
||||
template <typename S>
|
||||
void serialize(S& s) {
|
||||
s.ext(group, bitsery::ext::StdOptional(),
|
||||
[](S& s, auto& v) { s.text1b(v, 4096); });
|
||||
|
||||
s.value1b(cache_time_info);
|
||||
s.value1b(editor_double_embed);
|
||||
s.value1b(editor_force_dnd);
|
||||
@@ -197,8 +200,6 @@ class Configuration {
|
||||
[](S& s, auto& v) { s.value4b(v); });
|
||||
s.value1b(vst3_no_scaling);
|
||||
s.value1b(vst3_prefer_32bit);
|
||||
s.ext(group, bitsery::ext::StdOptional(),
|
||||
[](S& s, auto& v) { s.text1b(v, 4096); });
|
||||
|
||||
s.ext(matched_file, bitsery::ext::StdOptional(),
|
||||
[](S& s, auto& v) { s.ext(v, bitsery::ext::BoostPath{}); });
|
||||
|
||||
Reference in New Issue
Block a user