Fully implement IProgress

`IParameterFunctionName` will be the last interface before we _in
theory_ support all VST3 features.
This commit is contained in:
Robbert van der Helm
2021-01-17 00:19:48 +01:00
parent 1dc900aff9
commit aa1a7a1588
5 changed files with 52 additions and 9 deletions
+3
View File
@@ -208,6 +208,9 @@ using CallbackRequest =
YaHostApplication::GetName, YaHostApplication::GetName,
YaPlugFrame::ResizeView, YaPlugFrame::ResizeView,
YaPlugInterfaceSupport::IsPlugInterfaceSupported, YaPlugInterfaceSupport::IsPlugInterfaceSupported,
YaProgress::Start,
YaProgress::Update,
YaProgress::Finish,
YaUnitHandler::NotifyUnitSelection, YaUnitHandler::NotifyUnitSelection,
YaUnitHandler::NotifyProgramListChange, YaUnitHandler::NotifyProgramListChange,
YaUnitHandler2::NotifyUnitByBusChange>; YaUnitHandler2::NotifyUnitByBusChange>;
@@ -450,6 +450,7 @@ tresult PLUGIN_API Vst3PluginProxyImpl::setComponentHandler(
component_handler_2 = component_handler; component_handler_2 = component_handler;
component_handler_3 = component_handler; component_handler_3 = component_handler;
component_handler_bus_activation = component_handler; component_handler_bus_activation = component_handler;
progress = component_handler;
unit_handler = component_handler; unit_handler = component_handler;
unit_handler_2 = component_handler; unit_handler_2 = component_handler;
@@ -353,6 +353,7 @@ class Vst3PluginProxyImpl : public Vst3PluginProxy {
component_handler_3; component_handler_3;
Steinberg::FUnknownPtr<Steinberg::Vst::IComponentHandlerBusActivation> Steinberg::FUnknownPtr<Steinberg::Vst::IComponentHandlerBusActivation>
component_handler_bus_activation; component_handler_bus_activation;
Steinberg::FUnknownPtr<Steinberg::Vst::IProgress> progress;
Steinberg::FUnknownPtr<Steinberg::Vst::IUnitHandler> unit_handler; Steinberg::FUnknownPtr<Steinberg::Vst::IUnitHandler> unit_handler;
Steinberg::FUnknownPtr<Steinberg::Vst::IUnitHandler2> unit_handler_2; Steinberg::FUnknownPtr<Steinberg::Vst::IUnitHandler2> unit_handler_2;
+29
View File
@@ -287,6 +287,35 @@ Vst3PluginBridge::Vst3PluginBridge()
request.iid.data()); request.iid.data());
} }
}, },
[&](const YaProgress::Start& request)
-> YaProgress::Start::Response {
Steinberg::Vst::IProgress::ID out_id;
const tresult result =
plugin_proxies.at(request.owner_instance_id)
.get()
.progress->start(
request.type,
request.optional_description
? u16string_to_tchar_pointer(
*request.optional_description)
: nullptr,
out_id);
return YaProgress::StartResponse{.result = result,
.out_id = out_id};
},
[&](const YaProgress::Update& request)
-> YaProgress::Update::Response {
return plugin_proxies.at(request.owner_instance_id)
.get()
.progress->update(request.id, request.norm_value);
},
[&](const YaProgress::Finish& request)
-> YaProgress::Finish::Response {
return plugin_proxies.at(request.owner_instance_id)
.get()
.progress->finish(request.id);
},
[&](const YaUnitHandler::NotifyUnitSelection& request) [&](const YaUnitHandler::NotifyUnitSelection& request)
-> YaUnitHandler::NotifyUnitSelection::Response { -> YaUnitHandler::NotifyUnitSelection::Response {
return plugin_proxies.at(request.owner_instance_id) return plugin_proxies.at(request.owner_instance_id)
@@ -132,23 +132,32 @@ tresult PLUGIN_API Vst3ComponentHandlerProxyImpl::start(
ProgressType type, ProgressType type,
const Steinberg::tchar* optionalDescription, const Steinberg::tchar* optionalDescription,
ID& outID) { ID& outID) {
// TODO: Implement const StartResponse response = bridge.send_message(YaProgress::Start{
std::cerr << "TODO: Implement IProgress::start()" << std::endl; .owner_instance_id = owner_instance_id(),
return Steinberg::kNotImplemented; .type = type,
.optional_description =
(optionalDescription
? std::optional<std::u16string>(
tchar_pointer_to_u16string(optionalDescription))
: std::nullopt)});
outID = response.out_id;
return response.result;
} }
tresult PLUGIN_API tresult PLUGIN_API
Vst3ComponentHandlerProxyImpl::update(ID id, Vst3ComponentHandlerProxyImpl::update(ID id,
Steinberg::Vst::ParamValue normValue) { Steinberg::Vst::ParamValue normValue) {
// TODO: Implement return bridge.send_message(
std::cerr << "TODO: Implement IProgress::update()" << std::endl; YaProgress::Update{.owner_instance_id = owner_instance_id(),
return Steinberg::kNotImplemented; .id = id,
.norm_value = normValue});
} }
tresult PLUGIN_API Vst3ComponentHandlerProxyImpl::finish(ID id) { tresult PLUGIN_API Vst3ComponentHandlerProxyImpl::finish(ID id) {
// TODO: Implement return bridge.send_message(
std::cerr << "TODO: Implement IProgress::finish()" << std::endl; YaProgress::Finish{.owner_instance_id = owner_instance_id(), .id = id});
return Steinberg::kNotImplemented;
} }
tresult PLUGIN_API Vst3ComponentHandlerProxyImpl::notifyUnitSelection( tresult PLUGIN_API Vst3ComponentHandlerProxyImpl::notifyUnitSelection(