Browse Source

VST3: Update VST3 SDK files

v6.1.6
reuk 4 years ago
parent
commit
52e6c4f727
No known key found for this signature in database GPG Key ID: 9ADCD339CFC98A11
91 changed files with 2398 additions and 1637 deletions
  1. +1
    -1
      modules/juce_audio_processors/format_types/VST3_SDK/LICENSE.txt
  2. +6
    -249
      modules/juce_audio_processors/format_types/VST3_SDK/README.md
  3. +1
    -1
      modules/juce_audio_processors/format_types/VST3_SDK/base/LICENSE.txt
  4. +4
    -1
      modules/juce_audio_processors/format_types/VST3_SDK/base/README.md
  5. +1
    -1
      modules/juce_audio_processors/format_types/VST3_SDK/base/source/baseiids.cpp
  6. +1
    -1
      modules/juce_audio_processors/format_types/VST3_SDK/base/source/classfactoryhelpers.h
  7. +3
    -4
      modules/juce_audio_processors/format_types/VST3_SDK/base/source/fbuffer.cpp
  8. +3
    -3
      modules/juce_audio_processors/format_types/VST3_SDK/base/source/fbuffer.h
  9. +86
    -81
      modules/juce_audio_processors/format_types/VST3_SDK/base/source/fdebug.cpp
  10. +10
    -9
      modules/juce_audio_processors/format_types/VST3_SDK/base/source/fdebug.h
  11. +10
    -10
      modules/juce_audio_processors/format_types/VST3_SDK/base/source/fobject.cpp
  12. +25
    -27
      modules/juce_audio_processors/format_types/VST3_SDK/base/source/fobject.h
  13. +4
    -4
      modules/juce_audio_processors/format_types/VST3_SDK/base/source/fstreamer.cpp
  14. +2
    -2
      modules/juce_audio_processors/format_types/VST3_SDK/base/source/fstreamer.h
  15. +52
    -45
      modules/juce_audio_processors/format_types/VST3_SDK/base/source/fstring.cpp
  16. +15
    -14
      modules/juce_audio_processors/format_types/VST3_SDK/base/source/fstring.h
  17. +28
    -16
      modules/juce_audio_processors/format_types/VST3_SDK/base/source/updatehandler.cpp
  18. +8
    -8
      modules/juce_audio_processors/format_types/VST3_SDK/base/source/updatehandler.h
  19. +4
    -4
      modules/juce_audio_processors/format_types/VST3_SDK/base/thread/include/flock.h
  20. +2
    -2
      modules/juce_audio_processors/format_types/VST3_SDK/base/thread/source/flock.cpp
  21. +1
    -1
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/LICENSE.txt
  22. +5
    -2
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/README.md
  23. +0
    -1
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/conststringtable.h
  24. +1
    -3
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/falignpush.h
  25. +36
    -7
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/fplatform.h
  26. +1
    -3
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/fstrdefs.h
  27. +5
    -3
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/ftypes.h
  28. +45
    -9
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/funknown.cpp
  29. +128
    -53
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/funknown.h
  30. +4
    -4
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/fvariant.h
  31. +5
    -7
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/ibstream.h
  32. +2
    -3
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/icloneable.h
  33. +8
    -9
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/ipersistent.h
  34. +52
    -63
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/ipluginbase.h
  35. +6
    -6
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/istringresult.h
  36. +3
    -5
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/iupdatehandler.h
  37. +5
    -7
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/smartpointer.h
  38. +26
    -14
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/typesizecheck.h
  39. +6
    -3
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/ustring.cpp
  40. +37
    -31
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/ustring.h
  41. +22
    -25
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/gui/iplugview.h
  42. +3
    -2
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/gui/iplugviewcontentscalesupport.h
  43. +22
    -19
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivstattributes.h
  44. +155
    -81
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivstaudioprocessor.h
  45. +3
    -3
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivstautomationstate.h
  46. +28
    -16
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivstchannelcontextinfo.h
  47. +45
    -26
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivstcomponent.h
  48. +25
    -23
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivstcontextmenu.h
  49. +305
    -124
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivsteditcontroller.h
  50. +44
    -15
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivstevents.h
  51. +24
    -23
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivsthostapplication.h
  52. +9
    -11
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivstinterappaudio.h
  53. +10
    -9
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivstmessage.h
  54. +7
    -7
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivstmidicontrollers.h
  55. +52
    -3
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivstmidilearn.h
  56. +41
    -37
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivstnoteexpression.h
  57. +21
    -18
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivstparameterchanges.h
  58. +143
    -0
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivstparameterfunctionname.h
  59. +49
    -10
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivstphysicalui.h
  60. +9
    -6
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivstpluginterfacesupport.h
  61. +3
    -3
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivstplugview.h
  62. +22
    -10
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivstprefetchablesupport.h
  63. +46
    -35
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivstprocesscontext.h
  64. +17
    -25
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivstrepresentation.h
  65. +21
    -1
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivsttestplugprovider.h
  66. +39
    -37
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivstunits.h
  67. +282
    -110
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/vstspeaker.h
  68. +25
    -6
      modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/vsttypes.h
  69. +1
    -1
      modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/LICENSE.txt
  70. +6
    -3
      modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/README.md
  71. +5
    -5
      modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/common/memorystream.cpp
  72. +7
    -8
      modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/common/memorystream.h
  73. +2
    -2
      modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/common/pluginview.cpp
  74. +30
    -17
      modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/common/pluginview.h
  75. +30
    -29
      modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/vst/hosting/hostclasses.cpp
  76. +4
    -4
      modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/vst/hosting/hostclasses.h
  77. +6
    -1
      modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/vst/hosting/pluginterfacesupport.cpp
  78. +1
    -1
      modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/vst/hosting/pluginterfacesupport.h
  79. +1
    -1
      modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/vst/vstbus.cpp
  80. +11
    -11
      modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/vst/vstbus.h
  81. +3
    -3
      modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/vst/vstcomponent.cpp
  82. +5
    -5
      modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/vst/vstcomponent.h
  83. +28
    -28
      modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/vst/vstcomponentbase.cpp
  84. +17
    -14
      modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/vst/vstcomponentbase.h
  85. +40
    -38
      modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/vst/vsteditcontroller.cpp
  86. +19
    -19
      modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/vst/vsteditcontroller.h
  87. +8
    -1
      modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/vst/vstinitiids.cpp
  88. +26
    -13
      modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/vst/vstparameters.cpp
  89. +14
    -12
      modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/vst/vstparameters.h
  90. +6
    -6
      modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/vst/vstpresetfile.cpp
  91. +14
    -13
      modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/vst/vstpresetfile.h

+ 1
- 1
modules/juce_audio_processors/format_types/VST3_SDK/LICENSE.txt View File

@@ -1,6 +1,6 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LICENSE // LICENSE
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
This license applies only to files referencing this license, This license applies only to files referencing this license,
for other files of the Software Development Kit the respective embedded license text for other files of the Software Development Kit the respective embedded license text


+ 6
- 249
modules/juce_audio_processors/format_types/VST3_SDK/README.md View File

@@ -1,253 +1,10 @@
# Welcome to VST SDK 3.6.x
# Welcome to VST 3 SDK Interfaces
## Table Of Contents
1. [The VST SDK package](#100)
1. [System requirements](#200)
1. [About VST Plug-ins in general](#300)
1. [About VST 3](#400)
1. [How to build VST 3](#500)
1. [Contributing](#600)
1. [License & Usage guidelines](#700)
<div id='100'/>
## The VST SDK package contains
- The VST 3 API
- VST 3 Implementation Helper Classes
- AAX, AU and VST 2 wrappers
- VST 3 Plug-ins Examples
The full VST 3 SDK is available [here!](https://www.steinberg.net/en/company/developers.html). It contains :
- a VST 3 Plug-in Test Host Application/Validator,
- the **Steinberg VST 3 Plug-In SDK Licensing Agreement** that you have to sign if you want to develop or host VST 3 Plug-Ins.
<div id='200'/>
## System requirements
Supported OS:
- Microsoft Windows 7-10
- Apple OSX 10.9-10.13
- Apple iOS 8-9
- Linux (Beta version)
Supported IDE:
- Visual Studio 2015/2017/2019
- minimum Xcode 7
- Qt Creator
---
<div id='300'/>
## About VST Plug-ins in general
A VST Plug-in is an audio processing component that is utilized within a host application. This host application provides the audio or/and event streams that are processed by the Plug-in's code. Generally speaking, a VST Plug-in can take a stream of audio data, apply a process to the audio, and return the result to the host application. A VST Plug-in performs its process normally using the processor of the computer. The audio stream is broken down into a series of blocks. The host supplies the blocks in sequence. The host and its current environment control the block-size. The VST Plug-in maintains the status of all its own parameters relating to the running process: The host does not maintain any information about what the Plug-in did with the last block of data it processed.
From the host application's point of view, a VST Plug-in is a black box with an arbitrary number of inputs, outputs (Event (MIDI) or Audio), and associated parameters. The host needs no implicit knowledge of the Plug-in's process to be able to use it. The Plug-in process can use whatever parameters it wishes, internally to the process, but depending on the capabilities of the host, it can allow the changes to user parameters to be automated by the host.
The source code of a VST Plug-in is platform independent, but the delivery system depends on the platform architecture:
- On **Windows**, a VST Plug-in is a multi-threaded DLL (Dynamic Link Library), recently packaged into a folder structur.
- On **Mac OS X**, a VST Plug-in is a Mach-O Bundle
- On **Linux**, a VST Plug-in is a package
To learn more about VST you can subscribe to the [VST Developer Forum](https://sdk.steinberg.net) - check the 3rd Party Developer Support section at [www.steinberg.net](http://www.steinberg.net).
---
<div id='400'/>
## About VST 3
VST 3 is a general rework of the long-serving VST Plug-in interface. It is not compatible with the older VST versions, but it includes some new features and possibilities. We have redesigned the API to make it not only far easier and more reliable for developers to work with, but have also provided completely new possibilities for Plug-ins. These include:
### 1. Improved Performance with the Silence Flag
Processing can optionally be applied to Plug-ins only when audio signals are present on their respective inputs, so VST 3 Plug-ins can apply their processing economically and only when it is needed.
### 2. Multiple Dynamic I/Os
VST 3 Plug-ins are no longer limited to a fixed number of inputs and outputs, and their I/O configuration can dynamically adapt to the channel configuration. Side-chains are also very easily realizable. This includes the possibility to deactivate unused buses after loading and even reactivate those when needed. This cleans up the mixer and further helps to reduce CPU load.
### 3. Sample-accurate Automation
VST 3 also features vastly improved parameter automation with sample accuracy and support for ramped automation data, allowing completely accurate and rapid parameter automation changes.
### 4. Logical Parameter Organization
The VST 3 Plug-in parameters are displayed in a tree structure. Parameters are grouped into sections which represent the structure of the Plug-in. Plug-ins can communicate their internal structure for the purpose of overview, but also for some associated functionality (eg. program-lists).
### 5. Resizeable UI Editor
VST 3 defines a way to allow resizing of the Plug-in editor by a user.
### 6. Mouse Over Support
The Host could ask the Plug-in which parameter is under the mouse.
### 7. Context Menu Support
VST 3 defines a way to allow the host to add its own entries in the Plug-in context menu of a specific parameter.
### 8. Channel Context Information
A VST 3 Plug-in could access some channel information where it is instantiated: name, color,...
### 9. Note Expression
VST 3 defines with Note Expression a new way of event controller editing. The Plug-in is able to break free from the limitations of MIDI controller events by providing access to new VST 3 controller events that circumvent the laws of MIDI and provide articulation information for each individual note (event) in a polyphonic arrangement according to its noteId.
### 10. 3D Support
VST 3 supports new speaker configurations like Ambisonic, Atmos, Auro 3D or 22.2.
### 11. Factory Concept
VST 3 Plug-in library could export multiple Plug-ins and in this way replaces the shell concept of VST 2 (kPlugCategShell).
### 12. Support Remote control Representation
VST 3 Plug-in can deliver a specific parameter mapping for remote controls like Nuage.
### 13. Others
While designing VST 3, we performed a careful analysis of the existing functionality of VST and rewrote the interfaces from scratch. In doing so, we focused a lot on providing clear interfaces and their documentation in order to avoid usage errors from the deepest possible layer.
Some more features implemented specifically for developers include:
- More stable technical Host/Plug-in environment
- Advanced technical definition of the standard
- Modular approach
- Separation of UI and processing
- Advanced Preset System
- Multiple Plug-ins per Library
- Test Host included
- Automated Testing Environment
- Validator (small command line Test Host) and Plug-in examples code included
---
<div id='500'/>
## How to build VST3
### Get the source code from GitHub
<pre>git clone --recursive https://github.com/steinbergmedia/vst3sdk.git
</pre>
### Adding VST2 version
The VST2 SDK is not part anymore of the VST3 SDK, you have to use an older version of the SDK and copy the VST2_SDK folder into the VST_SDK folder.
In order to build a VST2 version of the Plug-in and a VST3 at the same time, you need to copy the VST2 folder into the VST3 folder, simply run the following commands:
- for macOS:
<pre>
cd TheFolderWhereYouDownloadTheSDK
./copy_vst2_to_vst3_sdk.sh
</pre>
- for Windows:
<pre>
cd TheFolderWhereYouDownloadTheSDK
copy_vst2_to_vst3_sdk.bat
</pre>
### Build the examples on Linux
- Create a folder for the build and move to this folder (using cd):
<pre>
mkdir build
cd build
</pre>
- Generate the Solution/Projects: provide the path of the Project where CMakeLists.txt is located:
<pre>
cmake ../vst3sdk
</pre>
- Now you can build the Plug-in:
<pre>
make
(or alternatively for example for release)
cmake --build . --config Release
</pre>
### Build the examples on macOS
- Create a folder for the build and move to this folder (using cd):
<pre>
mkdir build
cd build
</pre>
- Generate the Solution/Projects: provide the path of the Project where CMakeLists.txt is located:
<pre>
For XCode:
cmake -GXcode ../vst3sdk
Without XCode (here debug variant):
cmake -DCMAKE_BUILD_TYPE=Debug ../
</pre>
- Now you can build the Plug-in (you can use XCode too):
<pre>
xcodebuild
(or alternatively for example for release)
cmake --build . --config Release
</pre>
### Build the examples on Windows
- Create a folder for the build and move to this folder (using cd):
<pre>
mkdir build
cd build
</pre>
- Generate the Solution/Projects: provide the path of the Project where CMakeLists.txt is located:
<pre>
cmake.exe -G"Visual Studio 15 2017 Win64" ../vst3sdk
</pre>
- Now you can build the Plug-in (you can use Visual Studio too):
<pre>
msbuild.exe vstsdk.sln
(or alternatively for example for release)
cmake --build . --config Release
</pre>
### Build using cmake-gui
- start the cmake-gui Application
- "Browse Source...": select the folder VST3_SDK
- "Browse Build...": select a folder where the outputs (projects/...) will be created. Typically a folder named "build"
- you can check the SMTG Options
- Press "Configure"
- Press "Generate" and the project will be created
---
<div id='600'/>
## Contributing
For bug reports and features requests, please visit the [VST Developer Forum](https://sdk.steinberg.net)
---
<div id='700'/>
Here are located all VST interfaces definitions (including VST Component/Controller, UI, Test).
## License & Usage guidelines ## License & Usage guidelines
More details are found at [www.steinberg.net/sdklicenses_vst3](http://www.steinberg.net/sdklicenses_vst3)
More details are found at [www.steinberg.net/sdklicenses_vst3](http://www.steinberg.net/sdklicenses_vst3)
----
Return to [VST 3 SDK](https://github.com/steinbergmedia/vst3sdk)

+ 1
- 1
modules/juce_audio_processors/format_types/VST3_SDK/base/LICENSE.txt View File

@@ -1,6 +1,6 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LICENSE // LICENSE
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // are permitted provided that the following conditions are met:


+ 4
- 1
modules/juce_audio_processors/format_types/VST3_SDK/base/README.md View File

@@ -3,4 +3,7 @@
Here you can find some helper classes useful for developing VST3 Plug-Ins. Here you can find some helper classes useful for developing VST3 Plug-Ins.
## License & Usage guidelines ## License & Usage guidelines
More details are found at [www.steinberg.net/sdklicenses_vst3](http://www.steinberg.net/sdklicenses_vst3)
More details are found at [www.steinberg.net/sdklicenses_vst3](http://www.steinberg.net/sdklicenses_vst3)
----
Return to [VST 3 SDK](https://github.com/steinbergmedia/vst3sdk)

+ 1
- 1
modules/juce_audio_processors/format_types/VST3_SDK/base/source/baseiids.cpp View File

@@ -9,7 +9,7 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LICENSE // LICENSE
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // are permitted provided that the following conditions are met:


+ 1
- 1
modules/juce_audio_processors/format_types/VST3_SDK/base/source/classfactoryhelpers.h View File

@@ -9,7 +9,7 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LICENSE // LICENSE
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // are permitted provided that the following conditions are met:


+ 3
- 4
modules/juce_audio_processors/format_types/VST3_SDK/base/source/fbuffer.cpp View File

@@ -9,7 +9,7 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LICENSE // LICENSE
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // are permitted provided that the following conditions are met:
@@ -37,7 +37,7 @@


#include "base/source/fbuffer.h" #include "base/source/fbuffer.h"
#include "base/source/fstring.h" #include "base/source/fstring.h"
#include <stdlib.h>
#include <cstdlib>


namespace Steinberg { namespace Steinberg {


@@ -231,7 +231,6 @@ bool Buffer::prependString8 (const char8* s)
return false; return false;


uint32 len = (uint32) strlen (s); uint32 len = (uint32) strlen (s);
if (len > 0) if (len > 0)
{ {
shiftStart (len); shiftStart (len);
@@ -361,7 +360,7 @@ bool Buffer::fromHexString (const char8* string)
else return false; // no hex string else return false; // no hex string


if (upper) if (upper)
data [count >> 1] = d << 4;
data [count >> 1] = static_cast<unsigned char> (d << 4);
else else
data [count >> 1] += d; data [count >> 1] += d;




+ 3
- 3
modules/juce_audio_processors/format_types/VST3_SDK/base/source/fbuffer.h View File

@@ -9,7 +9,7 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LICENSE // LICENSE
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // are permitted provided that the following conditions are met:
@@ -85,7 +85,7 @@ public:


/** Destructor - deallocates the internal memory. /** Destructor - deallocates the internal memory.
*/ */
~Buffer ();
virtual ~Buffer ();
/** Assignment operator - copies contents from a given Buffer and increases the size if necessary. /** Assignment operator - copies contents from a given Buffer and increases the size if necessary.
\param[in] buff : the Buffer from which all memory will be copied \param[in] buff : the Buffer from which all memory will be copied
@@ -210,7 +210,7 @@ public:


int8* operator + (uint32 i); ///< \return the internal Buffer's address plus the given offset i, zero if offset is out of range int8* operator + (uint32 i); ///< \return the internal Buffer's address plus the given offset i, zero if offset is out of range
int32 operator ! () { return buffer == 0; }
int32 operator ! () { return buffer == nullptr; }
enum swapSize enum swapSize
{ {


+ 86
- 81
modules/juce_audio_processors/format_types/VST3_SDK/base/source/fdebug.cpp View File

@@ -11,7 +11,7 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LICENSE // LICENSE
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // are permitted provided that the following conditions are met:
@@ -39,9 +39,72 @@


#include "base/source/fdebug.h" #include "base/source/fdebug.h"


#if SMTG_OS_WINDOWS
#include <windows.h>

bool AmIBeingDebugged ()
{
return IsDebuggerPresent ();
}
#endif

#if SMTG_OS_LINUX
#include <signal.h>
#include <sys/types.h>
#include <unistd.h>
//--------------------------------------------------------------------------
bool AmIBeingDebugged ()
{
// TODO: check if GDB or LLDB is attached
return true;
}
#endif

#if SMTG_OS_MACOS

#include <stdbool.h>
#include <sys/sysctl.h>
#include <sys/types.h>
#include <unistd.h>

//------------------------------------------------------------------------
// from Technical Q&A QA1361 (http://developer.apple.com/qa/qa2004/qa1361.html)
//------------------------------------------------------------------------
bool AmIBeingDebugged ()
// Returns true if the current process is being debugged (either
// running under the debugger or has a debugger attached post facto).
{
int mib[4];
struct kinfo_proc info;
size_t size;

// Initialize the flags so that, if sysctl fails for some bizarre
// reason, we get a predictable result.

info.kp_proc.p_flag = 0;

// Initialize mib, which tells sysctl the info we want, in this case
// we're looking for information about a specific process ID.

mib[0] = CTL_KERN;
mib[1] = KERN_PROC;
mib[2] = KERN_PROC_PID;
mib[3] = getpid ();

// Call sysctl.

size = sizeof (info);
sysctl (mib, sizeof (mib) / sizeof (*mib), &info, &size, NULL, 0);

// We're being debugged if the P_TRACED flag is set.
return ((info.kp_proc.p_flag & P_TRACED) != 0);
}

#endif // SMTG_OS_MACOS

#if DEVELOPMENT #if DEVELOPMENT


#include <assert.h>
#include <cassert>
#include <cstdarg> #include <cstdarg>
#include <cstdio> #include <cstdio>


@@ -49,8 +112,9 @@
#ifndef _WIN32_WINNT #ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0400 #define _WIN32_WINNT 0x0400
#endif #endif
#if _MSC_VER
#include <intrin.h> #include <intrin.h>
#include <windows.h>
#endif
#define vsnprintf _vsnprintf #define vsnprintf _vsnprintf
#define snprintf _snprintf #define snprintf _snprintf


@@ -60,12 +124,6 @@
#include <mach/mach_time.h> #include <mach/mach_time.h>
#include <new> #include <new>
#include <signal.h> #include <signal.h>
#include <stdbool.h>
#include <sys/sysctl.h>
#include <sys/types.h>
#include <unistd.h>

static bool AmIBeingDebugged (void);


#define THREAD_ALLOC_WATCH 0 // check allocations on specific threads #define THREAD_ALLOC_WATCH 0 // check allocations on specific threads


@@ -79,27 +137,6 @@ AssertionHandler gAssertionHandler = nullptr;
AssertionHandler gPreAssertionHook = nullptr; AssertionHandler gPreAssertionHook = nullptr;
DebugPrintLogger gDebugPrintLogger = nullptr; DebugPrintLogger gDebugPrintLogger = nullptr;


namespace boost {
// Define the boost assertion handler to redirect to our assertion handler,
// otherwise it just calls abort(). Note that we don't need to include any boost
// headers for this, it just provides the handler.
void assertion_failed (char const* expr, char const* function, char const* file, long line)
{
#if DEVELOPMENT
char message[512];
snprintf (message, 512, "%s at %s, %s:%ld", expr, function, file, line);
if (gAssertionHandler)
{
FDebugBreak (message);
}
else
{
assert (!(const char *)message);
}
#endif
}
}

//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
static const int kDebugPrintfBufferSize = 10000; static const int kDebugPrintfBufferSize = 10000;
static bool neverDebugger = false; // so I can switch it off in the debugger... static bool neverDebugger = false; // so I can switch it off in the debugger...
@@ -116,7 +153,7 @@ static void printDebugString (const char* string)
} }
else else
{ {
#if SMTG_OS_MACOS
#if SMTG_OS_MACOS || defined(__MINGW32__)
fprintf (stderr, "%s", string); fprintf (stderr, "%s", string);
#elif SMTG_OS_WINDOWS #elif SMTG_OS_WINDOWS
OutputDebugStringA (string); OutputDebugStringA (string);
@@ -137,22 +174,6 @@ void FDebugPrint (const char* format, ...)
printDebugString (string); printDebugString (string);
} }


#if SMTG_OS_WINDOWS
#define AmIBeingDebugged IsDebuggerPresent
#endif

#if SMTG_OS_LINUX
#include <signal.h>
#include <sys/types.h>
#include <unistd.h>
//--------------------------------------------------------------------------
static inline bool AmIBeingDebugged ()
{
// TODO: check if GDB or LLDB is attached
return true;
}
#endif

//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// printf style debugging output // printf style debugging output
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
@@ -187,8 +208,11 @@ void FDebugBreak (const char* format, ...)


if (breakIntoDebugger) if (breakIntoDebugger)
{ {
#if SMTG_OS_WINDOWS
#if SMTG_OS_WINDOWS && _MSC_VER
__debugbreak (); // intrinsic version of DebugBreak() __debugbreak (); // intrinsic version of DebugBreak()
#elif SMTG_OS_MACOS && __arm64__
raise (SIGSTOP);

#elif __ppc64__ || __ppc__ || __arm__ #elif __ppc64__ || __ppc__ || __arm__
kill (getpid (), SIGINT); kill (getpid (), SIGINT);
#elif __i386__ || __x86_64__ #elif __i386__ || __x86_64__
@@ -205,9 +229,9 @@ void FPrintLastError (const char* file, int line)
{ {
#if SMTG_OS_WINDOWS #if SMTG_OS_WINDOWS
LPVOID lpMessageBuffer; LPVOID lpMessageBuffer;
FormatMessageA (FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL,
FormatMessageA (FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, nullptr,
GetLastError (), MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT), GetLastError (), MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPSTR)&lpMessageBuffer, 0, NULL);
(LPSTR)&lpMessageBuffer, 0, nullptr);
FDebugPrint ("%s(%d) : %s\n", file, line, lpMessageBuffer); FDebugPrint ("%s(%d) : %s\n", file, line, lpMessageBuffer);
LocalFree (lpMessageBuffer); LocalFree (lpMessageBuffer);
#endif #endif
@@ -276,39 +300,20 @@ void operator delete[] (void* p, int, const char* file, int line)
::operator delete[] (p); ::operator delete[] (p);
} }


//------------------------------------------------------------------------
// from Technical Q&A QA1361 (http://developer.apple.com/qa/qa2004/qa1361.html)
//------------------------------------------------------------------------
bool AmIBeingDebugged (void)
// Returns true if the current process is being debugged (either
// running under the debugger or has a debugger attached post facto).
{
int mib[4];
struct kinfo_proc info;
size_t size;

// Initialize the flags so that, if sysctl fails for some bizarre
// reason, we get a predictable result.

info.kp_proc.p_flag = 0;

// Initialize mib, which tells sysctl the info we want, in this case
// we're looking for information about a specific process ID.

mib[0] = CTL_KERN;
mib[1] = KERN_PROC;
mib[2] = KERN_PROC_PID;
mib[3] = getpid ();
#endif // SMTG_OS_MACOS


// Call sysctl.
#endif // DEVELOPMENT


size = sizeof (info);
sysctl (mib, sizeof (mib) / sizeof (*mib), &info, &size, NULL, 0);
static bool smtg_unit_testing_active = false; // ugly hack to unit testing ...


// We're being debugged if the P_TRACED flag is set.
return ((info.kp_proc.p_flag & P_TRACED) != 0);
//------------------------------------------------------------------------
bool isSmtgUnitTesting ()
{
return smtg_unit_testing_active;
} }


#endif // SMTG_OS_MACOS

#endif // DEVELOPMENT
//------------------------------------------------------------------------
void setSmtgUnitTesting ()
{
smtg_unit_testing_active = true;
}

+ 10
- 9
modules/juce_audio_processors/format_types/VST3_SDK/base/source/fdebug.h View File

@@ -11,7 +11,7 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LICENSE // LICENSE
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // are permitted provided that the following conditions are met:
@@ -51,12 +51,15 @@
#pragma once #pragma once


#include "pluginterfaces/base/ftypes.h" #include "pluginterfaces/base/ftypes.h"
#include <string.h>
#include <cstring>


#if SMTG_OS_MACOS #if SMTG_OS_MACOS
#include <new> #include <new>
#endif #endif


/** Returns true if a debugger is attached. */
bool AmIBeingDebugged ();

//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// development / release // development / release
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -152,10 +155,10 @@ void FPrintLastError (const char* file, int line);
the debug output to a file or stream. the debug output to a file or stream.
*/ */
///@{ ///@{
typedef bool (*AssertionHandler) (const char* message);
using AssertionHandler = bool (*) (const char* message);
extern AssertionHandler gAssertionHandler; extern AssertionHandler gAssertionHandler;
extern AssertionHandler gPreAssertionHook; extern AssertionHandler gPreAssertionHook;
typedef void (*DebugPrintLogger) (const char* message);
using DebugPrintLogger = void (*) (const char* message);
extern DebugPrintLogger gDebugPrintLogger; extern DebugPrintLogger gDebugPrintLogger;
///@} ///@}


@@ -212,11 +215,9 @@ void* operator new (size_t, int, const char*, int);
#endif #endif
#endif #endif


#if SMTG_CPPUNIT_TESTING
#define SMTG_IS_TEST true
#else
#define SMTG_IS_TEST false
#endif
// replace #if SMTG_CPPUNIT_TESTING
bool isSmtgUnitTesting ();
void setSmtgUnitTesting ();


#if !SMTG_RENAME_ASSERT #if !SMTG_RENAME_ASSERT
#if SMTG_OS_WINDOWS #if SMTG_OS_WINDOWS


+ 10
- 10
modules/juce_audio_processors/format_types/VST3_SDK/base/source/fobject.cpp View File

@@ -9,7 +9,7 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LICENSE // LICENSE
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // are permitted provided that the following conditions are met:
@@ -42,7 +42,7 @@


namespace Steinberg { namespace Steinberg {


IUpdateHandler* FObject::gUpdateHandler = 0;
IUpdateHandler* FObject::gUpdateHandler = nullptr;


//------------------------------------------------------------------------ //------------------------------------------------------------------------
const FUID FObject::iid; const FUID FObject::iid;
@@ -84,7 +84,7 @@ tresult PLUGIN_API FObject::queryInterface (const TUID _iid, void** obj)
QUERY_INTERFACE (_iid, obj, FUnknown::iid, FUnknown) QUERY_INTERFACE (_iid, obj, FUnknown::iid, FUnknown)
QUERY_INTERFACE (_iid, obj, IDependent::iid, IDependent) QUERY_INTERFACE (_iid, obj, IDependent::iid, IDependent)
QUERY_INTERFACE (_iid, obj, FObject::iid, FObject) QUERY_INTERFACE (_iid, obj, FObject::iid, FObject)
*obj = 0;
*obj = nullptr;
return kNoInterface; return kNoInterface;
} }


@@ -125,8 +125,8 @@ void FObject::deferUpdate (int32 msg)
//------------------------------------------------------------------------ //------------------------------------------------------------------------
namespace Singleton namespace Singleton
{ {
typedef std::vector<FObject**> ObjectVector;
ObjectVector* singletonInstances = 0;
using ObjectVector = std::vector<FObject**>;
ObjectVector* singletonInstances = nullptr;
bool singletonsTerminated = false; bool singletonsTerminated = false;
Steinberg::Base::Thread::FLock* singletonsLock; Steinberg::Base::Thread::FLock* singletonsLock;


@@ -148,7 +148,7 @@ namespace Singleton
SMTG_ASSERT (singletonsTerminated == false) SMTG_ASSERT (singletonsTerminated == false)
if (singletonsTerminated == false) if (singletonsTerminated == false)
{ {
if (singletonInstances == 0)
if (singletonInstances == nullptr)
singletonInstances = NEW std::vector<FObject**>; singletonInstances = NEW std::vector<FObject**>;
singletonInstances->push_back (o); singletonInstances->push_back (o);
} }
@@ -167,15 +167,15 @@ namespace Singleton
{ {
FObject** obj = (*it); FObject** obj = (*it);
(*obj)->release (); (*obj)->release ();
*obj = 0;
obj = 0;
*obj = nullptr;
obj = nullptr;
} }


delete singletonInstances; delete singletonInstances;
singletonInstances = 0;
singletonInstances = nullptr;
} }
delete singletonsLock; delete singletonsLock;
singletonsLock = 0;
singletonsLock = nullptr;
} }
} deleter; } deleter;
} }


+ 25
- 27
modules/juce_audio_processors/format_types/VST3_SDK/base/source/fobject.h View File

@@ -9,7 +9,7 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LICENSE // LICENSE
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // are permitted provided that the following conditions are met:
@@ -43,41 +43,39 @@


#include "pluginterfaces/base/funknown.h" #include "pluginterfaces/base/funknown.h"
#include "pluginterfaces/base/iupdatehandler.h" #include "pluginterfaces/base/iupdatehandler.h"
//#include "base/source/basefwd.h"
#include "base/source/fdebug.h" // NEW

#include "base/source/fdebug.h" // use of NEW


namespace Steinberg { namespace Steinberg {


//---------------------------------- //----------------------------------


typedef FIDString FClassID;
using FClassID = FIDString;


//------------------------------------------------------------------------ //------------------------------------------------------------------------
// Basic FObject - implements FUnknown + IDependent // Basic FObject - implements FUnknown + IDependent
//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Implements FUnknown and IDependent. /** Implements FUnknown and IDependent.


FObject is a polymorphic class that implements IDependent (of SKI module)
and therefore derived from FUnknown, which is the most abstract base class of all.

All COM-like virtual methods of FUnknown such as queryInterface(), addRef(), release()
are implemented here. On top of that, dependency-related methods are implemented too.
FObject is a polymorphic class that implements IDependent (of SKI module) and therefore derived from
FUnknown, which is the most abstract base class of all.


Pointer casting is done via the template methods FCast, either FObject to FObject or
FUnknown to FObject.
All COM-like virtual methods of FUnknown such as queryInterface(), addRef(), release() are
implemented here. On top of that, dependency-related methods are implemented too.


FObject supports a new singleton concept, therefore these objects are deleted automatically upon program termination.
Pointer casting is done via the template methods FCast, either FObject to FObject or FUnknown to
FObject.


- Runtime type information: An object can be queried at runtime, of what class
it is. To do this correctly, every class must override some methods. This
is simplified by using the OBJ_METHODS macros
FObject supports a new singleton concept, therefore these objects are deleted automatically upon
program termination.


- Runtime type information: An object can be queried at runtime, of what class it is. To do this
correctly, every class must override some methods. This is simplified by using the OBJ_METHODS
macros


@see
- FUnknown
- IDependent
- IUpdateHandler
@see
- FUnknown
- IDependent
- IUpdateHandler
*/ */
//------------------------------------------------------------------------ //------------------------------------------------------------------------
class FObject : public IDependent class FObject : public IDependent
@@ -99,19 +97,19 @@ public:
FUnknown* unknownCast () {return this;} ///< get FUnknown interface from object FUnknown* unknownCast () {return this;} ///< get FUnknown interface from object


// FUnknown // FUnknown
virtual tresult PLUGIN_API queryInterface (const TUID _iid, void** obj) SMTG_OVERRIDE; ///< please refer to FUnknown::queryInterface ()
virtual uint32 PLUGIN_API addRef () SMTG_OVERRIDE; ///< please refer to FUnknown::addref ()
virtual uint32 PLUGIN_API release () SMTG_OVERRIDE; ///< please refer to FUnknown::release ()
tresult PLUGIN_API queryInterface (const TUID _iid, void** obj) SMTG_OVERRIDE; ///< please refer to FUnknown::queryInterface ()
uint32 PLUGIN_API addRef () SMTG_OVERRIDE; ///< please refer to FUnknown::addref ()
uint32 PLUGIN_API release () SMTG_OVERRIDE; ///< please refer to FUnknown::release ()


// IDependent // IDependent
virtual void PLUGIN_API update (FUnknown* /*changedUnknown*/, int32 /*message*/) SMTG_OVERRIDE {}
void PLUGIN_API update (FUnknown* /*changedUnknown*/, int32 /*message*/) SMTG_OVERRIDE {}
///< empty virtual method that should be overridden by derived classes for data updates upon changes ///< empty virtual method that should be overridden by derived classes for data updates upon changes
// IDependency // IDependency
virtual void addDependent (IDependent* dep); ///< adds dependency to the object virtual void addDependent (IDependent* dep); ///< adds dependency to the object
virtual void removeDependent (IDependent* dep); ///< removes dependency from the object virtual void removeDependent (IDependent* dep); ///< removes dependency from the object
virtual void changed (int32 msg = kChanged); ///< Inform all dependents, that the object has changed. virtual void changed (int32 msg = kChanged); ///< Inform all dependents, that the object has changed.
virtual void deferUpdate (int32 msg = kChanged); ///< Similar to triggerUpdates, except only delivered in idle (usefull in collecting updates). virtual void deferUpdate (int32 msg = kChanged); ///< Similar to triggerUpdates, except only delivered in idle (usefull in collecting updates).
virtual void updateDone (int32 /* msg */) {} ///< empty virtual method that should be overridden by derived classes
virtual void updateDone (int32 /* msg */) {} ///< empty virtual method that should be overridden by derived classes
virtual bool isEqualInstance (FUnknown* d) {return this == d;} virtual bool isEqualInstance (FUnknown* d) {return this == d;}
static void setUpdateHandler (IUpdateHandler* handler) {gUpdateHandler = handler;} ///< set method for the local attribute static void setUpdateHandler (IUpdateHandler* handler) {gUpdateHandler = handler;} ///< set method for the local attribute
@@ -137,7 +135,7 @@ protected:
//------------------------------------------------------------------------ //------------------------------------------------------------------------
inline FObject* FObject::unknownToObject (FUnknown* unknown) inline FObject* FObject::unknownToObject (FUnknown* unknown)
{ {
FObject* object = 0;
FObject* object = nullptr;
if (unknown) if (unknown)
{ {
unknown->queryInterface (FObject::iid, (void**)&object); unknown->queryInterface (FObject::iid, (void**)&object);
@@ -180,7 +178,7 @@ inline C* FCast (FUnknown* unknown)
template <class C> template <class C>
inline C* FUCast (FObject* object) inline C* FUCast (FObject* object)
{ {
return FUnknownPtr<C> (object ? object->unknownCast () : 0);
return FUnknownPtr<C> (object ? object->unknownCast () : nullptr);
} }


template <class C> template <class C>


+ 4
- 4
modules/juce_audio_processors/format_types/VST3_SDK/base/source/fstreamer.cpp View File

@@ -9,7 +9,7 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LICENSE // LICENSE
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // are permitted provided that the following conditions are met:
@@ -687,13 +687,13 @@ char8* FStreamer::readStr8 ()
{ {
int32 length; int32 length;
if (!readInt32 (length)) if (!readInt32 (length))
return 0;
return nullptr;
// check corruption // check corruption
if (length > 262144) if (length > 262144)
return 0;
return nullptr;


char8* s = (length > 0) ? NEWVEC char8[length] : 0;
char8* s = (length > 0) ? NEWVEC char8[length] : nullptr;
if (s) if (s)
readRaw (s, length * sizeof (char8)); readRaw (s, length * sizeof (char8));
return s; return s;


+ 2
- 2
modules/juce_audio_processors/format_types/VST3_SDK/base/source/fstreamer.h View File

@@ -9,7 +9,7 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LICENSE // LICENSE
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // are permitted provided that the following conditions are met:
@@ -217,7 +217,7 @@ class IBStream;
// IBStreamer // IBStreamer
//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Wrapper class for typed reading/writing from or to IBStream. /** Wrapper class for typed reading/writing from or to IBStream.
Can be used framework-independent in Plug-ins. */
Can be used framework-independent in plug-ins. */
//------------------------------------------------------------------------ //------------------------------------------------------------------------
class IBStreamer: public FStreamer class IBStreamer: public FStreamer
{ {


+ 52
- 45
modules/juce_audio_processors/format_types/VST3_SDK/base/source/fstring.cpp View File

@@ -9,7 +9,7 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LICENSE // LICENSE
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // are permitted provided that the following conditions are met:
@@ -48,6 +48,7 @@


#if SMTG_OS_WINDOWS #if SMTG_OS_WINDOWS
#include <windows.h> #include <windows.h>
#ifdef _MSC_VER
#pragma warning (disable : 4244) #pragma warning (disable : 4244)
#pragma warning (disable : 4267) #pragma warning (disable : 4267)
#pragma warning (disable : 4996) #pragma warning (disable : 4996)
@@ -59,9 +60,9 @@
#define realloc(p,s) _realloc_dbg(p,s, _NORMAL_BLOCK, __FILE__, __LINE__) #define realloc(p,s) _realloc_dbg(p,s, _NORMAL_BLOCK, __FILE__, __LINE__)
#define free(p) _free_dbg(p, _NORMAL_BLOCK) #define free(p) _free_dbg(p, _NORMAL_BLOCK)


#endif
#endif
#endif // DEVELOPMENT
#endif // _MSC_VER
#endif // SMTG_OS_WINDOWS


#ifndef kPrintfBufferSize #ifndef kPrintfBufferSize
#define kPrintfBufferSize 4096 #define kPrintfBufferSize 4096
@@ -175,7 +176,7 @@ static CFStringDebugAllocator gDebugAllocator;
#else #else


static const CFAllocatorRef kCFAllocator = ::kCFAllocatorDefault; static const CFAllocatorRef kCFAllocator = ::kCFAllocatorDefault;
#endif
#endif // SMTG_DEBUG_CFALLOCATOR
} }


//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -287,6 +288,7 @@ static inline int strnicmp16 (const Steinberg::char16* s1, const Steinberg::char
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
static inline int sprintf16 (Steinberg::char16* wcs, const Steinberg::char16* format, ...) static inline int sprintf16 (Steinberg::char16* wcs, const Steinberg::char16* format, ...)
{ {
#warning DEPRECATED No Linux implementation
assert(false && "DEPRECATED No Linux implementation"); assert(false && "DEPRECATED No Linux implementation");
return 0; return 0;
} }
@@ -310,6 +312,7 @@ static inline int vsnwprintf (Steinberg::char16* wcs, size_t maxlen,
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
static inline Steinberg::char16* strrchr16 (const Steinberg::char16* str, Steinberg::char16 c) static inline Steinberg::char16* strrchr16 (const Steinberg::char16* str, Steinberg::char16 c)
{ {
#warning DEPRECATED No Linux implementation
assert(false && "DEPRECATED No Linux implementation"); assert(false && "DEPRECATED No Linux implementation");
return nullptr; return nullptr;
} }
@@ -327,7 +330,7 @@ static inline Steinberg::int32 strnicmp16 (const Steinberg::char16* str1, const


CFIndex str1Len = Steinberg::strlen16 (str1); CFIndex str1Len = Steinberg::strlen16 (str1);
CFIndex str2Len = Steinberg::strlen16 (str2); CFIndex str2Len = Steinberg::strlen16 (str2);
if (size < str2Len) // range is not applied to second string
if (static_cast<CFIndex> (size) < str2Len) // range is not applied to second string
str2Len = size; str2Len = size;
CFStringRef cfStr1 = CFStringCreateWithCharactersNoCopy (Steinberg::kCFAllocator, (UniChar*)str1, str1Len, kCFAllocatorNull); CFStringRef cfStr1 = CFStringCreateWithCharactersNoCopy (Steinberg::kCFAllocator, (UniChar*)str1, str1Len, kCFAllocatorNull);
CFStringRef cfStr2 = CFStringCreateWithCharactersNoCopy (Steinberg::kCFAllocator, (UniChar*)str2, str2Len, kCFAllocatorNull); CFStringRef cfStr2 = CFStringCreateWithCharactersNoCopy (Steinberg::kCFAllocator, (UniChar*)str2, str2Len, kCFAllocatorNull);
@@ -414,7 +417,7 @@ static inline Steinberg::int32 sprintf16 (Steinberg::char16* str, const Steinber
return vsnwprintf (str, -1, format, marker); return vsnwprintf (str, -1, format, marker);
} }


#endif
#endif // SMTG_OS_LINUX


/* /*
UTF-8 EF BB BF UTF-8 EF BB BF
@@ -467,7 +470,7 @@ ConstString::ConstString (const ConstString& str, int32 offset, int32 length)


//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
ConstString::ConstString (const FVariant& var) ConstString::ConstString (const FVariant& var)
: buffer (0)
: buffer (nullptr)
, len (0) , len (0)
, isWide (0) , isWide (0)
{ {
@@ -489,7 +492,7 @@ ConstString::ConstString (const FVariant& var)


//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
ConstString::ConstString () ConstString::ConstString ()
: buffer (0)
: buffer (nullptr)
, len (0) , len (0)
, isWide (0) , isWide (0)
{ {
@@ -1584,6 +1587,7 @@ char16 ConstString::toLower (char16 c)
} }
return c; return c;
#elif SMTG_OS_LINUX #elif SMTG_OS_LINUX
#warning DEPRECATED No Linux implementation
assert(false && "DEPRECATED No Linux implementation"); assert(false && "DEPRECATED No Linux implementation");
return c; return c;
#else #else
@@ -1612,6 +1616,7 @@ char16 ConstString::toUpper (char16 c)
} }
return c; return c;
#elif SMTG_OS_LINUX #elif SMTG_OS_LINUX
#warning DEPRECATED No Linux implementation
assert(false && "DEPRECATED No Linux implementation"); assert(false && "DEPRECATED No Linux implementation");
return c; return c;
#else #else
@@ -1629,7 +1634,7 @@ char8 ConstString::toLower (char8 c)
::CharLowerA (temp); ::CharLowerA (temp);
return temp[0]; return temp[0];
#else #else
return tolower (c);
return static_cast<char8> (tolower (c));
#endif #endif
} }


@@ -1643,7 +1648,7 @@ char8 ConstString::toUpper (char8 c)
::CharUpperA (temp); ::CharUpperA (temp);
return temp[0]; return temp[0];
#else #else
return toupper (c);
return static_cast<char8> (toupper (c));
#endif #endif
} }


@@ -1856,7 +1861,7 @@ static CFStringEncoding MBCodePageToCFStringEncoding (uint32 codePage)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
int32 ConstString::multiByteToWideString (char16* dest, const char8* source, int32 charCount, uint32 sourceCodePage) int32 ConstString::multiByteToWideString (char16* dest, const char8* source, int32 charCount, uint32 sourceCodePage)
{ {
if (source == 0 || source[0] == 0)
if (source == nullptr || source[0] == 0)
{ {
if (dest && charCount > 0) if (dest && charCount > 0)
{ {
@@ -1889,7 +1894,7 @@ int32 ConstString::multiByteToWideString (char16* dest, const char8* source, int
#endif #endif


#if SMTG_OS_LINUX #if SMTG_OS_LINUX
if (sourceCodePage == kCP_ANSI || sourceCodePage == kCP_Utf8)
if (sourceCodePage == kCP_ANSI || sourceCodePage == kCP_US_ASCII || sourceCodePage == kCP_Utf8)
{ {
if (dest == nullptr) if (dest == nullptr)
{ {
@@ -1909,7 +1914,8 @@ int32 ConstString::multiByteToWideString (char16* dest, const char8* source, int
} }
} }
else else
{
{
#warning DEPRECATED No Linux implementation
assert(false && "DEPRECATED No Linux implementation"); assert(false && "DEPRECATED No Linux implementation");
} }


@@ -1923,7 +1929,7 @@ int32 ConstString::multiByteToWideString (char16* dest, const char8* source, int
int32 ConstString::wideStringToMultiByte (char8* dest, const char16* wideString, int32 charCount, uint32 destCodePage) int32 ConstString::wideStringToMultiByte (char8* dest, const char16* wideString, int32 charCount, uint32 destCodePage)
{ {
#if SMTG_OS_WINDOWS #if SMTG_OS_WINDOWS
return WideCharToMultiByte (destCodePage, 0, wideString, -1, dest, charCount, 0, 0);
return WideCharToMultiByte (destCodePage, 0, wideString, -1, dest, charCount, nullptr, nullptr);


#elif SMTG_OS_MACOS #elif SMTG_OS_MACOS
int32 result = 0; int32 result = 0;
@@ -1966,7 +1972,7 @@ int32 ConstString::wideStringToMultiByte (char8* dest, const char16* wideString,
} }
} }
} }
else if (destCodePage == kCP_ANSI)
else if (destCodePage == kCP_ANSI || destCodePage == kCP_US_ASCII)
{ {
if (dest == nullptr) if (dest == nullptr)
{ {
@@ -1989,7 +1995,8 @@ int32 ConstString::wideStringToMultiByte (char8* dest, const char16* wideString,
} }
} }
else else
{
{
#warning DEPRECATED No Linux implementation
assert(false && "DEPRECATED No Linux implementation"); assert(false && "DEPRECATED No Linux implementation");
} }
return result; return result;
@@ -2012,7 +2019,7 @@ bool ConstString::isNormalized (UnicodeNormalization n)
#ifdef UNICODE #ifdef UNICODE
if (n != kUnicodeNormC) if (n != kUnicodeNormC)
return false; return false;
uint32 normCharCount = static_cast<uint32> (FoldString (MAP_PRECOMPOSED, buffer16, len, 0, 0));
uint32 normCharCount = static_cast<uint32> (FoldString (MAP_PRECOMPOSED, buffer16, len, nullptr, 0));
return (normCharCount == len); return (normCharCount == len);
#else #else
return false; return false;
@@ -2115,7 +2122,7 @@ String::String (String&& str)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
String& String::operator= (String&& str) String& String::operator= (String&& str)
{ {
SMTG_ASSERT (buffer == 0 || buffer != str.buffer);
SMTG_ASSERT (buffer == nullptr || buffer != str.buffer);
tryFreeBuffer (); tryFreeBuffer ();
isWide = str.isWide; isWide = str.isWide;
@@ -2143,7 +2150,7 @@ bool String::toWideString (uint32 sourceCodePage)
{ {
if (buffer8 && len > 0) if (buffer8 && len > 0)
{ {
int32 bytesNeeded = multiByteToWideString (0, buffer8, 0, sourceCodePage) * sizeof (char16);
int32 bytesNeeded = multiByteToWideString (nullptr, buffer8, 0, sourceCodePage) * sizeof (char16);
if (bytesNeeded) if (bytesNeeded)
{ {
bytesNeeded += sizeof (char16); bytesNeeded += sizeof (char16);
@@ -2227,7 +2234,7 @@ bool String::toMultiByte (uint32 destCodePage)
{ {
if (buffer16 && len > 0) if (buffer16 && len > 0)
{ {
int32 numChars = wideStringToMultiByte (0, buffer16, 0, destCodePage) + sizeof (char8);
int32 numChars = wideStringToMultiByte (nullptr, buffer16, 0, destCodePage) + sizeof (char8);
char8* newStr = (char8*) malloc (numChars * sizeof (char8)); char8* newStr = (char8*) malloc (numChars * sizeof (char8));
if (wideStringToMultiByte (newStr, buffer16, numChars, destCodePage) <= 0) if (wideStringToMultiByte (newStr, buffer16, numChars, destCodePage) <= 0)
{ {
@@ -2263,7 +2270,7 @@ bool String::normalize (UnicodeNormalization n)
if (isWide == false) if (isWide == false)
return false; return false;


if (buffer16 == 0)
if (buffer16 == nullptr)
return true; return true;


#if SMTG_OS_WINDOWS #if SMTG_OS_WINDOWS
@@ -2271,7 +2278,7 @@ bool String::normalize (UnicodeNormalization n)
if (n != kUnicodeNormC) if (n != kUnicodeNormC)
return false; return false;


uint32 normCharCount = static_cast<uint32> (FoldString (MAP_PRECOMPOSED, buffer16, len, 0, 0));
uint32 normCharCount = static_cast<uint32> (FoldString (MAP_PRECOMPOSED, buffer16, len, nullptr, 0));
if (normCharCount == len) if (normCharCount == len)
return true; return true;


@@ -2320,7 +2327,7 @@ void String::tryFreeBuffer ()
if (buffer) if (buffer)
{ {
free (buffer); free (buffer);
buffer = 0;
buffer = nullptr;
} }
} }


@@ -2348,7 +2355,7 @@ bool String::resize (uint32 newLength, bool wide, bool fill)
if (newBufferSize != oldBufferSize) if (newBufferSize != oldBufferSize)
{ {
void* newstr = realloc (buffer, newBufferSize); void* newstr = realloc (buffer, newBufferSize);
if (newstr == 0)
if (newstr == nullptr)
return false; return false;
buffer = newstr; buffer = newstr;
if (isWide) if (isWide)
@@ -2362,7 +2369,7 @@ bool String::resize (uint32 newLength, bool wide, bool fill)
else else
{ {
void* newstr = malloc (newBufferSize); void* newstr = malloc (newBufferSize);
if (newstr == 0)
if (newstr == nullptr)
return false; return false;
buffer = newstr; buffer = newstr;
if (isWide) if (isWide)
@@ -2520,7 +2527,7 @@ String& String::assign (const char8* str, int32 n, bool isTerminated)


if (resize (n, false)) if (resize (n, false))
{ {
if (buffer8 && n > 0)
if (buffer8 && n > 0 && str)
{ {
memcpy (buffer8, str, n * sizeof (char8)); memcpy (buffer8, str, n * sizeof (char8));
SMTG_ASSERT (buffer8[n] == 0) SMTG_ASSERT (buffer8[n] == 0)
@@ -2547,7 +2554,7 @@ String& String::assign (const char16* str, int32 n, bool isTerminated)


if (resize (n, true)) if (resize (n, true))
{ {
if (buffer16 && n > 0)
if (buffer16 && n > 0 && str)
{ {
memcpy (buffer16, str, n * sizeof (char16)); memcpy (buffer16, str, n * sizeof (char16));
SMTG_ASSERT (buffer16[n] == 0) SMTG_ASSERT (buffer16[n] == 0)
@@ -2628,7 +2635,7 @@ String& String::append (const char8* str, int32 n)
if (!resize (newlen, false)) if (!resize (newlen, false))
return *this; return *this;


if (buffer)
if (buffer && str)
{ {
memcpy (buffer8 + len, str, n * sizeof (char8)); memcpy (buffer8 + len, str, n * sizeof (char8));
SMTG_ASSERT (buffer8[newlen] == 0) SMTG_ASSERT (buffer8[newlen] == 0)
@@ -2663,7 +2670,7 @@ String& String::append (const char16* str, int32 n)
if (!resize (newlen, true)) if (!resize (newlen, true))
return *this; return *this;


if (buffer16)
if (buffer16 && str)
{ {
memcpy (buffer16 + len, str, n * sizeof (char16)); memcpy (buffer16 + len, str, n * sizeof (char16));
SMTG_ASSERT (buffer16[newlen] == 0) SMTG_ASSERT (buffer16[newlen] == 0)
@@ -2772,7 +2779,7 @@ String& String::insertAt (uint32 idx, const char8* str, int32 n)
if (!resize (newlen, false)) if (!resize (newlen, false))
return *this; return *this;


if (buffer)
if (buffer && str)
{ {
if (idx < len) if (idx < len)
memmove (buffer8 + idx + n, buffer8 + idx, (len - idx) * sizeof (char8)); memmove (buffer8 + idx + n, buffer8 + idx, (len - idx) * sizeof (char8));
@@ -2806,7 +2813,7 @@ String& String::insertAt (uint32 idx, const char16* str, int32 n)
if (!resize (newlen, true)) if (!resize (newlen, true))
return *this; return *this;


if (buffer)
if (buffer && str)
{ {
if (idx < len) if (idx < len)
memmove (buffer16 + idx + n, buffer16 + idx, (len - idx) * sizeof (char16)); memmove (buffer16 + idx + n, buffer16 + idx, (len - idx) * sizeof (char16));
@@ -2833,7 +2840,7 @@ String& String::replace (uint32 idx, int32 n1, const ConstString& str, int32 n2)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
String& String::replace (uint32 idx, int32 n1, const char8* str, int32 n2) String& String::replace (uint32 idx, int32 n1, const char8* str, int32 n2)
{ {
if (idx > len || str == 0)
if (idx > len || str == nullptr)
return *this; return *this;


if (isWide) if (isWide)
@@ -2874,7 +2881,7 @@ String& String::replace (uint32 idx, int32 n1, const char8* str, int32 n2)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
String& String::replace (uint32 idx, int32 n1, const char16* str, int32 n2) String& String::replace (uint32 idx, int32 n1, const char16* str, int32 n2)
{ {
if (idx > len || str == 0)
if (idx > len || str == nullptr)
return *this; return *this;


if (!isWide) if (!isWide)
@@ -2911,7 +2918,7 @@ String& String::replace (uint32 idx, int32 n1, const char16* str, int32 n2)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
int32 String::replace (const char8* toReplace, const char8* toReplaceWith, bool all, CompareMode m) int32 String::replace (const char8* toReplace, const char8* toReplaceWith, bool all, CompareMode m)
{ {
if (toReplace == 0 || toReplaceWith == 0)
if (toReplace == nullptr || toReplaceWith == nullptr)
return 0; return 0;


int32 result = 0; int32 result = 0;
@@ -2939,7 +2946,7 @@ int32 String::replace (const char8* toReplace, const char8* toReplaceWith, bool
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
int32 String::replace (const char16* toReplace, const char16* toReplaceWith, bool all, CompareMode m) int32 String::replace (const char16* toReplace, const char16* toReplaceWith, bool all, CompareMode m)
{ {
if (toReplace == 0 || toReplaceWith == 0)
if (toReplace == nullptr || toReplaceWith == nullptr)
return 0; return 0;


int32 result = 0; int32 result = 0;
@@ -3264,7 +3271,7 @@ static uint32 performRemoveChars (T* str, uint32 length, const T* toRemove)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
bool String::removeChars8 (const char8* toRemove) bool String::removeChars8 (const char8* toRemove)
{ {
if (isEmpty () || toRemove == 0)
if (isEmpty () || toRemove == nullptr)
return true; return true;


if (isWide) if (isWide)
@@ -3288,7 +3295,7 @@ bool String::removeChars8 (const char8* toRemove)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
bool String::removeChars16 (const char16* toRemove) bool String::removeChars16 (const char16* toRemove)
{ {
if (isEmpty () || toRemove == 0)
if (isEmpty () || toRemove == nullptr)
return true; return true;


if (!isWide) if (!isWide)
@@ -3649,7 +3656,7 @@ void String::take (String& other)
buffer = other.buffer; buffer = other.buffer;
len = other.len; len = other.len;


other.buffer = 0;
other.buffer = nullptr;
other.len = 0; other.len = 0;
} }


@@ -3667,7 +3674,7 @@ void* String::pass ()
{ {
void* res = buffer; void* res = buffer;
len = 0; len = 0;
buffer = 0;
buffer = nullptr;
return res; return res;
} }


@@ -3857,11 +3864,11 @@ uint32 hashString16 (const char16* s, uint32 m)
//------------------------------------------------------------------------ //------------------------------------------------------------------------
template <class T> int32 tstrnatcmp (const T* s1, const T* s2, bool caseSensitive = true) template <class T> int32 tstrnatcmp (const T* s1, const T* s2, bool caseSensitive = true)
{ {
if (s1 == 0 && s2 == 0)
if (s1 == nullptr && s2 == nullptr)
return 0; return 0;
else if (s1 == 0)
else if (s1 == nullptr)
return -1; return -1;
else if (s2 == 0)
else if (s2 == nullptr)
return 1; return 1;


while (*s1 && *s2) while (*s1 && *s2)
@@ -3907,8 +3914,8 @@ template <class T> int32 tstrnatcmp (const T* s1, const T* s2, bool caseSensitiv
{ {
if (caseSensitive == false) if (caseSensitive == false)
{ {
T srcToUpper = toupper (*s1);
T dstToUpper = toupper (*s2);
T srcToUpper = static_cast<T> (toupper (*s1));
T dstToUpper = static_cast<T> (toupper (*s2));
if (srcToUpper != dstToUpper) if (srcToUpper != dstToUpper)
return (int32)(srcToUpper - dstToUpper); return (int32)(srcToUpper - dstToUpper);
} }


+ 15
- 14
modules/juce_audio_processors/format_types/VST3_SDK/base/source/fstring.h View File

@@ -9,7 +9,7 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LICENSE // LICENSE
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // are permitted provided that the following conditions are met:
@@ -44,7 +44,7 @@


#include "base/source/fobject.h" #include "base/source/fobject.h"


#include <stdarg.h>
#include <cstdarg>


namespace Steinberg { namespace Steinberg {


@@ -126,7 +126,7 @@ public:


// access ----------------------------------------------------------------- // access -----------------------------------------------------------------
virtual int32 length () const {return static_cast<int32> (len);} ///< Return length of string virtual int32 length () const {return static_cast<int32> (len);} ///< Return length of string
inline bool isEmpty () const {return buffer == 0 || len == 0;} ///< Return true if string is empty
inline bool isEmpty () const {return buffer == nullptr || len == 0;} ///< Return true if string is empty


operator const char8* () const {return text8 ();} ///< Returns pointer to string of type char8 (no modification allowed) operator const char8* () const {return text8 ();} ///< Returns pointer to string of type char8 (no modification allowed)
operator const char16* () const {return text16 ();} ///< Returns pointer to string of type char16(no modification allowed) operator const char16* () const {return text16 ();} ///< Returns pointer to string of type char16(no modification allowed)
@@ -307,6 +307,7 @@ Extends class ConstString by operations which allow modifications.
class String : public ConstString class String : public ConstString
{ {
public: public:
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
String (); String ();
String (const char8* str, MBCodePage codepage, int32 n = -1, bool isTerminated = true); ///< assign n characters of str and convert to wide string by using the specified codepage String (const char8* str, MBCodePage codepage, int32 n = -1, bool isTerminated = true); ///< assign n characters of str and convert to wide string by using the specified codepage
@@ -325,10 +326,10 @@ public:


// access------------------------------------------------------------------ // access------------------------------------------------------------------
void updateLength (); ///< Call this when the string is truncated outside (not recommended though) void updateLength (); ///< Call this when the string is truncated outside (not recommended though)
virtual const char8* text8 () const SMTG_OVERRIDE;
virtual const char16* text16 () const SMTG_OVERRIDE;
virtual char8 getChar8 (uint32 index) const SMTG_OVERRIDE;
virtual char16 getChar16 (uint32 index) const SMTG_OVERRIDE;
const char8* text8 () const SMTG_OVERRIDE;
const char16* text16 () const SMTG_OVERRIDE;
char8 getChar8 (uint32 index) const SMTG_OVERRIDE;
char16 getChar16 (uint32 index) const SMTG_OVERRIDE;


bool setChar8 (uint32 index, char8 c); bool setChar8 (uint32 index, char8 c);
bool setChar16 (uint32 index, char16 c); bool setChar16 (uint32 index, char16 c);
@@ -725,18 +726,18 @@ public:
using String::operator=; using String::operator=;


// IStringResult ---------------------------------------------------------- // IStringResult ----------------------------------------------------------
virtual void PLUGIN_API setText (const char8* text) SMTG_OVERRIDE;
void PLUGIN_API setText (const char8* text) SMTG_OVERRIDE;
//------------------------------------------------------------------------- //-------------------------------------------------------------------------


// IString----------------------------------------------------------------- // IString-----------------------------------------------------------------
virtual void PLUGIN_API setText8 (const char8* text) SMTG_OVERRIDE;
virtual void PLUGIN_API setText16 (const char16* text) SMTG_OVERRIDE;
void PLUGIN_API setText8 (const char8* text) SMTG_OVERRIDE;
void PLUGIN_API setText16 (const char16* text) SMTG_OVERRIDE;


virtual const char8* PLUGIN_API getText8 () SMTG_OVERRIDE;
virtual const char16* PLUGIN_API getText16 () SMTG_OVERRIDE;
const char8* PLUGIN_API getText8 () SMTG_OVERRIDE;
const char16* PLUGIN_API getText16 () SMTG_OVERRIDE;


virtual void PLUGIN_API take (void* s, bool _isWide) SMTG_OVERRIDE;
virtual bool PLUGIN_API isWideString () const SMTG_OVERRIDE;
void PLUGIN_API take (void* s, bool _isWide) SMTG_OVERRIDE;
bool PLUGIN_API isWideString () const SMTG_OVERRIDE;
//------------------------------------------------------------------------- //-------------------------------------------------------------------------


OBJ_METHODS (StringObject, FObject) OBJ_METHODS (StringObject, FObject)


+ 28
- 16
modules/juce_audio_processors/format_types/VST3_SDK/base/source/updatehandler.cpp View File

@@ -9,7 +9,7 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LICENSE // LICENSE
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // are permitted provided that the following conditions are met:
@@ -128,28 +128,28 @@ struct UpdateData
}; };


//------------------------------------------------------------------------ //------------------------------------------------------------------------
typedef std::deque<DeferedChange> DeferedChangeList;
typedef DeferedChangeList::const_iterator DeferedChangeListIterConst;
typedef DeferedChangeList::iterator DeferedChangeListIter;
using DeferedChangeList = std::deque<DeferedChange>;
using DeferedChangeListIterConst = DeferedChangeList::const_iterator;
using DeferedChangeListIter = DeferedChangeList::iterator;


typedef std::deque<UpdateData> UpdateDataList;
typedef UpdateDataList::const_iterator UpdateDataListIterConst;
using UpdateDataList = std::deque<UpdateData>;
using UpdateDataListIterConst = UpdateDataList::const_iterator;


#if CLASS_NAME_TRACKED #if CLASS_NAME_TRACKED
typedef std::vector<Dependency> DependentList;
using DependentList = std::vector<Dependency>;
#else #else
typedef std::vector<IDependent*> DependentList; typedef std::vector<IDependent*> DependentList;
#endif #endif
typedef DependentList::iterator DependentListIter;
typedef DependentList::const_iterator DependentListIterConst;
using DependentListIter = DependentList::iterator;
using DependentListIterConst = DependentList::const_iterator;


#if SMTG_CPP11_STDLIBSUPPORT #if SMTG_CPP11_STDLIBSUPPORT
typedef std::unordered_map<const FUnknown*, DependentList> DependentMap;
using DependentMap = std::unordered_map<const FUnknown*, DependentList>;
#else #else
typedef std::map<const FUnknown*, DependentList> DependentMap; typedef std::map<const FUnknown*, DependentList> DependentMap;
#endif #endif
typedef DependentMap::iterator DependentMapIter;
typedef DependentMap::const_iterator DependentMapIterConst;
using DependentMapIter = DependentMap::iterator;
using DependentMapIterConst = DependentMap::const_iterator;


struct Table struct Table
{ {
@@ -261,7 +261,7 @@ tresult PLUGIN_API UpdateHandler::removeDependent (FUnknown* u, IDependent* depe
for (uint32 count = 0; count < (*iter).count; count++) for (uint32 count = 0; count < (*iter).count; count++)
{ {
if ((*iter).dependents[count] == dependent) if ((*iter).dependents[count] == dependent)
(*iter).dependents[count] = 0;
(*iter).dependents[count] = nullptr;
} }
} }
++iter; ++iter;
@@ -277,6 +277,8 @@ tresult PLUGIN_API UpdateHandler::removeDependent (FUnknown* u, IDependent* depe
{ {
Update::DependentList& list = (*iterMap).second; Update::DependentList& list = (*iterMap).second;
Update::DependentListIter iterList = list.begin (); Update::DependentListIter iterList = list.begin ();
bool listIsEmpty = false;
while (iterList != list.end ()) while (iterList != list.end ())
{ {
#if CLASS_NAME_TRACKED #if CLASS_NAME_TRACKED
@@ -285,14 +287,24 @@ tresult PLUGIN_API UpdateHandler::removeDependent (FUnknown* u, IDependent* depe
if ((*iterList) == dependent) if ((*iterList) == dependent)
#endif #endif
{ {
iterList = list.erase (iterList);
if (list.size () == 1u)
{
listIsEmpty = true;
break;
}
else
iterList = list.erase (iterList);
} }
else else
{ {
++iterList; ++iterList;
} }
} }
++iterMap;
if (listIsEmpty)
iterMap = map.erase (iterMap);
else
++iterMap;
} }
} }
} }
@@ -594,7 +606,7 @@ tresult PLUGIN_API UpdateHandler::cancelUpdates (FUnknown* u)
FGuard guard (lock); FGuard guard (lock);


Update::DeferedChange change (unknown, 0); Update::DeferedChange change (unknown, 0);
while (1)
while (true)
{ {
auto iter = std::find (table->defered.begin (), table->defered.end (), change); auto iter = std::find (table->defered.begin (), table->defered.end (), change);
if (iter != table->defered.end ()) if (iter != table->defered.end ())


+ 8
- 8
modules/juce_audio_processors/format_types/VST3_SDK/base/source/updatehandler.h View File

@@ -9,7 +9,7 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LICENSE // LICENSE
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // are permitted provided that the following conditions are met:
@@ -57,7 +57,7 @@ public:
/** cancel pending messages send by \param object or by any if object is 0 */ /** cancel pending messages send by \param object or by any if object is 0 */
virtual tresult PLUGIN_API cancelUpdates (FUnknown* object) = 0; virtual tresult PLUGIN_API cancelUpdates (FUnknown* object) = 0;
/** send pending messages send by \param object or by any if object is 0 */ /** send pending messages send by \param object or by any if object is 0 */
virtual tresult PLUGIN_API triggerDeferedUpdates (FUnknown* object = 0) = 0;
virtual tresult PLUGIN_API triggerDeferedUpdates (FUnknown* object = nullptr) = 0;
static const FUID iid; static const FUID iid;
}; };


@@ -86,20 +86,20 @@ public:


// IUpdateHandler // IUpdateHandler
/** register \param dependent to get messages from \param object */ /** register \param dependent to get messages from \param object */
virtual tresult PLUGIN_API addDependent (FUnknown* object, IDependent* dependent) SMTG_OVERRIDE;
tresult PLUGIN_API addDependent (FUnknown* object, IDependent* dependent) SMTG_OVERRIDE;
/** unregister \param dependent to get no messages from \param object */ /** unregister \param dependent to get no messages from \param object */
virtual tresult PLUGIN_API removeDependent (FUnknown* object,
tresult PLUGIN_API removeDependent (FUnknown* object,
IDependent* dependent) SMTG_OVERRIDE; IDependent* dependent) SMTG_OVERRIDE;
/** send \param message to all dependents of \param object immediately */ /** send \param message to all dependents of \param object immediately */
virtual tresult PLUGIN_API triggerUpdates (FUnknown* object, int32 message) SMTG_OVERRIDE;
tresult PLUGIN_API triggerUpdates (FUnknown* object, int32 message) SMTG_OVERRIDE;
/** send \param message to all dependents of \param object when idle */ /** send \param message to all dependents of \param object when idle */
virtual tresult PLUGIN_API deferUpdates (FUnknown* object, int32 message) SMTG_OVERRIDE;
tresult PLUGIN_API deferUpdates (FUnknown* object, int32 message) SMTG_OVERRIDE;


// IUpdateManager // IUpdateManager
/** cancel pending messages send by \param object or by any if object is 0 */ /** cancel pending messages send by \param object or by any if object is 0 */
virtual tresult PLUGIN_API cancelUpdates (FUnknown* object) SMTG_OVERRIDE;
tresult PLUGIN_API cancelUpdates (FUnknown* object) SMTG_OVERRIDE;
/** send pending messages send by \param object or by any if object is 0 */ /** send pending messages send by \param object or by any if object is 0 */
virtual tresult PLUGIN_API triggerDeferedUpdates (FUnknown* object = 0) SMTG_OVERRIDE;
tresult PLUGIN_API triggerDeferedUpdates (FUnknown* object = nullptr) SMTG_OVERRIDE;


/// @cond ignore /// @cond ignore
// obsolete functions kept for compatibility // obsolete functions kept for compatibility


+ 4
- 4
modules/juce_audio_processors/format_types/VST3_SDK/base/thread/include/flock.h View File

@@ -9,7 +9,7 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LICENSE // LICENSE
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // are permitted provided that the following conditions are met:
@@ -102,9 +102,9 @@ public:
~FLock (); ~FLock ();


//-- ILock ----------------------------------------------------------- //-- ILock -----------------------------------------------------------
virtual void lock () SMTG_OVERRIDE;
virtual void unlock () SMTG_OVERRIDE;
virtual bool trylock () SMTG_OVERRIDE;
void lock () SMTG_OVERRIDE;
void unlock () SMTG_OVERRIDE;
bool trylock () SMTG_OVERRIDE;


//------------------------------------------------------------------------ //------------------------------------------------------------------------
protected: protected:


+ 2
- 2
modules/juce_audio_processors/format_types/VST3_SDK/base/thread/source/flock.cpp View File

@@ -9,7 +9,7 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LICENSE // LICENSE
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // are permitted provided that the following conditions are met:
@@ -55,7 +55,7 @@
#define INIT_CS(cs) \ #define INIT_CS(cs) \
InitializeCriticalSection ((LPCRITICAL_SECTION)&cs); InitializeCriticalSection ((LPCRITICAL_SECTION)&cs);


#endif
#endif // SMTG_OS_WINDOWS


namespace Steinberg { namespace Steinberg {
namespace Base { namespace Base {


+ 1
- 1
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/LICENSE.txt View File

@@ -1,6 +1,6 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LICENSE // LICENSE
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
This license applies only to files referencing this license, This license applies only to files referencing this license,
for other files of the Software Development Kit the respective embedded license text for other files of the Software Development Kit the respective embedded license text


+ 5
- 2
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/README.md View File

@@ -1,7 +1,10 @@
# Welcome to VST SDK 3 Interfaces
# Welcome to VST 3 SDK Interfaces
Here are located all VST interfaces definitions (including VST Component/Controller, UI, Test). Here are located all VST interfaces definitions (including VST Component/Controller, UI, Test).
## License & Usage guidelines ## License & Usage guidelines
More details are found at [www.steinberg.net/sdklicenses_vst3](http://www.steinberg.net/sdklicenses_vst3)
More details are found at [www.steinberg.net/sdklicenses_vst3](http://www.steinberg.net/sdklicenses_vst3)
----
Return to [VST 3 SDK](https://github.com/steinbergmedia/vst3sdk)

+ 0
- 1
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/conststringtable.h View File

@@ -24,7 +24,6 @@ namespace Steinberg {
/** Constant unicode string table. /** Constant unicode string table.
Used for conversion from ASCII string literals to char16. Used for conversion from ASCII string literals to char16.
*/ */
//------------------------------------------------------------------------
class ConstStringTable class ConstStringTable
{ {
public: public:


+ 1
- 3
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/falignpush.h View File

@@ -16,15 +16,13 @@


//---------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------
#if SMTG_OS_MACOS #if SMTG_OS_MACOS
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunknown-warning-option"
#pragma GCC diagnostic ignored "-Wunknown-warning-option"
#pragma GCC diagnostic ignored "-Wpragma-pack" #pragma GCC diagnostic ignored "-Wpragma-pack"
#if SMTG_PLATFORM_64 #if SMTG_PLATFORM_64
#pragma pack(push, 16) #pragma pack(push, 16)
#else #else
#pragma pack(push, 1) #pragma pack(push, 1)
#endif #endif
#pragma GCC diagnostic pop
#elif defined __BORLANDC__ #elif defined __BORLANDC__
#pragma -a8 #pragma -a8
#elif SMTG_OS_WINDOWS #elif SMTG_OS_WINDOWS


+ 36
- 7
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/fplatform.h View File

@@ -49,22 +49,31 @@
#define SMTG_OS_IOS 0 #define SMTG_OS_IOS 0
#define SMTG_OS_OSX 0 #define SMTG_OS_OSX 0


#define SMTG_CPU_X86 _M_IX86
#define SMTG_CPU_X86_64 _M_AMD64
#define SMTG_CPU_ARM (_M_ARM && !_M_ARM64)
#define SMTG_CPU_ARM_64 _M_ARM64

#define BYTEORDER kLittleEndian #define BYTEORDER kLittleEndian
#define COM_COMPATIBLE 1 #define COM_COMPATIBLE 1
#define PLUGIN_API __stdcall #define PLUGIN_API __stdcall
#define SMTG_PTHREADS 0 #define SMTG_PTHREADS 0


#define SMTG_EXPORT_SYMBOL __declspec (dllexport)

#ifndef _CRT_SECURE_NO_WARNINGS #ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS
#endif #endif


#pragma warning (disable : 4244) // Conversion from 'type1' to 'type2', possible loss of data.
#pragma warning (disable : 4250) // Inheritance via dominance is allowed
#pragma warning (disable : 4996) // deprecated functions
#ifdef _MSC_VER
#pragma warning (disable : 4244) // Conversion from 'type1' to 'type2', possible loss of data.
#pragma warning (disable : 4250) // Inheritance via dominance is allowed
#pragma warning (disable : 4996) // deprecated functions


#pragma warning (3 : 4189) // local variable is initialized but not referenced
#pragma warning (3 : 4238) // nonstandard extension used : class rvalue used as lvalue
#pragma warning (3 : 4189) // local variable is initialized but not referenced
#pragma warning (3 : 4238) // nonstandard extension used : class rvalue used as lvalue
#endif


#if defined (_WIN64) || defined (_M_ARM64) #if defined (_WIN64) || defined (_M_ARM64)
#define SMTG_PLATFORM_64 1 #define SMTG_PLATFORM_64 1
@@ -86,13 +95,18 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LINUX // LINUX
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#elif __gnu_linux__
#elif __gnu_linux__ || __linux__
#define SMTG_OS_LINUX 1 #define SMTG_OS_LINUX 1
#define SMTG_OS_MACOS 0 #define SMTG_OS_MACOS 0
#define SMTG_OS_WINDOWS 0 #define SMTG_OS_WINDOWS 0
#define SMTG_OS_IOS 0 #define SMTG_OS_IOS 0
#define SMTG_OS_OSX 0 #define SMTG_OS_OSX 0


#define SMTG_CPU_X86 __i386__
#define SMTG_CPU_X86_64 __x86_64__
#define SMTG_CPU_ARM __arm__
#define SMTG_CPU_ARM_64 __aarch64__

#include <endian.h> #include <endian.h>
#if __BYTE_ORDER == __LITTLE_ENDIAN #if __BYTE_ORDER == __LITTLE_ENDIAN
#define BYTEORDER kLittleEndian #define BYTEORDER kLittleEndian
@@ -104,6 +118,8 @@
#define PLUGIN_API #define PLUGIN_API
#define SMTG_PTHREADS 1 #define SMTG_PTHREADS 1


#define SMTG_EXPORT_SYMBOL __attribute__ ((visibility ("default")))

#if __LP64__ #if __LP64__
#define SMTG_PLATFORM_64 1 #define SMTG_PLATFORM_64 1
#else #else
@@ -115,7 +131,11 @@
#ifndef SMTG_CPP11 #ifndef SMTG_CPP11
#error unsupported compiler #error unsupported compiler
#endif #endif
#define SMTG_CPP11_STDLIBSUPPORT 1
#if defined(__GNUG__) && __GNUG__ < 8
#define SMTG_CPP11_STDLIBSUPPORT 0
#else
#define SMTG_CPP11_STDLIBSUPPORT 1
#endif
#define SMTG_HAS_NOEXCEPT 1 #define SMTG_HAS_NOEXCEPT 1
#endif #endif
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -129,6 +149,11 @@
#define SMTG_OS_IOS TARGET_OS_IPHONE #define SMTG_OS_IOS TARGET_OS_IPHONE
#define SMTG_OS_OSX TARGET_OS_MAC && !TARGET_OS_IPHONE #define SMTG_OS_OSX TARGET_OS_MAC && !TARGET_OS_IPHONE


#define SMTG_CPU_X86 TARGET_CPU_X86
#define SMTG_CPU_X86_64 TARGET_CPU_X86_64
#define SMTG_CPU_ARM TARGET_CPU_ARM
#define SMTG_CPU_ARM_64 TARGET_CPU_ARM64

#if !SMTG_OS_IOS #if !SMTG_OS_IOS
#ifndef __CF_USE_FRAMEWORK_INCLUDES__ #ifndef __CF_USE_FRAMEWORK_INCLUDES__
#define __CF_USE_FRAMEWORK_INCLUDES__ #define __CF_USE_FRAMEWORK_INCLUDES__
@@ -152,6 +177,8 @@
#define PLUGIN_API #define PLUGIN_API
#define SMTG_PTHREADS 1 #define SMTG_PTHREADS 1


#define SMTG_EXPORT_SYMBOL __attribute__ ((visibility ("default")))

#if !defined(__PLIST__) && !defined(SMTG_DISABLE_DEFAULT_DIAGNOSTICS) #if !defined(__PLIST__) && !defined(SMTG_DISABLE_DEFAULT_DIAGNOSTICS)
#ifdef __clang__ #ifdef __clang__
#pragma GCC diagnostic ignored "-Wswitch-enum" #pragma GCC diagnostic ignored "-Wswitch-enum"
@@ -209,8 +236,10 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#if SMTG_CPP11 #if SMTG_CPP11
#define SMTG_OVERRIDE override #define SMTG_OVERRIDE override
#define SMTG_CONSTEXPR constexpr
#else #else
#define SMTG_OVERRIDE #define SMTG_OVERRIDE
#define SMTG_CONSTEXPR
#endif #endif
#if SMTG_HAS_NOEXCEPT #if SMTG_HAS_NOEXCEPT
#define SMTG_NOEXCEPT noexcept #define SMTG_NOEXCEPT noexcept


+ 1
- 3
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/fstrdefs.h View File

@@ -19,7 +19,7 @@
#include "ftypes.h" #include "ftypes.h"


//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// string methods defines unicode / ASCII
/** string methods defines unicode / ASCII */
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------


// 16 bit string operations // 16 bit string operations
@@ -265,10 +265,8 @@ inline void str8ToStr16 (char16* dst, const char8* src, int32 n = -1)
#else #else
dst[i] = static_cast<char16> (src[i]); dst[i] = static_cast<char16> (src[i]);
#endif #endif

if (src[i] == 0) if (src[i] == 0)
break; break;

i++; i++;
} }




+ 5
- 3
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/ftypes.h View File

@@ -93,6 +93,8 @@ namespace Steinberg
typedef char char8; typedef char char8;
#ifdef _NATIVE_WCHAR_T_DEFINED #ifdef _NATIVE_WCHAR_T_DEFINED
typedef __wchar_t char16; typedef __wchar_t char16;
#elif defined(__MINGW32__)
typedef wchar_t char16;
#elif SMTG_CPP11 #elif SMTG_CPP11
typedef char16_t char16; typedef char16_t char16;
#else #else
@@ -137,8 +139,8 @@ namespace Steinberg




//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
/** Byte-order Conversion Macros */
//----------------------------------------------------------------------------
/** Byte-order Conversion Macros
*/
#define SWAP_32(l) { \ #define SWAP_32(l) { \
unsigned char* p = (unsigned char*)& (l); \ unsigned char* p = (unsigned char*)& (l); \
unsigned char t; \ unsigned char t; \
@@ -170,7 +172,7 @@ namespace Steinberg
// always inline macros (only when RELEASE is 1) // always inline macros (only when RELEASE is 1)
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
#if RELEASE #if RELEASE
#if SMTG_OS_MACOS || SMTG_OS_LINUX
#if SMTG_OS_MACOS || SMTG_OS_LINUX || defined(__MINGW32__)
#define SMTG_ALWAYS_INLINE __inline__ __attribute__((__always_inline__)) #define SMTG_ALWAYS_INLINE __inline__ __attribute__((__always_inline__))
#define SMTG_NEVER_INLINE __attribute__((noinline)) #define SMTG_NEVER_INLINE __attribute__((noinline))
#elif SMTG_OS_WINDOWS #elif SMTG_OS_WINDOWS


+ 45
- 9
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/funknown.cpp View File

@@ -18,7 +18,7 @@


#include "fstrdefs.h" #include "fstrdefs.h"


#include <stdio.h>
#include <cstdio>


#if SMTG_OS_WINDOWS #if SMTG_OS_WINDOWS
#include <objbase.h> #include <objbase.h>
@@ -26,18 +26,38 @@


#if SMTG_OS_MACOS #if SMTG_OS_MACOS
#include <CoreFoundation/CoreFoundation.h> #include <CoreFoundation/CoreFoundation.h>
#include <libkern/OSAtomic.h>


#if !defined (SMTG_USE_STDATOMIC_H)
#if defined(MAC_OS_X_VERSION_10_11) && defined(MAC_OS_X_VERSION_MIN_REQUIRED)
#define SMTG_USE_STDATOMIC_H (MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_11)
#else
#define SMTG_USE_STDATOMIC_H 0
#endif
#endif // !defined (SMTG_USE_STDATOMIC_H)

#if !SMTG_USE_STDATOMIC_H
#include <libkern/OSAtomic.h>
#if defined(__GNUC__) && (__GNUC__ >= 4) && !__LP64__ #if defined(__GNUC__) && (__GNUC__ >= 4) && !__LP64__
// on 32 bit Mac OS X we can safely ignore the format warnings as sizeof(int) == sizeof(long) // on 32 bit Mac OS X we can safely ignore the format warnings as sizeof(int) == sizeof(long)
#pragma GCC diagnostic ignored "-Wformat" #pragma GCC diagnostic ignored "-Wformat"
#endif

#endif
#endif
#endif // !SMTG_USE_STDATOMIC_H
#endif // SMTG_OS_MACOS


#if SMTG_OS_LINUX #if SMTG_OS_LINUX
#if !defined (SMTG_USE_STDATOMIC_H)
#if defined (__ANDROID__) || defined(_LIBCPP_VERSION)
#define SMTG_USE_STDATOMIC_H 1
#else
#include <ext/atomicity.h> #include <ext/atomicity.h>
#endif #endif
#endif // !defined (SMTG_USE_STDATOMIC_H)
#include <stdlib.h>
#endif

#if defined (SMTG_USE_STDATOMIC_H) && SMTG_USE_STDATOMIC_H
#include <stdatomic.h>
#endif


namespace Steinberg { namespace Steinberg {


@@ -67,10 +87,19 @@ namespace FUnknownPrivate {
//------------------------------------------------------------------------ //------------------------------------------------------------------------
int32 PLUGIN_API atomicAdd (int32& var, int32 d) int32 PLUGIN_API atomicAdd (int32& var, int32 d)
{ {
#if SMTG_USE_STDATOMIC_H
return atomic_fetch_add (reinterpret_cast<atomic_int_least32_t*> (&var), d) + d;
#else
#if SMTG_OS_WINDOWS #if SMTG_OS_WINDOWS
return InterlockedExchangeAdd (&var, d) + d;
#ifdef __MINGW32__
return InterlockedExchangeAdd (reinterpret_cast<long volatile*>(&var), d) + d;
#else
return InterlockedExchangeAdd ((LONG*)&var, d) + d;
#endif
#elif SMTG_OS_MACOS #elif SMTG_OS_MACOS
return OSAtomicAdd32Barrier (d, (int32_t*)&var); return OSAtomicAdd32Barrier (d, (int32_t*)&var);
#elif defined(__ANDROID__)
return atomic_fetch_add ((atomic_int*)&var, d) + d;
#elif SMTG_OS_LINUX #elif SMTG_OS_LINUX
__gnu_cxx::__atomic_add (&var, d); __gnu_cxx::__atomic_add (&var, d);
return var; return var;
@@ -79,6 +108,7 @@ int32 PLUGIN_API atomicAdd (int32& var, int32 d)
var += d; var += d;
return var; return var;
#endif #endif
#endif
} }
} // FUnknownPrivate } // FUnknownPrivate


@@ -131,7 +161,7 @@ bool FUID::generate ()
{ {
case RPC_S_OK: memcpy (data, (char*)&guid, sizeof (TUID)); return true; case RPC_S_OK: memcpy (data, (char*)&guid, sizeof (TUID)); return true;


case RPC_S_UUID_LOCAL_ONLY:
case (HRESULT)RPC_S_UUID_LOCAL_ONLY:
default: return false; default: return false;
} }
#endif #endif
@@ -147,7 +177,13 @@ bool FUID::generate ()
} }
return false; return false;


#elif SMTG_OS_LINUX
srand ((size_t)this);
for (int32 i = 0; i < 16; i++)
data[i] = static_cast<unsigned char>(rand ());
return true;
#else #else
#warning implement me!
return false; return false;
#endif #endif
} }
@@ -263,7 +299,7 @@ void FUID::toString (char8* string) const
return; return;


#if COM_COMPATIBLE #if COM_COMPATIBLE
GuidStruct* g = (GuidStruct*)data;
auto* g = (GuidStruct*)data;


char8 s[17]; char8 s[17];
Steinberg::toString8 (s, data, 8, 16); Steinberg::toString8 (s, data, 8, 16);
@@ -349,7 +385,7 @@ void FUID::toRegistryString (char8* string) const
// e.g. {c200e360-38c5-11ce-ae62-08002b2b79ef} // e.g. {c200e360-38c5-11ce-ae62-08002b2b79ef}


#if COM_COMPATIBLE #if COM_COMPATIBLE
GuidStruct* g = (GuidStruct*)data;
auto* g = (GuidStruct*)data;


char8 s1[5]; char8 s1[5];
Steinberg::toString8 (s1, data, 8, 10); Steinberg::toString8 (s1, data, 8, 10);


+ 128
- 53
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/funknown.h View File

@@ -19,12 +19,15 @@
#include "pluginterfaces/base/fplatform.h" #include "pluginterfaces/base/fplatform.h"
#include "pluginterfaces/base/ftypes.h" #include "pluginterfaces/base/ftypes.h"
#include "pluginterfaces/base/smartpointer.h" #include "pluginterfaces/base/smartpointer.h"
#include <string.h>
#include <cstring>

#if SMTG_CPP11_STDLIBSUPPORT
#include <type_traits>
#endif


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/*! \defgroup pluginBase Basic Interfaces /*! \defgroup pluginBase Basic Interfaces
*/ */
//------------------------------------------------------------------------


//------------------------------------------------------------------------ //------------------------------------------------------------------------
// Unique Identifier macros // Unique Identifier macros
@@ -33,26 +36,26 @@
#if COM_COMPATIBLE #if COM_COMPATIBLE
#define INLINE_UID(l1, l2, l3, l4) \ #define INLINE_UID(l1, l2, l3, l4) \
{ \ { \
(::Steinberg::int8)((l1 & 0x000000FF) ), (::Steinberg::int8)((l1 & 0x0000FF00) >> 8), \
(::Steinberg::int8)((l1 & 0x00FF0000) >> 16), (::Steinberg::int8)((l1 & 0xFF000000) >> 24), \
(::Steinberg::int8)((l2 & 0x00FF0000) >> 16), (::Steinberg::int8)((l2 & 0xFF000000) >> 24), \
(::Steinberg::int8)((l2 & 0x000000FF) ), (::Steinberg::int8)((l2 & 0x0000FF00) >> 8), \
(::Steinberg::int8)((l3 & 0xFF000000) >> 24), (::Steinberg::int8)((l3 & 0x00FF0000) >> 16), \
(::Steinberg::int8)((l3 & 0x0000FF00) >> 8), (::Steinberg::int8)((l3 & 0x000000FF) ), \
(::Steinberg::int8)((l4 & 0xFF000000) >> 24), (::Steinberg::int8)((l4 & 0x00FF0000) >> 16), \
(::Steinberg::int8)((l4 & 0x0000FF00) >> 8), (::Steinberg::int8)((l4 & 0x000000FF) ) \
(::Steinberg::int8)(((::Steinberg::uint32)(l1) & 0x000000FF) ), (::Steinberg::int8)(((::Steinberg::uint32)(l1) & 0x0000FF00) >> 8), \
(::Steinberg::int8)(((::Steinberg::uint32)(l1) & 0x00FF0000) >> 16), (::Steinberg::int8)(((::Steinberg::uint32)(l1) & 0xFF000000) >> 24), \
(::Steinberg::int8)(((::Steinberg::uint32)(l2) & 0x00FF0000) >> 16), (::Steinberg::int8)(((::Steinberg::uint32)(l2) & 0xFF000000) >> 24), \
(::Steinberg::int8)(((::Steinberg::uint32)(l2) & 0x000000FF) ), (::Steinberg::int8)(((::Steinberg::uint32)(l2) & 0x0000FF00) >> 8), \
(::Steinberg::int8)(((::Steinberg::uint32)(l3) & 0xFF000000) >> 24), (::Steinberg::int8)(((::Steinberg::uint32)(l3) & 0x00FF0000) >> 16), \
(::Steinberg::int8)(((::Steinberg::uint32)(l3) & 0x0000FF00) >> 8), (::Steinberg::int8)(((::Steinberg::uint32)(l3) & 0x000000FF) ), \
(::Steinberg::int8)(((::Steinberg::uint32)(l4) & 0xFF000000) >> 24), (::Steinberg::int8)(((::Steinberg::uint32)(l4) & 0x00FF0000) >> 16), \
(::Steinberg::int8)(((::Steinberg::uint32)(l4) & 0x0000FF00) >> 8), (::Steinberg::int8)(((::Steinberg::uint32)(l4) & 0x000000FF) ) \
} }
#else #else
#define INLINE_UID(l1, l2, l3, l4) \ #define INLINE_UID(l1, l2, l3, l4) \
{ \ { \
(::Steinberg::int8)((l1 & 0xFF000000) >> 24), (::Steinberg::int8)((l1 & 0x00FF0000) >> 16), \
(::Steinberg::int8)((l1 & 0x0000FF00) >> 8), (::Steinberg::int8)((l1 & 0x000000FF) ), \
(::Steinberg::int8)((l2 & 0xFF000000) >> 24), (::Steinberg::int8)((l2 & 0x00FF0000) >> 16), \
(::Steinberg::int8)((l2 & 0x0000FF00) >> 8), (::Steinberg::int8)((l2 & 0x000000FF) ), \
(::Steinberg::int8)((l3 & 0xFF000000) >> 24), (::Steinberg::int8)((l3 & 0x00FF0000) >> 16), \
(::Steinberg::int8)((l3 & 0x0000FF00) >> 8), (::Steinberg::int8)((l3 & 0x000000FF) ), \
(::Steinberg::int8)((l4 & 0xFF000000) >> 24), (::Steinberg::int8)((l4 & 0x00FF0000) >> 16), \
(::Steinberg::int8)((l4 & 0x0000FF00) >> 8), (::Steinberg::int8)((l4 & 0x000000FF) ) \
(::Steinberg::int8)(((::Steinberg::uint32)(l1) & 0xFF000000) >> 24), (::Steinberg::int8)(((::Steinberg::uint32)(l1) & 0x00FF0000) >> 16), \
(::Steinberg::int8)(((::Steinberg::uint32)(l1) & 0x0000FF00) >> 8), (::Steinberg::int8)(((::Steinberg::uint32)(l1) & 0x000000FF) ), \
(::Steinberg::int8)(((::Steinberg::uint32)(l2) & 0xFF000000) >> 24), (::Steinberg::int8)(((::Steinberg::uint32)(l2) & 0x00FF0000) >> 16), \
(::Steinberg::int8)(((::Steinberg::uint32)(l2) & 0x0000FF00) >> 8), (::Steinberg::int8)(((::Steinberg::uint32)(l2) & 0x000000FF) ), \
(::Steinberg::int8)(((::Steinberg::uint32)(l3) & 0xFF000000) >> 24), (::Steinberg::int8)(((::Steinberg::uint32)(l3) & 0x00FF0000) >> 16), \
(::Steinberg::int8)(((::Steinberg::uint32)(l3) & 0x0000FF00) >> 8), (::Steinberg::int8)(((::Steinberg::uint32)(l3) & 0x000000FF) ), \
(::Steinberg::int8)(((::Steinberg::uint32)(l4) & 0xFF000000) >> 24), (::Steinberg::int8)(((::Steinberg::uint32)(l4) & 0x00FF0000) >> 16), \
(::Steinberg::int8)(((::Steinberg::uint32)(l4) & 0x0000FF00) >> 8), (::Steinberg::int8)(((::Steinberg::uint32)(l4) & 0x000000FF) ) \
} }
#endif #endif


@@ -117,7 +120,12 @@ public: \


//------------------------------------------------------------------------ //------------------------------------------------------------------------
#define FUNKNOWN_CTOR { __funknownRefCount = 1; } #define FUNKNOWN_CTOR { __funknownRefCount = 1; }
#if SMTG_FUNKNOWN_DTOR_ASSERT
#include <cassert>
#define FUNKNOWN_DTOR { assert (__funknownRefCount == 0); }
#else
#define FUNKNOWN_DTOR #define FUNKNOWN_DTOR
#endif


//------------------------------------------------------------------------ //------------------------------------------------------------------------
#define QUERY_INTERFACE(iid, obj, InterfaceIID, InterfaceName) \ #define QUERY_INTERFACE(iid, obj, InterfaceIID, InterfaceName) \
@@ -221,7 +229,6 @@ int32 PLUGIN_API atomicAdd (int32& value, int32 amount);
Each interface declares its identifier as static member inside the interface Each interface declares its identifier as static member inside the interface
namespace (e.g. FUnknown::iid). namespace (e.g. FUnknown::iid).
*/ */
//------------------------------------------------------------------------
class FUID class FUID
{ {
public: public:
@@ -258,14 +265,14 @@ public:
void from4Int (uint32 d1, uint32 d2, uint32 d3, uint32 d4); void from4Int (uint32 d1, uint32 d2, uint32 d3, uint32 d4);
void to4Int (uint32& d1, uint32& d2, uint32& d3, uint32& d4) const; void to4Int (uint32& d1, uint32& d2, uint32& d3, uint32& d4) const;


typedef char8 String[64];
typedef char8 String[33];


/** Converts UID to a string. /** Converts UID to a string.
The string will be 32 characters long, representing the hexadecimal values The string will be 32 characters long, representing the hexadecimal values
of each data byte (e.g. "9127BE30160E4BB69966670AA6087880"). of each data byte (e.g. "9127BE30160E4BB69966670AA6087880").
Typical use-case is: Typical use-case is:
\code
\code{.cpp}
char8[33] strUID = {0}; char8[33] strUID = {0};
FUID uid; FUID uid;
if (uid.generate ()) if (uid.generate ())
@@ -279,11 +286,11 @@ public:
the ASCII-encoded hexadecimal value of the corresponding data byte. */ the ASCII-encoded hexadecimal value of the corresponding data byte. */
bool fromString (const char8* string); bool fromString (const char8* string);


/** Converts UID to a string in Microsoft® OLE format.
/** Converts UID to a string in Microsoft(R) OLE format.
(e.g. "{c200e360-38c5-11ce-ae62-08002b2b79ef}") */ (e.g. "{c200e360-38c5-11ce-ae62-08002b2b79ef}") */
void toRegistryString (char8* string) const; void toRegistryString (char8* string) const;


/** Sets the UID data from a string in Microsoft® OLE format. */
/** Sets the UID data from a string in Microsoft(R) OLE format. */
bool fromRegistryString (const char8* string); bool fromRegistryString (const char8* string);


enum UIDPrintStyle enum UIDPrintStyle
@@ -348,8 +355,8 @@ inline bool operator== (const FUID& f1, T f2)
Interfaces are identified by 16 byte Globally Unique Identifiers. Interfaces are identified by 16 byte Globally Unique Identifiers.
The SDK provides a class called FUID for this purpose. The SDK provides a class called FUID for this purpose.


\ref howtoClass */
//------------------------------------------------------------------------
\ref howtoClass
*/
class FUnknown class FUnknown
{ {
public: public:
@@ -362,12 +369,12 @@ public:
\param obj : (out) On return, *obj points to the requested interface */ \param obj : (out) On return, *obj points to the requested interface */
virtual tresult PLUGIN_API queryInterface (const TUID _iid, void** obj) = 0; virtual tresult PLUGIN_API queryInterface (const TUID _iid, void** obj) = 0;


/** Adds a reference and return the new reference count.
/** Adds a reference and returns the new reference count.
\par Remarks: \par Remarks:
The initial reference count after creating an object is 1. */ The initial reference count after creating an object is 1. */
virtual uint32 PLUGIN_API addRef () = 0; virtual uint32 PLUGIN_API addRef () = 0;


/** Releases a reference and return the new reference count.
/** Releases a reference and returns the new reference count.
If the reference count reaches zero, the object will be destroyed in memory. */ If the reference count reaches zero, the object will be destroyed in memory. */
virtual uint32 PLUGIN_API release () = 0; virtual uint32 PLUGIN_API release () = 0;


@@ -384,14 +391,13 @@ DECLARE_CLASS_IID (FUnknown, 0x00000000, 0x00000000, 0xC0000000, 0x00000046)
//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** FUnknownPtr - automatic interface conversion and smart pointer in one. /** FUnknownPtr - automatic interface conversion and smart pointer in one.
This template class can be used for interface conversion like this: This template class can be used for interface conversion like this:
\code
IPtr<IPath> path = owned (FHostCreate (IPath, hostClasses));
FUnknownPtr<IPath2> path2 (path); // does a query interface for IPath2
if (path2)
...
\code{.cpp}
IPtr<IPath> path = owned (FHostCreate (IPath, hostClasses));
FUnknownPtr<IPath2> path2 (path); // does a query interface for IPath2
if (path2)
...
\endcode \endcode
*/ */
//------------------------------------------------------------------------
template <class I> template <class I>
class FUnknownPtr : public IPtr<I> class FUnknownPtr : public IPtr<I>
{ {
@@ -408,13 +414,83 @@ public:
} }
inline I* operator= (FUnknown* unknown); inline I* operator= (FUnknown* unknown);
inline I* getInterface () { return this->ptr; } inline I* getInterface () { return this->ptr; }

#if SMTG_CPP11_STDLIBSUPPORT
inline FUnknownPtr (FUnknownPtr&& p) SMTG_NOEXCEPT : IPtr<I> (std::move (p)) {}
inline FUnknownPtr& operator= (FUnknownPtr&& p) SMTG_NOEXCEPT
{
IPtr<I>::operator= (std::move (p));
return *this;
}
#endif
};

#if SMTG_CPP11_STDLIBSUPPORT

//------------------------------------------------------------------------
namespace FUnknownPrivate {

template <typename T>
struct Void : std::false_type
{
using Type = void;
};

template <typename T>
using VoidT = typename Void<T>::Type;

//------------------------------------------------------------------------
/**
* This type trait detects if a class has an @c iid member variable. It is used to detect if
* the FUID and DECLARE_CLASS_IID method or the SKI::UID method is used.
*/
template <typename T, typename U = void>
struct HasIIDType : std::false_type
{
};

//------------------------------------------------------------------------
template <typename T>
struct HasIIDType<T, FUnknownPrivate::VoidT<typename T::IID>> : std::true_type
{
}; };


//------------------------------------------------------------------------
} // FUnknownPrivate

//------------------------------------------------------------------------
/** @return the TUID for a SKI interface which uses the SKI::UID method. */
template <typename T,
typename std::enable_if<FUnknownPrivate::HasIIDType<T>::value>::type* = nullptr>
const TUID& getTUID ()
{
return T::IID::toTUID ();
}

//------------------------------------------------------------------------
/** @return the TUID for a SKI interface which uses the FUID and DECLARE_CLASS_IID method. */
template <typename T,
typename std::enable_if<!FUnknownPrivate::HasIIDType<T>::value>::type* = nullptr>
const TUID& getTUID ()
{
return T::iid.toTUID ();
}

#else // SMTG_CPP11_STDLIBSUPPORT

template<typename T>
const TUID& getTUID ()
{
return T::iid.toTUID ();
}

#endif // SMTG_CPP11_STDLIBSUPPORT

//------------------------------------------------------------------------ //------------------------------------------------------------------------
template <class I> template <class I>
inline FUnknownPtr<I>::FUnknownPtr (FUnknown* unknown) inline FUnknownPtr<I>::FUnknownPtr (FUnknown* unknown)
{ {
if (unknown && unknown->queryInterface (I::iid, (void**)&this->ptr) != kResultOk)
if (unknown && unknown->queryInterface (getTUID<I> (), (void**)&this->ptr) != kResultOk)
this->ptr = 0; this->ptr = 0;
} }


@@ -423,7 +499,7 @@ template <class I>
inline I* FUnknownPtr<I>::operator= (FUnknown* unknown) inline I* FUnknownPtr<I>::operator= (FUnknown* unknown)
{ {
I* newPtr = 0; I* newPtr = 0;
if (unknown && unknown->queryInterface (I::iid, (void**)&newPtr) == kResultOk)
if (unknown && unknown->queryInterface (getTUID<I> (), (void**)&newPtr) == kResultOk)
{ {
OPtr<I> rel (newPtr); OPtr<I> rel (newPtr);
return IPtr<I>::operator= (newPtr); return IPtr<I>::operator= (newPtr);
@@ -440,26 +516,25 @@ This class is obsolete and is only kept for compatibility.
The replacement for FReleaser is OPtr. The replacement for FReleaser is OPtr.


Usage example with FReleaser: Usage example with FReleaser:
\code
void someFunction ()
{
IPath* path = pathCreateMethod ();
FReleaser releaser (path);
.... do something with path...
.... path not used anymore, releaser will destroy it when leaving function scope
}
\endcode
\code{.cpp}
void someFunction ()
{
IPath* path = pathCreateMethod ();
FReleaser releaser (path);
.... do something with path...
.... path not used anymore, releaser will destroy it when leaving function scope
}
\endcode
Usage example with OPtr: Usage example with OPtr:
\code
void someFunction ()
{
OPtr<IPath> path = pathCreateMethod ();
.... do something with path...
.... path not used anymore, OPtr will destroy it when leaving function scope
}
\endcode
\code{.cpp}
void someFunction ()
{
OPtr<IPath> path = pathCreateMethod ();
.... do something with path...
.... path not used anymore, OPtr will destroy it when leaving function scope
}
\endcode
*/ */
//------------------------------------------------------------------------
struct FReleaser struct FReleaser
{ {
FReleaser (FUnknown* u) : u (u) {} FReleaser (FUnknown* u) : u (u) {}


+ 4
- 4
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/fvariant.h View File

@@ -138,10 +138,10 @@ public:
return (type & kInteger) ? static_cast<double> (intValue) : (type & kFloat) ? floatValue : return (type & kInteger) ? static_cast<double> (intValue) : (type & kFloat) ? floatValue :
0.; 0.;
} }
inline const char8* getString8 () const { return (type & kString8) ? string8 : 0; }
inline const char16* getString16 () const { return (type & kString16) ? string16 : 0; }
inline const char8* getString8 () const { return (type & kString8) ? string8 : nullptr; }
inline const char16* getString16 () const { return (type & kString16) ? string16 : nullptr; }


inline FUnknown* getObject () const { return (type & kObject) ? object : 0; }
inline FUnknown* getObject () const { return (type & kObject) ? object : nullptr; }


inline uint16 getType () const { return static_cast<uint16> (type & ~(kOwner)); } inline uint16 getType () const { return static_cast<uint16> (type & ~(kOwner)); }
inline bool isEmpty () const { return getType () == kEmpty; } inline bool isEmpty () const { return getType () == kEmpty; }
@@ -274,7 +274,7 @@ inline FVariant& FVariant::operator= (const FVariant& variant)
} }
else if ((type & kString16) && variant.string16) else if ((type & kString16) && variant.string16)
{ {
int32 len = strlen16 (variant.string16);
auto len = static_cast<size_t> (strlen16 (variant.string16));
string16 = new char16[len + 1]; string16 = new char16[len + 1];
char16* tmp = const_cast<char16*> (string16); char16* tmp = const_cast<char16*> (string16);
memcpy (tmp, variant.string16, len * sizeof (char16)); memcpy (tmp, variant.string16, len * sizeof (char16));


+ 5
- 7
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/ibstream.h View File

@@ -26,8 +26,6 @@ namespace Steinberg {
- read/write binary data from/to stream - read/write binary data from/to stream
- get/set stream read-write position (read and write position is the same) - get/set stream read-write position (read and write position is the same)
*/ */
//------------------------------------------------------------------------

class IBStream: public FUnknown class IBStream: public FUnknown
{ {
public: public:
@@ -43,19 +41,19 @@ public:
\param buffer : destination buffer \param buffer : destination buffer
\param numBytes : amount of bytes to be read \param numBytes : amount of bytes to be read
\param numBytesRead : result - how many bytes have been read from stream (set to 0 if this is of no interest) */ \param numBytesRead : result - how many bytes have been read from stream (set to 0 if this is of no interest) */
virtual tresult PLUGIN_API read (void* buffer, int32 numBytes, int32* numBytesRead = 0) = 0;
virtual tresult PLUGIN_API read (void* buffer, int32 numBytes, int32* numBytesRead = nullptr) = 0;
/** Writes binary data to stream. /** Writes binary data to stream.
\param buffer : source buffer \param buffer : source buffer
\param numBytes : amount of bytes to write \param numBytes : amount of bytes to write
\param numBytesWritten : result - how many bytes have been written to stream (set to 0 if this is of no interest) */ \param numBytesWritten : result - how many bytes have been written to stream (set to 0 if this is of no interest) */
virtual tresult PLUGIN_API write (void* buffer, int32 numBytes, int32* numBytesWritten = 0) = 0;
virtual tresult PLUGIN_API write (void* buffer, int32 numBytes, int32* numBytesWritten = nullptr) = 0;
/** Sets stream read-write position. /** Sets stream read-write position.
\param pos : new stream position (dependent on mode) \param pos : new stream position (dependent on mode)
\param mode : value of enum IStreamSeekMode \param mode : value of enum IStreamSeekMode
\param result : new seek position (set to 0 if this is of no interest) */ \param result : new seek position (set to 0 if this is of no interest) */
virtual tresult PLUGIN_API seek (int64 pos, int32 mode, int64* result = 0) = 0;
virtual tresult PLUGIN_API seek (int64 pos, int32 mode, int64* result = nullptr) = 0;
/** Gets current stream read-write position. /** Gets current stream read-write position.
\param pos : is assigned the current position if function succeeds */ \param pos : is assigned the current position if function succeeds */
@@ -69,8 +67,8 @@ DECLARE_CLASS_IID (IBStream, 0xC3BF6EA2, 0x30994752, 0x9B6BF990, 0x1EE33E9B)
//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Stream with a size. /** Stream with a size.
\ingroup pluginBase \ingroup pluginBase
[extends IBStream] when stream type supports it (like file and memory stream) */
//------------------------------------------------------------------------
[extends IBStream] when stream type supports it (like file and memory stream)
*/
class ISizeableStream: public FUnknown class ISizeableStream: public FUnknown
{ {
public: public:


+ 2
- 3
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/icloneable.h View File

@@ -22,10 +22,9 @@ namespace Steinberg {


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Interface allowing an object to be copied. /** Interface allowing an object to be copied.
[plug & host imp] \n
[released: N4.12] \n
- [plug & host imp]
- [released: N4.12]
*/ */
//------------------------------------------------------------------------
class ICloneable : public FUnknown class ICloneable : public FUnknown
{ {
public: public:


+ 8
- 9
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/ipersistent.h View File

@@ -29,9 +29,9 @@ This interface is used to store/restore attributes of an object.
An IPlugController can implement this interface to handle presets. An IPlugController can implement this interface to handle presets.
The gui-xml for a preset control looks like this: The gui-xml for a preset control looks like this:
\code \code
....
<view name="PresetView" data="Preset"/>
....
....
<view name="PresetView" data="Preset"/>
....
<template name="PresetView"> <template name="PresetView">
<view name="preset control" size="0, 0, 100, 20"/> <view name="preset control" size="0, 0, 100, 20"/>
<switch name="store preset" size="125,0,80,20" style="push|immediate" title="Store" /> <switch name="store preset" size="125,0,80,20" style="push|immediate" title="Store" />
@@ -41,7 +41,6 @@ The gui-xml for a preset control looks like this:
The tag data="Preset" tells the host to create a preset controller that handles the The tag data="Preset" tells the host to create a preset controller that handles the
3 values named "preset control", "store preset", and "remove preset". 3 values named "preset control", "store preset", and "remove preset".
*/ */
//------------------------------------------------------------------------
class IPersistent: public FUnknown class IPersistent: public FUnknown
{ {
public: public:
@@ -63,7 +62,8 @@ DECLARE_CLASS_IID (IPersistent, 0xBA1A4637, 0x3C9F46D0, 0xA65DBA0E, 0xB85DA829)
typedef FIDString IAttrID; typedef FIDString IAttrID;
//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Object Data Archive Interface. /** Object Data Archive Interface.
[host imp] \n
- [host imp]

- store data/objects/binary/subattributes in the archive - store data/objects/binary/subattributes in the archive
- read stored data from the archive - read stored data from the archive


@@ -76,7 +76,6 @@ in namespace PAttributes (public.sdk/source/common/pattributes.h+cpp) !!


\ingroup frameworkHostClasses \ingroup frameworkHostClasses
*/ */
//------------------------------------------------------------------------
class IAttributes: public FUnknown class IAttributes: public FUnknown
{ {
public: public:
@@ -139,11 +138,11 @@ DECLARE_CLASS_IID (IAttributes, 0xFA1E32F9, 0xCA6D46F5, 0xA982F956, 0xB1191B58)


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Extended access to Attributes; supports Attribute retrieval via iteration. /** Extended access to Attributes; supports Attribute retrieval via iteration.
[host imp] \n
[released] C7/N6 \n
- [host imp]
- [released] C7/N6

\ingroup frameworkHostClasses \ingroup frameworkHostClasses
*/ */
//------------------------------------------------------------------------
class IAttributes2 : public IAttributes class IAttributes2 : public IAttributes
{ {
public: public:


+ 52
- 63
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/ipluginbase.h View File

@@ -22,27 +22,27 @@
namespace Steinberg { namespace Steinberg {


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Basic interface to a Plug-in component.
/** Basic interface to a plug-in component: IPluginBase
\ingroup pluginBase \ingroup pluginBase
- [plug imp] - [plug imp]
- initialize/terminate the Plug-in component
- initialize/terminate the plug-in component


The host uses this interface to initialize and to terminate the Plug-in component.
The host uses this interface to initialize and to terminate the plug-in component.
The context that is passed to the initialize method contains any interface to the The context that is passed to the initialize method contains any interface to the
host that the Plug-in will need to work. These interfaces can vary from category to category.
host that the plug-in will need to work. These interfaces can vary from category to category.
A list of supported host context interfaces should be included in the documentation A list of supported host context interfaces should be included in the documentation
of a specific category. */
//------------------------------------------------------------------------
of a specific category.
*/
class IPluginBase: public FUnknown class IPluginBase: public FUnknown
{ {
public: public:
//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** The host passes a number of interfaces as context to initialize the Plug-in class.
/** The host passes a number of interfaces as context to initialize the plug-in class.
@note Extensive memory allocations etc. should be performed in this method rather than in the class' constructor! @note Extensive memory allocations etc. should be performed in this method rather than in the class' constructor!
If the method does NOT return kResultOk, the object is released immediately. In this case terminate is not called! */ If the method does NOT return kResultOk, the object is released immediately. In this case terminate is not called! */
virtual tresult PLUGIN_API initialize (FUnknown* context) = 0; virtual tresult PLUGIN_API initialize (FUnknown* context) = 0;


/** This function is called before the Plug-in is unloaded and can be used for
/** This function is called before the plug-in is unloaded and can be used for
cleanups. You have to release all references to any host application interfaces. */ cleanups. You have to release all references to any host application interfaces. */
virtual tresult PLUGIN_API terminate () = 0; virtual tresult PLUGIN_API terminate () = 0;


@@ -54,10 +54,9 @@ DECLARE_CLASS_IID (IPluginBase, 0x22888DDB, 0x156E45AE, 0x8358B348, 0x08190625)




//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Basic Information about the class factory of the Plug-in.
/** Basic Information about the class factory of the plug-in.
\ingroup pluginBase \ingroup pluginBase
*/ */
//------------------------------------------------------------------------
struct PFactoryInfo struct PFactoryInfo
{ {
//------------------------------------------------------------------------ //------------------------------------------------------------------------
@@ -66,8 +65,8 @@ struct PFactoryInfo
kNoFlags = 0, ///< Nothing kNoFlags = 0, ///< Nothing
kClassesDiscardable = 1 << 0, ///< The number of exported classes can change each time the Module is loaded. If this flag is set, the host does not cache class information. This leads to a longer startup time because the host always has to load the Module to get the current class information. kClassesDiscardable = 1 << 0, ///< The number of exported classes can change each time the Module is loaded. If this flag is set, the host does not cache class information. This leads to a longer startup time because the host always has to load the Module to get the current class information.
kLicenseCheck = 1 << 1, ///< Class IDs of components are interpreted as Syncrosoft-License (LICENCE_UID). Loaded in a Steinberg host, the module will not be loaded when the license is not valid kLicenseCheck = 1 << 1, ///< Class IDs of components are interpreted as Syncrosoft-License (LICENCE_UID). Loaded in a Steinberg host, the module will not be loaded when the license is not valid
kComponentNonDiscardable = 1 << 3, ///< Component won't be unloaded until process exit
kUnicode = 1 << 4 ///< Components have entirely unicode encoded strings. (True for VST 3 Plug-ins so far)
kComponentNonDiscardable = 1 << 3, ///< Component will not be unloaded until process exit
kUnicode = 1 << 4 ///< Components have entirely unicode encoded strings. (True for VST 3 plug-ins so far)
}; };


enum enum
@@ -101,10 +100,9 @@ struct PFactoryInfo
}; };


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Basic Information about a class provided by the Plug-in.
/** Basic Information about a class provided by the plug-in.
\ingroup pluginBase \ingroup pluginBase
*/ */
//------------------------------------------------------------------------
struct PClassInfo struct PClassInfo
{ {
//------------------------------------------------------------------------ //------------------------------------------------------------------------
@@ -142,28 +140,26 @@ struct PClassInfo
#endif #endif
}; };



//------------------------------------------------------------------------ //------------------------------------------------------------------------
// IPluginFactory interface declaration // IPluginFactory interface declaration
//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Class factory that any Plug-in defines for creating class instances.
/** Class factory that any plug-in defines for creating class instances: IPluginFactory
\ingroup pluginBase \ingroup pluginBase
- [plug imp] - [plug imp]


From the host's point of view a Plug-in module is a factory which can create
From the host's point of view a plug-in module is a factory which can create
a certain kind of object(s). The interface IPluginFactory provides methods a certain kind of object(s). The interface IPluginFactory provides methods
to get information about the classes exported by the Plug-in and a
to get information about the classes exported by the plug-in and a
mechanism to create instances of these classes (that usually define the IPluginBase interface). mechanism to create instances of these classes (that usually define the IPluginBase interface).


<b> An implementation is provided in public.sdk/source/common/pluginfactory.cpp </b> <b> An implementation is provided in public.sdk/source/common/pluginfactory.cpp </b>
\see GetPluginFactory \see GetPluginFactory
*/ */
//------------------------------------------------------------------------
class IPluginFactory : public FUnknown class IPluginFactory : public FUnknown
{ {
public: public:
//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Fill a PFactoryInfo structure with information about the Plug-in vendor. */
/** Fill a PFactoryInfo structure with information about the plug-in vendor. */
virtual tresult PLUGIN_API getFactoryInfo (PFactoryInfo* info) = 0; virtual tresult PLUGIN_API getFactoryInfo (PFactoryInfo* info) = 0;


/** Returns the number of exported classes by this factory. /** Returns the number of exported classes by this factory.
@@ -184,15 +180,14 @@ DECLARE_CLASS_IID (IPluginFactory, 0x7A4D811C, 0x52114A1F, 0xAED9D2EE, 0x0B43BF9




//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Version 2 of Basic Information about a class provided by the Plug-in.
/** Version 2 of Basic Information about a class provided by the plug-in.
\ingroup pluginBase \ingroup pluginBase
*/ */
//------------------------------------------------------------------------
struct PClassInfo2 struct PClassInfo2
{ {
//------------------------------------------------------------------------ //------------------------------------------------------------------------
TUID cid; ///< Class ID 16 Byte class GUID TUID cid; ///< Class ID 16 Byte class GUID
int32 cardinality; ///< cardinality of the class, set to kManyInstances (see \ref ClassCardinality)
int32 cardinality; ///< cardinality of the class, set to kManyInstances (see \ref PClassInfo::ClassCardinality)
char8 category[PClassInfo::kCategorySize]; ///< class category, host uses this to categorize interfaces char8 category[PClassInfo::kCategorySize]; ///< class category, host uses this to categorize interfaces
char8 name[PClassInfo::kNameSize]; ///< class name, visible to the user char8 name[PClassInfo::kNameSize]; ///< class name, visible to the user


@@ -252,11 +247,10 @@ struct PClassInfo2
//------------------------------------------------------------------------ //------------------------------------------------------------------------
// IPluginFactory2 interface declaration // IPluginFactory2 interface declaration
//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Version 2 of class factory supporting PClassInfo2.
/** Version 2 of class factory supporting PClassInfo2: IPluginFactory2
\ingroup pluginBase \ingroup pluginBase
\copydoc IPluginFactory \copydoc IPluginFactory
*/ */
//------------------------------------------------------------------------
class IPluginFactory2 : public IPluginFactory class IPluginFactory2 : public IPluginFactory
{ {
public: public:
@@ -271,8 +265,8 @@ DECLARE_CLASS_IID (IPluginFactory2, 0x0007B650, 0xF24B4C0B, 0xA464EDB9, 0xF00B2A




//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Unicode Version of Basic Information about a class provided by the Plug-in */
//------------------------------------------------------------------------
/** Unicode Version of Basic Information about a class provided by the plug-in
*/
struct PClassInfoW struct PClassInfoW
{ {
//------------------------------------------------------------------------ //------------------------------------------------------------------------
@@ -347,15 +341,13 @@ struct PClassInfoW
} }
}; };



//------------------------------------------------------------------------ //------------------------------------------------------------------------
// IPluginFactory3 interface declaration // IPluginFactory3 interface declaration
//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Version 3 of class factory supporting PClassInfoW.
/** Version 3 of class factory supporting PClassInfoW: IPluginFactory3
\ingroup pluginBase \ingroup pluginBase
\copydoc IPluginFactory \copydoc IPluginFactory
*/ */
//------------------------------------------------------------------------
class IPluginFactory3 : public IPluginFactory2 class IPluginFactory3 : public IPluginFactory2
{ {
public: public:
@@ -373,7 +365,6 @@ DECLARE_CLASS_IID (IPluginFactory3, 0x4555A2AB, 0xC1234E57, 0x9B122910, 0x368789
//------------------------------------------------------------------------ //------------------------------------------------------------------------
} // namespace Steinberg } // namespace Steinberg



//------------------------------------------------------------------------ //------------------------------------------------------------------------
#define LICENCE_UID(l1, l2, l3, l4) \ #define LICENCE_UID(l1, l2, l3, l4) \
{ \ { \
@@ -387,50 +378,48 @@ DECLARE_CLASS_IID (IPluginFactory3, 0x4555A2AB, 0xC1234E57, 0x9B122910, 0x368789
(int8)((l4 & 0x0000FF00) >> 8), (int8)((l4 & 0x000000FF) ) \ (int8)((l4 & 0x0000FF00) >> 8), (int8)((l4 & 0x000000FF) ) \
} }



//------------------------------------------------------------------------ //------------------------------------------------------------------------
// GetPluginFactory // GetPluginFactory
//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Plug-in entry point. /** Plug-in entry point.
\ingroup pluginBase \ingroup pluginBase
Any Plug-in must define and export this function. \n
Any plug-in must define and export this function. \n
A typical implementation of GetPluginFactory looks like this A typical implementation of GetPluginFactory looks like this
\code
IPluginFactory* PLUGIN_API GetPluginFactory ()
\code{.cpp}
SMTG_EXPORT_SYMBOL IPluginFactory* PLUGIN_API GetPluginFactory ()
{
if (!gPluginFactory)
{ {
if (!gPluginFactory)
static PFactoryInfo factoryInfo =
{ {
static PFactoryInfo factoryInfo =
{
"My Company Name",
"http://www.mywebpage.com",
"mailto:myemail@address.com",
PFactoryInfo::kNoFlags
};

gPluginFactory = new CPluginFactory (factoryInfo);

static PClassInfo componentClass =
{
INLINE_UID (0x00000000, 0x00000000, 0x00000000, 0x00000000), // replace by a valid uid
1,
"Service", // category
"Name"
};

gPluginFactory->registerClass (&componentClass, MyComponentClass::newInstance);
}
else
gPluginFactory->addRef ();

return gPluginFactory;
"My Company Name",
"http://www.mywebpage.com",
"mailto:myemail@address.com",
PFactoryInfo::kNoFlags
};

gPluginFactory = new CPluginFactory (factoryInfo);

static PClassInfo componentClass =
{
INLINE_UID (0x00000000, 0x00000000, 0x00000000, 0x00000000), // replace by a valid uid
1,
"Service", // category
"Name"
};

gPluginFactory->registerClass (&componentClass, MyComponentClass::newInstance);
} }
\endcode
else
gPluginFactory->addRef ();

return gPluginFactory;
}
\endcode
\see \ref loadPlugin \see \ref loadPlugin
*/ */
//------------------------------------------------------------------------
extern "C" extern "C"
{ {
Steinberg::IPluginFactory* PLUGIN_API GetPluginFactory ();
SMTG_EXPORT_SYMBOL Steinberg::IPluginFactory* PLUGIN_API GetPluginFactory ();
typedef Steinberg::IPluginFactory* (PLUGIN_API *GetFactoryProc) (); typedef Steinberg::IPluginFactory* (PLUGIN_API *GetFactoryProc) ();
} }

+ 6
- 6
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/istringresult.h View File

@@ -25,9 +25,9 @@ namespace Steinberg {
In order to manage memory allocation and deallocation properly, In order to manage memory allocation and deallocation properly,
this interface is used to transfer a string as result parameter of this interface is used to transfer a string as result parameter of
a method requires a string of unknown size. a method requires a string of unknown size.
[host imp] or [plug imp] \n
[released: SX 4] */
//------------------------------------------------------------------------
- [host imp] or [plug imp]
- [released: SX 4]
*/
class IStringResult : public FUnknown class IStringResult : public FUnknown
{ {
public: public:
@@ -43,9 +43,9 @@ DECLARE_CLASS_IID (IStringResult, 0x550798BC, 0x872049DB, 0x84920A15, 0x3B50B7A8


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Interface to a string of variable size and encoding. /** Interface to a string of variable size and encoding.
[host imp] or [plug imp] \n
[released: ] */
//------------------------------------------------------------------------
- [host imp] or [plug imp]
- [released: ]
*/
class IString : public FUnknown class IString : public FUnknown
{ {
public: public:


+ 3
- 5
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/iupdatehandler.h View File

@@ -24,9 +24,9 @@ class IDependent;


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Host implements dependency handling for plugins. /** Host implements dependency handling for plugins.
[host imp] \n
[get this interface from IHostClasses] \n
[released N3.1] \n
- [host imp]
- [get this interface from IHostClasses]
- [released N3.1]


- Install/Remove change notifications - Install/Remove change notifications
- Trigger updates when an object has changed - Trigger updates when an object has changed
@@ -37,7 +37,6 @@ inside the Plug-In to handle internal updates!
\see IDependent \see IDependent
\ingroup frameworkHostClasses \ingroup frameworkHostClasses
*/ */
//------------------------------------------------------------------------
class IUpdateHandler: public FUnknown class IUpdateHandler: public FUnknown
{ {
public: public:
@@ -73,7 +72,6 @@ DECLARE_CLASS_IID (IUpdateHandler, 0xF5246D56, 0x86544d60, 0xB026AFB5, 0x7B697B3
\see IUpdateHandler \see IUpdateHandler
\ingroup frameworkHostClasses \ingroup frameworkHostClasses
*/ */
//------------------------------------------------------------------------
class IDependent: public FUnknown class IDependent: public FUnknown
{ {
public: public:


+ 5
- 7
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/smartpointer.h View File

@@ -34,12 +34,11 @@ namespace Steinberg {
- handles refCount of the interface - handles refCount of the interface
- Usage example: - Usage example:
\code \code
IPtr<IPath> path (sharedPath);
if (path)
path->ascend ();
IPtr<IPath> path (sharedPath);
if (path)
path->ascend ();
\endcode \endcode
*/ */
//------------------------------------------------------------------------
template <class I> template <class I>
class IPtr class IPtr
{ {
@@ -80,7 +79,7 @@ public:
template <typename T> template <typename T>
inline IPtr (IPtr<T>&& movePtr) SMTG_NOEXCEPT : ptr (movePtr.take ()) { } inline IPtr (IPtr<T>&& movePtr) SMTG_NOEXCEPT : ptr (movePtr.take ()) { }


inline IPtr& operator= (IPtr<I>&& movePtr)
inline IPtr& operator= (IPtr<I>&& movePtr) SMTG_NOEXCEPT
{ {
if (ptr) if (ptr)
ptr->release (); ptr->release ();
@@ -98,6 +97,7 @@ public:
ptr = movePtr.take (); ptr = movePtr.take ();
return *this; return *this;
} }
#endif


inline void reset (I* obj = nullptr) inline void reset (I* obj = nullptr)
{ {
@@ -116,7 +116,6 @@ public:
template <typename T> template <typename T>
static IPtr<T> adopt (T* obj) SMTG_NOEXCEPT { return IPtr<T> (obj, false); } static IPtr<T> adopt (T* obj) SMTG_NOEXCEPT { return IPtr<T> (obj, false); }


#endif
//------------------------------------------------------------------------ //------------------------------------------------------------------------
protected: protected:
I* ptr; I* ptr;
@@ -206,7 +205,6 @@ inline IPtr<I>& IPtr<I>::operator= (const IPtr<I>& _ptr)
\endcode \endcode
This will lead to a leak! This will lead to a leak!
*/ */
//------------------------------------------------------------------------
template <class I> template <class I>
class OPtr : public IPtr<I> class OPtr : public IPtr<I>
{ {


+ 26
- 14
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/typesizecheck.h View File

@@ -19,25 +19,37 @@
#include "pluginterfaces/base/fplatform.h" #include "pluginterfaces/base/fplatform.h"


#if SMTG_CPP11 #if SMTG_CPP11
#define SMTG_TYPE_STATIC_CHECK(Operator, Type, Platform64Size, MacOS32Size, Win32Size, \
Linux32Size) \
namespace { \
template <typename Type, size_t w, size_t x, size_t y, size_t z> \
struct Operator##Check##Type \
{ \
constexpr Operator##Check##Type () \
{ \
static_assert (Operator (Type) == \
(SMTG_PLATFORM_64 ? w : SMTG_OS_MACOS ? x : SMTG_OS_LINUX ? z : y), \
"Struct " #Operator " error: " #Type); \
} \
}; \
static constexpr Operator##Check##Type<Type, Platform64Size, MacOS32Size, Win32Size, \
Linux32Size> \
instance##Operator##Type; \
}

/** Check the size of a structure depending on compilation platform /** Check the size of a structure depending on compilation platform
* Used to check that structure sizes don't change between SDK releases. * Used to check that structure sizes don't change between SDK releases.
*/ */
#define SMTG_TYPE_SIZE_CHECK(Type, Platform64Size, MacOS32Size, Win32Size, Linux32Size) \
namespace { \
template <typename Type, size_t w, size_t x, size_t y, size_t z> \
struct SizeCheck##Type \
{ \
constexpr SizeCheck##Type () \
{ \
static_assert (sizeof (Type) == (SMTG_PLATFORM_64 ? w : SMTG_OS_MACOS ? x : SMTG_OS_LINUX ? z : y), \
"Struct Size Error: " #Type); \
} \
}; \
static constexpr SizeCheck##Type<Type, Platform64Size, MacOS32Size, Win32Size, Linux32Size> instance##Type; \
}
#define SMTG_TYPE_SIZE_CHECK(Type, Platform64Size, MacOS32Size, Win32Size, Linux32Size) \
SMTG_TYPE_STATIC_CHECK (sizeof, Type, Platform64Size, MacOS32Size, Win32Size, Linux32Size)

/** Check the alignment of a structure depending on compilation platform
* Used to check that structure alignments don't change between SDK releases.
*/
#define SMTG_TYPE_ALIGN_CHECK(Type, Platform64Size, MacOS32Size, Win32Size, Linux32Size) \
SMTG_TYPE_STATIC_CHECK (alignof, Type, Platform64Size, MacOS32Size, Win32Size, Linux32Size)


#else #else
// need static_assert // need static_assert
#define SMTG_TYPE_SIZE_CHECK(Type, Platform64Size, MacOS32Size, Win32Size, Linux32Size) #define SMTG_TYPE_SIZE_CHECK(Type, Platform64Size, MacOS32Size, Win32Size, Linux32Size)
#endif #endif


+ 6
- 3
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/ustring.cpp View File

@@ -17,8 +17,11 @@
#include "ustring.h" #include "ustring.h"


#if SMTG_OS_WINDOWS #if SMTG_OS_WINDOWS
#include <stdio.h>
#pragma warning (disable : 4996)
#include <cstdio>

#ifdef _MSC_VER
#pragma warning (disable : 4996) // deprecated functions
#endif


#elif SMTG_OS_MACOS #elif SMTG_OS_MACOS
#include <CoreFoundation/CoreFoundation.h> #include <CoreFoundation/CoreFoundation.h>
@@ -78,7 +81,7 @@ void StringCopy (TDstChar* dst, int32 dstSize, const TSrcChar* src, int32 srcSiz
} }


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Find length of null-terminated string. */
/** Find length of null-terminated string, i.e. StringLength (L"ABC\0") => 3 */
//------------------------------------------------------------------------ //------------------------------------------------------------------------
template <class TSrcChar> template <class TSrcChar>
int32 StringLength (const TSrcChar* src, int32 srcSize = -1) int32 StringLength (const TSrcChar* src, int32 srcSize = -1)


+ 37
- 31
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/base/ustring.h View File

@@ -22,33 +22,35 @@
namespace Steinberg { namespace Steinberg {


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** UTF-16 string class without buffer management. */
//------------------------------------------------------------------------
/** UTF-16 string class without buffer management.
Note: that some characters are encoded in 2 UTF16 code units (surrogate pair),
this means that getLength returns the number of code unit, not the count of character! */
class UString class UString
{ {
public: public:
//------------------------------------------------------------------------ //------------------------------------------------------------------------
UString (char16* buffer, int32 size)
: thisBuffer (buffer),
thisSize (size)
{}
/** Construct from UTF-16 string, size is in code unit (count of char16) */
UString (char16* buffer, int32 size) : thisBuffer (buffer), thisSize (size) {}


int32 getSize () const { return thisSize; } ///< returns buffer size
operator const char16* () const { return thisBuffer; } ///< cast to char16*
/** returns buffer size */
int32 getSize () const { return thisSize; }
/** cast to char16* */
operator const char16* () const { return thisBuffer; }


/** Returns length of string (in code units). */
/** Returns length of string (in code unit). Note this is not the count of character! */
int32 getLength () const; int32 getLength () const;


/** Copy from UTF-16 buffer. */
/** Copy from UTF-16 buffer (srcSize is in code unit (count of char16)). */
UString& assign (const char16* src, int32 srcSize = -1); UString& assign (const char16* src, int32 srcSize = -1);


/** Append UTF-16 buffer. */
/** Append UTF-16 buffer (srcSize is in code unit (count of char16)). */
UString& append (const char16* src, int32 srcSize = -1); UString& append (const char16* src, int32 srcSize = -1);


/** Copy to UTF-16 buffer. */
/** Copy to UTF-16 buffer (dstSize is in code unit (count of char16)). */
const UString& copyTo (char16* dst, int32 dstSize) const; const UString& copyTo (char16* dst, int32 dstSize) const;


/** Copy from ASCII string. */
/** Copy from ASCII string (srcSize is in code unit (count of char16)). */
UString& fromAscii (const char* src, int32 srcSize = -1); UString& fromAscii (const char* src, int32 srcSize = -1);
UString& assign (const char* src, int32 srcSize = -1) { return fromAscii (src, srcSize); } UString& assign (const char* src, int32 srcSize = -1) { return fromAscii (src, srcSize); }


@@ -69,42 +71,46 @@ public:
//------------------------------------------------------------------------ //------------------------------------------------------------------------
protected: protected:
char16* thisBuffer; char16* thisBuffer;
int32 thisSize;
int32 thisSize; ///< size in code unit (not in byte!)
}; };


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** UTF-16 string with fixed buffer size. */
//------------------------------------------------------------------------
template<int32 maxSize>
class UStringBuffer: public UString
/** UTF-16 string with fixed buffer size.
*/
template <int32 maxSize>
class UStringBuffer : public UString
{ {
public: public:
//------------------------------------------------------------------------ //------------------------------------------------------------------------
UStringBuffer ()
: UString (data, maxSize)
{ data[0] = 0; }
UStringBuffer () : UString (data, maxSize) { data[0] = 0; }


/** Construct from UTF-16 string. */ /** Construct from UTF-16 string. */
UStringBuffer (const char16* src, int32 srcSize = -1)
: UString (data, maxSize)
{ data[0] = 0; if (src) assign (src, srcSize); }
UStringBuffer (const char16* src, int32 srcSize = -1) : UString (data, maxSize)
{
data[0] = 0;
if (src)
assign (src, srcSize);
}


/** Construct from ASCII string. */ /** Construct from ASCII string. */
UStringBuffer (const char* src, int32 srcSize = -1)
: UString (data, maxSize)
{ data[0] = 0; if (src) fromAscii (src, srcSize); }
UStringBuffer (const char* src, int32 srcSize = -1) : UString (data, maxSize)
{
data[0] = 0;
if (src)
fromAscii (src, srcSize);
}
//------------------------------------------------------------------------ //------------------------------------------------------------------------
protected: protected:
char16 data[maxSize]; char16 data[maxSize];
}; };


//------------------------------------------------------------------------ //------------------------------------------------------------------------
typedef UStringBuffer<128> UString128; ///< 128 character UTF-16 string
typedef UStringBuffer<256> UString256; ///< 256 character UTF-16 string
typedef UStringBuffer<128> UString128; ///< 128 character UTF-16 string
typedef UStringBuffer<256> UString256; ///< 256 character UTF-16 string
} // namespace Steinberg } // namespace Steinberg


//------------------------------------------------------------------------ //------------------------------------------------------------------------
#define USTRING(asciiString) Steinberg::UString256 (asciiString)
#define USTRINGSIZE(var) (sizeof (var) / sizeof (Steinberg::char16))
#define USTRING(asciiString) Steinberg::UString256 (asciiString)
#define USTRINGSIZE(var) (sizeof (var) / sizeof (Steinberg::char16))


//------------------------------------------------------------------------ //------------------------------------------------------------------------

+ 22
- 25
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/gui/iplugview.h View File

@@ -31,7 +31,6 @@ class IPlugFrame;
/** Graphical rectangle structure. Used with IPlugView. /** Graphical rectangle structure. Used with IPlugView.
\ingroup pluginGUI \ingroup pluginGUI
*/ */
//------------------------------------------------------------------------
struct ViewRect struct ViewRect
{ {
ViewRect (int32 l = 0, int32 t = 0, int32 r = 0, int32 b = 0) ViewRect (int32 l = 0, int32 t = 0, int32 r = 0, int32 b = 0)
@@ -55,7 +54,7 @@ SMTG_TYPE_SIZE_CHECK (ViewRect, 16, 16, 16, 16)
/** \defgroup platformUIType Platform UI Types /** \defgroup platformUIType Platform UI Types
\ingroup pluginGUI \ingroup pluginGUI
List of Platform UI types for IPlugView. This list is used to match the GUI-System between List of Platform UI types for IPlugView. This list is used to match the GUI-System between
the host and a Plug-in in case that an OS provides multiple GUI-APIs.
the host and a plug-in in case that an OS provides multiple GUI-APIs.
*/ */
/*@{*/ /*@{*/
/** The parent parameter in IPlugView::attached() is a HWND handle. /** The parent parameter in IPlugView::attached() is a HWND handle.
@@ -89,38 +88,37 @@ const FIDString kPlatformTypeX11EmbedWindowID = "X11EmbedWindowID"; ///< X11 Win
- [released: 3.0.0] - [released: 3.0.0]


\par Sizing of a view \par Sizing of a view
Usually the size of a Plug-in view is fixed. But both the host and the Plug-in can cause
Usually, the size of a plug-in view is fixed. But both the host and the plug-in can cause
a view to be resized: a view to be resized:
\n \n
- <b> Host </b> : If IPlugView::canResize () returns kResultTrue the host will setup the window
so that the user can resize it. While the user resizes the window
IPlugView::checkSizeConstraint () is called, allowing the Plug-in to change the size to a valid
rect. The host then resizes the window to this rect and has to call IPlugView::onSize ().
- \b Host: If IPlugView::canResize () returns kResultTrue the host will set up the window
so that the user can resize it. While the user resizes the window,
IPlugView::checkSizeConstraint () is called, allowing the plug-in to change the size to a valid
a valid supported rectangle size. The host then resizes the window to this rect and has to call IPlugView::onSize ().
\n \n
\n \n
- <b> Plug-in </b> : The Plug-in can call IPlugFrame::resizeView () and cause the host to resize the
window.
Afterwards in the same callstack the host has to call IPlugView::onSize () if a resize is needed (size was changed).
- \b Plug-in: The plug-in can call IPlugFrame::resizeView () and cause the host to resize the
window.\n\n
Afterwards, in the same callstack, the host has to call IPlugView::onSize () if a resize is needed (size was changed).
Note that if the host calls IPlugView::getSize () before calling IPlugView::onSize () (if needed), Note that if the host calls IPlugView::getSize () before calling IPlugView::onSize () (if needed),
it will get the current (old) size not the wanted one!!
Here the calling sequence:
* plug-in->host: IPlugFrame::resizeView (newSize)
* host->plug-in (optional): IPlugView::getSize () returns the currentSize (not the newSize)!
* host->plug-in: if newSize is different from the current size: IPlugView::onSize (newSize)
* host->plug-in (optional): IPlugView::getSize () returns the newSize
it will get the current (old) size not the wanted one!!\n
Here the calling sequence:\n
- plug-in->host: IPlugFrame::resizeView (newSize)
- host->plug-in (optional): IPlugView::getSize () returns the currentSize (not the newSize!)
- host->plug-in: if newSize is different from the current size: IPlugView::onSize (newSize)
- host->plug-in (optional): IPlugView::getSize () returns the newSize
\n \n
<b>Please only resize the platform representation of the view when IPlugView::onSize () is <b>Please only resize the platform representation of the view when IPlugView::onSize () is
called.</b> called.</b>


\par Keyboard handling \par Keyboard handling
The Plug-in view receives keyboard events from the host. A view implementation must not handle
The plug-in view receives keyboard events from the host. A view implementation must not handle
keyboard events by the means of platform callbacks, but let the host pass them to the view. The host keyboard events by the means of platform callbacks, but let the host pass them to the view. The host
depends on a proper return value when IPlugView::onKeyDown is called, otherwise the Plug-in view may
cause a malfunction of the host's key command handling!
depends on a proper return value when IPlugView::onKeyDown is called, otherwise the plug-in view may
cause a malfunction of the host's key command handling.


\see IPlugFrame, \ref platformUIType \see IPlugFrame, \ref platformUIType
*/ */
//------------------------------------------------------------------------
class IPlugView : public FUnknown class IPlugView : public FUnknown
{ {
public: public:
@@ -133,7 +131,7 @@ public:
should now be created as well. should now be created as well.
Note that the parent is owned by the caller and you are not allowed to alter it in any way Note that the parent is owned by the caller and you are not allowed to alter it in any way
other than adding your own views. other than adding your own views.
Note that in this call the Plug-in could call a IPlugFrame::resizeView ()!
Note that in this call the plug-in could call a IPlugFrame::resizeView ()!
\param parent : platform handle of the parent window or view \param parent : platform handle of the parent window or view
\param type : \ref platformUIType which should be created */ \param type : \ref platformUIType which should be created */
virtual tresult PLUGIN_API attached (void* parent, FIDString type) = 0; virtual tresult PLUGIN_API attached (void* parent, FIDString type) = 0;
@@ -164,14 +162,14 @@ public:
/** Returns the size of the platform representation of the view. */ /** Returns the size of the platform representation of the view. */
virtual tresult PLUGIN_API getSize (ViewRect* size) = 0; virtual tresult PLUGIN_API getSize (ViewRect* size) = 0;


/** Resizes the platform representation of the view to the given rect. Note that if the Plug-in
/** Resizes the platform representation of the view to the given rect. Note that if the plug-in
* requests a resize (IPlugFrame::resizeView ()) onSize has to be called afterward. */ * requests a resize (IPlugFrame::resizeView ()) onSize has to be called afterward. */
virtual tresult PLUGIN_API onSize (ViewRect* newSize) = 0; virtual tresult PLUGIN_API onSize (ViewRect* newSize) = 0;


/** Focus changed message. */ /** Focus changed message. */
virtual tresult PLUGIN_API onFocus (TBool state) = 0; virtual tresult PLUGIN_API onFocus (TBool state) = 0;


/** Sets IPlugFrame object to allow the Plug-in to inform the host about resizing. */
/** Sets IPlugFrame object to allow the plug-in to inform the host about resizing. */
virtual tresult PLUGIN_API setFrame (IPlugFrame* frame) = 0; virtual tresult PLUGIN_API setFrame (IPlugFrame* frame) = 0;


/** Is view sizable by user. */ /** Is view sizable by user. */
@@ -193,9 +191,8 @@ DECLARE_CLASS_IID (IPlugView, 0x5BC32507, 0xD06049EA, 0xA6151B52, 0x2B755B29)
- [released: 3.0.0] - [released: 3.0.0]
- [mandatory] - [mandatory]


Enables a Plug-in to resize the view and cause the host to resize the window.
Enables a plug-in to resize the view and cause the host to resize the window.
*/ */
//------------------------------------------------------------------------
class IPlugFrame : public FUnknown class IPlugFrame : public FUnknown
{ {
public: public:


+ 3
- 2
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/gui/iplugviewcontentscalesupport.h View File

@@ -30,12 +30,13 @@ namespace Steinberg {
\ingroup pluginGUI vstIPlug vst366 \ingroup pluginGUI vstIPlug vst366
- [plug impl] - [plug impl]
- [extends IPlugView] - [extends IPlugView]
- [released: 3.6.6]
- [optional] - [optional]


This interface communicates the content scale factor from the host to the plug-in view on This interface communicates the content scale factor from the host to the plug-in view on
systems where plug-ins cannot get this information directly like Microsoft Windows. systems where plug-ins cannot get this information directly like Microsoft Windows.


The host calls setContentScaleFactor directly after the plug view was attached and when the scale
The host calls setContentScaleFactor directly after the plug-in view is attached and when the scale
factor changes (system change or window moved to another screen with different scaling settings). factor changes (system change or window moved to another screen with different scaling settings).
The host could call setContentScaleFactor in a different context, for example: scaling the The host could call setContentScaleFactor in a different context, for example: scaling the
plug-in editor for better readability. plug-in editor for better readability.
@@ -43,7 +44,7 @@ When a plug-in handles this (by returning kResultTrue), it needs to scale the wi
its view by the scale factor and inform the host via a IPlugFrame::resizeView(), the host will then its view by the scale factor and inform the host via a IPlugFrame::resizeView(), the host will then
call IPlugView::onSize(). call IPlugView::onSize().


Note that the host is allowed to call setContentScaleFactor() at any time the IPlugView is alive.
Note that the host is allowed to call setContentScaleFactor() at any time the IPlugView is valid.
*/ */
class IPlugViewContentScaleSupport : public FUnknown class IPlugViewContentScaleSupport : public FUnknown
{ {


+ 22
- 19
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivstattributes.h View File

@@ -26,16 +26,18 @@
//------------------------------------------------------------------------ //------------------------------------------------------------------------
namespace Steinberg { namespace Steinberg {
namespace Vst { namespace Vst {

//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Attribute list used in IMessage and IStreamAttributes.
/** Attribute list used in IMessage and IStreamAttributes: Vst::IAttributeList
\ingroup vstIHost vst300 \ingroup vstIHost vst300
- [host imp] - [host imp]
- [released: 3.0.0] - [released: 3.0.0]
- [mandatory] - [mandatory]


An attribute list associates values with a key (id: some predefined keys could be found in \ref presetAttributes). */
//------------------------------------------------------------------------
class IAttributeList: public FUnknown
An attribute list associates values with a key (id: some predefined keys can be found in \ref
presetAttributes).
*/
class IAttributeList : public FUnknown
{ {
public: public:
//------------------------------------------------------------------------ //------------------------------------------------------------------------
@@ -53,17 +55,18 @@ public:
/** Gets float value. */ /** Gets float value. */
virtual tresult PLUGIN_API getFloat (AttrID id, double& value) = 0; virtual tresult PLUGIN_API getFloat (AttrID id, double& value) = 0;


/** Sets string value (UTF16). */
/** Sets string value (UTF16) (should be null-terminated!). */
virtual tresult PLUGIN_API setString (AttrID id, const TChar* string) = 0; virtual tresult PLUGIN_API setString (AttrID id, const TChar* string) = 0;


/** Gets string value (UTF16). Note that Size is in Byte, not the string Length! (Do not forget to multiply the length by sizeof (TChar)!) */
virtual tresult PLUGIN_API getString (AttrID id, TChar* string, uint32 size) = 0;
/** Gets string value (UTF16). Note that Size is in Byte, not the string Length!
Do not forget to multiply the length by sizeof (TChar)! */
virtual tresult PLUGIN_API getString (AttrID id, TChar* string, uint32 sizeInBytes) = 0;


/** Sets binary data. */ /** Sets binary data. */
virtual tresult PLUGIN_API setBinary (AttrID id, const void* data, uint32 size) = 0;
virtual tresult PLUGIN_API setBinary (AttrID id, const void* data, uint32 sizeInBytes) = 0;


/** Gets binary data. */ /** Gets binary data. */
virtual tresult PLUGIN_API getBinary (AttrID id, const void*& data, uint32& size) = 0;
virtual tresult PLUGIN_API getBinary (AttrID id, const void*& data, uint32& sizeInBytes) = 0;
//------------------------------------------------------------------------ //------------------------------------------------------------------------
static const FUID iid; static const FUID iid;
}; };
@@ -71,15 +74,19 @@ public:
DECLARE_CLASS_IID (IAttributeList, 0x1E5F0AEB, 0xCC7F4533, 0xA2544011, 0x38AD5EE4) DECLARE_CLASS_IID (IAttributeList, 0x1E5F0AEB, 0xCC7F4533, 0xA2544011, 0x38AD5EE4)


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Meta attributes of a stream.
\ingroup vstIHost vst360
/** Meta attributes of a stream: Vst::IStreamAttributes
\ingroup vstIHost vst360
- [host imp] - [host imp]
- [extends IBStream] - [extends IBStream]
- [released: 3.6.0] - [released: 3.6.0]
- [optional] - [optional]


\code
...
Interface to access preset meta information from stream, used, for example, in setState in order to inform the plug-in about
the current context in which the preset loading occurs (Project context or Preset load (see \ref StateType))
or used to get the full file path of the loaded preset (if available).

\code{.cpp}
//------------------------------------------------------------------------
#include "pluginterfaces/base/ustring.h" #include "pluginterfaces/base/ustring.h"
#include "pluginterfaces/vst/vstpresetkeys.h" #include "pluginterfaces/vst/vstpresetkeys.h"
... ...
@@ -118,11 +125,8 @@ tresult PLUGIN_API MyPlugin::setState (IBStream* state)
return kResultTrue; return kResultTrue;
} }
\endcode \endcode
Interface to access preset meta information from stream, used for example in setState in order to inform the plug-in about
the current context in which this preset loading occurs (Project context or Preset load (see \ref StateType))
or used to get the full file path of the loaded preset (if available). */
//------------------------------------------------------------------------
class IStreamAttributes: public FUnknown
*/
class IStreamAttributes : public FUnknown
{ {
public: public:
//------------------------------------------------------------------------ //------------------------------------------------------------------------
@@ -137,7 +141,6 @@ public:


DECLARE_CLASS_IID (IStreamAttributes, 0xD6CE2FFC, 0xEFAF4B8C, 0x9E74F1BB, 0x12DA44B4) DECLARE_CLASS_IID (IStreamAttributes, 0xD6CE2FFC, 0xEFAF4B8C, 0x9E74F1BB, 0x12DA44B4)



//------------------------------------------------------------------------ //------------------------------------------------------------------------
} // namespace Vst } // namespace Vst
} // namespace Steinberg } // namespace Steinberg


+ 155
- 81
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivstaudioprocessor.h View File

@@ -33,13 +33,13 @@
//------------------------------------------------------------------------ //------------------------------------------------------------------------
namespace Steinberg { namespace Steinberg {
namespace Vst { namespace Vst {

class IEventList; class IEventList;
class IParameterChanges; class IParameterChanges;
struct ProcessContext; struct ProcessContext;


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Component Types used as subCategories in PClassInfo2 */ /** Component Types used as subCategories in PClassInfo2 */
//------------------------------------------------------------------------
namespace PlugType namespace PlugType
{ {
/** /**
@@ -77,15 +77,17 @@ const CString kInstrumentSynthSampler = "Instrument|Synth|Sampler"; ///< Instrum
const CString kSpatial = "Spatial"; ///< used for SurroundPanner const CString kSpatial = "Spatial"; ///< used for SurroundPanner
const CString kSpatialFx = "Spatial|Fx"; ///< used for SurroundPanner and as insert effect const CString kSpatialFx = "Spatial|Fx"; ///< used for SurroundPanner and as insert effect
const CString kOnlyRealTime = "OnlyRT"; ///< indicates that it supports only realtime process call, no processing faster than realtime const CString kOnlyRealTime = "OnlyRT"; ///< indicates that it supports only realtime process call, no processing faster than realtime
const CString kOnlyOfflineProcess = "OnlyOfflineProcess"; ///< used for Plug-in offline processing (will not work as normal insert Plug-in)
const CString kNoOfflineProcess = "NoOfflineProcess"; ///< will be NOT used for Plug-in offline processing (will work as normal insert Plug-in)
const CString kOnlyOfflineProcess = "OnlyOfflineProcess"; ///< used for plug-in offline processing (will not work as normal insert plug-in)
const CString kOnlyARA = "OnlyARA"; ///< used for plug-ins that require ARA to operate (will not work as normal insert plug-in)

const CString kNoOfflineProcess = "NoOfflineProcess"; ///< will be NOT used for plug-in offline processing (will work as normal insert plug-in)
const CString kUpDownMix = "Up-Downmix"; ///< used for Mixconverter/Up-Mixer/Down-Mixer const CString kUpDownMix = "Up-Downmix"; ///< used for Mixconverter/Up-Mixer/Down-Mixer
const CString kAnalyzer = "Analyzer"; ///< Meter, Scope, FFT-Display, not selectable as insert plugin
const CString kAnalyzer = "Analyzer"; ///< Meter, Scope, FFT-Display, not selectable as insert plug-in
const CString kAmbisonics = "Ambisonics"; ///< used for Ambisonics channel (FX or Panner/Mixconverter/Up-Mixer/Down-Mixer when combined with other category) const CString kAmbisonics = "Ambisonics"; ///< used for Ambisonics channel (FX or Panner/Mixconverter/Up-Mixer/Down-Mixer when combined with other category)


const CString kMono = "Mono"; ///< used for Mono only Plug-in [optional]
const CString kStereo = "Stereo"; ///< used for Stereo only Plug-in [optional]
const CString kSurround = "Surround"; ///< used for Surround only Plug-in [optional]
const CString kMono = "Mono"; ///< used for Mono only plug-in [optional]
const CString kStereo = "Stereo"; ///< used for Stereo only plug-in [optional]
const CString kSurround = "Surround"; ///< used for Surround only plug-in [optional]


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/*@}*/ /*@}*/
@@ -93,7 +95,6 @@ const CString kSurround = "Surround"; ///< used for Surround only Plug-in [o


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Component Flags used as classFlags in PClassInfo2 */ /** Component Flags used as classFlags in PClassInfo2 */
//------------------------------------------------------------------------
enum ComponentFlags enum ComponentFlags
{ {
//------------------------------------------------------------------------ //------------------------------------------------------------------------
@@ -104,8 +105,8 @@ enum ComponentFlags


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Symbolic sample size. /** Symbolic sample size.
\see ProcessSetup, ProcessData */
//------------------------------------------------------------------------
\see ProcessSetup, ProcessData
*/
enum SymbolicSampleSizes enum SymbolicSampleSizes
{ {
kSample32, ///< 32-bit precision kSample32, ///< 32-bit precision
@@ -113,27 +114,27 @@ enum SymbolicSampleSizes
}; };


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Processing mode informs the Plug-in about the context and at which frequency the process call is called.
/** Processing mode informs the plug-in about the context and at which frequency the process call is called.
VST3 defines 3 modes: VST3 defines 3 modes:
- kRealtime: each process call is called at a realtime frequency (defined by [numSamples of ProcessData] / samplerate). - kRealtime: each process call is called at a realtime frequency (defined by [numSamples of ProcessData] / samplerate).
The Plug-in should always try to process as fast as possible in order to let enough time slice to other Plug-ins.
The plug-in should always try to process as fast as possible in order to let enough time slice to other plug-ins.
- kPrefetch: each process call could be called at a variable frequency (jitter, slower / faster than realtime), - kPrefetch: each process call could be called at a variable frequency (jitter, slower / faster than realtime),
the Plug-in should process at the same quality level than realtime, Plug-in must not slow down to realtime
the plug-in should process at the same quality level than realtime, plug-in must not slow down to realtime
(e.g. disk streaming)! (e.g. disk streaming)!
The host should avoid to process in kPrefetch mode such sampler based Plug-in.
The host should avoid to process in kPrefetch mode such sampler based plug-in.
- kOffline: each process call could be faster than realtime or slower, higher quality than realtime could be used. - kOffline: each process call could be faster than realtime or slower, higher quality than realtime could be used.
Plug-ins using disk streaming should be sure that they have enough time in the process call for streaming,
plug-ins using disk streaming should be sure that they have enough time in the process call for streaming,
if needed by slowing down to realtime or slower. if needed by slowing down to realtime or slower.
. .
Note about Process Modes switching: Note about Process Modes switching:
-Switching between kRealtime and kPrefetch process modes are done in realtime thread without need of calling
IAudioProcessor::setupProcessing, the Plug-in should check in process call the member processMode of ProcessData
- Switching between kRealtime and kPrefetch process modes are done in realtime thread without need of calling
IAudioProcessor::setupProcessing, the plug-in should check in process call the member processMode of ProcessData
in order to know in which mode it is processed. in order to know in which mode it is processed.
-Switching between kRealtime (or kPrefetch) and kOffline requires that the host calls IAudioProcessor::setupProcessing
in order to inform the Plug-in about this mode change.
.
\see ProcessSetup, ProcessData */
//------------------------------------------------------------------------
- Switching between kRealtime (or kPrefetch) and kOffline requires that the host calls IAudioProcessor::setupProcessing
in order to inform the plug-in about this mode change.
.
\see ProcessSetup, ProcessData
*/
enum ProcessModes enum ProcessModes
{ {
kRealtime, ///< realtime processing kRealtime, ///< realtime processing
@@ -145,21 +146,22 @@ enum ProcessModes
/** kNoTail /** kNoTail
* *
* to be returned by getTailSamples when no tail is wanted * to be returned by getTailSamples when no tail is wanted
\see IAudioProcessor::getTailSamples */
//------------------------------------------------------------------------
\see IAudioProcessor::getTailSamples
*/
static const uint32 kNoTail = 0; static const uint32 kNoTail = 0;

//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** kInfiniteTail /** kInfiniteTail
* *
* to be returned by getTailSamples when infinite tail is wanted * to be returned by getTailSamples when infinite tail is wanted
\see IAudioProcessor::getTailSamples */
//------------------------------------------------------------------------
\see IAudioProcessor::getTailSamples
*/
static const uint32 kInfiniteTail = kMaxInt32u; static const uint32 kInfiniteTail = kMaxInt32u;


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Audio processing setup. /** Audio processing setup.
\see IAudioProcessor::setupProcessing */
//------------------------------------------------------------------------
\see IAudioProcessor::setupProcessing
*/
struct ProcessSetup struct ProcessSetup
{ {
//------------------------------------------------------------------------ //------------------------------------------------------------------------
@@ -174,21 +176,21 @@ struct ProcessSetup
/** Processing buffers of an audio bus. /** Processing buffers of an audio bus.
This structure contains the processing buffer for each channel of an audio bus. This structure contains the processing buffer for each channel of an audio bus.
- The number of channels (numChannels) must always match the current bus arrangement. - The number of channels (numChannels) must always match the current bus arrangement.
It could be set to value '0' when the host wants to flush the parameters (when the Plug-in is not processed).
It could be set to value '0' when the host wants to flush the parameters (when the plug-in is not processed).
- The size of the channel buffer array must always match the number of channels. So the host - The size of the channel buffer array must always match the number of channels. So the host
must always supply an array for the channel buffers, regardless if the must always supply an array for the channel buffers, regardless if the
bus is active or not. However, if an audio bus is currently inactive, the actual sample bus is active or not. However, if an audio bus is currently inactive, the actual sample
buffer addresses are safe to be null. buffer addresses are safe to be null.
- The silence flag is set when every sample of the according buffer has the value '0'. It is - The silence flag is set when every sample of the according buffer has the value '0'. It is
intended to be used as help for optimizations allowing a Plug-in to reduce processing activities.
intended to be used as help for optimizations allowing a plug-in to reduce processing activities.
But even if this flag is set for a channel, the channel buffers must still point to valid memory! But even if this flag is set for a channel, the channel buffers must still point to valid memory!
This flag is optional. A host is free to support it or not. This flag is optional. A host is free to support it or not.
. .
\see ProcessData */
//------------------------------------------------------------------------
\see ProcessData
*/
struct AudioBusBuffers struct AudioBusBuffers
{ {
AudioBusBuffers () : numChannels (0), silenceFlags (0), channelBuffers64 (0) {}
AudioBusBuffers () : numChannels (0), silenceFlags (0), channelBuffers64 (nullptr) {}


//------------------------------------------------------------------------ //------------------------------------------------------------------------
int32 numChannels; ///< number of audio channels in bus int32 numChannels; ///< number of audio channels in bus
@@ -206,23 +208,34 @@ struct AudioBusBuffers
The host prepares AudioBusBuffers for each input/output bus, The host prepares AudioBusBuffers for each input/output bus,
regardless of the bus activation state. Bus buffer indices always match regardless of the bus activation state. Bus buffer indices always match
with bus indices used in IComponent::getBusInfo of media type kAudio. with bus indices used in IComponent::getBusInfo of media type kAudio.
\see AudioBusBuffers, IParameterChanges, IEventList, ProcessContext */
//------------------------------------------------------------------------
\see AudioBusBuffers, IParameterChanges, IEventList, ProcessContext, IProcessContextRequirements
*/
struct ProcessData struct ProcessData
{ {
ProcessData () ProcessData ()
: processMode (0), symbolicSampleSize (kSample32), numSamples (0), numInputs (0)
, numOutputs (0), inputs (0), outputs (0), inputParameterChanges (0), outputParameterChanges (0)
, inputEvents (0), outputEvents (0), processContext (0) {}
: processMode (0)
, symbolicSampleSize (kSample32)
, numSamples (0)
, numInputs (0)
, numOutputs (0)
, inputs (nullptr)
, outputs (nullptr)
, inputParameterChanges (nullptr)
, outputParameterChanges (nullptr)
, inputEvents (nullptr)
, outputEvents (nullptr)
, processContext (nullptr)
{
}


//------------------------------------------------------------------------ //------------------------------------------------------------------------
int32 processMode; ///< processing mode - value of \ref ProcessModes int32 processMode; ///< processing mode - value of \ref ProcessModes
int32 symbolicSampleSize; ///< sample size - value of \ref SymbolicSampleSizes int32 symbolicSampleSize; ///< sample size - value of \ref SymbolicSampleSizes
int32 numSamples; ///< number of samples to process int32 numSamples; ///< number of samples to process
int32 numInputs; ///< number of audio input buses
int32 numOutputs; ///< number of audio output buses
AudioBusBuffers* inputs; ///< buffers of input buses
AudioBusBuffers* outputs; ///< buffers of output buses
int32 numInputs; ///< number of audio input busses
int32 numOutputs; ///< number of audio output busses
AudioBusBuffers* inputs; ///< buffers of input busses
AudioBusBuffers* outputs; ///< buffers of output busses


IParameterChanges* inputParameterChanges; ///< incoming parameter changes for this block IParameterChanges* inputParameterChanges; ///< incoming parameter changes for this block
IParameterChanges* outputParameterChanges; ///< outgoing parameter changes for this block (optional) IParameterChanges* outputParameterChanges; ///< outgoing parameter changes for this block (optional)
@@ -233,60 +246,77 @@ struct ProcessData
}; };


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Audio Processing Interface.
/** Audio processing interface: Vst::IAudioProcessor
\ingroup vstIPlug vst300 \ingroup vstIPlug vst300
- [plug imp] - [plug imp]
- [extends IComponent] - [extends IComponent]
- [released: 3.0.0] - [released: 3.0.0]
- [mandatory] - [mandatory]


This interface must always be supported by audio processing Plug-ins. */
//------------------------------------------------------------------------
class IAudioProcessor: public FUnknown
This interface must always be supported by audio processing plug-ins.
*/
class IAudioProcessor : public FUnknown
{ {
public: public:
//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Try to set (from host) a predefined arrangement for inputs and outputs.
The host should always deliver the same number of input and output buses than the Plug-in needs
(see \ref IComponent::getBusCount).
The Plug-in returns kResultFalse if wanted arrangements are not supported.
If the Plug-in accepts these arrangements, it should modify its buses to match the new arrangements
(asked by the host with IComponent::getInfo () or IAudioProcessor::getBusArrangement ()) and then return kResultTrue.
If the Plug-in does not accept these arrangements, but can adapt its current arrangements (according to the wanted ones),
it should modify its buses arrangements and return kResultFalse. */
/** Try to set (host => plug-in) a wanted arrangement for inputs and outputs.
The host should always deliver the same number of input and output busses than the plug-in
needs (see \ref IComponent::getBusCount). The plug-in has 3 possibilities to react on this
setBusArrangements call:\n
1. The plug-in accepts these arrangements, then it should modify, if needed, its busses to match
these new arrangements (later on asked by the host with IComponent::getBusInfo () or
IAudioProcessor::getBusArrangement ()) and then should return kResultTrue.\n
2. The plug-in does not accept or support these requested arrangements for all
inputs/outputs or just for some or only one bus, but the plug-in can try to adapt its current
arrangements according to the requested ones (requested arrangements for kMain busses should be
handled with more priority than the ones for kAux busses), then it should modify its busses arrangements
and should return kResultFalse.\n
3. Same than the point 2 above the plug-in does not support these requested arrangements
but the plug-in cannot find corresponding arrangements, the plug-in could keep its current arrangement
or fall back to a default arrangement by modifying its busses arrangements and should return kResultFalse.\n
\param inputs pointer to an array of /ref SpeakerArrangement
\param numIns number of /ref SpeakerArrangement in inputs array
\param outputs pointer to an array of /ref SpeakerArrangement
\param numOuts number of /ref SpeakerArrangement in outputs array
Returns kResultTrue when Arrangements is supported and is the current one, else returns kResultFalse. */
virtual tresult PLUGIN_API setBusArrangements (SpeakerArrangement* inputs, int32 numIns, virtual tresult PLUGIN_API setBusArrangements (SpeakerArrangement* inputs, int32 numIns,
SpeakerArrangement* outputs, int32 numOuts) = 0; SpeakerArrangement* outputs, int32 numOuts) = 0;


/** Gets the bus arrangement for a given direction (input/output) and index. /** Gets the bus arrangement for a given direction (input/output) and index.
Note: IComponent::getInfo () and IAudioProcessor::getBusArrangement () should be always return the same
information about the buses arrangements. */
Note: IComponent::getBusInfo () and IAudioProcessor::getBusArrangement () should be always return the same
information about the busses arrangements. */
virtual tresult PLUGIN_API getBusArrangement (BusDirection dir, int32 index, SpeakerArrangement& arr) = 0; virtual tresult PLUGIN_API getBusArrangement (BusDirection dir, int32 index, SpeakerArrangement& arr) = 0;


/** Asks if a given sample size is supported see \ref SymbolicSampleSizes. */ /** Asks if a given sample size is supported see \ref SymbolicSampleSizes. */
virtual tresult PLUGIN_API canProcessSampleSize (int32 symbolicSampleSize) = 0; virtual tresult PLUGIN_API canProcessSampleSize (int32 symbolicSampleSize) = 0;


/** Gets the current Latency in samples. /** Gets the current Latency in samples.
The returned value defines the group delay or the latency of the Plug-in. For example, if the Plug-in internally needs
to look in advance (like compressors) 512 samples then this Plug-in should report 512 as latency.
If during the use of the Plug-in this latency change, the Plug-in has to inform the host by
The returned value defines the group delay or the latency of the plug-in. For example, if the plug-in internally needs
to look in advance (like compressors) 512 samples then this plug-in should report 512 as latency.
If during the use of the plug-in this latency change, the plug-in has to inform the host by
using IComponentHandler::restartComponent (kLatencyChanged), this could lead to audio playback interruption using IComponentHandler::restartComponent (kLatencyChanged), this could lead to audio playback interruption
because the host has to recompute its internal mixer delay compensation. because the host has to recompute its internal mixer delay compensation.
Note that for player live recording this latency should be zero or small. */ Note that for player live recording this latency should be zero or small. */
virtual uint32 PLUGIN_API getLatencySamples () = 0; virtual uint32 PLUGIN_API getLatencySamples () = 0;


/** Called in disable state (not active) before processing will begin. */
/** Called in disable state (setActive not called with true) before setProcessing is called and processing will begin. */
virtual tresult PLUGIN_API setupProcessing (ProcessSetup& setup) = 0; virtual tresult PLUGIN_API setupProcessing (ProcessSetup& setup) = 0;


/** Informs the Plug-in about the processing state. This will be called before any process calls start with true and after with false.
Note that setProcessing (false) may be called after setProcessing (true) without any process calls.
In this call the Plug-in should do only light operation (no memory allocation or big setup reconfiguration),
this could be used to reset some buffers (like Delay line or Reverb). */
/** Informs the plug-in about the processing state. This will be called before any process calls
start with true and after with false.
Note that setProcessing (false) may be called after setProcessing (true) without any process
calls.
Note this function could be called in the UI or in Processing Thread, thats why the plug-in
should only light operation (no memory allocation or big setup reconfiguration),
this could be used to reset some buffers (like Delay line or Reverb).
The host has to be sure that it is called only when the plug-in is enable (setActive (true)
was called). */
virtual tresult PLUGIN_API setProcessing (TBool state) = 0; virtual tresult PLUGIN_API setProcessing (TBool state) = 0;


/** The Process call, where all information (parameter changes, event, audio buffer) are passed. */ /** The Process call, where all information (parameter changes, event, audio buffer) are passed. */
virtual tresult PLUGIN_API process (ProcessData& data) = 0; virtual tresult PLUGIN_API process (ProcessData& data) = 0;


/** Gets tail size in samples. For example, if the Plug-in is a Reverb Plug-in and it knows that
/** Gets tail size in samples. For example, if the plug-in is a Reverb plug-in and it knows that
the maximum length of the Reverb is 2sec, then it has to return in getTailSamples() the maximum length of the Reverb is 2sec, then it has to return in getTailSamples()
(in VST2 it was getGetTailSize ()): 2*sampleRate. (in VST2 it was getGetTailSize ()): 2*sampleRate.
This information could be used by host for offline processing, process optimization and This information could be used by host for offline processing, process optimization and
@@ -304,40 +334,40 @@ public:
DECLARE_CLASS_IID (IAudioProcessor, 0x42043F99, 0xB7DA453C, 0xA569E79D, 0x9AAEC33D) DECLARE_CLASS_IID (IAudioProcessor, 0x42043F99, 0xB7DA453C, 0xA569E79D, 0x9AAEC33D)


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Extended IAudioProcessor interface for a component.
/** Extended IAudioProcessor interface for a component: Vst::IAudioPresentationLatency
\ingroup vstIPlug vst310 \ingroup vstIPlug vst310
- [plug imp] - [plug imp]
- [extends IAudioProcessor] - [extends IAudioProcessor]
- [released: 3.1.0] - [released: 3.1.0]
- [optional] - [optional]


Inform the Plug-in about how long from the moment of generation/acquiring (from file or from Input)
it will take for its input to arrive, and how long it will take for its output to be presented (to output or to Speaker).
Inform the plug-in about how long from the moment of generation/acquiring (from file or from Input)
it will take for its input to arrive, and how long it will take for its output to be presented (to output or to speaker).


Note for Input Presentation Latency: when reading from file, the first Plug-in will have an input presentation latency set to zero.
When monitoring audio input from a Audio Device, then this initial input latency will be the input latency of the Audio Device itself.
Note for Input Presentation Latency: when reading from file, the first plug-in will have an input presentation latency set to zero.
When monitoring audio input from an audio device, the initial input latency is the input latency of the audio device itself.


Note for Output Presentation Latency: when writing to a file, the last Plug-in will have an output presentation latency set to zero.
When the output of this Plug-in is connected to a Audio Device then this initial output latency will be the output
latency of the Audio Device itself.
Note for Output Presentation Latency: when writing to a file, the last plug-in will have an output presentation latency set to zero.
When the output of this plug-in is connected to an audio device, the initial output latency is the output
latency of the audio device itself.


A value of zero means either no latency or an unknown latency.
A value of zero either means no latency or an unknown latency.


Each Plug-in adding a latency (returning a none zero value for IAudioProcessor::getLatencySamples) will modify the input
presentation latency of the next Plug-ins in the mixer routing graph and will modify the output presentation latency
of the previous Plug-ins.
Each plug-in adding a latency (returning a none zero value for IAudioProcessor::getLatencySamples) will modify the input
presentation latency of the next plug-ins in the mixer routing graph and will modify the output presentation latency
of the previous plug-ins.


\n \n
\image html "iaudiopresentationlatency_usage.png" \image html "iaudiopresentationlatency_usage.png"
\n \n
\see IAudioProcessor \see IAudioProcessor
\see IComponent*/
//------------------------------------------------------------------------
class IAudioPresentationLatency: public FUnknown
\see IComponent
*/
class IAudioPresentationLatency : public FUnknown
{ {
public: public:
//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Informs the Plug-in about the Audio Presentation Latency in samples for a given direction (kInput/kOutput) and bus index. */
/** Informs the plug-in about the Audio Presentation Latency in samples for a given direction (kInput/kOutput) and bus index. */
virtual tresult PLUGIN_API setAudioPresentationLatencySamples (BusDirection dir, int32 busIndex, uint32 latencyInSamples) = 0; virtual tresult PLUGIN_API setAudioPresentationLatencySamples (BusDirection dir, int32 busIndex, uint32 latencyInSamples) = 0;


//------------------------------------------------------------------------ //------------------------------------------------------------------------
@@ -346,6 +376,50 @@ public:


DECLARE_CLASS_IID (IAudioPresentationLatency, 0x309ECE78, 0xEB7D4fae, 0x8B2225D9, 0x09FD08B6) DECLARE_CLASS_IID (IAudioPresentationLatency, 0x309ECE78, 0xEB7D4fae, 0x8B2225D9, 0x09FD08B6)


//------------------------------------------------------------------------
/** Extended IAudioProcessor interface for a component: Vst::IProcessContextRequirements
\ingroup vstIPlug vst370
- [plug imp]
- [extends IAudioProcessor]
- [released: 3.7.0]
- [mandatory]
To get accurate process context information (Vst::ProcessContext), it is now required to implement this interface and
return the desired bit mask of flags which your audio effect needs. If you do not implement this
interface, you may not get any information at all of the process function.

The host asks for this information once between initialize and setActive. It cannot be changed afterwards.

This gives the host the opportunity to better optimize the audio process graph when it knows which
plug-ins need which information.

Plug-Ins built with an earlier SDK version (< 3.7) will still get the old information, but the information
may not be as accurate as when using this interface.
*/
class IProcessContextRequirements : public FUnknown
{
public:
enum Flags
{
kNeedSystemTime = 1 << 0, // kSystemTimeValid
kNeedContinousTimeSamples = 1 << 1, // kContTimeValid
kNeedProjectTimeMusic = 1 << 2, // kProjectTimeMusicValid
kNeedBarPositionMusic = 1 << 3, // kBarPositionValid
kNeedCycleMusic = 1 << 4, // kCycleValid
kNeedSamplesToNextClock = 1 << 5, // kClockValid
kNeedTempo = 1 << 6, // kTempoValid
kNeedTimeSignature = 1 << 7, // kTimeSigValid
kNeedChord = 1 << 8, // kChordValid
kNeedFrameRate = 1 << 9, // kSmpteValid
kNeedTransportState = 1 << 10, // kPlaying, kCycleActive, kRecording
};
virtual uint32 PLUGIN_API getProcessContextRequirements () = 0;
//------------------------------------------------------------------------
static const FUID iid;
};

DECLARE_CLASS_IID (IProcessContextRequirements, 0x2A654303, 0xEF764E3D, 0x95B5FE83, 0x730EF6D0)

//------------------------------------------------------------------------ //------------------------------------------------------------------------
} // namespace Vst } // namespace Vst
} // namespace Steinberg } // namespace Steinberg


+ 3
- 3
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivstautomationstate.h View File

@@ -27,16 +27,15 @@ namespace Steinberg {
namespace Vst { namespace Vst {


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Extended Plug-in interface IEditController.
/** Extended plug-in interface IEditController: Vst::IAutomationState
\ingroup vstIPlug vst365 \ingroup vstIPlug vst365
- [plug imp] - [plug imp]
- [extends IEditController] - [extends IEditController]
- [released: 3.6.5] - [released: 3.6.5]
- [optional] - [optional]


Hosts could inform the Plug-in about its current automation state (Read/Write/Nothing).
Hosts can inform the plug-in about its current automation state (Read/Write/Nothing).
*/ */
//------------------------------------------------------------------------
class IAutomationState : public FUnknown class IAutomationState : public FUnknown
{ {
public: public:
@@ -59,6 +58,7 @@ public:


DECLARE_CLASS_IID (IAutomationState, 0xB4E8287F, 0x1BB346AA, 0x83A46667, 0x68937BAB) DECLARE_CLASS_IID (IAutomationState, 0xB4E8287F, 0x1BB346AA, 0x83A46667, 0x68937BAB)


//------------------------------------------------------------------------
} // namespace Vst } // namespace Vst
} // namespace Steinberg } // namespace Steinberg




+ 28
- 16
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivstchannelcontextinfo.h View File

@@ -26,6 +26,7 @@
//------------------------------------------------------------------------ //------------------------------------------------------------------------
namespace Steinberg { namespace Steinberg {
namespace Vst { namespace Vst {

/** For Channel Context Info Interface */ /** For Channel Context Info Interface */
namespace ChannelContext { namespace ChannelContext {


@@ -35,22 +36,24 @@ namespace ChannelContext {


//------------------------------------------------------------------------ //------------------------------------------------------------------------
//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Channel Context Interface.
/** Channel context interface: Vst::IInfoListener
\ingroup vstIHost vst365 \ingroup vstIHost vst365
- [plug imp] - [plug imp]
- [extends IEditController] - [extends IEditController]
- [released: 3.6.5] - [released: 3.6.5]
- [optional] - [optional]


Allows the host to inform the Plug-in about the context in which the Plug-in is instantiated,
mainly channel based info (color, name, index,...). Index could be defined inside a namespace
(for example index start from 1 to N for Type Input/Output Channel (Index namespace) and index
Allows the host to inform the plug-in about the context in which the plug-in is instantiated,
mainly channel based info (color, name, index,...). Index can be defined inside a namespace
(for example, index start from 1 to N for Type Input/Output Channel (Index namespace) and index
start from 1 to M for Type Audio Channel).\n start from 1 to M for Type Audio Channel).\n
As soon as the Plug-in provides this IInfoListener interface, the host will call setChannelContextInfos
As soon as the plug-in provides this IInfoListener interface, the host will call setChannelContextInfos
for each change occurring to this channel (new name, new color, new indexation,...) for each change occurring to this channel (new name, new color, new indexation,...)


\section IChannelContextExample Example \section IChannelContextExample Example
\code

\code{.cpp}
//------------------------------------------------------------------------
tresult PLUGIN_API MyPlugin::setChannelContextInfos (IAttributeList* list) tresult PLUGIN_API MyPlugin::setChannelContextInfos (IAttributeList* list)
{ {
if (list) if (list)
@@ -62,7 +65,7 @@ tresult PLUGIN_API MyPlugin::setChannelContextInfos (IAttributeList* list)
... ...
} }
// get the Channel Name where we, as Plug-in, are instantiated
// get the Channel Name where we, as plug-in, are instantiated
String128 name; String128 name;
if (list->getString (ChannelContext::kChannelNameKey, name, sizeof (name)) == kResultTrue) if (list->getString (ChannelContext::kChannelNameKey, name, sizeof (name)) == kResultTrue)
{ {
@@ -116,7 +119,7 @@ tresult PLUGIN_API MyPlugin::setChannelContextInfos (IAttributeList* list)
... ...
} }


// get Plug-in Channel Location
// get plug-in Channel Location
int64 location; int64 location;
if (list->getInt (ChannelContext::kChannelPluginLocationKey, location) == kResultTrue) if (list->getInt (ChannelContext::kChannelPluginLocationKey, location) == kResultTrue)
{ {
@@ -140,9 +143,9 @@ tresult PLUGIN_API MyPlugin::setChannelContextInfos (IAttributeList* list)
// do not forget to call addRef () if you want to keep this list // do not forget to call addRef () if you want to keep this list
} }
} }
\endcode */
//------------------------------------------------------------------------
class IInfoListener: public FUnknown
\endcode
*/
class IInfoListener : public FUnknown
{ {
public: public:
/** Receive the channel context infos from host. */ /** Receive the channel context infos from host. */
@@ -156,7 +159,6 @@ DECLARE_CLASS_IID (IInfoListener, 0x0F194781, 0x8D984ADA, 0xBBA0C1EF, 0xC011D8D0


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Values used for kChannelPluginLocationKey */ /** Values used for kChannelPluginLocationKey */
//------------------------------------------------------------------------
enum ChannelPluginLocation enum ChannelPluginLocation
{ {
kPreVolumeFader = 0, kPreVolumeFader = 0,
@@ -166,13 +168,23 @@ enum ChannelPluginLocation


//------------------------------------------------------------------------ //------------------------------------------------------------------------
//------------------------------------------------------------------------ //------------------------------------------------------------------------
// Colors
typedef uint32 ColorSpec; ///< ARGB (Alpha-Red-Green-Blue)
// Colors
//------------------------------------------------------------------------
/** \defgroup vst3typedef VST 3 Data Types */
/*@{*/
//------------------------------------------------------------------------
/** ARGB (Alpha-Red-Green-Blue) */
typedef uint32 ColorSpec;
typedef uint8 ColorComponent; typedef uint8 ColorComponent;
/*@}*/


/** Returns the Blue part of the given ColorSpec */
inline ColorComponent GetBlue (ColorSpec cs) {return (ColorComponent)(cs & 0x000000FF); } inline ColorComponent GetBlue (ColorSpec cs) {return (ColorComponent)(cs & 0x000000FF); }
/** Returns the Green part of the given ColorSpec */
inline ColorComponent GetGreen (ColorSpec cs) {return (ColorComponent)((cs >> 8) & 0x000000FF); } inline ColorComponent GetGreen (ColorSpec cs) {return (ColorComponent)((cs >> 8) & 0x000000FF); }
/** Returns the Red part of the given ColorSpec */
inline ColorComponent GetRed (ColorSpec cs) {return (ColorComponent)((cs >> 16) & 0x000000FF); } inline ColorComponent GetRed (ColorSpec cs) {return (ColorComponent)((cs >> 16) & 0x000000FF); }
/** Returns the Alpha part of the given ColorSpec */
inline ColorComponent GetAlpha (ColorSpec cs) {return (ColorComponent)((cs >> 24) & 0x000000FF); } inline ColorComponent GetAlpha (ColorSpec cs) {return (ColorComponent)((cs >> 24) & 0x000000FF); }


//------------------------------------------------------------------------ //------------------------------------------------------------------------
@@ -213,10 +225,10 @@ const CString kChannelIndexNamespaceLengthKey = "channel index namespace length"
/** PNG image representation as binary [optional] */ /** PNG image representation as binary [optional] */
const CString kChannelImageKey = "channel image"; const CString kChannelImageKey = "channel image";


/** integer (int64) [optional]: routing position of the Plug-in in the channel (see ChannelPluginLocation) */
/** integer (int64) [optional]: routing position of the plug-in in the channel (see ChannelPluginLocation) */
const CString kChannelPluginLocationKey = "channel plugin location"; const CString kChannelPluginLocationKey = "channel plugin location";
//------------------------------------------------------------------------


//------------------------------------------------------------------------
} // namespace ChannelContext } // namespace ChannelContext
} // namespace Vst } // namespace Vst
} // namespace Steinberg } // namespace Steinberg


+ 45
- 26
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivstcomponent.h View File

@@ -17,7 +17,7 @@
#pragma once #pragma once


#include "pluginterfaces/base/ipluginbase.h" #include "pluginterfaces/base/ipluginbase.h"
#include "vsttypes.h"
#include "pluginterfaces/vst/vsttypes.h"


//------------------------------------------------------------------------ //------------------------------------------------------------------------
#include "pluginterfaces/base/falignpush.h" #include "pluginterfaces/base/falignpush.h"
@@ -28,31 +28,36 @@ class IBStream;


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** All VST specific interfaces are located in Vst namespace */ /** All VST specific interfaces are located in Vst namespace */
//------------------------------------------------------------------------
namespace Vst { namespace Vst {
const int32 kDefaultFactoryFlags = PFactoryInfo::kUnicode; ///< Standard value for PFactoryInfo::flags

/** Standard value for PFactoryInfo::flags */
const int32 kDefaultFactoryFlags = PFactoryInfo::kUnicode;


#define BEGIN_FACTORY_DEF(vendor,url,email) using namespace Steinberg; \ #define BEGIN_FACTORY_DEF(vendor,url,email) using namespace Steinberg; \
EXPORT_FACTORY IPluginFactory* PLUGIN_API GetPluginFactory () { \
SMTG_EXPORT_SYMBOL IPluginFactory* PLUGIN_API GetPluginFactory () { \
if (!gPluginFactory) \ if (!gPluginFactory) \
{ static PFactoryInfo factoryInfo (vendor,url,email,Vst::kDefaultFactoryFlags); \
{ \
static PFactoryInfo factoryInfo (vendor, url, email, Vst::kDefaultFactoryFlags); \
gPluginFactory = new CPluginFactory (factoryInfo); gPluginFactory = new CPluginFactory (factoryInfo);


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** \defgroup vstBus VST Buses
/** \defgroup vstBus VST busses
Bus Description Bus Description


A bus can be understood as a "collection of data channels" belonging together. A bus can be understood as a "collection of data channels" belonging together.
It describes a data input or a data output of the Plug-in.
A VST component can define any desired number of buses, but this number must \b never change.
Dynamic usage of buses is handled in the host by activating and deactivating buses.
The component has to define the maximum number of supported buses and it has to
define which of them are active by default. A host that can handle multiple buses,
allows the user to activate buses that were initially inactive.
It describes a data input or a data output of the plug-in.
A VST component can define any desired number of busses.
Dynamic usage of busses is handled in the host by activating and deactivating busses.
All busses are initially inactive.
The component has to define the maximum number of supported busses and it has to
define which of them have to be activated by default after instantiation of the plug-in (This is
only a wish, the host is allow to not follow it, and only activate the first bus for example).
A host that can handle multiple busses, allows the user to activate busses which are initially all inactive.
The kMain busses have to place before any others kAux busses.


See also: IComponent::getBusInfo, IComponent::activateBus See also: IComponent::getBusInfo, IComponent::activateBus

@{*/
*/
/*@{*/


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Bus media types */ /** Bus media types */
@@ -82,7 +87,8 @@ enum BusTypes
//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** BusInfo: /** BusInfo:
This is the structure used with getBusInfo, informing the host about what is a specific given bus. This is the structure used with getBusInfo, informing the host about what is a specific given bus.
\n See also: IComponent::getBusInfo */
\n See also: Steinberg::Vst::IComponent::getBusInfo
*/
struct BusInfo struct BusInfo
{ {
MediaType mediaType; ///< Media type - has to be a value of \ref MediaTypes MediaType mediaType; ///< Media type - has to be a value of \ref MediaTypes
@@ -96,7 +102,15 @@ struct BusInfo
uint32 flags; ///< flags - a combination of \ref BusFlags uint32 flags; ///< flags - a combination of \ref BusFlags
enum BusFlags enum BusFlags
{ {
kDefaultActive = 1 << 0 ///< bus active per default
/** The bus should be activated by the host per default on instantiation (activateBus call is requested).
By default a bus is inactive. */
kDefaultActive = 1 << 0,
/** The bus does not contain ordinary audio data, but data used for control changes at sample rate.
The data is in the same format as the audio data [-1..1].
A host has to prevent unintended routing to speakers to prevent damage.
Only valid for audio media type busses.
[released: 3.7.0] */
kIsControlVoltage = 1 << 1
}; };
}; };


@@ -108,15 +122,16 @@ enum IoModes
{ {
kSimple = 0, ///< 1:1 Input / Output. Only used for Instruments. See \ref vst3IoMode kSimple = 0, ///< 1:1 Input / Output. Only used for Instruments. See \ref vst3IoMode
kAdvanced, ///< n:m Input / Output. Only used for Instruments. kAdvanced, ///< n:m Input / Output. Only used for Instruments.
kOfflineProcessing ///< Plug-in used in an offline processing context
kOfflineProcessing ///< plug-in used in an offline processing context
}; };


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Routing Information: /** Routing Information:
When the Plug-in supports multiple I/O buses, a host may want to know how the buses are related. The
When the plug-in supports multiple I/O busses, a host may want to know how the busses are related. The
relation of an event-input-channel to an audio-output-bus in particular is of interest to the host relation of an event-input-channel to an audio-output-bus in particular is of interest to the host
(in order to relate MIDI-tracks to audio-channels) (in order to relate MIDI-tracks to audio-channels)
\n See also: IComponent::getRoutingInfo, \ref vst3Routing */
\n See also: IComponent::getRoutingInfo, \ref vst3Routing
*/
struct RoutingInfo struct RoutingInfo
{ {
MediaType mediaType; ///< media type see \ref MediaTypes MediaType mediaType; ///< media type see \ref MediaTypes
@@ -127,7 +142,7 @@ struct RoutingInfo
//------------------------------------------------------------------------ //------------------------------------------------------------------------
// IComponent Interface // IComponent Interface
//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Component Base Interface
/** Component base interface: Vst::IComponent
\ingroup vstIPlug vst300 \ingroup vstIPlug vst300
- [plug imp] - [plug imp]
- [released: 3.0.0] - [released: 3.0.0]
@@ -137,8 +152,9 @@ This is the basic interface for a VST component and must always be supported.
It contains the common parts of any kind of processing class. The parts that It contains the common parts of any kind of processing class. The parts that
are specific to a media type are defined in a separate interface. An implementation are specific to a media type are defined in a separate interface. An implementation
component must provide both the specific interface and IComponent. component must provide both the specific interface and IComponent.
\see IPluginBase
*/ */
class IComponent: public IPluginBase
class IComponent : public IPluginBase
{ {
public: public:
//------------------------------------------------------------------------ //------------------------------------------------------------------------
@@ -148,19 +164,22 @@ public:
/** Called before 'initialize' to set the component usage (optional). See \ref IoModes */ /** Called before 'initialize' to set the component usage (optional). See \ref IoModes */
virtual tresult PLUGIN_API setIoMode (IoMode mode) = 0; virtual tresult PLUGIN_API setIoMode (IoMode mode) = 0;


/** Called after the Plug-in is initialized. See \ref MediaTypes, BusDirections */
/** Called after the plug-in is initialized. See \ref MediaTypes, BusDirections */
virtual int32 PLUGIN_API getBusCount (MediaType type, BusDirection dir) = 0; virtual int32 PLUGIN_API getBusCount (MediaType type, BusDirection dir) = 0;


/** Called after the Plug-in is initialized. See \ref MediaTypes, BusDirections */
/** Called after the plug-in is initialized. See \ref MediaTypes, BusDirections */
virtual tresult PLUGIN_API getBusInfo (MediaType type, BusDirection dir, int32 index, BusInfo& bus /*out*/) = 0; virtual tresult PLUGIN_API getBusInfo (MediaType type, BusDirection dir, int32 index, BusInfo& bus /*out*/) = 0;


/** Retrieves routing information (to be implemented when more than one regular input or output bus exists). /** Retrieves routing information (to be implemented when more than one regular input or output bus exists).
The inInfo always refers to an input bus while the returned outInfo must refer to an output bus! */ The inInfo always refers to an input bus while the returned outInfo must refer to an output bus! */
virtual tresult PLUGIN_API getRoutingInfo (RoutingInfo& inInfo, RoutingInfo& outInfo /*out*/) = 0; virtual tresult PLUGIN_API getRoutingInfo (RoutingInfo& inInfo, RoutingInfo& outInfo /*out*/) = 0;


/** Called upon (de-)activating a bus in the host application. The Plug-in should only processed an activated bus,
the host could provide less see \ref AudioBusBuffers in the process call (see \ref IAudioProcessor::process) if last buses are not activated */
virtual tresult PLUGIN_API activateBus (MediaType type, BusDirection dir, int32 index, TBool state) = 0;
/** Called upon (de-)activating a bus in the host application. The plug-in should only processed
an activated bus, the host could provide less see \ref AudioBusBuffers in the process call
(see \ref IAudioProcessor::process) if last busses are not activated. An already activated bus
does not need to be reactivated after a IAudioProcessor::setBusArrangements call. */
virtual tresult PLUGIN_API activateBus (MediaType type, BusDirection dir, int32 index,
TBool state) = 0;


/** Activates / deactivates the component. */ /** Activates / deactivates the component. */
virtual tresult PLUGIN_API setActive (TBool state) = 0; virtual tresult PLUGIN_API setActive (TBool state) = 0;


+ 25
- 23
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivstcontextmenu.h View File

@@ -17,7 +17,7 @@
#pragma once #pragma once


#include "pluginterfaces/base/funknown.h" #include "pluginterfaces/base/funknown.h"
#include "vsttypes.h"
#include "pluginterfaces/vst/vsttypes.h"


//------------------------------------------------------------------------ //------------------------------------------------------------------------
#include "pluginterfaces/base/falignpush.h" #include "pluginterfaces/base/falignpush.h"
@@ -30,30 +30,35 @@ namespace Vst {
class IContextMenu; class IContextMenu;


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Extended Host callback interface IComponentHandler3 for an edit controller.
/** Extended host callback interface Vst::IComponentHandler3 for an edit controller.
\ingroup vstIHost vst350 \ingroup vstIHost vst350
- [host imp] - [host imp]
- [extends IComponentHandler] - [extends IComponentHandler]
- [released: 3.5.0] - [released: 3.5.0]
- [optional] - [optional]


A Plug-in can ask the host to create a context menu for a given exported Parameter ID or a generic context menu.\n
A plug-in can ask the host to create a context menu for a given exported parameter ID or a generic context menu.\n


The host may pre-fill this context menu with specific items regarding the parameter ID like "Show automation for parameter", The host may pre-fill this context menu with specific items regarding the parameter ID like "Show automation for parameter",
"MIDI learn" etc...\n "MIDI learn" etc...\n


The Plug-in can use the context menu in two ways :
- add its own items to the menu via the IContextMenu interface and call IContextMenu::popup(..) to pop-up it. See the \ref IContextMenuExample.
- extract the host menu items and add them to its own created context menu
The plug-in can use the context menu in two ways :
- add its own items to the menu via the IContextMenu interface and call IContextMenu::popup(..) to create the pop-up. See the \ref IContextMenuExample.
- extract the host menu items and add them to a context menu created by the plug-in.


\b Note: You can and should use this even if you don't add your own items to the menu as this is considered to be a big user value.
\b Note: You can and should use this even if you do not add your own items to the menu as this is considered to be a big user value.


\sa IContextMenu \sa IContextMenu
\sa IContextMenuTarget \sa IContextMenuTarget


\section IContextMenuExample Example
Adding Plug-in specific items to the context menu
\code
\section IContextMenuExample Examples
- For example, Cubase adds its owned entries in the context menu opened with right-click on an exported parameter when the plug-in uses createContextMenu.
\image html "contextmenuexample.png"
\n
- Adding plug-in specific items to the context menu:

\code{.cpp}
//------------------------------------------------------------------------
class PluginContextMenuTarget : public IContextMenuTarget, public FObject class PluginContextMenuTarget : public IContextMenuTarget, public FObject
{ {
public: public:
@@ -61,8 +66,8 @@ public:


virtual tresult PLUGIN_API executeMenuItem (int32 tag) virtual tresult PLUGIN_API executeMenuItem (int32 tag)
{ {
// this will be called if the user has executed one of the menu items of the Plug-in.
// It won't be called for items of the host.
// this will be called if the user has executed one of the menu items of the plug-in.
// It will not be called for items of the host.
switch (tag) switch (tag)
{ {
case 1: break; case 1: break;
@@ -110,14 +115,13 @@ void popupContextMenu (IComponentHandler* componentHandler, IPlugView* view, con
} }
\endcode \endcode
*/ */
//------------------------------------------------------------------------
class IComponentHandler3 : public FUnknown class IComponentHandler3 : public FUnknown
{ {
public: public:
/** Creates a host context menu for a Plug-in:
/** Creates a host context menu for a plug-in:
- If paramID is zero, the host may create a generic context menu. - If paramID is zero, the host may create a generic context menu.
- The IPlugView object must be valid. - The IPlugView object must be valid.
- The return IContextMenu object needs to be released afterwards by the Plug-in.
- The return IContextMenu object needs to be released afterwards by the plug-in.
*/ */
virtual IContextMenu* PLUGIN_API createContextMenu (IPlugView* plugView, const ParamID* paramID) = 0; virtual IContextMenu* PLUGIN_API createContextMenu (IPlugView* plugView, const ParamID* paramID) = 0;
//------------------------------------------------------------------------ //------------------------------------------------------------------------
@@ -127,7 +131,7 @@ public:
DECLARE_CLASS_IID (IComponentHandler3, 0x69F11617, 0xD26B400D, 0xA4B6B964, 0x7B6EBBAB) DECLARE_CLASS_IID (IComponentHandler3, 0x69F11617, 0xD26B400D, 0xA4B6B964, 0x7B6EBBAB)
//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Context Menu Item Target Interface.
/** Context Menu Item Target interface: Vst::IContextMenuTarget
\ingroup vstIHost vstIPlug vst350 \ingroup vstIHost vstIPlug vst350
- [host imp] - [host imp]
- [plug imp] - [plug imp]
@@ -137,9 +141,8 @@ DECLARE_CLASS_IID (IComponentHandler3, 0x69F11617, 0xD26B400D, 0xA4B6B964, 0x7B6
A receiver of a menu item should implement this interface, which will be called after the user has selected A receiver of a menu item should implement this interface, which will be called after the user has selected
this menu item. this menu item.


See IComponentHandler3 for more.
\see IComponentHandler3 for more information.
*/ */
//------------------------------------------------------------------------
class IContextMenuTarget : public FUnknown class IContextMenuTarget : public FUnknown
{ {
public: public:
@@ -168,7 +171,7 @@ struct IContextMenuItem
}; };
}; };
//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Context Menu Interface.
/** Context Menu interface: Vst::IContextMenu
\ingroup vstIHost vst350 \ingroup vstIHost vst350
- [host imp] - [host imp]
- [create with IComponentHandler3::createContextMenu(..)] - [create with IComponentHandler3::createContextMenu(..)]
@@ -177,11 +180,10 @@ struct IContextMenuItem


A context menu is composed of Item (entry). A Item is defined by a name, a tag, a flag A context menu is composed of Item (entry). A Item is defined by a name, a tag, a flag
and a associated target (called when this item will be selected/executed). and a associated target (called when this item will be selected/executed).
With IContextMenu the Plug-in can retrieve a Item, add a Item, remove a Item and pop-up the menu.
With IContextMenu the plug-in can retrieve a Item, add a Item, remove a Item and pop-up the menu.


See IComponentHandler3 for more.
\see IComponentHandler3 for more information.
*/ */
//------------------------------------------------------------------------
class IContextMenu : public FUnknown class IContextMenu : public FUnknown
{ {
public: public:
@@ -199,7 +201,7 @@ public:
/** Removes a menu item. */ /** Removes a menu item. */
virtual tresult PLUGIN_API removeItem (const Item& item, IContextMenuTarget* target) = 0; virtual tresult PLUGIN_API removeItem (const Item& item, IContextMenuTarget* target) = 0;


/** Pop-ups the menu. Coordinates are relative to the top-left position of the Plug-ins view. */
/** Pop-ups the menu. Coordinates are relative to the top-left position of the plug-ins view. */
virtual tresult PLUGIN_API popup (UCoord x, UCoord y) = 0; virtual tresult PLUGIN_API popup (UCoord x, UCoord y) = 0;


//------------------------------------------------------------------------ //------------------------------------------------------------------------


+ 305
- 124
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivsteditcontroller.h View File

@@ -17,7 +17,7 @@
#pragma once #pragma once


#include "pluginterfaces/base/ipluginbase.h" #include "pluginterfaces/base/ipluginbase.h"
#include "vsttypes.h"
#include "pluginterfaces/vst/vsttypes.h"


//------------------------------------------------------------------------ //------------------------------------------------------------------------
#include "pluginterfaces/base/falignpush.h" #include "pluginterfaces/base/falignpush.h"
@@ -37,9 +37,12 @@ class IBStream;


//------------------------------------------------------------------------ //------------------------------------------------------------------------
namespace Vst { namespace Vst {

//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Controller Parameter Info. */
//------------------------------------------------------------------------
/** Controller Parameter Info.
* A parameter info describes a parameter of the controller.
* The id must always be the same for a parameter as this uniquely identifies the parameter.
*/
struct ParameterInfo struct ParameterInfo
{ {
//------------------------------------------------------------------------ //------------------------------------------------------------------------
@@ -48,23 +51,25 @@ struct ParameterInfo
String128 shortTitle; ///< parameter shortTitle (e.g. "Vol") String128 shortTitle; ///< parameter shortTitle (e.g. "Vol")
String128 units; ///< parameter unit (e.g. "dB") String128 units; ///< parameter unit (e.g. "dB")
int32 stepCount; ///< number of discrete steps (0: continuous, 1: toggle, discrete value otherwise int32 stepCount; ///< number of discrete steps (0: continuous, 1: toggle, discrete value otherwise
///< (corresponding to max - min, for example: 127 for a min = 0 and a max = 127) - see \ref vst3parameterIntro)
///< (corresponding to max - min, for example: 127 for a min = 0 and a max = 127) - see \ref vst3ParameterIntro)
ParamValue defaultNormalizedValue; ///< default normalized value [0,1] (in case of discrete value: defaultNormalizedValue = defDiscreteValue / stepCount) ParamValue defaultNormalizedValue; ///< default normalized value [0,1] (in case of discrete value: defaultNormalizedValue = defDiscreteValue / stepCount)
UnitID unitId; ///< id of unit this parameter belongs to (see \ref vst3UnitsIntro)
UnitID unitId; ///< id of unit this parameter belongs to (see \ref vst3Units)


int32 flags; ///< ParameterFlags (see below) int32 flags; ///< ParameterFlags (see below)
enum ParameterFlags enum ParameterFlags
{ {
kNoFlags = 0, ///< no flags wanted kNoFlags = 0, ///< no flags wanted
kCanAutomate = 1 << 0, ///< parameter can be automated kCanAutomate = 1 << 0, ///< parameter can be automated
kIsReadOnly = 1 << 1, ///< parameter cannot be changed from outside (implies that kCanAutomate is false)
kIsReadOnly = 1 << 1, ///< parameter cannot be changed from outside the plug-in (implies that kCanAutomate is NOT set)
kIsWrapAround = 1 << 2, ///< attempts to set the parameter value out of the limits will result in a wrap around [SDK 3.0.2] kIsWrapAround = 1 << 2, ///< attempts to set the parameter value out of the limits will result in a wrap around [SDK 3.0.2]
kIsList = 1 << 3, ///< parameter should be displayed as list in generic editor or automation editing [SDK 3.1.0] kIsList = 1 << 3, ///< parameter should be displayed as list in generic editor or automation editing [SDK 3.1.0]
kIsHidden = 1 << 4, ///< parameter should be NOT displayed and cannot be changed from outside the plug-in
///< (implies that kCanAutomate is NOT set and kIsReadOnly is set) [SDK 3.7.0]


kIsProgramChange = 1 << 15, ///< parameter is a program change (unitId gives info about associated unit kIsProgramChange = 1 << 15, ///< parameter is a program change (unitId gives info about associated unit
///< - see \ref vst3UnitPrograms)
kIsBypass = 1 << 16 ///< special bypass parameter (only one allowed): Plug-in can handle bypass
///< (highly recommended to export a bypass parameter for effect Plug-in)
///< - see \ref vst3ProgramLists)
kIsBypass = 1 << 16 ///< special bypass parameter (only one allowed): plug-in can handle bypass
///< (highly recommended to export a bypass parameter for effect plug-in)
}; };
//------------------------------------------------------------------------ //------------------------------------------------------------------------
}; };
@@ -78,48 +83,101 @@ const CString kEditor = "editor";


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Flags used for IComponentHandler::restartComponent */ /** Flags used for IComponentHandler::restartComponent */
//------------------------------------------------------------------------
enum RestartFlags enum RestartFlags
{ {
kReloadComponent = 1 << 0, ///< The Component should be reloaded [SDK 3.0.0]
kIoChanged = 1 << 1, ///< Input and/or Output Bus configuration has changed [SDK 3.0.0]
kParamValuesChanged = 1 << 2, ///< Multiple parameter values have changed
///< (as result of a program change for example) [SDK 3.0.0]
kLatencyChanged = 1 << 3, ///< Latency has changed (IAudioProcessor.getLatencySamples) [SDK 3.0.0]
kParamTitlesChanged = 1 << 4, ///< Parameter titles or default values or flags have changed [SDK 3.0.0]
kMidiCCAssignmentChanged = 1 << 5, ///< MIDI Controller Assignments have changed [SDK 3.0.1]
kNoteExpressionChanged = 1 << 6, ///< Note Expression has changed (info, count, PhysicalUIMapping, ...) [SDK 3.5.0]
kIoTitlesChanged = 1 << 7, ///< Input and/or Output bus titles have changed [SDK 3.5.0]
kPrefetchableSupportChanged = 1 << 8, ///< Prefetch support has changed (\see IPrefetchableSupport) [SDK 3.6.1]
kRoutingInfoChanged = 1 << 9 ///< RoutingInfo has changed (\see IComponent) [SDK 3.6.6]
/** The Component should be reloaded
* The host has to unload completely the plug-in (controller/processor) and reload it.
* [SDK 3.0.0] */
kReloadComponent = 1 << 0,

/** Input / Output Bus configuration has changed
* The plug-in informs the host that either the bus configuration or the bus count has changed.
* The host has to deactivate the plug-in, asks the plug-in for its wanted new bus configurations,
* adapts its processing graph and reactivate the plug-in.
* [SDK 3.0.0] */
kIoChanged = 1 << 1,

/** Multiple parameter values have changed (as result of a program change for example)
* The host invalidates all caches of parameter values and asks the edit controller for the current values.
* [SDK 3.0.0] */
kParamValuesChanged = 1 << 2,

/** Latency has changed
* The plug informs the host that its latency has changed, getLatencySamples should return the new latency after setActive (true) was called
* The host has to deactivate and reactivate the plug-in, then afterwards the host could ask for the current latency (getLatencySamples)
* see IAudioProcessor::getLatencySamples
* [SDK 3.0.0] */
kLatencyChanged = 1 << 3,

/** Parameter titles, default values or flags (ParameterFlags) have changed
* The host invalidates all caches of parameter infos and asks the edit controller for the current infos.
* [SDK 3.0.0] */
kParamTitlesChanged = 1 << 4,

/** MIDI Controllers and/or Program Changes Assignments have changed
* The plug-in informs the host that its MIDI-CC mapping has changed (for example after a MIDI learn or new loaded preset)
* or if the stepCount or UnitID of a ProgramChange parameter has changed.
* The host has to rebuild the MIDI-CC => parameter mapping (getMidiControllerAssignment)
* and reread program changes parameters (stepCount and associated unitID)
* [SDK 3.0.1] */
kMidiCCAssignmentChanged = 1 << 5,
/** Note Expression has changed (info, count, PhysicalUIMapping, ...)
* Either the note expression type info, the count of note expressions or the physical UI mapping has changed.
* The host invalidates all caches of note expression infos and asks the edit controller for the current ones.
* See INoteExpressionController, NoteExpressionTypeInfo and INoteExpressionPhysicalUIMapping
* [SDK 3.5.0] */
kNoteExpressionChanged = 1 << 6,
/** Input / Output bus titles have changed
* The host invalidates all caches of bus titles and asks the edit controller for the current titles.
* [SDK 3.5.0] */
kIoTitlesChanged = 1 << 7,
/** Prefetch support has changed
* The plug-in informs the host that its PrefetchSupport has changed
* The host has to deactivate the plug-in, calls IPrefetchableSupport::getPrefetchableSupport and reactivate the plug-in
* see IPrefetchableSupport
* [SDK 3.6.1] */
kPrefetchableSupportChanged = 1 << 8,

/** RoutingInfo has changed
* The plug-in informs the host that its internal routing (relation of an event-input-channel to an audio-output-bus) has changed
* The host ask the plug-in for the new routing with IComponent::getRoutingInfo, \ref vst3Routing
* see IComponent
* [SDK 3.6.6] */
kRoutingInfoChanged = 1 << 9
}; };


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Host callback interface for an edit controller.
/** Host callback interface for an edit controller: Vst::IComponentHandler
\ingroup vstIHost vst300 \ingroup vstIHost vst300
- [host imp] - [host imp]
- [released: 3.0.0] - [released: 3.0.0]
- [mandatory] - [mandatory]


Allow transfer of parameter editing to component (processor) via host and support automation. Allow transfer of parameter editing to component (processor) via host and support automation.
Cause the host to react on configuration changes (restartComponent)
Cause the host to react on configuration changes (restartComponent).


\see IEditController */
//------------------------------------------------------------------------
class IComponentHandler: public FUnknown
\see \ref IEditController
*/
class IComponentHandler : public FUnknown
{ {
public: public:
//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** To be called before calling a performEdit (e.g. on mouse-click-down event). */
/** To be called before calling a performEdit (e.g. on mouse-click-down event).
This must be called in the UI-Thread context! */
virtual tresult PLUGIN_API beginEdit (ParamID id) = 0; virtual tresult PLUGIN_API beginEdit (ParamID id) = 0;


/** Called between beginEdit and endEdit to inform the handler that a given parameter has a new value. */
/** Called between beginEdit and endEdit to inform the handler that a given parameter has a new
* value. This must be called in the UI-Thread context! */
virtual tresult PLUGIN_API performEdit (ParamID id, ParamValue valueNormalized) = 0; virtual tresult PLUGIN_API performEdit (ParamID id, ParamValue valueNormalized) = 0;


/** To be called after calling a performEdit (e.g. on mouse-click-up event). */
/** To be called after calling a performEdit (e.g. on mouse-click-up event).
This must be called in the UI-Thread context! */
virtual tresult PLUGIN_API endEdit (ParamID id) = 0; virtual tresult PLUGIN_API endEdit (ParamID id) = 0;


/** Instructs host to restart the component. This should be called in the UI-Thread context!
/** Instructs host to restart the component. This must be called in the UI-Thread context!
\param flags is a combination of RestartFlags */ \param flags is a combination of RestartFlags */
virtual tresult PLUGIN_API restartComponent (int32 flags) = 0; virtual tresult PLUGIN_API restartComponent (int32 flags) = 0;


@@ -130,7 +188,7 @@ public:
DECLARE_CLASS_IID (IComponentHandler, 0x93A0BEA3, 0x0BD045DB, 0x8E890B0C, 0xC1E46AC6) DECLARE_CLASS_IID (IComponentHandler, 0x93A0BEA3, 0x0BD045DB, 0x8E890B0C, 0xC1E46AC6)


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Extended Host callback interface IComponentHandler2 for an edit controller
/** Extended host callback interface for an edit controller: Vst::IComponentHandler2
\ingroup vstIHost vst310 \ingroup vstIHost vst310
- [host imp] - [host imp]
- [extends IComponentHandler] - [extends IComponentHandler]
@@ -138,63 +196,64 @@ DECLARE_CLASS_IID (IComponentHandler, 0x93A0BEA3, 0x0BD045DB, 0x8E890B0C, 0xC1E4
- [optional] - [optional]


One part handles: One part handles:
- Setting dirty state of Plug-in
- requesting the host to open the editor
- Setting dirty state of the plug-in
- Requesting the host to open the editor


The other part handles parameter group editing from Plug-in UI. It wraps a set of \ref IComponentHandler::beginEdit /
\ref IComponentHandler::performEdit / \ref IComponentHandler::endEdit functions (see \ref IComponentHandler)
The other part handles parameter group editing from the plug-in UI. It wraps a set of \ref IComponentHandler::beginEdit /
\ref Steinberg::Vst::IComponentHandler::performEdit / \ref Steinberg::Vst::IComponentHandler::endEdit functions (see \ref IComponentHandler)
which should use the same timestamp in the host when writing automation. which should use the same timestamp in the host when writing automation.
This allows for better synchronizing multiple parameter changes at once.
This allows for better synchronizing of multiple parameter changes at once.


\section IComponentHandler2Example Examples of different use cases \section IComponentHandler2Example Examples of different use cases
\code
//--------------------------------------
// in case of multiple switch buttons (with associated ParamID 1 and 3)
// on mouse down :
hostHandler2->startGroupEdit ();
hostHandler->beginEdit (1);
hostHandler->beginEdit (3);
hostHandler->performEdit (1, 1.0);
hostHandler->performEdit (3, 0.0); // the opposite of paramID 1 for example
....
// on mouse up :
hostHandler->endEdit (1);
hostHandler->endEdit (3);
hostHandler2->finishGroupEdit ();
....
....
//--------------------------------------
// in case of multiple faders (with associated ParamID 1 and 3)
// on mouse down :
hostHandler2->startGroupEdit ();
hostHandler->beginEdit (1);
hostHandler->beginEdit (3);
hostHandler2->finishGroupEdit ();
....
// on mouse move :
hostHandler2->startGroupEdit ();
hostHandler->performEdit (1, x); // x the wanted value
hostHandler->performEdit (3, x);
hostHandler2->finishGroupEdit ();
....
// on mouse up :
hostHandler2->startGroupEdit ();
hostHandler->endEdit (1);
hostHandler->endEdit (3);
hostHandler2->finishGroupEdit ();

\code{.cpp}
//--------------------------------------
// we are in the editcontroller...
// in case of multiple switch buttons (with associated ParamID 1 and 3)
// on mouse down :
hostHandler2->startGroupEdit ();
hostHandler->beginEdit (1);
hostHandler->beginEdit (3);
hostHandler->performEdit (1, 1.0);
hostHandler->performEdit (3, 0.0); // the opposite of paramID 1 for example
....
// on mouse up :
hostHandler->endEdit (1);
hostHandler->endEdit (3);
hostHandler2->finishGroupEdit ();
....
....
//--------------------------------------
// in case of multiple faders (with associated ParamID 1 and 3)
// on mouse down :
hostHandler2->startGroupEdit ();
hostHandler->beginEdit (1);
hostHandler->beginEdit (3);
hostHandler2->finishGroupEdit ();
....
// on mouse move :
hostHandler2->startGroupEdit ();
hostHandler->performEdit (1, x); // x the wanted value
hostHandler->performEdit (3, x);
hostHandler2->finishGroupEdit ();
....
// on mouse up :
hostHandler2->startGroupEdit ();
hostHandler->endEdit (1);
hostHandler->endEdit (3);
hostHandler2->finishGroupEdit ();
\endcode \endcode
\see IComponentHandler
\see IEditController*/
//------------------------------------------------------------------------
class IComponentHandler2: public FUnknown
\see \ref IComponentHandler, \ref IEditController
*/
class IComponentHandler2 : public FUnknown
{ {
public: public:
//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Tells host that the Plug-in is dirty (something besides parameters has changed since last save),
/** Tells host that the plug-in is dirty (something besides parameters has changed since last save),
if true the host should apply a save before quitting. */ if true the host should apply a save before quitting. */
virtual tresult PLUGIN_API setDirty (TBool state) = 0; virtual tresult PLUGIN_API setDirty (TBool state) = 0;


/** Tells host that it should open the Plug-in editor the next time it's possible.
/** Tells host that it should open the plug-in editor the next time it's possible.
You should use this instead of showing an alert and blocking the program flow (especially on loading projects). */ You should use this instead of showing an alert and blocking the program flow (especially on loading projects). */
virtual tresult PLUGIN_API requestOpenEditor (FIDString name = ViewType::kEditor) = 0; virtual tresult PLUGIN_API requestOpenEditor (FIDString name = ViewType::kEditor) = 0;


@@ -214,24 +273,33 @@ public:
DECLARE_CLASS_IID (IComponentHandler2, 0xF040B4B3, 0xA36045EC, 0xABCDC045, 0xB4D5A2CC) DECLARE_CLASS_IID (IComponentHandler2, 0xF040B4B3, 0xA36045EC, 0xABCDC045, 0xB4D5A2CC)


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Extended Host callback interface IComponentHandlerBusActivation for an edit controller.
/** Extended host callback interface for an edit controller: Vst::IComponentHandlerBusActivation
\ingroup vstIHost vst368 \ingroup vstIHost vst368
- [host imp] - [host imp]
- [extends IComponentHandler] - [extends IComponentHandler]
- [released: 3.6.8] - [released: 3.6.8]
- [optional] - [optional]


Allows the Plug-in to request the host to activate or deactivate a specific bus,
if the host accepts it will call later on IComponent::activateBus (see \ref IComponent::activateBus).
Useful especially for Instrument with more than 1 outputs, where the user could request
from the Plug-in UI a given output bus activation.
Allows the plug-in to request the host to activate or deactivate a specific bus.
If the host accepts this request, it will call later on \ref IComponent::activateBus.
This is particularly useful for instruments with more than 1 outputs, where the user could request
from the plug-in UI a given output bus activation.


\see \ref IComponentHandler */
//------------------------------------------------------------------------
\code{.cpp}
// somewhere in your code when you need to inform the host to enable a specific Bus.
FUnknownPtr<IComponentHandlerBusActivation> busActivation (componentHandler);
if (busActivation)
{
// here we want to activate our audio input sidechain (the 2cd input bus: index 1)
busActivation->requestBusActivation (kAudio, kInput, 1, true);
}
\endcode
\see \ref IComponentHandler
*/
class IComponentHandlerBusActivation : public FUnknown class IComponentHandlerBusActivation : public FUnknown
{ {
public: public:
//------------------------------------------------------------------------
//------------------------------------------------------------------------
/** request the host to activate or deactivate a specific bus. */ /** request the host to activate or deactivate a specific bus. */
virtual tresult PLUGIN_API requestBusActivation (MediaType type, BusDirection dir, int32 index, virtual tresult PLUGIN_API requestBusActivation (MediaType type, BusDirection dir, int32 index,
TBool state) = 0; TBool state) = 0;
@@ -243,16 +311,84 @@ public:
DECLARE_CLASS_IID (IComponentHandlerBusActivation, 0x067D02C1, 0x5B4E274D, 0xA92D90FD, 0x6EAF7240) DECLARE_CLASS_IID (IComponentHandlerBusActivation, 0x067D02C1, 0x5B4E274D, 0xA92D90FD, 0x6EAF7240)


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Edit controller component interface.
/** Extended host callback interface for an edit controller: Vst::IProgress
\ingroup vstIHost vst370
- [host imp]
- [extends IComponentHandler]
- [released: 3.7.0]
- [optional]

Allows the plug-in to request the host to create a progress for some specific tasks which take
some time. The host can visualize the progress as read-only UI elements. For example,
after loading a project where a plug-in needs to load extra
data (e.g. samples) in a background thread, this enables the host to get and visualize the current status of the loading
progress and to inform the user when the loading is finished.
Note: During the progress, the host can unload the plug-in at any time. Make sure that the plug-in
supports this use case.

\section IProgressExample Example

\code{.cpp}
//--------------------------------------
// we are in the editcontroller:
// as member: IProgress::ID mProgressID;

FUnknownPtr<IProgress> progress (componentHandler);
if (progress)
progress->start (IProgress::ProgressType::UIBackgroundTask, STR ("Load Samples..."), mProgressID);

// ...
myProgressValue += incProgressStep;
FUnknownPtr<IProgress> progress (componentHandler);
if (progress)
progress->update (mProgressID, myProgressValue);

// ...
FUnknownPtr<IProgress> progress (componentHandler);
if (progress)
progress->finish (mProgressID);
\endcode

\see \ref IComponentHandler
*/
class IProgress : public FUnknown
{
public:
//------------------------------------------------------------------------
enum ProgressType : uint32
{
AsyncStateRestoration = 0, ///< plug-in state is restored async (in a background Thread)
UIBackgroundTask ///< a plug-in task triggered by a UI action
};

using ID = uint64;

/** Start a new progress of a given type and optional Description. outID is as ID created by the
* host to identify this newly created progress (for update and finish method) */
virtual tresult PLUGIN_API start (ProgressType type, const tchar* optionalDescription,
ID& outID) = 0;
/** Update the progress value (normValue between [0, 1]) associated to the given id */
virtual tresult PLUGIN_API update (ID id, ParamValue normValue) = 0;
/** Finish the progress associated to the given id */
virtual tresult PLUGIN_API finish (ID id) = 0;

//------------------------------------------------------------------------
static const FUID iid;
};

DECLARE_CLASS_IID (IProgress, 0x00C9DC5B, 0x9D904254, 0x91A388C8, 0xB4E91B69)

//------------------------------------------------------------------------
/** Edit controller component interface: Vst::IEditController
\ingroup vstIPlug vst300 \ingroup vstIPlug vst300
- [plug imp] - [plug imp]
- [released: 3.0.0] - [released: 3.0.0]
- [mandatory] - [mandatory]


The Controller part of an effect or instrument with parameter handling (export, definition, conversion...).
\see IComponent::getControllerClassId, IMidiMapping */
//------------------------------------------------------------------------
class IEditController: public IPluginBase
The controller part of an effect or instrument with parameter handling (export, definition, conversion...).
\see \ref IComponent::getControllerClassId, \ref IMidiMapping
*/
class IEditController : public IPluginBase
{ {
public: public:
//------------------------------------------------------------------------ //------------------------------------------------------------------------
@@ -277,7 +413,7 @@ public:
virtual tresult PLUGIN_API getParamValueByString (ParamID id, TChar* string /*in*/, ParamValue& valueNormalized /*out*/) = 0; virtual tresult PLUGIN_API getParamValueByString (ParamID id, TChar* string /*in*/, ParamValue& valueNormalized /*out*/) = 0;


/** Returns for a given paramID and a normalized value its plain representation /** Returns for a given paramID and a normalized value its plain representation
(for example 90 for 90db - see \ref vst3AutomationIntro). */
(for example -6 for -6dB - see \ref vst3AutomationIntro). */
virtual ParamValue PLUGIN_API normalizedParamToPlain (ParamID id, ParamValue valueNormalized) = 0; virtual ParamValue PLUGIN_API normalizedParamToPlain (ParamID id, ParamValue valueNormalized) = 0;
/** Returns for a given paramID and a plain value its normalized value. (see \ref vst3AutomationIntro) */ /** Returns for a given paramID and a plain value its normalized value. (see \ref vst3AutomationIntro) */
virtual ParamValue PLUGIN_API plainParamToNormalized (ParamID id, ParamValue plainValue) = 0; virtual ParamValue PLUGIN_API plainParamToNormalized (ParamID id, ParamValue plainValue) = 0;
@@ -290,11 +426,12 @@ public:
virtual tresult PLUGIN_API setParamNormalized (ParamID id, ParamValue value) = 0; virtual tresult PLUGIN_API setParamNormalized (ParamID id, ParamValue value) = 0;


// handler ---------------------------- // handler ----------------------------
/** Gets from host a handler. */
/** Gets from host a handler which allows the Plugin-in to communicate with the host.
Note: This is mandatory if the host is using the IEditController! */
virtual tresult PLUGIN_API setComponentHandler (IComponentHandler* handler) = 0; virtual tresult PLUGIN_API setComponentHandler (IComponentHandler* handler) = 0;


// view ------------------------------- // view -------------------------------
/** Creates the editor view of the Plug-in, currently only "editor" is supported, see \ref ViewType.
/** Creates the editor view of the plug-in, currently only "editor" is supported, see \ref ViewType.
The life time of the editor view will never exceed the life time of this controller instance. */ The life time of the editor view will never exceed the life time of this controller instance. */
virtual IPlugView* PLUGIN_API createView (FIDString name) = 0; virtual IPlugView* PLUGIN_API createView (FIDString name) = 0;


@@ -306,7 +443,6 @@ DECLARE_CLASS_IID (IEditController, 0xDCD7BBE3, 0x7742448D, 0xA874AACC, 0x979C75


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Knob Mode */ /** Knob Mode */
//------------------------------------------------------------------------
enum KnobModes enum KnobModes
{ {
kCircularMode = 0, ///< Circular with jump to clicked position kCircularMode = 0, ///< Circular with jump to clicked position
@@ -314,33 +450,39 @@ enum KnobModes
kLinearMode ///< Linear: depending on vertical movement kLinearMode ///< Linear: depending on vertical movement
}; };


typedef int32 KnobMode; ///< Knob Mode
//------------------------------------------------------------------------
/** \defgroup vst3typedef VST 3 Data Types */
/*@{*/
//------------------------------------------------------------------------
/** Knob Mode Type */
typedef int32 KnobMode;
/*@}*/


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Edit controller component interface extension.
/** Edit controller component interface extension: Vst::IEditController2
\ingroup vstIPlug vst310 \ingroup vstIPlug vst310
- [plug imp] - [plug imp]
- [extends IEditController] - [extends IEditController]
- [released: 3.1.0] - [released: 3.1.0]
- [optional] - [optional]


Extension to inform the Plug-in about the host Knob Mode,
and to open the Plug-in about box or help documentation.
Extension to allow the host to inform the plug-in about the host Knob Mode,
and to open the plug-in about box or help documentation.


\see IEditController*/
//------------------------------------------------------------------------
class IEditController2: public FUnknown
\see \ref IEditController, \ref EditController
*/
class IEditController2 : public FUnknown
{ {
public: public:
/** Host could set the Knob Mode for the Plug-in. Return kResultFalse means not supported mode. \see KnobModes. */
/** Host could set the Knob Mode for the plug-in. Return kResultFalse means not supported mode. \see KnobModes. */
virtual tresult PLUGIN_API setKnobMode (KnobMode mode) = 0; virtual tresult PLUGIN_API setKnobMode (KnobMode mode) = 0;


/** Host could ask to open the Plug-in help (could be: opening a PDF document or link to a web page).
/** Host could ask to open the plug-in help (could be: opening a PDF document or link to a web page).
The host could call it with onlyCheck set to true for testing support of open Help. The host could call it with onlyCheck set to true for testing support of open Help.
Return kResultFalse means not supported function. */ Return kResultFalse means not supported function. */
virtual tresult PLUGIN_API openHelp (TBool onlyCheck) = 0; virtual tresult PLUGIN_API openHelp (TBool onlyCheck) = 0;


/** Host could ask to open the Plug-in about box.
/** Host could ask to open the plug-in about box.
The host could call it with onlyCheck set to true for testing support of open AboutBox. The host could call it with onlyCheck set to true for testing support of open AboutBox.
Return kResultFalse means not supported function. */ Return kResultFalse means not supported function. */
virtual tresult PLUGIN_API openAboutBox (TBool onlyCheck) = 0; virtual tresult PLUGIN_API openAboutBox (TBool onlyCheck) = 0;
@@ -352,7 +494,7 @@ public:
DECLARE_CLASS_IID (IEditController2, 0x7F4EFE59, 0xF3204967, 0xAC27A3AE, 0xAFB63038) DECLARE_CLASS_IID (IEditController2, 0x7F4EFE59, 0xF3204967, 0xAC27A3AE, 0xAFB63038)


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** MIDI Mapping Interface.
/** MIDI Mapping interface: Vst::IMidiMapping
\ingroup vstIPlug vst301 \ingroup vstIPlug vst301
- [plug imp] - [plug imp]
- [extends IEditController] - [extends IEditController]
@@ -362,20 +504,52 @@ DECLARE_CLASS_IID (IEditController2, 0x7F4EFE59, 0xF3204967, 0xAC27A3AE, 0xAFB63
MIDI controllers are not transmitted directly to a VST component. MIDI as hardware protocol has MIDI controllers are not transmitted directly to a VST component. MIDI as hardware protocol has
restrictions that can be avoided in software. Controller data in particular come along with unclear restrictions that can be avoided in software. Controller data in particular come along with unclear
and often ignored semantics. On top of this they can interfere with regular parameter automation and and often ignored semantics. On top of this they can interfere with regular parameter automation and
the host is unaware of what happens in the Plug-in when passing MIDI controllers directly.
the host is unaware of what happens in the plug-in when passing MIDI controllers directly.


So any functionality that is to be controlled by MIDI controllers must be exported as regular parameter. So any functionality that is to be controlled by MIDI controllers must be exported as regular parameter.
The host will transform incoming MIDI controller data using this interface and transmit them as normal
The host will transform incoming MIDI controller data using this interface and transmit them as regular
parameter change. This allows the host to automate them in the same way as other parameters. parameter change. This allows the host to automate them in the same way as other parameters.
CtrlNumber could be typical MIDI controller value extended to some others values like pitch bend or
after touch (see \ref ControllerNumbers).
If the mapping has changed, the Plug-in should call IComponentHandler::restartComponent (kMidiCCAssignmentChanged)
to inform the host about this change. */
//------------------------------------------------------------------------
class IMidiMapping: public FUnknown
CtrlNumber can be a typical MIDI controller value extended to some others values like pitchbend or
aftertouch (see \ref ControllerNumbers).
If the mapping has changed, the plug-in must call IComponentHandler::restartComponent (kMidiCCAssignmentChanged)
to inform the host about this change.

\section IMidiMappingExample Example

\code{.cpp}
//--------------------------------------
// in myeditcontroller.h
class MyEditController: public EditControllerEx1, public IMidiMapping
{ {
public:
//...
//---IMidiMapping---------------------------
tresult PLUGIN_API getMidiControllerAssignment (int32 busIndex, int16 channel, CtrlNumber midiControllerNumber, ParamID& id) SMTG_OVERRIDE;
//---Interface---------
OBJ_METHODS (MyEditController, EditControllerEx1)
DEFINE_INTERFACES
DEF_INTERFACE (IMidiMapping)
END_DEFINE_INTERFACES (MyEditController)
REFCOUNT_METHODS (MyEditController)
};

//--------------------------------------
// in myeditcontroller.cpp
tresult PLUGIN_API MyEditController::getMidiControllerAssignment (int32 busIndex, int16 midiChannel, CtrlNumber midiControllerNumber, ParamID& tag)
{
// for my first Event bus and for MIDI channel 0 and for MIDI CC Volume only
if (busIndex == 0 && midiChannel == 0 && midiControllerNumber == kCtrlVolume)
{
tag = kGainId;
return kResultTrue;
}
return kResultFalse;
}
\endcode


*/
class IMidiMapping : public FUnknown
{
public:
/** Gets an (preferred) associated ParamID for a given Input Event Bus index, channel and MIDI Controller. /** Gets an (preferred) associated ParamID for a given Input Event Bus index, channel and MIDI Controller.
* @param[in] busIndex - index of Input Event Bus * @param[in] busIndex - index of Input Event Bus
* @param[in] channel - channel of the bus * @param[in] channel - channel of the bus
@@ -392,24 +566,31 @@ public:
DECLARE_CLASS_IID (IMidiMapping, 0xDF0FF9F7, 0x49B74669, 0xB63AB732, 0x7ADBF5E5) DECLARE_CLASS_IID (IMidiMapping, 0xDF0FF9F7, 0x49B74669, 0xB63AB732, 0x7ADBF5E5)


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Parameter Editing from Host.
/** Parameter Editing from host: Vst::IEditControllerHostEditing
\ingroup vstIPlug vst350 \ingroup vstIPlug vst350
- [plug imp] - [plug imp]
- [extends IEditController] - [extends IEditController]
- [released: 3.5.0] - [released: 3.5.0]
- [optional] - [optional]


If this interface is implemented by the edit controller and when performing edits from outside
the Plug-in (host / remote) of a not automatable and not read only flagged parameter (kind of helper parameter),
If this interface is implemented by the edit controller, and when performing edits from outside
the plug-in (host / remote) of a not automatable and not read-only, and not hidden flagged parameter (kind of helper parameter),
the host will start with a beginEditFromHost before calling setParamNormalized and end with an endEditFromHost. the host will start with a beginEditFromHost before calling setParamNormalized and end with an endEditFromHost.
Here the sequencing, the host will call:
- beginEditFromHost ()
- setParamNormalized ()
- setParamNormalized ()
- ...
- endEditFromHost ()
\see IEditController */
Here the sequence that the host will call:

\section IEditControllerExample Example

\code{.cpp}
//------------------------------------------------------------------------ //------------------------------------------------------------------------
plugEditController->beginEditFromHost (id);
plugEditController->setParamNormalized (id, value);
plugEditController->setParamNormalized (id, value + 0.1);
// ...
plugEditController->endEditFromHost (id);
\endcode

\see \ref IEditController
*/
class IEditControllerHostEditing : public FUnknown class IEditControllerHostEditing : public FUnknown
{ {
public: public:


+ 44
- 15
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivstevents.h View File

@@ -26,12 +26,24 @@
//------------------------------------------------------------------------ //------------------------------------------------------------------------
namespace Steinberg { namespace Steinberg {
namespace Vst { namespace Vst {

//------------------------------------------------------------------------
/** Reserved note identifier (noteId) range for a plug-in. Guaranteed not used by the host. */
enum NoteIDUserRange
{
kNoteIDUserRangeLowerBound = -10000,
kNoteIDUserRangeUpperBound = -1000,
};

//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Note-on event specific data. Used in \ref Event (union)*/
/** Note-on event specific data. Used in \ref Event (union)
\ingroup vstEventGrp
Pitch uses the twelve-tone equal temperament tuning (12-TET).
*/
struct NoteOnEvent struct NoteOnEvent
{ {
int16 channel; ///< channel index in event bus int16 channel; ///< channel index in event bus
int16 pitch; ///< range [0, 127] = [C-2, G8] with A3=440Hz
int16 pitch; ///< range [0, 127] = [C-2, G8] with A3=440Hz (12-TET: twelve-tone equal temperament)
float tuning; ///< 1.f = +1 cent, -1.f = -1 cent float tuning; ///< 1.f = +1 cent, -1.f = -1 cent
float velocity; ///< range [0.0, 1.0] float velocity; ///< range [0.0, 1.0]
int32 length; ///< in sample frames (optional, Note Off has to follow in any case!) int32 length; ///< in sample frames (optional, Note Off has to follow in any case!)
@@ -39,18 +51,22 @@ struct NoteOnEvent
}; };


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Note-off event specific data. Used in \ref Event (union)*/
/** Note-off event specific data. Used in \ref Event (union)
\ingroup vstEventGrp
*/
struct NoteOffEvent struct NoteOffEvent
{ {
int16 channel; ///< channel index in event bus int16 channel; ///< channel index in event bus
int16 pitch; ///< range [0, 127] = [C-2, G8] with A3=440Hz
int16 pitch; ///< range [0, 127] = [C-2, G8] with A3=440Hz (12-TET)
float velocity; ///< range [0.0, 1.0] float velocity; ///< range [0.0, 1.0]
int32 noteId; ///< associated noteOn identifier (if not available then -1) int32 noteId; ///< associated noteOn identifier (if not available then -1)
float tuning; ///< 1.f = +1 cent, -1.f = -1 cent float tuning; ///< 1.f = +1 cent, -1.f = -1 cent
}; };


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Data event specific data. Used in \ref Event (union)*/
/** Data event specific data. Used in \ref Event (union)
\ingroup vstEventGrp
*/
struct DataEvent struct DataEvent
{ {
uint32 size; ///< size in bytes of the data block bytes uint32 size; ///< size in bytes of the data block bytes
@@ -65,7 +81,9 @@ struct DataEvent
}; };


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** PolyPressure event specific data. Used in \ref Event (union)*/
/** PolyPressure event specific data. Used in \ref Event (union)
\ingroup vstEventGrp
*/
struct PolyPressureEvent struct PolyPressureEvent
{ {
int16 channel; ///< channel index in event bus int16 channel; ///< channel index in event bus
@@ -75,7 +93,9 @@ struct PolyPressureEvent
}; };


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Chord event specific data. Used in \ref Event (union)*/
/** Chord event specific data. Used in \ref Event (union)
\ingroup vstEventGrp
*/
struct ChordEvent struct ChordEvent
{ {
int16 root; ///< range [0, 127] = [C-2, G8] with A3=440Hz int16 root; ///< range [0, 127] = [C-2, G8] with A3=440Hz
@@ -87,7 +107,9 @@ struct ChordEvent
}; };


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Scale event specific data. Used in \ref Event (union)*/
/** Scale event specific data. Used in \ref Event (union)
\ingroup vstEventGrp
*/
struct ScaleEvent struct ScaleEvent
{ {
int16 root; ///< range [0, 127] = root Note/Transpose Factor int16 root; ///< range [0, 127] = root Note/Transpose Factor
@@ -98,7 +120,12 @@ struct ScaleEvent
}; };


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Legacy MIDI CC Out event specific data. Used in \ref Event (union)*/
/** Legacy MIDI CC Out event specific data. Used in \ref Event (union)
\ingroup vstEventGrp
- [released: 3.6.12]

This kind of event is reserved for generating MIDI CC as output event for kEvent Bus during the process call.
*/
struct LegacyMIDICCOutEvent struct LegacyMIDICCOutEvent
{ {
uint8 controlNumber;///< see enum ControllerNumbers [0, 255] uint8 controlNumber;///< see enum ControllerNumbers [0, 255]
@@ -108,8 +135,10 @@ struct LegacyMIDICCOutEvent
}; };


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Event */
//------------------------------------------------------------------------
/** Event
\ingroup vstEventGrp
Structure representing a single Event of different types associated to a specific event (\ref kEvent) bus.
*/
struct Event struct Event
{ {
int32 busIndex; ///< event bus index int32 busIndex; ///< event bus index
@@ -156,15 +185,15 @@ struct Event
}; };


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** List of events to process.
/** List of events to process: Vst::IEventList
\ingroup vstIHost vst300 \ingroup vstIHost vst300
- [host imp] - [host imp]
- [released: 3.0.0] - [released: 3.0.0]
- [mandatory] - [mandatory]


\see ProcessData, Event */
//------------------------------------------------------------------------
class IEventList: public FUnknown
\see ProcessData, Event
*/
class IEventList : public FUnknown
{ {
public: public:
//------------------------------------------------------------------------ //------------------------------------------------------------------------


+ 24
- 23
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivsthostapplication.h View File

@@ -21,17 +21,18 @@
//------------------------------------------------------------------------ //------------------------------------------------------------------------
namespace Steinberg { namespace Steinberg {
namespace Vst { namespace Vst {

//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Basic Host Callback Interface.
/** Basic host callback interface: Vst::IHostApplication
\ingroup vstIHost vst300 \ingroup vstIHost vst300
- [host imp] - [host imp]
- [passed as 'context' in to IPluginBase::initialize () ] - [passed as 'context' in to IPluginBase::initialize () ]
- [released: 3.0.0] - [released: 3.0.0]
- [mandatory] - [mandatory]


Basic VST host application interface. */
//------------------------------------------------------------------------
class IHostApplication: public FUnknown
Basic VST host application interface.
*/
class IHostApplication : public FUnknown
{ {
public: public:
//------------------------------------------------------------------------ //------------------------------------------------------------------------
@@ -48,28 +49,29 @@ public:
DECLARE_CLASS_IID (IHostApplication, 0x58E595CC, 0xDB2D4969, 0x8B6AAF8C, 0x36A664E5) DECLARE_CLASS_IID (IHostApplication, 0x58E595CC, 0xDB2D4969, 0x8B6AAF8C, 0x36A664E5)


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Helper to allocate a message */
inline IMessage* allocateMessage (IHostApplication* host) inline IMessage* allocateMessage (IHostApplication* host)
{ {
TUID iid; TUID iid;
IMessage::iid.toTUID (iid); IMessage::iid.toTUID (iid);
IMessage* m = 0;
IMessage* m = nullptr;
if (host->createInstance (iid, iid, (void**)&m) == kResultOk) if (host->createInstance (iid, iid, (void**)&m) == kResultOk)
return m; return m;
return 0;
return nullptr;
} }


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** VST 3 to VST 2 Wrapper Interface.
/** VST 3 to VST 2 Wrapper interface: Vst::IVst3ToVst2Wrapper
\ingroup vstIHost vst310 \ingroup vstIHost vst310
- [host imp] - [host imp]
- [passed as 'context' to IPluginBase::initialize () ] - [passed as 'context' to IPluginBase::initialize () ]
- [released: 3.1.0] - [released: 3.1.0]
- [mandatory] - [mandatory]


Informs the Plug-in that a VST 3 to VST 2 wrapper is used between the Plug-in and the real host.
Implemented by the VST 2 Wrapper. */
//------------------------------------------------------------------------
class IVst3ToVst2Wrapper: public FUnknown
Informs the plug-in that a VST 3 to VST 2 wrapper is used between the plug-in and the real host.
Implemented by the VST 2 Wrapper.
*/
class IVst3ToVst2Wrapper : public FUnknown
{ {
public: public:
//------------------------------------------------------------------------ //------------------------------------------------------------------------
@@ -79,17 +81,17 @@ public:
DECLARE_CLASS_IID (IVst3ToVst2Wrapper, 0x29633AEC, 0x1D1C47E2, 0xBB85B97B, 0xD36EAC61) DECLARE_CLASS_IID (IVst3ToVst2Wrapper, 0x29633AEC, 0x1D1C47E2, 0xBB85B97B, 0xD36EAC61)


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** VST 3 to AU Wrapper Interface.
/** VST 3 to AU Wrapper interface: Vst::IVst3ToAUWrapper
\ingroup vstIHost vst310 \ingroup vstIHost vst310
- [host imp] - [host imp]
- [passed as 'context' to IPluginBase::initialize () ] - [passed as 'context' to IPluginBase::initialize () ]
- [released: 3.1.0] - [released: 3.1.0]
- [mandatory] - [mandatory]


Informs the Plug-in that a VST 3 to AU wrapper is used between the Plug-in and the real host.
Implemented by the AU Wrapper. */
//------------------------------------------------------------------------
class IVst3ToAUWrapper: public FUnknown
Informs the plug-in that a VST 3 to AU wrapper is used between the plug-in and the real host.
Implemented by the AU Wrapper.
*/
class IVst3ToAUWrapper : public FUnknown
{ {
public: public:
//------------------------------------------------------------------------ //------------------------------------------------------------------------
@@ -99,16 +101,16 @@ public:
DECLARE_CLASS_IID (IVst3ToAUWrapper, 0xA3B8C6C5, 0xC0954688, 0xB0916F0B, 0xB697AA44) DECLARE_CLASS_IID (IVst3ToAUWrapper, 0xA3B8C6C5, 0xC0954688, 0xB0916F0B, 0xB697AA44)


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** VST 3 to AAX Wrapper Interface.
/** VST 3 to AAX Wrapper interface: Vst::IVst3ToAAXWrapper
\ingroup vstIHost vst368 \ingroup vstIHost vst368
- [host imp] - [host imp]
- [passed as 'context' to IPluginBase::initialize () ] - [passed as 'context' to IPluginBase::initialize () ]
- [released: 3.6.8] - [released: 3.6.8]
- [mandatory] - [mandatory]


Informs the Plug-in that a VST 3 to AAX wrapper is used between the Plug-in and the real host.
Implemented by the AAX Wrapper. */
//------------------------------------------------------------------------
Informs the plug-in that a VST 3 to AAX wrapper is used between the plug-in and the real host.
Implemented by the AAX Wrapper.
*/
class IVst3ToAAXWrapper : public FUnknown class IVst3ToAAXWrapper : public FUnknown
{ {
public: public:
@@ -118,7 +120,7 @@ public:
DECLARE_CLASS_IID (IVst3ToAAXWrapper, 0x6D319DC6, 0x60C56242, 0xB32C951B, 0x93BEF4C6) DECLARE_CLASS_IID (IVst3ToAAXWrapper, 0x6D319DC6, 0x60C56242, 0xB32C951B, 0x93BEF4C6)


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Wrapper MPE Support Interface
/** Wrapper MPE Support interface: Vst::IVst3WrapperMPESupport
\ingroup vstIHost vst3612 \ingroup vstIHost vst3612
- [host imp] - [host imp]
- [passed as 'context' to IPluginBase::initialize () ] - [passed as 'context' to IPluginBase::initialize () ]
@@ -127,13 +129,12 @@ DECLARE_CLASS_IID (IVst3ToAAXWrapper, 0x6D319DC6, 0x60C56242, 0xB32C951B, 0x93BE


Implemented on wrappers that support MPE to Note Expression translation. Implemented on wrappers that support MPE to Note Expression translation.


Per default MPE input processing is enabled, the masterChannel will be zero, the memberBeginChannel
By default, MPE input processing is enabled, the masterChannel will be zero, the memberBeginChannel
will be one and the memberEndChannel will be 14. will be one and the memberEndChannel will be 14.


As MPE is a subset of the VST3 Note Expression feature, mapping from the three MPE expressions is As MPE is a subset of the VST3 Note Expression feature, mapping from the three MPE expressions is
handled via the INoteExpressionPhysicalUIMapping interface. handled via the INoteExpressionPhysicalUIMapping interface.
*/ */
//------------------------------------------------------------------------
class IVst3WrapperMPESupport : public FUnknown class IVst3WrapperMPESupport : public FUnknown
{ {
public: public:


+ 9
- 11
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivstinterappaudio.h View File

@@ -33,9 +33,9 @@ class IInterAppAudioPresetManager;
- [released: 3.6.0] - [released: 3.6.0]
- [optional] - [optional]


Implemented by the InterAppAudio Wrapper. */
//------------------------------------------------------------------------
class IInterAppAudioHost: public FUnknown
Implemented by the InterAppAudio Wrapper.
*/
class IInterAppAudioHost : public FUnknown
{ {
public: public:
/** get the size of the screen /** get the size of the screen
@@ -92,13 +92,12 @@ public:
DECLARE_CLASS_IID (IInterAppAudioHost, 0x0CE5743D, 0x68DF415E, 0xAE285BD4, 0xE2CDC8FD) DECLARE_CLASS_IID (IInterAppAudioHost, 0x0CE5743D, 0x68DF415E, 0xAE285BD4, 0xE2CDC8FD)


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Extended Plug-in interface IEditController for Inter-App Audio connection state change notifications
/** Extended plug-in interface IEditController for Inter-App Audio connection state change notifications
\ingroup vstIPlug vst360 \ingroup vstIPlug vst360
- [plug imp] - [plug imp]
- [extends IEditController] - [extends IEditController]
- [released: 3.6.0] - [released: 3.6.0]
*/ */
//------------------------------------------------------------------------
class IInterAppAudioConnectionNotification : public FUnknown class IInterAppAudioConnectionNotification : public FUnknown
{ {
public: public:
@@ -114,23 +113,22 @@ public:
DECLARE_CLASS_IID (IInterAppAudioConnectionNotification, 0x6020C72D, 0x5FC24AA1, 0xB0950DB5, 0xD7D6D5CF) DECLARE_CLASS_IID (IInterAppAudioConnectionNotification, 0x6020C72D, 0x5FC24AA1, 0xB0950DB5, 0xD7D6D5CF)


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Extended Plug-in interface IEditController for Inter-App Audio Preset Management
/** Extended plug-in interface IEditController for Inter-App Audio Preset Management
\ingroup vstIPlug vst360 \ingroup vstIPlug vst360
- [plug imp] - [plug imp]
- [extends IEditController] - [extends IEditController]
- [released: 3.6.0] - [released: 3.6.0]
*/ */
//------------------------------------------------------------------------
class IInterAppAudioPresetManager : public FUnknown class IInterAppAudioPresetManager : public FUnknown
{ {
public: public:
/** TODO */
/** Open the Preset Browser in order to load a preset */
virtual tresult PLUGIN_API runLoadPresetBrowser () = 0; virtual tresult PLUGIN_API runLoadPresetBrowser () = 0;
/** TODO */
/** Open the Preset Browser in order to save a preset */
virtual tresult PLUGIN_API runSavePresetBrowser () = 0; virtual tresult PLUGIN_API runSavePresetBrowser () = 0;
/** TODO */
/** Load the next available preset */
virtual tresult PLUGIN_API loadNextPreset () = 0; virtual tresult PLUGIN_API loadNextPreset () = 0;
/** TODO */
/** Load the previous available preset */
virtual tresult PLUGIN_API loadPreviousPreset () = 0; virtual tresult PLUGIN_API loadPreviousPreset () = 0;


//------------------------------------------------------------------------ //------------------------------------------------------------------------


+ 10
- 9
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivstmessage.h View File

@@ -25,18 +25,19 @@
//------------------------------------------------------------------------ //------------------------------------------------------------------------
namespace Steinberg { namespace Steinberg {
namespace Vst { namespace Vst {

//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Private Plug-in message.
/** Private plug-in message: Vst::IMessage
\ingroup vstIHost vst300 \ingroup vstIHost vst300
- [host imp] - [host imp]
- [create via IHostApplication::createInstance] - [create via IHostApplication::createInstance]
- [released: 3.0.0] - [released: 3.0.0]
- [mandatory] - [mandatory]


Messages are sent from a VST-controller component to a VST-editor component and vice versa.
\see IAttributeList, IConnectionPoint, \ref vst3Communication */
//------------------------------------------------------------------------
class IMessage: public FUnknown
Messages are sent from a VST controller component to a VST editor component and vice versa.
\see IAttributeList, IConnectionPoint, \ref vst3Communication
*/
class IMessage : public FUnknown
{ {
public: public:
//------------------------------------------------------------------------ //------------------------------------------------------------------------
@@ -56,7 +57,7 @@ public:
DECLARE_CLASS_IID (IMessage, 0x936F033B, 0xC6C047DB, 0xBB0882F8, 0x13C1E613) DECLARE_CLASS_IID (IMessage, 0x936F033B, 0xC6C047DB, 0xBB0882F8, 0x13C1E613)


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Connect a component with another one.
/** Connect a component with another one: Vst::IConnectionPoint
\ingroup vstIPlug vst300 \ingroup vstIPlug vst300
- [plug imp] - [plug imp]
- [host imp] - [host imp]
@@ -66,9 +67,9 @@ DECLARE_CLASS_IID (IMessage, 0x936F033B, 0xC6C047DB, 0xBB0882F8, 0x13C1E613)
This interface is used for the communication of separate components. This interface is used for the communication of separate components.
Note that some hosts will place a proxy object between the components so that they are not directly connected. Note that some hosts will place a proxy object between the components so that they are not directly connected.


\see \ref vst3Communication*/
//------------------------------------------------------------------------
class IConnectionPoint: public FUnknown
\see \ref vst3Communication
*/
class IConnectionPoint : public FUnknown
{ {
public: public:
//------------------------------------------------------------------------ //------------------------------------------------------------------------


+ 7
- 7
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivstmidicontrollers.h View File

@@ -19,9 +19,9 @@
//------------------------------------------------------------------------ //------------------------------------------------------------------------
namespace Steinberg { namespace Steinberg {
namespace Vst { namespace Vst {

//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Controller Numbers (MIDI) */ /** Controller Numbers (MIDI) */
//------------------------------------------------------------------------
enum ControllerNumbers enum ControllerNumbers
{ {
kCtrlBankSelectMSB = 0, ///< Bank Select MSB kCtrlBankSelectMSB = 0, ///< Bank Select MSB
@@ -78,10 +78,10 @@ enum ControllerNumbers


//---Effect Controllers--- //---Effect Controllers---
kCtrlEff1Depth = 91, ///< Effect 1 Depth (Reverb Send Level) kCtrlEff1Depth = 91, ///< Effect 1 Depth (Reverb Send Level)
kCtrlEff2Depth = 92, ///< Effect 2 Depth
kCtrlEff2Depth = 92, ///< Effect 2 Depth (Tremolo Level)
kCtrlEff3Depth = 93, ///< Effect 3 Depth (Chorus Send Level) kCtrlEff3Depth = 93, ///< Effect 3 Depth (Chorus Send Level)
kCtrlEff4Depth = 94, ///< Effect 4 Depth (Delay/Variation Level)
kCtrlEff5Depth = 95, ///< Effect 5 Depth
kCtrlEff4Depth = 94, ///< Effect 4 Depth (Delay/Variation/Detune Level)
kCtrlEff5Depth = 95, ///< Effect 5 Depth (Phaser Level)


kCtrlDataIncrement = 96, ///< Data Increment (+1) kCtrlDataIncrement = 96, ///< Data Increment (+1)
kCtrlDataDecrement = 97, ///< Data Decrement (-1) kCtrlDataDecrement = 97, ///< Data Decrement (-1)
@@ -101,14 +101,14 @@ enum ControllerNumbers
kCtrlPolyModeOn = 127, ///< Poly Mode On kCtrlPolyModeOn = 127, ///< Poly Mode On


//---Extra-------------------------- //---Extra--------------------------
kAfterTouch = 128, ///< After Touch
kPitchBend = 129, ///< Pitch Bend
kAfterTouch = 128, ///< After Touch (associated to Channel Pressure)
kPitchBend = 129, ///< Pitch Bend Change


kCountCtrlNumber, ///< Count of Controller Number kCountCtrlNumber, ///< Count of Controller Number


//---Extra for kLegacyMIDICCOutEvent- //---Extra for kLegacyMIDICCOutEvent-
kCtrlProgramChange = 130, ///< Program Change (use LegacyMIDICCOutEvent.value only) kCtrlProgramChange = 130, ///< Program Change (use LegacyMIDICCOutEvent.value only)
kCtrlPolyPressure = 131, ///< Poly Pressure (use LegacyMIDICCOutEvent.value for pitch and
kCtrlPolyPressure = 131, ///< Polyphonic Key Pressure (use LegacyMIDICCOutEvent.value for pitch and
/// LegacyMIDICCOutEvent.value2 for pressure) /// LegacyMIDICCOutEvent.value2 for pressure)
kCtrlQuarterFrame = 132 ///< Quarter Frame ((use LegacyMIDICCOutEvent.value only) kCtrlQuarterFrame = 132 ///< Quarter Frame ((use LegacyMIDICCOutEvent.value only)
}; };


+ 52
- 3
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivstmidilearn.h View File

@@ -24,7 +24,7 @@ namespace Steinberg {
namespace Vst { namespace Vst {


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** MIDI Learn Interface.
/** MIDI Learn interface: Vst::IMidiLearn
\ingroup vstIPlug vst3612 \ingroup vstIPlug vst3612
- [plug imp] - [plug imp]
- [extends IEditController] - [extends IEditController]
@@ -32,12 +32,61 @@ namespace Vst {
- [optional] - [optional]


If this interface is implemented by the edit controller, the host will call this method whenever If this interface is implemented by the edit controller, the host will call this method whenever
there is live MIDI-CC input for the plug-in. This way the plug-in can change it's MIDI-CC parameter
there is live MIDI-CC input for the plug-in. This way, the plug-in can change its MIDI-CC parameter
mapping and inform the host via the IComponentHandler::restartComponent with the mapping and inform the host via the IComponentHandler::restartComponent with the
kMidiCCAssignmentChanged flag. kMidiCCAssignmentChanged flag.
Use this if you want to implement custom MIDI-Learn functionality in your plug-in. Use this if you want to implement custom MIDI-Learn functionality in your plug-in.
*/

\code{.cpp}
//------------------------------------------------
// in MyController class declaration
class MyController : public Vst::EditController, public Vst::IMidiLearn
{
// ...
//--- IMidiLearn ---------------------------------
tresult PLUGIN_API onLiveMIDIControllerInput (int32 busIndex, int16 channel,
CtrlNumber midiCC) SMTG_OVERRIDE;
// ...

OBJ_METHODS (MyController, Vst::EditController)
DEFINE_INTERFACES
// ...
DEF_INTERFACE (Vst::IMidiLearn)
END_DEFINE_INTERFACES (Vst::EditController)
//...
}

//------------------------------------------------
// in mycontroller.cpp
#include "pluginterfaces/vst/ivstmidilearn.h

namespace Steinberg {
namespace Vst {
DEF_CLASS_IID (IMidiLearn)
}
}

//------------------------------------------------------------------------ //------------------------------------------------------------------------
tresult PLUGIN_API MyController::onLiveMIDIControllerInput (int32 busIndex,
int16 channel, CtrlNumber midiCC)
{
// if we are not in doMIDILearn (triggered by a UI button for example)
// or wrong channel then return
if (!doMIDILearn || busIndex != 0 || channel != 0 || midiLearnParamID == InvalidParamID)
return kResultFalse;

// adapt our internal MIDICC -> parameterID mapping
midiCCMapping[midiCC] = midiLearnParamID;

// new mapping then inform the host that our MIDI assignment has changed
if (auto componentHandler = getComponentHandler ())
{
componentHandler->restartComponent (kMidiCCAssignmentChanged);
}
return kResultTrue;
}
\endcode
*/
class IMidiLearn : public FUnknown class IMidiLearn : public FUnknown
{ {
public: public:


+ 41
- 37
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivstnoteexpression.h View File

@@ -17,16 +17,25 @@
#pragma once #pragma once


#include "pluginterfaces/base/funknown.h" #include "pluginterfaces/base/funknown.h"
#include "vsttypes.h"
#include "pluginterfaces/vst/vsttypes.h"


//------------------------------------------------------------------------ //------------------------------------------------------------------------
#include "pluginterfaces/base/falignpush.h" #include "pluginterfaces/base/falignpush.h"
//------------------------------------------------------------------------ //------------------------------------------------------------------------


//------------------------------------------------------------------------
namespace Steinberg { namespace Steinberg {
namespace Vst { namespace Vst {

//------------------------------------------------------------------------
/** \defgroup vst3typedef VST 3 Data Types */
/*@{*/
//------------------------------------------------------------------------
/** Note Expression Types */
typedef uint32 NoteExpressionTypeID; typedef uint32 NoteExpressionTypeID;
/** Note Expression Value */
typedef double NoteExpressionValue; typedef double NoteExpressionValue;
/*@}*/


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** NoteExpressionTypeIDs describes the type of the note expression. /** NoteExpressionTypeIDs describes the type of the note expression.
@@ -44,13 +53,13 @@ enum NoteExpressionTypeIDs : uint32
kVibratoTypeID, ///< Vibrato kVibratoTypeID, ///< Vibrato
kExpressionTypeID, ///< Expression kExpressionTypeID, ///< Expression
kBrightnessTypeID, ///< Brightness kBrightnessTypeID, ///< Brightness
kTextTypeID, ///< TODO:
kTextTypeID, ///< See NoteExpressionTextEvent
kPhonemeTypeID, ///< TODO: kPhonemeTypeID, ///< TODO:


kCustomStart = 100000, ///< start of custom note expression type ids kCustomStart = 100000, ///< start of custom note expression type ids
kCustomEnd = 200000, ///< end of custom note expression type ids kCustomEnd = 200000, ///< end of custom note expression type ids
kInvalidTypeID = 0xFFFFFFFF ///< indicates an invalid note expression type
kInvalidTypeID = 0xFFFFFFFF ///< indicates an invalid note expression type
}; };


//------------------------------------------------------------------------ //------------------------------------------------------------------------
@@ -60,13 +69,12 @@ This structure is part of the NoteExpressionTypeInfo structure, it describes for
and a stepCount when the given NoteExpressionTypeID is limited to discrete values (like on/off state). and a stepCount when the given NoteExpressionTypeID is limited to discrete values (like on/off state).
\see NoteExpressionTypeInfo \see NoteExpressionTypeInfo
*/ */
//------------------------------------------------------------------------
struct NoteExpressionValueDescription struct NoteExpressionValueDescription
{ {
NoteExpressionValue defaultValue; ///< default normalized value [0,1]
NoteExpressionValue minimum; ///< minimum normalized value [0,1]
NoteExpressionValue maximum; ///< maximum normalized value [0,1]
int32 stepCount; ///< number of discrete steps (0: continuous, 1: toggle, discrete value otherwise - see \ref vst3parameterIntro)
NoteExpressionValue defaultValue; ///< default normalized value [0,1]
NoteExpressionValue minimum; ///< minimum normalized value [0,1]
NoteExpressionValue maximum; ///< maximum normalized value [0,1]
int32 stepCount; ///< number of discrete steps (0: continuous, 1: toggle, discrete value otherwise - see \ref vst3ParameterIntro)
}; };


#if SMTG_OS_WINDOWS && !SMTG_PLATFORM_64 #if SMTG_OS_WINDOWS && !SMTG_PLATFORM_64
@@ -75,13 +83,12 @@ struct NoteExpressionValueDescription
//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Note Expression Value event. Used in \ref Event (union) /** Note Expression Value event. Used in \ref Event (union)
A note expression event affects one single playing note (referring its noteId). A note expression event affects one single playing note (referring its noteId).
This kind of event is send from host to the Plug-in like other events (NoteOnEvent, NoteOffEvent,...) in \ref ProcessData during the process call.
This kind of event is send from host to the plug-in like other events (NoteOnEvent, NoteOffEvent,...) in \ref ProcessData during the process call.
Note expression events for a specific noteId can only occur after a NoteOnEvent. The host must take care that the event list (\ref IEventList) is properly sorted. Note expression events for a specific noteId can only occur after a NoteOnEvent. The host must take care that the event list (\ref IEventList) is properly sorted.
Expression events are always absolute normalized values [0.0, 1.0]. Expression events are always absolute normalized values [0.0, 1.0].
The predefined types have a predefined mapping of the normalized values (see \ref NoteExpressionTypeIDs) The predefined types have a predefined mapping of the normalized values (see \ref NoteExpressionTypeIDs)
\sa INoteExpressionController \sa INoteExpressionController
*/ */
//------------------------------------------------------------------------
struct NoteExpressionValueEvent struct NoteExpressionValueEvent
{ {
NoteExpressionTypeID typeId; ///< see \ref NoteExpressionTypeID NoteExpressionTypeID typeId; ///< see \ref NoteExpressionTypeID
@@ -94,8 +101,8 @@ struct NoteExpressionValueEvent
/** Note Expression Text event. Used in Event (union) /** Note Expression Text event. Used in Event (union)
A Expression event affects one single playing note. \sa INoteExpressionController A Expression event affects one single playing note. \sa INoteExpressionController


\see NoteExpressionTypeInfo*/
//------------------------------------------------------------------------
\see NoteExpressionTypeInfo
*/
struct NoteExpressionTextEvent struct NoteExpressionTextEvent
{ {
NoteExpressionTypeID typeId; ///< see \ref NoteExpressionTypeID (kTextTypeID or kPhoneticTypeID) NoteExpressionTypeID typeId; ///< see \ref NoteExpressionTypeID (kTextTypeID or kPhoneticTypeID)
@@ -112,18 +119,17 @@ struct NoteExpressionTextEvent
#endif #endif


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** NoteExpressionTypeInfo is the structure describing a note expression supported by the Plug-in.
/** NoteExpressionTypeInfo is the structure describing a note expression supported by the plug-in.
This structure is used by the method \ref INoteExpressionController::getNoteExpressionInfo. This structure is used by the method \ref INoteExpressionController::getNoteExpressionInfo.
\see INoteExpressionController \see INoteExpressionController
*/ */
//------------------------------------------------------------------------
struct NoteExpressionTypeInfo struct NoteExpressionTypeInfo
{ {
NoteExpressionTypeID typeId; ///< unique identifier of this note Expression type NoteExpressionTypeID typeId; ///< unique identifier of this note Expression type
String128 title; ///< note Expression type title (e.g. "Volume") String128 title; ///< note Expression type title (e.g. "Volume")
String128 shortTitle; ///< note Expression type short title (e.g. "Vol") String128 shortTitle; ///< note Expression type short title (e.g. "Vol")
String128 units; ///< note Expression type unit (e.g. "dB") String128 units; ///< note Expression type unit (e.g. "dB")
int32 unitId; ///< id of unit this NoteExpression belongs to (see \ref vst3UnitsIntro), in order to sort the note expression, it is possible to use unitId like for parameters. -1 means no unit used.
int32 unitId; ///< id of unit this NoteExpression belongs to (see \ref vst3Units), in order to sort the note expression, it is possible to use unitId like for parameters. -1 means no unit used.
NoteExpressionValueDescription valueDesc; ///< value description see \ref NoteExpressionValueDescription NoteExpressionValueDescription valueDesc; ///< value description see \ref NoteExpressionValueDescription
ParamID associatedParameterId; ///< optional associated parameter ID (for mapping from note expression to global (using the parameter automation for example) and back). Only used when kAssociatedParameterIDValid is set in flags. ParamID associatedParameterId; ///< optional associated parameter ID (for mapping from note expression to global (using the parameter automation for example) and back). Only used when kAssociatedParameterIDValid is set in flags.


@@ -138,14 +144,14 @@ struct NoteExpressionTypeInfo
}; };


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Extended Plug-in interface IEditController for note expression event support
/** Extended plug-in interface IEditController for note expression event support: Vst::INoteExpressionController
\ingroup vstIPlug vst350 \ingroup vstIPlug vst350
- [plug imp] - [plug imp]
- [extends IEditController] - [extends IEditController]
- [released: 3.5.0] - [released: 3.5.0]
- [optional] - [optional]


With this Plug-in interface, the host can retrieve all necessary note expression information supported by the Plug-in.
With this plug-in interface, the host can retrieve all necessary note expression information supported by the plug-in.
Note expression information (\ref NoteExpressionTypeInfo) are specific for given channel and event bus. Note expression information (\ref NoteExpressionTypeInfo) are specific for given channel and event bus.


Note that there is only one NoteExpressionTypeID per given channel of an event bus. Note that there is only one NoteExpressionTypeID per given channel of an event bus.
@@ -153,11 +159,10 @@ Note that there is only one NoteExpressionTypeID per given channel of an event b
The method getNoteExpressionStringByValue allows conversion from a normalized value to a string representation The method getNoteExpressionStringByValue allows conversion from a normalized value to a string representation
and the getNoteExpressionValueByString method from a string to a normalized value. and the getNoteExpressionValueByString method from a string to a normalized value.


When the note expression state changes (for example when switching presets) the Plug-in needs
When the note expression state changes (for example when switching presets) the plug-in needs
to inform the host about it via \ref IComponentHandler::restartComponent (kNoteExpressionChanged). to inform the host about it via \ref IComponentHandler::restartComponent (kNoteExpressionChanged).
*/ */
//------------------------------------------------------------------------
class INoteExpressionController: public FUnknown
class INoteExpressionController : public FUnknown
{ {
public: public:
/** Returns number of supported note change types for event bus index and channel. */ /** Returns number of supported note change types for event bus index and channel. */
@@ -185,10 +190,10 @@ DECLARE_CLASS_IID (INoteExpressionController, 0xB7F8F859, 0x41234872, 0x91169581
*/ */
enum KeyswitchTypeIDs : uint32 enum KeyswitchTypeIDs : uint32
{ {
kNoteOnKeyswitchTypeID = 0, ///< press before noteOn is played
kOnTheFlyKeyswitchTypeID, ///< press while noteOn is played
kOnReleaseKeyswitchTypeID, ///< press before entering release
kKeyRangeTypeID ///< key should be maintained pressed for playing
kNoteOnKeyswitchTypeID = 0, ///< press before noteOn is played
kOnTheFlyKeyswitchTypeID, ///< press while noteOn is played
kOnReleaseKeyswitchTypeID, ///< press before entering release
kKeyRangeTypeID ///< key should be maintained pressed for playing
}; };


typedef uint32 KeyswitchTypeID; typedef uint32 KeyswitchTypeID;
@@ -200,34 +205,33 @@ This structure is used by the method \ref IKeyswitchController::getKeyswitchInfo
*/ */
struct KeyswitchInfo struct KeyswitchInfo
{ {
KeyswitchTypeID typeId; ///< see KeyswitchTypeID
String128 title; ///< name of key switch (e.g. "Accentuation")
String128 shortTitle; ///< short title (e.g. "Acc")
KeyswitchTypeID typeId; ///< see KeyswitchTypeID
String128 title; ///< name of key switch (e.g. "Accentuation")
String128 shortTitle; ///< short title (e.g. "Acc")


int32 keyswitchMin; ///< associated main key switch min (value between [0, 127])
int32 keyswitchMax; ///< associated main key switch max (value between [0, 127])
int32 keyRemapped; /** optional remapped key switch (default -1), the Plug-in could provide one remapped
key for a key switch (allowing better location on the keyboard of the key switches) */
int32 keyswitchMin; ///< associated main key switch min (value between [0, 127])
int32 keyswitchMax; ///< associated main key switch max (value between [0, 127])
int32 keyRemapped; /** optional remapped key switch (default -1), the plug-in could provide one remapped
key for a key switch (allowing better location on the keyboard of the key switches) */


int32 unitId; ///< id of unit this key switch belongs to (see \ref vst3UnitsIntro), -1 means no unit used.
int32 unitId; ///< id of unit this key switch belongs to (see \ref vst3Units), -1 means no unit used.


int32 flags; ///< not yet used (set to 0)
int32 flags; ///< not yet used (set to 0)
}; };


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Extended Plug-in interface IEditController for key switches support
/** Extended plug-in interface IEditController for key switches support: Vst::IKeyswitchController
\ingroup vstIPlug vst350 \ingroup vstIPlug vst350
- [plug imp] - [plug imp]
- [extends IEditController] - [extends IEditController]
- [released: 3.5.0] - [released: 3.5.0]
- [optional] - [optional]


When a (instrument) Plug-in supports such interface, the host could get from the Plug-in the current set
When a (instrument) plug-in supports such interface, the host could get from the plug-in the current set
of used key switches (megatrig/articulation) for a given channel of a event bus and then automatically use them (like in Cubase 6) to of used key switches (megatrig/articulation) for a given channel of a event bus and then automatically use them (like in Cubase 6) to
create VST Expression Map (allowing to associated symbol to a given articulation / key switch). create VST Expression Map (allowing to associated symbol to a given articulation / key switch).
*/ */
//------------------------------------------------------------------------
class IKeyswitchController: public FUnknown
class IKeyswitchController : public FUnknown
{ {
public: public:
/** Returns number of supported key switches for event bus index and channel. */ /** Returns number of supported key switches for event bus index and channel. */


+ 21
- 18
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivstparameterchanges.h View File

@@ -17,7 +17,7 @@
#pragma once #pragma once


#include "pluginterfaces/base/funknown.h" #include "pluginterfaces/base/funknown.h"
#include "vsttypes.h"
#include "pluginterfaces/vst/vsttypes.h"


//------------------------------------------------------------------------ //------------------------------------------------------------------------
#include "pluginterfaces/base/falignpush.h" #include "pluginterfaces/base/falignpush.h"
@@ -27,33 +27,35 @@
namespace Steinberg { namespace Steinberg {
namespace Vst { namespace Vst {
//---------------------------------------------------------------------- //----------------------------------------------------------------------
/** Queue of changes for a specific parameter.
/** Queue of changes for a specific parameter: Vst::IParamValueQueue
\ingroup vstIHost vst300 \ingroup vstIHost vst300
- [host imp] - [host imp]
- [released: 3.0.0] - [released: 3.0.0]
- [mandatory] - [mandatory]


The change queue can be interpreted as segment of an automation curve. For each The change queue can be interpreted as segment of an automation curve. For each
processing block a segment with the size of the block is transmitted to the processor.
processing block, a segment with the size of the block is transmitted to the processor.
The curve is expressed as sampling points of a linear approximation of The curve is expressed as sampling points of a linear approximation of
the original automation curve. If the original already is a linear curve it can
the original automation curve. If the original already is a linear curve, it can
be transmitted precisely. A non-linear curve has to be converted to a linear be transmitted precisely. A non-linear curve has to be converted to a linear
approximation by the host. Every point of the value queue defines a linear approximation by the host. Every point of the value queue defines a linear
section of the curve as a straight line from the previous point of a block to section of the curve as a straight line from the previous point of a block to
the new one. So the Plug-in can calculate the value of the curve for any sample
the new one. So the plug-in can calculate the value of the curve for any sample
position in the block. position in the block.


<b>Implicit Points:</b> \n <b>Implicit Points:</b> \n
In each processing block the section of the curve for each parameter is transmitted.
In each processing block, the section of the curve for each parameter is transmitted.
In order to reduce the amount of points, the point at block position 0 can be omitted. In order to reduce the amount of points, the point at block position 0 can be omitted.
- If the curve has a slope of 0 over a period of multiple blocks, only one point is - If the curve has a slope of 0 over a period of multiple blocks, only one point is
transmitted for the block where the constant curve section starts. The queue for the following transmitted for the block where the constant curve section starts. The queue for the following
blocks will be empty as long as the curve slope is 0. blocks will be empty as long as the curve slope is 0.
- If the curve has a constant slope other than 0 over the period of several blocks, only - If the curve has a constant slope other than 0 over the period of several blocks, only
the value for the last sample of the block is transmitted. In this case the last valid point
the value for the last sample of the block is transmitted. In this case, the last valid point
is at block position -1. The processor can calculate the value for each sample in the block is at block position -1. The processor can calculate the value for each sample in the block
by using a linear interpolation: by using a linear interpolation:
\code

\code{.cpp}
//------------------------------------------------------------------------
double x1 = -1; // position of last point related to current buffer double x1 = -1; // position of last point related to current buffer
double y1 = currentParameterValue; // last transmitted value double y1 = currentParameterValue; // last transmitted value


@@ -70,15 +72,16 @@ double offset = y1 - (slope * x1);
double curveValue = (slope * bufferTime) + offset; // bufferTime is any position in buffer double curveValue = (slope * bufferTime) + offset; // bufferTime is any position in buffer
\endcode \endcode


<b>Jumps:</b> \n
\b Jumps:
\n
A jump in the automation curve has to be transmitted as two points: one with the A jump in the automation curve has to be transmitted as two points: one with the
old value and one with the new value at the next sample position. old value and one with the new value at the next sample position.


\image html "automation.jpg" \image html "automation.jpg"
\see IParameterChanges, ProcessData

See \ref IParameterChanges, \ref ProcessData
*/ */
//----------------------------------------------------------------------
class IParamValueQueue: public FUnknown
class IParamValueQueue : public FUnknown
{ {
public: public:
//------------------------------------------------------------------------ //------------------------------------------------------------------------
@@ -101,19 +104,19 @@ public:
DECLARE_CLASS_IID (IParamValueQueue, 0x01263A18, 0xED074F6F, 0x98C9D356, 0x4686F9BA) DECLARE_CLASS_IID (IParamValueQueue, 0x01263A18, 0xED074F6F, 0x98C9D356, 0x4686F9BA)


//---------------------------------------------------------------------- //----------------------------------------------------------------------
/** All parameter changes of a processing block.
/** All parameter changes of a processing block: Vst::IParameterChanges
\ingroup vstIHost vst300 \ingroup vstIHost vst300
- [host imp] - [host imp]
- [released: 3.0.0] - [released: 3.0.0]
- [mandatory] - [mandatory]


This interface is used to transmit any changes that shall be applied to parameters
This interface is used to transmit any changes to be applied to parameters
in the current processing block. A change can be caused by GUI interaction as in the current processing block. A change can be caused by GUI interaction as
well as automation. They are transmitted as a list of queues (IParamValueQueue)
well as automation. They are transmitted as a list of queues (\ref IParamValueQueue)
containing only queues for parameters that actually did change. containing only queues for parameters that actually did change.
\see IParamValueQueue, ProcessData */
//----------------------------------------------------------------------
class IParameterChanges: public FUnknown
See \ref IParamValueQueue, \ref ProcessData
*/
class IParameterChanges : public FUnknown
{ {
public: public:
//------------------------------------------------------------------------ //------------------------------------------------------------------------


+ 143
- 0
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivstparameterfunctionname.h View File

@@ -0,0 +1,143 @@
//------------------------------------------------------------------------
// Project : VST SDK
//
// Category : Interfaces
// Filename : pluginterfaces/vst/ivstparameterfunctionname.h
// Created by : Steinberg, 03/2020
// Description : VST Parameter Function Name Interface
//
//-----------------------------------------------------------------------------
// This file is part of a Steinberg SDK. It is subject to the license terms
// in the LICENSE file found in the top-level directory of this distribution
// and at www.steinberg.net/sdklicenses.
// No part of the SDK, including this file, may be copied, modified, propagated,
// or distributed except according to the terms contained in the LICENSE file.
//-----------------------------------------------------------------------------

#pragma once

#include "pluginterfaces/base/funknown.h"
#include "pluginterfaces/vst/vsttypes.h"

//------------------------------------------------------------------------
#include "pluginterfaces/base/falignpush.h"
//------------------------------------------------------------------------

//------------------------------------------------------------------------
namespace Steinberg {
namespace Vst {

namespace FunctionNameType {
//--------------------------------------------------------------------
const CString kCompGainReduction = "Comp:GainReduction"; /** */
const CString kCompGainReductionMax = "Comp:GainReductionMax";
const CString kCompGainReductionPeakHold = "Comp:GainReductionPeakHold";
const CString kCompResetGainReductionMax = "Comp:ResetGainReductionMax";

const CString kLowLatencyMode = "LowLatencyMode"; /** Useful for live situation where low
latency is required:
0 means LowLatency disable,
1 means LowLatency enable */
const CString kDryWetMix = "DryWetMix"; /** Allowing to mix the original (Dry) Signal with the processed one (Wet):
0.0 means Dry Signal only,
0.5 means 50% Dry Signal + 50% Wet Signal,
1.0 means Wet Signal only */
const CString kRandomize = "Randomize"; /** Allow to assign some randomized values to some
parameters in a controlled way*/

} // FunctionNameType

//------------------------------------------------------------------------
/** Edit controller component interface extension: Vst::IParameterFunctionName
\ingroup vstIPlug vst370
- [plug imp]
- [extends IEditController]
- [released: 3.7.0]
- [optional]

This interface allows the host to get a parameter associated to a specific meaning (a functionName) for a given unit.
The host can use this information, for example, for drawing a Gain Reduction meter in its own UI.
In order to get the plain value of this parameter, the host should use the IEditController::normalizedParamToPlain.
The host can automatically map parameters to dedicated UI controls, such as the wet-dry mix knob or Randomize button.

\section IParameterFunctionNameExample Example

\code{.cpp}
//------------------------------------------------------------------------
// here an example of how a VST3 plug-in could support this IParameterFunctionName interface.
// we need to define somewhere the iids:

in MyController class declaration
class MyController : public Vst::EditController, public Vst::IParameterFunctionName
{
...
tresult PLUGIN_API getParameterIDFromFunctionName (UnitID unitID, FIDString functionName,
Vst::ParamID& paramID) override;
...

OBJ_METHODS (MyController, Vst::EditController)
DEFINE_INTERFACES
...
DEF_INTERFACE (Vst::IParameterFunctionName)
END_DEFINE_INTERFACES (Vst::EditController)
...
}

#include "ivstparameterfunctionname.h"
namespace Steinberg {
namespace Vst {
DEF_CLASS_IID (IParameterFunctionName)
}
}

//------------------------------------------------------------------------
tresult PLUGIN_API MyController::getParameterIDFromFunctionName (UnitID unitID, FIDString functionName,
Vst::ParamID& paramID)
{
using namespace Vst;

paramID = kNoParamId;

if (unitID == kRootUnitId && FIDStringsEqual (functionName, kCompGainReduction))
paramID = kMyGainReductionId;

return (paramID != kNoParamId) ? kResultOk : kResultFalse;
}

//--- a host implementation example: --------------------
...
FUnknownPtr<Vst::IParameterFunctionName> functionName (mEditController->getIEditController ());
if (functionName)
{
Vst::ParamID paramID;
if (functionName->getParameterIDFromFunctionName (Vst::FunctionNameType::kCompGainReduction, paramID) == kResultTrue)
{
// paramID could be cached for performance issue
ParamValue norm = mEditController->getIEditController ()->getParamNormalized (paramID);
ParamValue plain = mEditController->getIEditController ()->normalizedParamToPlain (paramID, norm);
// plain is something like -6 (-6dB)
}
}
\endcode
*/
class IParameterFunctionName : public FUnknown
{
public:
//------------------------------------------------------------------------
/** Gets for the given unitID the associated paramID to a function Name.
Returns kResultFalse when no found parameter (paramID is set to kNoParamId in this case). */
virtual tresult PLUGIN_API getParameterIDFromFunctionName (UnitID unitID, FIDString functionName, ParamID& paramID) = 0;

//------------------------------------------------------------------------
static const FUID iid;
};

DECLARE_CLASS_IID (IParameterFunctionName, 0x6D21E1DC, 0x91199D4B, 0xA2A02FEF, 0x6C1AE55C)

//------------------------------------------------------------------------
} // namespace Vst
} // namespace Steinberg

//------------------------------------------------------------------------
#include "pluginterfaces/base/falignpop.h"
//------------------------------------------------------------------------

+ 49
- 10
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivstphysicalui.h View File

@@ -27,11 +27,17 @@ namespace Steinberg {
namespace Vst { namespace Vst {
//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** \defgroup vst3typedef VST 3 Data Types */
/*@{*/
//------------------------------------------------------------------------
/** Physical UI Type */
typedef uint32 PhysicalUITypeID; typedef uint32 PhysicalUITypeID;
/*@}*/
//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** PhysicalUITypeIDs describes the type of Physical UI (PUI) which could be associated to a note /** PhysicalUITypeIDs describes the type of Physical UI (PUI) which could be associated to a note
expression. \see PhysicalUIMap
expression.
\see PhysicalUIMap
*/ */
enum PhysicalUITypeIDs enum PhysicalUITypeIDs
{ {
@@ -50,7 +56,8 @@ enum PhysicalUITypeIDs
//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** PhysicalUIMap describes a mapping of a noteExpression Type to a Physical UI Type. /** PhysicalUIMap describes a mapping of a noteExpression Type to a Physical UI Type.
It is used in PhysicalUIMapList. It is used in PhysicalUIMapList.
\see PhysicalUIMapList */
\see PhysicalUIMapList
*/
struct PhysicalUIMap struct PhysicalUIMap
{ {
/** This represents the physical UI. /see PhysicalUITypeIDs, this is set by the caller of /** This represents the physical UI. /see PhysicalUITypeIDs, this is set by the caller of
@@ -65,7 +72,8 @@ struct PhysicalUIMap
//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** PhysicalUIMapList describes a list of PhysicalUIMap /** PhysicalUIMapList describes a list of PhysicalUIMap
\see INoteExpressionPhysicalUIMapping*/
\see INoteExpressionPhysicalUIMapping
*/
struct PhysicalUIMapList struct PhysicalUIMapList
{ {
/** Count of entries in the map array, set by the caller of getPhysicalUIMapping. */ /** Count of entries in the map array, set by the caller of getPhysicalUIMapping. */
@@ -76,21 +84,51 @@ struct PhysicalUIMapList
}; };
//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Extended Plug-in interface IEditController for note expression event support
/** Extended plug-in interface IEditController for note expression event support: Vst::INoteExpressionPhysicalUIMapping
\ingroup vstIPlug vst3611 \ingroup vstIPlug vst3611
- [plug imp] - [plug imp]
- [extends IEditController] - [extends IEditController]
- [released: 3.6.11] - [released: 3.6.11]
- [optional] - [optional]
With this Plug-in interface, the host can retrieve the preferred physical mapping associated to note
expression supported by the Plug-in.
When the mapping changes (for example when switching presets) the Plug-in needs
With this plug-in interface, the host can retrieve the preferred physical mapping associated to note
expression supported by the plug-in.
When the mapping changes (for example when switching presets) the plug-in needs
to inform the host about it via \ref IComponentHandler::restartComponent (kNoteExpressionChanged). to inform the host about it via \ref IComponentHandler::restartComponent (kNoteExpressionChanged).
\section INoteExpressionPhysicalUIMappingExample Example \section INoteExpressionPhysicalUIMappingExample Example
\code
tresult PLUGIN_API myPlug::::getPhysicalUIMapping (int32 busIndex, int16 channel, PhysicalUIMapList& list)
\code{.cpp}
//------------------------------------------------------------------------
// here an example of how a VST3 plug-in could support this INoteExpressionPhysicalUIMapping interface.
// we need to define somewhere the iids:
//in MyController class declaration
class MyController : public Vst::EditController, public Vst::INoteExpressionPhysicalUIMapping
{
// ...
//--- INoteExpressionPhysicalUIMapping ---------------------------------
tresult PLUGIN_API getPhysicalUIMapping (int32 busIndex, int16 channel, PhysicalUIMapList& list) SMTG_OVERRIDE;
// ...
OBJ_METHODS (MyController, Vst::EditController)
DEFINE_INTERFACES
// ...
DEF_INTERFACE (Vst::INoteExpressionPhysicalUIMapping)
END_DEFINE_INTERFACES (Vst::EditController)
//...
}
// In mycontroller.cpp
#include "pluginterfaces/vst/ivstnoteexpression.h"
namespace Steinberg {
namespace Vst {
DEF_CLASS_IID (INoteExpressionPhysicalUIMapping)
}
}
//------------------------------------------------------------------------
tresult PLUGIN_API MyController::getPhysicalUIMapping (int32 busIndex, int16 channel, PhysicalUIMapList& list)
{ {
if (busIndex == 0 && channel == 0) if (busIndex == 0 && channel == 0)
{ {
@@ -106,7 +144,8 @@ tresult PLUGIN_API myPlug::::getPhysicalUIMapping (int32 busIndex, int16 channel
} }
return kResultFalse; return kResultFalse;
} }
\endcode */
\endcode
*/
class INoteExpressionPhysicalUIMapping : public FUnknown class INoteExpressionPhysicalUIMapping : public FUnknown
{ {
public: public:


+ 9
- 6
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivstpluginterfacesupport.h View File

@@ -17,22 +17,25 @@
#pragma once #pragma once


#include "pluginterfaces/base/funknown.h" #include "pluginterfaces/base/funknown.h"
#include "vsttypes.h"
#include "pluginterfaces/vst/vsttypes.h"


//------------------------------------------------------------------------ //------------------------------------------------------------------------
namespace Steinberg { namespace Steinberg {
namespace Vst { namespace Vst {
//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Host callback interface for an edit controller.
/** Host callback interface for an edit controller: Vst::IPlugInterfaceSupport
\ingroup vstIHost vst3612 \ingroup vstIHost vst3612
- [host imp] - [host imp]
- [released: 3.6.12] - [released: 3.6.12]
- [optional] - [optional]


Allow a Plug-in to ask the host if a given Plug-in interface is supported/used by the host.
Allows a plug-in to ask the host if a given plug-in interface is supported/used by the host.
It is implemented by the hostContext given when the component is initialized. It is implemented by the hostContext given when the component is initialized.


\code
\section IPlugInterfaceSupportExample Example

\code{.cpp}
//------------------------------------------------------------------------
tresult PLUGIN_API MyPluginController::initialize (FUnknown* context) tresult PLUGIN_API MyPluginController::initialize (FUnknown* context)
{ {
// ... // ...
@@ -45,8 +48,8 @@ tresult PLUGIN_API MyPluginController::initialize (FUnknown* context)
// ... // ...
} }
\endcode \endcode
\see IPluginBase */
//------------------------------------------------------------------------
\see IPluginBase
*/
class IPlugInterfaceSupport : public FUnknown class IPlugInterfaceSupport : public FUnknown
{ {
public: public:


+ 3
- 3
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivstplugview.h View File

@@ -17,7 +17,7 @@
#pragma once #pragma once


#include "pluginterfaces/base/funknown.h" #include "pluginterfaces/base/funknown.h"
#include "vsttypes.h"
#include "pluginterfaces/vst/vsttypes.h"


//------------------------------------------------------------------------ //------------------------------------------------------------------------
#include "pluginterfaces/base/falignpush.h" #include "pluginterfaces/base/falignpush.h"
@@ -29,7 +29,7 @@ namespace Vst {
//------------------------------------------------------------------------ //------------------------------------------------------------------------
// IParameterFinder Interface // IParameterFinder Interface
//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Extension for IPlugView to find view parameters (lookup value under mouse support)
/** Extension for IPlugView to find view parameters (lookup value under mouse support): Vst::IParameterFinder
\ingroup pluginGUI vst302 \ingroup pluginGUI vst302
- [plug imp] - [plug imp]
- [extends IPlugView] - [extends IPlugView]
@@ -45,7 +45,7 @@ class IParameterFinder: public FUnknown
{ {
public: public:
//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Find out which parameter in Plug-in view is at given position (relative to Plug-in view). */
/** Find out which parameter in plug-in view is at given position (relative to plug-in view). */
virtual tresult PLUGIN_API findParameter (int32 xPos, int32 yPos, ParamID& resultTag /*out*/) = 0; virtual tresult PLUGIN_API findParameter (int32 xPos, int32 yPos, ParamID& resultTag /*out*/) = 0;
//------------------------------------------------------------------------ //------------------------------------------------------------------------
static const FUID iid; static const FUID iid;


+ 22
- 10
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivstprefetchablesupport.h View File

@@ -27,7 +27,15 @@
namespace Steinberg { namespace Steinberg {
namespace Vst { namespace Vst {


// ------------------------------------------------------------------------
/** \defgroup vst3typedef VST 3 Data Types */
/*@{*/
//------------------------------------------------------------------------
/** Prefetchable Support Type */
typedef uint32 PrefetchableSupport; typedef uint32 PrefetchableSupport;
/*@}*/

/** Prefetchable Support Enum */
enum ePrefetchableSupport enum ePrefetchableSupport
{ {
kIsNeverPrefetchable = 0, ///< every instance of the plug does not support prefetch processing kIsNeverPrefetchable = 0, ///< every instance of the plug does not support prefetch processing
@@ -39,19 +47,21 @@ enum ePrefetchableSupport
//------------------------------------------------------------------------ //------------------------------------------------------------------------
// IPrefetchableSupport Interface // IPrefetchableSupport Interface
//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Indicates that the Plug-in could or not support Prefetch (dynamically).
/** Indicates that the plug-in could or not support Prefetch (dynamically): Vst::IPrefetchableSupport
\ingroup vstIPlug vst365 \ingroup vstIPlug vst365
- [plug imp] - [plug imp]
- [extends IComponent] - [extends IComponent]
- [released: 3.6.5] - [released: 3.6.5]
- [optional] - [optional]


The Plug-in should implement this interface if it needs to dynamically change between Prefetchable or not.
By default (without implementing this interface) the host will decide in which mode the Plug-in will be process.
For more info about Prefetch processing mode check ProcessModes::kPrefetch documentation.
The plug-in should implement this interface if it needs to dynamically change between prefetchable or not.
By default (without implementing this interface) the host decides in which mode the plug-in is processed.
For more info about the prefetch processing mode check the ProcessModes::kPrefetch documentation.


\section IPrefetchableSupportExample Example \section IPrefetchableSupportExample Example
\code

\code{.cpp}
//------------------------------------------------------------------------
tresult PLUGIN_API myPlug::getPrefetchableSupport (PrefetchableSupport& prefetchable) tresult PLUGIN_API myPlug::getPrefetchableSupport (PrefetchableSupport& prefetchable)
{ {
prefetchable = kIsNeverPrefetchable; prefetchable = kIsNeverPrefetchable;
@@ -64,21 +74,23 @@ tresult PLUGIN_API myPlug::getPrefetchableSupport (PrefetchableSupport& prefetch
} }
return kResultOk; return kResultOk;
} }
\endcode */
\endcode
*/
class IPrefetchableSupport : public FUnknown class IPrefetchableSupport : public FUnknown
{ {
public: public:
//------------------------------------------------------------------------
/** retrieve the current prefetch support. Use IComponentHandler::restartComponent (kPrefetchableSupportChanged)
to inform the host that this support has changed. */
//------------------------------------------------------------------------
/** retrieve the current prefetch support. Use IComponentHandler::restartComponent
(kPrefetchableSupportChanged) to inform the host that this support has changed. */
virtual tresult PLUGIN_API getPrefetchableSupport (PrefetchableSupport& prefetchable /*out*/) = 0; virtual tresult PLUGIN_API getPrefetchableSupport (PrefetchableSupport& prefetchable /*out*/) = 0;


//------------------------------------------------------------------------
//------------------------------------------------------------------------
static const FUID iid; static const FUID iid;
}; };


DECLARE_CLASS_IID (IPrefetchableSupport, 0x8AE54FDA, 0xE93046B9, 0xA28555BC, 0xDC98E21E) DECLARE_CLASS_IID (IPrefetchableSupport, 0x8AE54FDA, 0xE93046B9, 0xA28555BC, 0xDC98E21E)


//------------------------------------------------------------------------
} // namespace Vst } // namespace Vst
} // namespace Steinberg } // namespace Steinberg




+ 46
- 35
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivstprocesscontext.h View File

@@ -17,7 +17,7 @@
#pragma once #pragma once


#include "pluginterfaces/base/funknown.h" #include "pluginterfaces/base/funknown.h"
#include "vsttypes.h"
#include "pluginterfaces/vst/vsttypes.h"


//------------------------------------------------------------------------ //------------------------------------------------------------------------
#include "pluginterfaces/base/falignpush.h" #include "pluginterfaces/base/falignpush.h"
@@ -27,17 +27,29 @@
namespace Steinberg { namespace Steinberg {
namespace Vst { namespace Vst {
//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Frame Rate */
//------------------------------------------------------------------------
/** Frame Rate
A frame rate describes the number of image (frame) displayed per second.
Some examples:
- 23.976 fps is framesPerSecond: 24 and flags: kPullDownRate
- 24 fps is framesPerSecond: 24 and flags: 0
- 25 fps is framesPerSecond: 25 and flags: 0
- 29.97 drop fps is framesPerSecond: 30 and flags: kDropRate|kPullDownRate
- 29.97 fps is framesPerSecond: 30 and flags: kPullDownRate
- 30 fps is framesPerSecond: 30 and flags: 0
- 30 drop fps is framesPerSecond: 30 and flags: kDropRate
- 50 fps is framesPerSecond: 50 and flags: 0
- 59.94 fps is framesPerSecond: 60 and flags: kPullDownRate
- 60 fps is framesPerSecond: 60 and flags: 0
*/
struct FrameRate struct FrameRate
{ {
//------------------------------------------------------------------------ //------------------------------------------------------------------------
enum FrameRateFlags enum FrameRateFlags
{ {
kPullDownRate = 1 << 0, ///< for ex. HDTV: 23.976 fps with 24 as frame rate
kDropRate = 1 << 1 ///< for ex. 29.97 fps drop with 30 as frame rate
kPullDownRate = 1 << 0,
kDropRate = 1 << 1
}; };
//------------------------------------------------------------------------
uint32 framesPerSecond; ///< frame rate uint32 framesPerSecond; ///< frame rate
uint32 flags; ///< flags #FrameRateFlags uint32 flags; ///< flags #FrameRateFlags
//------------------------------------------------------------------------ //------------------------------------------------------------------------
@@ -47,21 +59,21 @@ struct FrameRate
/** Description of a chord. /** Description of a chord.
A chord is described with a key note, a root note and the A chord is described with a key note, a root note and the
\copydoc chordMask \copydoc chordMask
\see ProcessContext*/
//------------------------------------------------------------------------
\see ProcessContext
*/
struct Chord struct Chord
{ {
//------------------------------------------------------------------------ //------------------------------------------------------------------------
uint8 keyNote; ///< key note in chord uint8 keyNote; ///< key note in chord
uint8 rootNote; ///< lowest note in chord uint8 rootNote; ///< lowest note in chord


/** Bitmask of a chord.
/** Bitmask of a chord. \n
1st bit set: minor second; 2nd bit set: major second, and so on. \n 1st bit set: minor second; 2nd bit set: major second, and so on. \n
There is \b no bit for the keynote (root of the chord) because it is inherently always present. \n There is \b no bit for the keynote (root of the chord) because it is inherently always present. \n
Examples: Examples:
- XXXX 0000 0100 1000 (= 0x0048) -> major chord\n
- XXXX 0000 0100 0100 (= 0x0044) -> minor chord\n
- XXXX 0010 0100 0100 (= 0x0244) -> minor chord with minor seventh */
- XXXX 0000 0100 1000 (= 0x0048) -> major chord
- XXXX 0000 0100 0100 (= 0x0044) -> minor chord
- XXXX 0010 0100 0100 (= 0x0244) -> minor chord with minor seventh */
int16 chordMask; int16 chordMask;


enum Masks { enum Masks {
@@ -73,15 +85,14 @@ struct Chord


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Audio processing context. /** Audio processing context.
For each processing block the host provides timing information and
musical parameters that can change over time. For a host that supports jumps
(like cycle) it is possible to split up a processing block into multiple parts in
order to provide a correct project time inside of every block, but this behaviour
is not mandatory. Since the timing will be correct at the beginning of the next block
again, a host that is dependent on a fixed processing block size can choose to neglect
For each processing block the host provides timing information and musical parameters that can
change over time. For a host that supports jumps (like cycle) it is possible to split up a
processing block into multiple parts in order to provide a correct project time inside of every
block, but this behavior is not mandatory. Since the timing will be correct at the beginning of the
next block again, a host that is dependent on a fixed processing block size can choose to neglect
this problem. this problem.
\see IAudioProcessor, ProcessData*/
//------------------------------------------------------------------------
\see IAudioProcessor, ProcessData
*/
struct ProcessContext struct ProcessContext
{ {
//------------------------------------------------------------------------ //------------------------------------------------------------------------
@@ -109,27 +120,27 @@ struct ProcessContext


uint32 state; ///< a combination of the values from \ref StatesAndFlags uint32 state; ///< a combination of the values from \ref StatesAndFlags


double sampleRate; ///< current sample rate (always valid)
TSamples projectTimeSamples; ///< project time in samples (always valid)
double sampleRate; ///< current sample rate (always valid)
TSamples projectTimeSamples; ///< project time in samples (always valid)


int64 systemTime; ///< system time in nanoseconds (optional)
TSamples continousTimeSamples; ///< project time, without loop (optional)
int64 systemTime; ///< system time in nanoseconds (optional)
TSamples continousTimeSamples; ///< project time, without loop (optional)


TQuarterNotes projectTimeMusic; ///< musical position in quarter notes (1.0 equals 1 quarter note)
TQuarterNotes barPositionMusic; ///< last bar start position, in quarter notes
TQuarterNotes cycleStartMusic; ///< cycle start in quarter notes
TQuarterNotes cycleEndMusic; ///< cycle end in quarter notes
TQuarterNotes projectTimeMusic; ///< musical position in quarter notes (1.0 equals 1 quarter note) (optional)
TQuarterNotes barPositionMusic; ///< last bar start position, in quarter notes (optional)
TQuarterNotes cycleStartMusic; ///< cycle start in quarter notes (optional)
TQuarterNotes cycleEndMusic; ///< cycle end in quarter notes (optional)


double tempo; ///< tempo in BPM (Beats Per Minute)
int32 timeSigNumerator; ///< time signature numerator (e.g. 3 for 3/4)
int32 timeSigDenominator; ///< time signature denominator (e.g. 4 for 3/4)
double tempo; ///< tempo in BPM (Beats Per Minute) (optional)
int32 timeSigNumerator; ///< time signature numerator (e.g. 3 for 3/4) (optional)
int32 timeSigDenominator; ///< time signature denominator (e.g. 4 for 3/4) (optional)


Chord chord; ///< musical info
Chord chord; ///< musical info (optional)


int32 smpteOffsetSubframes; ///< SMPTE (sync) offset in subframes (1/80 of frame)
FrameRate frameRate; ///< frame rate
int32 smpteOffsetSubframes; ///< SMPTE (sync) offset in subframes (1/80 of frame) (optional)
FrameRate frameRate; ///< frame rate (optional)


int32 samplesToNextClock; ///< MIDI Clock Resolution (24 Per Quarter Note), can be negative (nearest)
int32 samplesToNextClock; ///< MIDI Clock Resolution (24 Per Quarter Note), can be negative (nearest) (optional)
//------------------------------------------------------------------------ //------------------------------------------------------------------------
}; };




+ 17
- 25
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivstrepresentation.h View File

@@ -44,7 +44,7 @@ struct RepresentationInfo
memset (host, 0, kNameSize); memset (host, 0, kNameSize);
} }
RepresentationInfo (char8* _vendor, char8* _name = 0, char8* _version = 0, char8* _host = 0)
RepresentationInfo (char8* _vendor, char8* _name = nullptr, char8* _version = nullptr, char8* _host = nullptr)
{ {
memset (vendor, 0, kNameSize); memset (vendor, 0, kNameSize);
if (_vendor) if (_vendor)
@@ -73,29 +73,29 @@ struct RepresentationInfo


//------------------------------------------------------------------------ //------------------------------------------------------------------------
//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Extended Plug-in interface IEditController for a component.
/** Extended plug-in interface IEditController for a component: Vst::IXmlRepresentationController
\ingroup vstIPlug vst350 \ingroup vstIPlug vst350
- [plug imp] - [plug imp]
- [extends IEditController] - [extends IEditController]
- [released: 3.5.0] - [released: 3.5.0]
- [optional] - [optional]


A Representation based on XML is a way to export and structure, group Plug-ins parameters for a specific remote (could be hardware or software rack (like quickcontrols)).
A representation based on XML is a way to export, structure, and group plug-ins parameters for a specific remote (hardware or software rack (such as quick controls)).
\n \n
It allows to describe more precisely each parameter (what is the best matching to a knob, different titles lengths matching limited remote display,...).\n See an \ref Example.
It allows to describe each parameter more precisely (what is the best matching to a knob, different title lengths matching limited remote display,...).\n See an \ref Example.
\n\n \n\n
- A Representation is composed of Pages (this means that to see all exported parameters the user has to navigate through the pages).
- A Page is composed of Cells (for example 8 Cells per page).
- A Cell is composed of Layers (for example a cell could have a knob, a display and a button which are 3 Layers).
- A Layer is associated to a Plug-in parameter using the ParameterID as identifier:
- it could be a knob with a display for Title and/or value, this display uses the same parameterId, but it could an another one.
- Switch
- link which allows to jump directly to a subpage (an another page)
- A representation is composed of pages (this means that to see all exported parameters, the user has to navigate through the pages).
- A page is composed of cells (for example 8 cells per page).
- A cell is composed of layers (for example a cell could have a knob, a display, and a button, which means 3 layers).
- A layer is associated to a plug-in parameter using the ParameterID as identifier:
- it could be a knob with a display for title and/or value, this display uses the same parameterId, but it could an another one.
- switch
- link which allows to jump directly to a subpage (another page)
- more... See Vst::LayerType - more... See Vst::LayerType
. .


\n \n
This Representation is implemented as XML text following the Document Type Definition (DTD): http://dtd.steinberg.net/VST-Remote-1.1.dtd
This representation is implemented as XML text following the Document Type Definition (DTD): http://dtd.steinberg.net/VST-Remote-1.1.dtd


\section Example \section Example
Here an example of what should be passed in the stream of getXmlRepresentationStream: Here an example of what should be passed in the stream of getXmlRepresentationStream:
@@ -177,20 +177,19 @@ Here an example of what should be passed in the stream of getXmlRepresentationSt
</vstXML> </vstXML>
\endcode \endcode
*/ */
//------------------------------------------------------------------------
class IXmlRepresentationController: public FUnknown
class IXmlRepresentationController : public FUnknown
{ {
public: public:
/** Retrieves a stream containing a XmlRepresentation for a wanted representation info */ /** Retrieves a stream containing a XmlRepresentation for a wanted representation info */
virtual tresult PLUGIN_API getXmlRepresentationStream (RepresentationInfo& info /*in*/, IBStream* stream /*out*/) = 0;
virtual tresult PLUGIN_API getXmlRepresentationStream (RepresentationInfo& info /*in*/,
IBStream* stream /*out*/) = 0;


//------------------------------------------------------------------------
//------------------------------------------------------------------------
static const FUID iid; static const FUID iid;
}; };


DECLARE_CLASS_IID (IXmlRepresentationController, 0xA81A0471, 0x48C34DC4, 0xAC30C9E1, 0x3C8393D5) DECLARE_CLASS_IID (IXmlRepresentationController, 0xA81A0471, 0x48C34DC4, 0xAC30C9E1, 0x3C8393D5)



//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Defines for XML representation Tags and Attributes */ /** Defines for XML representation Tags and Attributes */


@@ -254,7 +253,6 @@ DECLARE_CLASS_IID (IXmlRepresentationController, 0xA81A0471, 0x48C34DC4, 0xAC30C


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Layer Types used in a VST XML Representation */ /** Layer Types used in a VST XML Representation */
//------------------------------------------------------------------------
namespace LayerType namespace LayerType
{ {
enum enum
@@ -280,13 +278,12 @@ namespace LayerType
,"link" ,"link"
,"display" ,"display"
,"fader" ,"fader"
,0
,nullptr
}; };
}; };


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Curve Types used in a VST XML Representation */ /** Curve Types used in a VST XML Representation */
//------------------------------------------------------------------------
namespace CurveType namespace CurveType
{ {
const CString kSegment = "segment"; ///< const CString kSegment = "segment"; ///<
@@ -295,7 +292,6 @@ namespace CurveType


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Attributes used to defined a Layer in a VST XML Representation */ /** Attributes used to defined a Layer in a VST XML Representation */
//------------------------------------------------------------------------
namespace Attributes namespace Attributes
{ {
const CString kStyle = ATTR_STYLE; ///< string attribute : See AttributesStyle for available string value const CString kStyle = ATTR_STYLE; ///< string attribute : See AttributesStyle for available string value
@@ -308,7 +304,6 @@ namespace Attributes


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Attributes Function used to defined the function of a Layer in a VST XML Representation */ /** Attributes Function used to defined the function of a Layer in a VST XML Representation */
//------------------------------------------------------------------------
namespace AttributesFunction namespace AttributesFunction
{ {
/// Global Style /// Global Style
@@ -330,7 +325,6 @@ namespace AttributesFunction


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Attributes Style associated a specific Layer Type in a VST XML Representation */ /** Attributes Style associated a specific Layer Type in a VST XML Representation */
//------------------------------------------------------------------------
namespace AttributesStyle namespace AttributesStyle
{ {
/// Global Style /// Global Style
@@ -356,13 +350,11 @@ namespace AttributesStyle


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Attributes Flags defining a Layer in a VST XML Representation */ /** Attributes Flags defining a Layer in a VST XML Representation */
//------------------------------------------------------------------------
namespace AttributesFlags namespace AttributesFlags
{ {
const CString kHideableFlag = "hideable"; ///< the associated layer marked as hideable allows a remote to hide or make it not usable a parameter when the associated value is inactive const CString kHideableFlag = "hideable"; ///< the associated layer marked as hideable allows a remote to hide or make it not usable a parameter when the associated value is inactive
}; };



//------------------------------------------------------------------------ //------------------------------------------------------------------------
} // namespace Vst } // namespace Vst
} // namespace Steinberg } // namespace Steinberg


+ 21
- 1
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivsttestplugprovider.h View File

@@ -9,7 +9,7 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LICENSE // LICENSE
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved
// (c) 2020, Steinberg Media Technologies GmbH, All Rights Reserved
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // are permitted provided that the following conditions are met:
@@ -84,6 +84,26 @@ public:


DECLARE_CLASS_IID (ITestPlugProvider, 0x86BE70EE, 0x4E99430F, 0x978F1E6E, 0xD68FB5BA) DECLARE_CLASS_IID (ITestPlugProvider, 0x86BE70EE, 0x4E99430F, 0x978F1E6E, 0xD68FB5BA)


//------------------------------------------------------------------------
/** Test Helper extension.
* \ingroup TestClass
*/
class ITestPlugProvider2 : public ITestPlugProvider
{
public:
/** get the plugin factory.
*
* The reference count of the returned factory object is not increased when calling this
* function.
*/
virtual IPluginFactory* PLUGIN_API getPluginFactory () = 0;

//------------------------------------------------------------------------
static const FUID iid;
};

DECLARE_CLASS_IID (ITestPlugProvider2, 0xC7C75364, 0x7B8343AC, 0xA4495B0A, 0x3E5A46C7)

//------------------------------------------------------------------------ //------------------------------------------------------------------------
} // Vst } // Vst
} // Steinberg } // Steinberg

+ 39
- 37
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/ivstunits.h View File

@@ -17,21 +17,21 @@
#pragma once #pragma once


#include "pluginterfaces/base/funknown.h" #include "pluginterfaces/base/funknown.h"
#include "vsttypes.h"
#include "pluginterfaces/vst/vsttypes.h"


//------------------------------------------------------------------------ //------------------------------------------------------------------------
#include "pluginterfaces/base/falignpush.h" #include "pluginterfaces/base/falignpush.h"
//------------------------------------------------------------------------ //------------------------------------------------------------------------


//------------------------------------------------------------------------
namespace Steinberg { namespace Steinberg {
class IBStream; class IBStream;

//------------------------------------------------------------------------ //------------------------------------------------------------------------
namespace Vst { namespace Vst {
//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Special UnitIDs for UnitInfo */ /** Special UnitIDs for UnitInfo */
static const UnitID kRootUnitId = 0; ///< identifier for the top level unit (root) static const UnitID kRootUnitId = 0; ///< identifier for the top level unit (root)
static const UnitID kNoParentUnitId = -1; ///< used for the root unit which doesn't have a parent.
static const UnitID kNoParentUnitId = -1; ///< used for the root unit which does not have a parent.


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Special ProgramListIDs for UnitInfo */ /** Special ProgramListIDs for UnitInfo */
@@ -39,8 +39,8 @@ static const ProgramListID kNoProgramListId = -1; ///< no programs are used in t


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Basic Unit Description. /** Basic Unit Description.
\see IUnitInfo */
//------------------------------------------------------------------------
\see IUnitInfo
*/
struct UnitInfo struct UnitInfo
{ {
UnitID id; ///< unit identifier UnitID id; ///< unit identifier
@@ -51,8 +51,8 @@ struct UnitInfo


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Basic Program List Description. /** Basic Program List Description.
\see IUnitInfo */
//------------------------------------------------------------------------
\see IUnitInfo
*/
struct ProgramListInfo struct ProgramListInfo
{ {
ProgramListID id; ///< program list identifier ProgramListID id; ///< program list identifier
@@ -65,7 +65,7 @@ struct ProgramListInfo
static const int32 kAllProgramInvalid = -1; ///< all program information is invalid static const int32 kAllProgramInvalid = -1; ///< all program information is invalid


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Host callback for unit support.
/** Host callback for unit support: Vst::IUnitHandler
\ingroup vstIHost vst300 \ingroup vstIHost vst300
- [host imp] - [host imp]
- [extends IComponentHandler] - [extends IComponentHandler]
@@ -75,16 +75,16 @@ static const int32 kAllProgramInvalid = -1; ///< all program information is inv
Host callback interface, used with IUnitInfo. Host callback interface, used with IUnitInfo.
Retrieve via queryInterface from IComponentHandler. Retrieve via queryInterface from IComponentHandler.


\see \ref vst3Units, IUnitInfo */
//------------------------------------------------------------------------
class IUnitHandler: public FUnknown
\see \ref vst3Units, IUnitInfo
*/
class IUnitHandler : public FUnknown
{ {
public: public:
//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Notify host when a module is selected in Plug-in GUI. */
/** Notify host when a module is selected in plug-in GUI. */
virtual tresult PLUGIN_API notifyUnitSelection (UnitID unitId) = 0; virtual tresult PLUGIN_API notifyUnitSelection (UnitID unitId) = 0;


/** Tell host that the Plug-in controller changed a program list (rename, load, PitchName changes).
/** Tell host that the plug-in controller changed a program list (rename, load, PitchName changes).
\param listId is the specified program list ID to inform. \param listId is the specified program list ID to inform.
\param programIndex : when kAllProgramInvalid, all program information is invalid, otherwise only the program of given index. */ \param programIndex : when kAllProgramInvalid, all program information is invalid, otherwise only the program of given index. */
virtual tresult PLUGIN_API notifyProgramListChange (ProgramListID listId, int32 programIndex) = 0; virtual tresult PLUGIN_API notifyProgramListChange (ProgramListID listId, int32 programIndex) = 0;
@@ -95,9 +95,8 @@ public:


DECLARE_CLASS_IID (IUnitHandler, 0x4B5147F8, 0x4654486B, 0x8DAB30BA, 0x163A3C56) DECLARE_CLASS_IID (IUnitHandler, 0x4B5147F8, 0x4654486B, 0x8DAB30BA, 0x163A3C56)



//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Host callback for extended unit support.
/** Host callback for extended unit support: Vst::IUnitHandler2
\ingroup vstIHost vst365 \ingroup vstIHost vst365
- [host imp] - [host imp]
- [extends IUnitHandler] - [extends IUnitHandler]
@@ -107,8 +106,12 @@ DECLARE_CLASS_IID (IUnitHandler, 0x4B5147F8, 0x4654486B, 0x8DAB30BA, 0x163A3C56)
Host callback interface, used with IUnitInfo. Host callback interface, used with IUnitInfo.
Retrieve via queryInterface from IComponentHandler. Retrieve via queryInterface from IComponentHandler.


\see \ref vst3Units, IUnitHandler */
//------------------------------------------------------------------------
The plug-in has the possibility to inform the host with notifyUnitByBusChange that something has
changed in the bus - unit assignment, the host then has to recall IUnitInfo::getUnitByBus in order
to get the new relations between busses and unit.

\see \ref vst3Units, IUnitHandler
*/
class IUnitHandler2 : public FUnknown class IUnitHandler2 : public FUnknown
{ {
public: public:
@@ -122,24 +125,23 @@ public:


DECLARE_CLASS_IID (IUnitHandler2, 0xF89F8CDF, 0x699E4BA5, 0x96AAC9A4, 0x81452B01) DECLARE_CLASS_IID (IUnitHandler2, 0xF89F8CDF, 0x699E4BA5, 0x96AAC9A4, 0x81452B01)



//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Edit controller extension to describe the Plug-in structure.
/** Edit controller extension to describe the plug-in structure: Vst::IUnitInfo
\ingroup vstIPlug vst300 \ingroup vstIPlug vst300
- [plug imp] - [plug imp]
- [extends IEditController] - [extends IEditController]
- [released: 3.0.0] - [released: 3.0.0]
- [optional] - [optional]


IUnitInfo describes the internal structure of the Plug-in.
IUnitInfo describes the internal structure of the plug-in.
- The root unit is the component itself, so getUnitCount must return 1 at least. - The root unit is the component itself, so getUnitCount must return 1 at least.
- The root unit id has to be 0 (kRootUnitId). - The root unit id has to be 0 (kRootUnitId).
- Each unit can reference one program list - this reference must not change. - Each unit can reference one program list - this reference must not change.
- Each unit using a program list, references one program of the list.
- Each unit, using a program list, references one program of the list.


\see \ref vst3Units, IUnitHandler */
//------------------------------------------------------------------------
class IUnitInfo: public FUnknown
\see \ref vst3Units, IUnitHandler
*/
class IUnitInfo : public FUnknown
{ {
public: public:
//------------------------------------------------------------------------ //------------------------------------------------------------------------
@@ -167,7 +169,7 @@ public:
virtual tresult PLUGIN_API hasProgramPitchNames (ProgramListID listId, int32 programIndex) = 0; virtual tresult PLUGIN_API hasProgramPitchNames (ProgramListID listId, int32 programIndex) = 0;


/** Gets the PitchName for a given program list ID, program index and pitch. /** Gets the PitchName for a given program list ID, program index and pitch.
If PitchNames are changed the Plug-in should inform the host with IUnitHandler::notifyProgramListChange. */
If PitchNames are changed the plug-in should inform the host with IUnitHandler::notifyProgramListChange. */
virtual tresult PLUGIN_API getProgramPitchName (ProgramListID listId, int32 programIndex, virtual tresult PLUGIN_API getProgramPitchName (ProgramListID listId, int32 programIndex,
int16 midiPitch, String128 name /*out*/) = 0; int16 midiPitch, String128 name /*out*/) = 0;


@@ -197,19 +199,19 @@ public:
DECLARE_CLASS_IID (IUnitInfo, 0x3D4BD6B5, 0x913A4FD2, 0xA886E768, 0xA5EB92C1) DECLARE_CLASS_IID (IUnitInfo, 0x3D4BD6B5, 0x913A4FD2, 0xA886E768, 0xA5EB92C1)


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Component extension to access program list data.
/** Component extension to access program list data: Vst::IProgramListData
\ingroup vstIPlug vst300 \ingroup vstIPlug vst300
- [plug imp] - [plug imp]
- [extends IComponent] - [extends IComponent]
- [released: 3.0.0] - [released: 3.0.0]
- [optional] - [optional]


A component can either support program list data via this interface or
unit preset data (IUnitData), but not both!
A component can support program list data via this interface or/and
unit preset data (IUnitData).


\see \ref vst3UnitPrograms */
//------------------------------------------------------------------------
class IProgramListData: public FUnknown
\see IUnitData, \ref vst3MultitimbralPrograms
*/
class IProgramListData : public FUnknown
{ {
public: public:
//------------------------------------------------------------------------ //------------------------------------------------------------------------
@@ -229,19 +231,19 @@ public:
DECLARE_CLASS_IID (IProgramListData, 0x8683B01F, 0x7B354F70, 0xA2651DEC, 0x353AF4FF) DECLARE_CLASS_IID (IProgramListData, 0x8683B01F, 0x7B354F70, 0xA2651DEC, 0x353AF4FF)


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Component extension to access unit data.
/** Component extension to access unit data: Vst::IUnitData
\ingroup vstIPlug vst300 \ingroup vstIPlug vst300
- [plug imp] - [plug imp]
- [extends IComponent] - [extends IComponent]
- [released: 3.0.0] - [released: 3.0.0]
- [optional] - [optional]


A component can either support unit preset data via this interface or
program list data (IProgramListData), but not both!
A component can support unit preset data via this interface or
program list data (IProgramListData).


\see \ref vst3UnitPrograms */
//------------------------------------------------------------------------
class IUnitData: public FUnknown
\see \ref vst3ProgramLists
*/
class IUnitData : public FUnknown
{ {
public: public:
//------------------------------------------------------------------------ //------------------------------------------------------------------------


+ 282
- 110
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/vstspeaker.h View File

@@ -15,9 +15,8 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------


#pragma once #pragma once
#include "vsttypes.h"


//#include "pluginterfaces/base/ftype.h"
#include "pluginterfaces/vst/vsttypes.h"


//------------------------------------------------------------------------ //------------------------------------------------------------------------
namespace Steinberg { namespace Steinberg {
@@ -29,7 +28,9 @@ namespace Vst {
A SpeakerArrangement is a bitset combination of speakers. For example: A SpeakerArrangement is a bitset combination of speakers. For example:
\code \code
const SpeakerArrangement kStereo = kSpeakerL | kSpeakerR; // => hex: 0x03 / binary: 0011. const SpeakerArrangement kStereo = kSpeakerL | kSpeakerR; // => hex: 0x03 / binary: 0011.
\endcode*/
\endcode
\see IAudioProcessor::getBusArrangement () and IAudioProcessor::setBusArrangements ()
*/
//------------------------------------------------------------------------ //------------------------------------------------------------------------


//------------------------------------------------------------------------ //------------------------------------------------------------------------
@@ -76,14 +77,14 @@ const Speaker kSpeakerACN13 = (Speaker)1 << 47; ///< Ambisonic ACN 13
const Speaker kSpeakerACN14 = (Speaker)1 << 48; ///< Ambisonic ACN 14 const Speaker kSpeakerACN14 = (Speaker)1 << 48; ///< Ambisonic ACN 14
const Speaker kSpeakerACN15 = (Speaker)1 << 49; ///< Ambisonic ACN 15 const Speaker kSpeakerACN15 = (Speaker)1 << 49; ///< Ambisonic ACN 15


const Speaker kSpeakerTsl = 1 << 24; ///< Top Side Left (Tsl)
const Speaker kSpeakerTsr = 1 << 25; ///< Top Side Right (Tsr)
const Speaker kSpeakerLcs = 1 << 26; ///< Left of Center Surround (Lcs) - Back Left Center
const Speaker kSpeakerRcs = 1 << 27; ///< Right of Center Surround (Rcs) - Back Right Center
const Speaker kSpeakerTsl = (Speaker)1 << 24; ///< Top Side Left (Tsl)
const Speaker kSpeakerTsr = (Speaker)1 << 25; ///< Top Side Right (Tsr)
const Speaker kSpeakerLcs = (Speaker)1 << 26; ///< Left of Center Surround (Lcs) - Back Left Center
const Speaker kSpeakerRcs = (Speaker)1 << 27; ///< Right of Center Surround (Rcs) - Back Right Center


const Speaker kSpeakerBfl = 1 << 28; ///< Bottom Front Left (Bfl)
const Speaker kSpeakerBfc = 1 << 29; ///< Bottom Front Center (Bfc)
const Speaker kSpeakerBfr = 1 << 30; ///< Bottom Front Right (Bfr)
const Speaker kSpeakerBfl = (Speaker)1 << 28; ///< Bottom Front Left (Bfl)
const Speaker kSpeakerBfc = (Speaker)1 << 29; ///< Bottom Front Center (Bfc)
const Speaker kSpeakerBfr = (Speaker)1 << 30; ///< Bottom Front Right (Bfr)


const Speaker kSpeakerPl = (Speaker)1 << 31; ///< Proximity Left (Pl) const Speaker kSpeakerPl = (Speaker)1 << 31; ///< Proximity Left (Pl)
const Speaker kSpeakerPr = (Speaker)1 << 32; ///< Proximity Right (Pr) const Speaker kSpeakerPr = (Speaker)1 << 32; ///< Proximity Right (Pr)
@@ -97,8 +98,7 @@ const Speaker kSpeakerBrr = (Speaker)1 << 37; ///< Bottom Rear Right (Brr)
/** @}*/ /** @}*/


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Speaker Arrangement Definitions (SpeakerArrangement)*/
//------------------------------------------------------------------------
/** Speaker Arrangement Definitions (SpeakerArrangement) */
namespace SpeakerArr namespace SpeakerArr
{ {
//------------------------------------------------------------------------ //------------------------------------------------------------------------
@@ -116,21 +116,22 @@ const SpeakerArrangement kStereoTF = kSpeakerTfl | kSpeakerTfr; ///< Tfl Tfr
const SpeakerArrangement kStereoTS = kSpeakerTsl | kSpeakerTsr; ///< Tsl Tsr const SpeakerArrangement kStereoTS = kSpeakerTsl | kSpeakerTsr; ///< Tsl Tsr
const SpeakerArrangement kStereoTR = kSpeakerTrl | kSpeakerTrr; ///< Trl Trr const SpeakerArrangement kStereoTR = kSpeakerTrl | kSpeakerTrr; ///< Trl Trr
const SpeakerArrangement kStereoBF = kSpeakerBfl | kSpeakerBfr; ///< Bfl Bfr const SpeakerArrangement kStereoBF = kSpeakerBfl | kSpeakerBfr; ///< Bfl Bfr
const SpeakerArrangement kCineFront = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLc | kSpeakerRc; ///< L R C Lc Rc


/** L R C */ /** L R C */
const SpeakerArrangement k30Cine = kSpeakerL | kSpeakerR | kSpeakerC; const SpeakerArrangement k30Cine = kSpeakerL | kSpeakerR | kSpeakerC;
/** L R S */
const SpeakerArrangement k30Music = kSpeakerL | kSpeakerR | kSpeakerS;
/** L R C Lfe */
/** L R C Lfe */
const SpeakerArrangement k31Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe; const SpeakerArrangement k31Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe;
/** L R S */
const SpeakerArrangement k30Music = kSpeakerL | kSpeakerR | kSpeakerCs;
/** L R Lfe S */ /** L R Lfe S */
const SpeakerArrangement k31Music = kSpeakerL | kSpeakerR | kSpeakerLfe | kSpeakerS;
const SpeakerArrangement k31Music = kSpeakerL | kSpeakerR | kSpeakerLfe | kSpeakerCs;
/** L R C S (LCRS) */ /** L R C S (LCRS) */
const SpeakerArrangement k40Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerS;
const SpeakerArrangement k40Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerCs;
/** L R C Lfe S (LCRS+Lfe) */
const SpeakerArrangement k41Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerCs;
/** L R Ls Rs (Quadro) */ /** L R Ls Rs (Quadro) */
const SpeakerArrangement k40Music = kSpeakerL | kSpeakerR | kSpeakerLs | kSpeakerRs; const SpeakerArrangement k40Music = kSpeakerL | kSpeakerR | kSpeakerLs | kSpeakerRs;
/** L R C Lfe S (LCRS+Lfe) */
const SpeakerArrangement k41Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerS;
/** L R Lfe Ls Rs (Quadro+Lfe) */ /** L R Lfe Ls Rs (Quadro+Lfe) */
const SpeakerArrangement k41Music = kSpeakerL | kSpeakerR | kSpeakerLfe | kSpeakerLs | kSpeakerRs; const SpeakerArrangement k41Music = kSpeakerL | kSpeakerR | kSpeakerLfe | kSpeakerLs | kSpeakerRs;
/** L R C Ls Rs */ /** L R C Ls Rs */
@@ -139,35 +140,48 @@ const SpeakerArrangement k50 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeake
const SpeakerArrangement k51 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs; const SpeakerArrangement k51 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs;
/** L R C Ls Rs Cs */ /** L R C Ls Rs Cs */
const SpeakerArrangement k60Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerCs; const SpeakerArrangement k60Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerCs;
/** L R Ls Rs Sl Sr */
const SpeakerArrangement k60Music = kSpeakerL | kSpeakerR | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr;
/** L R C Lfe Ls Rs Cs */ /** L R C Lfe Ls Rs Cs */
const SpeakerArrangement k61Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerCs; const SpeakerArrangement k61Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerCs;
/** L R Ls Rs Sl Sr */
const SpeakerArrangement k60Music = kSpeakerL | kSpeakerR | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr;
/** L R Lfe Ls Rs Sl Sr */ /** L R Lfe Ls Rs Sl Sr */
const SpeakerArrangement k61Music = kSpeakerL | kSpeakerR | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr; const SpeakerArrangement k61Music = kSpeakerL | kSpeakerR | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr;
/** L R C Ls Rs Lc Rc */ /** L R C Ls Rs Lc Rc */
const SpeakerArrangement k70Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc; const SpeakerArrangement k70Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc;
/** L R C Ls Rs Sl Sr */
const SpeakerArrangement k70Music = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr;
/** L R C Lfe Ls Rs Lc Rc */ /** L R C Lfe Ls Rs Lc Rc */
const SpeakerArrangement k71Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc; const SpeakerArrangement k71Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc;
const SpeakerArrangement k71CineFullFront= k71Cine;
/** L R C Lfe Ls Rs Lcs Rcs */
const SpeakerArrangement k71CineFullRear = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerLcs | kSpeakerRcs;
const SpeakerArrangement k71CineFullFront = k71Cine;
/** L R C Ls Rs Sl Sr */
const SpeakerArrangement k70Music = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr;
/** L R C Lfe Ls Rs Sl Sr */ /** L R C Lfe Ls Rs Sl Sr */
const SpeakerArrangement k71Music = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr; const SpeakerArrangement k71Music = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr;

/** L R C Lfe Ls Rs Lcs Rcs */
const SpeakerArrangement k71CineFullRear = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerLcs | kSpeakerRcs;
const SpeakerArrangement k71CineSideFill = k71Music; const SpeakerArrangement k71CineSideFill = k71Music;
/** L R C Lfe Ls Rs Pl Pr */ /** L R C Lfe Ls Rs Pl Pr */
const SpeakerArrangement k71Proximity = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerPl | kSpeakerPr; const SpeakerArrangement k71Proximity = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerPl | kSpeakerPr;

/** L R C Ls Rs Lc Rc Cs */ /** L R C Ls Rs Lc Rc Cs */
const SpeakerArrangement k80Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc | kSpeakerCs; const SpeakerArrangement k80Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc | kSpeakerCs;
/** L R C Ls Rs Cs Sl Sr */
const SpeakerArrangement k80Music = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerCs | kSpeakerSl | kSpeakerSr;
/** L R C Lfe Ls Rs Lc Rc Cs */ /** L R C Lfe Ls Rs Lc Rc Cs */
const SpeakerArrangement k81Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc | kSpeakerCs; const SpeakerArrangement k81Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc | kSpeakerCs;
/** L R C Ls Rs Cs Sl Sr */
const SpeakerArrangement k80Music = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerCs | kSpeakerSl | kSpeakerSr;
/** L R C Lfe Ls Rs Cs Sl Sr */ /** L R C Lfe Ls Rs Cs Sl Sr */
const SpeakerArrangement k81Music = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerCs | kSpeakerSl | kSpeakerSr; const SpeakerArrangement k81Music = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerCs | kSpeakerSl | kSpeakerSr;

/** L R C Ls Rs Lc Rc Sl Sr */
const SpeakerArrangement k90Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc |
kSpeakerSl | kSpeakerSr;
/** L R C Lfe Ls Rs Lc Rc Sl Sr */
const SpeakerArrangement k91Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc |
kSpeakerSl | kSpeakerSr;
/** L R C Ls Rs Lc Rc Cs Sl Sr */
const SpeakerArrangement k100Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc | kSpeakerCs |
kSpeakerSl | kSpeakerSr;
/** L R C Lfe Ls Rs Lc Rc Cs Sl Sr */
const SpeakerArrangement k101Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc | kSpeakerCs |
kSpeakerSl | kSpeakerSr;


/** First-Order with Ambisonic Channel Number (ACN) ordering and SN3D normalization */ /** First-Order with Ambisonic Channel Number (ACN) ordering and SN3D normalization */
const SpeakerArrangement kAmbi1stOrderACN = kSpeakerACN0 | kSpeakerACN1 | kSpeakerACN2 | kSpeakerACN3; const SpeakerArrangement kAmbi1stOrderACN = kSpeakerACN0 | kSpeakerACN1 | kSpeakerACN2 | kSpeakerACN3;
@@ -180,84 +194,122 @@ const SpeakerArrangement kAmbi3rdOrderACN = kAmbi2cdOrderACN | kSpeakerACN9 | kS
/*-----------*/ /*-----------*/
/* 3D formats */ /* 3D formats */
/*-----------*/ /*-----------*/
/** L R Ls Rs Tfl Tfr Trl Trr */
/** L R Ls Rs Tfl Tfr Trl Trr */ // 4.0.4
const SpeakerArrangement k80Cube = kSpeakerL | kSpeakerR | kSpeakerLs | kSpeakerRs | kSpeakerTfl| kSpeakerTfr| kSpeakerTrl | kSpeakerTrr; const SpeakerArrangement k80Cube = kSpeakerL | kSpeakerR | kSpeakerLs | kSpeakerRs | kSpeakerTfl| kSpeakerTfr| kSpeakerTrl | kSpeakerTrr;
/** L R C Lfe Ls Rs Cs Tc */
/** L R C Lfe Ls Rs Cs Tc */ // 6.1.1
const SpeakerArrangement k71CineTopCenter = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerCs | kSpeakerTc; const SpeakerArrangement k71CineTopCenter = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerCs | kSpeakerTc;
/** L R C Lfe Ls Rs Cs Tfc */
/** L R C Lfe Ls Rs Cs Tfc */ // 6.1.1
const SpeakerArrangement k71CineCenterHigh = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerCs | kSpeakerTfc; const SpeakerArrangement k71CineCenterHigh = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerCs | kSpeakerTfc;
/** L R C Lfe Ls Rs Tfl Tfr */
/** L R C Lfe Ls Rs Tfl Tfr */ // 5.1.2
const SpeakerArrangement k71CineFrontHigh = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerTfl | kSpeakerTfr; const SpeakerArrangement k71CineFrontHigh = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerTfl | kSpeakerTfr;
const SpeakerArrangement k71MPEG3D = k71CineFrontHigh; const SpeakerArrangement k71MPEG3D = k71CineFrontHigh;
/** L R C Lfe Ls Rs Tsl Tsr */
/** L R C Lfe Ls Rs Tsl Tsr */ // 5.1.2
const SpeakerArrangement k71CineSideHigh = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerTsl | kSpeakerTsr; const SpeakerArrangement k71CineSideHigh = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerTsl | kSpeakerTsr;


/** L R Lfe Ls Rs Tfl Tfc Tfr Bfc */
/** L R Lfe Ls Rs Tfl Tfc Tfr Bfc */ // 4.1.4
const SpeakerArrangement k81MPEG3D = kSpeakerL | kSpeakerR | kSpeakerLfe | kSpeakerLs | kSpeakerRs | const SpeakerArrangement k81MPEG3D = kSpeakerL | kSpeakerR | kSpeakerLfe | kSpeakerLs | kSpeakerRs |
kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerBfc;
kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerBfc;


/** L R C Ls Rs Tfl Tfr Trl Trr */
/** L R C Ls Rs Tfl Tfr Trl Trr */ // 5.0.4
const SpeakerArrangement k90 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | const SpeakerArrangement k90 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs |
kSpeakerTfl| kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
kSpeakerTfl| kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
const SpeakerArrangement k50_4 = k90; const SpeakerArrangement k50_4 = k90;
/** L R C Lfe Ls Rs Tfl Tfr Trl Trr */
/** L R C Lfe Ls Rs Tfl Tfr Trl Trr */ // 5.1.4
const SpeakerArrangement k91 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | const SpeakerArrangement k91 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs |
kSpeakerTfl| kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
kSpeakerTfl| kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
const SpeakerArrangement k51_4 = k91; const SpeakerArrangement k51_4 = k91;


/** L R C Lfe Ls Rs Sl Sr Tsl Tsr */
const SpeakerArrangement k71_2 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs |
kSpeakerRs | kSpeakerSl | kSpeakerSr | kSpeakerTsl | kSpeakerTsr;
const SpeakerArrangement k91Atmos = k71_2;
/** L R C Ls Rs Sl Sr Tsl Tsr */ // 7.0.2
const SpeakerArrangement k70_2 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs |
kSpeakerSl | kSpeakerSr | kSpeakerTsl | kSpeakerTsr;

/** L R C Lfe Ls Rs Sl Sr Tsl Tsr */ // 7.1.2
const SpeakerArrangement k71_2 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs |
kSpeakerSl | kSpeakerSr | kSpeakerTsl | kSpeakerTsr;
const SpeakerArrangement k91Atmos = k71_2; // 9.1 Dolby Atmos (3D)


/** L R C Ls Rs Tc Tfl Tfr Trl Trr */
/** L R C Ls Rs Sl Sr Tfl Tfr Trl Trr */ // 7.0.4
const SpeakerArrangement k70_4 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr |
kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;

/** L R C Lfe Ls Rs Sl Sr Tfl Tfr Trl Trr */ // 7.1.4
const SpeakerArrangement k71_4 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr |
kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
const SpeakerArrangement k111MPEG3D = k71_4;

/** L R C Ls Rs Sl Sr Tfl Tfr Trl Trr Tsl Tsr */ // 7.0.6
const SpeakerArrangement k70_6 = kSpeakerL | kSpeakerR | kSpeakerC |
kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr |
kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr | kSpeakerTsl | kSpeakerTsr;

/** L R C Lfe Ls Rs Sl Sr Tfl Tfr Trl Trr Tsl Tsr */ // 7.1.6
const SpeakerArrangement k71_6 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe |
kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr |
kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr | kSpeakerTsl | kSpeakerTsr;

/** L R C Ls Rs Lc Rc Sl Sr Tfl Tfr Trl Trr */ // 9.0.4
const SpeakerArrangement k90_4 = kSpeakerL | kSpeakerR | kSpeakerC |
kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc | kSpeakerSl | kSpeakerSr |
kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;

/** L R C Lfe Ls Rs Lc Rc Sl Sr Tfl Tfr Trl Trr */ // 9.1.4
const SpeakerArrangement k91_4 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe |
kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc | kSpeakerSl | kSpeakerSr |
kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;

/** L R C Lfe Ls Rs Lc Rc Sl Sr Tfl Tfr Trl Trr Tsl Tsr */ // 9.0.6
const SpeakerArrangement k90_6 = kSpeakerL | kSpeakerR | kSpeakerC |
kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc | kSpeakerSl | kSpeakerSr |
kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr | kSpeakerTsl | kSpeakerTsr;

/** L R C Lfe Ls Rs Lc Rc Sl Sr Tfl Tfr Trl Trr Tsl Tsr */ // 9.1.6
const SpeakerArrangement k91_6 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe |
kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc | kSpeakerSl | kSpeakerSr |
kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr | kSpeakerTsl | kSpeakerTsr;

/** L R C Ls Rs Tc Tfl Tfr Trl Trr */ // 5.0.5
const SpeakerArrangement k100 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | const SpeakerArrangement k100 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs |
kSpeakerTc | kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
/** L R C Lfe Ls Rs Tc Tfl Tfr Trl Trr */
kSpeakerTc | kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
/** L R C Lfe Ls Rs Tc Tfl Tfr Trl Trr */ // 5.1.5
const SpeakerArrangement k101 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | const SpeakerArrangement k101 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs |
kSpeakerTc | kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
kSpeakerTc | kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
const SpeakerArrangement k101MPEG3D = k101; const SpeakerArrangement k101MPEG3D = k101;


/** L R C Lfe Ls Rs Tfl Tfc Tfr Trl Trr Lfe2 */
/** L R C Lfe Ls Rs Tfl Tfc Tfr Trl Trr Lfe2 */ // 5.2.5
const SpeakerArrangement k102 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | const SpeakerArrangement k102 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs |
kSpeakerTfl| kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr | kSpeakerLfe2;
kSpeakerTfl| kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr | kSpeakerLfe2;


/** L R C Ls Rs Tc Tfl Tfc Tfr Trl Trr */
/** L R C Ls Rs Tc Tfl Tfc Tfr Trl Trr */ // 5.0.6
const SpeakerArrangement k110 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | const SpeakerArrangement k110 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs |
kSpeakerTc | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
/** L R C Lfe Ls Rs Tc Tfl Tfc Tfr Trl Trr */
kSpeakerTc | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
/** L R C Lfe Ls Rs Tc Tfl Tfc Tfr Trl Trr */ // 5.1.6
const SpeakerArrangement k111 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | const SpeakerArrangement k111 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs |
kSpeakerTc | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
kSpeakerTc | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;


/** L R C Ls Rs Sl Sr Tfl Tfr Trl Trr */
const SpeakerArrangement k70_4 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr |
kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;

/** L R C Lfe Ls Rs Sl Sr Tfl Tfr Trl Trr */
const SpeakerArrangement k71_4 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr |
kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
const SpeakerArrangement k111MPEG3D = k71_4;

/** L R C Lfe Ls Rs Lc Rc Tfl Tfc Tfr Trl Trr Lfe2 */
/** L R C Lfe Ls Rs Lc Rc Tfl Tfc Tfr Trl Trr Lfe2 */ // 7.2.5
const SpeakerArrangement k122 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc | const SpeakerArrangement k122 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc |
kSpeakerTfl| kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr | kSpeakerLfe2;
/** L R C Ls Rs Sl Sr Tc Tfl Tfc Tfr Trl Trr */
kSpeakerTfl| kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr | kSpeakerLfe2;
/** L R C Ls Rs Sl Sr Tc Tfl Tfc Tfr Trl Trr */ // 7.0.6
const SpeakerArrangement k130 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr | const SpeakerArrangement k130 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr |
kSpeakerTc | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
/** L R C Lfe Ls Rs Sl Sr Tc Tfl Tfc Tfr Trl Trr */
kSpeakerTc | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
/** L R C Lfe Ls Rs Sl Sr Tc Tfl Tfc Tfr Trl Trr */ // 7.1.6
const SpeakerArrangement k131 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr | const SpeakerArrangement k131 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr |
kSpeakerTc | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
kSpeakerTc | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;


/** L R Ls Rs Sl Sr Tfl Tfr Trl Trr Bfl Bfr Brl Brr */
/** L R Ls Rs Sl Sr Tfl Tfr Trl Trr Bfl Bfr Brl Brr */ // 6.0.4.4
const SpeakerArrangement k140 = kSpeakerL | kSpeakerR | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr | const SpeakerArrangement k140 = kSpeakerL | kSpeakerR | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr |
kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr |
kSpeakerBfl | kSpeakerBfr | kSpeakerBrl | kSpeakerBrr;
kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr |
kSpeakerBfl | kSpeakerBfr | kSpeakerBrl | kSpeakerBrr;


/** L R C Lfe Ls Rs Lc Rc Cs Sl Sr Tc Tfl Tfc Tfr Trl Trc Trr Lfe2 Tsl Tsr Bfl Bfc Bfr */
const SpeakerArrangement k222 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc | kSpeakerCs | kSpeakerSl | kSpeakerSr |
kSpeakerTc | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrc | kSpeakerTrr | kSpeakerLfe2 | kSpeakerTsl | kSpeakerTsr |
kSpeakerBfl| kSpeakerBfc | kSpeakerBfr;
/** L R C Ls Rs Lc Rc Cs Sl Sr Tc Tfl Tfc Tfr Trl Trc Trr Tsl Tsr Bfl Bfc Bfr */ // 10.0.9.3
const SpeakerArrangement k220 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc | kSpeakerCs | kSpeakerSl | kSpeakerSr |
kSpeakerTc | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrc | kSpeakerTrr | kSpeakerTsl | kSpeakerTsr |
kSpeakerBfl| kSpeakerBfc | kSpeakerBfr;


/** L R C Lfe Ls Rs Lc Rc Cs Sl Sr Tc Tfl Tfc Tfr Trl Trc Trr Lfe2 Tsl Tsr Bfl Bfc Bfr */ // 10.2.9.3
const SpeakerArrangement k222 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc | kSpeakerCs | kSpeakerSl | kSpeakerSr |
kSpeakerTc | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrc | kSpeakerTrr | kSpeakerLfe2 | kSpeakerTsl | kSpeakerTsr |
kSpeakerBfl| kSpeakerBfc | kSpeakerBfr;


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Speaker Arrangement String Representation. /** Speaker Arrangement String Representation.
@@ -274,6 +326,7 @@ const CString kStringStereoTF = "Stereo (Tfl Tfr)";
const CString kStringStereoTS = "Stereo (Tsl Tsr)"; const CString kStringStereoTS = "Stereo (Tsl Tsr)";
const CString kStringStereoTR = "Stereo (Trl Trr)"; const CString kStringStereoTR = "Stereo (Trl Trr)";
const CString kStringStereoBF = "Stereo (Bfl Bfr)"; const CString kStringStereoBF = "Stereo (Bfl Bfr)";
const CString kStringCineFront = "Cine Front";


const CString kString30Cine = "LRC"; const CString kString30Cine = "LRC";
const CString kString30Music = "LRS"; const CString kString30Music = "LRS";
@@ -289,10 +342,14 @@ const CString kString60Cine = "6.0 Cine";
const CString kString60Music = "6.0 Music"; const CString kString60Music = "6.0 Music";
const CString kString61Cine = "6.1 Cine"; const CString kString61Cine = "6.1 Cine";
const CString kString61Music = "6.1 Music"; const CString kString61Music = "6.1 Music";
const CString kString70Cine = "7.0 Cine (SDDS)";
const CString kString70Music = "7.0 Music (Dolby)";
const CString kString71Cine = "7.1 Cine (SDDS)";
const CString kString71Music = "7.1 Music (Dolby)";
const CString kString70Cine = "7.0 SDDS";
const CString kString70CineOld = "7.0 Cine (SDDS)";
const CString kString70Music = "7.0";
const CString kString70MusicOld = "7.0 Music (Dolby)";
const CString kString71Cine = "7.1 SDDS";
const CString kString71CineOld = "7.1 Cine (SDDS)";
const CString kString71Music = "7.1";
const CString kString71MusicOld = "7.1 Music (Dolby)";
const CString kString71CineTopCenter = "7.1 Cine Top Center"; const CString kString71CineTopCenter = "7.1 Cine Top Center";
const CString kString71CineCenterHigh = "7.1 Cine Center High"; const CString kString71CineCenterHigh = "7.1 Cine Center High";
const CString kString71CineFrontHigh = "7.1 Cine Front High"; const CString kString71CineFrontHigh = "7.1 Cine Front High";
@@ -304,11 +361,24 @@ const CString kString80Music = "8.0 Music";
const CString kString80Cube = "8.0 Cube"; const CString kString80Cube = "8.0 Cube";
const CString kString81Cine = "8.1 Cine"; const CString kString81Cine = "8.1 Cine";
const CString kString81Music = "8.1 Music"; const CString kString81Music = "8.1 Music";
const CString kString90Cine = "9.0 Cine";
const CString kString91Cine = "9.1 Cine";
const CString kString100Cine = "10.0 Cine";
const CString kString101Cine = "10.1 Cine";
const CString kString102 = "10.2 Experimental"; const CString kString102 = "10.2 Experimental";
const CString kString122 = "12.2";
const CString kString50_4 = "5.0.4";
const CString kString51_4 = "5.1.4";
const CString kString91Atmos = "9.1 Dolby Atmos";
const CString kString122 = "12.2";
const CString kString50_4 = "5.0.4";
const CString kString51_4 = "5.1.4";
const CString kString70_2 = "7.0.2";
const CString kString71_2 = "7.1.2";
const CString kString70_4 = "7.0.4";
const CString kString71_4 = "7.1.4";
const CString kString70_6 = "7.0.6";
const CString kString71_6 = "7.1.6";
const CString kString90_4 = "9.0.4";
const CString kString91_4 = "9.1.4";
const CString kString90_6 = "9.0.6";
const CString kString91_6 = "9.1.6";
const CString kString100 = "10.0 Auro-3D"; const CString kString100 = "10.0 Auro-3D";
const CString kString101 = "10.1 Auro-3D"; const CString kString101 = "10.1 Auro-3D";
const CString kString110 = "11.0 Auro-3D"; const CString kString110 = "11.0 Auro-3D";
@@ -316,10 +386,9 @@ const CString kString111 = "11.1 Auro-3D";
const CString kString130 = "13.0 Auro-3D"; const CString kString130 = "13.0 Auro-3D";
const CString kString131 = "13.1 Auro-3D"; const CString kString131 = "13.1 Auro-3D";
const CString kString81MPEG = "8.1 MPEG"; const CString kString81MPEG = "8.1 MPEG";
const CString kString70_4 = "7.0.4";
const CString kString71_4 = "7.1.4";
const CString kString140 = "14.0"; const CString kString140 = "14.0";
const CString kString222 = "22.2"; const CString kString222 = "22.2";
const CString kString220 = "22.0";
const CString kStringAmbi1stOrder = "1st Order Ambisonics"; const CString kStringAmbi1stOrder = "1st Order Ambisonics";
const CString kStringAmbi2cdOrder = "2nd Order Ambisonics"; const CString kStringAmbi2cdOrder = "2nd Order Ambisonics";
const CString kStringAmbi3rdOrder = "3rd Order Ambisonics"; const CString kStringAmbi3rdOrder = "3rd Order Ambisonics";
@@ -340,6 +409,7 @@ const CString kStringStereoTFS = "Tfl Tfr";
const CString kStringStereoTSS = "Tsl Tsr"; const CString kStringStereoTSS = "Tsl Tsr";
const CString kStringStereoTRS = "Trl Trr"; const CString kStringStereoTRS = "Trl Trr";
const CString kStringStereoBFS = "Bfl Bfr"; const CString kStringStereoBFS = "Bfl Bfr";
const CString kStringCineFrontS = "L R C Lc Rc";
const CString kString30CineS = "L R C"; const CString kString30CineS = "L R C";
const CString kString30MusicS = "L R S"; const CString kString30MusicS = "L R S";
const CString kString31CineS = "L R C LFE"; const CString kString31CineS = "L R C LFE";
@@ -369,15 +439,26 @@ const CString kString71CineFrontHighS = "L R C LFE Ls Rs Tfl Tfl";
const CString kString71CineSideHighS = "L R C LFE Ls Rs Tsl Tsl"; const CString kString71CineSideHighS = "L R C LFE Ls Rs Tsl Tsl";
const CString kString71CineFullRearS = "L R C LFE Ls Rs Lcs Rcs"; const CString kString71CineFullRearS = "L R C LFE Ls Rs Lcs Rcs";
const CString kString71ProximityS = "L R C LFE Ls Rs Pl Pr"; const CString kString71ProximityS = "L R C LFE Ls Rs Pl Pr";
const CString kString90CineS = "L R C Ls Rs Lc Rc Sl Sr";
const CString kString91CineS = "L R C Lfe Ls Rs Lc Rc Sl Sr";
const CString kString100CineS = "L R C Ls Rs Lc Rc Cs Sl Sr";
const CString kString101CineS = "L R C Lfe Ls Rs Lc Rc Cs Sl Sr";
const CString kString50_4S = "L R C Ls Rs Tfl Tfr Trl Trr"; const CString kString50_4S = "L R C Ls Rs Tfl Tfr Trl Trr";
const CString kString51_4S = "L R C LFE Ls Rs Tfl Tfr Trl Trr"; const CString kString51_4S = "L R C LFE Ls Rs Tfl Tfr Trl Trr";
const CString kString91AtmosS = "L R C LFE Ls Rs Sl Sr Tsl Tsr";
const CString kString70_2S = "L R C Ls Rs Sl Sr Tsl Tsr";
const CString kString71_2S = "L R C LFE Ls Rs Sl Sr Tsl Tsr";
const CString kString70_4S = "L R C Ls Rs Sl Sr Tfl Tfr Trl Trr";
const CString kString71_4S = "L R C LFE Ls Rs Sl Sr Tfl Tfr Trl Trr";
const CString kString70_6S = "L R C Ls Rs Sl Sr Tfl Tfr Trl Trr Tsl Tsr";
const CString kString71_6S = "L R C LFE Ls Rs Sl Sr Tfl Tfr Trl Trr Tsl Tsr";
const CString kString90_4S = "L R C Ls Rs Lc Rc Sl Sr Tfl Tfr Trl Trr";
const CString kString91_4S = "L R C LFE Ls Rs Lc Rc Sl Sr Tfl Tfr Trl Trr";
const CString kString90_6S = "L R C Ls Rs Lc Rc Sl Sr Tfl Tfr Trl Trr Tsl Tsr";
const CString kString91_6S = "L R C LFE Ls Rs Lc Rc Sl Sr Tfl Tfr Trl Trr Tsl Tsr";
const CString kString100S = "L R C Ls Rs Tc Tfl Tfr Trl Trr"; const CString kString100S = "L R C Ls Rs Tc Tfl Tfr Trl Trr";
const CString kString101S = "L R C LFE Ls Rs Tc Tfl Tfr Trl Trr"; const CString kString101S = "L R C LFE Ls Rs Tc Tfl Tfr Trl Trr";
const CString kString110S = "L R C Ls Rs Tc Tfl Tfc Tfr Trl Trr"; const CString kString110S = "L R C Ls Rs Tc Tfl Tfc Tfr Trl Trr";
const CString kString111S = "L R C LFE Ls Rs Tc Tfl Tfc Tfr Trl Trr"; const CString kString111S = "L R C LFE Ls Rs Tc Tfl Tfc Tfr Trl Trr";
const CString kStringk70_4S = "L R C Ls Rs Sl Sr Tfl Tfr Trl Trr";
const CString kStringk71_4S = "L R C LFE Ls Rs Sl Sr Tfl Tfr Trl Trr";
const CString kString130S = "L R C Ls Rs Sl Sr Tc Tfl Tfc Tfr Trl Trr"; const CString kString130S = "L R C Ls Rs Sl Sr Tc Tfl Tfc Tfr Trl Trr";
const CString kString131S = "L R C LFE Ls Rs Sl Sr Tc Tfl Tfc Tfr Trl Trr"; const CString kString131S = "L R C LFE Ls Rs Sl Sr Tc Tfl Tfc Tfr Trl Trr";
const CString kString102S = "L R C LFE Ls Rs Tfl Tfc Tfr Trl Trr LFE2"; const CString kString102S = "L R C LFE Ls Rs Tfl Tfc Tfr Trl Trr LFE2";
@@ -385,6 +466,7 @@ const CString kString122S = "L R C LFE Ls Rs Lc Rc Tfl Tfc Tfr Trl Trr LFE2";
const CString kString81MPEGS = "L R LFE Ls Rs Tfl Tfc Tfr Bfc"; const CString kString81MPEGS = "L R LFE Ls Rs Tfl Tfc Tfr Bfc";
const CString kString140S = "L R Ls Rs Sl Sr Tfl Tfr Trl Trr Bfl Bfr Brl Brr"; const CString kString140S = "L R Ls Rs Sl Sr Tfl Tfr Trl Trr Bfl Bfr Brl Brr";
const CString kString222S = "L R C LFE Ls Rs Lc Rc Cs Sl Sr Tc Tfl Tfc Tfr Trl Trc Trr LFE2 Tsl Tsr Bfl Bfc Bfr"; const CString kString222S = "L R C LFE Ls Rs Lc Rc Cs Sl Sr Tc Tfl Tfc Tfr Trl Trc Trr LFE2 Tsl Tsr Bfl Bfc Bfr";
const CString kString220S = "L R C Ls Rs Lc Rc Cs Sl Sr Tc Tfl Tfc Tfr Trl Trc Trr Tsl Tsr Bfl Bfc Bfr";


const CString kStringAmbi1stOrderS = "0 1 2 3"; const CString kStringAmbi1stOrderS = "0 1 2 3";
const CString kStringAmbi2cdOrderS = "0 1 2 3 4 5 6 7 8"; const CString kStringAmbi2cdOrderS = "0 1 2 3 4 5 6 7 8";
@@ -469,6 +551,61 @@ inline bool isAuro (const SpeakerArrangement& arr)
return false; return false;
} }


//------------------------------------------------------------------------
/** Returns true if arrangement contains top (upper layer) speakers */
inline bool hasTopSpeakers (const SpeakerArrangement& arr)
{
if (arr & kSpeakerTc || arr & kSpeakerTfl || arr & kSpeakerTfc || arr & kSpeakerTfr ||
arr & kSpeakerTrl || arr & kSpeakerTrc || arr & kSpeakerTrr || arr & kSpeakerTsl ||
arr & kSpeakerTsr)
return true;
return false;
}

//------------------------------------------------------------------------
/** Returns true if arrangement contains bottom (lower layer) speakers */
inline bool hasBottomSpeakers (const SpeakerArrangement& arr)
{
if (arr & kSpeakerBfl || arr & kSpeakerBfc || arr & kSpeakerBfl || arr & kSpeakerBfc ||
arr & kSpeakerBfr)
return true;
return false;
}

//------------------------------------------------------------------------
/** Returns true if arrangement contains middle layer (at ears level) speakers */
inline bool hasMiddleSpeakers (const SpeakerArrangement& arr)
{
if (arr & kSpeakerL || arr & kSpeakerR || arr & kSpeakerC || arr & kSpeakerLs ||
arr & kSpeakerRs || arr & kSpeakerLc || arr & kSpeakerRc || arr & kSpeakerCs ||
arr & kSpeakerSl || arr & kSpeakerSr || arr & kSpeakerM || arr & kSpeakerPl ||
arr & kSpeakerPr || arr & kSpeakerLcs || arr & kSpeakerRcs)
return true;
return false;
}

//------------------------------------------------------------------------
/** Returns true if arrangement contains LFE speakers */
inline bool hasLfe (const SpeakerArrangement& arr)
{
if (arr & kSpeakerLfe || arr & kSpeakerLfe2)
return true;
return false;
}

//------------------------------------------------------------------------
/** Returns true if arrangement is a 3D configuration ((top or bottom) and middle) */
inline bool is3D (const SpeakerArrangement& arr)
{
bool top = hasTopSpeakers (arr);
bool bottom = hasBottomSpeakers (arr);
bool middle = hasMiddleSpeakers (arr);

if (((top || bottom) && middle) || (top && bottom))
return true;
return false;
}

//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Returns true if arrangement is a Auro configuration. */ /** Returns true if arrangement is a Auro configuration. */
inline bool isAmbisonics (const SpeakerArrangement& arr) inline bool isAmbisonics (const SpeakerArrangement& arr)
@@ -482,8 +619,7 @@ inline bool isAmbisonics (const SpeakerArrangement& arr)


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Returns the speaker arrangement associated to a string representation. /** Returns the speaker arrangement associated to a string representation.
Returns kEmpty if no associated arrangement is known.
*/
Returns kEmpty if no associated arrangement is known. */
inline SpeakerArrangement getSpeakerArrangementFromString (CString arrStr) inline SpeakerArrangement getSpeakerArrangementFromString (CString arrStr)
{ {
if (!strcmp8 (arrStr, kStringMono)) if (!strcmp8 (arrStr, kStringMono))
@@ -506,6 +642,8 @@ inline SpeakerArrangement getSpeakerArrangementFromString (CString arrStr)
return kStereoTR; return kStereoTR;
if (!strcmp8 (arrStr, kStringStereoBF)) if (!strcmp8 (arrStr, kStringStereoBF))
return kStereoBF; return kStereoBF;
if (!strcmp8 (arrStr, kStringCineFront))
return kCineFront;
if (!strcmp8 (arrStr, kString30Cine)) if (!strcmp8 (arrStr, kString30Cine))
return k30Cine; return k30Cine;
if (!strcmp8 (arrStr, kString30Music)) if (!strcmp8 (arrStr, kString30Music))
@@ -534,13 +672,13 @@ inline SpeakerArrangement getSpeakerArrangementFromString (CString arrStr)
return k61Cine; return k61Cine;
if (!strcmp8 (arrStr, kString61Music)) if (!strcmp8 (arrStr, kString61Music))
return k61Music; return k61Music;
if (!strcmp8 (arrStr, kString70Cine))
if (!strcmp8 (arrStr, kString70Cine) || !strcmp8 (arrStr, kString70CineOld))
return k70Cine; return k70Cine;
if (!strcmp8 (arrStr, kString70Music))
if (!strcmp8 (arrStr, kString70Music) || !strcmp8 (arrStr, kString70MusicOld))
return k70Music; return k70Music;
if (!strcmp8 (arrStr, kString71Cine))
if (!strcmp8 (arrStr, kString71Cine) || !strcmp8 (arrStr, kString71CineOld))
return k71Cine; return k71Cine;
if (!strcmp8 (arrStr, kString71Music))
if (!strcmp8 (arrStr, kString71Music) || !strcmp8 (arrStr, kString71MusicOld))
return k71Music; return k71Music;
if (!strcmp8 (arrStr, kString71Proximity)) if (!strcmp8 (arrStr, kString71Proximity))
return k71Proximity; return k71Proximity;
@@ -568,14 +706,40 @@ inline SpeakerArrangement getSpeakerArrangementFromString (CString arrStr)
return k71CineSideHigh; return k71CineSideHigh;
if (!strcmp8 (arrStr, kString71CineFullRear)) if (!strcmp8 (arrStr, kString71CineFullRear))
return k71CineFullRear; return k71CineFullRear;
if (!strcmp8 (arrStr, kString90Cine))
return k90Cine;
if (!strcmp8 (arrStr, kString91Cine))
return k91Cine;
if (!strcmp8 (arrStr, kString100Cine))
return k100Cine;
if (!strcmp8 (arrStr, kString101Cine))
return k101Cine;
if (!strcmp8 (arrStr, kString50_4)) if (!strcmp8 (arrStr, kString50_4))
return k50_4; return k50_4;
if (!strcmp8 (arrStr, kString51_4)) if (!strcmp8 (arrStr, kString51_4))
return k51_4; return k51_4;
if (!strcmp8 (arrStr, kString81MPEG)) if (!strcmp8 (arrStr, kString81MPEG))
return k81MPEG3D; return k81MPEG3D;
if (!strcmp8 (arrStr, kString91Atmos))
return k91Atmos;
if (!strcmp8 (arrStr, kString70_2))
return k70_2;
if (!strcmp8 (arrStr, kString71_2))
return k71_2;
if (!strcmp8 (arrStr, kString70_4))
return k70_4;
if (!strcmp8 (arrStr, kString71_4))
return k71_4;
if (!strcmp8 (arrStr, kString70_6))
return k70_6;
if (!strcmp8 (arrStr, kString71_6))
return k71_6;
if (!strcmp8 (arrStr, kString90_4))
return k90_4;
if (!strcmp8 (arrStr, kString91_4))
return k91_4;
if (!strcmp8 (arrStr, kString90_6))
return k90_6;
if (!strcmp8 (arrStr, kString91_6))
return k91_6;
if (!strcmp8 (arrStr, kString100)) if (!strcmp8 (arrStr, kString100))
return k100; return k100;
if (!strcmp8 (arrStr, kString101)) if (!strcmp8 (arrStr, kString101))
@@ -584,10 +748,6 @@ inline SpeakerArrangement getSpeakerArrangementFromString (CString arrStr)
return k110; return k110;
if (!strcmp8 (arrStr, kString111)) if (!strcmp8 (arrStr, kString111))
return k111; return k111;
if (!strcmp8 (arrStr, kString70_4))
return k70_4;
if (!strcmp8 (arrStr, kString71_4))
return k71_4;
if (!strcmp8 (arrStr, kString130)) if (!strcmp8 (arrStr, kString130))
return k130; return k130;
if (!strcmp8 (arrStr, kString131)) if (!strcmp8 (arrStr, kString131))
@@ -596,6 +756,8 @@ inline SpeakerArrangement getSpeakerArrangementFromString (CString arrStr)
return k140; return k140;
if (!strcmp8 (arrStr, kString222)) if (!strcmp8 (arrStr, kString222))
return k222; return k222;
if (!strcmp8 (arrStr, kString220))
return k220;
if (!strcmp8 (arrStr, kStringAmbi1stOrder)) if (!strcmp8 (arrStr, kStringAmbi1stOrder))
return kAmbi1stOrderACN; return kAmbi1stOrderACN;
if (!strcmp8 (arrStr, kStringAmbi2cdOrder)) if (!strcmp8 (arrStr, kStringAmbi2cdOrder))
@@ -607,8 +769,7 @@ inline SpeakerArrangement getSpeakerArrangementFromString (CString arrStr)


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Returns the string representation of a given speaker arrangement. /** Returns the string representation of a given speaker arrangement.
Returns kStringEmpty if arr is unknown.
*/
Returns kStringEmpty if arr is unknown. */
inline CString getSpeakerArrangementString (SpeakerArrangement arr, bool withSpeakersName) inline CString getSpeakerArrangementString (SpeakerArrangement arr, bool withSpeakersName)
{ {
switch (arr) switch (arr)
@@ -623,6 +784,7 @@ inline CString getSpeakerArrangementString (SpeakerArrangement arr, bool withSpe
case kStereoTS: return withSpeakersName ? kStringStereoTSS : kStringStereoTS; case kStereoTS: return withSpeakersName ? kStringStereoTSS : kStringStereoTS;
case kStereoTR: return withSpeakersName ? kStringStereoTRS : kStringStereoTR; case kStereoTR: return withSpeakersName ? kStringStereoTRS : kStringStereoTR;
case kStereoBF: return withSpeakersName ? kStringStereoBFS : kStringStereoBF; case kStereoBF: return withSpeakersName ? kStringStereoBFS : kStringStereoBF;
case kCineFront: return withSpeakersName ? kStringCineFrontS : kStringCineFront;
case k30Cine: return withSpeakersName ? kString30CineS : kString30Cine; case k30Cine: return withSpeakersName ? kString30CineS : kString30Cine;
case k30Music: return withSpeakersName ? kString30MusicS : kString30Music; case k30Music: return withSpeakersName ? kString30MusicS : kString30Music;
case k31Cine: return withSpeakersName ? kString31CineS : kString31Cine; case k31Cine: return withSpeakersName ? kString31CineS : kString31Cine;
@@ -655,7 +817,10 @@ inline CString getSpeakerArrangementString (SpeakerArrangement arr, bool withSpe
case k71CineFrontHigh: return withSpeakersName ? kString71CineFrontHighS : kString71CineFrontHigh; case k71CineFrontHigh: return withSpeakersName ? kString71CineFrontHighS : kString71CineFrontHigh;
case k71CineSideHigh: return withSpeakersName ? kString71CineSideHighS : kString71CineSideHigh; case k71CineSideHigh: return withSpeakersName ? kString71CineSideHighS : kString71CineSideHigh;
case k71CineFullRear: return withSpeakersName ? kString71CineFullRearS : kString71CineFullRear; case k71CineFullRear: return withSpeakersName ? kString71CineFullRearS : kString71CineFullRear;
case k91Atmos: return withSpeakersName ? kString91AtmosS : kString91Atmos;
case k90Cine: return withSpeakersName ? kString90CineS : kString90Cine;
case k91Cine: return withSpeakersName ? kString91CineS : kString91Cine;
case k100Cine: return withSpeakersName ? kString100CineS : kString100Cine;
case k101Cine: return withSpeakersName ? kString101CineS : kString101Cine;
case k100: return withSpeakersName ? kString100S : kString100; case k100: return withSpeakersName ? kString100S : kString100;
case k101: return withSpeakersName ? kString101S : kString101; case k101: return withSpeakersName ? kString101S : kString101;
case k110: return withSpeakersName ? kString110S : kString110; case k110: return withSpeakersName ? kString110S : kString110;
@@ -663,13 +828,21 @@ inline CString getSpeakerArrangementString (SpeakerArrangement arr, bool withSpe


case k50_4: return withSpeakersName ? kString50_4S : kString50_4; case k50_4: return withSpeakersName ? kString50_4S : kString50_4;
case k51_4: return withSpeakersName ? kString51_4S : kString51_4; case k51_4: return withSpeakersName ? kString51_4S : kString51_4;
case k70_4: return withSpeakersName ? kStringk70_4S : kString70_4;
case k71_4: return withSpeakersName ? kStringk71_4S : kString71_4;
case k70_2: return withSpeakersName ? kString70_2S : kString70_2;
case k71_2: return withSpeakersName ? kString71_2S : kString71_2;
case k70_4: return withSpeakersName ? kString70_4S : kString70_4;
case k71_4: return withSpeakersName ? kString71_4S : kString71_4;
case k70_6: return withSpeakersName ? kString70_6S : kString70_6;
case k71_6: return withSpeakersName ? kString71_6S : kString71_6;
case k90_4: return withSpeakersName ? kString90_4S : kString90_4;
case k91_4: return withSpeakersName ? kString91_4S : kString91_4;
case k90_6: return withSpeakersName ? kString90_6S : kString90_6;
case k91_6: return withSpeakersName ? kString91_6S : kString91_6;
case k130: return withSpeakersName ? kString130S : kString130; case k130: return withSpeakersName ? kString130S : kString130;
case k131: return withSpeakersName ? kString131S : kString131; case k131: return withSpeakersName ? kString131S : kString131;
case k140: return withSpeakersName ? kString140S : kString140; case k140: return withSpeakersName ? kString140S : kString140;
case k222: return withSpeakersName ? kString222S : kString222; case k222: return withSpeakersName ? kString222S : kString222;
case k220: return withSpeakersName ? kString220S : kString220;
break; break;
} }


@@ -684,8 +857,7 @@ inline CString getSpeakerArrangementString (SpeakerArrangement arr, bool withSpe
} }


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Returns a CString representation of a given speaker in a given arrangement
*/
/** Returns a CString representation of a given speaker in a given arrangement */
inline CString getSpeakerShortName (const SpeakerArrangement& arr, int32 index) inline CString getSpeakerShortName (const SpeakerArrangement& arr, int32 index)
{ {
SpeakerArrangement arrTmp = arr; SpeakerArrangement arrTmp = arr;
@@ -726,7 +898,7 @@ inline CString getSpeakerShortName (const SpeakerArrangement& arr, int32 index)
return "Lc"; return "Lc";
if (speaker == kSpeakerRc) if (speaker == kSpeakerRc)
return "Rc"; return "Rc";
if (speaker == kSpeakerS)
if (speaker == kSpeakerCs)
return "S"; return "S";
if (speaker == kSpeakerSl) if (speaker == kSpeakerSl)
return "Sl"; return "Sl";


+ 25
- 6
modules/juce_audio_processors/format_types/VST3_SDK/pluginterfaces/vst/vsttypes.h View File

@@ -22,20 +22,39 @@
namespace Steinberg { namespace Steinberg {
namespace Vst { namespace Vst {
//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** VST3 SDK Version */
#ifndef kVstVersionString #ifndef kVstVersionString
#define kVstVersionString "VST 3.6.13" ///< SDK version for PClassInfo2
#define kVstVersionString "VST 3.7.2" ///< SDK version for PClassInfo2
#endif #endif


#define kVstVersionMajor 3 #define kVstVersionMajor 3
#define kVstVersionMinor 6
#define kVstVersionSub 13
#define kVstVersionMinor 7
#define kVstVersionSub 2


// this allows to write things like: #if VST_VERSION >= 0x030500 // note that 3.10.0 is 0x030a00
#define VST_VERSION ((kVstVersionMajor << 16) | (kVstVersionMinor << 8) | kVstVersionSub) #define VST_VERSION ((kVstVersionMajor << 16) | (kVstVersionMinor << 8) | kVstVersionSub)


// Versions History which allows to write such code:
// #if VST_VERSION >= VST_3_6_5_VERSION
#define VST_3_7_2_VERSION 0x030702
#define VST_3_7_1_VERSION 0x030701
#define VST_3_7_0_VERSION 0x030700
#define VST_3_6_14_VERSION 0x03060E
#define VST_3_6_13_VERSION 0x03060D
#define VST_3_6_12_VERSION 0x03060C
#define VST_3_6_11_VERSION 0x03060B
#define VST_3_6_10_VERSION 0x03060A
#define VST_3_6_9_VERSION 0x030609
#define VST_3_6_8_VERSION 0x030608
#define VST_3_6_7_VERSION 0x030607
#define VST_3_6_6_VERSION 0x030606
#define VST_3_6_5_VERSION 0x030605
#define VST_3_6_0_VERSION 0x030600
#define VST_3_5_0_VERSION 0x030500
#define VST_3_1_0_VERSION 0x030100
#define VST_3_0_0_VERSION 0x030000

//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** \defgroup vst3typedef VST 3 Data Types
*/
/** \defgroup vst3typedef VST 3 Data Types */
/*@{*/ /*@{*/
//------------------------------------------------------------------------ //------------------------------------------------------------------------
// String Types // String Types


+ 1
- 1
modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/LICENSE.txt View File

@@ -1,6 +1,6 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LICENSE // LICENSE
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // are permitted provided that the following conditions are met:


+ 6
- 3
modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/README.md View File

@@ -1,9 +1,9 @@
# Welcome to VST SDK 3 public_sdk
# Welcome to VST 3 SDK public_sdk
Here are located: Here are located:
- helper classes implementing VST3 Interfaces - helper classes implementing VST3 Interfaces
- samples of VST3 hosting and VST3 Plug-Ins
- samples of VST3 Hosting and VST3 Plug-Ins
- AAX Wrapper - AAX Wrapper
- AU Wrapper - AU Wrapper
- AUv3 Wrapper - AUv3 Wrapper
@@ -12,4 +12,7 @@ Here are located:
## License & Usage guidelines ## License & Usage guidelines
More details are found at [www.steinberg.net/sdklicenses_vst3](http://www.steinberg.net/sdklicenses_vst3)
More details are found at [VST 3 SDK public_sdk License](https://forums.steinberg.net/t/vst-3-sdk-public-sdk-license/695592)
----
Return to [VST 3 SDK](https://github.com/steinbergmedia/vst3sdk)

+ 5
- 5
modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/common/memorystream.cpp View File

@@ -8,7 +8,7 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LICENSE // LICENSE
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // are permitted provided that the following conditions are met:
@@ -105,7 +105,7 @@ tresult PLUGIN_API MemoryStream::read (void* data, int32 numBytes, int32* numByt
if (numBytes) if (numBytes)
{ {
memcpy (data, &memory[cursor], numBytes);
memcpy (data, &memory[cursor], static_cast<size_t> (numBytes));
cursor += numBytes; cursor += numBytes;
} }
} }
@@ -137,7 +137,7 @@ tresult PLUGIN_API MemoryStream::write (void* buffer, int32 numBytes, int32* num
// Copy data // Copy data
if (memory && cursor >= 0 && numBytes > 0) if (memory && cursor >= 0 && numBytes > 0)
{ {
memcpy (&memory[cursor], buffer, numBytes);
memcpy (&memory[cursor], buffer, static_cast<size_t> (numBytes));
// Update cursor // Update cursor
cursor += numBytes; cursor += numBytes;
} }
@@ -187,7 +187,7 @@ tresult PLUGIN_API MemoryStream::tell (int64* pos)
} }


//------------------------------------------------------------------------ //------------------------------------------------------------------------
TSize MemoryStream::getSize ()
TSize MemoryStream::getSize () const
{ {
return size; return size;
} }
@@ -258,7 +258,7 @@ void MemoryStream::setSize (TSize s)
} }


//------------------------------------------------------------------------ //------------------------------------------------------------------------
char* MemoryStream::getData ()
char* MemoryStream::getData () const
{ {
return memory; return memory;
} }


+ 7
- 8
modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/common/memorystream.h View File

@@ -8,7 +8,7 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LICENSE // LICENSE
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // are permitted provided that the following conditions are met:
@@ -44,7 +44,6 @@ namespace Steinberg {
/** Memory based Stream for IBStream implementation (using malloc). /** Memory based Stream for IBStream implementation (using malloc).
\ingroup sdkBase \ingroup sdkBase
*/ */
//------------------------------------------------------------------------
class MemoryStream : public IBStream class MemoryStream : public IBStream
{ {
public: public:
@@ -54,14 +53,14 @@ public:
virtual ~MemoryStream (); virtual ~MemoryStream ();


//---IBStream--------------------------------------- //---IBStream---------------------------------------
virtual tresult PLUGIN_API read (void* buffer, int32 numBytes, int32* numBytesRead) SMTG_OVERRIDE;
virtual tresult PLUGIN_API write (void* buffer, int32 numBytes, int32* numBytesWritten) SMTG_OVERRIDE;
virtual tresult PLUGIN_API seek (int64 pos, int32 mode, int64* result) SMTG_OVERRIDE;
virtual tresult PLUGIN_API tell (int64* pos) SMTG_OVERRIDE;
tresult PLUGIN_API read (void* buffer, int32 numBytes, int32* numBytesRead) SMTG_OVERRIDE;
tresult PLUGIN_API write (void* buffer, int32 numBytes, int32* numBytesWritten) SMTG_OVERRIDE;
tresult PLUGIN_API seek (int64 pos, int32 mode, int64* result) SMTG_OVERRIDE;
tresult PLUGIN_API tell (int64* pos) SMTG_OVERRIDE;


TSize getSize (); ///< returns the current memory size
TSize getSize () const; ///< returns the current memory size
void setSize (TSize size); ///< set the memory size, a realloc will occur if memory already used void setSize (TSize size); ///< set the memory size, a realloc will occur if memory already used
char* getData (); ///< returns the memory pointer
char* getData () const; ///< returns the memory pointer
char* detachData (); ///< returns the memory pointer and give up ownership char* detachData (); ///< returns the memory pointer and give up ownership
bool truncate (); ///< realloc to the current use memory size if needed bool truncate (); ///< realloc to the current use memory size if needed
bool truncateToCursor (); ///< truncate memory at current cursor position bool truncateToCursor (); ///< truncate memory at current cursor position


+ 2
- 2
modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/common/pluginview.cpp View File

@@ -8,7 +8,7 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LICENSE // LICENSE
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // are permitted provided that the following conditions are met:
@@ -42,7 +42,7 @@ namespace Steinberg {
// CPluginView implementation // CPluginView implementation
//------------------------------------------------------------------------ //------------------------------------------------------------------------
CPluginView::CPluginView (const ViewRect* _rect) CPluginView::CPluginView (const ViewRect* _rect)
: rect (0, 0, 0, 0), systemWindow (nullptr), plugFrame (nullptr)
: rect (0, 0, 0, 0)
{ {
if (_rect) if (_rect)
rect = *_rect; rect = *_rect;


+ 30
- 17
modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/common/pluginview.h View File

@@ -8,7 +8,7 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LICENSE // LICENSE
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // are permitted provided that the following conditions are met:
@@ -44,10 +44,9 @@ namespace Steinberg {
//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Plug-In view default implementation. /** Plug-In view default implementation.
\ingroup sdkBase \ingroup sdkBase
Can be used as base class for an IPlugView implementation. */
//------------------------------------------------------------------------
class CPluginView: public FObject,
public IPlugView
Can be used as base class for an IPlugView implementation.
*/
class CPluginView : public FObject, public IPlugView
{ {
public: public:
//------------------------------------------------------------------------ //------------------------------------------------------------------------
@@ -55,13 +54,13 @@ public:
virtual ~CPluginView (); virtual ~CPluginView ();


/** Returns its current frame rectangle. */ /** Returns its current frame rectangle. */
const ViewRect& getRect () const { return rect; }
const ViewRect& getRect () const { return rect; }
/** Sets a new frame rectangle. */ /** Sets a new frame rectangle. */
void setRect (const ViewRect& r) { rect = r; }
void setRect (const ViewRect& r) { rect = r; }


/** Checks if this view is attached to its parent view. */ /** Checks if this view is attached to its parent view. */
bool isAttached () const { return systemWindow != nullptr; }
bool isAttached () const { return systemWindow != nullptr; }


/** Calls when this view will be attached to its parent view. */ /** Calls when this view will be attached to its parent view. */
virtual void attachedToParent () {} virtual void attachedToParent () {}
@@ -75,28 +74,42 @@ public:
tresult PLUGIN_API removed () SMTG_OVERRIDE; tresult PLUGIN_API removed () SMTG_OVERRIDE;


tresult PLUGIN_API onWheel (float /*distance*/) SMTG_OVERRIDE { return kResultFalse; } tresult PLUGIN_API onWheel (float /*distance*/) SMTG_OVERRIDE { return kResultFalse; }
tresult PLUGIN_API onKeyDown (char16 /*key*/, int16 /*keyMsg*/, int16 /*modifiers*/) SMTG_OVERRIDE { return kResultFalse; }
tresult PLUGIN_API onKeyUp (char16 /*key*/, int16 /*keyMsg*/, int16 /*modifiers*/) SMTG_OVERRIDE { return kResultFalse; }
tresult PLUGIN_API onKeyDown (char16 /*key*/, int16 /*keyMsg*/,
int16 /*modifiers*/) SMTG_OVERRIDE
{
return kResultFalse;
}
tresult PLUGIN_API onKeyUp (char16 /*key*/, int16 /*keyMsg*/, int16 /*modifiers*/) SMTG_OVERRIDE
{
return kResultFalse;
}
tresult PLUGIN_API getSize (ViewRect* size) SMTG_OVERRIDE; tresult PLUGIN_API getSize (ViewRect* size) SMTG_OVERRIDE;
tresult PLUGIN_API onSize (ViewRect* newSize) SMTG_OVERRIDE; tresult PLUGIN_API onSize (ViewRect* newSize) SMTG_OVERRIDE;


tresult PLUGIN_API onFocus (TBool /*state*/) SMTG_OVERRIDE { return kResultFalse; } tresult PLUGIN_API onFocus (TBool /*state*/) SMTG_OVERRIDE { return kResultFalse; }
tresult PLUGIN_API setFrame (IPlugFrame* frame) SMTG_OVERRIDE { plugFrame = frame; return kResultTrue; }
tresult PLUGIN_API setFrame (IPlugFrame* frame) SMTG_OVERRIDE
{
plugFrame = frame;
return kResultTrue;
}


tresult PLUGIN_API canResize () SMTG_OVERRIDE { return kResultFalse; } tresult PLUGIN_API canResize () SMTG_OVERRIDE { return kResultFalse; }
tresult PLUGIN_API checkSizeConstraint (ViewRect* /*rect*/) SMTG_OVERRIDE { return kResultFalse; }
tresult PLUGIN_API checkSizeConstraint (ViewRect* /*rect*/) SMTG_OVERRIDE
{
return kResultFalse;
}


//---Interface------ //---Interface------
OBJ_METHODS (CPluginView, FObject) OBJ_METHODS (CPluginView, FObject)
DEFINE_INTERFACES DEFINE_INTERFACES
DEF_INTERFACE (IPlugView) DEF_INTERFACE (IPlugView)
END_DEFINE_INTERFACES (FObject) END_DEFINE_INTERFACES (FObject)
REFCOUNT_METHODS(FObject)
REFCOUNT_METHODS (FObject)
//------------------------------------------------------------------------ //------------------------------------------------------------------------
protected: protected:
ViewRect rect; ViewRect rect;
void* systemWindow;
IPlugFrame* plugFrame;
void* systemWindow {nullptr};
IPlugFrame* plugFrame {nullptr};
}; };


} // namespace
} // namespace

+ 30
- 29
modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/vst/hosting/hostclasses.cpp View File

@@ -8,7 +8,7 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LICENSE // LICENSE
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // are permitted provided that the following conditions are met:
@@ -164,15 +164,16 @@ public:


HostAttribute (int64 value) : size (0), type (kInteger) { v.intValue = value; } HostAttribute (int64 value) : size (0), type (kInteger) { v.intValue = value; }
HostAttribute (double value) : size (0), type (kFloat) { v.floatValue = value; } HostAttribute (double value) : size (0), type (kFloat) { v.floatValue = value; }
HostAttribute (const TChar* value, uint32 size) : size (size), type (kString)
/** size is in code unit (count of TChar) */
HostAttribute (const TChar* value, uint32 sizeInCodeUnit) : size (sizeInCodeUnit), type (kString)
{ {
v.stringValue = new TChar[size];
memcpy (v.stringValue, value, size * sizeof (TChar));
v.stringValue = new TChar[sizeInCodeUnit];
memcpy (v.stringValue, value, sizeInCodeUnit * sizeof (TChar));
} }
HostAttribute (const void* value, uint32 size) : size (size), type (kBinary)
HostAttribute (const void* value, uint32 sizeInBytes) : size (sizeInBytes), type (kBinary)
{ {
v.binaryValue = new char[size];
memcpy (v.binaryValue, value, size);
v.binaryValue = new char[sizeInBytes];
memcpy (v.binaryValue, value, sizeInBytes);
} }
~HostAttribute () ~HostAttribute ()
{ {
@@ -182,14 +183,15 @@ public:


int64 intValue () const { return v.intValue; } int64 intValue () const { return v.intValue; }
double floatValue () const { return v.floatValue; } double floatValue () const { return v.floatValue; }
const TChar* stringValue (uint32& stringSize)
/** sizeInCodeUnit is in code unit (count of TChar) */
const TChar* stringValue (uint32& sizeInCodeUnit)
{ {
stringSize = size;
sizeInCodeUnit = size;
return v.stringValue; return v.stringValue;
} }
const void* binaryValue (uint32& binarySize)
const void* binaryValue (uint32& sizeInBytes)
{ {
binarySize = size;
sizeInBytes = size;
return v.binaryValue; return v.binaryValue;
} }


@@ -207,8 +209,6 @@ protected:
Type type; Type type;
}; };


using mapIterator = std::map<String, HostAttribute*>::iterator;

//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -222,7 +222,7 @@ HostAttributeList::HostAttributeList ()
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
HostAttributeList::~HostAttributeList () HostAttributeList::~HostAttributeList ()
{ {
std::map<String, HostAttribute*>::reverse_iterator it = list.rbegin ();
auto it = list.rbegin ();
while (it != list.rend ()) while (it != list.rend ())
{ {
delete it->second; delete it->second;
@@ -234,7 +234,7 @@ HostAttributeList::~HostAttributeList ()
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void HostAttributeList::removeAttrID (AttrID aid) void HostAttributeList::removeAttrID (AttrID aid)
{ {
mapIterator it = list.find (aid);
auto it = list.find (aid);
if (it != list.end ()) if (it != list.end ())
{ {
delete it->second; delete it->second;
@@ -253,7 +253,7 @@ tresult PLUGIN_API HostAttributeList::setInt (AttrID aid, int64 value)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
tresult PLUGIN_API HostAttributeList::getInt (AttrID aid, int64& value) tresult PLUGIN_API HostAttributeList::getInt (AttrID aid, int64& value)
{ {
mapIterator it = list.find (aid);
auto it = list.find (aid);
if (it != list.end () && it->second) if (it != list.end () && it->second)
{ {
value = it->second->intValue (); value = it->second->intValue ();
@@ -273,7 +273,7 @@ tresult PLUGIN_API HostAttributeList::setFloat (AttrID aid, double value)
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
tresult PLUGIN_API HostAttributeList::getFloat (AttrID aid, double& value) tresult PLUGIN_API HostAttributeList::getFloat (AttrID aid, double& value)
{ {
mapIterator it = list.find (aid);
auto it = list.find (aid);
if (it != list.end () && it->second) if (it != list.end () && it->second)
{ {
value = it->second->floatValue (); value = it->second->floatValue ();
@@ -286,42 +286,43 @@ tresult PLUGIN_API HostAttributeList::getFloat (AttrID aid, double& value)
tresult PLUGIN_API HostAttributeList::setString (AttrID aid, const TChar* string) tresult PLUGIN_API HostAttributeList::setString (AttrID aid, const TChar* string)
{ {
removeAttrID (aid); removeAttrID (aid);
list[aid] = new HostAttribute (string, String (const_cast<TChar*> (string)).length ());
// + 1 for the null-terminate
list[aid] = new HostAttribute (string, String (string).length () + 1);
return kResultTrue; return kResultTrue;
} }


//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
tresult PLUGIN_API HostAttributeList::getString (AttrID aid, TChar* string, uint32 size)
tresult PLUGIN_API HostAttributeList::getString (AttrID aid, TChar* string, uint32 sizeInBytes)
{ {
mapIterator it = list.find (aid);
auto it = list.find (aid);
if (it != list.end () && it->second) if (it != list.end () && it->second)
{ {
uint32 stringSize = 0;
const TChar* _string = it->second->stringValue (stringSize);
memcpy (string, _string, std::min<uint32> (stringSize, size) * sizeof (TChar));
uint32 sizeInCodeUnit = 0;
const TChar* _string = it->second->stringValue (sizeInCodeUnit);
memcpy (string, _string, std::min<uint32> (sizeInCodeUnit * sizeof (TChar), sizeInBytes));
return kResultTrue; return kResultTrue;
} }
return kResultFalse; return kResultFalse;
} }


//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
tresult PLUGIN_API HostAttributeList::setBinary (AttrID aid, const void* data, uint32 size)
tresult PLUGIN_API HostAttributeList::setBinary (AttrID aid, const void* data, uint32 sizeInBytes)
{ {
removeAttrID (aid); removeAttrID (aid);
list[aid] = new HostAttribute (data, size);
list[aid] = new HostAttribute (data, sizeInBytes);
return kResultTrue; return kResultTrue;
} }


//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
tresult PLUGIN_API HostAttributeList::getBinary (AttrID aid, const void*& data, uint32& size)
tresult PLUGIN_API HostAttributeList::getBinary (AttrID aid, const void*& data, uint32& sizeInBytes)
{ {
mapIterator it = list.find (aid);
auto it = list.find (aid);
if (it != list.end () && it->second) if (it != list.end () && it->second)
{ {
data = it->second->binaryValue (size);
data = it->second->binaryValue (sizeInBytes);
return kResultTrue; return kResultTrue;
} }
size = 0;
sizeInBytes = 0;
return kResultFalse; return kResultFalse;
} }
} }


+ 4
- 4
modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/vst/hosting/hostclasses.h View File

@@ -8,7 +8,7 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LICENSE // LICENSE
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // are permitted provided that the following conditions are met:
@@ -82,9 +82,9 @@ public:
tresult PLUGIN_API setFloat (AttrID aid, double value) SMTG_OVERRIDE; tresult PLUGIN_API setFloat (AttrID aid, double value) SMTG_OVERRIDE;
tresult PLUGIN_API getFloat (AttrID aid, double& value) SMTG_OVERRIDE; tresult PLUGIN_API getFloat (AttrID aid, double& value) SMTG_OVERRIDE;
tresult PLUGIN_API setString (AttrID aid, const TChar* string) SMTG_OVERRIDE; tresult PLUGIN_API setString (AttrID aid, const TChar* string) SMTG_OVERRIDE;
tresult PLUGIN_API getString (AttrID aid, TChar* string, uint32 size) SMTG_OVERRIDE;
tresult PLUGIN_API setBinary (AttrID aid, const void* data, uint32 size) SMTG_OVERRIDE;
tresult PLUGIN_API getBinary (AttrID aid, const void*& data, uint32& size) SMTG_OVERRIDE;
tresult PLUGIN_API getString (AttrID aid, TChar* string, uint32 sizeInBytes) SMTG_OVERRIDE;
tresult PLUGIN_API setBinary (AttrID aid, const void* data, uint32 sizeInBytes) SMTG_OVERRIDE;
tresult PLUGIN_API getBinary (AttrID aid, const void*& data, uint32& sizeInBytes) SMTG_OVERRIDE;


DECLARE_FUNKNOWN_METHODS DECLARE_FUNKNOWN_METHODS
protected: protected:


+ 6
- 1
modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/vst/hosting/pluginterfacesupport.cpp View File

@@ -8,7 +8,7 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LICENSE // LICENSE
// (c) 2018, Steinberg Media Technologies GmbH, All Rights Reserved
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // are permitted provided that the following conditions are met:
@@ -91,6 +91,11 @@ PlugInterfaceSupport::PlugInterfaceSupport ()


//---VST 3.6.12-------------------------------- //---VST 3.6.12--------------------------------
addPlugInterfaceSupported (IMidiLearn::iid); addPlugInterfaceSupported (IMidiLearn::iid);

//---VST 3.7-----------------------------------
addPlugInterfaceSupported (IProcessContextRequirements::iid);
addPlugInterfaceSupported (IParameterFunctionName::iid);
addPlugInterfaceSupported (IProgress::iid);
*/ */
} }




+ 1
- 1
modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/vst/hosting/pluginterfacesupport.h View File

@@ -8,7 +8,7 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LICENSE // LICENSE
// (c) 2018, Steinberg Media Technologies GmbH, All Rights Reserved
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // are permitted provided that the following conditions are met:


+ 1
- 1
modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/vst/vstbus.cpp View File

@@ -8,7 +8,7 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LICENSE // LICENSE
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // are permitted provided that the following conditions are met:


+ 11
- 11
modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/vst/vstbus.h View File

@@ -8,7 +8,7 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LICENSE // LICENSE
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // are permitted provided that the following conditions are met:
@@ -49,8 +49,8 @@ namespace Vst {


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Basic Bus object. /** Basic Bus object.
\ingroup vstClasses */
//------------------------------------------------------------------------
\ingroup vstClasses
*/
class Bus: public FObject class Bus: public FObject
{ {
public: public:
@@ -81,14 +81,14 @@ public:
protected: protected:
String name; ///< name String name; ///< name
BusType busType; ///< kMain or kAux, see \ref BusTypes BusType busType; ///< kMain or kAux, see \ref BusTypes
int32 flags; ///< flags, see \ref BusFlags
int32 flags; ///< flags, see \ref BusInfo::BusFlags
TBool active; ///< activation state TBool active; ///< activation state
}; };


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Description of an Event Bus. /** Description of an Event Bus.
\ingroup vstClasses */
//------------------------------------------------------------------------
\ingroup vstClasses
*/
class EventBus: public Bus class EventBus: public Bus
{ {
public: public:
@@ -109,8 +109,8 @@ protected:


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Description of an Audio Bus. /** Description of an Audio Bus.
\ingroup vstClasses */
//------------------------------------------------------------------------
\ingroup vstClasses
*/
class AudioBus: public Bus class AudioBus: public Bus
{ {
public: public:
@@ -135,9 +135,9 @@ protected:
}; };


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** List of Buses.
\ingroup vstClasses */
//------------------------------------------------------------------------
/** List of Busses.
\ingroup vstClasses
*/
class BusList: public FObject, public std::vector<IPtr<Vst::Bus> > class BusList: public FObject, public std::vector<IPtr<Vst::Bus> >
{ {
public: public:


+ 3
- 3
modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/vst/vstcomponent.cpp View File

@@ -8,7 +8,7 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LICENSE // LICENSE
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // are permitted provided that the following conditions are met:
@@ -59,7 +59,7 @@ tresult PLUGIN_API Component::initialize (FUnknown* context)
//------------------------------------------------------------------------ //------------------------------------------------------------------------
tresult PLUGIN_API Component::terminate () tresult PLUGIN_API Component::terminate ()
{ {
// remove all buses
// remove all busses
removeAllBusses (); removeAllBusses ();


return ComponentBase::terminate (); return ComponentBase::terminate ();
@@ -210,7 +210,7 @@ tresult Component::renameBus (MediaType type, BusDirection dir, int32 index,
tresult getSpeakerChannelIndex (SpeakerArrangement arrangement, uint64 speaker, int32& channel) tresult getSpeakerChannelIndex (SpeakerArrangement arrangement, uint64 speaker, int32& channel)
{ {
channel = SpeakerArr::getSpeakerIndex (speaker, arrangement); channel = SpeakerArr::getSpeakerIndex (speaker, arrangement);
return channel < 0 ? kResultFalse : kResultTrue;
return (channel < 0) == true ? kResultFalse : kResultTrue;
} }
} // namespace Vst } // namespace Vst
} // namespace Steinberg } // namespace Steinberg

+ 5
- 5
modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/vst/vstcomponent.h View File

@@ -8,7 +8,7 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LICENSE // LICENSE
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // are permitted provided that the following conditions are met:
@@ -47,8 +47,8 @@ namespace Vst {
//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Default implementation for a VST 3 Component. /** Default implementation for a VST 3 Component.
\ingroup vstClasses \ingroup vstClasses
Can be used as base class for a VST 3 component implementation. */
//------------------------------------------------------------------------
Can be used as base class for a VST 3 component implementation.
*/
class Component : public ComponentBase, public IComponent class Component : public ComponentBase, public IComponent
{ {
public: public:
@@ -60,10 +60,10 @@ public:
/** Sets the controller Class ID associated to its component. */ /** Sets the controller Class ID associated to its component. */
void setControllerClass (const FUID& cid) { controllerClass = cid; } void setControllerClass (const FUID& cid) { controllerClass = cid; }


/** Removes all Audio Buses. */
/** Removes all Audio Busses. */
tresult removeAudioBusses (); tresult removeAudioBusses ();


/** Removes all Event Buses. */
/** Removes all Event Busses. */
tresult removeEventBusses (); tresult removeEventBusses ();


/** Renames a specific bus. Do not forget to inform the host about this (see \ref /** Renames a specific bus. Do not forget to inform the host about this (see \ref


+ 28
- 28
modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/vst/vstcomponentbase.cpp View File

@@ -8,7 +8,7 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LICENSE // LICENSE
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // are permitted provided that the following conditions are met:
@@ -43,7 +43,7 @@ namespace Vst {
//------------------------------------------------------------------------ //------------------------------------------------------------------------
// ComponentBase Implementation // ComponentBase Implementation
//------------------------------------------------------------------------ //------------------------------------------------------------------------
ComponentBase::ComponentBase () : hostContext (nullptr), peerConnection (nullptr)
ComponentBase::ComponentBase ()
{ {
} }


@@ -60,8 +60,6 @@ tresult PLUGIN_API ComponentBase::initialize (FUnknown* context)
return kResultFalse; return kResultFalse;


hostContext = context; hostContext = context;
if (hostContext)
hostContext->addRef ();


return kResultOk; return kResultOk;
} }
@@ -70,18 +68,13 @@ tresult PLUGIN_API ComponentBase::initialize (FUnknown* context)
tresult PLUGIN_API ComponentBase::terminate () tresult PLUGIN_API ComponentBase::terminate ()
{ {
// release host interfaces // release host interfaces
if (hostContext)
{
hostContext->release ();
hostContext = nullptr;
}
hostContext = nullptr;


// in case host did not disconnect us, // in case host did not disconnect us,
// release peer now // release peer now
if (peerConnection) if (peerConnection)
{ {
peerConnection->disconnect (this); peerConnection->disconnect (this);
peerConnection->release ();
peerConnection = nullptr; peerConnection = nullptr;
} }


@@ -99,7 +92,6 @@ tresult PLUGIN_API ComponentBase::connect (IConnectionPoint* other)
return kResultFalse; return kResultFalse;


peerConnection = other; peerConnection = other;
peerConnection->addRef ();
return kResultOk; return kResultOk;
} }


@@ -108,7 +100,6 @@ tresult PLUGIN_API ComponentBase::disconnect (IConnectionPoint* other)
{ {
if (peerConnection && other == peerConnection) if (peerConnection && other == peerConnection)
{ {
peerConnection->release ();
peerConnection = nullptr; peerConnection = nullptr;
return kResultOk; return kResultOk;
} }
@@ -121,11 +112,10 @@ tresult PLUGIN_API ComponentBase::notify (IMessage* message)
if (!message) if (!message)
return kInvalidArgument; return kInvalidArgument;


if (!strcmp (message->getMessageID (), "TextMessage"))
if (FIDStringsEqual (message->getMessageID (), "TextMessage"))
{ {
TChar string[256] = {0}; TChar string[256] = {0};
if (message->getAttributes ()->getString ("Text", string,
sizeof (string) / sizeof (char16)) == kResultOk)
if (message->getAttributes ()->getString ("Text", string, sizeof (string)) == kResultOk)
{ {
String tmp (string); String tmp (string);
tmp.toMultiByte (kCP_Utf8); tmp.toMultiByte (kCP_Utf8);
@@ -137,7 +127,7 @@ tresult PLUGIN_API ComponentBase::notify (IMessage* message)
} }


//------------------------------------------------------------------------ //------------------------------------------------------------------------
IMessage* ComponentBase::allocateMessage ()
IMessage* ComponentBase::allocateMessage () const
{ {
FUnknownPtr<IHostApplication> hostApp (hostContext); FUnknownPtr<IHostApplication> hostApp (hostContext);
if (hostApp) if (hostApp)
@@ -146,7 +136,7 @@ IMessage* ComponentBase::allocateMessage ()
} }


//------------------------------------------------------------------------ //------------------------------------------------------------------------
tresult ComponentBase::sendMessage (IMessage* message)
tresult ComponentBase::sendMessage (IMessage* message) const
{ {
if (message != nullptr && getPeer () != nullptr) if (message != nullptr && getPeer () != nullptr)
return getPeer ()->notify (message); return getPeer ()->notify (message);
@@ -154,19 +144,29 @@ tresult ComponentBase::sendMessage (IMessage* message)
} }


//------------------------------------------------------------------------ //------------------------------------------------------------------------
tresult ComponentBase::sendTextMessage (const char8* text)
tresult ComponentBase::sendTextMessage (const char8* text) const
{ {
IMessage* message = allocateMessage ();
if (!message)
return kResultFalse;
if (auto msg = owned (allocateMessage ()))
{
msg->setMessageID ("TextMessage");
String tmp (text, kCP_Utf8);
if (tmp.length () >= 256)
tmp.remove (255);
msg->getAttributes ()->setString ("Text", tmp.text16 ());
return sendMessage (msg);
}
return kResultFalse;
}


FReleaser msgReleaser (message);
message->setMessageID ("TextMessage");
String tmp (text, kCP_Utf8);
if (tmp.length () >= 256)
tmp.remove (255);
message->getAttributes ()->setString ("Text", tmp.text16 ());
return sendMessage (message);
//------------------------------------------------------------------------
tresult ComponentBase::sendMessageID (const char* messageID) const
{
if (auto msg = owned (allocateMessage ()))
{
msg->setMessageID (messageID);
return sendMessage (msg);
}
return kResultFalse;
} }


//------------------------------------------------------------------------ //------------------------------------------------------------------------


+ 17
- 14
modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/vst/vstcomponentbase.h View File

@@ -8,7 +8,7 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LICENSE // LICENSE
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // are permitted provided that the following conditions are met:
@@ -47,8 +47,8 @@ namespace Vst {


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Base class for VST 3 Component and Edit Controller. /** Base class for VST 3 Component and Edit Controller.
\ingroup vstClasses */
//------------------------------------------------------------------------
\ingroup vstClasses
*/
class ComponentBase: public FObject, class ComponentBase: public FObject,
public IPluginBase, public IPluginBase,
public IConnectionPoint public IConnectionPoint
@@ -56,25 +56,28 @@ class ComponentBase: public FObject,
public: public:
//------------------------------------------------------------------------ //------------------------------------------------------------------------
ComponentBase (); ComponentBase ();
virtual ~ComponentBase ();
~ComponentBase () override;


//--- Internal Methods------ //--- Internal Methods------
/** Returns the hostContext (set by the host during initialize call). */ /** Returns the hostContext (set by the host during initialize call). */
FUnknown* getHostContext () { return hostContext; }
FUnknown* getHostContext () const { return hostContext; }


/** Returns the peer for the messaging communication (you can only use IConnectionPoint::notify /** Returns the peer for the messaging communication (you can only use IConnectionPoint::notify
* for communicate between peers, do not try to cast peerConnection. */ * for communicate between peers, do not try to cast peerConnection. */
IConnectionPoint* getPeer () { return peerConnection; }
IConnectionPoint* getPeer () const { return peerConnection; }


/** Allocates a message instance (don't forget to release it). */
IMessage* allocateMessage ();
/** Allocates a message instance (do not forget to release it). */
IMessage* allocateMessage () const;


/** Sends the given message to the peer. */ /** Sends the given message to the peer. */
tresult sendMessage (IMessage* message);
tresult sendMessage (IMessage* message) const;

/** Sends a simple text message to the peer (max 255 characters).
Text is interpreted as UTF-8. */
tresult sendTextMessage (const char8* text) const;


/** Sends a simple text message to the peer (max 255 characters). Text is interpreted as UTF-8.
*/
tresult sendTextMessage (const char8* text);
/** Sends a message with a given ID without any other payload. */
tresult sendMessageID (const char8* messageID) const;


/** Receives a simple text message from the peer (max 255 characters). Text is UTF-8 encoded. */ /** Receives a simple text message from the peer (max 255 characters). Text is UTF-8 encoded. */
virtual tresult receiveText (const char8* text); virtual tresult receiveText (const char8* text);
@@ -98,8 +101,8 @@ public:


//------------------------------------------------------------------------ //------------------------------------------------------------------------
protected: protected:
FUnknown* hostContext;
IConnectionPoint* peerConnection;
IPtr<FUnknown> hostContext;
IPtr<IConnectionPoint> peerConnection;
}; };


//------------------------------------------------------------------------ //------------------------------------------------------------------------


+ 40
- 38
modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/vst/vsteditcontroller.cpp View File

@@ -8,7 +8,7 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LICENSE // LICENSE
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // are permitted provided that the following conditions are met:
@@ -38,7 +38,7 @@
#include "base/source/updatehandler.h" #include "base/source/updatehandler.h"
#include "pluginterfaces/base/ustring.h" #include "pluginterfaces/base/ustring.h"


#include <stdio.h>
#include <cstdio>


namespace Steinberg { namespace Steinberg {
namespace Vst { namespace Vst {
@@ -105,8 +105,7 @@ int32 PLUGIN_API EditController::getParameterCount ()
//------------------------------------------------------------------------ //------------------------------------------------------------------------
tresult PLUGIN_API EditController::getParameterInfo (int32 paramIndex, ParameterInfo& info) tresult PLUGIN_API EditController::getParameterInfo (int32 paramIndex, ParameterInfo& info)
{ {
Parameter* parameter = parameters.getParameterByIndex (paramIndex);
if (parameter)
if (Parameter* parameter = parameters.getParameterByIndex (paramIndex))
{ {
info = parameter->getInfo (); info = parameter->getInfo ();
return kResultTrue; return kResultTrue;
@@ -118,8 +117,7 @@ tresult PLUGIN_API EditController::getParameterInfo (int32 paramIndex, Parameter
tresult PLUGIN_API EditController::getParamStringByValue (ParamID tag, ParamValue valueNormalized, tresult PLUGIN_API EditController::getParamStringByValue (ParamID tag, ParamValue valueNormalized,
String128 string) String128 string)
{ {
Parameter* parameter = getParameterObject (tag);
if (parameter)
if (Parameter* parameter = getParameterObject (tag))
{ {
parameter->toString (valueNormalized, string); parameter->toString (valueNormalized, string);
return kResultTrue; return kResultTrue;
@@ -131,8 +129,7 @@ tresult PLUGIN_API EditController::getParamStringByValue (ParamID tag, ParamValu
tresult PLUGIN_API EditController::getParamValueByString (ParamID tag, TChar* string, tresult PLUGIN_API EditController::getParamValueByString (ParamID tag, TChar* string,
ParamValue& valueNormalized) ParamValue& valueNormalized)
{ {
Parameter* parameter = getParameterObject (tag);
if (parameter)
if (Parameter* parameter = getParameterObject (tag))
{ {
if (parameter->fromString (string, valueNormalized)) if (parameter->fromString (string, valueNormalized))
{ {
@@ -146,8 +143,7 @@ tresult PLUGIN_API EditController::getParamValueByString (ParamID tag, TChar* st
ParamValue PLUGIN_API EditController::normalizedParamToPlain (ParamID tag, ParamValue PLUGIN_API EditController::normalizedParamToPlain (ParamID tag,
ParamValue valueNormalized) ParamValue valueNormalized)
{ {
Parameter* parameter = getParameterObject (tag);
if (parameter)
if (Parameter* parameter = getParameterObject (tag))
{ {
return parameter->toPlain (valueNormalized); return parameter->toPlain (valueNormalized);
} }
@@ -157,8 +153,7 @@ ParamValue PLUGIN_API EditController::normalizedParamToPlain (ParamID tag,
//------------------------------------------------------------------------ //------------------------------------------------------------------------
ParamValue PLUGIN_API EditController::plainParamToNormalized (ParamID tag, ParamValue plainValue) ParamValue PLUGIN_API EditController::plainParamToNormalized (ParamID tag, ParamValue plainValue)
{ {
Parameter* parameter = getParameterObject (tag);
if (parameter)
if (Parameter* parameter = getParameterObject (tag))
{ {
return parameter->toNormalized (plainValue); return parameter->toNormalized (plainValue);
} }
@@ -168,8 +163,7 @@ ParamValue PLUGIN_API EditController::plainParamToNormalized (ParamID tag, Param
//------------------------------------------------------------------------ //------------------------------------------------------------------------
ParamValue PLUGIN_API EditController::getParamNormalized (ParamID tag) ParamValue PLUGIN_API EditController::getParamNormalized (ParamID tag)
{ {
Parameter* parameter = getParameterObject (tag);
if (parameter)
if (Parameter* parameter = getParameterObject (tag))
{ {
return parameter->getNormalized (); return parameter->getNormalized ();
} }
@@ -179,8 +173,7 @@ ParamValue PLUGIN_API EditController::getParamNormalized (ParamID tag)
//------------------------------------------------------------------------ //------------------------------------------------------------------------
tresult PLUGIN_API EditController::setParamNormalized (ParamID tag, ParamValue value) tresult PLUGIN_API EditController::setParamNormalized (ParamID tag, ParamValue value)
{ {
Parameter* parameter = getParameterObject (tag);
if (parameter)
if (Parameter* parameter = getParameterObject (tag))
{ {
parameter->setNormalized (value); parameter->setNormalized (value);
return kResultTrue; return kResultTrue;
@@ -274,8 +267,7 @@ tresult EditController::finishGroupEdit ()
//------------------------------------------------------------------------ //------------------------------------------------------------------------
tresult EditController::getParameterInfoByTag (ParamID tag, ParameterInfo& info) tresult EditController::getParameterInfoByTag (ParamID tag, ParameterInfo& info)
{ {
Parameter* parameter = getParameterObject (tag);
if (parameter)
if (Parameter* parameter = getParameterObject (tag))
{ {
info = parameter->getInfo (); info = parameter->getInfo ();
return kResultTrue; return kResultTrue;
@@ -303,11 +295,12 @@ tresult EditController::requestOpenEditor (FIDString name)
return kNotImplemented; return kNotImplemented;
} }


#ifndef NO_PLUGUI
//------------------------------------------------------------------------ //------------------------------------------------------------------------
// EditorView Implementation // EditorView Implementation
//------------------------------------------------------------------------ //------------------------------------------------------------------------
EditorView::EditorView (EditController* controller, ViewRect* size)
: CPluginView (size), controller (controller)
EditorView::EditorView (EditController* _controller, ViewRect* size)
: CPluginView (size), controller (_controller)
{ {
if (controller) if (controller)
{ {
@@ -342,6 +335,7 @@ void EditorView::removedFromParent ()
controller->editorRemoved (this); controller->editorRemoved (this);
} }
} }
#endif // NO_PLUGUI


//------------------------------------------------------------------------ //------------------------------------------------------------------------
// EditControllerEx1 implementation // EditControllerEx1 implementation
@@ -354,26 +348,35 @@ EditControllerEx1::EditControllerEx1 () : selectedUnit (kRootUnitId)
//------------------------------------------------------------------------ //------------------------------------------------------------------------
EditControllerEx1::~EditControllerEx1 () EditControllerEx1::~EditControllerEx1 ()
{ {
for (ProgramListVector::const_iterator it = programLists.begin (), end = programLists.end ();
it != end; ++it)
}

//------------------------------------------------------------------------
tresult PLUGIN_API EditControllerEx1::terminate ()
{
units.clear ();

for (const auto& programList : programLists)
{ {
if (*it)
(*it)->removeDependent (this);
if (programList)
programList->removeDependent (this);
} }
programLists.clear ();
programIndexMap.clear ();

return EditController::terminate ();
} }


//------------------------------------------------------------------------ //------------------------------------------------------------------------
bool EditControllerEx1::addUnit (Unit* unit) bool EditControllerEx1::addUnit (Unit* unit)
{ {
units.push_back (IPtr<Unit> (unit, false));
units.emplace_back (unit, false);
return true; return true;
} }


//------------------------------------------------------------------------ //------------------------------------------------------------------------
tresult PLUGIN_API EditControllerEx1::getUnitInfo (int32 unitIndex, UnitInfo& info /*out*/) tresult PLUGIN_API EditControllerEx1::getUnitInfo (int32 unitIndex, UnitInfo& info /*out*/)
{ {
Unit* unit = units.at (unitIndex);
if (unit)
if (Unit* unit = units.at (unitIndex))
{ {
info = unit->getInfo (); info = unit->getInfo ();
return kResultTrue; return kResultTrue;
@@ -395,7 +398,7 @@ tresult EditControllerEx1::notifyUnitSelection ()
bool EditControllerEx1::addProgramList (ProgramList* list) bool EditControllerEx1::addProgramList (ProgramList* list)
{ {
programIndexMap[list->getID ()] = programLists.size (); programIndexMap[list->getID ()] = programLists.size ();
programLists.push_back (IPtr<ProgramList> (list, false));
programLists.emplace_back (list, false);
list->addDependent (this); list->addDependent (this);
return true; return true;
} }
@@ -558,8 +561,8 @@ ProgramList::ProgramList (const ProgramList& programList)
int32 ProgramList::addProgram (const String128 name) int32 ProgramList::addProgram (const String128 name)
{ {
++info.programCount; ++info.programCount;
programNames.push_back (name);
programInfos.push_back (ProgramInfoVector::value_type ());
programNames.emplace_back (name);
programInfos.emplace_back ();
return static_cast<int32> (programNames.size ()) - 1; return static_cast<int32> (programNames.size ()) - 1;
} }


@@ -625,13 +628,12 @@ Parameter* ProgramList::getParameter ()
if (parameter == nullptr) if (parameter == nullptr)
{ {
auto* listParameter = new StringListParameter ( auto* listParameter = new StringListParameter (
info.name, info.id, nullptr,
ParameterInfo::kCanAutomate | ParameterInfo::kIsList | ParameterInfo::kIsProgramChange,
unitId);
for (StringVector::const_iterator it = programNames.begin (), end = programNames.end ();
it != end; ++it)
info.name, info.id, nullptr,
ParameterInfo::kCanAutomate | ParameterInfo::kIsList | ParameterInfo::kIsProgramChange,
unitId);
for (const auto& programName : programNames)
{ {
listParameter->appendString (*it);
listParameter->appendString (programName);
} }
parameter = listParameter; parameter = listParameter;
} }
@@ -652,7 +654,7 @@ int32 ProgramListWithPitchNames::addProgram (const String128 name)
{ {
int32 index = ProgramList::addProgram (name); int32 index = ProgramList::addProgram (name);
if (index >= 0) if (index >= 0)
pitchNames.push_back (PitchNamesVector::value_type ());
pitchNames.emplace_back ();
return index; return index;
} }


@@ -696,7 +698,7 @@ bool ProgramListWithPitchNames::removePitchName (int32 programIndex, int16 pitch
tresult ProgramListWithPitchNames::hasPitchNames (int32 programIndex) tresult ProgramListWithPitchNames::hasPitchNames (int32 programIndex)
{ {
if (programIndex >= 0 && programIndex < getCount ()) if (programIndex >= 0 && programIndex < getCount ())
return pitchNames.at (programIndex).empty () ? kResultFalse : kResultTrue;
return (pitchNames.at (programIndex).empty () == true) ? kResultFalse : kResultTrue;
return kResultFalse; return kResultFalse;
} }




+ 19
- 19
modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/vst/vsteditcontroller.h View File

@@ -8,7 +8,7 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LICENSE // LICENSE
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // are permitted provided that the following conditions are met:
@@ -56,11 +56,9 @@ class EditorView;
//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Default implementation for a VST 3 edit controller. /** Default implementation for a VST 3 edit controller.
\ingroup vstClasses \ingroup vstClasses
Can be used as base class for a specific controller implementation */
//------------------------------------------------------------------------
class EditController: public ComponentBase,
public IEditController,
public IEditController2
Can be used as base class for a specific controller implementation
*/
class EditController : public ComponentBase, public IEditController, public IEditController2
{ {
public: public:
//------------------------------------------------------------------------ //------------------------------------------------------------------------
@@ -88,7 +86,7 @@ public:


//---from ComponentBase--------- //---from ComponentBase---------
tresult PLUGIN_API initialize (FUnknown* context) SMTG_OVERRIDE; tresult PLUGIN_API initialize (FUnknown* context) SMTG_OVERRIDE;
tresult PLUGIN_API terminate () SMTG_OVERRIDE;
tresult PLUGIN_API terminate () SMTG_OVERRIDE;


//---Internal Methods------- //---Internal Methods-------
virtual tresult beginEdit (ParamID tag); ///< to be called before a serie of performEdit virtual tresult beginEdit (ParamID tag); ///< to be called before a serie of performEdit
@@ -137,17 +135,17 @@ protected:


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** View related to an edit controller. /** View related to an edit controller.
\ingroup vstClasses */
//------------------------------------------------------------------------
\ingroup vstClasses
*/
class EditorView : public CPluginView class EditorView : public CPluginView
{ {
public: public:
//------------------------------------------------------------------------ //------------------------------------------------------------------------
EditorView (EditController* controller, ViewRect* size = nullptr); EditorView (EditController* controller, ViewRect* size = nullptr);
virtual ~EditorView ();
~EditorView () override;


/** Gets its controller part. */ /** Gets its controller part. */
EditController* getController () { return controller; }
EditController* getController () const { return controller; }


//---from CPluginView------------- //---from CPluginView-------------
void attachedToParent () SMTG_OVERRIDE; void attachedToParent () SMTG_OVERRIDE;
@@ -160,8 +158,8 @@ protected:


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Unit element. /** Unit element.
\ingroup vstClasses */
//------------------------------------------------------------------------
\ingroup vstClasses
*/
class Unit : public FObject class Unit : public FObject
{ {
public: public:
@@ -200,8 +198,8 @@ protected:


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** ProgramList element. /** ProgramList element.
\ingroup vstClasses */
//------------------------------------------------------------------------
\ingroup vstClasses
*/
class ProgramList : public FObject class ProgramList : public FObject
{ {
public: public:
@@ -255,8 +253,8 @@ protected:


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** ProgramListWithPitchNames element. /** ProgramListWithPitchNames element.
\ingroup vstClasses */
//-----------------------------------------------------------------------------
\ingroup vstClasses
*/
class ProgramListWithPitchNames : public ProgramList class ProgramListWithPitchNames : public ProgramList
{ {
public: public:
@@ -287,12 +285,14 @@ protected:
\ingroup vstClasses \ingroup vstClasses
- [extends EditController] - [extends EditController]
*/ */
//------------------------------------------------------------------------
class EditControllerEx1 : public EditController, public IUnitInfo class EditControllerEx1 : public EditController, public IUnitInfo
{ {
public: public:
EditControllerEx1 (); EditControllerEx1 ();
virtual ~EditControllerEx1 ();
~EditControllerEx1 () override;

//---from ComponentBase---------
tresult PLUGIN_API terminate () SMTG_OVERRIDE;


/** Adds a given unit. */ /** Adds a given unit. */
bool addUnit (Unit* unit); bool addUnit (Unit* unit);


+ 8
- 1
modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/vst/vstinitiids.cpp View File

@@ -8,7 +8,7 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LICENSE // LICENSE
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // are permitted provided that the following conditions are met:
@@ -47,6 +47,7 @@
#include "pluginterfaces/vst/ivstmessage.h" #include "pluginterfaces/vst/ivstmessage.h"
#include "pluginterfaces/vst/ivstmidilearn.h" #include "pluginterfaces/vst/ivstmidilearn.h"
#include "pluginterfaces/vst/ivstparameterchanges.h" #include "pluginterfaces/vst/ivstparameterchanges.h"
#include "pluginterfaces/vst/ivstparameterfunctionname.h"
#include "pluginterfaces/vst/ivstphysicalui.h" #include "pluginterfaces/vst/ivstphysicalui.h"
#include "pluginterfaces/vst/ivstpluginterfacesupport.h" #include "pluginterfaces/vst/ivstpluginterfacesupport.h"
#include "pluginterfaces/vst/ivstplugview.h" #include "pluginterfaces/vst/ivstplugview.h"
@@ -131,6 +132,12 @@ DEF_CLASS_IID (IVst3WrapperMPESupport)
//----VST 3.6.13-------------------------------- //----VST 3.6.13--------------------------------
DEF_CLASS_IID (ITestPlugProvider) DEF_CLASS_IID (ITestPlugProvider)


//----VST 3.7-----------------------------------
DEF_CLASS_IID (IParameterFunctionName)
DEF_CLASS_IID (IProcessContextRequirements)
DEF_CLASS_IID (IProgress)
DEF_CLASS_IID (ITestPlugProvider2)

//------------------------------------------------------------------------ //------------------------------------------------------------------------
} // Vst } // Vst
} // Steinberg } // Steinberg

+ 26
- 13
modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/vst/vstparameters.cpp View File

@@ -8,7 +8,7 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LICENSE // LICENSE
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // are permitted provided that the following conditions are met:
@@ -47,7 +47,7 @@ namespace Vst {
//------------------------------------------------------------------------ //------------------------------------------------------------------------
Parameter::Parameter () : valueNormalized (0.), precision (4) Parameter::Parameter () : valueNormalized (0.), precision (4)
{ {
info = { 0 };
info = {};
} }


//------------------------------------------------------------------------ //------------------------------------------------------------------------
@@ -62,7 +62,7 @@ Parameter::Parameter (const TChar* title, ParamID tag, const TChar* units,
UnitID unitID, const TChar* shortTitle) UnitID unitID, const TChar* shortTitle)
: precision (4) : precision (4)
{ {
info = { 0 };
info = {};


UString (info.title, str16BufferSize (String128)).assign (title); UString (info.title, str16BufferSize (String128)).assign (title);
if (units) if (units)
@@ -223,8 +223,7 @@ bool RangeParameter::fromString (const TChar* string, ParamValue& _valueNormaliz
ParamValue RangeParameter::toPlain (ParamValue _valueNormalized) const ParamValue RangeParameter::toPlain (ParamValue _valueNormalized) const
{ {
if (info.stepCount > 1) if (info.stepCount > 1)
return Min<int32> (info.stepCount, (int32) (_valueNormalized * (info.stepCount + 1))) +
getMin ();
return FromNormalized<ParamValue> (_valueNormalized, info.stepCount) + getMin ();
return _valueNormalized * (getMax () - getMin ()) + getMin (); return _valueNormalized * (getMax () - getMin ()) + getMin ();
} }


@@ -232,7 +231,7 @@ ParamValue RangeParameter::toPlain (ParamValue _valueNormalized) const
ParamValue RangeParameter::toNormalized (ParamValue plainValue) const ParamValue RangeParameter::toNormalized (ParamValue plainValue) const
{ {
if (info.stepCount > 1) if (info.stepCount > 1)
return (plainValue - getMin ()) / info.stepCount;
return ToNormalized <ParamValue>(plainValue - getMin (), info.stepCount);
return (plainValue - getMin ()) / (getMax () - getMin ()); return (plainValue - getMin ()) / (getMax () - getMin ());
} }


@@ -304,8 +303,7 @@ bool StringListParameter::replaceString (int32 index, const String128 string)
void StringListParameter::toString (ParamValue _valueNormalized, String128 string) const void StringListParameter::toString (ParamValue _valueNormalized, String128 string) const
{ {
int32 index = (int32)toPlain (_valueNormalized); int32 index = (int32)toPlain (_valueNormalized);
const TChar* valueString = strings.at (index);
if (valueString)
if (const TChar* valueString = strings.at (index))
{ {
UString (string, str16BufferSize (String128)).assign (valueString); UString (string, str16BufferSize (String128)).assign (valueString);
} }
@@ -333,7 +331,7 @@ ParamValue StringListParameter::toPlain (ParamValue _valueNormalized) const
{ {
if (info.stepCount <= 0) if (info.stepCount <= 0)
return 0; return 0;
return Min<int32> (info.stepCount, (int32) (_valueNormalized * (info.stepCount + 1)));
return FromNormalized<ParamValue> (_valueNormalized, info.stepCount);
} }


//------------------------------------------------------------------------ //------------------------------------------------------------------------
@@ -341,7 +339,7 @@ ParamValue StringListParameter::toNormalized (ParamValue plainValue) const
{ {
if (info.stepCount <= 0) if (info.stepCount <= 0)
return 0; return 0;
return plainValue / (ParamValue)info.stepCount;
return ToNormalized<ParamValue> (plainValue, info.stepCount);
} }


//------------------------------------------------------------------------ //------------------------------------------------------------------------
@@ -392,17 +390,32 @@ Parameter* ParameterContainer::addParameter (const ParameterInfo& info)
} }


//------------------------------------------------------------------------ //------------------------------------------------------------------------
Parameter* ParameterContainer::getParameter (ParamID tag)
Parameter* ParameterContainer::getParameter (ParamID tag) const
{ {
if (params) if (params)
{ {
IndexMap::const_iterator it = id2index.find (tag);
auto it = id2index.find (tag);
if (it != id2index.end ()) if (it != id2index.end ())
return params->at (it->second); return params->at (it->second);
} }
return nullptr; return nullptr;
} }


//------------------------------------------------------------------------
bool ParameterContainer::removeParameter (ParamID tag)
{
if (!params)
return false;
IndexMap::const_iterator it = id2index.find (tag);
if (it != id2index.end ())
{
params->erase (params->begin () + it->second);
id2index.erase (it);
}
return false;
}

//------------------------------------------------------------------------ //------------------------------------------------------------------------
Parameter* ParameterContainer::addParameter (const TChar* title, const TChar* units, Parameter* ParameterContainer::addParameter (const TChar* title, const TChar* units,
int32 stepCount, ParamValue defaultNormalizedValue, int32 stepCount, ParamValue defaultNormalizedValue,
@@ -413,7 +426,7 @@ Parameter* ParameterContainer::addParameter (const TChar* title, const TChar* un
return nullptr; return nullptr;
} }


ParameterInfo info = {0};
ParameterInfo info = {};


UString (info.title, str16BufferSize (String128)).assign (title); UString (info.title, str16BufferSize (String128)).assign (title);
if (units) if (units)


+ 14
- 12
modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/vst/vstparameters.h View File

@@ -8,7 +8,7 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LICENSE // LICENSE
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // are permitted provided that the following conditions are met:
@@ -49,8 +49,8 @@ namespace Vst {


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Description of a Parameter. /** Description of a Parameter.
\ingroup vstClasses */
//------------------------------------------------------------------------
\ingroup vstClasses
*/
class Parameter : public FObject class Parameter : public FObject
{ {
public: public:
@@ -105,8 +105,8 @@ protected:


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Description of a RangeParameter. /** Description of a RangeParameter.
\ingroup vstClasses */
//------------------------------------------------------------------------
\ingroup vstClasses
*/
class RangeParameter : public Parameter class RangeParameter : public Parameter
{ {
public: public:
@@ -148,8 +148,8 @@ protected:


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Description of a StringListParameter. /** Description of a StringListParameter.
\ingroup vstClasses */
//------------------------------------------------------------------------
\ingroup vstClasses
*/
class StringListParameter : public Parameter class StringListParameter : public Parameter
{ {
public: public:
@@ -184,8 +184,8 @@ protected:


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Collection of parameters. /** Collection of parameters.
\ingroup vstClasses */
//------------------------------------------------------------------------
\ingroup vstClasses
*/
class ParameterContainer class ParameterContainer
{ {
public: public:
@@ -212,7 +212,7 @@ public:
int32 getParameterCount () const { return params ? static_cast<int32> (params->size ()) : 0; } int32 getParameterCount () const { return params ? static_cast<int32> (params->size ()) : 0; }


/** Gets parameter by index. */ /** Gets parameter by index. */
Parameter* getParameterByIndex (int32 index) { return params ? params->at (index) : nullptr; }
Parameter* getParameterByIndex (int32 index) const { return params ? params->at (index) : nullptr; }


/** Removes all parameters. */ /** Removes all parameters. */
void removeAll () void removeAll ()
@@ -223,9 +223,11 @@ public:
} }


/** Gets parameter by ID. */ /** Gets parameter by ID. */
Parameter* getParameter (ParamID tag);
Parameter* getParameter (ParamID tag) const;


//------------------------------------------------------------------------
/** Remove a specific parameter by ID. */
bool removeParameter (ParamID tag);
//------------------------------------------------------------------------
protected: protected:
using ParameterPtrVector = std::vector<IPtr<Parameter>>; using ParameterPtrVector = std::vector<IPtr<Parameter>>;
using IndexMap = std::map<ParamID, ParameterPtrVector::size_type>; using IndexMap = std::map<ParamID, ParameterPtrVector::size_type>;


+ 6
- 6
modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/vst/vstpresetfile.cpp View File

@@ -8,7 +8,7 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LICENSE // LICENSE
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // are permitted provided that the following conditions are met:
@@ -712,7 +712,7 @@ IMPLEMENT_FUNKNOWN_METHODS (FileStream, IBStream, IBStream::iid)
//------------------------------------------------------------------------ //------------------------------------------------------------------------
tresult PLUGIN_API FileStream::read (void* buffer, int32 numBytes, int32* numBytesRead) tresult PLUGIN_API FileStream::read (void* buffer, int32 numBytes, int32* numBytesRead)
{ {
size_t result = fread (buffer, 1, numBytes, file);
size_t result = fread (buffer, 1, static_cast<size_t> (numBytes), file);
if (numBytesRead) if (numBytesRead)
*numBytesRead = (int32)result; *numBytesRead = (int32)result;
return static_cast<int32> (result) == numBytes ? kResultOk : kResultFalse; return static_cast<int32> (result) == numBytes ? kResultOk : kResultFalse;
@@ -721,7 +721,7 @@ tresult PLUGIN_API FileStream::read (void* buffer, int32 numBytes, int32* numByt
//------------------------------------------------------------------------ //------------------------------------------------------------------------
tresult PLUGIN_API FileStream::write (void* buffer, int32 numBytes, int32* numBytesWritten) tresult PLUGIN_API FileStream::write (void* buffer, int32 numBytes, int32* numBytesWritten)
{ {
size_t result = fwrite (buffer, 1, numBytes, file);
size_t result = fwrite (buffer, 1, static_cast<size_t> (numBytes), file);
if (numBytesWritten) if (numBytesWritten)
*numBytesWritten = (int32)result; *numBytesWritten = (int32)result;
return static_cast<int32> (result) == numBytes ? kResultOk : kResultFalse; return static_cast<int32> (result) == numBytes ? kResultOk : kResultFalse;
@@ -863,9 +863,9 @@ BufferStream::~BufferStream () {FUNKNOWN_DTOR}
//------------------------------------------------------------------------ //------------------------------------------------------------------------
tresult PLUGIN_API BufferStream::read (void* buffer, int32 numBytes, int32* numBytesRead) tresult PLUGIN_API BufferStream::read (void* buffer, int32 numBytes, int32* numBytesRead)
{ {
uint32 size = mBuffer.get (buffer, numBytes);
uint32 size = mBuffer.get (buffer, static_cast<uint32> (numBytes));
if (numBytesRead) if (numBytesRead)
*numBytesRead = size;
*numBytesRead = static_cast<int32> (size);


return kResultTrue; return kResultTrue;
} }
@@ -873,7 +873,7 @@ tresult PLUGIN_API BufferStream::read (void* buffer, int32 numBytes, int32* numB
//------------------------------------------------------------------------ //------------------------------------------------------------------------
tresult PLUGIN_API BufferStream::write (void* buffer, int32 numBytes, int32* numBytesWritten) tresult PLUGIN_API BufferStream::write (void* buffer, int32 numBytes, int32* numBytesWritten)
{ {
bool res = mBuffer.put (buffer, numBytes);
bool res = mBuffer.put (buffer, static_cast<uint32> (numBytes));
if (numBytesWritten) if (numBytesWritten)
*numBytesWritten = res ? numBytes : 0; *numBytesWritten = res ? numBytes : 0;




+ 14
- 13
modules/juce_audio_processors/format_types/VST3_SDK/public.sdk/source/vst/vstpresetfile.h View File

@@ -8,7 +8,7 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// LICENSE // LICENSE
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // are permitted provided that the following conditions are met:
@@ -107,8 +107,8 @@ inline bool isEqualID (const ChunkID id1, const ChunkID id2)
//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Handler for a VST 3 Preset File. /** Handler for a VST 3 Preset File.
\ingroup vstClasses \ingroup vstClasses
\see \ref presetformat */
//------------------------------------------------------------------------
\see \ref presetformat
*/
class PresetFile class PresetFile
{ {
public: public:
@@ -150,7 +150,7 @@ public:
bool writeChunk (const void* data, int32 size, ChunkType which = kComponentState); bool writeChunk (const void* data, int32 size, ChunkType which = kComponentState);


//------------------------------------------------------------- //-------------------------------------------------------------
// for storing and restoring the whole Plug-in state (component and controller states)
// for storing and restoring the whole plug-in state (component and controller states)
bool seekToComponentState (); ///< Seeks to the begin of the Component State. bool seekToComponentState (); ///< Seeks to the begin of the Component State.
bool storeComponentState (IComponent* component); ///< Stores the component state (only one time). bool storeComponentState (IComponent* component); ///< Stores the component state (only one time).
bool storeComponentState (IBStream* componentStream); ///< Stores the component state from stream (only one time). bool storeComponentState (IBStream* componentStream); ///< Stores the component state from stream (only one time).
@@ -165,10 +165,11 @@ public:


//--- ---------------------------------------------------------- //--- ----------------------------------------------------------
/** Store program data or unit data from stream (including the header chunk). /** Store program data or unit data from stream (including the header chunk).
\param inStream
\param listID could be ProgramListID or UnitID. */ \param listID could be ProgramListID or UnitID. */
bool storeProgramData (IBStream* inStream, ProgramListID listID); bool storeProgramData (IBStream* inStream, ProgramListID listID);


//---when Plug-in uses IProgramListData-----------------------
//---when plug-in uses IProgramListData-----------------------
/** Stores a IProgramListData with a given identifier and index (including the header chunk). */ /** Stores a IProgramListData with a given identifier and index (including the header chunk). */
bool storeProgramData (IProgramListData* programListData, ProgramListID programListID, bool storeProgramData (IProgramListData* programListData, ProgramListID programListID,
int32 programIndex); int32 programIndex);
@@ -176,14 +177,14 @@ public:
bool restoreProgramData (IProgramListData* programListData, ProgramListID* programListID = nullptr, bool restoreProgramData (IProgramListData* programListData, ProgramListID* programListID = nullptr,
int32 programIndex = 0); int32 programIndex = 0);


//---when Plug-in uses IUnitData------------------------------
//---when plug-in uses IUnitData------------------------------
/** Stores a IUnitData with a given unitID (including the header chunk). */ /** Stores a IUnitData with a given unitID (including the header chunk). */
bool storeProgramData (IUnitData* unitData, UnitID unitID); bool storeProgramData (IUnitData* unitData, UnitID unitID);
/** Restores a IUnitData with a given unitID (optional). */ /** Restores a IUnitData with a given unitID (optional). */
bool restoreProgramData (IUnitData* unitData, UnitID* unitID = nullptr); bool restoreProgramData (IUnitData* unitData, UnitID* unitID = nullptr);


//--- ---------------------------------------------------------- //--- ----------------------------------------------------------
/** for keeping the Controller part in sync concerning preset data stream, unitProgramListID
/** for keeping the controller part in sync concerning preset data stream, unitProgramListID
* could be ProgramListID or UnitID. */ * could be ProgramListID or UnitID. */
bool restoreProgramData (IUnitInfo* unitInfo, int32 unitProgramListID, int32 programIndex = -1); bool restoreProgramData (IUnitInfo* unitInfo, int32 unitProgramListID, int32 programIndex = -1);


@@ -226,8 +227,8 @@ protected:
}; };


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Stream implementation for a file using stdio. */
//------------------------------------------------------------------------
/** Stream implementation for a file using stdio.
*/
class FileStream: public IBStream class FileStream: public IBStream
{ {
public: public:
@@ -252,8 +253,8 @@ protected:
}; };


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Stream representing a Read-Only subsection of its source stream. */
//------------------------------------------------------------------------
/** Stream representing a Read-Only subsection of its source stream.
*/
class ReadOnlyBStream: public IBStream class ReadOnlyBStream: public IBStream
{ {
public: public:
@@ -279,8 +280,8 @@ protected:
}; };


//------------------------------------------------------------------------ //------------------------------------------------------------------------
/** Stream implementation for a memory buffer. */
//------------------------------------------------------------------------
/** Stream implementation for a memory buffer.
*/
class BufferStream : public IBStream class BufferStream : public IBStream
{ {
public: public:


Loading…
Cancel
Save