Pass plugin type when calling the host application

This commit is contained in:
Robbert van der Helm
2020-11-30 23:04:28 +01:00
parent 1142c908df
commit f9bb3822de
6 changed files with 42 additions and 21 deletions
+7 -5
View File
@@ -53,9 +53,9 @@ LibArchitecture find_dll_architecture(const fs::path& plugin_path) {
}
PluginType plugin_type_from_string(const std::string& plugin_type) {
if (plugin_type == "vst2") {
if (plugin_type == "VST2") {
return PluginType::vst2;
} else if (plugin_type == "vst3") {
} else if (plugin_type == "VST3") {
return PluginType::vst3;
} else {
return PluginType::unknown;
@@ -63,11 +63,13 @@ PluginType plugin_type_from_string(const std::string& plugin_type) {
}
std::string plugin_type_to_string(const PluginType& plugin_type) {
// We'll capitalize the acronyms because this is also our human readable
// format
if (plugin_type == PluginType::vst2) {
return "vst2";
return "VST2";
} else if (plugin_type == PluginType::vst3) {
return "vst3";
return "VST3";
} else {
return "unknown";
return "<unknown>";
}
}
+4
View File
@@ -22,6 +22,8 @@
#include <cstdint>
#include <type_traits>
#include "../plugins.h"
// The plugin should always be compiled to a 64-bit version, but the host
// application can also be 32-bit to allow using 32-bit legacy Windows VST in a
// modern Linux VST host. Because of this we have to make sure to always use
@@ -54,11 +56,13 @@ overload(Ts...) -> overload<Ts...>;
* to `yabridge-host.exe` were the plugin to be hosted individually.
*/
struct GroupRequest {
PluginType plugin_type;
std::string plugin_path;
std::string endpoint_base_dir;
template <typename S>
void serialize(S& s) {
s.object(plugin_type);
s.text1b(plugin_path, 4096);
s.text1b(endpoint_base_dir, 4096);
}