mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-15 13:00:02 +02:00
Implement IComponent::setState()
This commit is contained in:
@@ -133,6 +133,15 @@ void Vst3Logger::log_request(bool is_host_vst,
|
||||
});
|
||||
}
|
||||
|
||||
void Vst3Logger::log_request(bool is_host_vst,
|
||||
const YaComponent::SetState& request) {
|
||||
log_request_base(is_host_vst, [&](auto& message) {
|
||||
message << "<IComponent* #" << request.instance_id
|
||||
<< ">::setState(state = <IBStream* containing "
|
||||
<< request.state.size() << "bytes>)";
|
||||
});
|
||||
}
|
||||
|
||||
void Vst3Logger::log_request(bool is_host_vst,
|
||||
const YaPluginFactory::Construct&) {
|
||||
log_request_base(is_host_vst,
|
||||
|
||||
@@ -66,6 +66,7 @@ class Vst3Logger {
|
||||
void log_request(bool is_host_vst, const YaComponent::GetRoutingInfo&);
|
||||
void log_request(bool is_host_vst, const YaComponent::ActivateBus&);
|
||||
void log_request(bool is_host_vst, const YaComponent::SetActive&);
|
||||
void log_request(bool is_host_vst, const YaComponent::SetState&);
|
||||
void log_request(bool is_host_vst, const YaPluginFactory::Construct&);
|
||||
void log_request(bool is_host_vst, const YaPluginFactory::SetHostContext&);
|
||||
void log_request(bool is_host_vst, const WantsConfiguration&);
|
||||
|
||||
@@ -67,6 +67,7 @@ using ControlRequest = std::variant<YaComponent::Construct,
|
||||
YaComponent::GetRoutingInfo,
|
||||
YaComponent::ActivateBus,
|
||||
YaComponent::SetActive,
|
||||
YaComponent::SetState,
|
||||
YaPluginFactory::Construct,
|
||||
YaPluginFactory::SetHostContext>;
|
||||
|
||||
|
||||
@@ -175,6 +175,10 @@ tresult PLUGIN_API VectorStream::queryInterface(Steinberg::FIDString _iid,
|
||||
return Steinberg::kNoInterface;
|
||||
}
|
||||
|
||||
size_t VectorStream::size() const {
|
||||
return buffer.size();
|
||||
}
|
||||
|
||||
tresult PLUGIN_API VectorStream::read(void* buffer,
|
||||
int32 numBytes,
|
||||
int32* numBytesRead) {
|
||||
|
||||
@@ -134,6 +134,11 @@ class VectorStream : public Steinberg::IBStream,
|
||||
|
||||
DECLARE_FUNKNOWN_METHODS
|
||||
|
||||
/**
|
||||
* Return the buffer's, used in the logging messages.
|
||||
*/
|
||||
size_t size() const;
|
||||
|
||||
// From `IBstream`
|
||||
tresult PLUGIN_API read(void* buffer,
|
||||
int32 numBytes,
|
||||
|
||||
@@ -350,6 +350,25 @@ class YaComponent : public Steinberg::Vst::IComponent {
|
||||
};
|
||||
|
||||
virtual tresult PLUGIN_API setActive(TBool state) override = 0;
|
||||
|
||||
/**
|
||||
* Message to pass through a call to `IComponent::setState(state)` to the
|
||||
* Wine plugin host.
|
||||
*/
|
||||
struct SetState {
|
||||
using Response = UniversalTResult;
|
||||
|
||||
native_size_t instance_id;
|
||||
|
||||
VectorStream state;
|
||||
|
||||
template <typename S>
|
||||
void serialize(S& s) {
|
||||
s.value8b(instance_id);
|
||||
s.object(state);
|
||||
}
|
||||
};
|
||||
|
||||
virtual tresult PLUGIN_API
|
||||
setState(Steinberg::IBStream* state) override = 0;
|
||||
virtual tresult PLUGIN_API
|
||||
|
||||
Reference in New Issue
Block a user