Implement IUnitInfo::getProgramListInfo

This commit is contained in:
Robbert van der Helm
2020-12-26 22:17:21 +01:00
parent 92a7cb755a
commit 60f6b30b84
6 changed files with 85 additions and 4 deletions
+2 -1
View File
@@ -102,7 +102,8 @@ using ControlRequest = std::variant<Vst3PlugViewProxy::Destruct,
YaPluginFactory::SetHostContext,
YaUnitInfo::GetUnitCount,
YaUnitInfo::GetUnitInfo,
YaUnitInfo::GetProgramListCount>;
YaUnitInfo::GetProgramListCount,
YaUnitInfo::GetProgramListInfo>;
template <typename S>
void serialize(S& s, ControlRequest& payload) {
@@ -132,6 +132,40 @@ class YaUnitInfo : public Steinberg::Vst::IUnitInfo {
};
virtual int32 PLUGIN_API getProgramListCount() override = 0;
/**
* The response code and returned unit information for a call to
* `IUnitInfo::getProgramListInfo(list_index)`.
*/
struct GetProgramListInfoResponse {
UniversalTResult result;
Steinberg::Vst::ProgramListInfo info;
template <typename S>
void serialize(S& s) {
s.object(result);
s.object(info);
}
};
/**
* Message to pass through a call to
* `IUnitInfo::getProgramListInfo(list_index)` to the Wine plugin host.
*/
struct GetProgramListInfo {
using Response = GetProgramListInfoResponse;
native_size_t instance_id;
int32 list_index;
template <typename S>
void serialize(S& s) {
s.value8b(instance_id);
s.value4b(list_index);
}
};
virtual tresult PLUGIN_API getProgramListInfo(
int32 listIndex,
Steinberg::Vst::ProgramListInfo& info /*out*/) override = 0;
@@ -181,5 +215,12 @@ void serialize(S& s, UnitInfo& info) {
s.text2b(info.name);
s.value4b(info.programListId);
}
template <typename S>
void serialize(S& s, ProgramListInfo& info) {
s.value4b(info.id);
s.text2b(info.name);
s.value4b(info.programCount);
}
} // namespace Vst
} // namespace Steinberg