Add a configuration option for double embedding

Only plugin that needs this so far is PSPaudioware's E27 (and likely
other PSP plugins with expandable GUIs).
This commit is contained in:
Robbert van der Helm
2020-07-23 15:59:00 +02:00
parent 523f77d334
commit 967856fc1b
3 changed files with 24 additions and 0 deletions
+2
View File
@@ -49,6 +49,8 @@ Configuration::Configuration(const fs::path& config_path,
// If the table is missing some fields then they will simply be left at
// their defaults
if (toml::table* config = value.as_table()) {
editor_double_embed =
(*config)["editor_double_embed"].value<bool>().value_or(false);
group = (*config)["group"].value<std::string>();
}
+15
View File
@@ -73,6 +73,20 @@ class Configuration {
Configuration(const boost::filesystem::path& config_path,
const boost::filesystem::path& yabridge_path);
/**
* If this is set to true, then the plugin editor should be embedded in yet
* another window. This would result in an embedding sequence of
* `<window_provided_by_host> <-> <wine_parent_window> <->
* <wine_child_window> <-> <window_created_by_plugin>`, where
* `<wine_child_window>` is the new addition. The only plugin I've
* encountered where this was necessary was PSPaudioware E27 (and it likely
* also applies to other PSPaudioware plugins with expandable GUIs). I also
* haven't noticed any issues caused from having this enabled, but having it
* behind a flag reduces the amount of moving parts so that's probably a
* better idea.
*/
bool editor_double_embed = 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
@@ -92,6 +106,7 @@ class Configuration {
template <typename S>
void serialize(S& s) {
s.value1b(editor_double_embed);
s.ext(group, bitsery::ext::StdOptional(),
[](S& s, auto& v) { s.text1b(v, 4096); });
s.ext(matched_file, bitsery::ext::StdOptional(),
+7
View File
@@ -633,6 +633,13 @@ void PluginBridge::log_init_message() {
init_msg << ", 64-bit";
}
init_msg << "'" << std::endl;
init_msg << "other options: '";
if (config.editor_double_embed) {
init_msg << "editor: double embed";
} else {
init_msg << "<none>";
}
init_msg << "'" << std::endl;
init_msg << std::endl;
// Include a list of enabled compile-tiem features, mostly to make debug