Add a proxy class for IParameterFunctionName

This is the last official VST3 interface we have to implement!
This commit is contained in:
Robbert van der Helm
2021-01-17 13:09:20 +01:00
parent aa1a7a1588
commit 06f6e6acfc
4 changed files with 105 additions and 1 deletions
+2
View File
@@ -139,6 +139,7 @@ vst3_plugin_sources = [
'src/common/serialization/vst3/plugin/midi-mapping.cpp',
'src/common/serialization/vst3/plugin/note-expression-controller.cpp',
'src/common/serialization/vst3/plugin/note-expression-physical-ui-mapping.cpp',
'src/common/serialization/vst3/plugin/parameter-function-name.cpp',
'src/common/serialization/vst3/plugin/plugin-base.cpp',
'src/common/serialization/vst3/plugin/prefetchable-support.cpp',
'src/common/serialization/vst3/plugin/process-context-requirements.cpp',
@@ -225,6 +226,7 @@ if with_vst3
'src/common/serialization/vst3/plugin/midi-mapping.cpp',
'src/common/serialization/vst3/plugin/note-expression-controller.cpp',
'src/common/serialization/vst3/plugin/note-expression-physical-ui-mapping.cpp',
'src/common/serialization/vst3/plugin/parameter-function-name.cpp',
'src/common/serialization/vst3/plugin/plugin-base.cpp',
'src/common/serialization/vst3/plugin/prefetchable-support.cpp',
'src/common/serialization/vst3/plugin/process-context-requirements.cpp',
+1 -1
View File
@@ -6,7 +6,6 @@ for more information on how the serialization works.
The following interfaces are not yet implemented:
- The last few VST 3.7.0 interfaces
- The [Presonus extensions](https://presonussoftware.com/en_US/developer),
although most of these things seem to overlap with newer VST3 interfaces
@@ -35,6 +34,7 @@ VST3 plugin interfaces are implemented as follows:
| `YaMidiMapping` | `Vst3PluginProxy` | `IMidiMapping` |
| `YaNoteExpressionController` | `Vst3PluginProxy` | `INoteExpressionController` |
| `YaNoteExpressionPhysicalUIMapping` | `Vst3PluginProxy` | `INoteExpressionPhysicalUIMapping` |
| `YaParameterFunctionName` | `Vst3PluginProxy` | `IParameterFunctionName` |
| `YaPluginBase` | `Vst3PluginProxy` | `IPluginBase` |
| `YaProcessContextRequirements` | `Vst3PluginProxy` | `IProcessContextRequirements` |
| `YaPrefetchableSupport` | `Vst3PluginProxy` | `IPrefetchableSupport` |
@@ -0,0 +1,27 @@
// yabridge: a Wine VST bridge
// Copyright (C) 2020-2021 Robbert van der Helm
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
#include "parameter-function-name.h"
YaParameterFunctionName::ConstructArgs::ConstructArgs() {}
YaParameterFunctionName::ConstructArgs::ConstructArgs(
Steinberg::IPtr<Steinberg::FUnknown> object)
: supported(Steinberg::FUnknownPtr<Steinberg::Vst::IParameterFunctionName>(
object)) {}
YaParameterFunctionName::YaParameterFunctionName(const ConstructArgs&& args)
: arguments(std::move(args)) {}
@@ -0,0 +1,75 @@
// yabridge: a Wine VST bridge
// Copyright (C) 2020-2021 Robbert van der Helm
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
#pragma once
#include <pluginterfaces/vst/ivstparameterfunctionname.h>
#include "../../common.h"
#include "../base.h"
#include "../host-context-proxy.h"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
/**
* Wraps around `IParameterFunctionName` for serialization purposes. Both
* components and edit controllers inherit from this. This is instantiated as
* part of `Vst3PluginProxy`.
*/
class YaParameterFunctionName : public Steinberg::Vst::IParameterFunctionName {
public:
/**
* These are the arguments for creating a `YaParameterFunctionName`.
*/
struct ConstructArgs {
ConstructArgs();
/**
* Check whether an existing implementation implements
* `IParameterFunctionName` and read arguments from it.
*/
ConstructArgs(Steinberg::IPtr<Steinberg::FUnknown> object);
/**
* Whether the object supported this interface.
*/
bool supported;
template <typename S>
void serialize(S& s) {
s.value1b(supported);
}
};
/**
* Instantiate this instance with arguments read from another interface
* implementation.
*/
YaParameterFunctionName(const ConstructArgs&& args);
inline bool supported() const { return arguments.supported; }
virtual tresult PLUGIN_API getParameterIDFromFunctionName(
Steinberg::Vst::UnitID unitID,
Steinberg::FIDString functionName,
Steinberg::Vst::ParamID& paramID) override = 0;
protected:
ConstructArgs arguments;
};
#pragma GCC diagnostic pop