Implement IUnitHandler::notifyUnitSelection

This commit is contained in:
Robbert van der Helm
2020-12-26 14:26:00 +01:00
parent 934aea3860
commit bf40e10780
9 changed files with 54 additions and 8 deletions
+10
View File
@@ -700,6 +700,16 @@ bool Vst3Logger::log_request(bool is_host_vst,
});
}
bool Vst3Logger::log_request(
bool is_host_vst,
const YaUnitHandler::NotifyUnitSelection& request) {
return log_request_base(is_host_vst, [&](auto& message) {
message << request.owner_instance_id
<< ": IUnitHandler::notifyUnitSelection(unitId = "
<< request.unit_id << ")";
});
}
void Vst3Logger::log_response(bool is_host_vst, const Ack&) {
log_response_base(is_host_vst, [&](auto& message) { message << "ACK"; });
}
+2
View File
@@ -139,6 +139,8 @@ class Vst3Logger {
const YaComponentHandler::RestartComponent&);
bool log_request(bool is_host_vst, const YaHostApplication::GetName&);
bool log_request(bool is_host_vst, const YaPlugFrame::ResizeView&);
bool log_request(bool is_host_vst,
const YaUnitHandler::NotifyUnitSelection&);
void log_response(bool is_host_vst, const Ack&);
void log_response(
+2 -1
View File
@@ -153,7 +153,8 @@ using CallbackRequest = std::variant<WantsConfiguration,
// there
YaConnectionPoint::Notify,
YaHostApplication::GetName,
YaPlugFrame::ResizeView>;
YaPlugFrame::ResizeView,
YaUnitHandler::NotifyUnitSelection>;
template <typename S>
void serialize(S& s, CallbackRequest& payload) {
@@ -61,6 +61,25 @@ class YaUnitHandler : public Steinberg::Vst::IUnitHandler {
inline bool supported() const { return arguments.supported; }
/**
* Message to pass through a call to
* `IUnitHandler::notifyUnitSelection(unit_id)` to the unit handler provided
* by the host.
*/
struct NotifyUnitSelection {
using Response = UniversalTResult;
native_size_t owner_instance_id;
Steinberg::Vst::UnitID unit_id;
template <typename S>
void serialize(S& s) {
s.value8b(owner_instance_id);
s.value4b(unit_id);
}
};
virtual tresult PLUGIN_API
notifyUnitSelection(Steinberg::Vst::UnitID unitId) override = 0;
virtual tresult PLUGIN_API