mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-09 20:29:10 +02:00
Implement IUnitHandler::notifyProgramListChange
With this IUnitHandler has been fully implemented.
This commit is contained in:
@@ -710,6 +710,17 @@ bool Vst3Logger::log_request(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Vst3Logger::log_request(
|
||||||
|
bool is_host_vst,
|
||||||
|
const YaUnitHandler::NotifyProgramListChange& request) {
|
||||||
|
return log_request_base(is_host_vst, [&](auto& message) {
|
||||||
|
message << request.owner_instance_id
|
||||||
|
<< ": IUnitHandler::notifyProgramListChange(listId = "
|
||||||
|
<< request.list_id
|
||||||
|
<< ", programIndex = " << request.program_index << ")";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
void Vst3Logger::log_response(bool is_host_vst, const Ack&) {
|
void Vst3Logger::log_response(bool is_host_vst, const Ack&) {
|
||||||
log_response_base(is_host_vst, [&](auto& message) { message << "ACK"; });
|
log_response_base(is_host_vst, [&](auto& message) { message << "ACK"; });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -141,6 +141,8 @@ class Vst3Logger {
|
|||||||
bool log_request(bool is_host_vst, const YaPlugFrame::ResizeView&);
|
bool log_request(bool is_host_vst, const YaPlugFrame::ResizeView&);
|
||||||
bool log_request(bool is_host_vst,
|
bool log_request(bool is_host_vst,
|
||||||
const YaUnitHandler::NotifyUnitSelection&);
|
const YaUnitHandler::NotifyUnitSelection&);
|
||||||
|
bool log_request(bool is_host_vst,
|
||||||
|
const YaUnitHandler::NotifyProgramListChange&);
|
||||||
|
|
||||||
void log_response(bool is_host_vst, const Ack&);
|
void log_response(bool is_host_vst, const Ack&);
|
||||||
void log_response(
|
void log_response(
|
||||||
|
|||||||
@@ -154,7 +154,8 @@ using CallbackRequest = std::variant<WantsConfiguration,
|
|||||||
YaConnectionPoint::Notify,
|
YaConnectionPoint::Notify,
|
||||||
YaHostApplication::GetName,
|
YaHostApplication::GetName,
|
||||||
YaPlugFrame::ResizeView,
|
YaPlugFrame::ResizeView,
|
||||||
YaUnitHandler::NotifyUnitSelection>;
|
YaUnitHandler::NotifyUnitSelection,
|
||||||
|
YaUnitHandler::NotifyProgramListChange>;
|
||||||
|
|
||||||
template <typename S>
|
template <typename S>
|
||||||
void serialize(S& s, CallbackRequest& payload) {
|
void serialize(S& s, CallbackRequest& payload) {
|
||||||
|
|||||||
@@ -82,6 +82,28 @@ class YaUnitHandler : public Steinberg::Vst::IUnitHandler {
|
|||||||
|
|
||||||
virtual tresult PLUGIN_API
|
virtual tresult PLUGIN_API
|
||||||
notifyUnitSelection(Steinberg::Vst::UnitID unitId) override = 0;
|
notifyUnitSelection(Steinberg::Vst::UnitID unitId) override = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Message to pass through a call to
|
||||||
|
* `IUnitHandler::notifyProgramListChange(list_id, program_index)` to the
|
||||||
|
* unit handler provided by the host.
|
||||||
|
*/
|
||||||
|
struct NotifyProgramListChange {
|
||||||
|
using Response = UniversalTResult;
|
||||||
|
|
||||||
|
native_size_t owner_instance_id;
|
||||||
|
|
||||||
|
Steinberg::Vst::ProgramListID list_id;
|
||||||
|
int32 program_index;
|
||||||
|
|
||||||
|
template <typename S>
|
||||||
|
void serialize(S& s) {
|
||||||
|
s.value8b(owner_instance_id);
|
||||||
|
s.value4b(list_id);
|
||||||
|
s.value4b(program_index);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
virtual tresult PLUGIN_API
|
virtual tresult PLUGIN_API
|
||||||
notifyProgramListChange(Steinberg::Vst::ProgramListID listId,
|
notifyProgramListChange(Steinberg::Vst::ProgramListID listId,
|
||||||
int32 programIndex) override = 0;
|
int32 programIndex) override = 0;
|
||||||
|
|||||||
@@ -151,6 +151,13 @@ Vst3PluginBridge::Vst3PluginBridge()
|
|||||||
.get()
|
.get()
|
||||||
.unit_handler->notifyUnitSelection(request.unit_id);
|
.unit_handler->notifyUnitSelection(request.unit_id);
|
||||||
},
|
},
|
||||||
|
[&](const YaUnitHandler::NotifyProgramListChange& request)
|
||||||
|
-> YaUnitHandler::NotifyProgramListChange::Response {
|
||||||
|
return plugin_proxies.at(request.owner_instance_id)
|
||||||
|
.get()
|
||||||
|
.unit_handler->notifyProgramListChange(
|
||||||
|
request.list_id, request.program_index);
|
||||||
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,7 +76,8 @@ tresult PLUGIN_API Vst3ComponentHandlerProxyImpl::notifyUnitSelection(
|
|||||||
tresult PLUGIN_API Vst3ComponentHandlerProxyImpl::notifyProgramListChange(
|
tresult PLUGIN_API Vst3ComponentHandlerProxyImpl::notifyProgramListChange(
|
||||||
Steinberg::Vst::ProgramListID listId,
|
Steinberg::Vst::ProgramListID listId,
|
||||||
int32 programIndex) {
|
int32 programIndex) {
|
||||||
// TODO: Implement
|
return bridge.send_message(YaUnitHandler::NotifyProgramListChange{
|
||||||
std::cerr << "TODO: IUnitHandler::notifyProgramListChange" << std::endl;
|
.owner_instance_id = owner_instance_id(),
|
||||||
return Steinberg::kNotImplemented;
|
.list_id = listId,
|
||||||
|
.program_index = programIndex});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user