diff options
author | falkTX <falktx@gmail.com> | 2015-04-24 00:19:54 +0200 |
---|---|---|
committer | falkTX <falktx@gmail.com> | 2015-04-24 00:19:54 +0200 |
commit | f32b41625da5f988326b0657fd37ffe10ff7f2e7 (patch) | |
tree | 26797ac3e06da68b366ab48ee5e08d7ef5a65853 /distrho/DistrhoPlugin.hpp | |
parent | cba9f00f2c71ec7bb40963a3d05c0d8d17887f03 (diff) |
Add AudioPort struct and hints; Implement CV and Sidechain in LV2
Diffstat (limited to 'distrho/DistrhoPlugin.hpp')
-rw-r--r-- | distrho/DistrhoPlugin.hpp | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/distrho/DistrhoPlugin.hpp b/distrho/DistrhoPlugin.hpp index b9f9cdc6..4c2f4d0b 100644 --- a/distrho/DistrhoPlugin.hpp +++ b/distrho/DistrhoPlugin.hpp @@ -186,6 +186,29 @@ START_NAMESPACE_DISTRHO #endif /* ------------------------------------------------------------------------------------------------------------ + * Audio Port Hints */ + +/** + @defgroup AudioPortHints Audio Port Hints + + Various audio port hints. + @see AudioPort::hints + @{ + */ + +/** + Audio port can be used as control voltage (LV2 only). + */ +static const uint32_t kAudioPortIsCV = 0x1; + +/** + Audio port should be used as sidechan (LV2 only). + */ +static const uint32_t kAudioPortIsSidechain = 0x2; + +/** @} */ + +/* ------------------------------------------------------------------------------------------------------------ * Parameter Hints */ /** @@ -244,6 +267,40 @@ static const uint32_t kParameterIsCV = 0x20; */ /** + Audio Port. + */ +struct AudioPort { + /** + Hints describing this audio port. + @see AudioPortHints + */ + uint32_t hints; + + /** + The name of this audio port. + An audio port name can contain any character, but hosts might have a hard time with non-ascii ones. + The name doesn't have to be unique within a plugin instance, but it's recommended. + */ + d_string name; + + /** + The symbol of this audio port. + An audio port symbol is a short restricted name used as a machine and human readable identifier. + The first character must be one of _, a-z or A-Z and subsequent characters can be from _, a-z, A-Z and 0-9. + @note: Audio port and parameter symbols MUST be unique within a plugin instance. + */ + d_string symbol; + + /** + Default constructor for a regular audio port. + */ + AudioPort() noexcept + : hints(0x0), + name(), + symbol() {} +}; + +/** Parameter ranges. This is used to set the default, minimum and maximum values of a parameter. @@ -671,6 +728,12 @@ protected: * Init */ /** + Initialize the audio port @a index. + This function will be called once, shortly after the plugin is created. + */ + virtual void d_initAudioPort(bool input, uint32_t index, AudioPort& port); + + /** Initialize the parameter @a index. This function will be called once, shortly after the plugin is created. */ |