Search for the group host when using plugin groups

This commit is contained in:
Robbert van der Helm
2020-05-22 14:00:45 +02:00
parent fea256655d
commit 27af0f8c11
4 changed files with 20 additions and 16 deletions
+3 -3
View File
@@ -50,9 +50,10 @@ PluginBridge& get_bridge_instance(const AEffect& plugin) {
}
PluginBridge::PluginBridge(audioMasterCallback host_callback)
: vst_plugin_path(find_vst_plugin()),
: config(Configuration::load_for(get_this_file_location())),
vst_plugin_path(find_vst_plugin()),
vst_plugin_arch(find_vst_architecture(vst_plugin_path)),
vst_host_path(find_vst_host(vst_plugin_arch)),
vst_host_path(find_vst_host(vst_plugin_arch, config.group.has_value())),
// All the fields should be zero initialized because
// `Vst2PluginInstance::vstAudioMasterCallback` from Bitwig's plugin
// bridge will crash otherwise
@@ -68,7 +69,6 @@ PluginBridge::PluginBridge(audioMasterCallback host_callback)
host_callback_function(host_callback),
logger(Logger::create_from_environment(
create_logger_prefix(socket_endpoint.path()))),
config(Configuration::load_for(get_this_file_location())),
wine_version(get_wine_version()),
wine_stdout(io_context),
wine_stderr(io_context) {
+8 -8
View File
@@ -74,6 +74,14 @@ class PluginBridge {
float get_parameter(AEffect* plugin, int index);
void set_parameter(AEffect* plugin, int index, float value);
/**
* The configuration for this instance of yabridge. Set based on the values
* from a `yabridge.toml`, if it exists.
*
* @see Configuration::load_for
*/
Configuration config;
/**
* The path to the .dll being loaded in the Wine VST host.
*/
@@ -198,14 +206,6 @@ class PluginBridge {
*/
Logger logger;
/**
* The configuration for this instance of yabridge. Set based on the values
* from a `yabridge.toml`, if it exists.
*
* @see Configuration::load_for
*/
Configuration config;
/**
* The version of Wine currently in use. Used in the debug output on plugin
* startup.
+5 -4
View File
@@ -111,11 +111,12 @@ PluginArchitecture find_vst_architecture(fs::path plugin_path) {
throw std::runtime_error(error_msg.str());
}
fs::path find_vst_host(PluginArchitecture plugin_arch) {
// TODO: Take plugin group settings into account
auto host_name = yabridge_individual_host_name;
fs::path find_vst_host(PluginArchitecture plugin_arch, bool use_plugin_groups) {
auto host_name = use_plugin_groups ? yabridge_group_host_name
: yabridge_individual_host_name;
if (plugin_arch == PluginArchitecture::vst_32) {
host_name = yabridge_individual_host_name_32bit;
host_name = use_plugin_groups ? yabridge_group_host_name_32bit
: yabridge_individual_host_name_32bit;
}
fs::path host_path =
+4 -1
View File
@@ -80,11 +80,14 @@ PluginArchitecture find_vst_architecture(boost::filesystem::path);
*
* @param plugin_arch The architecture of the plugin, either 64-bit or 32-bit.
* Used to determine which host application to use, if available.
* @param use_plugin_groups Whether the plugin is using plugin groups and we
* should be looking for the group host instead of the individual plugin host.
*
* @return The a path to the VST host, if found.
* @throw std::runtime_error If the Wine VST host could not be found.
*/
boost::filesystem::path find_vst_host(PluginArchitecture plugin_arch);
boost::filesystem::path find_vst_host(PluginArchitecture plugin_arch,
bool use_plugin_groups);
/**
* Find the VST plugin .dll file that corresponds to this copy of