mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-14 12:30:00 +02:00
Clean up the query interface serialization
This commit is contained in:
@@ -138,7 +138,7 @@ class Configuration {
|
||||
s.ext(group, bitsery::ext::StdOptional(),
|
||||
[](S& s, auto& v) { s.text1b(v, 4096); });
|
||||
s.ext(matched_file, bitsery::ext::StdOptional(),
|
||||
[](S& s, auto& v) { s.ext(v, bitsery::ext::BoostPath()); });
|
||||
[](S& s, auto& v) { s.ext(v, bitsery::ext::BoostPath{}); });
|
||||
s.ext(matched_pattern, bitsery::ext::StdOptional(),
|
||||
[](S& s, auto& v) { s.text1b(v, 4096); });
|
||||
|
||||
|
||||
@@ -37,14 +37,15 @@ tresult PLUGIN_API YaPluginFactory::queryInterface(Steinberg::FIDString _iid,
|
||||
void** obj) {
|
||||
QUERY_INTERFACE(_iid, obj, Steinberg::FUnknown::iid,
|
||||
Steinberg::IPluginFactory)
|
||||
QUERY_INTERFACE(_iid, obj, Steinberg::IPluginFactory::iid,
|
||||
Steinberg::IPluginFactory)
|
||||
if (actual_iid == Steinberg::IPluginFactory2::iid ||
|
||||
actual_iid == Steinberg::IPluginFactory3::iid) {
|
||||
if (known_iids.contains(Steinberg::IPluginFactory::iid)) {
|
||||
QUERY_INTERFACE(_iid, obj, Steinberg::IPluginFactory::iid,
|
||||
Steinberg::IPluginFactory)
|
||||
}
|
||||
if (known_iids.contains(Steinberg::IPluginFactory2::iid)) {
|
||||
QUERY_INTERFACE(_iid, obj, Steinberg::IPluginFactory2::iid,
|
||||
Steinberg::IPluginFactory2)
|
||||
}
|
||||
if (actual_iid == Steinberg::IPluginFactory3::iid) {
|
||||
if (known_iids.contains(Steinberg::IPluginFactory3::iid)) {
|
||||
QUERY_INTERFACE(_iid, obj, Steinberg::IPluginFactory3::iid,
|
||||
Steinberg::IPluginFactory3)
|
||||
}
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <set>
|
||||
|
||||
#include <bitsery/ext/std_set.h>
|
||||
#include <pluginterfaces/base/ipluginbase.h>
|
||||
|
||||
#include "../../bitsery/ext/vst3.h"
|
||||
@@ -68,13 +71,16 @@ class YaPluginFactory : public Steinberg::IPluginFactory3 {
|
||||
tresult PLUGIN_API setHostContext(Steinberg::FUnknown* context) override;
|
||||
|
||||
/**
|
||||
* The IID of the interface we should report as.
|
||||
* The IIDs that the interface we serialized supports.
|
||||
*/
|
||||
Steinberg::FUID actual_iid;
|
||||
std::set<Steinberg::FUID> known_iids;
|
||||
|
||||
template <typename S>
|
||||
void serialize(S& s) {
|
||||
s.ext(actual_iid, bitsery::ext::FUID());
|
||||
s.ext(known_iids, bitsery::ext::StdSet{32},
|
||||
[](S& s, Steinberg::FUID& iid) {
|
||||
s.ext(iid, bitsery::ext::FUID{});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user