Add stubs for IUnitHandler2

This commit is contained in:
Robbert van der Helm
2021-01-10 23:49:58 +01:00
parent cbb8ebaf5d
commit 89111d2f5f
4 changed files with 21 additions and 2 deletions
@@ -25,13 +25,15 @@ Vst3ComponentHandlerProxy::ConstructArgs::ConstructArgs(
component_handler_args(object),
component_handler_2_args(object),
component_handler_3_args(object),
unit_handler_args(object) {}
unit_handler_args(object),
unit_handler_2_args(object) {}
Vst3ComponentHandlerProxy::Vst3ComponentHandlerProxy(const ConstructArgs&& args)
: YaComponentHandler(std::move(args.component_handler_args)),
YaComponentHandler2(std::move(args.component_handler_2_args)),
YaComponentHandler3(std::move(args.component_handler_3_args)),
YaUnitHandler(std::move(args.unit_handler_args)),
YaUnitHandler2(std::move(args.unit_handler_2_args)),
arguments(std::move(args)){FUNKNOWN_CTOR}
Vst3ComponentHandlerProxy::~Vst3ComponentHandlerProxy() {
@@ -64,6 +66,10 @@ Vst3ComponentHandlerProxy::queryInterface(Steinberg::FIDString _iid,
QUERY_INTERFACE(_iid, obj, Steinberg::Vst::IUnitHandler::iid,
Steinberg::Vst::IUnitHandler)
}
if (YaUnitHandler2::supported()) {
QUERY_INTERFACE(_iid, obj, Steinberg::Vst::IUnitHandler2::iid,
Steinberg::Vst::IUnitHandler2)
}
*obj = nullptr;
return Steinberg::kNoInterface;
@@ -20,6 +20,7 @@
#include "component-handler/component-handler-2.h"
#include "component-handler/component-handler-3.h"
#include "component-handler/component-handler.h"
#include "component-handler/unit-handler-2.h"
#include "component-handler/unit-handler.h"
#pragma GCC diagnostic push
@@ -36,7 +37,8 @@
class Vst3ComponentHandlerProxy : public YaComponentHandler,
public YaComponentHandler2,
public YaComponentHandler3,
public YaUnitHandler {
public YaUnitHandler,
public YaUnitHandler2 {
public:
/**
* These are the arguments for constructing a
@@ -64,6 +66,7 @@ class Vst3ComponentHandlerProxy : public YaComponentHandler,
YaComponentHandler2::ConstructArgs component_handler_2_args;
YaComponentHandler3::ConstructArgs component_handler_3_args;
YaUnitHandler::ConstructArgs unit_handler_args;
YaUnitHandler2::ConstructArgs unit_handler_2_args;
template <typename S>
void serialize(S& s) {
@@ -72,6 +75,7 @@ class Vst3ComponentHandlerProxy : public YaComponentHandler,
s.object(component_handler_2_args);
s.object(component_handler_3_args);
s.object(unit_handler_args);
s.object(unit_handler_2_args);
}
};
@@ -128,3 +128,9 @@ tresult PLUGIN_API Vst3ComponentHandlerProxyImpl::notifyProgramListChange(
.list_id = listId,
.program_index = programIndex});
}
tresult PLUGIN_API Vst3ComponentHandlerProxyImpl::notifyUnitByBusChange() {
// TODO: Implement
std::cerr << "TODO: IUnitHandler2::notifyUnitSelection()" << std::endl;
return Steinberg::kNotImplemented;
}
@@ -57,6 +57,9 @@ class Vst3ComponentHandlerProxyImpl : public Vst3ComponentHandlerProxy {
notifyProgramListChange(Steinberg::Vst::ProgramListID listId,
int32 programIndex) override;
// From `IUnitHandler2`
tresult PLUGIN_API notifyUnitByBusChange() override;
private:
Vst3Bridge& bridge;
};