mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
VST3: Update VST3 SDK
This commit is contained in:
parent
1de308cb16
commit
3fee576b47
68 changed files with 2161 additions and 978 deletions
|
|
@ -1,6 +1,2 @@
|
|||
This list details modifications made to the VST3 SDK in order to facilitate
|
||||
inclusion in JUCE.
|
||||
|
||||
- `#warning` directives were removed from fstring.cpp, as these cannot be
|
||||
silenced with a `pragma GCC diagnostic ignored "-Wcpp"` when building with
|
||||
g++.
|
||||
|
|
|
|||
|
|
@ -1,41 +1,44 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
This license applies only to files referencing this license,
|
||||
for other files of the Software Development Kit the respective embedded license text
|
||||
is applicable. The license can be found at: www.steinberg.net/sdklicenses_vst3
|
||||
|
||||
This Software Development Kit is licensed under the terms of the Steinberg VST3 License,
|
||||
or alternatively under the terms of the General Public License (GPL) Version 3.
|
||||
You may use the Software Development Kit according to either of these licenses as it is
|
||||
most appropriate for your project on a case-by-case basis (commercial or not).
|
||||
|
||||
a) Proprietary Steinberg VST3 License
|
||||
The Software Development Kit may not be distributed in parts or its entirety
|
||||
without prior written agreement by Steinberg Media Technologies GmbH.
|
||||
The SDK must not be used to re-engineer or manipulate any technology used
|
||||
in any Steinberg or Third-party application or software module,
|
||||
unless permitted by law.
|
||||
Neither the name of the Steinberg Media Technologies GmbH nor the names of its
|
||||
contributors may be used to endorse or promote products derived from this
|
||||
software without specific prior written permission.
|
||||
Before publishing a software under the proprietary license, you need to obtain a copy
|
||||
of the License Agreement signed by Steinberg Media Technologies GmbH.
|
||||
The Steinberg VST SDK License Agreement can be found at:
|
||||
www.steinberg.net/en/company/developers.html
|
||||
|
||||
THE SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
b) General Public License (GPL) Version 3
|
||||
Details of these licenses can be found at: www.gnu.org/licenses/gpl-3.0.html
|
||||
//----------------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
This license applies only to files referencing this license,
|
||||
for other files of the Software Development Kit the respective embedded license text
|
||||
is applicable. The license can be found at: www.steinberg.net/sdklicenses_vst3
|
||||
|
||||
This Software Development Kit is licensed under the terms of the Steinberg VST3 License,
|
||||
or alternatively under the terms of the General Public License (GPL) Version 3.
|
||||
You may use the Software Development Kit according to either of these licenses as it is
|
||||
most appropriate for your project on a case-by-case basis (commercial or not).
|
||||
|
||||
a) Proprietary Steinberg VST3 License
|
||||
The Software Development Kit may not be distributed in parts or its entirety
|
||||
without prior written agreement by Steinberg Media Technologies GmbH.
|
||||
The SDK must not be used to re-engineer or manipulate any technology used
|
||||
in any Steinberg or Third-party application or software module,
|
||||
unless permitted by law.
|
||||
Neither the name of the Steinberg Media Technologies GmbH nor the names of its
|
||||
contributors may be used to endorse or promote products derived from this
|
||||
software without specific prior written permission.
|
||||
Before publishing a software under the proprietary license, you need to obtain a copy
|
||||
of the License Agreement signed by Steinberg Media Technologies GmbH.
|
||||
The Steinberg VST SDK License Agreement can be found at:
|
||||
www.steinberg.net/en/company/developers.html
|
||||
|
||||
THE SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
b) General Public License (GPL) Version 3
|
||||
Details of these licenses can be found at: www.gnu.org/licenses/gpl-3.0.html
|
||||
Please refer to the Steinberg VST usage guidelines for the use of VST, VST logo and VST
|
||||
compatible logos:
|
||||
https://steinbergmedia.github.io/vst3_dev_portal/pages/VST+3+Licensing/Usage+guidelines.html
|
||||
//----------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -1,10 +1,267 @@
|
|||
# Welcome to VST 3 SDK Interfaces
|
||||
|
||||
Here are located all VST interfaces definitions (including VST Component/Controller, UI, Test).
|
||||
|
||||
## License & Usage guidelines
|
||||
|
||||
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)
|
||||
<div style="text-align:center">
|
||||
<img src="https://steinbergmedia.github.io/vst3_doc/gfx/vst3_logo.jpg" alt="VST 3 SDK" /></div>
|
||||
|
||||
# Welcome to VST SDK 3.7.x
|
||||
|
||||
## 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
|
||||
|
||||
- VST 3 API
|
||||
- VST 3 Implementation Helper Classes
|
||||
- AAX, AU, AUv3 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 :
|
||||
|
||||
- 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 Platforms:
|
||||
|
||||
| Operating System |Architecture |Compiler | Notes|
|
||||
| :------------------------------------ | :-----------------------: | :-------------------------------: | :-----------: |
|
||||
|Windows 10/11 |x86, x86_64, arm64 |MSVC 2022, MSVC 2019 | |
|
||||
|Windows 8.1 |x86, x86_64 |MSVC 2019, MSVC 2017 | |
|
||||
|macOS 10.13, 10.14, 10.15, 11, 12, 13 |x86, x86_64, Apple Silicon |Xcode 10 - 14 | |
|
||||
|iOS 13 - iOS 16 |arm64 |Xcode 11 - 14 | |
|
||||
|Linux - Raspberry Pi OS (Buster) |arm32 |GCC 8.3 and higher |Visual Studio Code|
|
||||
|Linux - Ubuntu 18.04 LTS |x86, x86_64 |GCC 8.3 and higher |Visual Studio Code, Qt Creator|
|
||||
|Linux - Ubuntu 20.04 LTS |x86, x86_64 |GCC 8.3 and higher |Visual Studio Code, 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 structure.
|
||||
- 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](https://www.steinberg.net/en/company/developers.html)
|
||||
- check the VST 3 SDK online documentation under: [steinbergmedia.github.io/vst3_dev_portal](https://steinbergmedia.github.io/vst3_dev_portal/pages/index.html)
|
||||
- check the online documentation under: [steinbergmedia.github.io/vst3_doc](https://steinbergmedia.github.io/vst3_doc)
|
||||
|
||||
---
|
||||
<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 busses 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
|
||||
|
||||
```c
|
||||
git clone --recursive https://github.com/steinbergmedia/vst3sdk.git
|
||||
```
|
||||
|
||||
### Adding VST2 version
|
||||
|
||||
The **VST 2 SDK** is not part anymore of the **VST 3 SDK**, you have to use an older version of the SDK and copy the vst2sdk 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:
|
||||
|
||||
```c
|
||||
cd TheFolderWhereYouDownloadTheSDK
|
||||
./copy_vst2_to_vst3_sdk.sh
|
||||
```
|
||||
|
||||
- for Windows:
|
||||
|
||||
```c
|
||||
cd TheFolderWhereYouDownloadTheSDK
|
||||
copy_vst2_to_vst3_sdk.bat
|
||||
```
|
||||
|
||||
### Build the examples on Windows
|
||||
|
||||
- Create a folder for the build and move to this folder (using cd):
|
||||
|
||||
```c
|
||||
mkdir build
|
||||
cd build
|
||||
```
|
||||
|
||||
- Generate the Solution/Projects: provide the path of the Project where CMakeLists.txt is located:
|
||||
|
||||
```c
|
||||
// examples:
|
||||
cmake.exe -G "Visual Studio 17 2022" -A x64 ..\vst3sdk
|
||||
// or without symbolic links
|
||||
cmake.exe -G "Visual Studio 17 2022" -A x64 ..\vst3sdk -DSMTG_CREATE_PLUGIN_LINK=0
|
||||
// or by using the local user program folder (FOLDERID_UserProgramFilesCommon) as VST3 folder
|
||||
cmake.exe -G "Visual Studio 17 2022" -A x64 -DSMTG_PLUGIN_TARGET_USER_PROGRAM_FILES_COMMON=1
|
||||
```
|
||||
|
||||
- Now you can build the plug-in (you can use Visual Studio too):
|
||||
|
||||
```c
|
||||
msbuild.exe vstsdk.sln
|
||||
// (or alternatively for example for release)
|
||||
cmake --build . --config Release
|
||||
```
|
||||
|
||||
### Build the examples on macOS
|
||||
|
||||
- Create a folder for the build and move to this folder (using cd):
|
||||
|
||||
```c
|
||||
mkdir build
|
||||
cd build
|
||||
```
|
||||
|
||||
- Generate the Solution/Projects: provide the path of the Project where CMakeLists.txt is located:
|
||||
|
||||
```c
|
||||
// For XCode:
|
||||
cmake -GXcode ../vst3sdk
|
||||
// Without XCode (here debug variant):
|
||||
cmake -DCMAKE_BUILD_TYPE=Debug ../
|
||||
```
|
||||
|
||||
- Now you can build the plug-in (you can use XCode too):
|
||||
|
||||
```c
|
||||
xcodebuild
|
||||
// (or alternatively for example for release)
|
||||
cmake --build . --config Release
|
||||
```
|
||||
|
||||
### Build the examples on Linux
|
||||
|
||||
- Install the required packages [Package Requirements](https://steinbergmedia.github.io/vst3_dev_portal/pages/Getting+Started/How+to+setup+my+system.html#for-linux)
|
||||
- Create a folder for the build and move to this folder (using cd):
|
||||
|
||||
```c
|
||||
mkdir build
|
||||
cd build
|
||||
```
|
||||
|
||||
- Generate the Solution/Projects: provide the path of the Project where CMakeLists.txt is located:
|
||||
|
||||
```c
|
||||
cmake ../vst3sdk
|
||||
```
|
||||
|
||||
- Now you can build the plug-in:
|
||||
|
||||
```c
|
||||
make
|
||||
// (or alternatively for example for release)
|
||||
cmake --build . --config Release
|
||||
```
|
||||
|
||||
### Build using cmake-gui
|
||||
|
||||
- start the cmake-gui Application
|
||||
- **Browse Source...**: select the folder vst3sdk
|
||||
- **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'/>
|
||||
|
||||
## License & Usage guidelines
|
||||
|
||||
More details are found at [www.steinberg.net/sdklicenses_vst3](http://www.steinberg.net/sdklicenses_vst3)
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
|
|
@ -9,7 +9,7 @@
|
|||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
|
|
@ -605,7 +605,7 @@ bool Buffer::toWideString (int32 sourceCodePage)
|
|||
endString8 ();
|
||||
|
||||
Buffer dest (getFillSize () * sizeof (char16));
|
||||
int32 result = String::multiByteToWideString (dest.str16 (), buffer, dest.getFree () / sizeof (char16), sourceCodePage);
|
||||
int32 result = String::multiByteToWideString (dest.str16 (), str8 (), dest.getFree () / sizeof (char16), sourceCodePage);
|
||||
if (result > 0)
|
||||
{
|
||||
dest.setFillSize ((result - 1) * sizeof (char16));
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
|
|
@ -107,6 +107,8 @@ bool AmIBeingDebugged ()
|
|||
#include <cassert>
|
||||
#include <cstdarg>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <mutex>
|
||||
|
||||
#if SMTG_OS_WINDOWS
|
||||
#ifndef _WIN32_WINNT
|
||||
|
|
@ -141,6 +143,20 @@ DebugPrintLogger gDebugPrintLogger = nullptr;
|
|||
static const int kDebugPrintfBufferSize = 10000;
|
||||
static bool neverDebugger = false; // so I can switch it off in the debugger...
|
||||
|
||||
static std::once_flag neverDebuggerEnvCheckFlag {};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
static void initNeverDebugger ()
|
||||
{
|
||||
std::call_once (neverDebuggerEnvCheckFlag, [] () {
|
||||
// add this environment variable to not stop in the debugger on ASSERT
|
||||
if (std::getenv ("SMTG_DEBUG_IGNORE_ASSERT"))
|
||||
{
|
||||
neverDebugger = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
static void printDebugString (const char* string)
|
||||
{
|
||||
|
|
@ -193,6 +209,7 @@ void FDebugBreak (const char* format, ...)
|
|||
gPreAssertionHook (string);
|
||||
}
|
||||
|
||||
initNeverDebugger ();
|
||||
if (neverDebugger)
|
||||
return;
|
||||
if (AmIBeingDebugged ())
|
||||
|
|
@ -228,7 +245,7 @@ void FDebugBreak (const char* format, ...)
|
|||
void FPrintLastError (const char* file, int line)
|
||||
{
|
||||
#if SMTG_OS_WINDOWS
|
||||
LPVOID lpMessageBuffer;
|
||||
LPVOID lpMessageBuffer = nullptr;
|
||||
FormatMessageA (FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, nullptr,
|
||||
GetLastError (), MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT),
|
||||
(LPSTR)&lpMessageBuffer, 0, nullptr);
|
||||
|
|
@ -291,12 +308,16 @@ void* operator new[] (size_t size, int, const char* file, int line)
|
|||
//------------------------------------------------------------------------
|
||||
void operator delete (void* p, int, const char* file, int line)
|
||||
{
|
||||
(void)file;
|
||||
(void)line;
|
||||
::operator delete (p);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
void operator delete[] (void* p, int, const char* file, int line)
|
||||
{
|
||||
(void)file;
|
||||
(void)line;
|
||||
::operator delete[] (p);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
//------------------------------------------------------------------------
|
||||
// Flags : clang-format SMTGSequencer
|
||||
// Project : SDK Base
|
||||
// Version : 1.0
|
||||
//
|
||||
|
|
@ -9,28 +10,28 @@
|
|||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright notice,
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above copyright notice,
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// and/or other materials provided with the distribution.
|
||||
// * Neither the name of the Steinberg Media Technologies nor the names of its
|
||||
// contributors may be used to endorse or promote products derived from this
|
||||
// contributors may be used to endorse or promote products derived from this
|
||||
// software without specific prior written permission.
|
||||
//
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
// OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -39,6 +40,12 @@
|
|||
#include "base/thread/include/flock.h"
|
||||
|
||||
#include <vector>
|
||||
#define SMTG_VALIDATE_DEPENDENCY_COUNT DEVELOPMENT // validating dependencyCount
|
||||
|
||||
#if SMTG_DEPENDENCY_COUNT
|
||||
#include "base/source/updatehandler.h"
|
||||
#define SMTG_DEPENDENCY_CHECK_LEVEL 1 // 1 => minimal assert, 2 => full assert
|
||||
#endif // SMTG_DEPENDENCY_COUNT
|
||||
|
||||
namespace Steinberg {
|
||||
|
||||
|
|
@ -54,52 +61,132 @@ struct FObjectIIDInitializer
|
|||
// only can cast to their own objects
|
||||
// this initializer must be after the definition of FObject::iid, otherwise
|
||||
// the default constructor of FUID will clear the generated iid
|
||||
FObjectIIDInitializer ()
|
||||
{
|
||||
const_cast<FUID&> (FObject::iid).generate ();
|
||||
}
|
||||
FObjectIIDInitializer () { const_cast<FUID&> (FObject::iid).generate (); }
|
||||
} gFObjectIidInitializer;
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
uint32 PLUGIN_API FObject::addRef ()
|
||||
{
|
||||
return FUnknownPrivate::atomicAdd (refCount, 1);
|
||||
}
|
||||
FObject::~FObject ()
|
||||
{
|
||||
#if SMTG_DEPENDENCY_COUNT && DEVELOPMENT
|
||||
static bool localNeverDebugger = false;
|
||||
#endif
|
||||
|
||||
#if DEVELOPMENT
|
||||
if (refCount > 1)
|
||||
FDebugPrint ("Refcount is %d when trying to delete %s\n", refCount, isA ());
|
||||
#endif
|
||||
|
||||
#if SMTG_DEPENDENCY_COUNT
|
||||
#if SMTG_DEPENDENCY_CHECK_LEVEL >= 1
|
||||
if (gUpdateHandler)
|
||||
{
|
||||
#if DEVELOPMENT
|
||||
SMTG_ASSERT (dependencyCount == 0 || localNeverDebugger);
|
||||
#endif // DEVELOPMENT
|
||||
}
|
||||
#endif
|
||||
#endif // SMTG_DEPENDENCY_COUNT
|
||||
|
||||
#if SMTG_VALIDATE_DEPENDENCY_COUNT
|
||||
if (!gUpdateHandler || gUpdateHandler != UpdateHandler::instance (false))
|
||||
return;
|
||||
|
||||
auto updateHandler = UpdateHandler::instance ();
|
||||
if (!updateHandler || updateHandler == this)
|
||||
return;
|
||||
|
||||
SMTG_ASSERT ((updateHandler->checkDeferred (this) == false || localNeverDebugger) &&
|
||||
"'this' has scheduled a deferUpdate that was not yet delivered");
|
||||
|
||||
if (updateHandler->hasDependencies (this))
|
||||
{
|
||||
SMTG_ASSERT (
|
||||
(false || localNeverDebugger) &&
|
||||
"Another object is still dependent on 'this'. This leads to zombie entries in the dependency map that can later crash.");
|
||||
FDebugPrint ("Object still has dependencies %x %s\n", this, this->isA ());
|
||||
updateHandler->printForObject (this);
|
||||
}
|
||||
#endif // SMTG_VALIDATE_DEPENDENCY_COUNT
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
uint32 PLUGIN_API FObject::release ()
|
||||
uint32 PLUGIN_API FObject::addRef ()
|
||||
{
|
||||
return FUnknownPrivate::atomicAdd (refCount, 1);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
uint32 PLUGIN_API FObject::release ()
|
||||
{
|
||||
if (FUnknownPrivate::atomicAdd (refCount, -1) == 0)
|
||||
{
|
||||
refCount = -1000;
|
||||
delete this;
|
||||
return 0;
|
||||
}
|
||||
return refCount;
|
||||
}
|
||||
return refCount;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
tresult PLUGIN_API FObject::queryInterface (const TUID _iid, void** obj)
|
||||
{
|
||||
QUERY_INTERFACE (_iid, obj, FUnknown::iid, FUnknown)
|
||||
QUERY_INTERFACE (_iid, obj, IDependent::iid, IDependent)
|
||||
QUERY_INTERFACE (_iid, obj, FObject::iid, FObject)
|
||||
QUERY_INTERFACE (_iid, obj, FUnknown::iid, FUnknown)
|
||||
QUERY_INTERFACE (_iid, obj, IDependent::iid, IDependent)
|
||||
QUERY_INTERFACE (_iid, obj, FObject::iid, FObject)
|
||||
*obj = nullptr;
|
||||
return kNoInterface;
|
||||
return kNoInterface;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
void FObject::addDependent (IDependent* dep)
|
||||
{
|
||||
if (gUpdateHandler)
|
||||
gUpdateHandler->addDependent (unknownCast (), dep);
|
||||
if (!gUpdateHandler)
|
||||
return;
|
||||
|
||||
gUpdateHandler->addDependent (unknownCast (), dep);
|
||||
#if SMTG_DEPENDENCY_COUNT
|
||||
dependencyCount++;
|
||||
#endif
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
void FObject::removeDependent (IDependent* dep)
|
||||
{
|
||||
if (gUpdateHandler)
|
||||
#if SMTG_DEPENDENCY_COUNT && DEVELOPMENT
|
||||
static bool localNeverDebugger = false;
|
||||
#endif
|
||||
|
||||
if (!gUpdateHandler)
|
||||
return;
|
||||
|
||||
#if SMTG_DEPENDENCY_COUNT
|
||||
if (gUpdateHandler != UpdateHandler::instance (false))
|
||||
{
|
||||
gUpdateHandler->removeDependent (unknownCast (), dep);
|
||||
dependencyCount--;
|
||||
return;
|
||||
}
|
||||
#if SMTG_DEPENDENCY_CHECK_LEVEL > 1
|
||||
SMTG_ASSERT ((dependencyCount > 0 || localNeverDebugger) &&
|
||||
"All dependencies have already been removed - mmichaelis 7/2021");
|
||||
#endif
|
||||
size_t removeCount;
|
||||
UpdateHandler::instance ()->removeDependent (unknownCast (), dep, removeCount);
|
||||
if (removeCount == 0)
|
||||
{
|
||||
#if SMTG_DEPENDENCY_CHECK_LEVEL > 1
|
||||
SMTG_ASSERT (localNeverDebugger && "No dependency to remove - ygrabit 8/2021");
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
SMTG_ASSERT ((removeCount == 1 || localNeverDebugger) &&
|
||||
"Duplicated dependencies established - mmichaelis 7/2021");
|
||||
}
|
||||
dependencyCount -= (int16)removeCount;
|
||||
#else
|
||||
gUpdateHandler->removeDependent (unknownCast (), dep);
|
||||
#endif // SMTG_DEPENDENCY_COUNT
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
|
|
@ -123,61 +210,61 @@ void FObject::deferUpdate (int32 msg)
|
|||
//------------------------------------------------------------------------
|
||||
/** Automatic creation and destruction of singleton instances. */
|
||||
//------------------------------------------------------------------------
|
||||
namespace Singleton
|
||||
namespace Singleton {
|
||||
using ObjectVector = std::vector<FObject**>;
|
||||
ObjectVector* singletonInstances = nullptr;
|
||||
bool singletonsTerminated = false;
|
||||
Steinberg::Base::Thread::FLock* singletonsLock;
|
||||
|
||||
bool isTerminated ()
|
||||
{
|
||||
using ObjectVector = std::vector<FObject**>;
|
||||
ObjectVector* singletonInstances = nullptr;
|
||||
bool singletonsTerminated = false;
|
||||
Steinberg::Base::Thread::FLock* singletonsLock;
|
||||
return singletonsTerminated;
|
||||
}
|
||||
|
||||
bool isTerminated () {return singletonsTerminated;}
|
||||
void lockRegister ()
|
||||
{
|
||||
if (!singletonsLock) // assume first call not from multiple threads
|
||||
singletonsLock = NEW Steinberg::Base::Thread::FLock;
|
||||
singletonsLock->lock ();
|
||||
}
|
||||
|
||||
void lockRegister ()
|
||||
void unlockRegister ()
|
||||
{
|
||||
singletonsLock->unlock ();
|
||||
}
|
||||
|
||||
void registerInstance (FObject** o)
|
||||
{
|
||||
SMTG_ASSERT (singletonsTerminated == false)
|
||||
if (singletonsTerminated == false)
|
||||
{
|
||||
if (!singletonsLock) // assume first call not from multiple threads
|
||||
singletonsLock = NEW Steinberg::Base::Thread::FLock;
|
||||
singletonsLock->lock ();
|
||||
}
|
||||
void unlockRegister ()
|
||||
{
|
||||
singletonsLock->unlock ();
|
||||
if (singletonInstances == nullptr)
|
||||
singletonInstances = NEW std::vector<FObject**>;
|
||||
singletonInstances->push_back (o);
|
||||
}
|
||||
}
|
||||
|
||||
void registerInstance (FObject** o)
|
||||
struct Deleter
|
||||
{
|
||||
~Deleter ()
|
||||
{
|
||||
SMTG_ASSERT (singletonsTerminated == false)
|
||||
if (singletonsTerminated == false)
|
||||
singletonsTerminated = true;
|
||||
if (singletonInstances)
|
||||
{
|
||||
if (singletonInstances == nullptr)
|
||||
singletonInstances = NEW std::vector<FObject**>;
|
||||
singletonInstances->push_back (o);
|
||||
}
|
||||
}
|
||||
|
||||
struct Deleter
|
||||
{
|
||||
~Deleter ()
|
||||
{
|
||||
singletonsTerminated = true;
|
||||
if (singletonInstances)
|
||||
for (Steinberg::FObject** obj : *singletonInstances)
|
||||
{
|
||||
for (ObjectVector::iterator it = singletonInstances->begin (),
|
||||
end = singletonInstances->end ();
|
||||
it != end; ++it)
|
||||
{
|
||||
FObject** obj = (*it);
|
||||
(*obj)->release ();
|
||||
*obj = nullptr;
|
||||
obj = nullptr;
|
||||
}
|
||||
|
||||
delete singletonInstances;
|
||||
singletonInstances = nullptr;
|
||||
(*obj)->release ();
|
||||
*obj = nullptr;
|
||||
obj = nullptr;
|
||||
}
|
||||
delete singletonsLock;
|
||||
singletonsLock = nullptr;
|
||||
|
||||
delete singletonInstances;
|
||||
singletonInstances = nullptr;
|
||||
}
|
||||
} deleter;
|
||||
delete singletonsLock;
|
||||
singletonsLock = nullptr;
|
||||
}
|
||||
} deleter;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
|
|
@ -45,6 +45,8 @@
|
|||
#include "pluginterfaces/base/iupdatehandler.h"
|
||||
#include "base/source/fdebug.h" // use of NEW
|
||||
|
||||
#define SMTG_DEPENDENCY_COUNT DEVELOPMENT
|
||||
|
||||
namespace Steinberg {
|
||||
|
||||
//----------------------------------
|
||||
|
|
@ -82,10 +84,15 @@ class FObject : public IDependent
|
|||
{
|
||||
public:
|
||||
//------------------------------------------------------------------------
|
||||
FObject () : refCount (1) {} ///< default constructor...
|
||||
FObject (const FObject&) : refCount (1) {} ///< overloaded constructor...
|
||||
virtual ~FObject () {} ///< destructor...
|
||||
FObject& operator = (const FObject&) { return *this; } ///< overloads operator "=" as the reference assignment
|
||||
FObject () = default; ///< default constructor...
|
||||
FObject (const FObject&) ///< overloaded constructor...
|
||||
: refCount (1)
|
||||
#if SMTG_DEPENDENCY_COUNT
|
||||
, dependencyCount (0)
|
||||
#endif
|
||||
{}
|
||||
FObject& operator= (const FObject&) { return *this; } ///< overloads operator "=" as the reference assignment
|
||||
virtual ~FObject (); ///< destructor...
|
||||
|
||||
// OBJECT_METHODS
|
||||
static inline FClassID getFClassID () {return "FObject";} ///< return Class ID as an ASCII string (statically)
|
||||
|
|
@ -124,8 +131,10 @@ public:
|
|||
|
||||
//------------------------------------------------------------------------
|
||||
protected:
|
||||
int32 refCount; ///< COM-model local reference count
|
||||
|
||||
int32 refCount = 1; ///< COM-model local reference count
|
||||
#if SMTG_DEPENDENCY_COUNT
|
||||
int16 dependencyCount = 0;
|
||||
#endif
|
||||
static IUpdateHandler* gUpdateHandler;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
|
|
@ -187,6 +187,30 @@ bool FStreamer::readChar16 (char16& c)
|
|||
return false;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
bool FStreamer::writeInt8 (int8 c)
|
||||
{
|
||||
return writeRaw ((void*)&c, sizeof (int8)) == sizeof (int8);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
bool FStreamer::readInt8 (int8& c)
|
||||
{
|
||||
return readRaw ((void*)&c, sizeof (int8)) == sizeof (int8);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
bool FStreamer::writeInt8u (uint8 c)
|
||||
{
|
||||
return writeRaw ((void*)&c, sizeof (uint8)) == sizeof (uint8);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
bool FStreamer::readInt8u (uint8& c)
|
||||
{
|
||||
return readRaw ((void*)&c, sizeof (uint8)) == sizeof (uint8);
|
||||
}
|
||||
|
||||
// int16 -----------------------------------------------------------------
|
||||
//------------------------------------------------------------------------
|
||||
bool FStreamer::writeInt16 (int16 i)
|
||||
|
|
@ -630,7 +654,7 @@ int32 FStreamer::readStringUtf8 (tchar* ptr, int32 nChars)
|
|||
break;
|
||||
}
|
||||
|
||||
char8* source = tmp.int8Ptr ();
|
||||
char8* source = tmp.str8 ();
|
||||
uint32 codePage = kCP_Default; // for legacy take default page if no utf8 bom is present...
|
||||
if (tmp.getFillSize () > 2)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
|
|
@ -84,10 +84,10 @@ public:
|
|||
bool writeChar16 (char16 c);
|
||||
bool readChar16 (char16& c);
|
||||
|
||||
bool writeInt8 (int8 c){return writeChar8 (c);}
|
||||
bool readInt8 (int8& c){return readChar8 (c);}
|
||||
bool writeInt8u (uint8 c){return writeUChar8 (c);}
|
||||
bool readInt8u (uint8& c){return readUChar8 (c);}
|
||||
bool writeInt8 (int8 c);
|
||||
bool readInt8 (int8& c);
|
||||
bool writeInt8u (uint8 c);
|
||||
bool readInt8u (uint8& c);
|
||||
///@}
|
||||
|
||||
/** @name read and write int16. */
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
|
|
@ -45,8 +45,15 @@
|
|||
#include <cstdio>
|
||||
#include <cstdarg>
|
||||
#include <utility>
|
||||
#include <complex>
|
||||
#include <cmath>
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
|
||||
#if SMTG_OS_WINDOWS
|
||||
#ifndef NOMINMAX
|
||||
#define NOMINMAX
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning (disable : 4244)
|
||||
|
|
@ -202,34 +209,32 @@ static bool fromCFStringRef (Steinberg::char8* dest, Steinberg::int32 destSize,
|
|||
#endif // SMTG_OS_MACOS
|
||||
|
||||
#if SMTG_OS_WINDOWS
|
||||
#define stricmp16 wcsicmp
|
||||
#define strnicmp16 wcsnicmp
|
||||
#define strrchr16 wcsrchr
|
||||
#define sprintf16 swprintf
|
||||
#define snprintf16 snwprintf
|
||||
#define vsnprintf16 vsnwprintf
|
||||
#define vsprintf16 wvsprintf
|
||||
#define vfprintf16 vfwprintf
|
||||
#define sscanf16 swscanf
|
||||
#define toupper16 towupper
|
||||
#define tolower16 towlower
|
||||
#define isupper16 iswupper
|
||||
#define islower16 iswlower
|
||||
#define isspace16 iswspace
|
||||
#define isalpha16 iswalpha
|
||||
#define isdigit16 iswdigit
|
||||
#define isalnum16 iswalnum
|
||||
//-----------------------------------------------------------------------------
|
||||
static inline int stricmp16 (const Steinberg::tchar* s1, const Steinberg::tchar* s2)
|
||||
{
|
||||
return wcsicmp (Steinberg::wscast (s1), Steinberg::wscast (s2));
|
||||
}
|
||||
|
||||
#define stricmp _stricmp
|
||||
#define strnicmp _strnicmp
|
||||
#define snprintf _snprintf
|
||||
#define vsnprintf _vsnprintf
|
||||
#define snwprintf _snwprintf
|
||||
#define vsnwprintf _vsnwprintf
|
||||
//-----------------------------------------------------------------------------
|
||||
static inline int strnicmp16 (const Steinberg::tchar* s1, const Steinberg::tchar* s2, size_t l)
|
||||
{
|
||||
return wcsnicmp (Steinberg::wscast (s1), Steinberg::wscast (s2), l);
|
||||
}
|
||||
|
||||
#define wtoi _wtoi
|
||||
#define wtol _wtol
|
||||
#define wtof _wtof
|
||||
//-----------------------------------------------------------------------------
|
||||
static inline int vsnwprintf (Steinberg::char16* buffer, size_t bufferSize,
|
||||
const Steinberg::char16* format, va_list args)
|
||||
{
|
||||
return _vsnwprintf (Steinberg::wscast (buffer), bufferSize, Steinberg::wscast (format), args);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
static inline Steinberg::int32 sprintf16 (Steinberg::char16* str, const Steinberg::char16* format, ...)
|
||||
{
|
||||
va_list marker;
|
||||
va_start (marker, format);
|
||||
return vsnwprintf (str, -1, format, marker);
|
||||
}
|
||||
|
||||
#elif SMTG_OS_LINUX
|
||||
#include <codecvt>
|
||||
|
|
@ -288,6 +293,7 @@ static inline int strnicmp16 (const Steinberg::char16* s1, const Steinberg::char
|
|||
//-----------------------------------------------------------------------------
|
||||
static inline int sprintf16 (Steinberg::char16* wcs, const Steinberg::char16* format, ...)
|
||||
{
|
||||
#warning DEPRECATED No Linux implementation
|
||||
assert(false && "DEPRECATED No Linux implementation");
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -311,6 +317,7 @@ static inline int vsnwprintf (Steinberg::char16* wcs, size_t maxlen,
|
|||
//-----------------------------------------------------------------------------
|
||||
static inline Steinberg::char16* strrchr16 (const Steinberg::char16* str, Steinberg::char16 c)
|
||||
{
|
||||
#warning DEPRECATED No Linux implementation
|
||||
assert(false && "DEPRECATED No Linux implementation");
|
||||
return nullptr;
|
||||
}
|
||||
|
|
@ -533,6 +540,9 @@ bool ConstString::testChar16 (uint32 index, char16 c) const
|
|||
//-----------------------------------------------------------------------------
|
||||
bool ConstString::extract (String& result, uint32 idx, int32 n) const
|
||||
{
|
||||
// AddressSanitizer : when extracting part of "this" on itself, it can lead to heap-use-after-free.
|
||||
SMTG_ASSERT (this != static_cast<ConstString*> (&result))
|
||||
|
||||
if (len == 0|| idx >= len)
|
||||
return false;
|
||||
|
||||
|
|
@ -1585,6 +1595,7 @@ char16 ConstString::toLower (char16 c)
|
|||
}
|
||||
return c;
|
||||
#elif SMTG_OS_LINUX
|
||||
#warning DEPRECATED No Linux implementation
|
||||
assert(false && "DEPRECATED No Linux implementation");
|
||||
return c;
|
||||
#else
|
||||
|
|
@ -1613,6 +1624,7 @@ char16 ConstString::toUpper (char16 c)
|
|||
}
|
||||
return c;
|
||||
#elif SMTG_OS_LINUX
|
||||
#warning DEPRECATED No Linux implementation
|
||||
assert(false && "DEPRECATED No Linux implementation");
|
||||
return c;
|
||||
#else
|
||||
|
|
@ -1867,7 +1879,7 @@ int32 ConstString::multiByteToWideString (char16* dest, const char8* source, int
|
|||
}
|
||||
int32 result = 0;
|
||||
#if SMTG_OS_WINDOWS
|
||||
result = MultiByteToWideChar (sourceCodePage, MB_ERR_INVALID_CHARS, source, -1, dest, charCount);
|
||||
result = MultiByteToWideChar (sourceCodePage, MB_ERR_INVALID_CHARS, source, -1, wscast (dest), charCount);
|
||||
#endif
|
||||
|
||||
#if SMTG_OS_MACOS
|
||||
|
|
@ -1911,6 +1923,7 @@ int32 ConstString::multiByteToWideString (char16* dest, const char8* source, int
|
|||
}
|
||||
else
|
||||
{
|
||||
#warning DEPRECATED No Linux implementation
|
||||
assert(false && "DEPRECATED No Linux implementation");
|
||||
}
|
||||
|
||||
|
|
@ -1924,7 +1937,7 @@ int32 ConstString::multiByteToWideString (char16* dest, const char8* source, int
|
|||
int32 ConstString::wideStringToMultiByte (char8* dest, const char16* wideString, int32 charCount, uint32 destCodePage)
|
||||
{
|
||||
#if SMTG_OS_WINDOWS
|
||||
return WideCharToMultiByte (destCodePage, 0, wideString, -1, dest, charCount, nullptr, nullptr);
|
||||
return WideCharToMultiByte (destCodePage, 0, wscast (wideString), -1, dest, charCount, nullptr, nullptr);
|
||||
|
||||
#elif SMTG_OS_MACOS
|
||||
int32 result = 0;
|
||||
|
|
@ -1991,6 +2004,7 @@ int32 ConstString::wideStringToMultiByte (char8* dest, const char16* wideString,
|
|||
}
|
||||
else
|
||||
{
|
||||
#warning DEPRECATED No Linux implementation
|
||||
assert(false && "DEPRECATED No Linux implementation");
|
||||
}
|
||||
return result;
|
||||
|
|
@ -2013,7 +2027,7 @@ bool ConstString::isNormalized (UnicodeNormalization n)
|
|||
#ifdef UNICODE
|
||||
if (n != kUnicodeNormC)
|
||||
return false;
|
||||
uint32 normCharCount = static_cast<uint32> (FoldString (MAP_PRECOMPOSED, buffer16, len, nullptr, 0));
|
||||
uint32 normCharCount = static_cast<uint32> (FoldString (MAP_PRECOMPOSED, wscast (buffer16), len, nullptr, 0));
|
||||
return (normCharCount == len);
|
||||
#else
|
||||
return false;
|
||||
|
|
@ -2043,11 +2057,27 @@ String::String ()
|
|||
//-----------------------------------------------------------------------------
|
||||
String::String (const char8* str, MBCodePage codePage, int32 n, bool isTerminated)
|
||||
{
|
||||
isWide = 0;
|
||||
isWide = false;
|
||||
if (str)
|
||||
{
|
||||
assign (str, n, isTerminated);
|
||||
toWideString (codePage);
|
||||
if (isTerminated && n >= 0 && str[n] != 0)
|
||||
{
|
||||
// isTerminated is not always set correctly
|
||||
isTerminated = false;
|
||||
}
|
||||
|
||||
if (!isTerminated)
|
||||
{
|
||||
assign (str, n, isTerminated);
|
||||
toWideString (codePage);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (n < 0)
|
||||
n = static_cast<int32> (strlen (str));
|
||||
if (n > 0)
|
||||
_toWideString (str, n, codePage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2139,22 +2169,33 @@ void String::updateLength ()
|
|||
|
||||
//-----------------------------------------------------------------------------
|
||||
bool String::toWideString (uint32 sourceCodePage)
|
||||
{
|
||||
if (!isWide && buffer8 && len > 0)
|
||||
return _toWideString (buffer8, len, sourceCodePage);
|
||||
isWide = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
bool String::_toWideString (const char8* src, int32 length, uint32 sourceCodePage)
|
||||
{
|
||||
if (!isWide)
|
||||
{
|
||||
if (buffer8 && len > 0)
|
||||
if (src && length > 0)
|
||||
{
|
||||
int32 bytesNeeded = multiByteToWideString (nullptr, buffer8, 0, sourceCodePage) * sizeof (char16);
|
||||
int32 bytesNeeded = multiByteToWideString (nullptr, src, 0, sourceCodePage) * sizeof (char16);
|
||||
if (bytesNeeded)
|
||||
{
|
||||
bytesNeeded += sizeof (char16);
|
||||
char16* newStr = (char16*) malloc (bytesNeeded);
|
||||
if (multiByteToWideString (newStr, buffer8, len + 1, sourceCodePage) <= 0)
|
||||
char16* newStr = (char16*)malloc (bytesNeeded);
|
||||
if (multiByteToWideString (newStr, src, length + 1, sourceCodePage) < 0)
|
||||
{
|
||||
free (newStr);
|
||||
return false;
|
||||
}
|
||||
free (buffer8);
|
||||
if (buffer8)
|
||||
free (buffer8);
|
||||
|
||||
buffer16 = newStr;
|
||||
isWide = true;
|
||||
updateLength ();
|
||||
|
|
@ -2254,8 +2295,8 @@ bool String::toMultiByte (uint32 destCodePage)
|
|||
//-----------------------------------------------------------------------------
|
||||
void String::fromUTF8 (const char8* utf8String)
|
||||
{
|
||||
assign (utf8String);
|
||||
toWideString (kCP_Utf8);
|
||||
resize (0, false);
|
||||
_toWideString (utf8String, static_cast<int32> (strlen (utf8String)), kCP_Utf8);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -2272,12 +2313,12 @@ bool String::normalize (UnicodeNormalization n)
|
|||
if (n != kUnicodeNormC)
|
||||
return false;
|
||||
|
||||
uint32 normCharCount = static_cast<uint32> (FoldString (MAP_PRECOMPOSED, buffer16, len, nullptr, 0));
|
||||
uint32 normCharCount = static_cast<uint32> (FoldString (MAP_PRECOMPOSED, wscast (buffer16), len, nullptr, 0));
|
||||
if (normCharCount == len)
|
||||
return true;
|
||||
|
||||
char16* newString = (char16*)malloc ((normCharCount + 1) * sizeof (char16));
|
||||
uint32 converterCount = static_cast<uint32> (FoldString (MAP_PRECOMPOSED, buffer16, len, newString, normCharCount + 1));
|
||||
uint32 converterCount = static_cast<uint32> (FoldString (MAP_PRECOMPOSED, wscast (buffer16), len, wscast (newString), normCharCount + 1));
|
||||
if (converterCount != normCharCount)
|
||||
{
|
||||
free (newString);
|
||||
|
|
@ -3369,55 +3410,44 @@ String& String::printInt64 (int64 value)
|
|||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
String& String::printFloat (double value)
|
||||
String& String::printFloat (double value, uint32 maxPrecision)
|
||||
{
|
||||
static constexpr auto kMaxAfterCommaResolution = 16;
|
||||
// escape point for integer values, avoid unnecessary complexity later on
|
||||
const bool withinInt64Boundaries = value <= std::numeric_limits<int64>::max () && value >= std::numeric_limits<int64>::lowest ();
|
||||
if (withinInt64Boundaries && (maxPrecision == 0 || std::round (value) == value))
|
||||
return printInt64 (value);
|
||||
|
||||
const auto absValue = std::abs (value);
|
||||
const uint32 valueExponent = absValue >= 1 ? std::log10 (absValue) : -std::log10 (absValue) + 1;
|
||||
|
||||
maxPrecision = std::min<uint32> (kMaxAfterCommaResolution - valueExponent, maxPrecision);
|
||||
|
||||
if (isWide)
|
||||
{
|
||||
char16 string[kPrintfBufferSize];
|
||||
sprintf16 (string, STR16 ("%lf"), value);
|
||||
|
||||
char16* pointPtr = strrchr16 (string, STR ('.'));
|
||||
if (pointPtr)
|
||||
{
|
||||
pointPtr++; // keep 1st digit after point
|
||||
int32 index = strlen16 (string) - 1;
|
||||
char16 zero = STR16 ('0');
|
||||
while (pointPtr < (string + index))
|
||||
{
|
||||
if (string[index] == zero)
|
||||
{
|
||||
string[index] = 0;
|
||||
index--;
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
return assign (string);
|
||||
}
|
||||
printf (STR ("%s%dlf"), STR ("%."), maxPrecision);
|
||||
else
|
||||
{
|
||||
char8 string[kPrintfBufferSize];
|
||||
sprintf (string, "%lf", value);
|
||||
printf ("%s%dlf", "%.", maxPrecision);
|
||||
|
||||
char8* pointPtr = strrchr (string, '.');
|
||||
if (pointPtr)
|
||||
if (isWide)
|
||||
printf (text16 (), value);
|
||||
else
|
||||
printf (text8 (), value);
|
||||
|
||||
// trim trail zeros
|
||||
for (int32 i = length () - 1; i >= 0; i--)
|
||||
{
|
||||
if (isWide && testChar16 (i, '0') || testChar8 (i, '0'))
|
||||
remove (i);
|
||||
else if (isWide && testChar16(i,'.') || testChar8(i, '.'))
|
||||
{
|
||||
pointPtr++; // keep 1st digit after point
|
||||
int32 index = (int32) (strlen (string) - 1);
|
||||
while (pointPtr < (string + index))
|
||||
{
|
||||
if (string[index] == '0')
|
||||
{
|
||||
string[index] = 0;
|
||||
index--;
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
remove(i);
|
||||
break;
|
||||
}
|
||||
return assign (string);
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -3461,17 +3491,19 @@ bool String::incrementTrailingNumber (uint32 width, tchar separator, uint32 minN
|
|||
}
|
||||
else
|
||||
{
|
||||
char format[64];
|
||||
char trail[128];
|
||||
static constexpr auto kFormatSize = 64u;
|
||||
static constexpr auto kTrailSize = 64u;
|
||||
char format[kFormatSize];
|
||||
char trail[kTrailSize];
|
||||
if (separator && isEmpty () == false)
|
||||
{
|
||||
sprintf (format, "%%c%%0%uu", width);
|
||||
sprintf (trail, format, separator, (uint32) number);
|
||||
snprintf (format, kFormatSize, "%%c%%0%uu", width);
|
||||
snprintf (trail, kTrailSize, format, separator, (uint32) number);
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf (format, "%%0%uu", width);
|
||||
sprintf (trail, format, (uint32) number);
|
||||
snprintf (format, kFormatSize, "%%0%uu", width);
|
||||
snprintf (trail, kTrailSize, format, (uint32) number);
|
||||
}
|
||||
append (trail);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
|
|
@ -278,6 +278,11 @@ public:
|
|||
|
||||
bool isNormalized (UnicodeNormalization = kUnicodeNormC); ///< On PC only kUnicodeNormC is working
|
||||
|
||||
#if SMTG_OS_WINDOWS
|
||||
ConstString (const wchar_t* str, int32 length = -1) : ConstString (wscast (str), length) {}
|
||||
operator const wchar_t* () const { return wscast (text16 ());}
|
||||
#endif
|
||||
|
||||
#if SMTG_OS_MACOS
|
||||
virtual void* toCFStringRef (uint32 encoding = 0xFFFF, bool mutableCFString = false) const; ///< CFString conversion
|
||||
#endif
|
||||
|
|
@ -416,7 +421,15 @@ public:
|
|||
|
||||
// numbers-----------------------------------------------------------------
|
||||
String& printInt64 (int64 value);
|
||||
String& printFloat (double value);
|
||||
|
||||
/**
|
||||
* @brief print a float into a string, trailing zeros will be trimmed
|
||||
* @param value the floating value to be printed
|
||||
* @param maxPrecision (optional) the max precision allowed for this, num of significant digits after the comma
|
||||
* For instance printFloat (1.234, 2) => 1.23
|
||||
* @return the resulting string.
|
||||
*/
|
||||
String& printFloat (double value, uint32 maxPrecision = 6);
|
||||
/** Increment the trailing number if present else start with minNumber, width specifies the string width format (width 2 for number 3 is 03),
|
||||
applyOnlyFormat set to true will only format the string to the given width without incrementing the founded trailing number */
|
||||
bool incrementTrailingNumber (uint32 width = 2, tchar separator = STR (' '), uint32 minNumber = 1, bool applyOnlyFormat = false);
|
||||
|
|
@ -448,6 +461,11 @@ public:
|
|||
void fromUTF8 (const char8* utf8String); ///< Assigns from UTF8 string
|
||||
bool normalize (UnicodeNormalization = kUnicodeNormC); ///< On PC only kUnicodeNormC is working
|
||||
|
||||
#if SMTG_OS_WINDOWS
|
||||
String (const wchar_t* str, int32 length = -1, bool isTerminated = true) : String (wscast (str), length, isTerminated) {}
|
||||
String& operator= (const wchar_t* str) {return String::operator= (wscast (str)); }
|
||||
#endif
|
||||
|
||||
#if SMTG_OS_MACOS
|
||||
virtual bool fromCFStringRef (const void*, uint32 encoding = 0xFFFF); ///< CFString conversion
|
||||
#endif
|
||||
|
|
@ -458,6 +476,7 @@ protected:
|
|||
bool resize (uint32 newSize, bool wide, bool fill = false);
|
||||
|
||||
private:
|
||||
bool _toWideString (const char8* src, int32 length, uint32 sourceCodePage = kCP_Default);
|
||||
void tryFreeBuffer ();
|
||||
bool checkToMultiByte (uint32 destCodePage = kCP_Default) const; // to remove debug code from inline - const_cast inside!!!
|
||||
};
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
|
|
@ -56,7 +56,6 @@ using Steinberg::Base::Thread::FGuard;
|
|||
namespace Steinberg {
|
||||
|
||||
DEF_CLASS_IID (IUpdateManager)
|
||||
bool UpdateHandler::lockUpdates = false;
|
||||
|
||||
namespace Update {
|
||||
const uint32 kHashSize = (1 << 8); // must be power of 2 (16 bytes * 256 == 4096)
|
||||
|
|
@ -243,10 +242,17 @@ tresult PLUGIN_API UpdateHandler::addDependent (FUnknown* u, IDependent* _depend
|
|||
|
||||
return kResultTrue;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
tresult PLUGIN_API UpdateHandler::removeDependent (FUnknown* u, IDependent* dependent)
|
||||
{
|
||||
size_t eraseCount;
|
||||
return removeDependent (u, dependent, eraseCount);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
tresult PLUGIN_API UpdateHandler::removeDependent (FUnknown* u, IDependent* dependent, size_t& eraseCount)
|
||||
{
|
||||
eraseCount = 0;
|
||||
IPtr<FUnknown> unknown = Update::getUnknownBase (u);
|
||||
if (unknown == nullptr && dependent == nullptr)
|
||||
return kResultFalse;
|
||||
|
|
@ -287,13 +293,16 @@ tresult PLUGIN_API UpdateHandler::removeDependent (FUnknown* u, IDependent* depe
|
|||
if ((*iterList) == dependent)
|
||||
#endif
|
||||
{
|
||||
eraseCount = list.size ();
|
||||
if (list.size () == 1u)
|
||||
{
|
||||
listIsEmpty = true;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
iterList = list.erase (iterList);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -322,11 +331,11 @@ tresult PLUGIN_API UpdateHandler::removeDependent (FUnknown* u, IDependent* depe
|
|||
{
|
||||
if (dependent == nullptr) // Remove all dependents of object
|
||||
{
|
||||
eraseCount = iterList->second.size ();
|
||||
map.erase (iterList);
|
||||
}
|
||||
else // Remove one dependent
|
||||
{
|
||||
int32 eraseCount = 0;
|
||||
Update::DependentList& dependentlist = (*iterList).second;
|
||||
Update::DependentListIter iterDependentlist = dependentlist.begin ();
|
||||
while (iterDependentlist != dependentlist.end ())
|
||||
|
|
@ -363,8 +372,6 @@ tresult PLUGIN_API UpdateHandler::removeDependent (FUnknown* u, IDependent* depe
|
|||
//------------------------------------------------------------------------
|
||||
tresult UpdateHandler::doTriggerUpdates (FUnknown* u, int32 message, bool suppressUpdateDone)
|
||||
{
|
||||
if (lockUpdates)
|
||||
return kResultFalse;
|
||||
IPtr<FUnknown> unknown = Update::getUnknownBase (u);
|
||||
if (!unknown)
|
||||
return kResultFalse;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
|
|
@ -85,11 +85,15 @@ public:
|
|||
using FObject::deferUpdate;
|
||||
|
||||
// IUpdateHandler
|
||||
//private:
|
||||
friend class FObject;
|
||||
/** register \param dependent to get messages from \param object */
|
||||
tresult PLUGIN_API addDependent (FUnknown* object, IDependent* dependent) SMTG_OVERRIDE;
|
||||
/** unregister \param dependent to get no messages from \param object */
|
||||
tresult PLUGIN_API removeDependent (FUnknown* object, IDependent* dependent, size_t& earseCount);
|
||||
tresult PLUGIN_API removeDependent (FUnknown* object,
|
||||
IDependent* dependent) SMTG_OVERRIDE;
|
||||
public:
|
||||
/** send \param message to all dependents of \param object immediately */
|
||||
tresult PLUGIN_API triggerUpdates (FUnknown* object, int32 message) SMTG_OVERRIDE;
|
||||
/** send \param message to all dependents of \param object when idle */
|
||||
|
|
@ -103,15 +107,24 @@ public:
|
|||
|
||||
/// @cond ignore
|
||||
// obsolete functions kept for compatibility
|
||||
void checkUpdates (FObject* object = nullptr) { triggerDeferedUpdates (object->unknownCast ()); }
|
||||
void flushUpdates (FObject* object) { cancelUpdates (object->unknownCast ()); }
|
||||
void checkUpdates (FObject* object = nullptr)
|
||||
{
|
||||
triggerDeferedUpdates (object ? object->unknownCast () : nullptr);
|
||||
}
|
||||
void flushUpdates (FObject* object)
|
||||
{
|
||||
if (object)
|
||||
cancelUpdates (object->unknownCast ());
|
||||
}
|
||||
void deferUpdate (FObject* object, int32 message)
|
||||
{
|
||||
deferUpdates (object->unknownCast (), message);
|
||||
if (object)
|
||||
deferUpdates (object->unknownCast (), message);
|
||||
}
|
||||
void signalChange (FObject* object, int32 message, bool suppressUpdateDone = false)
|
||||
{
|
||||
doTriggerUpdates (object->unknownCast (), message, suppressUpdateDone);
|
||||
if (object)
|
||||
doTriggerUpdates (object->unknownCast (), message, suppressUpdateDone);
|
||||
}
|
||||
#if DEVELOPMENT
|
||||
bool checkDeferred (FUnknown* object);
|
||||
|
|
@ -130,8 +143,6 @@ private:
|
|||
|
||||
Steinberg::Base::Thread::FLock lock;
|
||||
Update::Table* table = nullptr;
|
||||
friend struct LockUpdateDependencies;
|
||||
static bool lockUpdates;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ const char16* ConstStringTable::getString (const char8* str) const
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
const char16 ConstStringTable::getString (const char8 str) const
|
||||
char16 ConstStringTable::getString (const char8 str) const
|
||||
{
|
||||
std::map<const char8, char16>::iterator iter = charMap->find (str);
|
||||
if (iter != charMap->end ())
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public:
|
|||
/** Returns a char16 string of a ASCII string literal*/
|
||||
const char16* getString (const char8* str) const;
|
||||
/** Returns a char16 character of a ASCII character */
|
||||
const char16 getString (const char8 str) const;
|
||||
char16 getString (const char8 str) const;
|
||||
|
||||
protected:
|
||||
ConstStringTable ();
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@
|
|||
#elif defined __BORLANDC__
|
||||
#pragma -a8
|
||||
#elif SMTG_OS_WINDOWS
|
||||
//! @brief warning C4996: alignment changed after including header, may be due to missing #pragma pack(pop)
|
||||
#pragma warning(disable : 4103)
|
||||
#pragma pack(push)
|
||||
#if SMTG_PLATFORM_64
|
||||
#pragma pack(16)
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
// values for BYTEORDER according to the used platform
|
||||
#define kLittleEndian 0
|
||||
#define kBigEndian 1
|
||||
|
||||
|
|
@ -38,21 +39,37 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
#if defined (_WIN32)
|
||||
//-----------------------------------------------------------------------------
|
||||
// ARM32 AND ARM64 (WINDOWS)
|
||||
#if (defined(_M_ARM64) || defined(_M_ARM))
|
||||
#define SMTG_OS_WINDOWS_ARM 1
|
||||
#endif
|
||||
|
||||
#define SMTG_OS_LINUX 0
|
||||
#define SMTG_OS_MACOS 0
|
||||
#define SMTG_OS_WINDOWS 1
|
||||
#define SMTG_OS_IOS 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
|
||||
#if defined(_M_IX86)
|
||||
#define SMTG_CPU_X86 1
|
||||
#else
|
||||
#define SMTG_CPU_X86 0
|
||||
#endif
|
||||
#if defined(_M_AMD64)
|
||||
#define SMTG_CPU_X86_64 1
|
||||
#else
|
||||
#define SMTG_CPU_X86_64 0
|
||||
#endif
|
||||
#if defined(_M_ARM)
|
||||
#define SMTG_CPU_ARM 1
|
||||
#else
|
||||
#define SMTG_CPU_ARM 0
|
||||
#endif
|
||||
#if defined(_M_ARM64)
|
||||
#define SMTG_CPU_ARM_64 1
|
||||
#else
|
||||
#define SMTG_CPU_ARM_64 0
|
||||
#endif
|
||||
#if defined(_M_ARM64EC)
|
||||
#define SMTG_CPU_ARM_64EC 1
|
||||
#else
|
||||
#define SMTG_CPU_ARM_64EC 0
|
||||
#endif
|
||||
|
||||
#define BYTEORDER kLittleEndian
|
||||
|
||||
|
|
@ -61,6 +78,7 @@
|
|||
#define SMTG_PTHREADS 0
|
||||
|
||||
#define SMTG_EXPORT_SYMBOL __declspec (dllexport)
|
||||
#define SMTG_HIDDEN_SYMBOL
|
||||
|
||||
#ifndef _CRT_SECURE_NO_WARNINGS
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
|
|
@ -88,7 +106,11 @@
|
|||
#ifdef __cplusplus
|
||||
#define SMTG_CPP11 __cplusplus >= 201103L || _MSC_VER > 1600 || SMTG_INTEL_CXX11_MODE
|
||||
#define SMTG_CPP11_STDLIBSUPPORT SMTG_CPP11
|
||||
#define SMTG_HAS_NOEXCEPT _MSC_VER >= 1900 || (SMTG_INTEL_CXX11_MODE && SMTG_INTEL_COMPILER >= 1300)
|
||||
#define SMTG_CPP14 (__cplusplus >= 201402L || (defined (_MSVC_LANG) && _MSVC_LANG >= 201402L))
|
||||
#define SMTG_CPP17 (__cplusplus >= 201703L || (defined (_MSVC_LANG) && _MSVC_LANG >= 201703L))
|
||||
#define SMTG_HAS_NOEXCEPT (_MSC_FULL_VER >= 190023026 || (SMTG_INTEL_CXX11_MODE && SMTG_INTEL_COMPILER >= 1300))
|
||||
#define SMTG_HAS_CPP11_CONSTEXPR (_MSC_FULL_VER >= 190024210L || (SMTG_INTEL_CXX11_MODE && SMTG_INTEL_COMPILER >= 1500) || (defined(__MINGW32__) && SMTG_CPP11))
|
||||
#define SMTG_HAS_CPP14_CONSTEXPR (((_MSC_VER >= 1915L) && (_MSVC_LANG >= 201402L)) || (SMTG_INTEL_CXX11_MODE && SMTG_INTEL_COMPILER > 1700) || (defined(__MINGW32__) && SMTG_CPP14))
|
||||
#endif
|
||||
|
||||
#define SMTG_DEPRECATED_ATTRIBUTE(message) __declspec (deprecated ("Is Deprecated: " message))
|
||||
|
|
@ -104,8 +126,17 @@
|
|||
|
||||
#define SMTG_CPU_X86 __i386__
|
||||
#define SMTG_CPU_X86_64 __x86_64__
|
||||
#define SMTG_CPU_ARM __arm__
|
||||
#define SMTG_CPU_ARM_64 __aarch64__
|
||||
#if defined(__arm__)
|
||||
#define SMTG_CPU_ARM __arm__
|
||||
#else
|
||||
#define SMTG_CPU_ARM 0
|
||||
#endif
|
||||
#if defined(__aarch64__)
|
||||
#define SMTG_CPU_ARM_64 __aarch64__
|
||||
#else
|
||||
#define SMTG_CPU_ARM_64 0
|
||||
#endif
|
||||
#define SMTG_CPU_ARM_64EC 0
|
||||
|
||||
#include <endian.h>
|
||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
|
|
@ -119,6 +150,7 @@
|
|||
#define SMTG_PTHREADS 1
|
||||
|
||||
#define SMTG_EXPORT_SYMBOL __attribute__ ((visibility ("default")))
|
||||
#define SMTG_HIDDEN_SYMBOL __attribute__ ((visibility ("hidden")))
|
||||
|
||||
#if __LP64__
|
||||
#define SMTG_PLATFORM_64 1
|
||||
|
|
@ -131,12 +163,16 @@
|
|||
#ifndef SMTG_CPP11
|
||||
#error unsupported compiler
|
||||
#endif
|
||||
#define SMTG_CPP14 (__cplusplus >= 201402L)
|
||||
#define SMTG_CPP17 (__cplusplus >= 201703L)
|
||||
#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_CPP11_CONSTEXPR SMTG_CPP11
|
||||
#define SMTG_HAS_CPP14_CONSTEXPR SMTG_CPP14
|
||||
#endif
|
||||
//-----------------------------------------------------------------------------
|
||||
// Mac and iOS
|
||||
|
|
@ -153,6 +189,7 @@
|
|||
#define SMTG_CPU_X86_64 TARGET_CPU_X86_64
|
||||
#define SMTG_CPU_ARM TARGET_CPU_ARM
|
||||
#define SMTG_CPU_ARM_64 TARGET_CPU_ARM64
|
||||
#define SMTG_CPU_ARM_64EC 0
|
||||
|
||||
#if !SMTG_OS_IOS
|
||||
#ifndef __CF_USE_FRAMEWORK_INCLUDES__
|
||||
|
|
@ -178,6 +215,7 @@
|
|||
#define SMTG_PTHREADS 1
|
||||
|
||||
#define SMTG_EXPORT_SYMBOL __attribute__ ((visibility ("default")))
|
||||
#define SMTG_HIDDEN_SYMBOL __attribute__ ((visibility ("hidden")))
|
||||
|
||||
#if !defined(__PLIST__) && !defined(SMTG_DISABLE_DEFAULT_DIAGNOSTICS)
|
||||
#ifdef __clang__
|
||||
|
|
@ -203,6 +241,8 @@
|
|||
#ifdef __cplusplus
|
||||
#include <cstddef>
|
||||
#define SMTG_CPP11 (__cplusplus >= 201103L || SMTG_INTEL_CXX11_MODE)
|
||||
#define SMTG_CPP14 (__cplusplus >= 201402L)
|
||||
#define SMTG_CPP17 (__cplusplus >= 201703L)
|
||||
#if defined (_LIBCPP_VERSION) && SMTG_CPP11
|
||||
#define SMTG_CPP11_STDLIBSUPPORT 1
|
||||
#define SMTG_HAS_NOEXCEPT 1
|
||||
|
|
@ -210,11 +250,23 @@
|
|||
#define SMTG_CPP11_STDLIBSUPPORT 0
|
||||
#define SMTG_HAS_NOEXCEPT 0
|
||||
#endif
|
||||
#define SMTG_HAS_CPP11_CONSTEXPR SMTG_CPP11
|
||||
#define SMTG_HAS_CPP14_CONSTEXPR SMTG_CPP14
|
||||
#endif
|
||||
//-----------------------------------------------------------------------------
|
||||
// Unknown Platform
|
||||
//-----------------------------------------------------------------------------
|
||||
#else
|
||||
#pragma error unknown platform
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
#if SMTG_OS_WINDOWS && (SMTG_CPU_ARM_64EC || SMTG_CPU_ARM_64 || SMTG_CPU_ARM)
|
||||
#define SMTG_OS_WINDOWS_ARM 1
|
||||
#else
|
||||
#define SMTG_OS_WINDOWS_ARM 0
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
#if !SMTG_RENAME_ASSERT
|
||||
#undef WINDOWS
|
||||
|
|
@ -236,11 +288,22 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
#if SMTG_CPP11
|
||||
#define SMTG_OVERRIDE override
|
||||
#define SMTG_CONSTEXPR constexpr
|
||||
#else
|
||||
#define SMTG_OVERRIDE
|
||||
#endif
|
||||
|
||||
#if SMTG_HAS_CPP11_CONSTEXPR
|
||||
#define SMTG_CONSTEXPR constexpr
|
||||
#else
|
||||
#define SMTG_CONSTEXPR
|
||||
#endif
|
||||
|
||||
#if SMTG_HAS_CPP14_CONSTEXPR
|
||||
#define SMTG_CONSTEXPR14 constexpr
|
||||
#else
|
||||
#define SMTG_CONSTEXPR14
|
||||
#endif
|
||||
|
||||
#if SMTG_HAS_NOEXCEPT
|
||||
#define SMTG_NOEXCEPT noexcept
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -25,11 +25,7 @@
|
|||
// 16 bit string operations
|
||||
#if SMTG_CPP11 // if c++11 unicode string literals
|
||||
#define SMTG_CPP11_CAT_PRIVATE_DONT_USE(a,b) a ## b
|
||||
#if SMTG_OS_WINDOWS
|
||||
#define STR16(x) SMTG_CPP11_CAT_PRIVATE_DONT_USE(L,x)
|
||||
#else
|
||||
#define STR16(x) SMTG_CPP11_CAT_PRIVATE_DONT_USE(u,x)
|
||||
#endif
|
||||
#define STR16(x) SMTG_CPP11_CAT_PRIVATE_DONT_USE(u,x)
|
||||
#else
|
||||
#include "conststringtable.h"
|
||||
#define STR16(x) Steinberg::ConstStringTable::instance ()->getString (x)
|
||||
|
|
@ -99,19 +95,19 @@
|
|||
namespace Steinberg {
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
static const tchar kEmptyString[] = { 0 };
|
||||
static const char8 kEmptyString8[] = { 0 };
|
||||
static const char16 kEmptyString16[] = { 0 };
|
||||
static SMTG_CONSTEXPR const tchar kEmptyString[] = { 0 };
|
||||
static SMTG_CONSTEXPR const char8 kEmptyString8[] = { 0 };
|
||||
static SMTG_CONSTEXPR const char16 kEmptyString16[] = { 0 };
|
||||
|
||||
#ifdef UNICODE
|
||||
static const tchar kInfiniteSymbol[] = { 0x221E, 0 };
|
||||
static SMTG_CONSTEXPR const tchar kInfiniteSymbol[] = { 0x221E, 0 };
|
||||
#else
|
||||
static const tchar* const kInfiniteSymbol = STR ("oo");
|
||||
static SMTG_CONSTEXPR const tchar* const kInfiniteSymbol = STR ("oo");
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
template <class T>
|
||||
inline int32 _tstrlen (const T* wcs)
|
||||
inline SMTG_CONSTEXPR14 int32 _tstrlen (const T* wcs)
|
||||
{
|
||||
const T* eos = wcs;
|
||||
|
||||
|
|
@ -121,13 +117,13 @@ inline int32 _tstrlen (const T* wcs)
|
|||
return (int32) (eos - wcs - 1);
|
||||
}
|
||||
|
||||
inline int32 tstrlen (const tchar* str) {return _tstrlen (str);}
|
||||
inline int32 strlen8 (const char8* str) {return _tstrlen (str);}
|
||||
inline int32 strlen16 (const char16* str) {return _tstrlen (str);}
|
||||
inline SMTG_CONSTEXPR14 int32 tstrlen (const tchar* str) {return _tstrlen (str);}
|
||||
inline SMTG_CONSTEXPR14 int32 strlen8 (const char8* str) {return _tstrlen (str);}
|
||||
inline SMTG_CONSTEXPR14 int32 strlen16 (const char16* str) {return _tstrlen (str);}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
template <class T>
|
||||
inline int32 _tstrcmp (const T* src, const T* dst)
|
||||
inline SMTG_CONSTEXPR14 int32 _tstrcmp (const T* src, const T* dst)
|
||||
{
|
||||
while (*src == *dst && *dst)
|
||||
{
|
||||
|
|
@ -145,22 +141,22 @@ inline int32 _tstrcmp (const T* src, const T* dst)
|
|||
return (int32) (*src - *dst);
|
||||
}
|
||||
|
||||
inline int32 tstrcmp (const tchar* src, const tchar* dst) {return _tstrcmp (src, dst);}
|
||||
inline int32 strcmp8 (const char8* src, const char8* dst) {return _tstrcmp (src, dst);}
|
||||
inline int32 strcmp16 (const char16* src, const char16* dst) {return _tstrcmp (src, dst);}
|
||||
inline SMTG_CONSTEXPR14 int32 tstrcmp (const tchar* src, const tchar* dst) {return _tstrcmp (src, dst);}
|
||||
inline SMTG_CONSTEXPR14 int32 strcmp8 (const char8* src, const char8* dst) {return _tstrcmp (src, dst);}
|
||||
inline SMTG_CONSTEXPR14 int32 strcmp16 (const char16* src, const char16* dst) {return _tstrcmp (src, dst);}
|
||||
|
||||
template <typename T>
|
||||
inline int32 strcmpT (const T* first, const T* last);
|
||||
inline SMTG_CONSTEXPR14 int32 strcmpT (const T* first, const T* last);
|
||||
|
||||
template <>
|
||||
inline int32 strcmpT<char8> (const char8* first, const char8* last) { return _tstrcmp (first, last); }
|
||||
inline SMTG_CONSTEXPR14 int32 strcmpT<char8> (const char8* first, const char8* last) { return _tstrcmp (first, last); }
|
||||
|
||||
template <>
|
||||
inline int32 strcmpT<char16> (const char16* first, const char16* last) { return _tstrcmp (first, last); }
|
||||
inline SMTG_CONSTEXPR14 int32 strcmpT<char16> (const char16* first, const char16* last) { return _tstrcmp (first, last); }
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
template <class T>
|
||||
inline int32 _tstrncmp (const T* first, const T* last, uint32 count)
|
||||
inline SMTG_CONSTEXPR14 int32 _tstrncmp (const T* first, const T* last, uint32 count)
|
||||
{
|
||||
if (count == 0)
|
||||
return 0;
|
||||
|
|
@ -181,35 +177,35 @@ inline int32 _tstrncmp (const T* first, const T* last, uint32 count)
|
|||
return (int32) (*first - *last);
|
||||
}
|
||||
|
||||
inline int32 tstrncmp (const tchar* first, const tchar* last, uint32 count) {return _tstrncmp (first, last, count);}
|
||||
inline int32 strncmp8 (const char8* first, const char8* last, uint32 count) {return _tstrncmp (first, last, count);}
|
||||
inline int32 strncmp16 (const char16* first, const char16* last, uint32 count) {return _tstrncmp (first, last, count);}
|
||||
inline SMTG_CONSTEXPR14 int32 tstrncmp (const tchar* first, const tchar* last, uint32 count) {return _tstrncmp (first, last, count);}
|
||||
inline SMTG_CONSTEXPR14 int32 strncmp8 (const char8* first, const char8* last, uint32 count) {return _tstrncmp (first, last, count);}
|
||||
inline SMTG_CONSTEXPR14 int32 strncmp16 (const char16* first, const char16* last, uint32 count) {return _tstrncmp (first, last, count);}
|
||||
|
||||
template <typename T>
|
||||
inline int32 strncmpT (const T* first, const T* last, uint32 count);
|
||||
inline SMTG_CONSTEXPR14 int32 strncmpT (const T* first, const T* last, uint32 count);
|
||||
|
||||
template <>
|
||||
inline int32 strncmpT<char8> (const char8* first, const char8* last, uint32 count) { return _tstrncmp (first, last, count); }
|
||||
inline SMTG_CONSTEXPR14 int32 strncmpT<char8> (const char8* first, const char8* last, uint32 count) { return _tstrncmp (first, last, count); }
|
||||
|
||||
template <>
|
||||
inline int32 strncmpT<char16> (const char16* first, const char16* last, uint32 count) {return _tstrncmp (first, last, count); }
|
||||
inline SMTG_CONSTEXPR14 int32 strncmpT<char16> (const char16* first, const char16* last, uint32 count) {return _tstrncmp (first, last, count); }
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
template <class T>
|
||||
inline T* _tstrcpy (T* dst, const T* src)
|
||||
inline SMTG_CONSTEXPR14 T* _tstrcpy (T* dst, const T* src)
|
||||
{
|
||||
T* cp = dst;
|
||||
while ((*cp++ = *src++) != 0) // copy string
|
||||
;
|
||||
return dst;
|
||||
}
|
||||
inline tchar* tstrcpy (tchar* dst, const tchar* src) {return _tstrcpy (dst, src);}
|
||||
inline char8* strcpy8 (char8* dst, const char8* src) {return _tstrcpy (dst, src);}
|
||||
inline char16* strcpy16 (char16* dst, const char16* src) {return _tstrcpy (dst, src);}
|
||||
inline SMTG_CONSTEXPR14 tchar* tstrcpy (tchar* dst, const tchar* src) {return _tstrcpy (dst, src);}
|
||||
inline SMTG_CONSTEXPR14 char8* strcpy8 (char8* dst, const char8* src) {return _tstrcpy (dst, src);}
|
||||
inline SMTG_CONSTEXPR14 char16* strcpy16 (char16* dst, const char16* src) {return _tstrcpy (dst, src);}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
template <class T>
|
||||
inline T* _tstrncpy (T* dest, const T* source, uint32 count)
|
||||
inline SMTG_CONSTEXPR14 T* _tstrncpy (T* dest, const T* source, uint32 count)
|
||||
{
|
||||
T* start = dest;
|
||||
while (count && (*dest++ = *source++) != 0) // copy string
|
||||
|
|
@ -223,13 +219,13 @@ inline T* _tstrncpy (T* dest, const T* source, uint32 count)
|
|||
return start;
|
||||
}
|
||||
|
||||
inline tchar* tstrncpy (tchar* dest, const tchar* source, uint32 count) {return _tstrncpy (dest, source, count);}
|
||||
inline char8* strncpy8 (char8* dest, const char8* source, uint32 count) {return _tstrncpy (dest, source, count);}
|
||||
inline char16* strncpy16 (char16* dest, const char16* source, uint32 count) {return _tstrncpy (dest, source, count);}
|
||||
inline SMTG_CONSTEXPR14 tchar* tstrncpy (tchar* dest, const tchar* source, uint32 count) {return _tstrncpy (dest, source, count);}
|
||||
inline SMTG_CONSTEXPR14 char8* strncpy8 (char8* dest, const char8* source, uint32 count) {return _tstrncpy (dest, source, count);}
|
||||
inline SMTG_CONSTEXPR14 char16* strncpy16 (char16* dest, const char16* source, uint32 count) {return _tstrncpy (dest, source, count);}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
template <class T>
|
||||
inline T* _tstrcat (T* dst, const T* src)
|
||||
inline SMTG_CONSTEXPR14 T* _tstrcat (T* dst, const T* src)
|
||||
{
|
||||
T* cp = dst;
|
||||
|
||||
|
|
@ -242,12 +238,12 @@ inline T* _tstrcat (T* dst, const T* src)
|
|||
return dst;
|
||||
}
|
||||
|
||||
inline tchar* tstrcat (tchar* dst, const tchar* src) {return _tstrcat (dst, src); }
|
||||
inline char8* strcat8 (char8* dst, const char8* src) {return _tstrcat (dst, src); }
|
||||
inline char16* strcat16 (char16* dst, const char16* src) {return _tstrcat (dst, src); }
|
||||
inline SMTG_CONSTEXPR14 tchar* tstrcat (tchar* dst, const tchar* src) {return _tstrcat (dst, src); }
|
||||
inline SMTG_CONSTEXPR14 char8* strcat8 (char8* dst, const char8* src) {return _tstrcat (dst, src); }
|
||||
inline SMTG_CONSTEXPR14 char16* strcat16 (char16* dst, const char16* src) {return _tstrcat (dst, src); }
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
inline void str8ToStr16 (char16* dst, const char8* src, int32 n = -1)
|
||||
inline SMTG_CONSTEXPR14 void str8ToStr16 (char16* dst, const char8* src, int32 n = -1)
|
||||
{
|
||||
int32 i = 0;
|
||||
for (;;)
|
||||
|
|
@ -278,12 +274,20 @@ inline void str8ToStr16 (char16* dst, const char8* src, int32 n = -1)
|
|||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
inline bool FIDStringsEqual (FIDString id1, FIDString id2)
|
||||
inline SMTG_CONSTEXPR14 bool FIDStringsEqual (FIDString id1, FIDString id2)
|
||||
{
|
||||
return (id1 && id2) ? (strcmp8 (id1, id2) == 0) : false;
|
||||
}
|
||||
|
||||
static const uint32 kPrintfBufferSize = 4096;
|
||||
static SMTG_CONSTEXPR const uint32 kPrintfBufferSize = 4096;
|
||||
|
||||
#if SMTG_OS_WINDOWS
|
||||
/* cast between wchar_t and char16 */
|
||||
inline wchar_t* wscast (char16* s) { static_assert (sizeof (wchar_t) == sizeof (char16), ""); return reinterpret_cast<wchar_t*> (s); }
|
||||
inline char16* wscast (wchar_t* s) { static_assert (sizeof (wchar_t) == sizeof (char16), ""); return reinterpret_cast<char16*> (s);}
|
||||
inline const wchar_t* wscast (const char16* s) { static_assert (sizeof (wchar_t) == sizeof (char16), ""); return reinterpret_cast<const wchar_t*> (s); }
|
||||
inline const char16* wscast (const wchar_t* s) { static_assert (sizeof (wchar_t) == sizeof (char16), ""); return reinterpret_cast<const char16*> (s); }
|
||||
#endif
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
} // namespace Steinberg
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@
|
|||
|
||||
#include "fplatform.h"
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
//#define UNICODE_OFF // disable / enable unicode
|
||||
|
||||
#ifdef UNICODE_OFF
|
||||
|
|
@ -37,38 +39,26 @@ namespace Steinberg
|
|||
//-----------------------------------------------------------------
|
||||
// Integral Types
|
||||
typedef char int8;
|
||||
typedef unsigned char uint8;
|
||||
typedef uint8_t uint8;
|
||||
typedef unsigned char uchar;
|
||||
|
||||
typedef short int16;
|
||||
typedef unsigned short uint16;
|
||||
typedef int16_t int16;
|
||||
typedef uint16_t uint16;
|
||||
|
||||
#if SMTG_OS_WINDOWS && !defined(__GNUC__)
|
||||
typedef long int32;
|
||||
typedef unsigned long uint32;
|
||||
#else
|
||||
typedef int int32;
|
||||
typedef unsigned int uint32;
|
||||
#endif
|
||||
typedef int32_t int32;
|
||||
typedef uint32_t uint32;
|
||||
|
||||
static const int32 kMaxLong = 0x7fffffff;
|
||||
static const int32 kMinLong = (-0x7fffffff - 1);
|
||||
static const int32 kMaxInt32 = kMaxLong;
|
||||
static const int32 kMinInt32 = kMinLong;
|
||||
static const uint32 kMaxInt32u = 0xffffffff;
|
||||
static const int32 kMaxInt32 = INT32_MAX;
|
||||
static const int32 kMinInt32 = INT32_MIN;
|
||||
static const int32 kMaxLong = kMaxInt32;
|
||||
static const int32 kMinLong = kMinInt32;
|
||||
static const uint32 kMaxInt32u = UINT32_MAX;
|
||||
|
||||
#if SMTG_OS_WINDOWS && !defined(__GNUC__)
|
||||
typedef __int64 int64;
|
||||
typedef unsigned __int64 uint64;
|
||||
static const int64 kMaxInt64 = 9223372036854775807i64;
|
||||
static const int64 kMinInt64 = (-9223372036854775807i64 - 1);
|
||||
#else
|
||||
typedef long long int64;
|
||||
typedef unsigned long long uint64;
|
||||
static const int64 kMaxInt64 = 0x7fffffffffffffffLL;
|
||||
static const int64 kMinInt64 = (-0x7fffffffffffffffLL-1);
|
||||
#endif
|
||||
static const uint64 kMaxInt64u = uint64 (0xffffffff) | (uint64 (0xffffffff) << 32);
|
||||
typedef int64_t int64;
|
||||
typedef uint64_t uint64;
|
||||
static const int64 kMaxInt64 = INT64_MAX;
|
||||
static const int64 kMinInt64 = INT64_MIN;
|
||||
static const uint64 kMaxInt64u = UINT64_MAX;
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
// other Semantic Types
|
||||
|
|
@ -91,15 +81,7 @@ namespace Steinberg
|
|||
//------------------------------------------------------------------
|
||||
// Char / Strings
|
||||
typedef char char8;
|
||||
#ifdef _NATIVE_WCHAR_T_DEFINED
|
||||
typedef __wchar_t char16;
|
||||
#elif defined(__MINGW32__)
|
||||
typedef wchar_t char16;
|
||||
#elif SMTG_CPP11
|
||||
typedef char16_t char16;
|
||||
#else
|
||||
typedef int16 char16;
|
||||
#endif
|
||||
|
||||
#ifdef UNICODE
|
||||
typedef char16 tchar;
|
||||
|
|
|
|||
|
|
@ -406,17 +406,23 @@ void FUID::toRegistryString (char8* string) const
|
|||
char8 s5[13];
|
||||
Steinberg::toString8 (s5, data, 10, 16);
|
||||
|
||||
sprintf (string, "{%s-%s-%s-%s-%s}", s1, s2, s3, s4, s5);
|
||||
snprintf (string, 36, "{%s-%s-%s-%s-%s}", s1, s2, s3, s4, s5);
|
||||
#endif
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
void FUID::print (char8* string, int32 style) const
|
||||
{
|
||||
if (!string) // no string: debug output
|
||||
print (style, string, 62);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
void FUID::print (int32 style, char8* string, size_t stringBufferSize) const
|
||||
{
|
||||
if (!string || stringBufferSize == 0) // no string: debug output
|
||||
{
|
||||
char8 str[128];
|
||||
print (str, style);
|
||||
print (style, str, 128);
|
||||
|
||||
#if SMTG_OS_WINDOWS
|
||||
OutputDebugStringA (str);
|
||||
|
|
@ -433,21 +439,25 @@ void FUID::print (char8* string, int32 style) const
|
|||
switch (style)
|
||||
{
|
||||
case kINLINE_UID:
|
||||
sprintf (string, "INLINE_UID (0x%08X, 0x%08X, 0x%08X, 0x%08X)", l1, l2, l3, l4);
|
||||
snprintf (string, stringBufferSize, "INLINE_UID (0x%08X, 0x%08X, 0x%08X, 0x%08X)", l1,
|
||||
l2, l3, l4);
|
||||
break;
|
||||
|
||||
case kDECLARE_UID:
|
||||
sprintf (string, "DECLARE_UID (0x%08X, 0x%08X, 0x%08X, 0x%08X)", l1, l2, l3, l4);
|
||||
snprintf (string, stringBufferSize, "DECLARE_UID (0x%08X, 0x%08X, 0x%08X, 0x%08X)", l1,
|
||||
l2, l3, l4);
|
||||
break;
|
||||
|
||||
case kFUID:
|
||||
sprintf (string, "FUID (0x%08X, 0x%08X, 0x%08X, 0x%08X)", l1, l2, l3, l4);
|
||||
snprintf (string, stringBufferSize, "FUID (0x%08X, 0x%08X, 0x%08X, 0x%08X)", l1, l2, l3,
|
||||
l4);
|
||||
break;
|
||||
|
||||
case kCLASS_UID:
|
||||
default:
|
||||
sprintf (string, "DECLARE_CLASS_IID (Interface, 0x%08X, 0x%08X, 0x%08X, 0x%08X)", l1,
|
||||
l2, l3, l4);
|
||||
snprintf (string, stringBufferSize,
|
||||
"DECLARE_CLASS_IID (Interface, 0x%08X, 0x%08X, 0x%08X, 0x%08X)", l1, l2, l3,
|
||||
l4);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -467,7 +477,7 @@ static void toString8 (char8* string, const char* data, int32 i1, int32 i2)
|
|||
for (int32 i = i1; i < i2; i++)
|
||||
{
|
||||
char8 s[3];
|
||||
sprintf (s, "%02X", (uint8)data[i]);
|
||||
snprintf (s, 3, "%02X", (uint8)data[i]);
|
||||
strcat (string, s);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,19 +60,18 @@
|
|||
#endif
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
#define DECLARE_UID(name, l1, l2, l3, l4) ::Steinberg::TUID name = INLINE_UID (l1, l2, l3, l4);
|
||||
#define DECLARE_UID(name, l1, l2, l3, l4) SMTG_CONSTEXPR14 ::Steinberg::TUID name = INLINE_UID (l1, l2, l3, l4);
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
#define EXTERN_UID(name) extern const ::Steinberg::TUID name;
|
||||
|
||||
#ifdef INIT_CLASS_IID
|
||||
#define DECLARE_CLASS_IID(ClassName, l1, l2, l3, l4) \
|
||||
static const ::Steinberg::TUID ClassName##_iid = INLINE_UID (l1, l2, l3, l4); \
|
||||
\
|
||||
const ::Steinberg::FUID ClassName::iid (ClassName##_iid);
|
||||
#define DECLARE_CLASS_IID(ClassName, l1, l2, l3, l4) \
|
||||
static SMTG_CONSTEXPR14 const ::Steinberg::TUID ClassName##_iid = INLINE_UID (l1, l2, l3, l4); \
|
||||
const ::Steinberg::FUID ClassName::iid (ClassName##_iid);
|
||||
#else
|
||||
#define DECLARE_CLASS_IID(ClassName, l1, l2, l3, l4) \
|
||||
static const ::Steinberg::TUID ClassName##_iid = INLINE_UID (l1, l2, l3, l4);
|
||||
static SMTG_CONSTEXPR14 const ::Steinberg::TUID ClassName##_iid = INLINE_UID (l1, l2, l3, l4);
|
||||
#endif
|
||||
|
||||
#define DEF_CLASS_IID(ClassName) const ::Steinberg::FUID ClassName::iid (ClassName##_iid);
|
||||
|
|
@ -207,7 +206,16 @@ typedef int64 LARGE_INT; // obsolete
|
|||
//------------------------------------------------------------------------
|
||||
// FUID class declaration
|
||||
//------------------------------------------------------------------------
|
||||
typedef int8 TUID[16]; ///< plain UID type
|
||||
typedef char TUID[16]; ///< plain UID type
|
||||
|
||||
#if SMTG_CPP14
|
||||
//------------------------------------------------------------------------
|
||||
inline SMTG_CONSTEXPR14 void copyTUID (char* dst, const char* src)
|
||||
{
|
||||
for (auto i = 0; i < 16; ++i)
|
||||
dst[i] = src[i];
|
||||
}
|
||||
#endif
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
/* FUnknown private */
|
||||
|
|
@ -301,12 +309,18 @@ public:
|
|||
kCLASS_UID ///< "DECLARE_CLASS_IID (Interface, 0x00000000, 0x00000000, 0x00000000, 0x00000000)"
|
||||
};
|
||||
/** Prints the UID to a string (or debug output if string is NULL).
|
||||
\param string is the output string if not NULL.
|
||||
\param style can be chosen from the FUID::UIDPrintStyle enumeration. */
|
||||
\param style can be chosen from the FUID::UIDPrintStyle enumeration.
|
||||
\param string is the output string if not NULL.
|
||||
\param stringBufferSize is the size of the output string */
|
||||
void print (int32 style, char8* string = nullptr, size_t stringBufferSize = 0) const;
|
||||
|
||||
#if SMTG_CPP17
|
||||
[[deprecated ("Use the print method with the buffer size")]]
|
||||
#endif
|
||||
void print (char8* string = nullptr, int32 style = kINLINE_UID) const;
|
||||
|
||||
template <size_t N>
|
||||
inline explicit FUID (const int8 (&uid)[N])
|
||||
inline explicit FUID (const char (&uid)[N])
|
||||
{
|
||||
#if SMTG_CPP11_STDLIBSUPPORT
|
||||
static_assert (N == sizeof (TUID), "only TUID allowed");
|
||||
|
|
@ -442,7 +456,7 @@ 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.
|
||||
* the FUID and DECLARE_CLASS_IID method or the U::UID method is used.
|
||||
*/
|
||||
template <typename T, typename U = void>
|
||||
struct HasIIDType : std::false_type
|
||||
|
|
@ -459,7 +473,7 @@ 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. */
|
||||
/** @return the TUID for an interface which uses the U::UID method. */
|
||||
template <typename T,
|
||||
typename std::enable_if<FUnknownPrivate::HasIIDType<T>::value>::type* = nullptr>
|
||||
const TUID& getTUID ()
|
||||
|
|
@ -468,7 +482,7 @@ const TUID& getTUID ()
|
|||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
/** @return the TUID for a SKI interface which uses the FUID and DECLARE_CLASS_IID method. */
|
||||
/** @return the TUID for an 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 ()
|
||||
|
|
|
|||
|
|
@ -38,8 +38,10 @@ class IPluginBase: public FUnknown
|
|||
public:
|
||||
//------------------------------------------------------------------------
|
||||
/** 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!
|
||||
If the method does NOT return kResultOk, the object is released immediately. In this case terminate is not called! */
|
||||
\param context, passed by the host, is mandatory and should implement IHostApplication
|
||||
@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! */
|
||||
virtual tresult PLUGIN_API initialize (FUnknown* context) = 0;
|
||||
|
||||
/** This function is called before the plug-in is unloaded and can be used for
|
||||
|
|
@ -62,11 +64,23 @@ struct PFactoryInfo
|
|||
//------------------------------------------------------------------------
|
||||
enum FactoryFlags
|
||||
{
|
||||
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.
|
||||
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 will not be unloaded until process exit
|
||||
kUnicode = 1 << 4 ///< Components have entirely unicode encoded strings. (True for VST 3 plug-ins so far)
|
||||
/** Nothing */
|
||||
kNoFlags = 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,
|
||||
|
||||
/** This flag is deprecated, do not use anymore, resp. it will get ignored from
|
||||
Cubase/Nuendo 12 and later. */
|
||||
kLicenseCheck = 1 << 1,
|
||||
|
||||
/** Component will not be unloaded until process exit */
|
||||
kComponentNonDiscardable = 1 << 3,
|
||||
|
||||
/** Components have entirely unicode encoded strings (True for VST 3 plug-ins so far). */
|
||||
kUnicode = 1 << 4
|
||||
};
|
||||
|
||||
enum
|
||||
|
|
@ -77,12 +91,16 @@ struct PFactoryInfo
|
|||
};
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
char8 vendor[kNameSize]; ///< e.g. "Steinberg Media Technologies"
|
||||
char8 url[kURLSize]; ///< e.g. "http://www.steinberg.de"
|
||||
char8 email[kEmailSize]; ///< e.g. "info@steinberg.de"
|
||||
int32 flags; ///< (see above)
|
||||
char8 vendor[kNameSize]; ///< e.g. "Steinberg Media Technologies"
|
||||
char8 url[kURLSize]; ///< e.g. "http://www.steinberg.de"
|
||||
char8 email[kEmailSize]; ///< e.g. "info@steinberg.de"
|
||||
int32 flags; ///< (see FactoryFlags above)
|
||||
//------------------------------------------------------------------------
|
||||
PFactoryInfo (const char8* _vendor, const char8* _url, const char8* _email, int32 _flags)
|
||||
SMTG_CONSTEXPR14 PFactoryInfo (const char8* _vendor, const char8* _url, const char8* _email,
|
||||
int32 _flags)
|
||||
#if SMTG_CPP14
|
||||
: vendor (), url (), email (), flags ()
|
||||
#endif
|
||||
{
|
||||
strncpy8 (vendor, _vendor, kNameSize);
|
||||
strncpy8 (url, _url, kURLSize);
|
||||
|
|
@ -117,16 +135,32 @@ struct PClassInfo
|
|||
kNameSize = 64
|
||||
};
|
||||
//------------------------------------------------------------------------
|
||||
TUID cid; ///< Class ID 16 Byte class GUID
|
||||
int32 cardinality; ///< cardinality of the class, set to kManyInstances (see \ref ClassCardinality)
|
||||
char8 category[kCategorySize]; ///< class category, host uses this to categorize interfaces
|
||||
char8 name[kNameSize]; ///< class name, visible to the user
|
||||
/** Class ID 16 Byte class GUID */
|
||||
TUID cid;
|
||||
|
||||
/** Cardinality of the class, set to kManyInstances (see \ref PClassInfo::ClassCardinality) */
|
||||
int32 cardinality;
|
||||
|
||||
/** Class category, host uses this to categorize interfaces */
|
||||
char8 category[kCategorySize];
|
||||
|
||||
/** Class name, visible to the user */
|
||||
char8 name[kNameSize];
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
PClassInfo (const TUID _cid, int32 _cardinality, const char8* _category, const char8* _name)
|
||||
SMTG_CONSTEXPR14 PClassInfo (const TUID _cid, int32 _cardinality, const char8* _category,
|
||||
const char8* _name)
|
||||
#if SMTG_CPP14
|
||||
: cid (), cardinality (), category (), name ()
|
||||
#endif
|
||||
{
|
||||
#if SMTG_CPP14
|
||||
copyTUID (cid, _cid);
|
||||
#else
|
||||
memset (this, 0, sizeof (PClassInfo));
|
||||
memcpy (cid, _cid, sizeof (TUID));
|
||||
#endif
|
||||
if (_category)
|
||||
strncpy8 (category, _category, kCategorySize);
|
||||
if (_name)
|
||||
|
|
@ -162,8 +196,9 @@ public:
|
|||
/** Fill a PFactoryInfo structure with information about the plug-in vendor. */
|
||||
virtual tresult PLUGIN_API getFactoryInfo (PFactoryInfo* info) = 0;
|
||||
|
||||
/** Returns the number of exported classes by this factory.
|
||||
If you are using the CPluginFactory implementation provided by the SDK, it returns the number of classes you registered with CPluginFactory::registerClass. */
|
||||
/** Returns the number of exported classes by this factory. If you are using the CPluginFactory
|
||||
* implementation provided by the SDK, it returns the number of classes you registered with
|
||||
* CPluginFactory::registerClass. */
|
||||
virtual int32 PLUGIN_API countClasses () = 0;
|
||||
|
||||
/** Fill a PClassInfo structure with information about the class at the specified index. */
|
||||
|
|
@ -186,10 +221,17 @@ DECLARE_CLASS_IID (IPluginFactory, 0x7A4D811C, 0x52114A1F, 0xAED9D2EE, 0x0B43BF9
|
|||
struct PClassInfo2
|
||||
{
|
||||
//------------------------------------------------------------------------
|
||||
TUID cid; ///< Class ID 16 Byte class GUID
|
||||
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 name[PClassInfo::kNameSize]; ///< class name, visible to the user
|
||||
/** Class ID 16 Byte class GUID */
|
||||
TUID cid;
|
||||
|
||||
/** Cardinality of the class, set to kManyInstances (see \ref PClassInfo::ClassCardinality) */
|
||||
int32 cardinality;
|
||||
|
||||
/** Class category, host uses this to categorize interfaces */
|
||||
char8 category[PClassInfo::kCategorySize];
|
||||
|
||||
/** Class name, visible to the user */
|
||||
char8 name[PClassInfo::kNameSize];
|
||||
|
||||
enum {
|
||||
kVendorSize = 64,
|
||||
|
|
@ -197,20 +239,44 @@ struct PClassInfo2
|
|||
kSubCategoriesSize = 128
|
||||
};
|
||||
|
||||
uint32 classFlags; ///< flags used for a specific category, must be defined where category is defined
|
||||
char8 subCategories[kSubCategoriesSize]; ///< module specific subcategories, can be more than one, logically added by the \c OR operator
|
||||
char8 vendor[kVendorSize]; ///< overwrite vendor information from factory info
|
||||
char8 version[kVersionSize]; ///< Version string (e.g. "1.0.0.512" with Major.Minor.Subversion.Build)
|
||||
char8 sdkVersion[kVersionSize]; ///< SDK version used to build this class (e.g. "VST 3.0")
|
||||
/** flags used for a specific category, must be defined where category is defined */
|
||||
uint32 classFlags;
|
||||
|
||||
/** module specific subcategories, can be more than one, logically added by the OR operator */
|
||||
char8 subCategories[kSubCategoriesSize];
|
||||
|
||||
/** overwrite vendor information from factory info */
|
||||
char8 vendor[kVendorSize];
|
||||
|
||||
/** Version string (e.g. "1.0.0.512" with Major.Minor.Subversion.Build) */
|
||||
char8 version[kVersionSize];
|
||||
|
||||
/** SDK version used to build this class (e.g. "VST 3.0") */
|
||||
char8 sdkVersion[kVersionSize];
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
PClassInfo2 (const TUID _cid, int32 _cardinality, const char8* _category, const char8* _name,
|
||||
int32 _classFlags, const char8* _subCategories, const char8* _vendor, const char8* _version,
|
||||
const char8* _sdkVersion)
|
||||
SMTG_CONSTEXPR14 PClassInfo2 (const TUID _cid, int32 _cardinality, const char8* _category,
|
||||
const char8* _name, int32 _classFlags,
|
||||
const char8* _subCategories, const char8* _vendor,
|
||||
const char8* _version, const char8* _sdkVersion)
|
||||
#if SMTG_CPP14
|
||||
: cid ()
|
||||
, cardinality ()
|
||||
, category ()
|
||||
, name ()
|
||||
, classFlags ()
|
||||
, subCategories ()
|
||||
, vendor ()
|
||||
, version ()
|
||||
, sdkVersion ()
|
||||
#endif
|
||||
{
|
||||
#if SMTG_CPP14
|
||||
copyTUID (cid, _cid);
|
||||
#else
|
||||
memset (this, 0, sizeof (PClassInfo2));
|
||||
memcpy (cid, _cid, sizeof (TUID));
|
||||
#endif
|
||||
cardinality = _cardinality;
|
||||
if (_category)
|
||||
strncpy8 (category, _category, PClassInfo::kCategorySize);
|
||||
|
|
@ -281,19 +347,44 @@ struct PClassInfoW
|
|||
kSubCategoriesSize = 128
|
||||
};
|
||||
|
||||
uint32 classFlags; ///< flags used for a specific category, must be defined where category is defined
|
||||
char8 subCategories[kSubCategoriesSize];///< module specific subcategories, can be more than one, logically added by the \c OR operator
|
||||
char16 vendor[kVendorSize]; ///< overwrite vendor information from factory info
|
||||
char16 version[kVersionSize]; ///< Version string (e.g. "1.0.0.512" with Major.Minor.Subversion.Build)
|
||||
char16 sdkVersion[kVersionSize]; ///< SDK version used to build this class (e.g. "VST 3.0")
|
||||
/** flags used for a specific category, must be defined where category is defined */
|
||||
uint32 classFlags;
|
||||
|
||||
/** module specific subcategories, can be more than one, logically added by the OR operator */
|
||||
char8 subCategories[kSubCategoriesSize];
|
||||
|
||||
/** overwrite vendor information from factory info */
|
||||
char16 vendor[kVendorSize];
|
||||
|
||||
/** Version string (e.g. "1.0.0.512" with Major.Minor.Subversion.Build) */
|
||||
char16 version[kVersionSize];
|
||||
|
||||
/** SDK version used to build this class (e.g. "VST 3.0") */
|
||||
char16 sdkVersion[kVersionSize];
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
PClassInfoW (const TUID _cid, int32 _cardinality, const char8* _category, const char16* _name,
|
||||
int32 _classFlags, const char8* _subCategories, const char16* _vendor, const char16* _version,
|
||||
const char16* _sdkVersion)
|
||||
SMTG_CONSTEXPR14 PClassInfoW (const TUID _cid, int32 _cardinality, const char8* _category,
|
||||
const char16* _name, int32 _classFlags,
|
||||
const char8* _subCategories, const char16* _vendor,
|
||||
const char16* _version, const char16* _sdkVersion)
|
||||
#if SMTG_CPP14
|
||||
: cid ()
|
||||
, cardinality ()
|
||||
, category ()
|
||||
, name ()
|
||||
, classFlags ()
|
||||
, subCategories ()
|
||||
, vendor ()
|
||||
, version ()
|
||||
, sdkVersion ()
|
||||
#endif
|
||||
{
|
||||
#if SMTG_CPP14
|
||||
copyTUID (cid, _cid);
|
||||
#else
|
||||
memset (this, 0, sizeof (PClassInfoW));
|
||||
memcpy (cid, _cid, sizeof (TUID));
|
||||
#endif
|
||||
cardinality = _cardinality;
|
||||
if (_category)
|
||||
strncpy8 (category, _category, PClassInfo::kCategorySize);
|
||||
|
|
@ -326,9 +417,13 @@ struct PClassInfoW
|
|||
PClassInfoW () { memset (this, 0, sizeof (PClassInfoW)); }
|
||||
#endif
|
||||
|
||||
void fromAscii (const PClassInfo2& ci2)
|
||||
SMTG_CONSTEXPR14 void fromAscii (const PClassInfo2& ci2)
|
||||
{
|
||||
#if SMTG_CPP14
|
||||
copyTUID (cid, ci2.cid);
|
||||
#else
|
||||
memcpy (cid, ci2.cid, sizeof (TUID));
|
||||
#endif
|
||||
cardinality = ci2.cardinality;
|
||||
strncpy8 (category, ci2.category, PClassInfo::kCategorySize);
|
||||
str8ToStr16 (name, ci2.name, PClassInfo::kNameSize);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,122 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Project : SDK Core
|
||||
//
|
||||
// Category : SDK Core Interfaces
|
||||
// Filename : pluginterfaces/base/iplugincompatibility.h
|
||||
// Created by : Steinberg, 02/2022
|
||||
// Description : Basic Plug-in Interfaces
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// 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 "ibstream.h"
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
namespace Steinberg {
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
/** moduleinfo.json
|
||||
|
||||
The moduleinfo.json describes the contents of the plug-in in a JSON5 compatible format (See https://json5.org/).
|
||||
It contains the factory info (see PFactoryInfo), the contained classes (see PClassInfo), the
|
||||
included snapshots and a list of compatibility of the included classes.
|
||||
|
||||
An example moduleinfo.json:
|
||||
|
||||
\code
|
||||
{
|
||||
"Name": "",
|
||||
"Version": "1.0",
|
||||
"Factory Info": {
|
||||
"Vendor": "Steinberg Media Technologies",
|
||||
"URL": "http://www.steinberg.net",
|
||||
"E-Mail": "mailto:info@steinberg.de",
|
||||
"Flags": {
|
||||
"Unicode": true,
|
||||
"Classes Discardable": false,
|
||||
"Component Non Discardable": false,
|
||||
},
|
||||
},
|
||||
"Compatibility": [
|
||||
{
|
||||
"New": "B9F9ADE1CD9C4B6DA57E61E3123535FD",
|
||||
"Old": [
|
||||
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", // just an example
|
||||
"BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB", // another example
|
||||
],
|
||||
},
|
||||
],
|
||||
"Classes": [
|
||||
{
|
||||
"CID": "B9F9ADE1CD9C4B6DA57E61E3123535FD",
|
||||
"Category": "Audio Module Class",
|
||||
"Name": "AGainSimple VST3",
|
||||
"Vendor": "Steinberg Media Technologies",
|
||||
"Version": "1.3.0.1",
|
||||
"SDKVersion": "VST 3.7.4",
|
||||
"Sub Categories": [
|
||||
"Fx",
|
||||
],
|
||||
"Class Flags": 0,
|
||||
"Cardinality": 2147483647,
|
||||
"Snapshots": [
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
\endcode
|
||||
|
||||
*/
|
||||
|
||||
#define kPluginCompatibilityClass "Plugin Compatibility Class"
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
/** optional interface to query the compatibility of the plug-ins classes
|
||||
- [plug imp]
|
||||
|
||||
A plug-in can add a class with this interface to its class factory if it cannot provide a
|
||||
moduleinfo.json file in its plug-in package/bundle where the compatibility is normally part of.
|
||||
|
||||
If the module contains a moduleinfo.json the host will ignore this class.
|
||||
|
||||
The class must write into the stream an UTF-8 encoded json description of the compatibility of
|
||||
the other classes in the factory.
|
||||
|
||||
It is expected that the JSON5 written starts with an array:
|
||||
\code
|
||||
[
|
||||
{
|
||||
"New": "B9F9ADE1CD9C4B6DA57E61E3123535FD",
|
||||
"Old": [
|
||||
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", // just an example
|
||||
"BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB", // another example
|
||||
],
|
||||
},
|
||||
]
|
||||
\endcode
|
||||
*/
|
||||
class IPluginCompatibility : public FUnknown
|
||||
{
|
||||
public:
|
||||
/** get the compatibility stream
|
||||
* @param stream the stream the plug-in must write the UTF8 encoded JSON5 compatibility
|
||||
* string.
|
||||
* @return kResultTrue on success
|
||||
*/
|
||||
virtual tresult PLUGIN_API getCompatibilityJSON (IBStream* stream) = 0;
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
static const FUID iid;
|
||||
};
|
||||
|
||||
DECLARE_CLASS_IID (IPluginCompatibility, 0x4AFD4B6A, 0x35D7C240, 0xA5C31414, 0xFB7D15E6)
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
} // Steinberg
|
||||
|
|
@ -36,16 +36,24 @@ namespace Steinberg {
|
|||
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.
|
||||
|
||||
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).
|
||||
The host could call setContentScaleFactor in a different context, for example: scaling the
|
||||
plug-in editor for better readability.
|
||||
The host calls setContentScaleFactor directly before or after the plug-in view is attached and when
|
||||
the scale factor changes while the view is attached (system change or window moved to another screen
|
||||
with different scaling settings).
|
||||
|
||||
The host may call setContentScaleFactor in a different context, for example: scaling the plug-in
|
||||
editor for better readability.
|
||||
|
||||
When a plug-in handles this (by returning kResultTrue), it needs to scale the width and height of
|
||||
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().
|
||||
|
||||
Note that the host is allowed to call setContentScaleFactor() at any time the IPlugView is valid.
|
||||
*/
|
||||
If this happens before the IPlugFrame object is set on your view, make sure that when the host calls
|
||||
IPlugView::getSize() afterwards you return the size of your view for that new scale factor.
|
||||
|
||||
It is recommended to implement this interface on Microsoft Windows to let the host know that the
|
||||
plug-in is able to render in different scalings.
|
||||
*/
|
||||
class IPlugViewContentScaleSupport : public FUnknown
|
||||
{
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ public:
|
|||
/** Gets float value. */
|
||||
virtual tresult PLUGIN_API getFloat (AttrID id, double& value) = 0;
|
||||
|
||||
/** Sets string value (UTF16) (should be null-terminated!). */
|
||||
/** Sets string value (UTF16) (must be null-terminated!). */
|
||||
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!
|
||||
|
|
|
|||
|
|
@ -46,48 +46,48 @@ namespace PlugType
|
|||
\defgroup plugType Plug-in Type used for subCategories */
|
||||
/*@{*/
|
||||
//------------------------------------------------------------------------
|
||||
const CString kFxAnalyzer = "Fx|Analyzer"; ///< Scope, FFT-Display, Loudness Processing...
|
||||
const CString kFxDelay = "Fx|Delay"; ///< Delay, Multi-tap Delay, Ping-Pong Delay...
|
||||
const CString kFxDistortion = "Fx|Distortion"; ///< Amp Simulator, Sub-Harmonic, SoftClipper...
|
||||
const CString kFxDynamics = "Fx|Dynamics"; ///< Compressor, Expander, Gate, Limiter, Maximizer, Tape Simulator, EnvelopeShaper...
|
||||
const CString kFxEQ = "Fx|EQ"; ///< Equalization, Graphical EQ...
|
||||
const CString kFxFilter = "Fx|Filter"; ///< WahWah, ToneBooster, Specific Filter,...
|
||||
const CString kFx = "Fx"; ///< others type (not categorized)
|
||||
const CString kFxInstrument = "Fx|Instrument"; ///< Fx which could be loaded as Instrument too
|
||||
const CString kFxInstrumentExternal = "Fx|Instrument|External"; ///< Fx which could be loaded as Instrument too and is external (wrapped Hardware)
|
||||
const CString kFxSpatial = "Fx|Spatial"; ///< MonoToStereo, StereoEnhancer,...
|
||||
const CString kFxGenerator = "Fx|Generator"; ///< Tone Generator, Noise Generator...
|
||||
const CString kFxMastering = "Fx|Mastering"; ///< Dither, Noise Shaping,...
|
||||
const CString kFxModulation = "Fx|Modulation"; ///< Phaser, Flanger, Chorus, Tremolo, Vibrato, AutoPan, Rotary, Cloner...
|
||||
const CString kFxPitchShift = "Fx|Pitch Shift"; ///< Pitch Processing, Pitch Correction, Vocal Tuning...
|
||||
const CString kFxRestoration = "Fx|Restoration"; ///< Denoiser, Declicker,...
|
||||
const CString kFxReverb = "Fx|Reverb"; ///< Reverberation, Room Simulation, Convolution Reverb...
|
||||
const CString kFxSurround = "Fx|Surround"; ///< dedicated to surround processing: LFE Splitter, Bass Manager...
|
||||
const CString kFxTools = "Fx|Tools"; ///< Volume, Mixer, Tuner...
|
||||
const CString kFxNetwork = "Fx|Network"; ///< using Network
|
||||
SMTG_CONSTEXPR const CString kFxAnalyzer = "Fx|Analyzer"; ///< Scope, FFT-Display, Loudness Processing...
|
||||
SMTG_CONSTEXPR const CString kFxDelay = "Fx|Delay"; ///< Delay, Multi-tap Delay, Ping-Pong Delay...
|
||||
SMTG_CONSTEXPR const CString kFxDistortion = "Fx|Distortion"; ///< Amp Simulator, Sub-Harmonic, SoftClipper...
|
||||
SMTG_CONSTEXPR const CString kFxDynamics = "Fx|Dynamics"; ///< Compressor, Expander, Gate, Limiter, Maximizer, Tape Simulator, EnvelopeShaper...
|
||||
SMTG_CONSTEXPR const CString kFxEQ = "Fx|EQ"; ///< Equalization, Graphical EQ...
|
||||
SMTG_CONSTEXPR const CString kFxFilter = "Fx|Filter"; ///< WahWah, ToneBooster, Specific Filter,...
|
||||
SMTG_CONSTEXPR const CString kFx = "Fx"; ///< others type (not categorized)
|
||||
SMTG_CONSTEXPR const CString kFxInstrument = "Fx|Instrument"; ///< Fx which could be loaded as Instrument too
|
||||
SMTG_CONSTEXPR const CString kFxInstrumentExternal = "Fx|Instrument|External"; ///< Fx which could be loaded as Instrument too and is external (wrapped Hardware)
|
||||
SMTG_CONSTEXPR const CString kFxSpatial = "Fx|Spatial"; ///< MonoToStereo, StereoEnhancer,...
|
||||
SMTG_CONSTEXPR const CString kFxGenerator = "Fx|Generator"; ///< Tone Generator, Noise Generator...
|
||||
SMTG_CONSTEXPR const CString kFxMastering = "Fx|Mastering"; ///< Dither, Noise Shaping,...
|
||||
SMTG_CONSTEXPR const CString kFxModulation = "Fx|Modulation"; ///< Phaser, Flanger, Chorus, Tremolo, Vibrato, AutoPan, Rotary, Cloner...
|
||||
SMTG_CONSTEXPR const CString kFxPitchShift = "Fx|Pitch Shift"; ///< Pitch Processing, Pitch Correction, Vocal Tuning...
|
||||
SMTG_CONSTEXPR const CString kFxRestoration = "Fx|Restoration"; ///< Denoiser, Declicker,...
|
||||
SMTG_CONSTEXPR const CString kFxReverb = "Fx|Reverb"; ///< Reverberation, Room Simulation, Convolution Reverb...
|
||||
SMTG_CONSTEXPR const CString kFxSurround = "Fx|Surround"; ///< dedicated to surround processing: LFE Splitter, Bass Manager...
|
||||
SMTG_CONSTEXPR const CString kFxTools = "Fx|Tools"; ///< Volume, Mixer, Tuner...
|
||||
SMTG_CONSTEXPR const CString kFxNetwork = "Fx|Network"; ///< using Network
|
||||
|
||||
const CString kInstrument = "Instrument"; ///< Effect used as instrument (sound generator), not as insert
|
||||
const CString kInstrumentDrum = "Instrument|Drum"; ///< Instrument for Drum sounds
|
||||
const CString kInstrumentExternal = "Instrument|External";///< External Instrument (wrapped Hardware)
|
||||
const CString kInstrumentPiano = "Instrument|Piano"; ///< Instrument for Piano sounds
|
||||
const CString kInstrumentSampler = "Instrument|Sampler"; ///< Instrument based on Samples
|
||||
const CString kInstrumentSynth = "Instrument|Synth"; ///< Instrument based on Synthesis
|
||||
const CString kInstrumentSynthSampler = "Instrument|Synth|Sampler"; ///< Instrument based on Synthesis and Samples
|
||||
SMTG_CONSTEXPR const CString kInstrument = "Instrument"; ///< Effect used as instrument (sound generator), not as insert
|
||||
SMTG_CONSTEXPR const CString kInstrumentDrum = "Instrument|Drum"; ///< Instrument for Drum sounds
|
||||
SMTG_CONSTEXPR const CString kInstrumentExternal = "Instrument|External";///< External Instrument (wrapped Hardware)
|
||||
SMTG_CONSTEXPR const CString kInstrumentPiano = "Instrument|Piano"; ///< Instrument for Piano sounds
|
||||
SMTG_CONSTEXPR const CString kInstrumentSampler = "Instrument|Sampler"; ///< Instrument based on Samples
|
||||
SMTG_CONSTEXPR const CString kInstrumentSynth = "Instrument|Synth"; ///< Instrument based on Synthesis
|
||||
SMTG_CONSTEXPR const CString kInstrumentSynthSampler = "Instrument|Synth|Sampler"; ///< Instrument based on Synthesis and Samples
|
||||
|
||||
const CString kSpatial = "Spatial"; ///< used for SurroundPanner
|
||||
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 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)
|
||||
SMTG_CONSTEXPR const CString kSpatial = "Spatial"; ///< used for SurroundPanner
|
||||
SMTG_CONSTEXPR const CString kSpatialFx = "Spatial|Fx"; ///< used for SurroundPanner and as insert effect
|
||||
SMTG_CONSTEXPR const CString kOnlyRealTime = "OnlyRT"; ///< indicates that it supports only realtime process call, no processing faster than realtime
|
||||
SMTG_CONSTEXPR const CString kOnlyOfflineProcess = "OnlyOfflineProcess"; ///< used for plug-in offline processing (will not work as normal insert plug-in)
|
||||
SMTG_CONSTEXPR 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 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)
|
||||
SMTG_CONSTEXPR const CString kNoOfflineProcess = "NoOfflineProcess"; ///< will be NOT used for plug-in offline processing (will work as normal insert plug-in)
|
||||
SMTG_CONSTEXPR const CString kUpDownMix = "Up-Downmix"; ///< used for Mixconverter/Up-Mixer/Down-Mixer
|
||||
SMTG_CONSTEXPR const CString kAnalyzer = "Analyzer"; ///< Meter, Scope, FFT-Display, not selectable as insert plug-in
|
||||
SMTG_CONSTEXPR 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]
|
||||
SMTG_CONSTEXPR const CString kMono = "Mono"; ///< used for Mono only plug-in [optional]
|
||||
SMTG_CONSTEXPR const CString kStereo = "Stereo"; ///< used for Stereo only plug-in [optional]
|
||||
SMTG_CONSTEXPR const CString kSurround = "Surround"; ///< used for Surround only plug-in [optional]
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
/*@}*/
|
||||
|
|
|
|||
|
|
@ -146,7 +146,14 @@ enum RestartFlags
|
|||
* The host ask the plug-in for the new routing with IComponent::getRoutingInfo, \ref vst3Routing
|
||||
* see IComponent
|
||||
* [SDK 3.6.6] */
|
||||
kRoutingInfoChanged = 1 << 9
|
||||
kRoutingInfoChanged = 1 << 9,
|
||||
|
||||
/** Key switches has changed (info, count)
|
||||
* Either the Key switches info, the count of Key switches has changed.
|
||||
* The host invalidates all caches of Key switches infos and asks the edit controller (IKeyswitchController) for the current ones.
|
||||
* See IKeyswitchController
|
||||
* [SDK 3.7.3] */
|
||||
kKeyswitchChanged = 1 << 10
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ public:
|
|||
|
||||
/** Adds a new parameter queue with a given ID at the end of the list,
|
||||
returns it and its index in the parameter changes list. */
|
||||
virtual IParamValueQueue* PLUGIN_API addParameterData (const Vst::ParamID& id, int32& index /*out*/) = 0;
|
||||
virtual IParamValueQueue* PLUGIN_API addParameterData (const ParamID& id, int32& index /*out*/) = 0;
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
static const FUID iid;
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@
|
|||
//------------------------------------------------------------------------
|
||||
namespace Steinberg {
|
||||
namespace Vst {
|
||||
|
||||
namespace FunctionNameType {
|
||||
//--------------------------------------------------------------------
|
||||
const CString kCompGainReduction = "Comp:GainReduction"; /** */
|
||||
|
|
@ -45,6 +44,12 @@ namespace FunctionNameType {
|
|||
const CString kRandomize = "Randomize"; /** Allow to assign some randomized values to some
|
||||
parameters in a controlled way*/
|
||||
|
||||
/// Panner Type
|
||||
const CString kPanPosCenterX = "PanPosCenterX"; ///< Gravity point X-axis [0, 1]=>[L-R] (for stereo: middle between left and right)
|
||||
const CString kPanPosCenterY = "PanPosCenterY"; ///< Gravity point Y-axis [0, 1]=>[Front-Rear]
|
||||
const CString kPanPosCenterZ = "PanPosCenterZ"; ///< Gravity point Z-axis [0, 1]=>[Bottom-Top]
|
||||
|
||||
|
||||
} // FunctionNameType
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
|
|
@ -55,10 +60,11 @@ namespace FunctionNameType {
|
|||
- [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.
|
||||
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
|
||||
|
||||
|
|
@ -70,38 +76,39 @@ The host can automatically map parameters to dedicated UI controls, such as the
|
|||
in MyController class declaration
|
||||
class MyController : public Vst::EditController, public Vst::IParameterFunctionName
|
||||
{
|
||||
...
|
||||
tresult PLUGIN_API getParameterIDFromFunctionName (UnitID unitID, FIDString functionName,
|
||||
Vst::ParamID& paramID) override;
|
||||
...
|
||||
...
|
||||
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)
|
||||
...
|
||||
OBJ_METHODS (MyController, Vst::EditController)
|
||||
DEFINE_INTERFACES
|
||||
...
|
||||
DEF_INTERFACE (Vst::IParameterFunctionName)
|
||||
END_DEFINE_INTERFACES (Vst::EditController)
|
||||
DELEGATE_REFCOUNT (Vst::EditController)
|
||||
...
|
||||
}
|
||||
|
||||
#include "ivstparameterfunctionname.h"
|
||||
namespace Steinberg {
|
||||
namespace Vst {
|
||||
DEF_CLASS_IID (IParameterFunctionName)
|
||||
}
|
||||
namespace Vst {
|
||||
DEF_CLASS_IID (IParameterFunctionName)
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
tresult PLUGIN_API MyController::getParameterIDFromFunctionName (UnitID unitID, FIDString functionName,
|
||||
Vst::ParamID& paramID)
|
||||
tresult PLUGIN_API MyController::getParameterIDFromFunctionName (UnitID unitID, FIDString
|
||||
functionName, Vst::ParamID& paramID)
|
||||
{
|
||||
using namespace Vst;
|
||||
using namespace Vst;
|
||||
|
||||
paramID = kNoParamId;
|
||||
paramID = kNoParamId;
|
||||
|
||||
if (unitID == kRootUnitId && FIDStringsEqual (functionName, kCompGainReduction))
|
||||
paramID = kMyGainReductionId;
|
||||
if (unitID == kRootUnitId && FIDStringsEqual (functionName, kCompGainReduction))
|
||||
paramID = kMyGainReductionId;
|
||||
|
||||
return (paramID != kNoParamId) ? kResultOk : kResultFalse;
|
||||
return (paramID != kNoParamId) ? kResultOk : kResultFalse;
|
||||
}
|
||||
|
||||
//--- a host implementation example: --------------------
|
||||
|
|
@ -109,14 +116,15 @@ tresult PLUGIN_API MyController::getParameterIDFromFunctionName (UnitID unitID,
|
|||
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)
|
||||
}
|
||||
Vst::ParamID paramID;
|
||||
if (functionName->getParameterIDFromFunctionName (kRootUnitId,
|
||||
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
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,169 +1,169 @@
|
|||
//------------------------------------------------------------------------
|
||||
// Project : VST SDK
|
||||
//
|
||||
// Category : Interfaces
|
||||
// Filename : pluginterfaces/vst/ivstphysicalui.h
|
||||
// Created by : Steinberg, 06/2018
|
||||
// Description : VST Physical User Interface support
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// 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/vst/ivstnoteexpression.h"
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
#include "pluginterfaces/base/falignpush.h"
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
namespace Steinberg {
|
||||
namespace Vst {
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
/** \defgroup vst3typedef VST 3 Data Types */
|
||||
/*@{*/
|
||||
//------------------------------------------------------------------------
|
||||
/** Physical UI Type */
|
||||
typedef uint32 PhysicalUITypeID;
|
||||
/*@}*/
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
/** PhysicalUITypeIDs describes the type of Physical UI (PUI) which could be associated to a note
|
||||
expression.
|
||||
\see PhysicalUIMap
|
||||
*/
|
||||
enum PhysicalUITypeIDs
|
||||
{
|
||||
/** absolute X position when touching keys of PUIs. Range [0=left, 0.5=middle, 1=right] */
|
||||
kPUIXMovement = 0,
|
||||
/** absolute Y position when touching keys of PUIs. Range [0=bottom/near, 0.5=center, 1=top/far] */
|
||||
kPUIYMovement,
|
||||
/** pressing a key down on keys of PUIs. Range [0=No Pressure, 1=Full Pressure] */
|
||||
kPUIPressure,
|
||||
|
||||
kPUITypeCount, ///< count of current defined PUIs
|
||||
|
||||
kInvalidPUITypeID = 0xFFFFFFFF ///< indicates an invalid or not initialized PUI type
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
/** PhysicalUIMap describes a mapping of a noteExpression Type to a Physical UI Type.
|
||||
It is used in PhysicalUIMapList.
|
||||
\see PhysicalUIMapList
|
||||
*/
|
||||
struct PhysicalUIMap
|
||||
{
|
||||
/** This represents the physical UI. /see PhysicalUITypeIDs, this is set by the caller of
|
||||
* getPhysicalUIMapping */
|
||||
PhysicalUITypeID physicalUITypeID;
|
||||
|
||||
/** This represents the associated noteExpression TypeID to the given physicalUITypeID. This
|
||||
* will be filled by the plug-in in the call getPhysicalUIMapping, set it to kInvalidTypeID if
|
||||
* no Note Expression is associated to the given PUI. */
|
||||
NoteExpressionTypeID noteExpressionTypeID;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
/** PhysicalUIMapList describes a list of PhysicalUIMap
|
||||
\see INoteExpressionPhysicalUIMapping
|
||||
*/
|
||||
struct PhysicalUIMapList
|
||||
{
|
||||
/** Count of entries in the map array, set by the caller of getPhysicalUIMapping. */
|
||||
uint32 count;
|
||||
|
||||
/** Pointer to a list of PhysicalUIMap containing count entries. */
|
||||
PhysicalUIMap* map;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
/** Extended plug-in interface IEditController for note expression event support: Vst::INoteExpressionPhysicalUIMapping
|
||||
\ingroup vstIPlug vst3611
|
||||
- [plug imp]
|
||||
- [extends IEditController]
|
||||
- [released: 3.6.11]
|
||||
- [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
|
||||
to inform the host about it via \ref IComponentHandler::restartComponent (kNoteExpressionChanged).
|
||||
|
||||
\section INoteExpressionPhysicalUIMappingExample Example
|
||||
|
||||
\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)
|
||||
{
|
||||
for (uint32 i = 0; i < list.count; ++i)
|
||||
{
|
||||
NoteExpressionTypeID type = kInvalidTypeID;
|
||||
if (kPUIXMovement == list.map[i].physicalUITypeID)
|
||||
list.map[i].noteExpressionTypeID = kCustomStart + 1;
|
||||
else if (kPUIYMovement == list.map[i].physicalUITypeID)
|
||||
list.map[i].noteExpressionTypeID = kCustomStart + 2;
|
||||
}
|
||||
return kResultTrue;
|
||||
}
|
||||
return kResultFalse;
|
||||
}
|
||||
\endcode
|
||||
*/
|
||||
class INoteExpressionPhysicalUIMapping : public FUnknown
|
||||
{
|
||||
public:
|
||||
/** Fills the list of mapped [physical UI (in) - note expression (out)] for a given bus index
|
||||
* and channel. */
|
||||
virtual tresult PLUGIN_API getPhysicalUIMapping (int32 busIndex, int16 channel,
|
||||
PhysicalUIMapList& list) = 0;
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
static const FUID iid;
|
||||
};
|
||||
|
||||
DECLARE_CLASS_IID (INoteExpressionPhysicalUIMapping, 0xB03078FF, 0x94D24AC8, 0x90CCD303, 0xD4133324)
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
} // namespace Vst
|
||||
} // namespace Steinberg
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
#include "pluginterfaces/base/falignpop.h"
|
||||
//------------------------------------------------------------------------
|
||||
//------------------------------------------------------------------------
|
||||
// Project : VST SDK
|
||||
//
|
||||
// Category : Interfaces
|
||||
// Filename : pluginterfaces/vst/ivstphysicalui.h
|
||||
// Created by : Steinberg, 06/2018
|
||||
// Description : VST Physical User Interface support
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// 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/vst/ivstnoteexpression.h"
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
#include "pluginterfaces/base/falignpush.h"
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
namespace Steinberg {
|
||||
namespace Vst {
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
/** \defgroup vst3typedef VST 3 Data Types */
|
||||
/*@{*/
|
||||
//------------------------------------------------------------------------
|
||||
/** Physical UI Type */
|
||||
typedef uint32 PhysicalUITypeID;
|
||||
/*@}*/
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
/** PhysicalUITypeIDs describes the type of Physical UI (PUI) which could be associated to a note
|
||||
expression.
|
||||
\see PhysicalUIMap
|
||||
*/
|
||||
enum PhysicalUITypeIDs
|
||||
{
|
||||
/** absolute X position when touching keys of PUIs. Range [0=left, 0.5=middle, 1=right] */
|
||||
kPUIXMovement = 0,
|
||||
/** absolute Y position when touching keys of PUIs. Range [0=bottom/near, 0.5=center, 1=top/far] */
|
||||
kPUIYMovement,
|
||||
/** pressing a key down on keys of PUIs. Range [0=No Pressure, 1=Full Pressure] */
|
||||
kPUIPressure,
|
||||
|
||||
kPUITypeCount, ///< count of current defined PUIs
|
||||
|
||||
kInvalidPUITypeID = 0xFFFFFFFF ///< indicates an invalid or not initialized PUI type
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
/** PhysicalUIMap describes a mapping of a noteExpression Type to a Physical UI Type.
|
||||
It is used in PhysicalUIMapList.
|
||||
\see PhysicalUIMapList
|
||||
*/
|
||||
struct PhysicalUIMap
|
||||
{
|
||||
/** This represents the physical UI. /see PhysicalUITypeIDs, this is set by the caller of
|
||||
* getPhysicalUIMapping */
|
||||
PhysicalUITypeID physicalUITypeID;
|
||||
|
||||
/** This represents the associated noteExpression TypeID to the given physicalUITypeID. This
|
||||
* will be filled by the plug-in in the call getPhysicalUIMapping, set it to kInvalidTypeID if
|
||||
* no Note Expression is associated to the given PUI. */
|
||||
NoteExpressionTypeID noteExpressionTypeID;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
/** PhysicalUIMapList describes a list of PhysicalUIMap
|
||||
\see INoteExpressionPhysicalUIMapping
|
||||
*/
|
||||
struct PhysicalUIMapList
|
||||
{
|
||||
/** Count of entries in the map array, set by the caller of getPhysicalUIMapping. */
|
||||
uint32 count;
|
||||
|
||||
/** Pointer to a list of PhysicalUIMap containing count entries. */
|
||||
PhysicalUIMap* map;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
/** Extended plug-in interface IEditController for note expression event support: Vst::INoteExpressionPhysicalUIMapping
|
||||
\ingroup vstIPlug vst3611
|
||||
- [plug imp]
|
||||
- [extends IEditController]
|
||||
- [released: 3.6.11]
|
||||
- [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
|
||||
to inform the host about it via \ref IComponentHandler::restartComponent (kNoteExpressionChanged).
|
||||
|
||||
\section INoteExpressionPhysicalUIMappingExample Example
|
||||
|
||||
\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)
|
||||
{
|
||||
for (uint32 i = 0; i < list.count; ++i)
|
||||
{
|
||||
NoteExpressionTypeID type = kInvalidTypeID;
|
||||
if (kPUIXMovement == list.map[i].physicalUITypeID)
|
||||
list.map[i].noteExpressionTypeID = kCustomStart + 1;
|
||||
else if (kPUIYMovement == list.map[i].physicalUITypeID)
|
||||
list.map[i].noteExpressionTypeID = kCustomStart + 2;
|
||||
}
|
||||
return kResultTrue;
|
||||
}
|
||||
return kResultFalse;
|
||||
}
|
||||
\endcode
|
||||
*/
|
||||
class INoteExpressionPhysicalUIMapping : public FUnknown
|
||||
{
|
||||
public:
|
||||
/** Fills the list of mapped [physical UI (in) - note expression (out)] for a given bus index
|
||||
* and channel. */
|
||||
virtual tresult PLUGIN_API getPhysicalUIMapping (int32 busIndex, int16 channel,
|
||||
PhysicalUIMapList& list) = 0;
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
static const FUID iid;
|
||||
};
|
||||
|
||||
DECLARE_CLASS_IID (INoteExpressionPhysicalUIMapping, 0xB03078FF, 0x94D24AC8, 0x90CCD303, 0xD4133324)
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
} // namespace Vst
|
||||
} // namespace Steinberg
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
#include "pluginterfaces/base/falignpop.h"
|
||||
//------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2020, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
|
|
|
|||
|
|
@ -134,9 +134,9 @@ const SpeakerArrangement k41Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpe
|
|||
const SpeakerArrangement k40Music = kSpeakerL | kSpeakerR | kSpeakerLs | kSpeakerRs;
|
||||
/** L R Lfe Ls Rs (Quadro+Lfe) */
|
||||
const SpeakerArrangement k41Music = kSpeakerL | kSpeakerR | kSpeakerLfe | kSpeakerLs | kSpeakerRs;
|
||||
/** L R C Ls Rs */
|
||||
/** L R C Ls Rs */ // 5.0 (ITU 0+5+0.0 Sound System B)
|
||||
const SpeakerArrangement k50 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs;
|
||||
/** L R C Lfe Ls Rs */
|
||||
/** L R C Lfe Ls Rs */ // 5.1 (ITU 0+5+0.1 Sound System B)
|
||||
const SpeakerArrangement k51 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs;
|
||||
/** L R C Ls Rs Cs */
|
||||
const SpeakerArrangement k60Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerCs;
|
||||
|
|
@ -151,9 +151,9 @@ const SpeakerArrangement k70Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpe
|
|||
/** L R C Lfe Ls Rs Lc Rc */
|
||||
const SpeakerArrangement k71Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc;
|
||||
const SpeakerArrangement k71CineFullFront = k71Cine;
|
||||
/** L R C Ls Rs Sl Sr */
|
||||
/** L R C Ls Rs Sl Sr */ // (ITU 0+7+0.0 Sound System I)
|
||||
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 */ // (ITU 0+7+0.1 Sound System I)
|
||||
const SpeakerArrangement k71Music = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr;
|
||||
|
||||
/** L R C Lfe Ls Rs Lcs Rcs */
|
||||
|
|
@ -196,29 +196,50 @@ const SpeakerArrangement kAmbi3rdOrderACN = kAmbi2cdOrderACN | kSpeakerACN9 | kS
|
|||
/*-----------*/
|
||||
/** L R Ls Rs Tfl Tfr Trl Trr */ // 4.0.4
|
||||
const SpeakerArrangement k80Cube = kSpeakerL | kSpeakerR | kSpeakerLs | kSpeakerRs | kSpeakerTfl| kSpeakerTfr| kSpeakerTrl | kSpeakerTrr;
|
||||
const SpeakerArrangement k40_4 = k80Cube;
|
||||
|
||||
/** L R C Lfe Ls Rs Cs Tc */ // 6.1.1
|
||||
const SpeakerArrangement k71CineTopCenter = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerCs | kSpeakerTc;
|
||||
|
||||
/** L R C Lfe Ls Rs Cs Tfc */ // 6.1.1
|
||||
const SpeakerArrangement k71CineCenterHigh = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerCs | kSpeakerTfc;
|
||||
/** L R C Lfe Ls Rs Tfl Tfr */ // 5.1.2
|
||||
const SpeakerArrangement k71CineFrontHigh = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerTfl | kSpeakerTfr;
|
||||
const SpeakerArrangement k71MPEG3D = k71CineFrontHigh;
|
||||
/** L R C Lfe Ls Rs Tsl Tsr */ // 5.1.2
|
||||
const SpeakerArrangement k71CineSideHigh = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerTsl | kSpeakerTsr;
|
||||
|
||||
/** L R Lfe Ls Rs Tfl Tfc Tfr Bfc */ // 4.1.4
|
||||
/** L R C Ls Rs Tfl Tfr */ // 5.0.2 (ITU 2+5+0.0 Sound System C)
|
||||
const SpeakerArrangement k70CineFrontHigh = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerTfl | kSpeakerTfr;
|
||||
const SpeakerArrangement k70MPEG3D = k70CineFrontHigh;
|
||||
const SpeakerArrangement k50_2 = k70CineFrontHigh;
|
||||
|
||||
/** L R C Lfe Ls Rs Tfl Tfr */ // 5.1.2 (ITU 2+5+0.1 Sound System C)
|
||||
const SpeakerArrangement k71CineFrontHigh = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerTfl | kSpeakerTfr;
|
||||
const SpeakerArrangement k71MPEG3D = k71CineFrontHigh;
|
||||
const SpeakerArrangement k51_2 = k71CineFrontHigh;
|
||||
|
||||
/** L R C Lfe Ls Rs Tsl Tsr */ // 5.1.2 (Side)
|
||||
const SpeakerArrangement k71CineSideHigh = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerTsl | kSpeakerTsr;
|
||||
|
||||
/** L R Lfe Ls Rs Tfl Tfc Tfr Bfc */ // 4.1.3.1
|
||||
const SpeakerArrangement k81MPEG3D = kSpeakerL | kSpeakerR | kSpeakerLfe | kSpeakerLs | kSpeakerRs |
|
||||
kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerBfc;
|
||||
const SpeakerArrangement k41_4_1 = k81MPEG3D;
|
||||
|
||||
/** L R C Ls Rs Tfl Tfr Trl Trr */ // 5.0.4
|
||||
/** L R C Ls Rs Tfl Tfr Trl Trr */ // 5.0.4 (ITU 4+5+0.0 Sound System D)
|
||||
const SpeakerArrangement k90 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs |
|
||||
kSpeakerTfl| kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
|
||||
const SpeakerArrangement k50_4 = k90;
|
||||
/** L R C Lfe Ls Rs Tfl Tfr Trl Trr */ // 5.1.4
|
||||
|
||||
/** L R C Lfe Ls Rs Tfl Tfr Trl Trr */ // 5.1.4 (ITU 4+5+0.1 Sound System D)
|
||||
const SpeakerArrangement k91 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs |
|
||||
kSpeakerTfl| kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
|
||||
const SpeakerArrangement k51_4 = k91;
|
||||
|
||||
/** L R C Ls Rs Tfl Tfr Trl Trr Bfc */ // 5.0.4.1 (ITU 4+5+1.0 Sound System E)
|
||||
const SpeakerArrangement k50_4_1 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs |
|
||||
kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr | kSpeakerBfc;
|
||||
|
||||
/** L R C Lfe Ls Rs Tfl Tfr Trl Trr Bfc */ // 5.1.4.1 (ITU 4+5+1.1 Sound System E)
|
||||
const SpeakerArrangement k51_4_1 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs |
|
||||
kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr | kSpeakerBfc;
|
||||
|
||||
/** 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;
|
||||
|
|
@ -228,11 +249,19 @@ const SpeakerArrangement k71_2 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeake
|
|||
kSpeakerSl | kSpeakerSr | kSpeakerTsl | kSpeakerTsr;
|
||||
const SpeakerArrangement k91Atmos = k71_2; // 9.1 Dolby Atmos (3D)
|
||||
|
||||
/** L R C Ls Rs Sl Sr Tfl Tfr Trl Trr */ // 7.0.4
|
||||
/** L R C Ls Rs Sl Sr Tfl Tfr Trc */ // 7.0.3 (ITU 3+7+0.0 Sound System F)
|
||||
const SpeakerArrangement k70_3 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs |
|
||||
kSpeakerSl | kSpeakerSr | kSpeakerTfl | kSpeakerTfr | kSpeakerTrc;
|
||||
|
||||
/** L R C Lfe Ls Rs Sl Sr Tfl Tfr Trc Lfe2 */ // 7.2.3 (ITU 3+7+0.2 Sound System F)
|
||||
const SpeakerArrangement k72_3 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs |
|
||||
kSpeakerSl | kSpeakerSr | kSpeakerTfl | kSpeakerTfr | kSpeakerTrc | kSpeakerLfe2;
|
||||
|
||||
/** L R C Ls Rs Sl Sr Tfl Tfr Trl Trr */ // 7.0.4 (ITU 4+7+0.0 Sound System J)
|
||||
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
|
||||
/** L R C Lfe Ls Rs Sl Sr Tfl Tfr Trl Trr */ // 7.1.4 (ITU 4+7+0.1 Sound System J)
|
||||
const SpeakerArrangement k71_4 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr |
|
||||
kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
|
||||
const SpeakerArrangement k111MPEG3D = k71_4;
|
||||
|
|
@ -247,12 +276,12 @@ const SpeakerArrangement k71_6 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeaker
|
|||
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
|
||||
/** L R C Ls Rs Lc Rc Sl Sr Tfl Tfr Trl Trr */ // 9.0.4 (ITU 4+9+0.0 Sound System G)
|
||||
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
|
||||
/** L R C Lfe Ls Rs Lc Rc Sl Sr Tfl Tfr Trl Trr */ // 9.1.4 (ITU 4+9+0.1 Sound System G)
|
||||
const SpeakerArrangement k91_4 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe |
|
||||
kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc | kSpeakerSl | kSpeakerSr |
|
||||
kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
|
||||
|
|
@ -270,46 +299,68 @@ const SpeakerArrangement k91_6 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeaker
|
|||
/** L R C Ls Rs Tc Tfl Tfr Trl Trr */ // 5.0.5
|
||||
const SpeakerArrangement k100 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs |
|
||||
kSpeakerTc | kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
|
||||
const SpeakerArrangement k50_5 = k100;
|
||||
|
||||
/** L R C Lfe Ls Rs Tc Tfl Tfr Trl Trr */ // 5.1.5
|
||||
const SpeakerArrangement k101 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs |
|
||||
kSpeakerTc | kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
|
||||
const SpeakerArrangement k101MPEG3D = k101;
|
||||
const SpeakerArrangement k51_5 = k101;
|
||||
|
||||
/** L R C Lfe Ls Rs Tfl Tfc Tfr Trl Trr Lfe2 */ // 5.2.5
|
||||
const SpeakerArrangement k102 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs |
|
||||
kSpeakerTfl| kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr | kSpeakerLfe2;
|
||||
const SpeakerArrangement k52_5 = k102;
|
||||
|
||||
/** L R C Ls Rs Tc Tfl Tfc Tfr Trl Trr */ // 5.0.6
|
||||
const SpeakerArrangement k110 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs |
|
||||
kSpeakerTc | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
|
||||
const SpeakerArrangement k50_6 = k110;
|
||||
|
||||
/** L R C Lfe Ls Rs Tc Tfl Tfc Tfr Trl Trr */ // 5.1.6
|
||||
const SpeakerArrangement k111 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs |
|
||||
kSpeakerTc | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
|
||||
const SpeakerArrangement k51_6 = k111;
|
||||
|
||||
/** 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 |
|
||||
kSpeakerTfl| kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr | kSpeakerLfe2;
|
||||
const SpeakerArrangement k72_5 = k122;
|
||||
|
||||
/** 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 |
|
||||
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 |
|
||||
kSpeakerTc | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr;
|
||||
|
||||
/** 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 |
|
||||
/** 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 |
|
||||
kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr |
|
||||
kSpeakerBfl | kSpeakerBfr | kSpeakerBrl | kSpeakerBrr;
|
||||
const SpeakerArrangement k60_4_4 = k140;
|
||||
|
||||
/** 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
|
||||
/** 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 (ITU 9+10+3.0 Sound System H)
|
||||
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;
|
||||
const SpeakerArrangement k100_9_3 = k220;
|
||||
|
||||
/** 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
|
||||
/** 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 (ITU 9+10+3.2 Sound System H)
|
||||
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;
|
||||
const SpeakerArrangement k102_9_3 = k222;
|
||||
|
||||
/** L R C Ls Rs Tfl Tfc Tfr Trl Trr Bfl Bfc Bfr */ // 5.0.5.3
|
||||
const SpeakerArrangement k50_5_3 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr |
|
||||
kSpeakerBfl | kSpeakerBfc | kSpeakerBfr;
|
||||
|
||||
/** L R C Lfe Ls Rs Tfl Tfc Tfr Trl Trr Bfl Bfc Bfr */ // 5.1.5.3
|
||||
const SpeakerArrangement k51_5_3 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr |
|
||||
kSpeakerBfl | kSpeakerBfc | kSpeakerBfr;
|
||||
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
/** Speaker Arrangement String Representation.
|
||||
|
|
@ -353,6 +404,7 @@ const CString kString71MusicOld = "7.1 Music (Dolby)";
|
|||
const CString kString71CineTopCenter = "7.1 Cine Top Center";
|
||||
const CString kString71CineCenterHigh = "7.1 Cine Center High";
|
||||
const CString kString71CineFrontHigh = "7.1 Cine Front High";
|
||||
const CString kString70CineFrontHigh = "7.0 Cine Front High";
|
||||
const CString kString71CineSideHigh = "7.1 Cine Side High";
|
||||
const CString kString71CineFullRear = "7.1 Cine Full Rear";
|
||||
const CString kString71Proximity = "7.1 Proximity";
|
||||
|
|
@ -369,15 +421,19 @@ 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 kString70_2 = "7.0.2";
|
||||
const CString kString50_4_1 = "5.0.4.1";
|
||||
const CString kString51_4_1 = "5.1.4.1";
|
||||
const CString kString70_2 = "7.0.2";
|
||||
const CString kString71_2 = "7.1.2";
|
||||
const CString kString70_3 = "7.0.3";
|
||||
const CString kString72_3 = "7.2.3";
|
||||
const CString kString70_4 = "7.0.4";
|
||||
const CString kString71_4 = "7.1.4";
|
||||
const CString kString70_6 = "7.0.6";
|
||||
const CString kString70_6 = "7.0.6";
|
||||
const CString kString71_6 = "7.1.6";
|
||||
const CString kString90_4 = "9.0.4";
|
||||
const CString kString90_4 = "9.0.4";
|
||||
const CString kString91_4 = "9.1.4";
|
||||
const CString kString90_6 = "9.0.6";
|
||||
const CString kString90_6 = "9.0.6";
|
||||
const CString kString91_6 = "9.1.6";
|
||||
const CString kString100 = "10.0 Auro-3D";
|
||||
const CString kString101 = "10.1 Auro-3D";
|
||||
|
|
@ -389,6 +445,8 @@ const CString kString81MPEG = "8.1 MPEG";
|
|||
const CString kString140 = "14.0";
|
||||
const CString kString222 = "22.2";
|
||||
const CString kString220 = "22.0";
|
||||
const CString kString50_5_3 = "5.0.5.3";
|
||||
const CString kString51_5_3 = "5.1.5.3";
|
||||
const CString kStringAmbi1stOrder = "1st Order Ambisonics";
|
||||
const CString kStringAmbi2cdOrder = "2nd Order Ambisonics";
|
||||
const CString kStringAmbi3rdOrder = "3rd Order Ambisonics";
|
||||
|
|
@ -435,18 +493,23 @@ const CString kString81MusicS = "L R C LFE Ls Rs Cs Sl Sr";
|
|||
const CString kString80CubeS = "L R Ls Rs Tfl Tfr Trl Trr";
|
||||
const CString kString71CineTopCenterS = "L R C LFE Ls Rs Cs Tc";
|
||||
const CString kString71CineCenterHighS = "L R C LFE Ls Rs Cs Tfc";
|
||||
const CString kString71CineFrontHighS = "L R C LFE Ls Rs Tfl Tfl";
|
||||
const CString kString71CineSideHighS = "L R C LFE Ls Rs Tsl Tsl";
|
||||
const CString kString71CineFrontHighS = "L R C LFE Ls Rs Tfl Tfr";
|
||||
const CString kString70CineFrontHighS = "L R C Ls Rs Tfl Tfr";
|
||||
const CString kString71CineSideHighS = "L R C LFE Ls Rs Tsl Tsr";
|
||||
const CString kString71CineFullRearS = "L R C LFE Ls Rs Lcs Rcs";
|
||||
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 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 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 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 kString50_4_1S = "L R C Ls Rs Tfl Tfr Trl Trr Bfc";
|
||||
const CString kString51_4_1S = "L R C LFE Ls Rs Tfl Tfr Trl Trr Bfc";
|
||||
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_3S = "L R C Ls Rs Sl Sr Tfl Tfr Trc";
|
||||
const CString kString72_3S = "L R C LFE Ls Rs Sl Sr Tfl Tfr Trc LFE2";
|
||||
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";
|
||||
|
|
@ -467,6 +530,8 @@ 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 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 kString50_5_3S = "L R C Ls Rs Tfl Tfc Tfr Trl Trr Bfl Bfc Bfr";
|
||||
const CString kString51_5_3S = "L R C LFE Ls Rs Tfl Tfc Tfr Trl Trr Bfl Bfc Bfr";
|
||||
|
||||
const CString kStringAmbi1stOrderS = "0 1 2 3";
|
||||
const CString kStringAmbi2cdOrderS = "0 1 2 3 4 5 6 7 8";
|
||||
|
|
@ -702,6 +767,8 @@ inline SpeakerArrangement getSpeakerArrangementFromString (CString arrStr)
|
|||
return k71CineCenterHigh;
|
||||
if (!strcmp8 (arrStr, kString71CineFrontHigh))
|
||||
return k71CineFrontHigh;
|
||||
if (!strcmp8 (arrStr, kString70CineFrontHigh))
|
||||
return k70CineFrontHigh;
|
||||
if (!strcmp8 (arrStr, kString71CineSideHigh))
|
||||
return k71CineSideHigh;
|
||||
if (!strcmp8 (arrStr, kString71CineFullRear))
|
||||
|
|
@ -718,12 +785,20 @@ inline SpeakerArrangement getSpeakerArrangementFromString (CString arrStr)
|
|||
return k50_4;
|
||||
if (!strcmp8 (arrStr, kString51_4))
|
||||
return k51_4;
|
||||
if (!strcmp8 (arrStr, kString50_4_1))
|
||||
return k50_4_1;
|
||||
if (!strcmp8 (arrStr, kString51_4_1))
|
||||
return k51_4_1;
|
||||
if (!strcmp8 (arrStr, kString81MPEG))
|
||||
return k81MPEG3D;
|
||||
if (!strcmp8 (arrStr, kString70_2))
|
||||
return k70_2;
|
||||
if (!strcmp8 (arrStr, kString71_2))
|
||||
return k71_2;
|
||||
if (!strcmp8 (arrStr, kString70_3))
|
||||
return k70_3;
|
||||
if (!strcmp8 (arrStr, kString72_3))
|
||||
return k72_3;
|
||||
if (!strcmp8 (arrStr, kString70_4))
|
||||
return k70_4;
|
||||
if (!strcmp8 (arrStr, kString71_4))
|
||||
|
|
@ -758,6 +833,10 @@ inline SpeakerArrangement getSpeakerArrangementFromString (CString arrStr)
|
|||
return k222;
|
||||
if (!strcmp8 (arrStr, kString220))
|
||||
return k220;
|
||||
if (!strcmp8 (arrStr, kString50_5_3))
|
||||
return k50_5_3;
|
||||
if (!strcmp8 (arrStr, kString51_5_3))
|
||||
return k51_5_3;
|
||||
if (!strcmp8 (arrStr, kStringAmbi1stOrder))
|
||||
return kAmbi1stOrderACN;
|
||||
if (!strcmp8 (arrStr, kStringAmbi2cdOrder))
|
||||
|
|
@ -815,11 +894,12 @@ inline CString getSpeakerArrangementString (SpeakerArrangement arr, bool withSpe
|
|||
case k71CineTopCenter: return withSpeakersName ? kString71CineTopCenterS : kString71CineTopCenter;
|
||||
case k71CineCenterHigh: return withSpeakersName ? kString71CineCenterHighS : kString71CineCenterHigh;
|
||||
case k71CineFrontHigh: return withSpeakersName ? kString71CineFrontHighS : kString71CineFrontHigh;
|
||||
case k70CineFrontHigh: return withSpeakersName ? kString70CineFrontHighS : kString70CineFrontHigh;
|
||||
case k71CineSideHigh: return withSpeakersName ? kString71CineSideHighS : kString71CineSideHigh;
|
||||
case k71CineFullRear: return withSpeakersName ? kString71CineFullRearS : kString71CineFullRear;
|
||||
case k90Cine: return withSpeakersName ? kString90CineS : kString90Cine;
|
||||
case k91Cine: return withSpeakersName ? kString91CineS : kString91Cine;
|
||||
case k100Cine: return withSpeakersName ? kString100CineS : kString100Cine;
|
||||
case k100Cine: return withSpeakersName ? kString100CineS : kString100Cine;
|
||||
case k101Cine: return withSpeakersName ? kString101CineS : kString101Cine;
|
||||
case k100: return withSpeakersName ? kString100S : kString100;
|
||||
case k101: return withSpeakersName ? kString101S : kString101;
|
||||
|
|
@ -828,8 +908,12 @@ inline CString getSpeakerArrangementString (SpeakerArrangement arr, bool withSpe
|
|||
|
||||
case k50_4: return withSpeakersName ? kString50_4S : kString50_4;
|
||||
case k51_4: return withSpeakersName ? kString51_4S : kString51_4;
|
||||
case k50_4_1: return withSpeakersName ? kString50_4_1S : kString50_4_1;
|
||||
case k51_4_1: return withSpeakersName ? kString51_4_1S : kString51_4_1;
|
||||
case k70_2: return withSpeakersName ? kString70_2S : kString70_2;
|
||||
case k71_2: return withSpeakersName ? kString71_2S : kString71_2;
|
||||
case k70_3: return withSpeakersName ? kString70_3S : kString70_3;
|
||||
case k72_3: return withSpeakersName ? kString72_3S : kString72_3;
|
||||
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;
|
||||
|
|
@ -843,6 +927,8 @@ inline CString getSpeakerArrangementString (SpeakerArrangement arr, bool withSpe
|
|||
case k140: return withSpeakersName ? kString140S : kString140;
|
||||
case k222: return withSpeakersName ? kString222S : kString222;
|
||||
case k220: return withSpeakersName ? kString220S : kString220;
|
||||
case k50_5_3: return withSpeakersName ? kString50_5_3S : kString50_5_3;
|
||||
case k51_5_3: return withSpeakersName ? kString51_5_3S : kString51_5_3;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,19 +22,24 @@
|
|||
namespace Steinberg {
|
||||
namespace Vst {
|
||||
//------------------------------------------------------------------------
|
||||
/** VST3 SDK Version */
|
||||
/** VST 3 SDK Version */
|
||||
#ifndef kVstVersionString
|
||||
#define kVstVersionString "VST 3.7.2" ///< SDK version for PClassInfo2
|
||||
#define kVstVersionString "VST 3.7.7" ///< SDK version for PClassInfo2
|
||||
#endif
|
||||
|
||||
#define kVstVersionMajor 3
|
||||
#define kVstVersionMinor 7
|
||||
#define kVstVersionSub 2
|
||||
#define kVstVersionSub 7
|
||||
|
||||
#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_7_VERSION 0x030707
|
||||
#define VST_3_7_6_VERSION 0x030706
|
||||
#define VST_3_7_5_VERSION 0x030705
|
||||
#define VST_3_7_4_VERSION 0x030704
|
||||
#define VST_3_7_3_VERSION 0x030703
|
||||
#define VST_3_7_2_VERSION 0x030702
|
||||
#define VST_3_7_1_VERSION 0x030701
|
||||
#define VST_3_7_0_VERSION 0x030700
|
||||
|
|
@ -100,6 +105,41 @@ typedef uint64 Speaker; ///< Bit for one speaker
|
|||
|
||||
/*@}*/
|
||||
|
||||
static SMTG_CONSTEXPR const FIDString SDKVersionString = kVstVersionString;
|
||||
|
||||
static SMTG_CONSTEXPR const uint32 SDKVersionMajor = kVstVersionMajor;
|
||||
static SMTG_CONSTEXPR const uint32 SDKVersionMinor = kVstVersionMinor;
|
||||
static SMTG_CONSTEXPR const uint32 SDKVersionSub = kVstVersionSub;
|
||||
|
||||
static SMTG_CONSTEXPR const uint32 SDKVersion =
|
||||
((SDKVersionMajor << 16) | (SDKVersionMinor << 8) | SDKVersionSub);
|
||||
|
||||
// Versions History which allows to write such code:
|
||||
// if constexpr (SDKVersion >= SDKVersion_3_6_5) { ... }
|
||||
static SMTG_CONSTEXPR const uint32 SDKVersion_3_7_7 = VST_3_7_7_VERSION;
|
||||
static SMTG_CONSTEXPR const uint32 SDKVersion_3_7_6 = VST_3_7_6_VERSION;
|
||||
static SMTG_CONSTEXPR const uint32 SDKVersion_3_7_5 = VST_3_7_5_VERSION;
|
||||
static SMTG_CONSTEXPR const uint32 SDKVersion_3_7_4 = VST_3_7_4_VERSION;
|
||||
static SMTG_CONSTEXPR const uint32 SDKVersion_3_7_3 = VST_3_7_3_VERSION;
|
||||
static SMTG_CONSTEXPR const uint32 SDKVersion_3_7_2 = VST_3_7_2_VERSION;
|
||||
static SMTG_CONSTEXPR const uint32 SDKVersion_3_7_1 = VST_3_7_1_VERSION;
|
||||
static SMTG_CONSTEXPR const uint32 SDKVersion_3_7_0 = VST_3_7_0_VERSION;
|
||||
static SMTG_CONSTEXPR const uint32 SDKVersion_3_6_14 = VST_3_6_14_VERSION;
|
||||
static SMTG_CONSTEXPR const uint32 SDKVersion_3_6_13 = VST_3_6_13_VERSION;
|
||||
static SMTG_CONSTEXPR const uint32 SDKVersion_3_6_12 = VST_3_6_12_VERSION;
|
||||
static SMTG_CONSTEXPR const uint32 SDKVersion_3_6_11 = VST_3_6_11_VERSION;
|
||||
static SMTG_CONSTEXPR const uint32 SDKVersion_3_6_10 = VST_3_6_10_VERSION;
|
||||
static SMTG_CONSTEXPR const uint32 SDKVersion_3_6_9 = VST_3_6_9_VERSION;
|
||||
static SMTG_CONSTEXPR const uint32 SDKVersion_3_6_8 = VST_3_6_8_VERSION;
|
||||
static SMTG_CONSTEXPR const uint32 SDKVersion_3_6_7 = VST_3_6_7_VERSION;
|
||||
static SMTG_CONSTEXPR const uint32 SDKVersion_3_6_6 = VST_3_6_6_VERSION;
|
||||
static SMTG_CONSTEXPR const uint32 SDKVersion_3_6_5 = VST_3_6_5_VERSION;
|
||||
static SMTG_CONSTEXPR const uint32 SDKVersion_3_6_0 = VST_3_6_0_VERSION;
|
||||
static SMTG_CONSTEXPR const uint32 SDKVersion_3_5_0 = VST_3_5_0_VERSION;
|
||||
static SMTG_CONSTEXPR const uint32 SDKVersion_3_1_0 = VST_3_1_0_VERSION;
|
||||
static SMTG_CONSTEXPR const uint32 SDKVersion_3_0_0 = VST_3_0_0_VERSION;
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
} // namespace Vst
|
||||
} // namespace Steinberg
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
|
|
@ -51,6 +51,7 @@ CPluginView::CPluginView (const ViewRect* _rect)
|
|||
//------------------------------------------------------------------------
|
||||
CPluginView::~CPluginView ()
|
||||
{
|
||||
setFrame (nullptr);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
|
|
@ -109,7 +109,7 @@ public:
|
|||
protected:
|
||||
ViewRect rect;
|
||||
void* systemWindow {nullptr};
|
||||
IPlugFrame* plugFrame {nullptr};
|
||||
IPtr<IPlugFrame> plugFrame;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
|
|
|||
|
|
@ -4,37 +4,38 @@
|
|||
// Category : Helpers
|
||||
// Filename : public.sdk/source/vst/hosting/hostclasses.cpp
|
||||
// Created by : Steinberg, 03/05/2008.
|
||||
// Description : VST 3 hostclasses, example implementations for IHostApplication, IAttributeList and IMessage
|
||||
// Description : VST 3 hostclasses, example impl. for IHostApplication, IAttributeList and IMessage
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright notice,
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above copyright notice,
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// and/or other materials provided with the distribution.
|
||||
// * Neither the name of the Steinberg Media Technologies nor the names of its
|
||||
// contributors may be used to endorse or promote products derived from this
|
||||
// contributors may be used to endorse or promote products derived from this
|
||||
// software without specific prior written permission.
|
||||
//
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
// OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "hostclasses.h"
|
||||
#include "public.sdk/source/vst/utility/stringconvert.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
|
|
@ -46,31 +47,34 @@ HostApplication::HostApplication ()
|
|||
{
|
||||
FUNKNOWN_CTOR
|
||||
|
||||
mPlugInterfaceSupport = owned (NEW PlugInterfaceSupport);
|
||||
mPlugInterfaceSupport = owned (new PlugInterfaceSupport);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
tresult PLUGIN_API HostApplication::getName (String128 name)
|
||||
{
|
||||
String str ("My VST3 HostApplication");
|
||||
str.copyTo16 (name, 0, 127);
|
||||
return kResultTrue;
|
||||
return VST3::StringConvert::convert ("My VST3 HostApplication", name) ? kResultTrue :
|
||||
kInternalError;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
tresult PLUGIN_API HostApplication::createInstance (TUID cid, TUID _iid, void** obj)
|
||||
{
|
||||
FUID classID (FUID::fromTUID (cid));
|
||||
FUID interfaceID (FUID::fromTUID (_iid));
|
||||
if (classID == IMessage::iid && interfaceID == IMessage::iid)
|
||||
if (FUnknownPrivate::iidEqual (cid, IMessage::iid) &&
|
||||
FUnknownPrivate::iidEqual (_iid, IMessage::iid))
|
||||
{
|
||||
*obj = new HostMessage;
|
||||
return kResultTrue;
|
||||
}
|
||||
else if (classID == IAttributeList::iid && interfaceID == IAttributeList::iid)
|
||||
if (FUnknownPrivate::iidEqual (cid, IAttributeList::iid) &&
|
||||
FUnknownPrivate::iidEqual (_iid, IAttributeList::iid))
|
||||
{
|
||||
*obj = new HostAttributeList;
|
||||
return kResultTrue;
|
||||
if (auto al = HostAttributeList::make ())
|
||||
{
|
||||
*obj = al.take ();
|
||||
return kResultTrue;
|
||||
}
|
||||
return kOutOfMemory;
|
||||
}
|
||||
*obj = nullptr;
|
||||
return kResultFalse;
|
||||
|
|
@ -106,17 +110,12 @@ uint32 PLUGIN_API HostApplication::release ()
|
|||
//-----------------------------------------------------------------------------
|
||||
IMPLEMENT_FUNKNOWN_METHODS (HostMessage, IMessage, IMessage::iid)
|
||||
//-----------------------------------------------------------------------------
|
||||
HostMessage::HostMessage () : messageId (nullptr), attributeList (nullptr)
|
||||
{
|
||||
FUNKNOWN_CTOR
|
||||
}
|
||||
HostMessage::HostMessage () {FUNKNOWN_CTOR}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
HostMessage::~HostMessage ()
|
||||
HostMessage::~HostMessage () noexcept
|
||||
{
|
||||
setMessageID (nullptr);
|
||||
if (attributeList)
|
||||
attributeList->release ();
|
||||
FUNKNOWN_DTOR
|
||||
}
|
||||
|
||||
|
|
@ -144,38 +143,51 @@ void PLUGIN_API HostMessage::setMessageID (const char* mid)
|
|||
IAttributeList* PLUGIN_API HostMessage::getAttributes ()
|
||||
{
|
||||
if (!attributeList)
|
||||
attributeList = new HostAttributeList;
|
||||
attributeList = HostAttributeList::make ();
|
||||
return attributeList;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
class HostAttribute
|
||||
struct HostAttributeList::Attribute
|
||||
{
|
||||
public:
|
||||
enum Type
|
||||
enum class Type
|
||||
{
|
||||
kUninitialized,
|
||||
kInteger,
|
||||
kFloat,
|
||||
kString,
|
||||
kBinary
|
||||
};
|
||||
Attribute () = default;
|
||||
|
||||
HostAttribute (int64 value) : size (0), type (kInteger) { v.intValue = value; }
|
||||
HostAttribute (double value) : size (0), type (kFloat) { v.floatValue = value; }
|
||||
/** size is in code unit (count of TChar) */
|
||||
HostAttribute (const TChar* value, uint32 sizeInCodeUnit) : size (sizeInCodeUnit), type (kString)
|
||||
Attribute (int64 value) : type (Type::kInteger) { v.intValue = value; }
|
||||
Attribute (double value) : type (Type::kFloat) { v.floatValue = value; }
|
||||
/* size is in code unit (count of TChar) */
|
||||
Attribute (const TChar* value, uint32 sizeInCodeUnit)
|
||||
: size (sizeInCodeUnit), type (Type::kString)
|
||||
{
|
||||
v.stringValue = new TChar[sizeInCodeUnit];
|
||||
memcpy (v.stringValue, value, sizeInCodeUnit * sizeof (TChar));
|
||||
}
|
||||
HostAttribute (const void* value, uint32 sizeInBytes) : size (sizeInBytes), type (kBinary)
|
||||
Attribute (const void* value, uint32 sizeInBytes) : size (sizeInBytes), type (Type::kBinary)
|
||||
{
|
||||
v.binaryValue = new char[sizeInBytes];
|
||||
memcpy (v.binaryValue, value, sizeInBytes);
|
||||
}
|
||||
~HostAttribute ()
|
||||
Attribute (Attribute&& o) { *this = std::move (o); }
|
||||
Attribute& operator= (Attribute&& o)
|
||||
{
|
||||
v = o.v;
|
||||
size = o.size;
|
||||
type = o.type;
|
||||
o.size = 0;
|
||||
o.type = Type::kUninitialized;
|
||||
o.v = {};
|
||||
return *this;
|
||||
}
|
||||
~Attribute () noexcept
|
||||
{
|
||||
if (size)
|
||||
delete[] v.binaryValue;
|
||||
|
|
@ -183,7 +195,7 @@ public:
|
|||
|
||||
int64 intValue () const { return v.intValue; }
|
||||
double floatValue () const { return v.floatValue; }
|
||||
/** sizeInCodeUnit is in code unit (count of TChar) */
|
||||
/* sizeInCodeUnit is in code unit (count of TChar) */
|
||||
const TChar* stringValue (uint32& sizeInCodeUnit)
|
||||
{
|
||||
sizeInCodeUnit = size;
|
||||
|
|
@ -197,7 +209,7 @@ public:
|
|||
|
||||
Type getType () const { return type; }
|
||||
|
||||
protected:
|
||||
private:
|
||||
union v
|
||||
{
|
||||
int64 intValue;
|
||||
|
|
@ -205,58 +217,48 @@ protected:
|
|||
TChar* stringValue;
|
||||
char* binaryValue;
|
||||
} v;
|
||||
uint32 size;
|
||||
Type type;
|
||||
uint32 size {0};
|
||||
Type type {Type::kUninitialized};
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
IMPLEMENT_FUNKNOWN_METHODS (HostAttributeList, IAttributeList, IAttributeList::iid)
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
HostAttributeList::HostAttributeList ()
|
||||
IPtr<IAttributeList> HostAttributeList::make ()
|
||||
{
|
||||
FUNKNOWN_CTOR
|
||||
return owned (new HostAttributeList);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
HostAttributeList::~HostAttributeList ()
|
||||
HostAttributeList::HostAttributeList () {FUNKNOWN_CTOR}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
HostAttributeList::~HostAttributeList () noexcept
|
||||
{
|
||||
auto it = list.rbegin ();
|
||||
while (it != list.rend ())
|
||||
{
|
||||
delete it->second;
|
||||
it++;
|
||||
}
|
||||
FUNKNOWN_DTOR
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void HostAttributeList::removeAttrID (AttrID aid)
|
||||
{
|
||||
auto it = list.find (aid);
|
||||
if (it != list.end ())
|
||||
{
|
||||
delete it->second;
|
||||
list.erase (it);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
tresult PLUGIN_API HostAttributeList::setInt (AttrID aid, int64 value)
|
||||
{
|
||||
removeAttrID (aid);
|
||||
list[aid] = new HostAttribute (value);
|
||||
if (!aid)
|
||||
return kInvalidArgument;
|
||||
list[aid] = Attribute (value);
|
||||
return kResultTrue;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
tresult PLUGIN_API HostAttributeList::getInt (AttrID aid, int64& value)
|
||||
{
|
||||
if (!aid)
|
||||
return kInvalidArgument;
|
||||
auto it = list.find (aid);
|
||||
if (it != list.end () && it->second)
|
||||
if (it != list.end () && it->second.getType () == Attribute::Type::kInteger)
|
||||
{
|
||||
value = it->second->intValue ();
|
||||
value = it->second.intValue ();
|
||||
return kResultTrue;
|
||||
}
|
||||
return kResultFalse;
|
||||
|
|
@ -265,18 +267,21 @@ tresult PLUGIN_API HostAttributeList::getInt (AttrID aid, int64& value)
|
|||
//-----------------------------------------------------------------------------
|
||||
tresult PLUGIN_API HostAttributeList::setFloat (AttrID aid, double value)
|
||||
{
|
||||
removeAttrID (aid);
|
||||
list[aid] = new HostAttribute (value);
|
||||
if (!aid)
|
||||
return kInvalidArgument;
|
||||
list[aid] = Attribute (value);
|
||||
return kResultTrue;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
tresult PLUGIN_API HostAttributeList::getFloat (AttrID aid, double& value)
|
||||
{
|
||||
if (!aid)
|
||||
return kInvalidArgument;
|
||||
auto it = list.find (aid);
|
||||
if (it != list.end () && it->second)
|
||||
if (it != list.end () && it->second.getType () == Attribute::Type::kFloat)
|
||||
{
|
||||
value = it->second->floatValue ();
|
||||
value = it->second.floatValue ();
|
||||
return kResultTrue;
|
||||
}
|
||||
return kResultFalse;
|
||||
|
|
@ -285,20 +290,24 @@ tresult PLUGIN_API HostAttributeList::getFloat (AttrID aid, double& value)
|
|||
//-----------------------------------------------------------------------------
|
||||
tresult PLUGIN_API HostAttributeList::setString (AttrID aid, const TChar* string)
|
||||
{
|
||||
removeAttrID (aid);
|
||||
if (!aid)
|
||||
return kInvalidArgument;
|
||||
// + 1 for the null-terminate
|
||||
list[aid] = new HostAttribute (string, String (string).length () + 1);
|
||||
auto length = tstrlen (string) + 1;
|
||||
list[aid] = Attribute (string, length);
|
||||
return kResultTrue;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
tresult PLUGIN_API HostAttributeList::getString (AttrID aid, TChar* string, uint32 sizeInBytes)
|
||||
{
|
||||
if (!aid)
|
||||
return kInvalidArgument;
|
||||
auto it = list.find (aid);
|
||||
if (it != list.end () && it->second)
|
||||
if (it != list.end () && it->second.getType () == Attribute::Type::kString)
|
||||
{
|
||||
uint32 sizeInCodeUnit = 0;
|
||||
const TChar* _string = it->second->stringValue (sizeInCodeUnit);
|
||||
const TChar* _string = it->second.stringValue (sizeInCodeUnit);
|
||||
memcpy (string, _string, std::min<uint32> (sizeInCodeUnit * sizeof (TChar), sizeInBytes));
|
||||
return kResultTrue;
|
||||
}
|
||||
|
|
@ -308,22 +317,26 @@ tresult PLUGIN_API HostAttributeList::getString (AttrID aid, TChar* string, uint
|
|||
//-----------------------------------------------------------------------------
|
||||
tresult PLUGIN_API HostAttributeList::setBinary (AttrID aid, const void* data, uint32 sizeInBytes)
|
||||
{
|
||||
removeAttrID (aid);
|
||||
list[aid] = new HostAttribute (data, sizeInBytes);
|
||||
if (!aid)
|
||||
return kInvalidArgument;
|
||||
list[aid] = Attribute (data, sizeInBytes);
|
||||
return kResultTrue;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
tresult PLUGIN_API HostAttributeList::getBinary (AttrID aid, const void*& data, uint32& sizeInBytes)
|
||||
{
|
||||
if (!aid)
|
||||
return kInvalidArgument;
|
||||
auto it = list.find (aid);
|
||||
if (it != list.end () && it->second)
|
||||
if (it != list.end () && it->second.getType () == Attribute::Type::kBinary)
|
||||
{
|
||||
data = it->second->binaryValue (sizeInBytes);
|
||||
data = it->second.binaryValue (sizeInBytes);
|
||||
return kResultTrue;
|
||||
}
|
||||
sizeInBytes = 0;
|
||||
return kResultFalse;
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
} // Vst
|
||||
} // Steinberg
|
||||
|
|
|
|||
|
|
@ -4,32 +4,32 @@
|
|||
// Category : Helpers
|
||||
// Filename : public.sdk/source/vst/hosting/hostclasses.h
|
||||
// Created by : Steinberg, 03/05/2008.
|
||||
// Description : VST 3 hostclasses, example implementations for IHostApplication, IAttributeList and IMessage
|
||||
// Description : VST 3 hostclasses, example impl. for IHostApplication, IAttributeList and IMessage
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright notice,
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above copyright notice,
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// and/or other materials provided with the distribution.
|
||||
// * Neither the name of the Steinberg Media Technologies nor the names of its
|
||||
// contributors may be used to endorse or promote products derived from this
|
||||
// contributors may be used to endorse or promote products derived from this
|
||||
// software without specific prior written permission.
|
||||
//
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
// OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -37,9 +37,10 @@
|
|||
#pragma once
|
||||
|
||||
#include "public.sdk/source/vst/hosting/pluginterfacesupport.h"
|
||||
#include "base/source/fstring.h"
|
||||
#include "pluginterfaces/vst/ivsthostapplication.h"
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
namespace Steinberg {
|
||||
namespace Vst {
|
||||
|
|
@ -52,64 +53,66 @@ class HostApplication : public IHostApplication
|
|||
{
|
||||
public:
|
||||
HostApplication ();
|
||||
virtual ~HostApplication () { FUNKNOWN_DTOR }
|
||||
virtual ~HostApplication () noexcept {FUNKNOWN_DTOR}
|
||||
|
||||
//--- IHostApplication ---------------
|
||||
tresult PLUGIN_API getName (String128 name) SMTG_OVERRIDE;
|
||||
tresult PLUGIN_API createInstance (TUID cid, TUID _iid, void** obj) SMTG_OVERRIDE;
|
||||
tresult PLUGIN_API getName (String128 name) override;
|
||||
tresult PLUGIN_API createInstance (TUID cid, TUID _iid, void** obj) override;
|
||||
|
||||
DECLARE_FUNKNOWN_METHODS
|
||||
|
||||
PlugInterfaceSupport* getPlugInterfaceSupport () const { return mPlugInterfaceSupport; }
|
||||
|
||||
protected:
|
||||
private:
|
||||
IPtr<PlugInterfaceSupport> mPlugInterfaceSupport;
|
||||
};
|
||||
|
||||
class HostAttribute;
|
||||
//------------------------------------------------------------------------
|
||||
/** Implementation's example of IAttributeList.
|
||||
/** Example, ready to use implementation of IAttributeList.
|
||||
\ingroup hostingBase
|
||||
*/
|
||||
class HostAttributeList : public IAttributeList
|
||||
class HostAttributeList final : public IAttributeList
|
||||
{
|
||||
public:
|
||||
HostAttributeList ();
|
||||
virtual ~HostAttributeList ();
|
||||
/** make a new attribute list instance */
|
||||
static IPtr<IAttributeList> make ();
|
||||
|
||||
tresult PLUGIN_API setInt (AttrID aid, int64 value) SMTG_OVERRIDE;
|
||||
tresult PLUGIN_API getInt (AttrID aid, int64& 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 setString (AttrID aid, const TChar* string) 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;
|
||||
tresult PLUGIN_API setInt (AttrID aid, int64 value) override;
|
||||
tresult PLUGIN_API getInt (AttrID aid, int64& value) override;
|
||||
tresult PLUGIN_API setFloat (AttrID aid, double value) override;
|
||||
tresult PLUGIN_API getFloat (AttrID aid, double& value) override;
|
||||
tresult PLUGIN_API setString (AttrID aid, const TChar* string) override;
|
||||
tresult PLUGIN_API getString (AttrID aid, TChar* string, uint32 sizeInBytes) override;
|
||||
tresult PLUGIN_API setBinary (AttrID aid, const void* data, uint32 sizeInBytes) override;
|
||||
tresult PLUGIN_API getBinary (AttrID aid, const void*& data, uint32& sizeInBytes) override;
|
||||
|
||||
virtual ~HostAttributeList () noexcept;
|
||||
DECLARE_FUNKNOWN_METHODS
|
||||
protected:
|
||||
void removeAttrID (AttrID aid);
|
||||
std::map<String, HostAttribute*> list;
|
||||
private:
|
||||
HostAttributeList ();
|
||||
|
||||
struct Attribute;
|
||||
std::map<std::string, Attribute> list;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
/** Implementation's example of IMessage.
|
||||
/** Example implementation of IMessage.
|
||||
\ingroup hostingBase
|
||||
*/
|
||||
class HostMessage : public IMessage
|
||||
class HostMessage final : public IMessage
|
||||
{
|
||||
public:
|
||||
HostMessage ();
|
||||
virtual ~HostMessage ();
|
||||
virtual ~HostMessage () noexcept;
|
||||
|
||||
const char* PLUGIN_API getMessageID () SMTG_OVERRIDE;
|
||||
void PLUGIN_API setMessageID (const char* messageID) SMTG_OVERRIDE;
|
||||
IAttributeList* PLUGIN_API getAttributes () SMTG_OVERRIDE;
|
||||
const char* PLUGIN_API getMessageID () override;
|
||||
void PLUGIN_API setMessageID (const char* messageID) override;
|
||||
IAttributeList* PLUGIN_API getAttributes () override;
|
||||
|
||||
DECLARE_FUNKNOWN_METHODS
|
||||
protected:
|
||||
char* messageId;
|
||||
HostAttributeList* attributeList;
|
||||
private:
|
||||
char* messageId {nullptr};
|
||||
IPtr<IAttributeList> attributeList;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
|
|
@ -43,12 +43,14 @@
|
|||
|
||||
#include <algorithm>
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
namespace Steinberg {
|
||||
namespace Vst {
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
PlugInterfaceSupport::PlugInterfaceSupport ()
|
||||
{
|
||||
FUNKNOWN_CTOR
|
||||
// add minimum set
|
||||
|
||||
//---VST 3.0.0--------------------------------
|
||||
|
|
@ -117,9 +119,16 @@ void PlugInterfaceSupport::addPlugInterfaceSupported (const TUID _iid)
|
|||
//-----------------------------------------------------------------------------
|
||||
bool PlugInterfaceSupport::removePlugInterfaceSupported (const TUID _iid)
|
||||
{
|
||||
return std::remove (mFUIDArray.begin (), mFUIDArray.end (), FUID::fromTUID (_iid)) !=
|
||||
mFUIDArray.end ();
|
||||
auto uid = FUID::fromTUID (_iid);
|
||||
auto it = std::find (mFUIDArray.begin (), mFUIDArray.end (), uid);
|
||||
if (it == mFUIDArray.end ())
|
||||
return false;
|
||||
mFUIDArray.erase (it);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace
|
||||
IMPLEMENT_FUNKNOWN_METHODS (PlugInterfaceSupport, IPlugInterfaceSupport, IPlugInterfaceSupport::iid)
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
} // Vst
|
||||
} // Steinberg
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
|
|
@ -39,19 +39,19 @@
|
|||
#include "pluginterfaces/vst/ivstpluginterfacesupport.h"
|
||||
|
||||
#include <vector>
|
||||
#include "base/source/fobject.h"
|
||||
|
||||
namespace Steinberg {
|
||||
namespace Vst {
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
/** Implementation's example of IPlugInterfaceSupport.
|
||||
/** Example implementation of IPlugInterfaceSupport.
|
||||
\ingroup hostingBase
|
||||
*/
|
||||
class PlugInterfaceSupport : public FObject, public IPlugInterfaceSupport
|
||||
class PlugInterfaceSupport : public IPlugInterfaceSupport
|
||||
{
|
||||
public:
|
||||
PlugInterfaceSupport ();
|
||||
virtual ~PlugInterfaceSupport () = default;
|
||||
|
||||
//--- IPlugInterfaceSupport ---------
|
||||
tresult PLUGIN_API isPlugInterfaceSupported (const TUID _iid) SMTG_OVERRIDE;
|
||||
|
|
@ -59,11 +59,7 @@ public:
|
|||
void addPlugInterfaceSupported (const TUID _iid);
|
||||
bool removePlugInterfaceSupported (const TUID _iid);
|
||||
|
||||
OBJ_METHODS (PlugInterfaceSupport, FObject)
|
||||
REFCOUNT_METHODS (FObject)
|
||||
DEFINE_INTERFACES
|
||||
DEF_INTERFACE (IPlugInterfaceSupport)
|
||||
END_DEFINE_INTERFACES (FObject)
|
||||
DECLARE_FUNKNOWN_METHODS
|
||||
|
||||
private:
|
||||
std::vector<FUID> mFUIDArray;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,148 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Project : VST SDK
|
||||
//
|
||||
// Category : Helpers
|
||||
// Filename : public.sdk/source/vst/utility/stringconvert.cpp
|
||||
// Created by : Steinberg, 11/2014
|
||||
// Description : c++11 unicode string convert functions
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above copyright notice,
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// and/or other materials provided with the distribution.
|
||||
// * Neither the name of the Steinberg Media Technologies nor the names of its
|
||||
// contributors may be used to endorse or promote products derived from this
|
||||
// software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
// OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "stringconvert.h"
|
||||
#include <codecvt>
|
||||
#include <locale>
|
||||
#include <istream>
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
namespace VST3 {
|
||||
namespace StringConvert {
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
namespace {
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1900
|
||||
#define USE_WCHAR_AS_UTF16TYPE
|
||||
using UTF16Type = wchar_t;
|
||||
#else
|
||||
using UTF16Type = char16_t;
|
||||
#endif
|
||||
|
||||
using Converter = std::wstring_convert<std::codecvt_utf8_utf16<UTF16Type>, UTF16Type>;
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
Converter& converter ()
|
||||
{
|
||||
static Converter conv;
|
||||
return conv;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
} // anonymous
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
std::u16string convert (const std::string& utf8Str)
|
||||
{
|
||||
#if defined(USE_WCHAR_AS_UTF16TYPE)
|
||||
auto wstr = converter ().from_bytes (utf8Str);
|
||||
return {wstr.data (), wstr.data () + wstr.size ()};
|
||||
#else
|
||||
return converter ().from_bytes (utf8Str);
|
||||
#endif
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
bool convert (const std::string& utf8Str, Steinberg::Vst::String128 str)
|
||||
{
|
||||
return convert (utf8Str, str, 128);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
bool convert (const std::string& utf8Str, Steinberg::Vst::TChar* str, uint32_t maxCharacters)
|
||||
{
|
||||
auto ucs2 = convert (utf8Str);
|
||||
if (ucs2.length () < maxCharacters)
|
||||
{
|
||||
ucs2.copy (reinterpret_cast<char16_t*> (str), ucs2.length ());
|
||||
str[ucs2.length ()] = 0;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
std::string convert (const Steinberg::Vst::TChar* str)
|
||||
{
|
||||
return converter ().to_bytes (reinterpret_cast<const UTF16Type*> (str));
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
std::string convert (const Steinberg::Vst::TChar* str, uint32_t max)
|
||||
{
|
||||
std::string result;
|
||||
if (str)
|
||||
{
|
||||
Steinberg::Vst::TChar tmp[2] {};
|
||||
for (uint32_t i = 0; i < max; ++i, ++str)
|
||||
{
|
||||
tmp[0] = *str;
|
||||
if (tmp[0] == 0)
|
||||
break;
|
||||
result += convert (tmp);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
std::string convert (const std::u16string& str)
|
||||
{
|
||||
return converter ().to_bytes (reinterpret_cast<const UTF16Type*> (str.data ()),
|
||||
reinterpret_cast<const UTF16Type*> (str.data () + str.size ()));
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
std::string convert (const char* str, uint32_t max)
|
||||
{
|
||||
std::string result;
|
||||
if (str)
|
||||
{
|
||||
result.reserve (max);
|
||||
for (uint32_t i = 0; i < max; ++i, ++str)
|
||||
{
|
||||
if (*str == 0)
|
||||
break;
|
||||
result += *str;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
} // String
|
||||
} // VST3
|
||||
|
|
@ -0,0 +1,132 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Project : VST SDK
|
||||
//
|
||||
// Category : Helpers
|
||||
// Filename : public.sdk/source/vst/utility/stringconvert.h
|
||||
// Created by : Steinberg, 11/2014
|
||||
// Description : c++11 unicode string convert functions
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
//
|
||||
// * Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
// * Redistributions in binary form must reproduce the above copyright notice,
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// and/or other materials provided with the distribution.
|
||||
// * Neither the name of the Steinberg Media Technologies nor the names of its
|
||||
// contributors may be used to endorse or promote products derived from this
|
||||
// software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
// OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "pluginterfaces/vst/vsttypes.h"
|
||||
#include <string>
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
namespace VST3 {
|
||||
namespace StringConvert {
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
/**
|
||||
* convert an UTF-8 string to an UTF-16 string
|
||||
*
|
||||
* @param utf8Str UTF-8 string
|
||||
*
|
||||
* @return UTF-16 string
|
||||
*/
|
||||
extern std::u16string convert (const std::string& utf8Str);
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
/**
|
||||
* convert an UTF-8 string to an UTF-16 string buffer with max 127 characters
|
||||
*
|
||||
* @param utf8Str UTF-8 string
|
||||
* @param str UTF-16 string buffer
|
||||
*
|
||||
* @return true on success
|
||||
*/
|
||||
extern bool convert (const std::string& utf8Str, Steinberg::Vst::String128 str);
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
/**
|
||||
* convert an UTF-8 string to an UTF-16 string buffer
|
||||
*
|
||||
* @param utf8Str UTF-8 string
|
||||
* @param str UTF-16 string buffer
|
||||
* @param maxCharacters max characters that fit into str
|
||||
*
|
||||
* @return true on success
|
||||
*/
|
||||
extern bool convert (const std::string& utf8Str, Steinberg::Vst::TChar* str,
|
||||
uint32_t maxCharacters);
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
/**
|
||||
* convert an UTF-16 string buffer to an UTF-8 string
|
||||
*
|
||||
* @param str UTF-16 string buffer
|
||||
*
|
||||
* @return UTF-8 string
|
||||
*/
|
||||
extern std::string convert (const Steinberg::Vst::TChar* str);
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
/**
|
||||
* convert an UTF-16 string buffer to an UTF-8 string
|
||||
*
|
||||
* @param str UTF-16 string buffer
|
||||
* @param max maximum characters in str
|
||||
*
|
||||
* @return UTF-8 string
|
||||
*/
|
||||
extern std::string convert (const Steinberg::Vst::TChar* str, uint32_t max);
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
/**
|
||||
* convert an UTF-16 string to an UTF-8 string
|
||||
*
|
||||
* @param str UTF-16 string
|
||||
*
|
||||
* @return UTF-8 string
|
||||
*/
|
||||
extern std::string convert (const std::u16string& str);
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
/**
|
||||
* convert a ASCII string buffer to an UTF-8 string
|
||||
*
|
||||
* @param str ASCII string buffer
|
||||
* @param max maximum characters in str
|
||||
*
|
||||
* @return UTF-8 string
|
||||
*/
|
||||
extern std::string convert (const char* str, uint32_t max);
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
} // String
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
inline const Steinberg::Vst::TChar* toTChar (const std::u16string& str)
|
||||
{
|
||||
return reinterpret_cast<const Steinberg::Vst::TChar*> (str.data ());
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
} // VST3
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
|
|
@ -59,6 +59,7 @@ public:
|
|||
//---Internal Methods-------
|
||||
/** Sets the controller Class ID associated to its component. */
|
||||
void setControllerClass (const FUID& cid) { controllerClass = cid; }
|
||||
void setControllerClass (const TUID& cid) { controllerClass = FUID::fromTUID (cid); }
|
||||
|
||||
/** Removes all Audio Busses. */
|
||||
tresult removeAudioBusses ();
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
|
|
@ -159,7 +159,7 @@ tresult ComponentBase::sendTextMessage (const char8* text) const
|
|||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
tresult ComponentBase::sendMessageID (const char* messageID) const
|
||||
tresult ComponentBase::sendMessageID (const char8* messageID) const
|
||||
{
|
||||
if (auto msg = owned (allocateMessage ()))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
|
|
@ -48,7 +48,7 @@ KnobMode EditController::hostKnobMode = kCircularMode;
|
|||
//------------------------------------------------------------------------
|
||||
// EditController Implementation
|
||||
//------------------------------------------------------------------------
|
||||
EditController::EditController () : componentHandler (nullptr), componentHandler2 (nullptr)
|
||||
EditController::EditController ()
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -63,17 +63,8 @@ tresult PLUGIN_API EditController::terminate ()
|
|||
{
|
||||
parameters.removeAll ();
|
||||
|
||||
if (componentHandler)
|
||||
{
|
||||
componentHandler->release ();
|
||||
componentHandler = nullptr;
|
||||
}
|
||||
|
||||
if (componentHandler2)
|
||||
{
|
||||
componentHandler2->release ();
|
||||
componentHandler2 = nullptr;
|
||||
}
|
||||
componentHandler.reset ();
|
||||
componentHandler2.reset ();
|
||||
|
||||
return ComponentBase::terminate ();
|
||||
}
|
||||
|
|
@ -189,25 +180,11 @@ tresult PLUGIN_API EditController::setComponentHandler (IComponentHandler* newHa
|
|||
return kResultTrue;
|
||||
}
|
||||
|
||||
if (componentHandler)
|
||||
{
|
||||
componentHandler->release ();
|
||||
}
|
||||
|
||||
componentHandler = newHandler;
|
||||
if (componentHandler)
|
||||
{
|
||||
componentHandler->addRef ();
|
||||
}
|
||||
componentHandler2.reset ();
|
||||
|
||||
// try to get the extended version
|
||||
if (componentHandler2)
|
||||
{
|
||||
componentHandler2->release ();
|
||||
componentHandler2 = nullptr;
|
||||
}
|
||||
|
||||
if (newHandler)
|
||||
// try to get the extended version
|
||||
if (newHandler)
|
||||
{
|
||||
newHandler->queryInterface (IComponentHandler2::iid, (void**)&componentHandler2);
|
||||
}
|
||||
|
|
@ -302,10 +279,6 @@ tresult EditController::requestOpenEditor (FIDString name)
|
|||
EditorView::EditorView (EditController* _controller, ViewRect* size)
|
||||
: CPluginView (size), controller (_controller)
|
||||
{
|
||||
if (controller)
|
||||
{
|
||||
controller->addRef ();
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
|
|
@ -314,7 +287,7 @@ EditorView::~EditorView ()
|
|||
if (controller)
|
||||
{
|
||||
controller->editorDestroyed (this);
|
||||
controller->release ();
|
||||
controller = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -340,7 +313,7 @@ void EditorView::removedFromParent ()
|
|||
//------------------------------------------------------------------------
|
||||
// EditControllerEx1 implementation
|
||||
//------------------------------------------------------------------------
|
||||
EditControllerEx1::EditControllerEx1 () : selectedUnit (kRootUnitId)
|
||||
EditControllerEx1::EditControllerEx1 ()
|
||||
{
|
||||
UpdateHandler::instance ();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
|
|
@ -125,8 +125,8 @@ public:
|
|||
REFCOUNT_METHODS (ComponentBase)
|
||||
//------------------------------------------------------------------------
|
||||
protected:
|
||||
IComponentHandler* componentHandler;
|
||||
IComponentHandler2* componentHandler2;
|
||||
IPtr<IComponentHandler> componentHandler;
|
||||
IPtr<IComponentHandler2> componentHandler2;
|
||||
|
||||
ParameterContainer parameters;
|
||||
|
||||
|
|
@ -153,7 +153,7 @@ public:
|
|||
|
||||
//------------------------------------------------------------------------
|
||||
protected:
|
||||
EditController* controller;
|
||||
IPtr<EditController> controller;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
|
|
@ -366,7 +366,7 @@ protected:
|
|||
UnitVector units;
|
||||
ProgramListVector programLists;
|
||||
ProgramIndexMap programIndexMap;
|
||||
UnitID selectedUnit;
|
||||
UnitID selectedUnit {kRootUnitId};
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
|
|
@ -36,6 +36,7 @@
|
|||
|
||||
#include "pluginterfaces/base/funknown.h"
|
||||
|
||||
#include "pluginterfaces/base/iplugincompatibility.h"
|
||||
#include "pluginterfaces/vst/ivstaudioprocessor.h"
|
||||
#include "pluginterfaces/vst/ivstautomationstate.h"
|
||||
#include "pluginterfaces/vst/ivstchannelcontextinfo.h"
|
||||
|
|
@ -58,86 +59,87 @@
|
|||
|
||||
//------------------------------------------------------------------------
|
||||
namespace Steinberg {
|
||||
namespace Vst {
|
||||
|
||||
//----VST 3.0--------------------------------
|
||||
DEF_CLASS_IID (IComponent)
|
||||
DEF_CLASS_IID (IAudioProcessor)
|
||||
DEF_CLASS_IID (IUnitData)
|
||||
DEF_CLASS_IID (IProgramListData)
|
||||
DEF_CLASS_IID (Vst::IComponent)
|
||||
DEF_CLASS_IID (Vst::IAudioProcessor)
|
||||
DEF_CLASS_IID (Vst::IUnitData)
|
||||
DEF_CLASS_IID (Vst::IProgramListData)
|
||||
|
||||
DEF_CLASS_IID (IEditController)
|
||||
DEF_CLASS_IID (IUnitInfo)
|
||||
DEF_CLASS_IID (Vst::IEditController)
|
||||
DEF_CLASS_IID (Vst::IUnitInfo)
|
||||
|
||||
DEF_CLASS_IID (IConnectionPoint)
|
||||
DEF_CLASS_IID (Vst::IConnectionPoint)
|
||||
|
||||
DEF_CLASS_IID (IComponentHandler)
|
||||
DEF_CLASS_IID (IUnitHandler)
|
||||
DEF_CLASS_IID (Vst::IComponentHandler)
|
||||
DEF_CLASS_IID (Vst::IUnitHandler)
|
||||
|
||||
DEF_CLASS_IID (IParamValueQueue)
|
||||
DEF_CLASS_IID (IParameterChanges)
|
||||
DEF_CLASS_IID (Vst::IParamValueQueue)
|
||||
DEF_CLASS_IID (Vst::IParameterChanges)
|
||||
|
||||
DEF_CLASS_IID (IEventList)
|
||||
DEF_CLASS_IID (IMessage)
|
||||
DEF_CLASS_IID (Vst::IEventList)
|
||||
DEF_CLASS_IID (Vst::IMessage)
|
||||
|
||||
DEF_CLASS_IID (IHostApplication)
|
||||
DEF_CLASS_IID (IAttributeList)
|
||||
DEF_CLASS_IID (Vst::IHostApplication)
|
||||
DEF_CLASS_IID (Vst::IAttributeList)
|
||||
|
||||
//----VST 3.0.1--------------------------------
|
||||
DEF_CLASS_IID (IMidiMapping)
|
||||
DEF_CLASS_IID (Vst::IMidiMapping)
|
||||
|
||||
//----VST 3.0.2--------------------------------
|
||||
DEF_CLASS_IID (IParameterFinder)
|
||||
DEF_CLASS_IID (Vst::IParameterFinder)
|
||||
|
||||
//----VST 3.1----------------------------------
|
||||
DEF_CLASS_IID (IComponentHandler2)
|
||||
DEF_CLASS_IID (IEditController2)
|
||||
DEF_CLASS_IID (IAudioPresentationLatency)
|
||||
DEF_CLASS_IID (IVst3ToVst2Wrapper)
|
||||
DEF_CLASS_IID (IVst3ToAUWrapper)
|
||||
DEF_CLASS_IID (Vst::IComponentHandler2)
|
||||
DEF_CLASS_IID (Vst::IEditController2)
|
||||
DEF_CLASS_IID (Vst::IAudioPresentationLatency)
|
||||
DEF_CLASS_IID (Vst::IVst3ToVst2Wrapper)
|
||||
DEF_CLASS_IID (Vst::IVst3ToAUWrapper)
|
||||
|
||||
//----VST 3.5----------------------------------
|
||||
DEF_CLASS_IID (INoteExpressionController)
|
||||
DEF_CLASS_IID (IKeyswitchController)
|
||||
DEF_CLASS_IID (IContextMenuTarget)
|
||||
DEF_CLASS_IID (IContextMenu)
|
||||
DEF_CLASS_IID (IComponentHandler3)
|
||||
DEF_CLASS_IID (IEditControllerHostEditing)
|
||||
DEF_CLASS_IID (IXmlRepresentationController)
|
||||
DEF_CLASS_IID (Vst::INoteExpressionController)
|
||||
DEF_CLASS_IID (Vst::IKeyswitchController)
|
||||
DEF_CLASS_IID (Vst::IContextMenuTarget)
|
||||
DEF_CLASS_IID (Vst::IContextMenu)
|
||||
DEF_CLASS_IID (Vst::IComponentHandler3)
|
||||
DEF_CLASS_IID (Vst::IEditControllerHostEditing)
|
||||
DEF_CLASS_IID (Vst::IXmlRepresentationController)
|
||||
|
||||
//----VST 3.6----------------------------------
|
||||
DEF_CLASS_IID (IInterAppAudioHost)
|
||||
DEF_CLASS_IID (IInterAppAudioConnectionNotification)
|
||||
DEF_CLASS_IID (IInterAppAudioPresetManager)
|
||||
DEF_CLASS_IID (IStreamAttributes)
|
||||
DEF_CLASS_IID (Vst::IInterAppAudioHost)
|
||||
DEF_CLASS_IID (Vst::IInterAppAudioConnectionNotification)
|
||||
DEF_CLASS_IID (Vst::IInterAppAudioPresetManager)
|
||||
DEF_CLASS_IID (Vst::IStreamAttributes)
|
||||
|
||||
//----VST 3.6.5--------------------------------
|
||||
DEF_CLASS_IID (ChannelContext::IInfoListener)
|
||||
DEF_CLASS_IID (IPrefetchableSupport)
|
||||
DEF_CLASS_IID (IUnitHandler2)
|
||||
DEF_CLASS_IID (IAutomationState)
|
||||
DEF_CLASS_IID (Vst::ChannelContext::IInfoListener)
|
||||
DEF_CLASS_IID (Vst::IPrefetchableSupport)
|
||||
DEF_CLASS_IID (Vst::IUnitHandler2)
|
||||
DEF_CLASS_IID (Vst::IAutomationState)
|
||||
|
||||
//----VST 3.6.8--------------------------------
|
||||
DEF_CLASS_IID (IComponentHandlerBusActivation)
|
||||
DEF_CLASS_IID (IVst3ToAAXWrapper)
|
||||
DEF_CLASS_IID (Vst::IComponentHandlerBusActivation)
|
||||
DEF_CLASS_IID (Vst::IVst3ToAAXWrapper)
|
||||
|
||||
//----VST 3.6.11--------------------------------
|
||||
DEF_CLASS_IID (INoteExpressionPhysicalUIMapping)
|
||||
DEF_CLASS_IID (Vst::INoteExpressionPhysicalUIMapping)
|
||||
|
||||
//----VST 3.6.12--------------------------------
|
||||
DEF_CLASS_IID (IMidiLearn)
|
||||
DEF_CLASS_IID (IPlugInterfaceSupport)
|
||||
DEF_CLASS_IID (IVst3WrapperMPESupport)
|
||||
DEF_CLASS_IID (Vst::IMidiLearn)
|
||||
DEF_CLASS_IID (Vst::IPlugInterfaceSupport)
|
||||
DEF_CLASS_IID (Vst::IVst3WrapperMPESupport)
|
||||
|
||||
//----VST 3.6.13--------------------------------
|
||||
DEF_CLASS_IID (ITestPlugProvider)
|
||||
DEF_CLASS_IID (Vst::ITestPlugProvider)
|
||||
|
||||
//----VST 3.7-----------------------------------
|
||||
DEF_CLASS_IID (IParameterFunctionName)
|
||||
DEF_CLASS_IID (IProcessContextRequirements)
|
||||
DEF_CLASS_IID (IProgress)
|
||||
DEF_CLASS_IID (ITestPlugProvider2)
|
||||
DEF_CLASS_IID (Vst::IParameterFunctionName)
|
||||
DEF_CLASS_IID (Vst::IProcessContextRequirements)
|
||||
DEF_CLASS_IID (Vst::IProgress)
|
||||
DEF_CLASS_IID (Vst::ITestPlugProvider2)
|
||||
|
||||
|
||||
//----VST 3.7.5---------------------------------
|
||||
DEF_CLASS_IID (IPluginCompatibility)
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
} // Vst
|
||||
} // Steinberg
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
|
|
@ -35,10 +35,8 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "vstpresetfile.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
|
||||
namespace Steinberg {
|
||||
namespace Vst {
|
||||
|
||||
|
|
@ -490,13 +488,12 @@ bool PresetFile::storeComponentState (IBStream* componentStream)
|
|||
bool PresetFile::restoreComponentState (IComponent* component)
|
||||
{
|
||||
const Entry* e = getEntry (kComponentState);
|
||||
if (e)
|
||||
{
|
||||
auto* readOnlyBStream = new ReadOnlyBStream (stream, e->offset, e->size);
|
||||
FReleaser readOnlyBStreamReleaser (readOnlyBStream);
|
||||
return verify (component->setState (readOnlyBStream));
|
||||
}
|
||||
return false;
|
||||
if (!e)
|
||||
return false;
|
||||
|
||||
auto readOnlyBStream = owned (new ReadOnlyBStream (stream, e->offset, e->size));
|
||||
return verify (component->setState (readOnlyBStream));
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
|
|
@ -505,8 +502,7 @@ bool PresetFile::restoreComponentState (IEditController* editController)
|
|||
const Entry* e = getEntry (kComponentState);
|
||||
if (e)
|
||||
{
|
||||
auto* readOnlyBStream = new ReadOnlyBStream (stream, e->offset, e->size);
|
||||
FReleaser readOnlyBStreamReleaser (readOnlyBStream);
|
||||
auto readOnlyBStream = owned (new ReadOnlyBStream (stream, e->offset, e->size));
|
||||
return verify (editController->setComponentState (readOnlyBStream));
|
||||
}
|
||||
return false;
|
||||
|
|
@ -546,8 +542,7 @@ bool PresetFile::restoreControllerState (IEditController* editController)
|
|||
const Entry* e = getEntry (kControllerState);
|
||||
if (e)
|
||||
{
|
||||
auto* readOnlyBStream = new ReadOnlyBStream (stream, e->offset, e->size);
|
||||
FReleaser readOnlyBStreamReleaser (readOnlyBStream);
|
||||
auto readOnlyBStream = owned (new ReadOnlyBStream (stream, e->offset, e->size));
|
||||
return verify (editController->setState (readOnlyBStream));
|
||||
}
|
||||
return false;
|
||||
|
|
@ -603,9 +598,8 @@ bool PresetFile::restoreProgramData (IProgramListData* programListData,
|
|||
return false;
|
||||
|
||||
int32 alreadyRead = sizeof (int32);
|
||||
auto* readOnlyBStream =
|
||||
new ReadOnlyBStream (stream, e->offset + alreadyRead, e->size - alreadyRead);
|
||||
FReleaser readOnlyBStreamReleaser (readOnlyBStream);
|
||||
auto readOnlyBStream = owned (
|
||||
new ReadOnlyBStream (stream, e->offset + alreadyRead, e->size - alreadyRead));
|
||||
return programListData && verify (programListData->setProgramData (
|
||||
savedProgramListID, programIndex, readOnlyBStream));
|
||||
}
|
||||
|
|
@ -639,9 +633,8 @@ bool PresetFile::restoreProgramData (IUnitData* unitData, UnitID* unitId)
|
|||
return false;
|
||||
|
||||
int32 alreadyRead = sizeof (int32);
|
||||
auto* readOnlyBStream =
|
||||
new ReadOnlyBStream (stream, e->offset + alreadyRead, e->size - alreadyRead);
|
||||
FReleaser readOnlyStreamReleaser (readOnlyBStream);
|
||||
auto readOnlyBStream = owned (
|
||||
new ReadOnlyBStream (stream, e->offset + alreadyRead, e->size - alreadyRead));
|
||||
return (unitData && verify (unitData->setUnitData (savedUnitID, readOnlyBStream)));
|
||||
}
|
||||
}
|
||||
|
|
@ -662,9 +655,8 @@ bool PresetFile::restoreProgramData (IUnitInfo* unitInfo, int32 unitProgramListI
|
|||
return false;
|
||||
|
||||
int32 alreadyRead = sizeof (int32);
|
||||
auto* readOnlyBStream =
|
||||
new ReadOnlyBStream (stream, e->offset + alreadyRead, e->size - alreadyRead);
|
||||
FReleaser readOnlyStreamReleaser (readOnlyBStream);
|
||||
auto readOnlyBStream = owned (
|
||||
new ReadOnlyBStream (stream, e->offset + alreadyRead, e->size - alreadyRead));
|
||||
return (unitInfo && unitInfo->setUnitProgramData (unitProgramListID, programIndex,
|
||||
readOnlyBStream));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// LICENSE
|
||||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
// (c) 2022, Steinberg Media Technologies GmbH, All Rights Reserved
|
||||
//-----------------------------------------------------------------------------
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
|
|
|
|||
|
|
@ -430,7 +430,7 @@ namespace detail
|
|||
inline bool isLayoutTableValid()
|
||||
{
|
||||
for (const auto& item : detail::layoutTable)
|
||||
if ((size_t) countNumberOfBits (item.arrangement) != item.channelOrder.size())
|
||||
if ((size_t) countNumberOfBits ((uint64) item.arrangement) != item.channelOrder.size())
|
||||
return false;
|
||||
|
||||
std::set<Steinberg::Vst::SpeakerArrangement> arrangements;
|
||||
|
|
|
|||
|
|
@ -47,18 +47,22 @@ JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-W#warnings",
|
|||
"-Wextra-semi",
|
||||
"-Wfloat-equal",
|
||||
"-Wformat",
|
||||
"-Wformat-truncation=",
|
||||
"-Wformat=",
|
||||
"-Wignored-qualifiers",
|
||||
"-Winconsistent-missing-destructor-override",
|
||||
"-Wint-to-pointer-cast",
|
||||
"-Wlogical-op-parentheses",
|
||||
"-Wmaybe-uninitialized",
|
||||
"-Wmissing-braces",
|
||||
"-Wmissing-field-initializers",
|
||||
"-Wmissing-prototypes",
|
||||
"-Wnon-virtual-dtor",
|
||||
"-Woverloaded-virtual",
|
||||
"-Wparentheses",
|
||||
"-Wpedantic",
|
||||
"-Wpragma-pack",
|
||||
"-Wredundant-decls",
|
||||
"-Wreorder",
|
||||
"-Wshadow",
|
||||
"-Wshadow-field",
|
||||
|
|
@ -116,6 +120,7 @@ JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-W#warnings",
|
|||
// needed for VST_VERSION
|
||||
#include <pluginterfaces/vst/vsttypes.h>
|
||||
|
||||
#define NOMINMAX // Some of the steinberg sources don't set this before including windows.h
|
||||
#include <base/source/baseiids.cpp>
|
||||
#include <base/source/fbuffer.cpp>
|
||||
#include <base/source/fdebug.cpp>
|
||||
|
|
@ -145,18 +150,19 @@ JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-W#warnings",
|
|||
#include <pluginterfaces/base/ustring.cpp>
|
||||
#include <pluginterfaces/gui/iplugview.h>
|
||||
#include <pluginterfaces/gui/iplugviewcontentscalesupport.h>
|
||||
#include <pluginterfaces/vst/ivstmidicontrollers.h>
|
||||
#include <pluginterfaces/vst/ivstchannelcontextinfo.h>
|
||||
#include <pluginterfaces/vst/ivstmidicontrollers.h>
|
||||
#include <public.sdk/source/common/memorystream.cpp>
|
||||
#include <public.sdk/source/common/pluginview.cpp>
|
||||
#include <public.sdk/source/vst/vsteditcontroller.cpp>
|
||||
#include <public.sdk/source/vst/hosting/hostclasses.cpp>
|
||||
#include <public.sdk/source/vst/utility/stringconvert.cpp>
|
||||
#include <public.sdk/source/vst/vstbus.cpp>
|
||||
#include <public.sdk/source/vst/vstinitiids.cpp>
|
||||
#include <public.sdk/source/vst/vstcomponent.cpp>
|
||||
#include <public.sdk/source/vst/vstcomponentbase.cpp>
|
||||
#include <public.sdk/source/vst/vsteditcontroller.cpp>
|
||||
#include <public.sdk/source/vst/vstinitiids.cpp>
|
||||
#include <public.sdk/source/vst/vstparameters.cpp>
|
||||
#include <public.sdk/source/vst/vstpresetfile.cpp>
|
||||
#include <public.sdk/source/vst/hosting/hostclasses.cpp>
|
||||
|
||||
#if VST_VERSION >= 0x03060c // 3.6.12
|
||||
#include <public.sdk/source/vst/hosting/pluginterfacesupport.cpp>
|
||||
|
|
|
|||
|
|
@ -3020,7 +3020,7 @@ public:
|
|||
{
|
||||
if (componentStream != nullptr)
|
||||
{
|
||||
int64 result;
|
||||
Steinberg::int64 result;
|
||||
componentStream->seek (0, IBStream::kIBSeekSet, &result);
|
||||
setComponentStateAndResetParameters (*componentStream);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue