mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 03:50:11 +02:00
Fully implement IKeyswitchController
This commit is contained in:
@@ -91,6 +91,8 @@ using ControlRequest =
|
||||
YaEditController2::OpenAboutBox,
|
||||
YaEditControllerHostEditing::BeginEditFromHost,
|
||||
YaEditControllerHostEditing::EndEditFromHost,
|
||||
YaKeyswitchController::GetKeyswitchCount,
|
||||
YaKeyswitchController::GetKeyswitchInfo,
|
||||
YaMidiMapping::GetMidiControllerAssignment,
|
||||
YaNoteExpressionController::GetNoteExpressionCount,
|
||||
YaNoteExpressionController::GetNoteExpressionInfo,
|
||||
|
||||
@@ -465,9 +465,10 @@ Vst3PluginProxyImpl::endEditFromHost(Steinberg::Vst::ParamID paramID) {
|
||||
|
||||
int32 PLUGIN_API Vst3PluginProxyImpl::getKeyswitchCount(int32 busIndex,
|
||||
int16 channel) {
|
||||
// TODO: Implement
|
||||
bridge.logger.log("TODO: IKeyswitchController::getKeyswitchCount()");
|
||||
return Steinberg::kNotImplemented;
|
||||
return bridge.send_message(
|
||||
YaKeyswitchController::GetKeyswitchCount{.instance_id = instance_id(),
|
||||
.bus_index = busIndex,
|
||||
.channel = channel});
|
||||
}
|
||||
|
||||
tresult PLUGIN_API Vst3PluginProxyImpl::getKeyswitchInfo(
|
||||
@@ -475,9 +476,16 @@ tresult PLUGIN_API Vst3PluginProxyImpl::getKeyswitchInfo(
|
||||
int16 channel,
|
||||
int32 keySwitchIndex,
|
||||
Steinberg::Vst::KeyswitchInfo& info /*out*/) {
|
||||
// TODO: Implement
|
||||
bridge.logger.log("TODO: IKeyswitchController::getKeyswitchInfo()");
|
||||
return Steinberg::kNotImplemented;
|
||||
const GetKeyswitchInfoResponse response =
|
||||
bridge.send_message(YaKeyswitchController::GetKeyswitchInfo{
|
||||
.instance_id = instance_id(),
|
||||
.bus_index = busIndex,
|
||||
.channel = channel,
|
||||
.key_switch_index = keySwitchIndex});
|
||||
|
||||
info = response.info;
|
||||
|
||||
return response.result;
|
||||
}
|
||||
|
||||
tresult PLUGIN_API Vst3PluginProxyImpl::getMidiControllerAssignment(
|
||||
|
||||
@@ -44,6 +44,7 @@ InstanceInterfaces::InstanceInterfaces(
|
||||
edit_controller(object),
|
||||
edit_controller_2(object),
|
||||
edit_controller_host_editing(object),
|
||||
keyswitch_controller(object),
|
||||
midi_mapping(object),
|
||||
note_expression_controller(object),
|
||||
plugin_base(object),
|
||||
@@ -411,6 +412,24 @@ void Vst3Bridge::run() {
|
||||
.edit_controller_host_editing->endEditFromHost(
|
||||
request.param_id);
|
||||
},
|
||||
[&](const YaKeyswitchController::GetKeyswitchCount& request)
|
||||
-> YaKeyswitchController::GetKeyswitchCount::Response {
|
||||
return object_instances[request.instance_id]
|
||||
.keyswitch_controller->getKeyswitchCount(request.bus_index,
|
||||
request.channel);
|
||||
},
|
||||
[&](const YaKeyswitchController::GetKeyswitchInfo& request)
|
||||
-> YaKeyswitchController::GetKeyswitchInfo::Response {
|
||||
Steinberg::Vst::KeyswitchInfo info{};
|
||||
const tresult result =
|
||||
object_instances[request.instance_id]
|
||||
.keyswitch_controller->getKeyswitchInfo(
|
||||
request.bus_index, request.channel,
|
||||
request.key_switch_index, info);
|
||||
|
||||
return YaKeyswitchController::GetKeyswitchInfoResponse{
|
||||
.result = result, .info = std::move(info)};
|
||||
},
|
||||
[&](const YaMidiMapping::GetMidiControllerAssignment& request)
|
||||
-> YaMidiMapping::GetMidiControllerAssignment::Response {
|
||||
Steinberg::Vst::ParamID id;
|
||||
@@ -780,7 +799,7 @@ void Vst3Bridge::run() {
|
||||
},
|
||||
[&](const YaUnitInfo::GetUnitInfo& request)
|
||||
-> YaUnitInfo::GetUnitInfo::Response {
|
||||
Steinberg::Vst::UnitInfo info;
|
||||
Steinberg::Vst::UnitInfo info{};
|
||||
const tresult result =
|
||||
object_instances[request.instance_id]
|
||||
.unit_info->getUnitInfo(request.unit_index, info);
|
||||
@@ -795,7 +814,7 @@ void Vst3Bridge::run() {
|
||||
},
|
||||
[&](const YaUnitInfo::GetProgramListInfo& request)
|
||||
-> YaUnitInfo::GetProgramListInfo::Response {
|
||||
Steinberg::Vst::ProgramListInfo info;
|
||||
Steinberg::Vst::ProgramListInfo info{};
|
||||
const tresult result = object_instances[request.instance_id]
|
||||
.unit_info->getProgramListInfo(
|
||||
request.list_index, info);
|
||||
|
||||
@@ -154,6 +154,8 @@ struct InstanceInterfaces {
|
||||
Steinberg::FUnknownPtr<Steinberg::Vst::IEditController2> edit_controller_2;
|
||||
Steinberg::FUnknownPtr<Steinberg::Vst::IEditControllerHostEditing>
|
||||
edit_controller_host_editing;
|
||||
Steinberg::FUnknownPtr<Steinberg::Vst::IKeyswitchController>
|
||||
keyswitch_controller;
|
||||
Steinberg::FUnknownPtr<Steinberg::Vst::IMidiMapping> midi_mapping;
|
||||
Steinberg::FUnknownPtr<Steinberg::Vst::INoteExpressionController>
|
||||
note_expression_controller;
|
||||
|
||||
Reference in New Issue
Block a user