mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 20:10:13 +02:00
Implement IAudioProcessor::canProcessSampleSize()
This commit is contained in:
@@ -167,7 +167,16 @@ void Vst3Logger::log_request(bool is_host_vst,
|
||||
log_request_base(is_host_vst, [&](auto& message) {
|
||||
message << "<IAudioProcessor* #" << request.instance_id
|
||||
<< ">::getBusArrangement(dir = " << request.dir
|
||||
<< ", index = " << request.index << ", &arr";
|
||||
<< ", index = " << request.index << ", &arr)";
|
||||
});
|
||||
}
|
||||
|
||||
void Vst3Logger::log_request(bool is_host_vst,
|
||||
const YaComponent::CanProcessSampleSize& request) {
|
||||
log_request_base(is_host_vst, [&](auto& message) {
|
||||
message << "<IAudioProcessor* #" << request.instance_id
|
||||
<< ">::canProcessSampleSize(symbolicSampleSize = "
|
||||
<< request.symbolic_sample_size << ")";
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -70,6 +70,8 @@ class Vst3Logger {
|
||||
void log_request(bool is_host_vst, const YaComponent::GetState&);
|
||||
void log_request(bool is_host_vst, const YaComponent::SetBusArrangements&);
|
||||
void log_request(bool is_host_vst, const YaComponent::GetBusArrangement&);
|
||||
void log_request(bool is_host_vst,
|
||||
const YaComponent::CanProcessSampleSize&);
|
||||
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&);
|
||||
|
||||
@@ -71,6 +71,7 @@ using ControlRequest = std::variant<YaComponent::Construct,
|
||||
YaComponent::GetState,
|
||||
YaComponent::SetBusArrangements,
|
||||
YaComponent::GetBusArrangement,
|
||||
YaComponent::CanProcessSampleSize,
|
||||
YaPluginFactory::Construct,
|
||||
YaPluginFactory::SetHostContext>;
|
||||
|
||||
|
||||
@@ -500,6 +500,26 @@ class YaComponent : public Steinberg::Vst::IComponent,
|
||||
getBusArrangement(Steinberg::Vst::BusDirection dir,
|
||||
int32 index,
|
||||
Steinberg::Vst::SpeakerArrangement& arr) override = 0;
|
||||
|
||||
/**
|
||||
* Message to pass through a call to
|
||||
* `IAudioProcessor::canProcessSampleSize(symbolic_sample_size)` to the Wine
|
||||
* plugin host.
|
||||
*/
|
||||
struct CanProcessSampleSize {
|
||||
using Response = UniversalTResult;
|
||||
|
||||
native_size_t instance_id;
|
||||
|
||||
int32 symbolic_sample_size;
|
||||
|
||||
template <typename S>
|
||||
void serialize(S& s) {
|
||||
s.value8b(instance_id);
|
||||
s.value4b(symbolic_sample_size);
|
||||
}
|
||||
};
|
||||
|
||||
virtual tresult PLUGIN_API
|
||||
canProcessSampleSize(int32 symbolicSampleSize) override = 0;
|
||||
virtual uint32 PLUGIN_API getLatencySamples() override = 0;
|
||||
|
||||
@@ -193,9 +193,11 @@ tresult PLUGIN_API YaComponentPluginImpl::getBusArrangement(
|
||||
|
||||
tresult PLUGIN_API
|
||||
YaComponentPluginImpl::canProcessSampleSize(int32 symbolicSampleSize) {
|
||||
// TODO: Implement
|
||||
bridge.logger.log("TODO: IAudioProcessor::canProcessSampleSize()");
|
||||
return Steinberg::kNotImplemented;
|
||||
return bridge
|
||||
.send_message(YaComponent::CanProcessSampleSize{
|
||||
.instance_id = arguments.instance_id,
|
||||
.symbolic_sample_size = symbolicSampleSize})
|
||||
.native();
|
||||
}
|
||||
|
||||
uint32 PLUGIN_API YaComponentPluginImpl::getLatencySamples() {
|
||||
|
||||
@@ -169,7 +169,6 @@ void Vst3Bridge::run() {
|
||||
},
|
||||
[&](YaComponent::SetBusArrangements& request)
|
||||
-> YaComponent::SetBusArrangements::Response {
|
||||
VectorStream stream;
|
||||
return component_instances[request.instance_id]
|
||||
.audio_processor->setBusArrangements(
|
||||
request.inputs.data(), request.num_ins,
|
||||
@@ -185,6 +184,12 @@ void Vst3Bridge::run() {
|
||||
return YaComponent::GetBusArrangementResponse{
|
||||
.result = result, .updated_arr = request.arr};
|
||||
},
|
||||
[&](YaComponent::CanProcessSampleSize& request)
|
||||
-> YaComponent::CanProcessSampleSize::Response {
|
||||
return component_instances[request.instance_id]
|
||||
.audio_processor->canProcessSampleSize(
|
||||
request.symbolic_sample_size);
|
||||
},
|
||||
[&](const YaPluginFactory::Construct&)
|
||||
-> YaPluginFactory::Construct::Response {
|
||||
return YaPluginFactory::ConstructArgs(
|
||||
|
||||
Reference in New Issue
Block a user