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,
YaPlugFrame::ResizeView,
YaPlugInterfaceSupport::IsPlugInterfaceSupported,
YaProgress::Start,
YaProgress::Update,
YaProgress::Finish,
YaUnitHandler::NotifyUnitSelection,
YaUnitHandler::NotifyProgramListChange,
YaUnitHandler2::NotifyUnitByBusChange>;
@@ -450,6 +450,7 @@ tresult PLUGIN_API Vst3PluginProxyImpl::setComponentHandler(
component_handler_2 = component_handler;
component_handler_3 = component_handler;
component_handler_bus_activation = component_handler;
progress = component_handler;
unit_handler = component_handler;
unit_handler_2 = component_handler;
@@ -353,6 +353,7 @@ class Vst3PluginProxyImpl : public Vst3PluginProxy {
component_handler_3;
Steinberg::FUnknownPtr<Steinberg::Vst::IComponentHandlerBusActivation>
component_handler_bus_activation;
Steinberg::FUnknownPtr<Steinberg::Vst::IProgress> progress;
Steinberg::FUnknownPtr<Steinberg::Vst::IUnitHandler> unit_handler;
Steinberg::FUnknownPtr<Steinberg::Vst::IUnitHandler2> unit_handler_2;
+29
View File
@@ -287,6 +287,35 @@ Vst3PluginBridge::Vst3PluginBridge()
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)
-> YaUnitHandler::NotifyUnitSelection::Response {
return plugin_proxies.at(request.owner_instance_id)
@@ -132,23 +132,32 @@ tresult PLUGIN_API Vst3ComponentHandlerProxyImpl::start(
ProgressType type,
const Steinberg::tchar* optionalDescription,
ID& outID) {
// TODO: Implement
std::cerr << "TODO: Implement IProgress::start()" << std::endl;
return Steinberg::kNotImplemented;
const StartResponse response = bridge.send_message(YaProgress::Start{
.owner_instance_id = owner_instance_id(),
.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
Vst3ComponentHandlerProxyImpl::update(ID id,
Steinberg::Vst::ParamValue normValue) {
// TODO: Implement
std::cerr << "TODO: Implement IProgress::update()" << std::endl;
return Steinberg::kNotImplemented;
return bridge.send_message(
YaProgress::Update{.owner_instance_id = owner_instance_id(),
.id = id,
.norm_value = normValue});
}
tresult PLUGIN_API Vst3ComponentHandlerProxyImpl::finish(ID id) {
// TODO: Implement
std::cerr << "TODO: Implement IProgress::finish()" << std::endl;
return Steinberg::kNotImplemented;
return bridge.send_message(
YaProgress::Finish{.owner_instance_id = owner_instance_id(), .id = id});
}
tresult PLUGIN_API Vst3ComponentHandlerProxyImpl::notifyUnitSelection(