@@ -69,6 +69,7 @@ ifeq ($(HAVE_QT5),true) | |||
endif | |||
ifeq ($(USING_JUCE),true) | |||
3RD_LIBS += $(MODULEDIR)/carla_juce.a | |||
3RD_LIBS += $(MODULEDIR)/juce_audio_basics.a | |||
ifeq ($(USING_JUCE_AUDIO_DEVICES),true) | |||
3RD_LIBS += $(MODULEDIR)/juce_audio_devices.a | |||
@@ -260,6 +261,7 @@ LIBS_POSIX32 += $(MODULEDIR)/rtmempool.posix32.a | |||
LIBS_POSIX32 += $(MODULEDIR)/water.posix32.a | |||
ifeq ($(USING_JUCE),true) | |||
LIBS_POSIX32 += $(MODULEDIR)/carla_juce.posix32.a | |||
LIBS_POSIX32 += $(MODULEDIR)/juce_audio_basics.posix32.a | |||
LIBS_POSIX32 += $(MODULEDIR)/juce_audio_processors.posix32.a | |||
LIBS_POSIX32 += $(MODULEDIR)/juce_data_structures.posix32.a | |||
@@ -285,6 +287,7 @@ LIBS_POSIX64 += $(MODULEDIR)/rtmempool.posix64.a | |||
LIBS_POSIX64 += $(MODULEDIR)/water.posix64.a | |||
ifeq ($(USING_JUCE),true) | |||
LIBS_POSIX64 += $(MODULEDIR)/carla_juce.posix64.a | |||
LIBS_POSIX64 += $(MODULEDIR)/juce_audio_basics.posix64.a | |||
LIBS_POSIX64 += $(MODULEDIR)/juce_audio_processors.posix64.a | |||
LIBS_POSIX64 += $(MODULEDIR)/juce_data_structures.posix64.a | |||
@@ -309,6 +312,7 @@ LIBS_WIN32 += $(MODULEDIR)/rtmempool.win32.a | |||
LIBS_WIN32 += $(MODULEDIR)/water.win32.a | |||
ifeq ($(USING_JUCE),true) | |||
LIBS_WIN32 += $(MODULEDIR)/carla_juce.win32.a | |||
LIBS_WIN32 += $(MODULEDIR)/juce_audio_basics.win32.a | |||
LIBS_WIN32 += $(MODULEDIR)/juce_audio_processors.win32.a | |||
LIBS_WIN32 += $(MODULEDIR)/juce_data_structures.win32.a | |||
@@ -345,6 +349,7 @@ LIBS_WIN64 += $(MODULEDIR)/rtmempool.win64.a | |||
LIBS_WIN64 += $(MODULEDIR)/water.win64.a | |||
ifeq ($(USING_JUCE),true) | |||
LIBS_WIN64 += $(MODULEDIR)/carla_juce.win64.a | |||
LIBS_WIN64 += $(MODULEDIR)/juce_audio_basics.win64.a | |||
LIBS_WIN64 += $(MODULEDIR)/juce_audio_processors.win64.a | |||
LIBS_WIN64 += $(MODULEDIR)/juce_data_structures.win64.a | |||
@@ -33,6 +33,10 @@ | |||
#include "water/files/File.h" | |||
#ifdef USING_JUCE | |||
# include "carla_juce/carla_juce.h" | |||
#endif | |||
#define CARLA_SAFE_ASSERT_WITH_LAST_ERROR_RETURN(cond, msg, ret) \ | |||
if (! (cond)) { \ | |||
carla_stderr2("%s: " msg, __FUNCTION__); \ | |||
@@ -41,21 +45,6 @@ | |||
return ret; \ | |||
} | |||
// -------------------------------------------------------------------------------------------------------------------- | |||
#ifdef USING_JUCE | |||
static void carla_standalone_juce_init(void); | |||
static void carla_standalone_juce_idle(void); | |||
static void carla_standalone_juce_cleanup(void); | |||
# define carla_juce_init carla_standalone_juce_init | |||
# define carla_juce_idle carla_standalone_juce_idle | |||
# define carla_juce_cleanup carla_standalone_juce_cleanup | |||
# include "utils/JUCE.cpp" | |||
# undef carla_juce_init | |||
# undef carla_juce_idle | |||
# undef carla_juce_cleanup | |||
#endif | |||
// ------------------------------------------------------------------------------------------------------------------- | |||
// Always return a valid string ptr for standalone functions | |||
@@ -413,7 +402,7 @@ bool carla_engine_init(CarlaHostHandle handle, const char* driverName, const cha | |||
#endif | |||
#ifdef USING_JUCE | |||
carla_standalone_juce_init(); | |||
CarlaJUCE::initialiseJuce_GUI(); | |||
#endif | |||
CarlaHostStandalone& shandle((CarlaHostStandalone&)*handle); | |||
@@ -463,7 +452,7 @@ bool carla_engine_init(CarlaHostHandle handle, const char* driverName, const cha | |||
shandle.engine = nullptr; | |||
delete engine; | |||
#ifdef USING_JUCE | |||
carla_standalone_juce_cleanup(); | |||
CarlaJUCE::shutdownJuce_GUI(); | |||
#endif | |||
return false; | |||
} | |||
@@ -543,7 +532,7 @@ bool carla_engine_close(CarlaHostHandle handle) | |||
delete engine; | |||
#ifdef USING_JUCE | |||
carla_standalone_juce_cleanup(); | |||
CarlaJUCE::shutdownJuce_GUI(); | |||
#endif | |||
return closed; | |||
} | |||
@@ -556,7 +545,7 @@ void carla_engine_idle(CarlaHostHandle handle) | |||
#ifdef USING_JUCE | |||
if (handle->isStandalone) | |||
carla_standalone_juce_idle(); | |||
CarlaJUCE::idleJuce_GUI(); | |||
#endif | |||
} | |||
@@ -45,6 +45,7 @@ STANDALONE_LIBS += $(MODULEDIR)/hylia.a | |||
endif | |||
ifeq ($(USING_JUCE),true) | |||
STANDALONE_LIBS += $(MODULEDIR)/carla_juce.a | |||
STANDALONE_LIBS += $(MODULEDIR)/juce_audio_basics.a | |||
ifeq ($(USING_JUCE_AUDIO_DEVICES),true) | |||
STANDALONE_LIBS += $(MODULEDIR)/juce_audio_devices.a | |||
@@ -30,20 +30,7 @@ | |||
#include "jackey.h" | |||
#ifdef USING_JUCE | |||
# if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic push | |||
# pragma GCC diagnostic ignored "-Wconversion" | |||
# pragma GCC diagnostic ignored "-Weffc++" | |||
# pragma GCC diagnostic ignored "-Wsign-conversion" | |||
# pragma GCC diagnostic ignored "-Wundef" | |||
# endif | |||
# include "AppConfig.h" | |||
# include "juce_events/juce_events.h" | |||
# if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic pop | |||
# endif | |||
# include "carla_juce/carla_juce.h" | |||
#endif | |||
#ifdef __SSE2_MATH__ | |||
@@ -4631,7 +4618,7 @@ int jack_initialize(jack_client_t* const client, const char* const load_init) | |||
mode = ENGINE_PROCESS_MODE_MULTIPLE_CLIENTS; | |||
#ifdef USING_JUCE | |||
juce::initialiseJuce_GUI(); | |||
CarlaJUCE::initialiseJuce_GUI(); | |||
#endif | |||
CarlaEngineJack* const engine = new CarlaEngineJack(); | |||
@@ -4660,7 +4647,7 @@ int jack_initialize(jack_client_t* const client, const char* const load_init) | |||
delete engine; | |||
#ifdef USING_JUCE | |||
juce::shutdownJuce_GUI(); | |||
CarlaJUCE::shutdownJuce_GUI(); | |||
#endif | |||
return 1; | |||
} | |||
@@ -4679,7 +4666,7 @@ void jack_finish(void *arg) | |||
delete engine; | |||
#ifdef USING_JUCE | |||
juce::shutdownJuce_GUI(); | |||
CarlaJUCE::shutdownJuce_GUI(); | |||
#endif | |||
} | |||
@@ -36,28 +36,15 @@ | |||
#include "CarlaNative.hpp" | |||
#include "CarlaNativePlugin.h" | |||
#if defined(USING_JUCE) && ! (defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN)) | |||
# if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic push | |||
# pragma GCC diagnostic ignored "-Wconversion" | |||
# pragma GCC diagnostic ignored "-Weffc++" | |||
# pragma GCC diagnostic ignored "-Wsign-conversion" | |||
# pragma GCC diagnostic ignored "-Wundef" | |||
# pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" | |||
# endif | |||
# include "AppConfig.h" | |||
# include "juce_events/juce_events.h" | |||
# define USE_REFCOUNTER_JUCE_MESSAGE_MANAGER | |||
# if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic pop | |||
# endif | |||
#endif | |||
#include "water/files/File.h" | |||
#include "water/streams/MemoryOutputStream.h" | |||
#include "water/xml/XmlDocument.h" | |||
#include "water/xml/XmlElement.h" | |||
#ifdef USING_JUCE | |||
# include "carla_juce/carla_juce.h" | |||
#endif | |||
using water::File; | |||
using water::MemoryOutputStream; | |||
using water::String; | |||
@@ -74,42 +61,6 @@ static const uint16_t kUiHeight = 712; | |||
// ----------------------------------------------------------------------- | |||
#ifdef USE_REFCOUNTER_JUCE_MESSAGE_MANAGER | |||
static int numScopedInitInstances = 0; | |||
struct ReferenceCountedJuceMessageMessager | |||
{ | |||
ReferenceCountedJuceMessageMessager() | |||
{ | |||
CARLA_SAFE_ASSERT(numScopedInitInstances == 0); | |||
} | |||
~ReferenceCountedJuceMessageMessager() | |||
{ | |||
CARLA_SAFE_ASSERT(numScopedInitInstances == 0); | |||
} | |||
void incRef() | |||
{ | |||
if (numScopedInitInstances++ == 0) | |||
{ | |||
juce::initialiseJuce_GUI(); | |||
juce::MessageManager::getInstance()->setCurrentThreadAsMessageThread(); | |||
} | |||
} | |||
void decRef() | |||
{ | |||
if (--numScopedInitInstances == 0) | |||
{ | |||
juce::shutdownJuce_GUI(); | |||
} | |||
} | |||
}; | |||
#endif | |||
// ----------------------------------------------------------------------- | |||
class CarlaEngineNative; | |||
class CarlaEngineNativeUI : public CarlaExternalUI | |||
@@ -173,7 +124,7 @@ public: | |||
#ifdef USE_REFCOUNTER_JUCE_MESSAGE_MANAGER | |||
if (kNeedsJuceEvents) | |||
fJuceMsgMgr->incRef(); | |||
fJuceMsgMgr.incRef(); | |||
#endif | |||
pData->bufferSize = pHost->get_buffer_size(pHost->handle); | |||
@@ -246,7 +197,7 @@ public: | |||
#ifdef USE_REFCOUNTER_JUCE_MESSAGE_MANAGER | |||
if (kNeedsJuceEvents) | |||
fJuceMsgMgr->decRef(); | |||
fJuceMsgMgr.decRef(); | |||
#endif | |||
carla_debug("CarlaEngineNative::~CarlaEngineNative() - END"); | |||
@@ -1735,45 +1686,28 @@ private: | |||
#ifdef USE_REFCOUNTER_JUCE_MESSAGE_MANAGER | |||
const bool kNeedsJuceEvents; | |||
const juce::SharedResourcePointer<ReferenceCountedJuceMessageMessager> fJuceMsgMgr; | |||
const CarlaJUCE::ReferenceCountedJuceMessageMessager fJuceMsgMgr; | |||
CarlaMutex fJuceMsgMutex; | |||
struct ScopedJuceMessageThreadRunner { | |||
const CarlaMutexTryLocker cmtl; | |||
const bool wasLocked; | |||
juce::MessageManager* msgMgr; | |||
ScopedJuceMessageThreadRunner(CarlaEngineNative& self, const bool forceLock) noexcept | |||
: cmtl(self.fJuceMsgMutex, forceLock), | |||
wasLocked(cmtl.wasLocked()), | |||
msgMgr(nullptr) | |||
wasLocked(cmtl.wasLocked()) | |||
{ | |||
if (! self.kNeedsJuceEvents) | |||
return; | |||
if (! wasLocked) | |||
return; | |||
juce::MessageManager* const msgMgr2 = juce::MessageManager::getInstanceWithoutCreating(); | |||
CARLA_SAFE_ASSERT_RETURN(msgMgr2 != nullptr,); | |||
if (! msgMgr2->isThisTheMessageThread()) | |||
{ | |||
try { | |||
msgMgr2->setCurrentThreadAsMessageThread(); | |||
} CARLA_SAFE_EXCEPTION_RETURN("setCurrentThreadAsMessageThread",); | |||
} | |||
msgMgr = msgMgr2; | |||
CarlaJUCE::setMessageManagerForThisThread(); | |||
} | |||
~ScopedJuceMessageThreadRunner() | |||
{ | |||
if (msgMgr == nullptr) | |||
return; | |||
const juce::MessageManagerLock mml; | |||
for (; msgMgr->dispatchNextMessageOnSystemQueue(true);) {} | |||
CarlaJUCE::dispatchMessageManagerMessages(); | |||
} | |||
CARLA_DECLARE_NON_COPY_STRUCT(ScopedJuceMessageThreadRunner) | |||
@@ -108,6 +108,11 @@ $(OBJDIR)/CarlaEngineJack.cpp.o: CarlaEngineJack.cpp | |||
$(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(JACK_FLAGS) -c -o $@ | |||
endif | |||
$(OBJDIR)/CarlaEngineJuce.cpp.o: CarlaEngineJuce.cpp | |||
-@mkdir -p $(OBJDIR) | |||
@echo "Compiling $<" | |||
$(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -std=gnu++14 -c -o $@ | |||
$(OBJDIR)/%.cpp.o: %.cpp | |||
-@mkdir -p $(OBJDIR) | |||
@echo "Compiling $<" | |||
@@ -27,26 +27,18 @@ | |||
#include "CarlaVst2Utils.hpp" | |||
#include "CarlaVst3Utils.hpp" | |||
#if defined(__clang__) | |||
# pragma clang diagnostic push | |||
# pragma clang diagnostic ignored "-Wfloat-equal" | |||
# pragma clang diagnostic ignored "-Wimplicit-int-float-conversion" | |||
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic push | |||
# pragma GCC diagnostic ignored "-Wconversion" | |||
# pragma GCC diagnostic ignored "-Wdouble-promotion" | |||
# pragma GCC diagnostic ignored "-Weffc++" | |||
# pragma GCC diagnostic ignored "-Wfloat-equal" | |||
#endif | |||
#define JUCE_GUI_BASICS_INCLUDE_XHEADERS 1 | |||
#include "AppConfig.h" | |||
#include "carla_juce/carla_juce.h" | |||
#pragma GCC diagnostic push | |||
#pragma GCC diagnostic ignored "-Wdouble-promotion" | |||
#pragma GCC diagnostic ignored "-Wduplicated-branches" | |||
#pragma GCC diagnostic ignored "-Weffc++" | |||
#pragma GCC diagnostic ignored "-Wfloat-equal" | |||
#include "juce_audio_processors/juce_audio_processors.h" | |||
#include "juce_gui_basics/juce_gui_basics.h" | |||
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic pop | |||
#endif | |||
#pragma GCC diagnostic pop | |||
#include "JucePluginWindow.hpp" | |||
@@ -114,7 +106,8 @@ public: | |||
fPosInfo(), | |||
fChunk(), | |||
fFormatName(), | |||
fWindow() | |||
fWindow(), | |||
fNeedsUpdate(false) | |||
{ | |||
carla_debug("CarlaPluginJuce::CarlaPluginJuce(%p, %i)", engine, id); | |||
@@ -167,7 +160,17 @@ public: | |||
int64_t getUniqueId() const noexcept override | |||
{ | |||
return fDesc.uid; | |||
return fDesc.uniqueId; | |||
} | |||
uint32_t getLatencyInFrames() const noexcept override | |||
{ | |||
CARLA_SAFE_ASSERT_RETURN(fInstance != nullptr, 0); | |||
const int latency = fInstance->getLatencySamples(); | |||
CARLA_SAFE_ASSERT_RETURN(latency >= 0, 0); | |||
return static_cast<uint32_t>(latency); | |||
} | |||
// ------------------------------------------------------------------- | |||
@@ -500,9 +503,9 @@ public: | |||
? (AEffect*)fInstance->getPlatformSpecificData() | |||
: nullptr; | |||
v3_plugin_view** const vst3view = fDesc.pluginFormatName == "VST3" | |||
v3_plugin_view** const vst3view = /*fDesc.pluginFormatName == "VST3" | |||
? (v3_plugin_view**)editor->getPlatformSpecificData() | |||
: nullptr; | |||
:*/ nullptr; | |||
fWindow = new JucePluginWindow(opts.frontendWinId, opts.pluginsAreStandalone, | |||
vst2effect, vst3view); | |||
@@ -871,10 +874,8 @@ public: | |||
if (mOuts > 0) | |||
pData->extraHints |= PLUGIN_EXTRA_HINT_HAS_MIDI_OUT; | |||
fInstance->setPlayConfigDetails(static_cast<int>(aIns), | |||
static_cast<int>(aOuts), | |||
pData->engine->getSampleRate(), | |||
static_cast<int>(pData->engine->getBufferSize())); | |||
fInstance->setRateAndBufferSizeDetails(pData->engine->getSampleRate(), | |||
static_cast<int>(pData->engine->getBufferSize())); | |||
bufferSizeChanged(pData->engine->getBufferSize()); | |||
reloadPrograms(true); | |||
@@ -1488,6 +1489,20 @@ public: | |||
} | |||
} | |||
// ------------------------------------------------------------------- | |||
// Misc | |||
void idle() override | |||
{ | |||
if (fNeedsUpdate) | |||
{ | |||
fNeedsUpdate = false; | |||
pData->engine->callback(true, true, ENGINE_CALLBACK_UPDATE, pData->id, 0, 0, 0, 0.0f, nullptr); | |||
} | |||
CarlaPlugin::idle(); | |||
} | |||
// ------------------------------------------------------------------- | |||
// Plugin buffers | |||
@@ -1518,9 +1533,10 @@ protected: | |||
CarlaPlugin::setParameterValue(static_cast<uint32_t>(index), fixedValue, false, true, true); | |||
} | |||
void audioProcessorChanged(juce::AudioProcessor*) override | |||
void audioProcessorChanged(juce::AudioProcessor*, const ChangeDetails& details) override | |||
{ | |||
pData->engine->callback(true, true, ENGINE_CALLBACK_UPDATE, pData->id, 0, 0, 0, 0.0f, nullptr); | |||
if (details.parameterInfoChanged || details.programChanged) | |||
fNeedsUpdate = true; | |||
} | |||
void audioProcessorParameterChangeGestureBegin(juce::AudioProcessor*, int index) override | |||
@@ -1669,7 +1685,7 @@ public: | |||
} | |||
if (uniqueId != 0) | |||
fDesc.uid = static_cast<int>(uniqueId); | |||
fDesc.uniqueId = static_cast<int>(uniqueId); | |||
juce::String error; | |||
@@ -1769,6 +1785,8 @@ private: | |||
CarlaScopedPointer<JucePluginWindow> fWindow; | |||
bool fNeedsUpdate; | |||
bool isJuceSaveFormat(const void* const data, const std::size_t dataSize) | |||
{ | |||
if (fFormatName != "VST2") | |||
@@ -75,7 +75,12 @@ $(OBJDIR)/CarlaPluginVST2.cpp.o: CarlaPluginVST2.cpp | |||
$(OBJDIR)/CarlaPluginJuce.cpp.o: CarlaPluginJuce.cpp | |||
-@mkdir -p $(OBJDIR) | |||
@echo "Compiling $<" | |||
$(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -ObjC++ -c -o $@ | |||
$(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -ObjC++ -std=gnu++14 -c -o $@ | |||
else | |||
$(OBJDIR)/CarlaPluginJuce.cpp.o: CarlaPluginJuce.cpp | |||
-@mkdir -p $(OBJDIR) | |||
@echo "Compiling $<" | |||
$(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) -std=gnu++14 -c -o $@ | |||
endif | |||
$(OBJDIR)/%.cpp.o: %.cpp | |||
@@ -32,8 +32,7 @@ | |||
#endif | |||
#ifdef USING_JUCE | |||
# include "AppConfig.h" | |||
# include "juce_core/juce_core.h" | |||
# include "carla_juce/carla_juce.h" | |||
#endif | |||
#ifdef USING_RTAUDIO | |||
@@ -127,7 +126,7 @@ const char* carla_get_juce_version() | |||
#ifdef USING_JUCE | |||
if (retVersion.isEmpty()) | |||
{ | |||
if (const char* const version = juce::SystemStats::getJUCEVersion().toRawUTF8()) | |||
if (const char* const version = CarlaJUCE::getVersion()) | |||
retVersion = version+6; | |||
else | |||
retVersion = "Unknown"; | |||
@@ -1,6 +1,6 @@ | |||
/* | |||
* Carla Plugin Host | |||
* Copyright (C) 2011-2020 Filipe Coelho <falktx@falktx.com> | |||
* Copyright (C) 2011-2022 Filipe Coelho <falktx@falktx.com> | |||
* | |||
* This program is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU General Public License as | |||
@@ -16,62 +16,32 @@ | |||
*/ | |||
#include "CarlaUtils.h" | |||
#include "CarlaUtils.hpp" | |||
#ifdef USING_JUCE | |||
// ------------------------------------------------------------------------------------------------------------------- | |||
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic push | |||
# pragma GCC diagnostic ignored "-Wconversion" | |||
# pragma GCC diagnostic ignored "-Weffc++" | |||
# pragma GCC diagnostic ignored "-Wsign-conversion" | |||
# pragma GCC diagnostic ignored "-Wundef" | |||
#endif | |||
#include "AppConfig.h" | |||
#include "juce_events/juce_events.h" | |||
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic pop | |||
# include "carla_juce/carla_juce.h" | |||
#endif | |||
// ------------------------------------------------------------------------------------------------------------------- | |||
void carla_juce_init() | |||
{ | |||
juce::initialiseJuce_GUI(); | |||
#if !(defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN)) | |||
juce::MessageManager::getInstance()->setCurrentThreadAsMessageThread(); | |||
#ifdef USING_JUCE | |||
CarlaJUCE::initialiseJuce_GUI(); | |||
#endif | |||
} | |||
void carla_juce_idle() | |||
{ | |||
#if !(defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN)) | |||
const juce::MessageManager* const msgMgr(juce::MessageManager::getInstanceWithoutCreating()); | |||
CARLA_SAFE_ASSERT_RETURN(msgMgr != nullptr,); | |||
for (; msgMgr->dispatchNextMessageOnSystemQueue(true);) {} | |||
#ifdef USING_JUCE | |||
CarlaJUCE::idleJuce_GUI(); | |||
#endif | |||
} | |||
void carla_juce_cleanup() | |||
{ | |||
juce::shutdownJuce_GUI(); | |||
#ifdef USING_JUCE | |||
CarlaJUCE::shutdownJuce_GUI(); | |||
#endif | |||
} | |||
// ------------------------------------------------------------------------------------------------------------------- | |||
#else // USING_JUCE | |||
// ------------------------------------------------------------------------------------------------------------------- | |||
void carla_juce_init() {} | |||
void carla_juce_idle() {} | |||
void carla_juce_cleanup() {} | |||
// ------------------------------------------------------------------------------------------------------------------- | |||
#endif // USING_JUCE |
@@ -29,6 +29,7 @@ LIBS = $(MODULEDIR)/lilv.a | |||
LIBS += $(MODULEDIR)/water.files.a | |||
ifeq ($(USING_JUCE),true) | |||
LIBS += $(MODULEDIR)/carla_juce.a | |||
LIBS += $(MODULEDIR)/juce_audio_basics.a | |||
LIBS += $(MODULEDIR)/juce_audio_processors.a | |||
LIBS += $(MODULEDIR)/juce_core.a | |||
@@ -51,30 +51,15 @@ | |||
#endif | |||
#ifdef USING_JUCE | |||
# if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic push | |||
# pragma GCC diagnostic ignored "-Wconversion" | |||
# pragma GCC diagnostic ignored "-Weffc++" | |||
# pragma GCC diagnostic ignored "-Wsign-conversion" | |||
# pragma GCC diagnostic ignored "-Wundef" | |||
# pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" | |||
# endif | |||
# include "AppConfig.h" | |||
# if defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN) | |||
# include "juce_gui_basics/juce_gui_basics.h" | |||
# else | |||
# include "juce_events/juce_events.h" | |||
# endif | |||
# if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic pop | |||
# endif | |||
# include "carla_juce/carla_juce.h" | |||
#endif | |||
#include "jackbridge/JackBridge.hpp" | |||
#include "water/files/File.h" | |||
#include "water/misc/Time.h" | |||
// must be last | |||
#include "jackbridge/JackBridge.hpp" | |||
using CARLA_BACKEND_NAMESPACE::CarlaEngine; | |||
using CARLA_BACKEND_NAMESPACE::EngineCallbackOpcode; | |||
using CARLA_BACKEND_NAMESPACE::EngineCallbackOpcode2Str; | |||
@@ -153,52 +138,6 @@ static void gIdle() | |||
} | |||
} | |||
// ------------------------------------------------------------------------- | |||
#if defined(USING_JUCE) && (defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN)) | |||
class CarlaJuceApp : public juce::JUCEApplication, | |||
private juce::Timer | |||
{ | |||
public: | |||
CarlaJuceApp() {} | |||
~CarlaJuceApp() {} | |||
void initialise(const juce::String&) override | |||
{ | |||
startTimer(8); | |||
} | |||
void shutdown() override | |||
{ | |||
gCloseNow = true; | |||
stopTimer(); | |||
} | |||
const juce::String getApplicationName() override | |||
{ | |||
return "CarlaPlugin"; | |||
} | |||
const juce::String getApplicationVersion() override | |||
{ | |||
return CARLA_VERSION_STRING; | |||
} | |||
void timerCallback() override | |||
{ | |||
gIdle(); | |||
if (gCloseNow) | |||
{ | |||
quit(); | |||
gCloseNow = false; | |||
} | |||
} | |||
}; | |||
static juce::JUCEApplicationBase* juce_CreateApplication() { return new CarlaJuceApp(); } | |||
#endif | |||
// ------------------------------------------------------------------------- | |||
class CarlaBridgePlugin | |||
@@ -290,12 +229,7 @@ public: | |||
gIsInitiated = true; | |||
#if defined(USING_JUCE) && (defined(CARLA_OS_MAC) || defined(CARLA_OS_WIN)) | |||
# ifndef CARLA_OS_WIN | |||
static const int argc = 0; | |||
static const char* argv[] = {}; | |||
# endif | |||
juce::JUCEApplicationBase::createInstance = &juce_CreateApplication; | |||
juce::JUCEApplicationBase::main(JUCE_MAIN_FUNCTION_ARGS); | |||
CarlaJUCE::setupAndUseMainApplication(); | |||
#else | |||
int64_t timeToEnd = 0; | |||
@@ -353,7 +287,7 @@ private: | |||
CarlaEngine* fEngine; | |||
#ifdef USING_JUCE | |||
const juce::ScopedJuceInitialiser_GUI fJuceInitialiser; | |||
const CarlaJUCE::ScopedJuceInitialiser_GUI fJuceInitialiser; | |||
#endif | |||
bool fUsingBridge; | |||
@@ -27,26 +27,12 @@ | |||
#include "CarlaLv2Utils.hpp" | |||
#include "CarlaUtils.h" | |||
#include "water/files/File.h" | |||
#ifdef USING_JUCE | |||
# if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic push | |||
# pragma GCC diagnostic ignored "-Wconversion" | |||
# pragma GCC diagnostic ignored "-Weffc++" | |||
# pragma GCC diagnostic ignored "-Wsign-conversion" | |||
# pragma GCC diagnostic ignored "-Wundef" | |||
# pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" | |||
# endif | |||
# include "AppConfig.h" | |||
# include "juce_events/juce_events.h" | |||
# if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic pop | |||
# endif | |||
# include "carla_juce/carla_juce.h" | |||
#endif | |||
#include "water/files/File.h" | |||
template<> | |||
void Lv2PluginBaseClass<CARLA_BACKEND_NAMESPACE::EngineTimeInfo>::clearTimeData() noexcept | |||
{ | |||
@@ -500,7 +486,7 @@ private: | |||
CarlaPluginPtr fPlugin; | |||
#ifdef USING_JUCE | |||
juce::SharedResourcePointer<juce::ScopedJuceInitialiser_GUI> fJuceInitialiser; | |||
CarlaJUCE::ScopedJuceInitialiser_GUI fJuceInitialiser; | |||
#endif | |||
void updateParameterOutputs() noexcept | |||
@@ -78,6 +78,12 @@ LIBS_win64 += $(MODULEDIR)/water.win64.a | |||
LINK_FLAGS += $(WATER_LIBS) | |||
ifeq ($(USING_JUCE),true) | |||
LIBS_native += $(MODULEDIR)/carla_juce.a | |||
LIBS_posix32 += $(MODULEDIR)/carla_juce.posix32.a | |||
LIBS_posix64 += $(MODULEDIR)/carla_juce.posix64.a | |||
LIBS_win32 += $(MODULEDIR)/carla_juce.win32.a | |||
LIBS_win64 += $(MODULEDIR)/carla_juce.win64.a | |||
LIBS_native += $(MODULEDIR)/juce_audio_basics.a | |||
LIBS_posix32 += $(MODULEDIR)/juce_audio_basics.posix32.a | |||
LIBS_posix64 += $(MODULEDIR)/juce_audio_basics.posix64.a | |||
@@ -303,7 +309,7 @@ $(OBJDIR)/CarlaPluginVST2.cpp.o: $(CWD)/backend/plugin/CarlaPluginVST2.cpp | |||
$(OBJDIR)/CarlaPluginJuce.cpp.o: $(CWD)/backend/plugin/CarlaPluginJuce.cpp | |||
-@mkdir -p $(OBJDIR) | |||
@echo "Compiling CarlaPluginJuce.cpp (bridge)" | |||
$(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(NATIVE_BUILD_FLAGS) -ObjC++ -c -o $@ | |||
$(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(NATIVE_BUILD_FLAGS) -ObjC++ -std=gnu++14 -c -o $@ | |||
$(OBJDIR)/CarlaStandalone.cpp.o: $(CWD)/backend/CarlaStandalone.cpp | |||
-@mkdir -p $(OBJDIR) | |||
@@ -315,6 +321,11 @@ $(OBJDIR)/CarlaBridgePlugin.cpp.o: CarlaBridgePlugin.cpp | |||
@echo "Compiling $<" | |||
$(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(NATIVE_BUILD_FLAGS) -ObjC++ -c -o $@ | |||
else | |||
$(OBJDIR)/CarlaPluginJuce.cpp.o: $(CWD)/backend/plugin/CarlaPluginJuce.cpp | |||
-@mkdir -p $(OBJDIR) | |||
@echo "Compiling CarlaPluginJuce.cpp (bridge)" | |||
$(SILENT)$(CXX) $< $(BUILD_CXX_FLAGS) $(NATIVE_BUILD_FLAGS) -std=gnu++14 -c -o $@ | |||
$(OBJDIR)/CarlaStandalone.cpp.o: $(CWD)/backend/CarlaStandalone.cpp | |||
-@mkdir -p $(OBJDIR) | |||
@echo "Compiling CarlaStandalone.cpp (bridge)" | |||
@@ -45,6 +45,10 @@ ifeq ($(WIN32),true) | |||
LINK_FLAGS += -lole32 -lssp -mwindows | |||
endif | |||
ifeq ($(USING_JUCE),true) | |||
BUILD_CXX_FLAGS += -std=gnu++14 | |||
endif | |||
32BIT_FLAGS += -DBUILD_BRIDGE -DBUILD_BRIDGE_ALTERNATIVE_ARCH | |||
64BIT_FLAGS += -DBUILD_BRIDGE -DBUILD_BRIDGE_ALTERNATIVE_ARCH | |||
ARM32_FLAGS += -DBUILD_BRIDGE -DBUILD_BRIDGE_ALTERNATIVE_ARCH | |||
@@ -79,6 +83,12 @@ LINK_FLAGS += $(WATER_LIBS) | |||
LINK_FLAGS += $(LIBDL_LIBS) | |||
ifeq ($(USING_JUCE),true) | |||
LIBS_native += $(MODULEDIR)/carla_juce.a | |||
LIBS_posix32 += $(MODULEDIR)/carla_juce.posix32.a | |||
LIBS_posix64 += $(MODULEDIR)/carla_juce.posix64.a | |||
LIBS_win32 += $(MODULEDIR)/carla_juce.win32.a | |||
LIBS_win64 += $(MODULEDIR)/carla_juce.win64.a | |||
LIBS_native += $(MODULEDIR)/juce_audio_basics.a | |||
LIBS_posix32 += $(MODULEDIR)/juce_audio_basics.posix32.a | |||
LIBS_posix64 += $(MODULEDIR)/juce_audio_basics.posix64.a | |||
@@ -173,37 +183,37 @@ win64: $(BINDIR)/$(MODULENAME)-win64.exe | |||
$(BINDIR)/$(MODULENAME)-native: $(OBJS_native) $(LIBS_native) | |||
-@mkdir -p $(BINDIR) | |||
@echo "Linking $(MODULENAME)-native" | |||
$(SILENT)$(CXX) $< $(LIBS_START) $(LIBS_native) $(LIBS_END) $(LINK_FLAGS) $(NATIVE_LINK_FLAGS) -o $@ | |||
$(SILENT)$(CXX) $(OBJS_native) $(LIBS_START) $(LIBS_native) $(LIBS_END) $(LINK_FLAGS) $(NATIVE_LINK_FLAGS) -o $@ | |||
$(BINDIR)/$(MODULENAME)-native.exe: $(OBJS_native) $(LIBS_native) | |||
-@mkdir -p $(BINDIR) | |||
@echo "Linking $(MODULENAME)-native.exe" | |||
$(SILENT)$(CXX) $< $(LIBS_START) $(LIBS_native) $(LIBS_END) $(LINK_FLAGS) $(NATIVE_LINK_FLAGS) -o $@ | |||
$(SILENT)$(CXX)$(OBJS_native)$(LIBS_START) $(LIBS_native) $(LIBS_END) $(LINK_FLAGS) $(NATIVE_LINK_FLAGS) -o $@ | |||
$(BINDIR)/$(MODULENAME)-arm32: $(OBJS_arm32) $(LIBS_arm32) | |||
-@mkdir -p $(BINDIR) | |||
@echo "Linking $(MODULENAME)-posix32" | |||
$(SILENT)$(CXX) $< $(LIBS_START) $(LIBS_arm32) $(LIBS_END) $(LINK_FLAGS) $(ARM32_FLAGS) -o $@ | |||
$(SILENT)$(CXX) $(OBJS_arm32) $(LIBS_START) $(LIBS_arm32) $(LIBS_END) $(LINK_FLAGS) $(ARM32_FLAGS) -o $@ | |||
$(BINDIR)/$(MODULENAME)-posix32: $(OBJS_posix32) $(LIBS_posix32) | |||
-@mkdir -p $(BINDIR) | |||
@echo "Linking $(MODULENAME)-posix32" | |||
$(SILENT)$(CXX) $< $(LIBS_START) $(LIBS_posix32) $(LIBS_END) $(LINK_FLAGS) $(32BIT_FLAGS) -o $@ | |||
$(SILENT)$(CXX) $(OBJS_posix32) $(LIBS_START) $(LIBS_posix32) $(LIBS_END) $(LINK_FLAGS) $(32BIT_FLAGS) -o $@ | |||
$(BINDIR)/$(MODULENAME)-posix64: $(OBJS_posix64) $(LIBS_posix64) | |||
-@mkdir -p $(BINDIR) | |||
@echo "Linking $(MODULENAME)-posix64" | |||
$(SILENT)$(CXX) $< $(LIBS_START) $(LIBS_posix64) $(LIBS_END) $(LINK_FLAGS) $(64BIT_FLAGS) -o $@ | |||
$(SILENT)$(CXX) $(OBJS_posix64) $(LIBS_START) $(LIBS_posix64) $(LIBS_END) $(LINK_FLAGS) $(64BIT_FLAGS) -o $@ | |||
$(BINDIR)/$(MODULENAME)-win32.exe: $(OBJS_win32) $(LIBS_win32) | |||
-@mkdir -p $(BINDIR) | |||
@echo "Linking $(MODULENAME)-win32.exe" | |||
$(SILENT)$(CXX) $< $(LIBS_START) $(LIBS_win32) $(LIBS_END) $(LINK_FLAGS) $(32BIT_FLAGS) -o $@ | |||
$(SILENT)$(CXX) $(OBJS_win32) $(LIBS_START) $(LIBS_win32) $(LIBS_END) $(LINK_FLAGS) $(32BIT_FLAGS) -o $@ | |||
$(BINDIR)/$(MODULENAME)-win64.exe: $(OBJS_win64) $(LIBS_win64) | |||
-@mkdir -p $(BINDIR) | |||
@echo "Linking $(MODULENAME)-win64.exe" | |||
$(SILENT)$(CXX) $< $(LIBS_START) $(LIBS_win64) $(LIBS_END) $(LINK_FLAGS) $(64BIT_FLAGS) -o $@ | |||
$(SILENT)$(CXX) $(OBJS_win64) $(LIBS_START) $(LIBS_win64) $(LIBS_END) $(LINK_FLAGS) $(64BIT_FLAGS) -o $@ | |||
# --------------------------------------------------------------------------------------------------------------------- | |||
@@ -21,39 +21,11 @@ | |||
#include "CarlaMIDI.h" | |||
#include "LinkedList.hpp" | |||
#ifdef BUILD_BRIDGE | |||
# undef HAVE_FLUIDSYNTH | |||
#endif | |||
#ifdef USING_JUCE | |||
# if defined(__clang__) | |||
# pragma clang diagnostic push | |||
# pragma clang diagnostic ignored "-Wfloat-equal" | |||
# pragma clang diagnostic ignored "-Wimplicit-int-float-conversion" | |||
# elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic push | |||
# pragma GCC diagnostic ignored "-Wconversion" | |||
# pragma GCC diagnostic ignored "-Wdouble-promotion" | |||
# pragma GCC diagnostic ignored "-Weffc++" | |||
# pragma GCC diagnostic ignored "-Wfloat-equal" | |||
# endif | |||
# include "../backend/utils/JUCE.cpp" | |||
# include "AppConfig.h" | |||
# include "juce_audio_processors/juce_audio_processors.h" | |||
# if JUCE_PLUGINHOST_VST | |||
# define USING_JUCE_FOR_VST2 | |||
# endif | |||
# if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) | |||
# pragma GCC diagnostic pop | |||
# endif | |||
#endif | |||
#include "CarlaLadspaUtils.hpp" | |||
#include "CarlaDssiUtils.hpp" | |||
#include "CarlaLv2Utils.hpp" | |||
#ifndef USING_JUCE_FOR_VST2 | |||
# include "CarlaVst2Utils.hpp" | |||
#endif | |||
#include "CarlaVst2Utils.hpp" | |||
#include "CarlaVst3Utils.hpp" | |||
#ifdef CARLA_OS_MAC | |||
# define Component CocoaComponent | |||
@@ -75,6 +47,10 @@ | |||
# include <objbase.h> | |||
#endif | |||
#ifdef BUILD_BRIDGE | |||
# undef HAVE_FLUIDSYNTH | |||
#endif | |||
#ifdef HAVE_FLUIDSYNTH | |||
# include <fluidsynth.h> | |||
#endif | |||
@@ -87,8 +63,19 @@ | |||
# include "water/text/StringArray.h" | |||
# include "CarlaDssiUtils.cpp" | |||
# include "../backend/utils/CachedPlugins.cpp" | |||
#else | |||
# include "CarlaDssiUtils.hpp" | |||
#endif | |||
#ifdef USING_JUCE | |||
# include "carla_juce/carla_juce.h" | |||
# pragma GCC diagnostic ignored "-Wdouble-promotion" | |||
# pragma GCC diagnostic ignored "-Wduplicated-branches" | |||
# pragma GCC diagnostic ignored "-Weffc++" | |||
# pragma GCC diagnostic ignored "-Wfloat-equal" | |||
# include "juce_audio_processors/juce_audio_processors.h" | |||
# if JUCE_PLUGINHOST_VST | |||
# define USING_JUCE_FOR_VST2 | |||
# endif | |||
# pragma GCC diagnostic pop | |||
#endif | |||
#define DISCOVERY_OUT(x, y) std::cout << "\ncarla-discovery::" << x << "::" << y << std::endl; | |||
@@ -170,7 +157,7 @@ static void do_cached_check(const PluginType type) | |||
# ifdef USING_JUCE | |||
if (type == PLUGIN_AU) | |||
carla_juce_init(); | |||
CarlaJUCE::initialiseJuce_GUI(); | |||
# endif | |||
const uint count = carla_get_cached_plugin_count(type, plugPath); | |||
@@ -185,7 +172,7 @@ static void do_cached_check(const PluginType type) | |||
# ifdef USING_JUCE | |||
if (type == PLUGIN_AU) | |||
carla_juce_cleanup(); | |||
CarlaJUCE::shutdownJuce_GUI(); | |||
# endif | |||
} | |||
#endif | |||
@@ -1420,7 +1407,7 @@ static bool do_juce_check(const char* const filename_, const char* const stype, | |||
CARLA_SAFE_ASSERT_RETURN(stype != nullptr && stype[0] != 0, false) // FIXME | |||
carla_debug("do_juce_check(%s, %s, %s)", filename_, stype, bool2str(doInit)); | |||
carla_juce_init(); | |||
CarlaJUCE::initialiseJuce_GUI(); | |||
juce::String filename; | |||
@@ -1512,7 +1499,7 @@ static bool do_juce_check(const char* const filename_, const char* const stype, | |||
if (std::unique_ptr<juce::AudioPluginInstance> instance | |||
= pluginFormat->createInstanceFromDescription(*desc, kSampleRate, kBufferSize)) | |||
{ | |||
carla_juce_idle(); | |||
CarlaJUCE::idleJuce_GUI(); | |||
findMaxTotalChannels(instance.get(), audioIns, audioOuts); | |||
instance->refreshParameterList(); | |||
@@ -1535,7 +1522,7 @@ static bool do_juce_check(const char* const filename_, const char* const stype, | |||
DISCOVERY_OUT("name", desc->descriptiveName); | |||
DISCOVERY_OUT("label", desc->name); | |||
DISCOVERY_OUT("maker", desc->manufacturerName); | |||
DISCOVERY_OUT("uniqueId", desc->uid); | |||
DISCOVERY_OUT("uniqueId", desc->uniqueId); | |||
DISCOVERY_OUT("audio.ins", audioIns); | |||
DISCOVERY_OUT("audio.outs", audioOuts); | |||
DISCOVERY_OUT("midi.ins", midiIns); | |||
@@ -1544,8 +1531,8 @@ static bool do_juce_check(const char* const filename_, const char* const stype, | |||
DISCOVERY_OUT("end", "------------"); | |||
} | |||
carla_juce_idle(); | |||
carla_juce_cleanup(); | |||
CarlaJUCE::idleJuce_GUI(); | |||
CarlaJUCE::shutdownJuce_GUI(); | |||
return false; | |||
} | |||
#endif // USING_JUCE_FOR_VST2 | |||
@@ -0,0 +1,6 @@ | |||
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,6 +1,6 @@ | |||
//----------------------------------------------------------------------------- | |||
// LICENSE | |||
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved | |||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved | |||
//----------------------------------------------------------------------------- | |||
This license applies only to files referencing this license, | |||
for other files of the Software Development Kit the respective embedded license text | |||
@@ -1,253 +1,10 @@ | |||
# Welcome to VST SDK 3.6.x | |||
# Welcome to VST 3 SDK Interfaces | |||
## Table Of Contents | |||
1. [The VST SDK package](#100) | |||
1. [System requirements](#200) | |||
1. [About VST Plug-ins in general](#300) | |||
1. [About VST 3](#400) | |||
1. [How to build VST 3](#500) | |||
1. [Contributing](#600) | |||
1. [License & Usage guidelines](#700) | |||
<div id='100'/> | |||
## The VST SDK package contains | |||
- The VST 3 API | |||
- VST 3 Implementation Helper Classes | |||
- AAX, AU and VST 2 wrappers | |||
- VST 3 Plug-ins Examples | |||
The full VST 3 SDK is available [here!](https://www.steinberg.net/en/company/developers.html). It contains : | |||
- a VST 3 Plug-in Test Host Application/Validator, | |||
- the **Steinberg VST 3 Plug-In SDK Licensing Agreement** that you have to sign if you want to develop or host VST 3 Plug-Ins. | |||
<div id='200'/> | |||
## System requirements | |||
Supported OS: | |||
- Microsoft Windows 7-10 | |||
- Apple OSX 10.9-10.13 | |||
- Apple iOS 8-9 | |||
- Linux (Beta version) | |||
Supported IDE: | |||
- Visual Studio 2015/2017/2019 | |||
- minimum Xcode 7 | |||
- Qt Creator | |||
--- | |||
<div id='300'/> | |||
## About VST Plug-ins in general | |||
A VST Plug-in is an audio processing component that is utilized within a host application. This host application provides the audio or/and event streams that are processed by the Plug-in's code. Generally speaking, a VST Plug-in can take a stream of audio data, apply a process to the audio, and return the result to the host application. A VST Plug-in performs its process normally using the processor of the computer. The audio stream is broken down into a series of blocks. The host supplies the blocks in sequence. The host and its current environment control the block-size. The VST Plug-in maintains the status of all its own parameters relating to the running process: The host does not maintain any information about what the Plug-in did with the last block of data it processed. | |||
From the host application's point of view, a VST Plug-in is a black box with an arbitrary number of inputs, outputs (Event (MIDI) or Audio), and associated parameters. The host needs no implicit knowledge of the Plug-in's process to be able to use it. The Plug-in process can use whatever parameters it wishes, internally to the process, but depending on the capabilities of the host, it can allow the changes to user parameters to be automated by the host. | |||
The source code of a VST Plug-in is platform independent, but the delivery system depends on the platform architecture: | |||
- On **Windows**, a VST Plug-in is a multi-threaded DLL (Dynamic Link Library), recently packaged into a folder structur. | |||
- On **Mac OS X**, a VST Plug-in is a Mach-O Bundle | |||
- On **Linux**, a VST Plug-in is a package | |||
To learn more about VST you can subscribe to the [VST Developer Forum](https://sdk.steinberg.net) - check the 3rd Party Developer Support section at [www.steinberg.net](http://www.steinberg.net). | |||
--- | |||
<div id='400'/> | |||
## About VST 3 | |||
VST 3 is a general rework of the long-serving VST Plug-in interface. It is not compatible with the older VST versions, but it includes some new features and possibilities. We have redesigned the API to make it not only far easier and more reliable for developers to work with, but have also provided completely new possibilities for Plug-ins. These include: | |||
### 1. Improved Performance with the Silence Flag | |||
Processing can optionally be applied to Plug-ins only when audio signals are present on their respective inputs, so VST 3 Plug-ins can apply their processing economically and only when it is needed. | |||
### 2. Multiple Dynamic I/Os | |||
VST 3 Plug-ins are no longer limited to a fixed number of inputs and outputs, and their I/O configuration can dynamically adapt to the channel configuration. Side-chains are also very easily realizable. This includes the possibility to deactivate unused buses after loading and even reactivate those when needed. This cleans up the mixer and further helps to reduce CPU load. | |||
### 3. Sample-accurate Automation | |||
VST 3 also features vastly improved parameter automation with sample accuracy and support for ramped automation data, allowing completely accurate and rapid parameter automation changes. | |||
### 4. Logical Parameter Organization | |||
The VST 3 Plug-in parameters are displayed in a tree structure. Parameters are grouped into sections which represent the structure of the Plug-in. Plug-ins can communicate their internal structure for the purpose of overview, but also for some associated functionality (eg. program-lists). | |||
### 5. Resizeable UI Editor | |||
VST 3 defines a way to allow resizing of the Plug-in editor by a user. | |||
### 6. Mouse Over Support | |||
The Host could ask the Plug-in which parameter is under the mouse. | |||
### 7. Context Menu Support | |||
VST 3 defines a way to allow the host to add its own entries in the Plug-in context menu of a specific parameter. | |||
### 8. Channel Context Information | |||
A VST 3 Plug-in could access some channel information where it is instantiated: name, color,... | |||
### 9. Note Expression | |||
VST 3 defines with Note Expression a new way of event controller editing. The Plug-in is able to break free from the limitations of MIDI controller events by providing access to new VST 3 controller events that circumvent the laws of MIDI and provide articulation information for each individual note (event) in a polyphonic arrangement according to its noteId. | |||
### 10. 3D Support | |||
VST 3 supports new speaker configurations like Ambisonic, Atmos, Auro 3D or 22.2. | |||
### 11. Factory Concept | |||
VST 3 Plug-in library could export multiple Plug-ins and in this way replaces the shell concept of VST 2 (kPlugCategShell). | |||
### 12. Support Remote control Representation | |||
VST 3 Plug-in can deliver a specific parameter mapping for remote controls like Nuage. | |||
### 13. Others | |||
While designing VST 3, we performed a careful analysis of the existing functionality of VST and rewrote the interfaces from scratch. In doing so, we focused a lot on providing clear interfaces and their documentation in order to avoid usage errors from the deepest possible layer. | |||
Some more features implemented specifically for developers include: | |||
- More stable technical Host/Plug-in environment | |||
- Advanced technical definition of the standard | |||
- Modular approach | |||
- Separation of UI and processing | |||
- Advanced Preset System | |||
- Multiple Plug-ins per Library | |||
- Test Host included | |||
- Automated Testing Environment | |||
- Validator (small command line Test Host) and Plug-in examples code included | |||
--- | |||
<div id='500'/> | |||
## How to build VST3 | |||
### Get the source code from GitHub | |||
<pre>git clone --recursive https://github.com/steinbergmedia/vst3sdk.git | |||
</pre> | |||
### Adding VST2 version | |||
The VST2 SDK is not part anymore of the VST3 SDK, you have to use an older version of the SDK and copy the VST2_SDK folder into the VST_SDK folder. | |||
In order to build a VST2 version of the Plug-in and a VST3 at the same time, you need to copy the VST2 folder into the VST3 folder, simply run the following commands: | |||
- for macOS: | |||
<pre> | |||
cd TheFolderWhereYouDownloadTheSDK | |||
./copy_vst2_to_vst3_sdk.sh | |||
</pre> | |||
- for Windows: | |||
<pre> | |||
cd TheFolderWhereYouDownloadTheSDK | |||
copy_vst2_to_vst3_sdk.bat | |||
</pre> | |||
### Build the examples on Linux | |||
- Create a folder for the build and move to this folder (using cd): | |||
<pre> | |||
mkdir build | |||
cd build | |||
</pre> | |||
- Generate the Solution/Projects: provide the path of the Project where CMakeLists.txt is located: | |||
<pre> | |||
cmake ../vst3sdk | |||
</pre> | |||
- Now you can build the Plug-in: | |||
<pre> | |||
make | |||
(or alternatively for example for release) | |||
cmake --build . --config Release | |||
</pre> | |||
### Build the examples on macOS | |||
- Create a folder for the build and move to this folder (using cd): | |||
<pre> | |||
mkdir build | |||
cd build | |||
</pre> | |||
- Generate the Solution/Projects: provide the path of the Project where CMakeLists.txt is located: | |||
<pre> | |||
For XCode: | |||
cmake -GXcode ../vst3sdk | |||
Without XCode (here debug variant): | |||
cmake -DCMAKE_BUILD_TYPE=Debug ../ | |||
</pre> | |||
- Now you can build the Plug-in (you can use XCode too): | |||
<pre> | |||
xcodebuild | |||
(or alternatively for example for release) | |||
cmake --build . --config Release | |||
</pre> | |||
### Build the examples on Windows | |||
- Create a folder for the build and move to this folder (using cd): | |||
<pre> | |||
mkdir build | |||
cd build | |||
</pre> | |||
- Generate the Solution/Projects: provide the path of the Project where CMakeLists.txt is located: | |||
<pre> | |||
cmake.exe -G"Visual Studio 15 2017 Win64" ../vst3sdk | |||
</pre> | |||
- Now you can build the Plug-in (you can use Visual Studio too): | |||
<pre> | |||
msbuild.exe vstsdk.sln | |||
(or alternatively for example for release) | |||
cmake --build . --config Release | |||
</pre> | |||
### Build using cmake-gui | |||
- start the cmake-gui Application | |||
- "Browse Source...": select the folder VST3_SDK | |||
- "Browse Build...": select a folder where the outputs (projects/...) will be created. Typically a folder named "build" | |||
- you can check the SMTG Options | |||
- Press "Configure" | |||
- Press "Generate" and the project will be created | |||
--- | |||
<div id='600'/> | |||
## Contributing | |||
For bug reports and features requests, please visit the [VST Developer Forum](https://sdk.steinberg.net) | |||
--- | |||
<div id='700'/> | |||
Here are located all VST interfaces definitions (including VST Component/Controller, UI, Test). | |||
## License & Usage guidelines | |||
More details are found at [www.steinberg.net/sdklicenses_vst3](http://www.steinberg.net/sdklicenses_vst3) | |||
More details are found at [www.steinberg.net/sdklicenses_vst3](http://www.steinberg.net/sdklicenses_vst3) | |||
---- | |||
Return to [VST 3 SDK](https://github.com/steinbergmedia/vst3sdk) |
@@ -1,6 +1,6 @@ | |||
//----------------------------------------------------------------------------- | |||
// LICENSE | |||
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved | |||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved | |||
//----------------------------------------------------------------------------- | |||
// Redistribution and use in source and binary forms, with or without modification, | |||
// are permitted provided that the following conditions are met: | |||
@@ -3,4 +3,7 @@ | |||
Here you can find some helper classes useful for developing VST3 Plug-Ins. | |||
## License & Usage guidelines | |||
More details are found at [www.steinberg.net/sdklicenses_vst3](http://www.steinberg.net/sdklicenses_vst3) | |||
More details are found at [www.steinberg.net/sdklicenses_vst3](http://www.steinberg.net/sdklicenses_vst3) | |||
---- | |||
Return to [VST 3 SDK](https://github.com/steinbergmedia/vst3sdk) |
@@ -9,7 +9,7 @@ | |||
// | |||
//----------------------------------------------------------------------------- | |||
// LICENSE | |||
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved | |||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved | |||
//----------------------------------------------------------------------------- | |||
// Redistribution and use in source and binary forms, with or without modification, | |||
// are permitted provided that the following conditions are met: | |||
@@ -9,7 +9,7 @@ | |||
// | |||
//----------------------------------------------------------------------------- | |||
// LICENSE | |||
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved | |||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved | |||
//----------------------------------------------------------------------------- | |||
// Redistribution and use in source and binary forms, with or without modification, | |||
// are permitted provided that the following conditions are met: | |||
@@ -9,7 +9,7 @@ | |||
// | |||
//----------------------------------------------------------------------------- | |||
// LICENSE | |||
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved | |||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved | |||
//----------------------------------------------------------------------------- | |||
// Redistribution and use in source and binary forms, with or without modification, | |||
// are permitted provided that the following conditions are met: | |||
@@ -37,7 +37,7 @@ | |||
#include "base/source/fbuffer.h" | |||
#include "base/source/fstring.h" | |||
#include <stdlib.h> | |||
#include <cstdlib> | |||
namespace Steinberg { | |||
@@ -231,7 +231,6 @@ bool Buffer::prependString8 (const char8* s) | |||
return false; | |||
uint32 len = (uint32) strlen (s); | |||
if (len > 0) | |||
{ | |||
shiftStart (len); | |||
@@ -361,7 +360,7 @@ bool Buffer::fromHexString (const char8* string) | |||
else return false; // no hex string | |||
if (upper) | |||
data [count >> 1] = d << 4; | |||
data [count >> 1] = static_cast<unsigned char> (d << 4); | |||
else | |||
data [count >> 1] += d; | |||
@@ -9,7 +9,7 @@ | |||
// | |||
//----------------------------------------------------------------------------- | |||
// LICENSE | |||
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved | |||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved | |||
//----------------------------------------------------------------------------- | |||
// Redistribution and use in source and binary forms, with or without modification, | |||
// are permitted provided that the following conditions are met: | |||
@@ -85,7 +85,7 @@ public: | |||
/** Destructor - deallocates the internal memory. | |||
*/ | |||
~Buffer (); | |||
virtual ~Buffer (); | |||
/** Assignment operator - copies contents from a given Buffer and increases the size if necessary. | |||
\param[in] buff : the Buffer from which all memory will be copied | |||
@@ -210,7 +210,7 @@ public: | |||
int8* operator + (uint32 i); ///< \return the internal Buffer's address plus the given offset i, zero if offset is out of range | |||
int32 operator ! () { return buffer == 0; } | |||
int32 operator ! () { return buffer == nullptr; } | |||
enum swapSize | |||
{ | |||
@@ -11,7 +11,7 @@ | |||
// | |||
//----------------------------------------------------------------------------- | |||
// LICENSE | |||
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved | |||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved | |||
//----------------------------------------------------------------------------- | |||
// Redistribution and use in source and binary forms, with or without modification, | |||
// are permitted provided that the following conditions are met: | |||
@@ -39,9 +39,72 @@ | |||
#include "base/source/fdebug.h" | |||
#if SMTG_OS_WINDOWS | |||
#include <windows.h> | |||
bool AmIBeingDebugged () | |||
{ | |||
return IsDebuggerPresent (); | |||
} | |||
#endif | |||
#if SMTG_OS_LINUX | |||
#include <signal.h> | |||
#include <sys/types.h> | |||
#include <unistd.h> | |||
//-------------------------------------------------------------------------- | |||
bool AmIBeingDebugged () | |||
{ | |||
// TODO: check if GDB or LLDB is attached | |||
return true; | |||
} | |||
#endif | |||
#if SMTG_OS_MACOS | |||
#include <stdbool.h> | |||
#include <sys/sysctl.h> | |||
#include <sys/types.h> | |||
#include <unistd.h> | |||
//------------------------------------------------------------------------ | |||
// from Technical Q&A QA1361 (http://developer.apple.com/qa/qa2004/qa1361.html) | |||
//------------------------------------------------------------------------ | |||
bool AmIBeingDebugged () | |||
// Returns true if the current process is being debugged (either | |||
// running under the debugger or has a debugger attached post facto). | |||
{ | |||
int mib[4]; | |||
struct kinfo_proc info; | |||
size_t size; | |||
// Initialize the flags so that, if sysctl fails for some bizarre | |||
// reason, we get a predictable result. | |||
info.kp_proc.p_flag = 0; | |||
// Initialize mib, which tells sysctl the info we want, in this case | |||
// we're looking for information about a specific process ID. | |||
mib[0] = CTL_KERN; | |||
mib[1] = KERN_PROC; | |||
mib[2] = KERN_PROC_PID; | |||
mib[3] = getpid (); | |||
// Call sysctl. | |||
size = sizeof (info); | |||
sysctl (mib, sizeof (mib) / sizeof (*mib), &info, &size, NULL, 0); | |||
// We're being debugged if the P_TRACED flag is set. | |||
return ((info.kp_proc.p_flag & P_TRACED) != 0); | |||
} | |||
#endif // SMTG_OS_MACOS | |||
#if DEVELOPMENT | |||
#include <assert.h> | |||
#include <cassert> | |||
#include <cstdarg> | |||
#include <cstdio> | |||
@@ -49,8 +112,9 @@ | |||
#ifndef _WIN32_WINNT | |||
#define _WIN32_WINNT 0x0400 | |||
#endif | |||
#if _MSC_VER | |||
#include <intrin.h> | |||
#include <windows.h> | |||
#endif | |||
#define vsnprintf _vsnprintf | |||
#define snprintf _snprintf | |||
@@ -60,12 +124,6 @@ | |||
#include <mach/mach_time.h> | |||
#include <new> | |||
#include <signal.h> | |||
#include <stdbool.h> | |||
#include <sys/sysctl.h> | |||
#include <sys/types.h> | |||
#include <unistd.h> | |||
static bool AmIBeingDebugged (void); | |||
#define THREAD_ALLOC_WATCH 0 // check allocations on specific threads | |||
@@ -79,27 +137,6 @@ AssertionHandler gAssertionHandler = nullptr; | |||
AssertionHandler gPreAssertionHook = nullptr; | |||
DebugPrintLogger gDebugPrintLogger = nullptr; | |||
namespace boost { | |||
// Define the boost assertion handler to redirect to our assertion handler, | |||
// otherwise it just calls abort(). Note that we don't need to include any boost | |||
// headers for this, it just provides the handler. | |||
void assertion_failed (char const* expr, char const* function, char const* file, long line) | |||
{ | |||
#if DEVELOPMENT | |||
char message[512]; | |||
snprintf (message, 512, "%s at %s, %s:%ld", expr, function, file, line); | |||
if (gAssertionHandler) | |||
{ | |||
FDebugBreak (message); | |||
} | |||
else | |||
{ | |||
assert (!(const char *)message); | |||
} | |||
#endif | |||
} | |||
} | |||
//-------------------------------------------------------------------------- | |||
static const int kDebugPrintfBufferSize = 10000; | |||
static bool neverDebugger = false; // so I can switch it off in the debugger... | |||
@@ -116,7 +153,7 @@ static void printDebugString (const char* string) | |||
} | |||
else | |||
{ | |||
#if SMTG_OS_MACOS | |||
#if SMTG_OS_MACOS || defined(__MINGW32__) | |||
fprintf (stderr, "%s", string); | |||
#elif SMTG_OS_WINDOWS | |||
OutputDebugStringA (string); | |||
@@ -137,22 +174,6 @@ void FDebugPrint (const char* format, ...) | |||
printDebugString (string); | |||
} | |||
#if SMTG_OS_WINDOWS | |||
#define AmIBeingDebugged IsDebuggerPresent | |||
#endif | |||
#if SMTG_OS_LINUX | |||
#include <signal.h> | |||
#include <sys/types.h> | |||
#include <unistd.h> | |||
//-------------------------------------------------------------------------- | |||
static inline bool AmIBeingDebugged () | |||
{ | |||
// TODO: check if GDB or LLDB is attached | |||
return true; | |||
} | |||
#endif | |||
//-------------------------------------------------------------------------- | |||
// printf style debugging output | |||
//-------------------------------------------------------------------------- | |||
@@ -187,8 +208,11 @@ void FDebugBreak (const char* format, ...) | |||
if (breakIntoDebugger) | |||
{ | |||
#if SMTG_OS_WINDOWS | |||
#if SMTG_OS_WINDOWS && _MSC_VER | |||
__debugbreak (); // intrinsic version of DebugBreak() | |||
#elif SMTG_OS_MACOS && __arm64__ | |||
raise (SIGSTOP); | |||
#elif __ppc64__ || __ppc__ || __arm__ | |||
kill (getpid (), SIGINT); | |||
#elif __i386__ || __x86_64__ | |||
@@ -205,9 +229,9 @@ void FPrintLastError (const char* file, int line) | |||
{ | |||
#if SMTG_OS_WINDOWS | |||
LPVOID lpMessageBuffer; | |||
FormatMessageA (FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, | |||
FormatMessageA (FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, nullptr, | |||
GetLastError (), MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT), | |||
(LPSTR)&lpMessageBuffer, 0, NULL); | |||
(LPSTR)&lpMessageBuffer, 0, nullptr); | |||
FDebugPrint ("%s(%d) : %s\n", file, line, lpMessageBuffer); | |||
LocalFree (lpMessageBuffer); | |||
#endif | |||
@@ -276,39 +300,20 @@ void operator delete[] (void* p, int, const char* file, int line) | |||
::operator delete[] (p); | |||
} | |||
//------------------------------------------------------------------------ | |||
// from Technical Q&A QA1361 (http://developer.apple.com/qa/qa2004/qa1361.html) | |||
//------------------------------------------------------------------------ | |||
bool AmIBeingDebugged (void) | |||
// Returns true if the current process is being debugged (either | |||
// running under the debugger or has a debugger attached post facto). | |||
{ | |||
int mib[4]; | |||
struct kinfo_proc info; | |||
size_t size; | |||
// Initialize the flags so that, if sysctl fails for some bizarre | |||
// reason, we get a predictable result. | |||
info.kp_proc.p_flag = 0; | |||
// Initialize mib, which tells sysctl the info we want, in this case | |||
// we're looking for information about a specific process ID. | |||
mib[0] = CTL_KERN; | |||
mib[1] = KERN_PROC; | |||
mib[2] = KERN_PROC_PID; | |||
mib[3] = getpid (); | |||
#endif // SMTG_OS_MACOS | |||
// Call sysctl. | |||
#endif // DEVELOPMENT | |||
size = sizeof (info); | |||
sysctl (mib, sizeof (mib) / sizeof (*mib), &info, &size, NULL, 0); | |||
static bool smtg_unit_testing_active = false; // ugly hack to unit testing ... | |||
// We're being debugged if the P_TRACED flag is set. | |||
return ((info.kp_proc.p_flag & P_TRACED) != 0); | |||
//------------------------------------------------------------------------ | |||
bool isSmtgUnitTesting () | |||
{ | |||
return smtg_unit_testing_active; | |||
} | |||
#endif // SMTG_OS_MACOS | |||
#endif // DEVELOPMENT | |||
//------------------------------------------------------------------------ | |||
void setSmtgUnitTesting () | |||
{ | |||
smtg_unit_testing_active = true; | |||
} |
@@ -11,7 +11,7 @@ | |||
// | |||
//----------------------------------------------------------------------------- | |||
// LICENSE | |||
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved | |||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved | |||
//----------------------------------------------------------------------------- | |||
// Redistribution and use in source and binary forms, with or without modification, | |||
// are permitted provided that the following conditions are met: | |||
@@ -51,12 +51,15 @@ | |||
#pragma once | |||
#include "pluginterfaces/base/ftypes.h" | |||
#include <string.h> | |||
#include <cstring> | |||
#if SMTG_OS_MACOS | |||
#include <new> | |||
#endif | |||
/** Returns true if a debugger is attached. */ | |||
bool AmIBeingDebugged (); | |||
//----------------------------------------------------------------------------- | |||
// development / release | |||
//----------------------------------------------------------------------------- | |||
@@ -152,10 +155,10 @@ void FPrintLastError (const char* file, int line); | |||
the debug output to a file or stream. | |||
*/ | |||
///@{ | |||
typedef bool (*AssertionHandler) (const char* message); | |||
using AssertionHandler = bool (*) (const char* message); | |||
extern AssertionHandler gAssertionHandler; | |||
extern AssertionHandler gPreAssertionHook; | |||
typedef void (*DebugPrintLogger) (const char* message); | |||
using DebugPrintLogger = void (*) (const char* message); | |||
extern DebugPrintLogger gDebugPrintLogger; | |||
///@} | |||
@@ -212,11 +215,9 @@ void* operator new (size_t, int, const char*, int); | |||
#endif | |||
#endif | |||
#if SMTG_CPPUNIT_TESTING | |||
#define SMTG_IS_TEST true | |||
#else | |||
#define SMTG_IS_TEST false | |||
#endif | |||
// replace #if SMTG_CPPUNIT_TESTING | |||
bool isSmtgUnitTesting (); | |||
void setSmtgUnitTesting (); | |||
#if !SMTG_RENAME_ASSERT | |||
#if SMTG_OS_WINDOWS | |||
@@ -9,7 +9,7 @@ | |||
// | |||
//----------------------------------------------------------------------------- | |||
// LICENSE | |||
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved | |||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved | |||
//----------------------------------------------------------------------------- | |||
// Redistribution and use in source and binary forms, with or without modification, | |||
// are permitted provided that the following conditions are met: | |||
@@ -42,7 +42,7 @@ | |||
namespace Steinberg { | |||
IUpdateHandler* FObject::gUpdateHandler = 0; | |||
IUpdateHandler* FObject::gUpdateHandler = nullptr; | |||
//------------------------------------------------------------------------ | |||
const FUID FObject::iid; | |||
@@ -84,7 +84,7 @@ tresult PLUGIN_API FObject::queryInterface (const TUID _iid, void** obj) | |||
QUERY_INTERFACE (_iid, obj, FUnknown::iid, FUnknown) | |||
QUERY_INTERFACE (_iid, obj, IDependent::iid, IDependent) | |||
QUERY_INTERFACE (_iid, obj, FObject::iid, FObject) | |||
*obj = 0; | |||
*obj = nullptr; | |||
return kNoInterface; | |||
} | |||
@@ -125,8 +125,8 @@ void FObject::deferUpdate (int32 msg) | |||
//------------------------------------------------------------------------ | |||
namespace Singleton | |||
{ | |||
typedef std::vector<FObject**> ObjectVector; | |||
ObjectVector* singletonInstances = 0; | |||
using ObjectVector = std::vector<FObject**>; | |||
ObjectVector* singletonInstances = nullptr; | |||
bool singletonsTerminated = false; | |||
Steinberg::Base::Thread::FLock* singletonsLock; | |||
@@ -148,7 +148,7 @@ namespace Singleton | |||
SMTG_ASSERT (singletonsTerminated == false) | |||
if (singletonsTerminated == false) | |||
{ | |||
if (singletonInstances == 0) | |||
if (singletonInstances == nullptr) | |||
singletonInstances = NEW std::vector<FObject**>; | |||
singletonInstances->push_back (o); | |||
} | |||
@@ -167,15 +167,15 @@ namespace Singleton | |||
{ | |||
FObject** obj = (*it); | |||
(*obj)->release (); | |||
*obj = 0; | |||
obj = 0; | |||
*obj = nullptr; | |||
obj = nullptr; | |||
} | |||
delete singletonInstances; | |||
singletonInstances = 0; | |||
singletonInstances = nullptr; | |||
} | |||
delete singletonsLock; | |||
singletonsLock = 0; | |||
singletonsLock = nullptr; | |||
} | |||
} deleter; | |||
} | |||
@@ -9,7 +9,7 @@ | |||
// | |||
//----------------------------------------------------------------------------- | |||
// LICENSE | |||
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved | |||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved | |||
//----------------------------------------------------------------------------- | |||
// Redistribution and use in source and binary forms, with or without modification, | |||
// are permitted provided that the following conditions are met: | |||
@@ -43,41 +43,39 @@ | |||
#include "pluginterfaces/base/funknown.h" | |||
#include "pluginterfaces/base/iupdatehandler.h" | |||
//#include "base/source/basefwd.h" | |||
#include "base/source/fdebug.h" // NEW | |||
#include "base/source/fdebug.h" // use of NEW | |||
namespace Steinberg { | |||
//---------------------------------- | |||
typedef FIDString FClassID; | |||
using FClassID = FIDString; | |||
//------------------------------------------------------------------------ | |||
// Basic FObject - implements FUnknown + IDependent | |||
//------------------------------------------------------------------------ | |||
/** Implements FUnknown and IDependent. | |||
FObject is a polymorphic class that implements IDependent (of SKI module) | |||
and therefore derived from FUnknown, which is the most abstract base class of all. | |||
All COM-like virtual methods of FUnknown such as queryInterface(), addRef(), release() | |||
are implemented here. On top of that, dependency-related methods are implemented too. | |||
FObject is a polymorphic class that implements IDependent (of SKI module) and therefore derived from | |||
FUnknown, which is the most abstract base class of all. | |||
Pointer casting is done via the template methods FCast, either FObject to FObject or | |||
FUnknown to FObject. | |||
All COM-like virtual methods of FUnknown such as queryInterface(), addRef(), release() are | |||
implemented here. On top of that, dependency-related methods are implemented too. | |||
FObject supports a new singleton concept, therefore these objects are deleted automatically upon program termination. | |||
Pointer casting is done via the template methods FCast, either FObject to FObject or FUnknown to | |||
FObject. | |||
- Runtime type information: An object can be queried at runtime, of what class | |||
it is. To do this correctly, every class must override some methods. This | |||
is simplified by using the OBJ_METHODS macros | |||
FObject supports a new singleton concept, therefore these objects are deleted automatically upon | |||
program termination. | |||
- Runtime type information: An object can be queried at runtime, of what class it is. To do this | |||
correctly, every class must override some methods. This is simplified by using the OBJ_METHODS | |||
macros | |||
@see | |||
- FUnknown | |||
- IDependent | |||
- IUpdateHandler | |||
@see | |||
- FUnknown | |||
- IDependent | |||
- IUpdateHandler | |||
*/ | |||
//------------------------------------------------------------------------ | |||
class FObject : public IDependent | |||
@@ -99,19 +97,19 @@ public: | |||
FUnknown* unknownCast () {return this;} ///< get FUnknown interface from object | |||
// FUnknown | |||
virtual tresult PLUGIN_API queryInterface (const TUID _iid, void** obj) SMTG_OVERRIDE; ///< please refer to FUnknown::queryInterface () | |||
virtual uint32 PLUGIN_API addRef () SMTG_OVERRIDE; ///< please refer to FUnknown::addref () | |||
virtual uint32 PLUGIN_API release () SMTG_OVERRIDE; ///< please refer to FUnknown::release () | |||
tresult PLUGIN_API queryInterface (const TUID _iid, void** obj) SMTG_OVERRIDE; ///< please refer to FUnknown::queryInterface () | |||
uint32 PLUGIN_API addRef () SMTG_OVERRIDE; ///< please refer to FUnknown::addref () | |||
uint32 PLUGIN_API release () SMTG_OVERRIDE; ///< please refer to FUnknown::release () | |||
// IDependent | |||
virtual void PLUGIN_API update (FUnknown* /*changedUnknown*/, int32 /*message*/) SMTG_OVERRIDE {} | |||
void PLUGIN_API update (FUnknown* /*changedUnknown*/, int32 /*message*/) SMTG_OVERRIDE {} | |||
///< empty virtual method that should be overridden by derived classes for data updates upon changes | |||
// IDependency | |||
virtual void addDependent (IDependent* dep); ///< adds dependency to the object | |||
virtual void removeDependent (IDependent* dep); ///< removes dependency from the object | |||
virtual void changed (int32 msg = kChanged); ///< Inform all dependents, that the object has changed. | |||
virtual void deferUpdate (int32 msg = kChanged); ///< Similar to triggerUpdates, except only delivered in idle (usefull in collecting updates). | |||
virtual void updateDone (int32 /* msg */) {} ///< empty virtual method that should be overridden by derived classes | |||
virtual void updateDone (int32 /* msg */) {} ///< empty virtual method that should be overridden by derived classes | |||
virtual bool isEqualInstance (FUnknown* d) {return this == d;} | |||
static void setUpdateHandler (IUpdateHandler* handler) {gUpdateHandler = handler;} ///< set method for the local attribute | |||
@@ -137,7 +135,7 @@ protected: | |||
//------------------------------------------------------------------------ | |||
inline FObject* FObject::unknownToObject (FUnknown* unknown) | |||
{ | |||
FObject* object = 0; | |||
FObject* object = nullptr; | |||
if (unknown) | |||
{ | |||
unknown->queryInterface (FObject::iid, (void**)&object); | |||
@@ -180,7 +178,7 @@ inline C* FCast (FUnknown* unknown) | |||
template <class C> | |||
inline C* FUCast (FObject* object) | |||
{ | |||
return FUnknownPtr<C> (object ? object->unknownCast () : 0); | |||
return FUnknownPtr<C> (object ? object->unknownCast () : nullptr); | |||
} | |||
template <class C> | |||
@@ -9,7 +9,7 @@ | |||
// | |||
//----------------------------------------------------------------------------- | |||
// LICENSE | |||
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved | |||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved | |||
//----------------------------------------------------------------------------- | |||
// Redistribution and use in source and binary forms, with or without modification, | |||
// are permitted provided that the following conditions are met: | |||
@@ -687,13 +687,13 @@ char8* FStreamer::readStr8 () | |||
{ | |||
int32 length; | |||
if (!readInt32 (length)) | |||
return 0; | |||
return nullptr; | |||
// check corruption | |||
if (length > 262144) | |||
return 0; | |||
return nullptr; | |||
char8* s = (length > 0) ? NEWVEC char8[length] : 0; | |||
char8* s = (length > 0) ? NEWVEC char8[length] : nullptr; | |||
if (s) | |||
readRaw (s, length * sizeof (char8)); | |||
return s; | |||
@@ -9,7 +9,7 @@ | |||
// | |||
//----------------------------------------------------------------------------- | |||
// LICENSE | |||
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved | |||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved | |||
//----------------------------------------------------------------------------- | |||
// Redistribution and use in source and binary forms, with or without modification, | |||
// are permitted provided that the following conditions are met: | |||
@@ -217,7 +217,7 @@ class IBStream; | |||
// IBStreamer | |||
//------------------------------------------------------------------------ | |||
/** Wrapper class for typed reading/writing from or to IBStream. | |||
Can be used framework-independent in Plug-ins. */ | |||
Can be used framework-independent in plug-ins. */ | |||
//------------------------------------------------------------------------ | |||
class IBStreamer: public FStreamer | |||
{ | |||
@@ -9,7 +9,7 @@ | |||
// | |||
//----------------------------------------------------------------------------- | |||
// LICENSE | |||
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved | |||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved | |||
//----------------------------------------------------------------------------- | |||
// Redistribution and use in source and binary forms, with or without modification, | |||
// are permitted provided that the following conditions are met: | |||
@@ -48,6 +48,7 @@ | |||
#if SMTG_OS_WINDOWS | |||
#include <windows.h> | |||
#ifdef _MSC_VER | |||
#pragma warning (disable : 4244) | |||
#pragma warning (disable : 4267) | |||
#pragma warning (disable : 4996) | |||
@@ -59,9 +60,9 @@ | |||
#define realloc(p,s) _realloc_dbg(p,s, _NORMAL_BLOCK, __FILE__, __LINE__) | |||
#define free(p) _free_dbg(p, _NORMAL_BLOCK) | |||
#endif | |||
#endif | |||
#endif // DEVELOPMENT | |||
#endif // _MSC_VER | |||
#endif // SMTG_OS_WINDOWS | |||
#ifndef kPrintfBufferSize | |||
#define kPrintfBufferSize 4096 | |||
@@ -175,7 +176,7 @@ static CFStringDebugAllocator gDebugAllocator; | |||
#else | |||
static const CFAllocatorRef kCFAllocator = ::kCFAllocatorDefault; | |||
#endif | |||
#endif // SMTG_DEBUG_CFALLOCATOR | |||
} | |||
//----------------------------------------------------------------------------- | |||
@@ -327,7 +328,7 @@ static inline Steinberg::int32 strnicmp16 (const Steinberg::char16* str1, const | |||
CFIndex str1Len = Steinberg::strlen16 (str1); | |||
CFIndex str2Len = Steinberg::strlen16 (str2); | |||
if (size < str2Len) // range is not applied to second string | |||
if (static_cast<CFIndex> (size) < str2Len) // range is not applied to second string | |||
str2Len = size; | |||
CFStringRef cfStr1 = CFStringCreateWithCharactersNoCopy (Steinberg::kCFAllocator, (UniChar*)str1, str1Len, kCFAllocatorNull); | |||
CFStringRef cfStr2 = CFStringCreateWithCharactersNoCopy (Steinberg::kCFAllocator, (UniChar*)str2, str2Len, kCFAllocatorNull); | |||
@@ -414,7 +415,7 @@ static inline Steinberg::int32 sprintf16 (Steinberg::char16* str, const Steinber | |||
return vsnwprintf (str, -1, format, marker); | |||
} | |||
#endif | |||
#endif // SMTG_OS_LINUX | |||
/* | |||
UTF-8 EF BB BF | |||
@@ -467,7 +468,7 @@ ConstString::ConstString (const ConstString& str, int32 offset, int32 length) | |||
//----------------------------------------------------------------------------- | |||
ConstString::ConstString (const FVariant& var) | |||
: buffer (0) | |||
: buffer (nullptr) | |||
, len (0) | |||
, isWide (0) | |||
{ | |||
@@ -489,7 +490,7 @@ ConstString::ConstString (const FVariant& var) | |||
//----------------------------------------------------------------------------- | |||
ConstString::ConstString () | |||
: buffer (0) | |||
: buffer (nullptr) | |||
, len (0) | |||
, isWide (0) | |||
{ | |||
@@ -1629,7 +1630,7 @@ char8 ConstString::toLower (char8 c) | |||
::CharLowerA (temp); | |||
return temp[0]; | |||
#else | |||
return tolower (c); | |||
return static_cast<char8> (tolower (c)); | |||
#endif | |||
} | |||
@@ -1643,7 +1644,7 @@ char8 ConstString::toUpper (char8 c) | |||
::CharUpperA (temp); | |||
return temp[0]; | |||
#else | |||
return toupper (c); | |||
return static_cast<char8> (toupper (c)); | |||
#endif | |||
} | |||
@@ -1856,7 +1857,7 @@ static CFStringEncoding MBCodePageToCFStringEncoding (uint32 codePage) | |||
//----------------------------------------------------------------------------- | |||
int32 ConstString::multiByteToWideString (char16* dest, const char8* source, int32 charCount, uint32 sourceCodePage) | |||
{ | |||
if (source == 0 || source[0] == 0) | |||
if (source == nullptr || source[0] == 0) | |||
{ | |||
if (dest && charCount > 0) | |||
{ | |||
@@ -1889,7 +1890,7 @@ int32 ConstString::multiByteToWideString (char16* dest, const char8* source, int | |||
#endif | |||
#if SMTG_OS_LINUX | |||
if (sourceCodePage == kCP_ANSI || sourceCodePage == kCP_Utf8) | |||
if (sourceCodePage == kCP_ANSI || sourceCodePage == kCP_US_ASCII || sourceCodePage == kCP_Utf8) | |||
{ | |||
if (dest == nullptr) | |||
{ | |||
@@ -1909,7 +1910,7 @@ int32 ConstString::multiByteToWideString (char16* dest, const char8* source, int | |||
} | |||
} | |||
else | |||
{ | |||
{ | |||
assert(false && "DEPRECATED No Linux implementation"); | |||
} | |||
@@ -1923,7 +1924,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, 0, 0); | |||
return WideCharToMultiByte (destCodePage, 0, wideString, -1, dest, charCount, nullptr, nullptr); | |||
#elif SMTG_OS_MACOS | |||
int32 result = 0; | |||
@@ -1966,7 +1967,7 @@ int32 ConstString::wideStringToMultiByte (char8* dest, const char16* wideString, | |||
} | |||
} | |||
} | |||
else if (destCodePage == kCP_ANSI) | |||
else if (destCodePage == kCP_ANSI || destCodePage == kCP_US_ASCII) | |||
{ | |||
if (dest == nullptr) | |||
{ | |||
@@ -1989,7 +1990,7 @@ int32 ConstString::wideStringToMultiByte (char8* dest, const char16* wideString, | |||
} | |||
} | |||
else | |||
{ | |||
{ | |||
assert(false && "DEPRECATED No Linux implementation"); | |||
} | |||
return result; | |||
@@ -2012,7 +2013,7 @@ bool ConstString::isNormalized (UnicodeNormalization n) | |||
#ifdef UNICODE | |||
if (n != kUnicodeNormC) | |||
return false; | |||
uint32 normCharCount = static_cast<uint32> (FoldString (MAP_PRECOMPOSED, buffer16, len, 0, 0)); | |||
uint32 normCharCount = static_cast<uint32> (FoldString (MAP_PRECOMPOSED, buffer16, len, nullptr, 0)); | |||
return (normCharCount == len); | |||
#else | |||
return false; | |||
@@ -2115,7 +2116,7 @@ String::String (String&& str) | |||
//----------------------------------------------------------------------------- | |||
String& String::operator= (String&& str) | |||
{ | |||
SMTG_ASSERT (buffer == 0 || buffer != str.buffer); | |||
SMTG_ASSERT (buffer == nullptr || buffer != str.buffer); | |||
tryFreeBuffer (); | |||
isWide = str.isWide; | |||
@@ -2143,7 +2144,7 @@ bool String::toWideString (uint32 sourceCodePage) | |||
{ | |||
if (buffer8 && len > 0) | |||
{ | |||
int32 bytesNeeded = multiByteToWideString (0, buffer8, 0, sourceCodePage) * sizeof (char16); | |||
int32 bytesNeeded = multiByteToWideString (nullptr, buffer8, 0, sourceCodePage) * sizeof (char16); | |||
if (bytesNeeded) | |||
{ | |||
bytesNeeded += sizeof (char16); | |||
@@ -2227,7 +2228,7 @@ bool String::toMultiByte (uint32 destCodePage) | |||
{ | |||
if (buffer16 && len > 0) | |||
{ | |||
int32 numChars = wideStringToMultiByte (0, buffer16, 0, destCodePage) + sizeof (char8); | |||
int32 numChars = wideStringToMultiByte (nullptr, buffer16, 0, destCodePage) + sizeof (char8); | |||
char8* newStr = (char8*) malloc (numChars * sizeof (char8)); | |||
if (wideStringToMultiByte (newStr, buffer16, numChars, destCodePage) <= 0) | |||
{ | |||
@@ -2263,7 +2264,7 @@ bool String::normalize (UnicodeNormalization n) | |||
if (isWide == false) | |||
return false; | |||
if (buffer16 == 0) | |||
if (buffer16 == nullptr) | |||
return true; | |||
#if SMTG_OS_WINDOWS | |||
@@ -2271,7 +2272,7 @@ bool String::normalize (UnicodeNormalization n) | |||
if (n != kUnicodeNormC) | |||
return false; | |||
uint32 normCharCount = static_cast<uint32> (FoldString (MAP_PRECOMPOSED, buffer16, len, 0, 0)); | |||
uint32 normCharCount = static_cast<uint32> (FoldString (MAP_PRECOMPOSED, buffer16, len, nullptr, 0)); | |||
if (normCharCount == len) | |||
return true; | |||
@@ -2320,7 +2321,7 @@ void String::tryFreeBuffer () | |||
if (buffer) | |||
{ | |||
free (buffer); | |||
buffer = 0; | |||
buffer = nullptr; | |||
} | |||
} | |||
@@ -2348,7 +2349,7 @@ bool String::resize (uint32 newLength, bool wide, bool fill) | |||
if (newBufferSize != oldBufferSize) | |||
{ | |||
void* newstr = realloc (buffer, newBufferSize); | |||
if (newstr == 0) | |||
if (newstr == nullptr) | |||
return false; | |||
buffer = newstr; | |||
if (isWide) | |||
@@ -2362,7 +2363,7 @@ bool String::resize (uint32 newLength, bool wide, bool fill) | |||
else | |||
{ | |||
void* newstr = malloc (newBufferSize); | |||
if (newstr == 0) | |||
if (newstr == nullptr) | |||
return false; | |||
buffer = newstr; | |||
if (isWide) | |||
@@ -2520,7 +2521,7 @@ String& String::assign (const char8* str, int32 n, bool isTerminated) | |||
if (resize (n, false)) | |||
{ | |||
if (buffer8 && n > 0) | |||
if (buffer8 && n > 0 && str) | |||
{ | |||
memcpy (buffer8, str, n * sizeof (char8)); | |||
SMTG_ASSERT (buffer8[n] == 0) | |||
@@ -2547,7 +2548,7 @@ String& String::assign (const char16* str, int32 n, bool isTerminated) | |||
if (resize (n, true)) | |||
{ | |||
if (buffer16 && n > 0) | |||
if (buffer16 && n > 0 && str) | |||
{ | |||
memcpy (buffer16, str, n * sizeof (char16)); | |||
SMTG_ASSERT (buffer16[n] == 0) | |||
@@ -2628,7 +2629,7 @@ String& String::append (const char8* str, int32 n) | |||
if (!resize (newlen, false)) | |||
return *this; | |||
if (buffer) | |||
if (buffer && str) | |||
{ | |||
memcpy (buffer8 + len, str, n * sizeof (char8)); | |||
SMTG_ASSERT (buffer8[newlen] == 0) | |||
@@ -2663,7 +2664,7 @@ String& String::append (const char16* str, int32 n) | |||
if (!resize (newlen, true)) | |||
return *this; | |||
if (buffer16) | |||
if (buffer16 && str) | |||
{ | |||
memcpy (buffer16 + len, str, n * sizeof (char16)); | |||
SMTG_ASSERT (buffer16[newlen] == 0) | |||
@@ -2772,7 +2773,7 @@ String& String::insertAt (uint32 idx, const char8* str, int32 n) | |||
if (!resize (newlen, false)) | |||
return *this; | |||
if (buffer) | |||
if (buffer && str) | |||
{ | |||
if (idx < len) | |||
memmove (buffer8 + idx + n, buffer8 + idx, (len - idx) * sizeof (char8)); | |||
@@ -2806,7 +2807,7 @@ String& String::insertAt (uint32 idx, const char16* str, int32 n) | |||
if (!resize (newlen, true)) | |||
return *this; | |||
if (buffer) | |||
if (buffer && str) | |||
{ | |||
if (idx < len) | |||
memmove (buffer16 + idx + n, buffer16 + idx, (len - idx) * sizeof (char16)); | |||
@@ -2833,7 +2834,7 @@ String& String::replace (uint32 idx, int32 n1, const ConstString& str, int32 n2) | |||
//----------------------------------------------------------------------------- | |||
String& String::replace (uint32 idx, int32 n1, const char8* str, int32 n2) | |||
{ | |||
if (idx > len || str == 0) | |||
if (idx > len || str == nullptr) | |||
return *this; | |||
if (isWide) | |||
@@ -2874,7 +2875,7 @@ String& String::replace (uint32 idx, int32 n1, const char8* str, int32 n2) | |||
//----------------------------------------------------------------------------- | |||
String& String::replace (uint32 idx, int32 n1, const char16* str, int32 n2) | |||
{ | |||
if (idx > len || str == 0) | |||
if (idx > len || str == nullptr) | |||
return *this; | |||
if (!isWide) | |||
@@ -2911,7 +2912,7 @@ String& String::replace (uint32 idx, int32 n1, const char16* str, int32 n2) | |||
//----------------------------------------------------------------------------- | |||
int32 String::replace (const char8* toReplace, const char8* toReplaceWith, bool all, CompareMode m) | |||
{ | |||
if (toReplace == 0 || toReplaceWith == 0) | |||
if (toReplace == nullptr || toReplaceWith == nullptr) | |||
return 0; | |||
int32 result = 0; | |||
@@ -2939,7 +2940,7 @@ int32 String::replace (const char8* toReplace, const char8* toReplaceWith, bool | |||
//----------------------------------------------------------------------------- | |||
int32 String::replace (const char16* toReplace, const char16* toReplaceWith, bool all, CompareMode m) | |||
{ | |||
if (toReplace == 0 || toReplaceWith == 0) | |||
if (toReplace == nullptr || toReplaceWith == nullptr) | |||
return 0; | |||
int32 result = 0; | |||
@@ -3264,7 +3265,7 @@ static uint32 performRemoveChars (T* str, uint32 length, const T* toRemove) | |||
//----------------------------------------------------------------------------- | |||
bool String::removeChars8 (const char8* toRemove) | |||
{ | |||
if (isEmpty () || toRemove == 0) | |||
if (isEmpty () || toRemove == nullptr) | |||
return true; | |||
if (isWide) | |||
@@ -3288,7 +3289,7 @@ bool String::removeChars8 (const char8* toRemove) | |||
//----------------------------------------------------------------------------- | |||
bool String::removeChars16 (const char16* toRemove) | |||
{ | |||
if (isEmpty () || toRemove == 0) | |||
if (isEmpty () || toRemove == nullptr) | |||
return true; | |||
if (!isWide) | |||
@@ -3649,7 +3650,7 @@ void String::take (String& other) | |||
buffer = other.buffer; | |||
len = other.len; | |||
other.buffer = 0; | |||
other.buffer = nullptr; | |||
other.len = 0; | |||
} | |||
@@ -3667,7 +3668,7 @@ void* String::pass () | |||
{ | |||
void* res = buffer; | |||
len = 0; | |||
buffer = 0; | |||
buffer = nullptr; | |||
return res; | |||
} | |||
@@ -3857,11 +3858,11 @@ uint32 hashString16 (const char16* s, uint32 m) | |||
//------------------------------------------------------------------------ | |||
template <class T> int32 tstrnatcmp (const T* s1, const T* s2, bool caseSensitive = true) | |||
{ | |||
if (s1 == 0 && s2 == 0) | |||
if (s1 == nullptr && s2 == nullptr) | |||
return 0; | |||
else if (s1 == 0) | |||
else if (s1 == nullptr) | |||
return -1; | |||
else if (s2 == 0) | |||
else if (s2 == nullptr) | |||
return 1; | |||
while (*s1 && *s2) | |||
@@ -3907,8 +3908,8 @@ template <class T> int32 tstrnatcmp (const T* s1, const T* s2, bool caseSensitiv | |||
{ | |||
if (caseSensitive == false) | |||
{ | |||
T srcToUpper = toupper (*s1); | |||
T dstToUpper = toupper (*s2); | |||
T srcToUpper = static_cast<T> (toupper (*s1)); | |||
T dstToUpper = static_cast<T> (toupper (*s2)); | |||
if (srcToUpper != dstToUpper) | |||
return (int32)(srcToUpper - dstToUpper); | |||
} | |||
@@ -9,7 +9,7 @@ | |||
// | |||
//----------------------------------------------------------------------------- | |||
// LICENSE | |||
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved | |||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved | |||
//----------------------------------------------------------------------------- | |||
// Redistribution and use in source and binary forms, with or without modification, | |||
// are permitted provided that the following conditions are met: | |||
@@ -44,7 +44,7 @@ | |||
#include "base/source/fobject.h" | |||
#include <stdarg.h> | |||
#include <cstdarg> | |||
namespace Steinberg { | |||
@@ -126,7 +126,7 @@ public: | |||
// access ----------------------------------------------------------------- | |||
virtual int32 length () const {return static_cast<int32> (len);} ///< Return length of string | |||
inline bool isEmpty () const {return buffer == 0 || len == 0;} ///< Return true if string is empty | |||
inline bool isEmpty () const {return buffer == nullptr || len == 0;} ///< Return true if string is empty | |||
operator const char8* () const {return text8 ();} ///< Returns pointer to string of type char8 (no modification allowed) | |||
operator const char16* () const {return text16 ();} ///< Returns pointer to string of type char16(no modification allowed) | |||
@@ -307,6 +307,7 @@ Extends class ConstString by operations which allow modifications. | |||
class String : public ConstString | |||
{ | |||
public: | |||
//----------------------------------------------------------------------------- | |||
String (); | |||
String (const char8* str, MBCodePage codepage, int32 n = -1, bool isTerminated = true); ///< assign n characters of str and convert to wide string by using the specified codepage | |||
@@ -325,10 +326,10 @@ public: | |||
// access------------------------------------------------------------------ | |||
void updateLength (); ///< Call this when the string is truncated outside (not recommended though) | |||
virtual const char8* text8 () const SMTG_OVERRIDE; | |||
virtual const char16* text16 () const SMTG_OVERRIDE; | |||
virtual char8 getChar8 (uint32 index) const SMTG_OVERRIDE; | |||
virtual char16 getChar16 (uint32 index) const SMTG_OVERRIDE; | |||
const char8* text8 () const SMTG_OVERRIDE; | |||
const char16* text16 () const SMTG_OVERRIDE; | |||
char8 getChar8 (uint32 index) const SMTG_OVERRIDE; | |||
char16 getChar16 (uint32 index) const SMTG_OVERRIDE; | |||
bool setChar8 (uint32 index, char8 c); | |||
bool setChar16 (uint32 index, char16 c); | |||
@@ -725,18 +726,18 @@ public: | |||
using String::operator=; | |||
// IStringResult ---------------------------------------------------------- | |||
virtual void PLUGIN_API setText (const char8* text) SMTG_OVERRIDE; | |||
void PLUGIN_API setText (const char8* text) SMTG_OVERRIDE; | |||
//------------------------------------------------------------------------- | |||
// IString----------------------------------------------------------------- | |||
virtual void PLUGIN_API setText8 (const char8* text) SMTG_OVERRIDE; | |||
virtual void PLUGIN_API setText16 (const char16* text) SMTG_OVERRIDE; | |||
void PLUGIN_API setText8 (const char8* text) SMTG_OVERRIDE; | |||
void PLUGIN_API setText16 (const char16* text) SMTG_OVERRIDE; | |||
virtual const char8* PLUGIN_API getText8 () SMTG_OVERRIDE; | |||
virtual const char16* PLUGIN_API getText16 () SMTG_OVERRIDE; | |||
const char8* PLUGIN_API getText8 () SMTG_OVERRIDE; | |||
const char16* PLUGIN_API getText16 () SMTG_OVERRIDE; | |||
virtual void PLUGIN_API take (void* s, bool _isWide) SMTG_OVERRIDE; | |||
virtual bool PLUGIN_API isWideString () const SMTG_OVERRIDE; | |||
void PLUGIN_API take (void* s, bool _isWide) SMTG_OVERRIDE; | |||
bool PLUGIN_API isWideString () const SMTG_OVERRIDE; | |||
//------------------------------------------------------------------------- | |||
OBJ_METHODS (StringObject, FObject) | |||
@@ -9,7 +9,7 @@ | |||
// | |||
//----------------------------------------------------------------------------- | |||
// LICENSE | |||
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved | |||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved | |||
//----------------------------------------------------------------------------- | |||
// Redistribution and use in source and binary forms, with or without modification, | |||
// are permitted provided that the following conditions are met: | |||
@@ -128,28 +128,28 @@ struct UpdateData | |||
}; | |||
//------------------------------------------------------------------------ | |||
typedef std::deque<DeferedChange> DeferedChangeList; | |||
typedef DeferedChangeList::const_iterator DeferedChangeListIterConst; | |||
typedef DeferedChangeList::iterator DeferedChangeListIter; | |||
using DeferedChangeList = std::deque<DeferedChange>; | |||
using DeferedChangeListIterConst = DeferedChangeList::const_iterator; | |||
using DeferedChangeListIter = DeferedChangeList::iterator; | |||
typedef std::deque<UpdateData> UpdateDataList; | |||
typedef UpdateDataList::const_iterator UpdateDataListIterConst; | |||
using UpdateDataList = std::deque<UpdateData>; | |||
using UpdateDataListIterConst = UpdateDataList::const_iterator; | |||
#if CLASS_NAME_TRACKED | |||
typedef std::vector<Dependency> DependentList; | |||
using DependentList = std::vector<Dependency>; | |||
#else | |||
typedef std::vector<IDependent*> DependentList; | |||
#endif | |||
typedef DependentList::iterator DependentListIter; | |||
typedef DependentList::const_iterator DependentListIterConst; | |||
using DependentListIter = DependentList::iterator; | |||
using DependentListIterConst = DependentList::const_iterator; | |||
#if SMTG_CPP11_STDLIBSUPPORT | |||
typedef std::unordered_map<const FUnknown*, DependentList> DependentMap; | |||
using DependentMap = std::unordered_map<const FUnknown*, DependentList>; | |||
#else | |||
typedef std::map<const FUnknown*, DependentList> DependentMap; | |||
#endif | |||
typedef DependentMap::iterator DependentMapIter; | |||
typedef DependentMap::const_iterator DependentMapIterConst; | |||
using DependentMapIter = DependentMap::iterator; | |||
using DependentMapIterConst = DependentMap::const_iterator; | |||
struct Table | |||
{ | |||
@@ -261,7 +261,7 @@ tresult PLUGIN_API UpdateHandler::removeDependent (FUnknown* u, IDependent* depe | |||
for (uint32 count = 0; count < (*iter).count; count++) | |||
{ | |||
if ((*iter).dependents[count] == dependent) | |||
(*iter).dependents[count] = 0; | |||
(*iter).dependents[count] = nullptr; | |||
} | |||
} | |||
++iter; | |||
@@ -277,6 +277,8 @@ tresult PLUGIN_API UpdateHandler::removeDependent (FUnknown* u, IDependent* depe | |||
{ | |||
Update::DependentList& list = (*iterMap).second; | |||
Update::DependentListIter iterList = list.begin (); | |||
bool listIsEmpty = false; | |||
while (iterList != list.end ()) | |||
{ | |||
#if CLASS_NAME_TRACKED | |||
@@ -285,14 +287,24 @@ tresult PLUGIN_API UpdateHandler::removeDependent (FUnknown* u, IDependent* depe | |||
if ((*iterList) == dependent) | |||
#endif | |||
{ | |||
iterList = list.erase (iterList); | |||
if (list.size () == 1u) | |||
{ | |||
listIsEmpty = true; | |||
break; | |||
} | |||
else | |||
iterList = list.erase (iterList); | |||
} | |||
else | |||
{ | |||
++iterList; | |||
} | |||
} | |||
++iterMap; | |||
if (listIsEmpty) | |||
iterMap = map.erase (iterMap); | |||
else | |||
++iterMap; | |||
} | |||
} | |||
} | |||
@@ -594,7 +606,7 @@ tresult PLUGIN_API UpdateHandler::cancelUpdates (FUnknown* u) | |||
FGuard guard (lock); | |||
Update::DeferedChange change (unknown, 0); | |||
while (1) | |||
while (true) | |||
{ | |||
auto iter = std::find (table->defered.begin (), table->defered.end (), change); | |||
if (iter != table->defered.end ()) | |||
@@ -9,7 +9,7 @@ | |||
// | |||
//----------------------------------------------------------------------------- | |||
// LICENSE | |||
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved | |||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved | |||
//----------------------------------------------------------------------------- | |||
// Redistribution and use in source and binary forms, with or without modification, | |||
// are permitted provided that the following conditions are met: | |||
@@ -57,7 +57,7 @@ public: | |||
/** cancel pending messages send by \param object or by any if object is 0 */ | |||
virtual tresult PLUGIN_API cancelUpdates (FUnknown* object) = 0; | |||
/** send pending messages send by \param object or by any if object is 0 */ | |||
virtual tresult PLUGIN_API triggerDeferedUpdates (FUnknown* object = 0) = 0; | |||
virtual tresult PLUGIN_API triggerDeferedUpdates (FUnknown* object = nullptr) = 0; | |||
static const FUID iid; | |||
}; | |||
@@ -86,20 +86,20 @@ public: | |||
// IUpdateHandler | |||
/** register \param dependent to get messages from \param object */ | |||
virtual tresult PLUGIN_API addDependent (FUnknown* object, IDependent* dependent) SMTG_OVERRIDE; | |||
tresult PLUGIN_API addDependent (FUnknown* object, IDependent* dependent) SMTG_OVERRIDE; | |||
/** unregister \param dependent to get no messages from \param object */ | |||
virtual tresult PLUGIN_API removeDependent (FUnknown* object, | |||
tresult PLUGIN_API removeDependent (FUnknown* object, | |||
IDependent* dependent) SMTG_OVERRIDE; | |||
/** send \param message to all dependents of \param object immediately */ | |||
virtual tresult PLUGIN_API triggerUpdates (FUnknown* object, int32 message) SMTG_OVERRIDE; | |||
tresult PLUGIN_API triggerUpdates (FUnknown* object, int32 message) SMTG_OVERRIDE; | |||
/** send \param message to all dependents of \param object when idle */ | |||
virtual tresult PLUGIN_API deferUpdates (FUnknown* object, int32 message) SMTG_OVERRIDE; | |||
tresult PLUGIN_API deferUpdates (FUnknown* object, int32 message) SMTG_OVERRIDE; | |||
// IUpdateManager | |||
/** cancel pending messages send by \param object or by any if object is 0 */ | |||
virtual tresult PLUGIN_API cancelUpdates (FUnknown* object) SMTG_OVERRIDE; | |||
tresult PLUGIN_API cancelUpdates (FUnknown* object) SMTG_OVERRIDE; | |||
/** send pending messages send by \param object or by any if object is 0 */ | |||
virtual tresult PLUGIN_API triggerDeferedUpdates (FUnknown* object = 0) SMTG_OVERRIDE; | |||
tresult PLUGIN_API triggerDeferedUpdates (FUnknown* object = nullptr) SMTG_OVERRIDE; | |||
/// @cond ignore | |||
// obsolete functions kept for compatibility | |||
@@ -9,7 +9,7 @@ | |||
// | |||
//----------------------------------------------------------------------------- | |||
// LICENSE | |||
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved | |||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved | |||
//----------------------------------------------------------------------------- | |||
// Redistribution and use in source and binary forms, with or without modification, | |||
// are permitted provided that the following conditions are met: | |||
@@ -102,9 +102,9 @@ public: | |||
~FLock (); | |||
//-- ILock ----------------------------------------------------------- | |||
virtual void lock () SMTG_OVERRIDE; | |||
virtual void unlock () SMTG_OVERRIDE; | |||
virtual bool trylock () SMTG_OVERRIDE; | |||
void lock () SMTG_OVERRIDE; | |||
void unlock () SMTG_OVERRIDE; | |||
bool trylock () SMTG_OVERRIDE; | |||
//------------------------------------------------------------------------ | |||
protected: | |||
@@ -9,7 +9,7 @@ | |||
// | |||
//----------------------------------------------------------------------------- | |||
// LICENSE | |||
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved | |||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved | |||
//----------------------------------------------------------------------------- | |||
// Redistribution and use in source and binary forms, with or without modification, | |||
// are permitted provided that the following conditions are met: | |||
@@ -55,7 +55,7 @@ | |||
#define INIT_CS(cs) \ | |||
InitializeCriticalSection ((LPCRITICAL_SECTION)&cs); | |||
#endif | |||
#endif // SMTG_OS_WINDOWS | |||
namespace Steinberg { | |||
namespace Base { | |||
@@ -1,6 +1,6 @@ | |||
//----------------------------------------------------------------------------- | |||
// LICENSE | |||
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved | |||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved | |||
//----------------------------------------------------------------------------- | |||
This license applies only to files referencing this license, | |||
for other files of the Software Development Kit the respective embedded license text | |||
@@ -1,7 +1,10 @@ | |||
# Welcome to VST SDK 3 Interfaces | |||
# Welcome to VST 3 SDK Interfaces | |||
Here are located all VST interfaces definitions (including VST Component/Controller, UI, Test). | |||
## License & Usage guidelines | |||
More details are found at [www.steinberg.net/sdklicenses_vst3](http://www.steinberg.net/sdklicenses_vst3) | |||
More details are found at [www.steinberg.net/sdklicenses_vst3](http://www.steinberg.net/sdklicenses_vst3) | |||
---- | |||
Return to [VST 3 SDK](https://github.com/steinbergmedia/vst3sdk) |
@@ -24,7 +24,6 @@ namespace Steinberg { | |||
/** Constant unicode string table. | |||
Used for conversion from ASCII string literals to char16. | |||
*/ | |||
//------------------------------------------------------------------------ | |||
class ConstStringTable | |||
{ | |||
public: | |||
@@ -16,15 +16,13 @@ | |||
//---------------------------------------------------------------------------------------------- | |||
#if SMTG_OS_MACOS | |||
#pragma GCC diagnostic push | |||
#pragma GCC diagnostic ignored "-Wunknown-warning-option" | |||
#pragma GCC diagnostic ignored "-Wunknown-warning-option" | |||
#pragma GCC diagnostic ignored "-Wpragma-pack" | |||
#if SMTG_PLATFORM_64 | |||
#pragma pack(push, 16) | |||
#else | |||
#pragma pack(push, 1) | |||
#endif | |||
#pragma GCC diagnostic pop | |||
#elif defined __BORLANDC__ | |||
#pragma -a8 | |||
#elif SMTG_OS_WINDOWS | |||
@@ -49,22 +49,31 @@ | |||
#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 | |||
#define BYTEORDER kLittleEndian | |||
#define COM_COMPATIBLE 1 | |||
#define PLUGIN_API __stdcall | |||
#define SMTG_PTHREADS 0 | |||
#define SMTG_EXPORT_SYMBOL __declspec (dllexport) | |||
#ifndef _CRT_SECURE_NO_WARNINGS | |||
#define _CRT_SECURE_NO_WARNINGS | |||
#endif | |||
#pragma warning (disable : 4244) // Conversion from 'type1' to 'type2', possible loss of data. | |||
#pragma warning (disable : 4250) // Inheritance via dominance is allowed | |||
#pragma warning (disable : 4996) // deprecated functions | |||
#ifdef _MSC_VER | |||
#pragma warning (disable : 4244) // Conversion from 'type1' to 'type2', possible loss of data. | |||
#pragma warning (disable : 4250) // Inheritance via dominance is allowed | |||
#pragma warning (disable : 4996) // deprecated functions | |||
#pragma warning (3 : 4189) // local variable is initialized but not referenced | |||
#pragma warning (3 : 4238) // nonstandard extension used : class rvalue used as lvalue | |||
#pragma warning (3 : 4189) // local variable is initialized but not referenced | |||
#pragma warning (3 : 4238) // nonstandard extension used : class rvalue used as lvalue | |||
#endif | |||
#if defined (_WIN64) || defined (_M_ARM64) | |||
#define SMTG_PLATFORM_64 1 | |||
@@ -86,13 +95,18 @@ | |||
//----------------------------------------------------------------------------- | |||
// LINUX | |||
//----------------------------------------------------------------------------- | |||
#elif __gnu_linux__ | |||
#elif __gnu_linux__ || __linux__ | |||
#define SMTG_OS_LINUX 1 | |||
#define SMTG_OS_MACOS 0 | |||
#define SMTG_OS_WINDOWS 0 | |||
#define SMTG_OS_IOS 0 | |||
#define SMTG_OS_OSX 0 | |||
#define SMTG_CPU_X86 __i386__ | |||
#define SMTG_CPU_X86_64 __x86_64__ | |||
#define SMTG_CPU_ARM __arm__ | |||
#define SMTG_CPU_ARM_64 __aarch64__ | |||
#include <endian.h> | |||
#if __BYTE_ORDER == __LITTLE_ENDIAN | |||
#define BYTEORDER kLittleEndian | |||
@@ -104,6 +118,8 @@ | |||
#define PLUGIN_API | |||
#define SMTG_PTHREADS 1 | |||
#define SMTG_EXPORT_SYMBOL __attribute__ ((visibility ("default"))) | |||
#if __LP64__ | |||
#define SMTG_PLATFORM_64 1 | |||
#else | |||
@@ -115,7 +131,11 @@ | |||
#ifndef SMTG_CPP11 | |||
#error unsupported compiler | |||
#endif | |||
#define SMTG_CPP11_STDLIBSUPPORT 1 | |||
#if defined(__GNUG__) && __GNUG__ < 8 | |||
#define SMTG_CPP11_STDLIBSUPPORT 0 | |||
#else | |||
#define SMTG_CPP11_STDLIBSUPPORT 1 | |||
#endif | |||
#define SMTG_HAS_NOEXCEPT 1 | |||
#endif | |||
//----------------------------------------------------------------------------- | |||
@@ -129,6 +149,11 @@ | |||
#define SMTG_OS_IOS TARGET_OS_IPHONE | |||
#define SMTG_OS_OSX TARGET_OS_MAC && !TARGET_OS_IPHONE | |||
#define SMTG_CPU_X86 TARGET_CPU_X86 | |||
#define SMTG_CPU_X86_64 TARGET_CPU_X86_64 | |||
#define SMTG_CPU_ARM TARGET_CPU_ARM | |||
#define SMTG_CPU_ARM_64 TARGET_CPU_ARM64 | |||
#if !SMTG_OS_IOS | |||
#ifndef __CF_USE_FRAMEWORK_INCLUDES__ | |||
#define __CF_USE_FRAMEWORK_INCLUDES__ | |||
@@ -152,6 +177,8 @@ | |||
#define PLUGIN_API | |||
#define SMTG_PTHREADS 1 | |||
#define SMTG_EXPORT_SYMBOL __attribute__ ((visibility ("default"))) | |||
#if !defined(__PLIST__) && !defined(SMTG_DISABLE_DEFAULT_DIAGNOSTICS) | |||
#ifdef __clang__ | |||
#pragma GCC diagnostic ignored "-Wswitch-enum" | |||
@@ -209,8 +236,10 @@ | |||
//----------------------------------------------------------------------------- | |||
#if SMTG_CPP11 | |||
#define SMTG_OVERRIDE override | |||
#define SMTG_CONSTEXPR constexpr | |||
#else | |||
#define SMTG_OVERRIDE | |||
#define SMTG_CONSTEXPR | |||
#endif | |||
#if SMTG_HAS_NOEXCEPT | |||
#define SMTG_NOEXCEPT noexcept | |||
@@ -19,7 +19,7 @@ | |||
#include "ftypes.h" | |||
//---------------------------------------------------------------------------- | |||
// string methods defines unicode / ASCII | |||
/** string methods defines unicode / ASCII */ | |||
//---------------------------------------------------------------------------- | |||
// 16 bit string operations | |||
@@ -265,10 +265,8 @@ inline void str8ToStr16 (char16* dst, const char8* src, int32 n = -1) | |||
#else | |||
dst[i] = static_cast<char16> (src[i]); | |||
#endif | |||
if (src[i] == 0) | |||
break; | |||
i++; | |||
} | |||
@@ -93,6 +93,8 @@ namespace Steinberg | |||
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 | |||
@@ -137,8 +139,8 @@ namespace Steinberg | |||
//---------------------------------------------------------------------------- | |||
/** Byte-order Conversion Macros */ | |||
//---------------------------------------------------------------------------- | |||
/** Byte-order Conversion Macros | |||
*/ | |||
#define SWAP_32(l) { \ | |||
unsigned char* p = (unsigned char*)& (l); \ | |||
unsigned char t; \ | |||
@@ -170,7 +172,7 @@ namespace Steinberg | |||
// always inline macros (only when RELEASE is 1) | |||
//---------------------------------------------------------------------------- | |||
#if RELEASE | |||
#if SMTG_OS_MACOS || SMTG_OS_LINUX | |||
#if SMTG_OS_MACOS || SMTG_OS_LINUX || defined(__MINGW32__) | |||
#define SMTG_ALWAYS_INLINE __inline__ __attribute__((__always_inline__)) | |||
#define SMTG_NEVER_INLINE __attribute__((noinline)) | |||
#elif SMTG_OS_WINDOWS | |||
@@ -18,7 +18,7 @@ | |||
#include "fstrdefs.h" | |||
#include <stdio.h> | |||
#include <cstdio> | |||
#if SMTG_OS_WINDOWS | |||
#include <objbase.h> | |||
@@ -26,18 +26,38 @@ | |||
#if SMTG_OS_MACOS | |||
#include <CoreFoundation/CoreFoundation.h> | |||
#include <libkern/OSAtomic.h> | |||
#if !defined (SMTG_USE_STDATOMIC_H) | |||
#if defined(MAC_OS_X_VERSION_10_11) && defined(MAC_OS_X_VERSION_MIN_REQUIRED) | |||
#define SMTG_USE_STDATOMIC_H (MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_11) | |||
#else | |||
#define SMTG_USE_STDATOMIC_H 0 | |||
#endif | |||
#endif // !defined (SMTG_USE_STDATOMIC_H) | |||
#if !SMTG_USE_STDATOMIC_H | |||
#include <libkern/OSAtomic.h> | |||
#if defined(__GNUC__) && (__GNUC__ >= 4) && !__LP64__ | |||
// on 32 bit Mac OS X we can safely ignore the format warnings as sizeof(int) == sizeof(long) | |||
#pragma GCC diagnostic ignored "-Wformat" | |||
#endif | |||
#endif | |||
#endif | |||
#endif // !SMTG_USE_STDATOMIC_H | |||
#endif // SMTG_OS_MACOS | |||
#if SMTG_OS_LINUX | |||
#if !defined (SMTG_USE_STDATOMIC_H) | |||
#if defined (__ANDROID__) || defined(_LIBCPP_VERSION) | |||
#define SMTG_USE_STDATOMIC_H 1 | |||
#else | |||
#include <ext/atomicity.h> | |||
#endif | |||
#endif // !defined (SMTG_USE_STDATOMIC_H) | |||
#include <stdlib.h> | |||
#endif | |||
#if defined (SMTG_USE_STDATOMIC_H) && SMTG_USE_STDATOMIC_H | |||
#include <stdatomic.h> | |||
#endif | |||
namespace Steinberg { | |||
@@ -67,10 +87,19 @@ namespace FUnknownPrivate { | |||
//------------------------------------------------------------------------ | |||
int32 PLUGIN_API atomicAdd (int32& var, int32 d) | |||
{ | |||
#if SMTG_USE_STDATOMIC_H | |||
return atomic_fetch_add (reinterpret_cast<atomic_int_least32_t*> (&var), d) + d; | |||
#else | |||
#if SMTG_OS_WINDOWS | |||
return InterlockedExchangeAdd (&var, d) + d; | |||
#ifdef __MINGW32__ | |||
return InterlockedExchangeAdd (reinterpret_cast<long volatile*>(&var), d) + d; | |||
#else | |||
return InterlockedExchangeAdd ((LONG*)&var, d) + d; | |||
#endif | |||
#elif SMTG_OS_MACOS | |||
return OSAtomicAdd32Barrier (d, (int32_t*)&var); | |||
#elif defined(__ANDROID__) | |||
return atomic_fetch_add ((atomic_int*)&var, d) + d; | |||
#elif SMTG_OS_LINUX | |||
__gnu_cxx::__atomic_add (&var, d); | |||
return var; | |||
@@ -79,6 +108,7 @@ int32 PLUGIN_API atomicAdd (int32& var, int32 d) | |||
var += d; | |||
return var; | |||
#endif | |||
#endif | |||
} | |||
} // FUnknownPrivate | |||
@@ -131,7 +161,7 @@ bool FUID::generate () | |||
{ | |||
case RPC_S_OK: memcpy (data, (char*)&guid, sizeof (TUID)); return true; | |||
case RPC_S_UUID_LOCAL_ONLY: | |||
case (HRESULT)RPC_S_UUID_LOCAL_ONLY: | |||
default: return false; | |||
} | |||
#endif | |||
@@ -147,7 +177,13 @@ bool FUID::generate () | |||
} | |||
return false; | |||
#elif SMTG_OS_LINUX | |||
srand ((size_t)this); | |||
for (int32 i = 0; i < 16; i++) | |||
data[i] = static_cast<unsigned char>(rand ()); | |||
return true; | |||
#else | |||
#warning implement me! | |||
return false; | |||
#endif | |||
} | |||
@@ -263,7 +299,7 @@ void FUID::toString (char8* string) const | |||
return; | |||
#if COM_COMPATIBLE | |||
GuidStruct* g = (GuidStruct*)data; | |||
auto* g = (GuidStruct*)data; | |||
char8 s[17]; | |||
Steinberg::toString8 (s, data, 8, 16); | |||
@@ -349,7 +385,7 @@ void FUID::toRegistryString (char8* string) const | |||
// e.g. {c200e360-38c5-11ce-ae62-08002b2b79ef} | |||
#if COM_COMPATIBLE | |||
GuidStruct* g = (GuidStruct*)data; | |||
auto* g = (GuidStruct*)data; | |||
char8 s1[5]; | |||
Steinberg::toString8 (s1, data, 8, 10); | |||
@@ -19,12 +19,15 @@ | |||
#include "pluginterfaces/base/fplatform.h" | |||
#include "pluginterfaces/base/ftypes.h" | |||
#include "pluginterfaces/base/smartpointer.h" | |||
#include <string.h> | |||
#include <cstring> | |||
#if SMTG_CPP11_STDLIBSUPPORT | |||
#include <type_traits> | |||
#endif | |||
//------------------------------------------------------------------------ | |||
/*! \defgroup pluginBase Basic Interfaces | |||
*/ | |||
//------------------------------------------------------------------------ | |||
//------------------------------------------------------------------------ | |||
// Unique Identifier macros | |||
@@ -33,26 +36,26 @@ | |||
#if COM_COMPATIBLE | |||
#define INLINE_UID(l1, l2, l3, l4) \ | |||
{ \ | |||
(::Steinberg::int8)((l1 & 0x000000FF) ), (::Steinberg::int8)((l1 & 0x0000FF00) >> 8), \ | |||
(::Steinberg::int8)((l1 & 0x00FF0000) >> 16), (::Steinberg::int8)((l1 & 0xFF000000) >> 24), \ | |||
(::Steinberg::int8)((l2 & 0x00FF0000) >> 16), (::Steinberg::int8)((l2 & 0xFF000000) >> 24), \ | |||
(::Steinberg::int8)((l2 & 0x000000FF) ), (::Steinberg::int8)((l2 & 0x0000FF00) >> 8), \ | |||
(::Steinberg::int8)((l3 & 0xFF000000) >> 24), (::Steinberg::int8)((l3 & 0x00FF0000) >> 16), \ | |||
(::Steinberg::int8)((l3 & 0x0000FF00) >> 8), (::Steinberg::int8)((l3 & 0x000000FF) ), \ | |||
(::Steinberg::int8)((l4 & 0xFF000000) >> 24), (::Steinberg::int8)((l4 & 0x00FF0000) >> 16), \ | |||
(::Steinberg::int8)((l4 & 0x0000FF00) >> 8), (::Steinberg::int8)((l4 & 0x000000FF) ) \ | |||
(::Steinberg::int8)(((::Steinberg::uint32)(l1) & 0x000000FF) ), (::Steinberg::int8)(((::Steinberg::uint32)(l1) & 0x0000FF00) >> 8), \ | |||
(::Steinberg::int8)(((::Steinberg::uint32)(l1) & 0x00FF0000) >> 16), (::Steinberg::int8)(((::Steinberg::uint32)(l1) & 0xFF000000) >> 24), \ | |||
(::Steinberg::int8)(((::Steinberg::uint32)(l2) & 0x00FF0000) >> 16), (::Steinberg::int8)(((::Steinberg::uint32)(l2) & 0xFF000000) >> 24), \ | |||
(::Steinberg::int8)(((::Steinberg::uint32)(l2) & 0x000000FF) ), (::Steinberg::int8)(((::Steinberg::uint32)(l2) & 0x0000FF00) >> 8), \ | |||
(::Steinberg::int8)(((::Steinberg::uint32)(l3) & 0xFF000000) >> 24), (::Steinberg::int8)(((::Steinberg::uint32)(l3) & 0x00FF0000) >> 16), \ | |||
(::Steinberg::int8)(((::Steinberg::uint32)(l3) & 0x0000FF00) >> 8), (::Steinberg::int8)(((::Steinberg::uint32)(l3) & 0x000000FF) ), \ | |||
(::Steinberg::int8)(((::Steinberg::uint32)(l4) & 0xFF000000) >> 24), (::Steinberg::int8)(((::Steinberg::uint32)(l4) & 0x00FF0000) >> 16), \ | |||
(::Steinberg::int8)(((::Steinberg::uint32)(l4) & 0x0000FF00) >> 8), (::Steinberg::int8)(((::Steinberg::uint32)(l4) & 0x000000FF) ) \ | |||
} | |||
#else | |||
#define INLINE_UID(l1, l2, l3, l4) \ | |||
{ \ | |||
(::Steinberg::int8)((l1 & 0xFF000000) >> 24), (::Steinberg::int8)((l1 & 0x00FF0000) >> 16), \ | |||
(::Steinberg::int8)((l1 & 0x0000FF00) >> 8), (::Steinberg::int8)((l1 & 0x000000FF) ), \ | |||
(::Steinberg::int8)((l2 & 0xFF000000) >> 24), (::Steinberg::int8)((l2 & 0x00FF0000) >> 16), \ | |||
(::Steinberg::int8)((l2 & 0x0000FF00) >> 8), (::Steinberg::int8)((l2 & 0x000000FF) ), \ | |||
(::Steinberg::int8)((l3 & 0xFF000000) >> 24), (::Steinberg::int8)((l3 & 0x00FF0000) >> 16), \ | |||
(::Steinberg::int8)((l3 & 0x0000FF00) >> 8), (::Steinberg::int8)((l3 & 0x000000FF) ), \ | |||
(::Steinberg::int8)((l4 & 0xFF000000) >> 24), (::Steinberg::int8)((l4 & 0x00FF0000) >> 16), \ | |||
(::Steinberg::int8)((l4 & 0x0000FF00) >> 8), (::Steinberg::int8)((l4 & 0x000000FF) ) \ | |||
(::Steinberg::int8)(((::Steinberg::uint32)(l1) & 0xFF000000) >> 24), (::Steinberg::int8)(((::Steinberg::uint32)(l1) & 0x00FF0000) >> 16), \ | |||
(::Steinberg::int8)(((::Steinberg::uint32)(l1) & 0x0000FF00) >> 8), (::Steinberg::int8)(((::Steinberg::uint32)(l1) & 0x000000FF) ), \ | |||
(::Steinberg::int8)(((::Steinberg::uint32)(l2) & 0xFF000000) >> 24), (::Steinberg::int8)(((::Steinberg::uint32)(l2) & 0x00FF0000) >> 16), \ | |||
(::Steinberg::int8)(((::Steinberg::uint32)(l2) & 0x0000FF00) >> 8), (::Steinberg::int8)(((::Steinberg::uint32)(l2) & 0x000000FF) ), \ | |||
(::Steinberg::int8)(((::Steinberg::uint32)(l3) & 0xFF000000) >> 24), (::Steinberg::int8)(((::Steinberg::uint32)(l3) & 0x00FF0000) >> 16), \ | |||
(::Steinberg::int8)(((::Steinberg::uint32)(l3) & 0x0000FF00) >> 8), (::Steinberg::int8)(((::Steinberg::uint32)(l3) & 0x000000FF) ), \ | |||
(::Steinberg::int8)(((::Steinberg::uint32)(l4) & 0xFF000000) >> 24), (::Steinberg::int8)(((::Steinberg::uint32)(l4) & 0x00FF0000) >> 16), \ | |||
(::Steinberg::int8)(((::Steinberg::uint32)(l4) & 0x0000FF00) >> 8), (::Steinberg::int8)(((::Steinberg::uint32)(l4) & 0x000000FF) ) \ | |||
} | |||
#endif | |||
@@ -117,7 +120,12 @@ public: \ | |||
//------------------------------------------------------------------------ | |||
#define FUNKNOWN_CTOR { __funknownRefCount = 1; } | |||
#if SMTG_FUNKNOWN_DTOR_ASSERT | |||
#include <cassert> | |||
#define FUNKNOWN_DTOR { assert (__funknownRefCount == 0); } | |||
#else | |||
#define FUNKNOWN_DTOR | |||
#endif | |||
//------------------------------------------------------------------------ | |||
#define QUERY_INTERFACE(iid, obj, InterfaceIID, InterfaceName) \ | |||
@@ -221,7 +229,6 @@ int32 PLUGIN_API atomicAdd (int32& value, int32 amount); | |||
Each interface declares its identifier as static member inside the interface | |||
namespace (e.g. FUnknown::iid). | |||
*/ | |||
//------------------------------------------------------------------------ | |||
class FUID | |||
{ | |||
public: | |||
@@ -258,14 +265,14 @@ public: | |||
void from4Int (uint32 d1, uint32 d2, uint32 d3, uint32 d4); | |||
void to4Int (uint32& d1, uint32& d2, uint32& d3, uint32& d4) const; | |||
typedef char8 String[64]; | |||
typedef char8 String[33]; | |||
/** Converts UID to a string. | |||
The string will be 32 characters long, representing the hexadecimal values | |||
of each data byte (e.g. "9127BE30160E4BB69966670AA6087880"). | |||
Typical use-case is: | |||
\code | |||
\code{.cpp} | |||
char8[33] strUID = {0}; | |||
FUID uid; | |||
if (uid.generate ()) | |||
@@ -279,11 +286,11 @@ public: | |||
the ASCII-encoded hexadecimal value of the corresponding data byte. */ | |||
bool fromString (const char8* string); | |||
/** Converts UID to a string in Microsoft® OLE format. | |||
/** Converts UID to a string in Microsoft(R) OLE format. | |||
(e.g. "{c200e360-38c5-11ce-ae62-08002b2b79ef}") */ | |||
void toRegistryString (char8* string) const; | |||
/** Sets the UID data from a string in Microsoft® OLE format. */ | |||
/** Sets the UID data from a string in Microsoft(R) OLE format. */ | |||
bool fromRegistryString (const char8* string); | |||
enum UIDPrintStyle | |||
@@ -348,8 +355,8 @@ inline bool operator== (const FUID& f1, T f2) | |||
Interfaces are identified by 16 byte Globally Unique Identifiers. | |||
The SDK provides a class called FUID for this purpose. | |||
\ref howtoClass */ | |||
//------------------------------------------------------------------------ | |||
\ref howtoClass | |||
*/ | |||
class FUnknown | |||
{ | |||
public: | |||
@@ -362,12 +369,12 @@ public: | |||
\param obj : (out) On return, *obj points to the requested interface */ | |||
virtual tresult PLUGIN_API queryInterface (const TUID _iid, void** obj) = 0; | |||
/** Adds a reference and return the new reference count. | |||
/** Adds a reference and returns the new reference count. | |||
\par Remarks: | |||
The initial reference count after creating an object is 1. */ | |||
virtual uint32 PLUGIN_API addRef () = 0; | |||
/** Releases a reference and return the new reference count. | |||
/** Releases a reference and returns the new reference count. | |||
If the reference count reaches zero, the object will be destroyed in memory. */ | |||
virtual uint32 PLUGIN_API release () = 0; | |||
@@ -384,14 +391,13 @@ DECLARE_CLASS_IID (FUnknown, 0x00000000, 0x00000000, 0xC0000000, 0x00000046) | |||
//------------------------------------------------------------------------ | |||
/** FUnknownPtr - automatic interface conversion and smart pointer in one. | |||
This template class can be used for interface conversion like this: | |||
\code | |||
IPtr<IPath> path = owned (FHostCreate (IPath, hostClasses)); | |||
FUnknownPtr<IPath2> path2 (path); // does a query interface for IPath2 | |||
if (path2) | |||
... | |||
\code{.cpp} | |||
IPtr<IPath> path = owned (FHostCreate (IPath, hostClasses)); | |||
FUnknownPtr<IPath2> path2 (path); // does a query interface for IPath2 | |||
if (path2) | |||
... | |||
\endcode | |||
*/ | |||
//------------------------------------------------------------------------ | |||
template <class I> | |||
class FUnknownPtr : public IPtr<I> | |||
{ | |||
@@ -408,13 +414,83 @@ public: | |||
} | |||
inline I* operator= (FUnknown* unknown); | |||
inline I* getInterface () { return this->ptr; } | |||
#if SMTG_CPP11_STDLIBSUPPORT | |||
inline FUnknownPtr (FUnknownPtr&& p) SMTG_NOEXCEPT : IPtr<I> (std::move (p)) {} | |||
inline FUnknownPtr& operator= (FUnknownPtr&& p) SMTG_NOEXCEPT | |||
{ | |||
IPtr<I>::operator= (std::move (p)); | |||
return *this; | |||
} | |||
#endif | |||
}; | |||
#if SMTG_CPP11_STDLIBSUPPORT | |||
//------------------------------------------------------------------------ | |||
namespace FUnknownPrivate { | |||
template <typename T> | |||
struct Void : std::false_type | |||
{ | |||
using Type = void; | |||
}; | |||
template <typename T> | |||
using VoidT = typename Void<T>::Type; | |||
//------------------------------------------------------------------------ | |||
/** | |||
* This type trait detects if a class has an @c iid member variable. It is used to detect if | |||
* the FUID and DECLARE_CLASS_IID method or the SKI::UID method is used. | |||
*/ | |||
template <typename T, typename U = void> | |||
struct HasIIDType : std::false_type | |||
{ | |||
}; | |||
//------------------------------------------------------------------------ | |||
template <typename T> | |||
struct HasIIDType<T, FUnknownPrivate::VoidT<typename T::IID>> : std::true_type | |||
{ | |||
}; | |||
//------------------------------------------------------------------------ | |||
} // FUnknownPrivate | |||
//------------------------------------------------------------------------ | |||
/** @return the TUID for a SKI interface which uses the SKI::UID method. */ | |||
template <typename T, | |||
typename std::enable_if<FUnknownPrivate::HasIIDType<T>::value>::type* = nullptr> | |||
const TUID& getTUID () | |||
{ | |||
return T::IID::toTUID (); | |||
} | |||
//------------------------------------------------------------------------ | |||
/** @return the TUID for a SKI interface which uses the FUID and DECLARE_CLASS_IID method. */ | |||
template <typename T, | |||
typename std::enable_if<!FUnknownPrivate::HasIIDType<T>::value>::type* = nullptr> | |||
const TUID& getTUID () | |||
{ | |||
return T::iid.toTUID (); | |||
} | |||
#else // SMTG_CPP11_STDLIBSUPPORT | |||
template<typename T> | |||
const TUID& getTUID () | |||
{ | |||
return T::iid.toTUID (); | |||
} | |||
#endif // SMTG_CPP11_STDLIBSUPPORT | |||
//------------------------------------------------------------------------ | |||
template <class I> | |||
inline FUnknownPtr<I>::FUnknownPtr (FUnknown* unknown) | |||
{ | |||
if (unknown && unknown->queryInterface (I::iid, (void**)&this->ptr) != kResultOk) | |||
if (unknown && unknown->queryInterface (getTUID<I> (), (void**)&this->ptr) != kResultOk) | |||
this->ptr = 0; | |||
} | |||
@@ -423,7 +499,7 @@ template <class I> | |||
inline I* FUnknownPtr<I>::operator= (FUnknown* unknown) | |||
{ | |||
I* newPtr = 0; | |||
if (unknown && unknown->queryInterface (I::iid, (void**)&newPtr) == kResultOk) | |||
if (unknown && unknown->queryInterface (getTUID<I> (), (void**)&newPtr) == kResultOk) | |||
{ | |||
OPtr<I> rel (newPtr); | |||
return IPtr<I>::operator= (newPtr); | |||
@@ -440,26 +516,25 @@ This class is obsolete and is only kept for compatibility. | |||
The replacement for FReleaser is OPtr. | |||
Usage example with FReleaser: | |||
\code | |||
void someFunction () | |||
{ | |||
IPath* path = pathCreateMethod (); | |||
FReleaser releaser (path); | |||
.... do something with path... | |||
.... path not used anymore, releaser will destroy it when leaving function scope | |||
} | |||
\endcode | |||
\code{.cpp} | |||
void someFunction () | |||
{ | |||
IPath* path = pathCreateMethod (); | |||
FReleaser releaser (path); | |||
.... do something with path... | |||
.... path not used anymore, releaser will destroy it when leaving function scope | |||
} | |||
\endcode | |||
Usage example with OPtr: | |||
\code | |||
void someFunction () | |||
{ | |||
OPtr<IPath> path = pathCreateMethod (); | |||
.... do something with path... | |||
.... path not used anymore, OPtr will destroy it when leaving function scope | |||
} | |||
\endcode | |||
\code{.cpp} | |||
void someFunction () | |||
{ | |||
OPtr<IPath> path = pathCreateMethod (); | |||
.... do something with path... | |||
.... path not used anymore, OPtr will destroy it when leaving function scope | |||
} | |||
\endcode | |||
*/ | |||
//------------------------------------------------------------------------ | |||
struct FReleaser | |||
{ | |||
FReleaser (FUnknown* u) : u (u) {} | |||
@@ -138,10 +138,10 @@ public: | |||
return (type & kInteger) ? static_cast<double> (intValue) : (type & kFloat) ? floatValue : | |||
0.; | |||
} | |||
inline const char8* getString8 () const { return (type & kString8) ? string8 : 0; } | |||
inline const char16* getString16 () const { return (type & kString16) ? string16 : 0; } | |||
inline const char8* getString8 () const { return (type & kString8) ? string8 : nullptr; } | |||
inline const char16* getString16 () const { return (type & kString16) ? string16 : nullptr; } | |||
inline FUnknown* getObject () const { return (type & kObject) ? object : 0; } | |||
inline FUnknown* getObject () const { return (type & kObject) ? object : nullptr; } | |||
inline uint16 getType () const { return static_cast<uint16> (type & ~(kOwner)); } | |||
inline bool isEmpty () const { return getType () == kEmpty; } | |||
@@ -274,7 +274,7 @@ inline FVariant& FVariant::operator= (const FVariant& variant) | |||
} | |||
else if ((type & kString16) && variant.string16) | |||
{ | |||
int32 len = strlen16 (variant.string16); | |||
auto len = static_cast<size_t> (strlen16 (variant.string16)); | |||
string16 = new char16[len + 1]; | |||
char16* tmp = const_cast<char16*> (string16); | |||
memcpy (tmp, variant.string16, len * sizeof (char16)); | |||
@@ -26,8 +26,6 @@ namespace Steinberg { | |||
- read/write binary data from/to stream | |||
- get/set stream read-write position (read and write position is the same) | |||
*/ | |||
//------------------------------------------------------------------------ | |||
class IBStream: public FUnknown | |||
{ | |||
public: | |||
@@ -43,19 +41,19 @@ public: | |||
\param buffer : destination buffer | |||
\param numBytes : amount of bytes to be read | |||
\param numBytesRead : result - how many bytes have been read from stream (set to 0 if this is of no interest) */ | |||
virtual tresult PLUGIN_API read (void* buffer, int32 numBytes, int32* numBytesRead = 0) = 0; | |||
virtual tresult PLUGIN_API read (void* buffer, int32 numBytes, int32* numBytesRead = nullptr) = 0; | |||
/** Writes binary data to stream. | |||
\param buffer : source buffer | |||
\param numBytes : amount of bytes to write | |||
\param numBytesWritten : result - how many bytes have been written to stream (set to 0 if this is of no interest) */ | |||
virtual tresult PLUGIN_API write (void* buffer, int32 numBytes, int32* numBytesWritten = 0) = 0; | |||
virtual tresult PLUGIN_API write (void* buffer, int32 numBytes, int32* numBytesWritten = nullptr) = 0; | |||
/** Sets stream read-write position. | |||
\param pos : new stream position (dependent on mode) | |||
\param mode : value of enum IStreamSeekMode | |||
\param result : new seek position (set to 0 if this is of no interest) */ | |||
virtual tresult PLUGIN_API seek (int64 pos, int32 mode, int64* result = 0) = 0; | |||
virtual tresult PLUGIN_API seek (int64 pos, int32 mode, int64* result = nullptr) = 0; | |||
/** Gets current stream read-write position. | |||
\param pos : is assigned the current position if function succeeds */ | |||
@@ -69,8 +67,8 @@ DECLARE_CLASS_IID (IBStream, 0xC3BF6EA2, 0x30994752, 0x9B6BF990, 0x1EE33E9B) | |||
//------------------------------------------------------------------------ | |||
/** Stream with a size. | |||
\ingroup pluginBase | |||
[extends IBStream] when stream type supports it (like file and memory stream) */ | |||
//------------------------------------------------------------------------ | |||
[extends IBStream] when stream type supports it (like file and memory stream) | |||
*/ | |||
class ISizeableStream: public FUnknown | |||
{ | |||
public: | |||
@@ -22,10 +22,9 @@ namespace Steinberg { | |||
//------------------------------------------------------------------------ | |||
/** Interface allowing an object to be copied. | |||
[plug & host imp] \n | |||
[released: N4.12] \n | |||
- [plug & host imp] | |||
- [released: N4.12] | |||
*/ | |||
//------------------------------------------------------------------------ | |||
class ICloneable : public FUnknown | |||
{ | |||
public: | |||
@@ -29,9 +29,9 @@ This interface is used to store/restore attributes of an object. | |||
An IPlugController can implement this interface to handle presets. | |||
The gui-xml for a preset control looks like this: | |||
\code | |||
.... | |||
<view name="PresetView" data="Preset"/> | |||
.... | |||
.... | |||
<view name="PresetView" data="Preset"/> | |||
.... | |||
<template name="PresetView"> | |||
<view name="preset control" size="0, 0, 100, 20"/> | |||
<switch name="store preset" size="125,0,80,20" style="push|immediate" title="Store" /> | |||
@@ -41,7 +41,6 @@ The gui-xml for a preset control looks like this: | |||
The tag data="Preset" tells the host to create a preset controller that handles the | |||
3 values named "preset control", "store preset", and "remove preset". | |||
*/ | |||
//------------------------------------------------------------------------ | |||
class IPersistent: public FUnknown | |||
{ | |||
public: | |||
@@ -63,7 +62,8 @@ DECLARE_CLASS_IID (IPersistent, 0xBA1A4637, 0x3C9F46D0, 0xA65DBA0E, 0xB85DA829) | |||
typedef FIDString IAttrID; | |||
//------------------------------------------------------------------------ | |||
/** Object Data Archive Interface. | |||
[host imp] \n | |||
- [host imp] | |||
- store data/objects/binary/subattributes in the archive | |||
- read stored data from the archive | |||
@@ -76,7 +76,6 @@ in namespace PAttributes (public.sdk/source/common/pattributes.h+cpp) !! | |||
\ingroup frameworkHostClasses | |||
*/ | |||
//------------------------------------------------------------------------ | |||
class IAttributes: public FUnknown | |||
{ | |||
public: | |||
@@ -139,11 +138,11 @@ DECLARE_CLASS_IID (IAttributes, 0xFA1E32F9, 0xCA6D46F5, 0xA982F956, 0xB1191B58) | |||
//------------------------------------------------------------------------ | |||
/** Extended access to Attributes; supports Attribute retrieval via iteration. | |||
[host imp] \n | |||
[released] C7/N6 \n | |||
- [host imp] | |||
- [released] C7/N6 | |||
\ingroup frameworkHostClasses | |||
*/ | |||
//------------------------------------------------------------------------ | |||
class IAttributes2 : public IAttributes | |||
{ | |||
public: | |||
@@ -22,27 +22,27 @@ | |||
namespace Steinberg { | |||
//------------------------------------------------------------------------ | |||
/** Basic interface to a Plug-in component. | |||
/** Basic interface to a plug-in component: IPluginBase | |||
\ingroup pluginBase | |||
- [plug imp] | |||
- initialize/terminate the Plug-in component | |||
- initialize/terminate the plug-in component | |||
The host uses this interface to initialize and to terminate the Plug-in component. | |||
The host uses this interface to initialize and to terminate the plug-in component. | |||
The context that is passed to the initialize method contains any interface to the | |||
host that the Plug-in will need to work. These interfaces can vary from category to category. | |||
host that the plug-in will need to work. These interfaces can vary from category to category. | |||
A list of supported host context interfaces should be included in the documentation | |||
of a specific category. */ | |||
//------------------------------------------------------------------------ | |||
of a specific category. | |||
*/ | |||
class IPluginBase: public FUnknown | |||
{ | |||
public: | |||
//------------------------------------------------------------------------ | |||
/** The host passes a number of interfaces as context to initialize the Plug-in class. | |||
/** The host passes a number of interfaces as context to initialize the plug-in class. | |||
@note Extensive memory allocations etc. should be performed in this method rather than in the class' constructor! | |||
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 | |||
/** This function is called before the plug-in is unloaded and can be used for | |||
cleanups. You have to release all references to any host application interfaces. */ | |||
virtual tresult PLUGIN_API terminate () = 0; | |||
@@ -54,10 +54,9 @@ DECLARE_CLASS_IID (IPluginBase, 0x22888DDB, 0x156E45AE, 0x8358B348, 0x08190625) | |||
//------------------------------------------------------------------------ | |||
/** Basic Information about the class factory of the Plug-in. | |||
/** Basic Information about the class factory of the plug-in. | |||
\ingroup pluginBase | |||
*/ | |||
//------------------------------------------------------------------------ | |||
struct PFactoryInfo | |||
{ | |||
//------------------------------------------------------------------------ | |||
@@ -66,8 +65,8 @@ struct PFactoryInfo | |||
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 won't be unloaded until process exit | |||
kUnicode = 1 << 4 ///< Components have entirely unicode encoded strings. (True for VST 3 Plug-ins so far) | |||
kComponentNonDiscardable = 1 << 3, ///< Component will not be unloaded until process exit | |||
kUnicode = 1 << 4 ///< Components have entirely unicode encoded strings. (True for VST 3 plug-ins so far) | |||
}; | |||
enum | |||
@@ -101,10 +100,9 @@ struct PFactoryInfo | |||
}; | |||
//------------------------------------------------------------------------ | |||
/** Basic Information about a class provided by the Plug-in. | |||
/** Basic Information about a class provided by the plug-in. | |||
\ingroup pluginBase | |||
*/ | |||
//------------------------------------------------------------------------ | |||
struct PClassInfo | |||
{ | |||
//------------------------------------------------------------------------ | |||
@@ -142,28 +140,26 @@ struct PClassInfo | |||
#endif | |||
}; | |||
//------------------------------------------------------------------------ | |||
// IPluginFactory interface declaration | |||
//------------------------------------------------------------------------ | |||
/** Class factory that any Plug-in defines for creating class instances. | |||
/** Class factory that any plug-in defines for creating class instances: IPluginFactory | |||
\ingroup pluginBase | |||
- [plug imp] | |||
From the host's point of view a Plug-in module is a factory which can create | |||
From the host's point of view a plug-in module is a factory which can create | |||
a certain kind of object(s). The interface IPluginFactory provides methods | |||
to get information about the classes exported by the Plug-in and a | |||
to get information about the classes exported by the plug-in and a | |||
mechanism to create instances of these classes (that usually define the IPluginBase interface). | |||
<b> An implementation is provided in public.sdk/source/common/pluginfactory.cpp </b> | |||
\see GetPluginFactory | |||
*/ | |||
//------------------------------------------------------------------------ | |||
class IPluginFactory : public FUnknown | |||
{ | |||
public: | |||
//------------------------------------------------------------------------ | |||
/** Fill a PFactoryInfo structure with information about the Plug-in vendor. */ | |||
/** Fill a PFactoryInfo structure with information about the plug-in vendor. */ | |||
virtual tresult PLUGIN_API getFactoryInfo (PFactoryInfo* info) = 0; | |||
/** Returns the number of exported classes by this factory. | |||
@@ -184,15 +180,14 @@ DECLARE_CLASS_IID (IPluginFactory, 0x7A4D811C, 0x52114A1F, 0xAED9D2EE, 0x0B43BF9 | |||
//------------------------------------------------------------------------ | |||
/** Version 2 of Basic Information about a class provided by the Plug-in. | |||
/** Version 2 of Basic Information about a class provided by the plug-in. | |||
\ingroup pluginBase | |||
*/ | |||
//------------------------------------------------------------------------ | |||
struct PClassInfo2 | |||
{ | |||
//------------------------------------------------------------------------ | |||
TUID cid; ///< Class ID 16 Byte class GUID | |||
int32 cardinality; ///< cardinality of the class, set to kManyInstances (see \ref ClassCardinality) | |||
int32 cardinality; ///< cardinality of the class, set to kManyInstances (see \ref PClassInfo::ClassCardinality) | |||
char8 category[PClassInfo::kCategorySize]; ///< class category, host uses this to categorize interfaces | |||
char8 name[PClassInfo::kNameSize]; ///< class name, visible to the user | |||
@@ -252,11 +247,10 @@ struct PClassInfo2 | |||
//------------------------------------------------------------------------ | |||
// IPluginFactory2 interface declaration | |||
//------------------------------------------------------------------------ | |||
/** Version 2 of class factory supporting PClassInfo2. | |||
/** Version 2 of class factory supporting PClassInfo2: IPluginFactory2 | |||
\ingroup pluginBase | |||
\copydoc IPluginFactory | |||
*/ | |||
//------------------------------------------------------------------------ | |||
class IPluginFactory2 : public IPluginFactory | |||
{ | |||
public: | |||
@@ -271,8 +265,8 @@ DECLARE_CLASS_IID (IPluginFactory2, 0x0007B650, 0xF24B4C0B, 0xA464EDB9, 0xF00B2A | |||
//------------------------------------------------------------------------ | |||
/** Unicode Version of Basic Information about a class provided by the Plug-in */ | |||
//------------------------------------------------------------------------ | |||
/** Unicode Version of Basic Information about a class provided by the plug-in | |||
*/ | |||
struct PClassInfoW | |||
{ | |||
//------------------------------------------------------------------------ | |||
@@ -347,15 +341,13 @@ struct PClassInfoW | |||
} | |||
}; | |||
//------------------------------------------------------------------------ | |||
// IPluginFactory3 interface declaration | |||
//------------------------------------------------------------------------ | |||
/** Version 3 of class factory supporting PClassInfoW. | |||
/** Version 3 of class factory supporting PClassInfoW: IPluginFactory3 | |||
\ingroup pluginBase | |||
\copydoc IPluginFactory | |||
*/ | |||
//------------------------------------------------------------------------ | |||
class IPluginFactory3 : public IPluginFactory2 | |||
{ | |||
public: | |||
@@ -373,7 +365,6 @@ DECLARE_CLASS_IID (IPluginFactory3, 0x4555A2AB, 0xC1234E57, 0x9B122910, 0x368789 | |||
//------------------------------------------------------------------------ | |||
} // namespace Steinberg | |||
//------------------------------------------------------------------------ | |||
#define LICENCE_UID(l1, l2, l3, l4) \ | |||
{ \ | |||
@@ -387,50 +378,48 @@ DECLARE_CLASS_IID (IPluginFactory3, 0x4555A2AB, 0xC1234E57, 0x9B122910, 0x368789 | |||
(int8)((l4 & 0x0000FF00) >> 8), (int8)((l4 & 0x000000FF) ) \ | |||
} | |||
//------------------------------------------------------------------------ | |||
// GetPluginFactory | |||
//------------------------------------------------------------------------ | |||
/** Plug-in entry point. | |||
\ingroup pluginBase | |||
Any Plug-in must define and export this function. \n | |||
Any plug-in must define and export this function. \n | |||
A typical implementation of GetPluginFactory looks like this | |||
\code | |||
IPluginFactory* PLUGIN_API GetPluginFactory () | |||
\code{.cpp} | |||
SMTG_EXPORT_SYMBOL IPluginFactory* PLUGIN_API GetPluginFactory () | |||
{ | |||
if (!gPluginFactory) | |||
{ | |||
if (!gPluginFactory) | |||
static PFactoryInfo factoryInfo = | |||
{ | |||
static PFactoryInfo factoryInfo = | |||
{ | |||
"My Company Name", | |||
"http://www.mywebpage.com", | |||
"mailto:myemail@address.com", | |||
PFactoryInfo::kNoFlags | |||
}; | |||
gPluginFactory = new CPluginFactory (factoryInfo); | |||
static PClassInfo componentClass = | |||
{ | |||
INLINE_UID (0x00000000, 0x00000000, 0x00000000, 0x00000000), // replace by a valid uid | |||
1, | |||
"Service", // category | |||
"Name" | |||
}; | |||
gPluginFactory->registerClass (&componentClass, MyComponentClass::newInstance); | |||
} | |||
else | |||
gPluginFactory->addRef (); | |||
return gPluginFactory; | |||
"My Company Name", | |||
"http://www.mywebpage.com", | |||
"mailto:myemail@address.com", | |||
PFactoryInfo::kNoFlags | |||
}; | |||
gPluginFactory = new CPluginFactory (factoryInfo); | |||
static PClassInfo componentClass = | |||
{ | |||
INLINE_UID (0x00000000, 0x00000000, 0x00000000, 0x00000000), // replace by a valid uid | |||
1, | |||
"Service", // category | |||
"Name" | |||
}; | |||
gPluginFactory->registerClass (&componentClass, MyComponentClass::newInstance); | |||
} | |||
\endcode | |||
else | |||
gPluginFactory->addRef (); | |||
return gPluginFactory; | |||
} | |||
\endcode | |||
\see \ref loadPlugin | |||
*/ | |||
//------------------------------------------------------------------------ | |||
extern "C" | |||
{ | |||
Steinberg::IPluginFactory* PLUGIN_API GetPluginFactory (); | |||
SMTG_EXPORT_SYMBOL Steinberg::IPluginFactory* PLUGIN_API GetPluginFactory (); | |||
typedef Steinberg::IPluginFactory* (PLUGIN_API *GetFactoryProc) (); | |||
} |
@@ -25,9 +25,9 @@ namespace Steinberg { | |||
In order to manage memory allocation and deallocation properly, | |||
this interface is used to transfer a string as result parameter of | |||
a method requires a string of unknown size. | |||
[host imp] or [plug imp] \n | |||
[released: SX 4] */ | |||
//------------------------------------------------------------------------ | |||
- [host imp] or [plug imp] | |||
- [released: SX 4] | |||
*/ | |||
class IStringResult : public FUnknown | |||
{ | |||
public: | |||
@@ -43,9 +43,9 @@ DECLARE_CLASS_IID (IStringResult, 0x550798BC, 0x872049DB, 0x84920A15, 0x3B50B7A8 | |||
//------------------------------------------------------------------------ | |||
/** Interface to a string of variable size and encoding. | |||
[host imp] or [plug imp] \n | |||
[released: ] */ | |||
//------------------------------------------------------------------------ | |||
- [host imp] or [plug imp] | |||
- [released: ] | |||
*/ | |||
class IString : public FUnknown | |||
{ | |||
public: | |||
@@ -24,9 +24,9 @@ class IDependent; | |||
//------------------------------------------------------------------------ | |||
/** Host implements dependency handling for plugins. | |||
[host imp] \n | |||
[get this interface from IHostClasses] \n | |||
[released N3.1] \n | |||
- [host imp] | |||
- [get this interface from IHostClasses] | |||
- [released N3.1] | |||
- Install/Remove change notifications | |||
- Trigger updates when an object has changed | |||
@@ -37,7 +37,6 @@ inside the Plug-In to handle internal updates! | |||
\see IDependent | |||
\ingroup frameworkHostClasses | |||
*/ | |||
//------------------------------------------------------------------------ | |||
class IUpdateHandler: public FUnknown | |||
{ | |||
public: | |||
@@ -73,7 +72,6 @@ DECLARE_CLASS_IID (IUpdateHandler, 0xF5246D56, 0x86544d60, 0xB026AFB5, 0x7B697B3 | |||
\see IUpdateHandler | |||
\ingroup frameworkHostClasses | |||
*/ | |||
//------------------------------------------------------------------------ | |||
class IDependent: public FUnknown | |||
{ | |||
public: | |||
@@ -34,12 +34,11 @@ namespace Steinberg { | |||
- handles refCount of the interface | |||
- Usage example: | |||
\code | |||
IPtr<IPath> path (sharedPath); | |||
if (path) | |||
path->ascend (); | |||
IPtr<IPath> path (sharedPath); | |||
if (path) | |||
path->ascend (); | |||
\endcode | |||
*/ | |||
//------------------------------------------------------------------------ | |||
template <class I> | |||
class IPtr | |||
{ | |||
@@ -80,7 +79,7 @@ public: | |||
template <typename T> | |||
inline IPtr (IPtr<T>&& movePtr) SMTG_NOEXCEPT : ptr (movePtr.take ()) { } | |||
inline IPtr& operator= (IPtr<I>&& movePtr) | |||
inline IPtr& operator= (IPtr<I>&& movePtr) SMTG_NOEXCEPT | |||
{ | |||
if (ptr) | |||
ptr->release (); | |||
@@ -98,6 +97,7 @@ public: | |||
ptr = movePtr.take (); | |||
return *this; | |||
} | |||
#endif | |||
inline void reset (I* obj = nullptr) | |||
{ | |||
@@ -116,7 +116,6 @@ public: | |||
template <typename T> | |||
static IPtr<T> adopt (T* obj) SMTG_NOEXCEPT { return IPtr<T> (obj, false); } | |||
#endif | |||
//------------------------------------------------------------------------ | |||
protected: | |||
I* ptr; | |||
@@ -206,7 +205,6 @@ inline IPtr<I>& IPtr<I>::operator= (const IPtr<I>& _ptr) | |||
\endcode | |||
This will lead to a leak! | |||
*/ | |||
//------------------------------------------------------------------------ | |||
template <class I> | |||
class OPtr : public IPtr<I> | |||
{ | |||
@@ -19,25 +19,37 @@ | |||
#include "pluginterfaces/base/fplatform.h" | |||
#if SMTG_CPP11 | |||
#define SMTG_TYPE_STATIC_CHECK(Operator, Type, Platform64Size, MacOS32Size, Win32Size, \ | |||
Linux32Size) \ | |||
namespace { \ | |||
template <typename Type, size_t w, size_t x, size_t y, size_t z> \ | |||
struct Operator##Check##Type \ | |||
{ \ | |||
constexpr Operator##Check##Type () \ | |||
{ \ | |||
static_assert (Operator (Type) == \ | |||
(SMTG_PLATFORM_64 ? w : SMTG_OS_MACOS ? x : SMTG_OS_LINUX ? z : y), \ | |||
"Struct " #Operator " error: " #Type); \ | |||
} \ | |||
}; \ | |||
static constexpr Operator##Check##Type<Type, Platform64Size, MacOS32Size, Win32Size, \ | |||
Linux32Size> \ | |||
instance##Operator##Type; \ | |||
} | |||
/** Check the size of a structure depending on compilation platform | |||
* Used to check that structure sizes don't change between SDK releases. | |||
*/ | |||
#define SMTG_TYPE_SIZE_CHECK(Type, Platform64Size, MacOS32Size, Win32Size, Linux32Size) \ | |||
namespace { \ | |||
template <typename Type, size_t w, size_t x, size_t y, size_t z> \ | |||
struct SizeCheck##Type \ | |||
{ \ | |||
constexpr SizeCheck##Type () \ | |||
{ \ | |||
static_assert (sizeof (Type) == (SMTG_PLATFORM_64 ? w : SMTG_OS_MACOS ? x : SMTG_OS_LINUX ? z : y), \ | |||
"Struct Size Error: " #Type); \ | |||
} \ | |||
}; \ | |||
static constexpr SizeCheck##Type<Type, Platform64Size, MacOS32Size, Win32Size, Linux32Size> instance##Type; \ | |||
} | |||
#define SMTG_TYPE_SIZE_CHECK(Type, Platform64Size, MacOS32Size, Win32Size, Linux32Size) \ | |||
SMTG_TYPE_STATIC_CHECK (sizeof, Type, Platform64Size, MacOS32Size, Win32Size, Linux32Size) | |||
/** Check the alignment of a structure depending on compilation platform | |||
* Used to check that structure alignments don't change between SDK releases. | |||
*/ | |||
#define SMTG_TYPE_ALIGN_CHECK(Type, Platform64Size, MacOS32Size, Win32Size, Linux32Size) \ | |||
SMTG_TYPE_STATIC_CHECK (alignof, Type, Platform64Size, MacOS32Size, Win32Size, Linux32Size) | |||
#else | |||
// need static_assert | |||
#define SMTG_TYPE_SIZE_CHECK(Type, Platform64Size, MacOS32Size, Win32Size, Linux32Size) | |||
#endif | |||
@@ -17,8 +17,11 @@ | |||
#include "ustring.h" | |||
#if SMTG_OS_WINDOWS | |||
#include <stdio.h> | |||
#pragma warning (disable : 4996) | |||
#include <cstdio> | |||
#ifdef _MSC_VER | |||
#pragma warning (disable : 4996) // deprecated functions | |||
#endif | |||
#elif SMTG_OS_MACOS | |||
#include <CoreFoundation/CoreFoundation.h> | |||
@@ -78,7 +81,7 @@ void StringCopy (TDstChar* dst, int32 dstSize, const TSrcChar* src, int32 srcSiz | |||
} | |||
//------------------------------------------------------------------------ | |||
/** Find length of null-terminated string. */ | |||
/** Find length of null-terminated string, i.e. StringLength (L"ABC\0") => 3 */ | |||
//------------------------------------------------------------------------ | |||
template <class TSrcChar> | |||
int32 StringLength (const TSrcChar* src, int32 srcSize = -1) | |||
@@ -22,33 +22,35 @@ | |||
namespace Steinberg { | |||
//------------------------------------------------------------------------ | |||
/** UTF-16 string class without buffer management. */ | |||
//------------------------------------------------------------------------ | |||
/** UTF-16 string class without buffer management. | |||
Note: that some characters are encoded in 2 UTF16 code units (surrogate pair), | |||
this means that getLength returns the number of code unit, not the count of character! */ | |||
class UString | |||
{ | |||
public: | |||
//------------------------------------------------------------------------ | |||
UString (char16* buffer, int32 size) | |||
: thisBuffer (buffer), | |||
thisSize (size) | |||
{} | |||
/** Construct from UTF-16 string, size is in code unit (count of char16) */ | |||
UString (char16* buffer, int32 size) : thisBuffer (buffer), thisSize (size) {} | |||
int32 getSize () const { return thisSize; } ///< returns buffer size | |||
operator const char16* () const { return thisBuffer; } ///< cast to char16* | |||
/** returns buffer size */ | |||
int32 getSize () const { return thisSize; } | |||
/** cast to char16* */ | |||
operator const char16* () const { return thisBuffer; } | |||
/** Returns length of string (in code units). */ | |||
/** Returns length of string (in code unit). Note this is not the count of character! */ | |||
int32 getLength () const; | |||
/** Copy from UTF-16 buffer. */ | |||
/** Copy from UTF-16 buffer (srcSize is in code unit (count of char16)). */ | |||
UString& assign (const char16* src, int32 srcSize = -1); | |||
/** Append UTF-16 buffer. */ | |||
/** Append UTF-16 buffer (srcSize is in code unit (count of char16)). */ | |||
UString& append (const char16* src, int32 srcSize = -1); | |||
/** Copy to UTF-16 buffer. */ | |||
/** Copy to UTF-16 buffer (dstSize is in code unit (count of char16)). */ | |||
const UString& copyTo (char16* dst, int32 dstSize) const; | |||
/** Copy from ASCII string. */ | |||
/** Copy from ASCII string (srcSize is in code unit (count of char16)). */ | |||
UString& fromAscii (const char* src, int32 srcSize = -1); | |||
UString& assign (const char* src, int32 srcSize = -1) { return fromAscii (src, srcSize); } | |||
@@ -69,42 +71,46 @@ public: | |||
//------------------------------------------------------------------------ | |||
protected: | |||
char16* thisBuffer; | |||
int32 thisSize; | |||
int32 thisSize; ///< size in code unit (not in byte!) | |||
}; | |||
//------------------------------------------------------------------------ | |||
/** UTF-16 string with fixed buffer size. */ | |||
//------------------------------------------------------------------------ | |||
template<int32 maxSize> | |||
class UStringBuffer: public UString | |||
/** UTF-16 string with fixed buffer size. | |||
*/ | |||
template <int32 maxSize> | |||
class UStringBuffer : public UString | |||
{ | |||
public: | |||
//------------------------------------------------------------------------ | |||
UStringBuffer () | |||
: UString (data, maxSize) | |||
{ data[0] = 0; } | |||
UStringBuffer () : UString (data, maxSize) { data[0] = 0; } | |||
/** Construct from UTF-16 string. */ | |||
UStringBuffer (const char16* src, int32 srcSize = -1) | |||
: UString (data, maxSize) | |||
{ data[0] = 0; if (src) assign (src, srcSize); } | |||
UStringBuffer (const char16* src, int32 srcSize = -1) : UString (data, maxSize) | |||
{ | |||
data[0] = 0; | |||
if (src) | |||
assign (src, srcSize); | |||
} | |||
/** Construct from ASCII string. */ | |||
UStringBuffer (const char* src, int32 srcSize = -1) | |||
: UString (data, maxSize) | |||
{ data[0] = 0; if (src) fromAscii (src, srcSize); } | |||
UStringBuffer (const char* src, int32 srcSize = -1) : UString (data, maxSize) | |||
{ | |||
data[0] = 0; | |||
if (src) | |||
fromAscii (src, srcSize); | |||
} | |||
//------------------------------------------------------------------------ | |||
protected: | |||
char16 data[maxSize]; | |||
}; | |||
//------------------------------------------------------------------------ | |||
typedef UStringBuffer<128> UString128; ///< 128 character UTF-16 string | |||
typedef UStringBuffer<256> UString256; ///< 256 character UTF-16 string | |||
typedef UStringBuffer<128> UString128; ///< 128 character UTF-16 string | |||
typedef UStringBuffer<256> UString256; ///< 256 character UTF-16 string | |||
} // namespace Steinberg | |||
//------------------------------------------------------------------------ | |||
#define USTRING(asciiString) Steinberg::UString256 (asciiString) | |||
#define USTRINGSIZE(var) (sizeof (var) / sizeof (Steinberg::char16)) | |||
#define USTRING(asciiString) Steinberg::UString256 (asciiString) | |||
#define USTRINGSIZE(var) (sizeof (var) / sizeof (Steinberg::char16)) | |||
//------------------------------------------------------------------------ |
@@ -31,7 +31,6 @@ class IPlugFrame; | |||
/** Graphical rectangle structure. Used with IPlugView. | |||
\ingroup pluginGUI | |||
*/ | |||
//------------------------------------------------------------------------ | |||
struct ViewRect | |||
{ | |||
ViewRect (int32 l = 0, int32 t = 0, int32 r = 0, int32 b = 0) | |||
@@ -55,7 +54,7 @@ SMTG_TYPE_SIZE_CHECK (ViewRect, 16, 16, 16, 16) | |||
/** \defgroup platformUIType Platform UI Types | |||
\ingroup pluginGUI | |||
List of Platform UI types for IPlugView. This list is used to match the GUI-System between | |||
the host and a Plug-in in case that an OS provides multiple GUI-APIs. | |||
the host and a plug-in in case that an OS provides multiple GUI-APIs. | |||
*/ | |||
/*@{*/ | |||
/** The parent parameter in IPlugView::attached() is a HWND handle. | |||
@@ -89,38 +88,37 @@ const FIDString kPlatformTypeX11EmbedWindowID = "X11EmbedWindowID"; ///< X11 Win | |||
- [released: 3.0.0] | |||
\par Sizing of a view | |||
Usually the size of a Plug-in view is fixed. But both the host and the Plug-in can cause | |||
Usually, the size of a plug-in view is fixed. But both the host and the plug-in can cause | |||
a view to be resized: | |||
\n | |||
- <b> Host </b> : If IPlugView::canResize () returns kResultTrue the host will setup the window | |||
so that the user can resize it. While the user resizes the window | |||
IPlugView::checkSizeConstraint () is called, allowing the Plug-in to change the size to a valid | |||
rect. The host then resizes the window to this rect and has to call IPlugView::onSize (). | |||
- \b Host: If IPlugView::canResize () returns kResultTrue the host will set up the window | |||
so that the user can resize it. While the user resizes the window, | |||
IPlugView::checkSizeConstraint () is called, allowing the plug-in to change the size to a valid | |||
a valid supported rectangle size. The host then resizes the window to this rect and has to call IPlugView::onSize (). | |||
\n | |||
\n | |||
- <b> Plug-in </b> : The Plug-in can call IPlugFrame::resizeView () and cause the host to resize the | |||
window. | |||
Afterwards in the same callstack the host has to call IPlugView::onSize () if a resize is needed (size was changed). | |||
- \b Plug-in: The plug-in can call IPlugFrame::resizeView () and cause the host to resize the | |||
window.\n\n | |||
Afterwards, in the same callstack, the host has to call IPlugView::onSize () if a resize is needed (size was changed). | |||
Note that if the host calls IPlugView::getSize () before calling IPlugView::onSize () (if needed), | |||
it will get the current (old) size not the wanted one!! | |||
Here the calling sequence: | |||
* plug-in->host: IPlugFrame::resizeView (newSize) | |||
* host->plug-in (optional): IPlugView::getSize () returns the currentSize (not the newSize)! | |||
* host->plug-in: if newSize is different from the current size: IPlugView::onSize (newSize) | |||
* host->plug-in (optional): IPlugView::getSize () returns the newSize | |||
it will get the current (old) size not the wanted one!!\n | |||
Here the calling sequence:\n | |||
- plug-in->host: IPlugFrame::resizeView (newSize) | |||
- host->plug-in (optional): IPlugView::getSize () returns the currentSize (not the newSize!) | |||
- host->plug-in: if newSize is different from the current size: IPlugView::onSize (newSize) | |||
- host->plug-in (optional): IPlugView::getSize () returns the newSize | |||
\n | |||
<b>Please only resize the platform representation of the view when IPlugView::onSize () is | |||
called.</b> | |||
\par Keyboard handling | |||
The Plug-in view receives keyboard events from the host. A view implementation must not handle | |||
The plug-in view receives keyboard events from the host. A view implementation must not handle | |||
keyboard events by the means of platform callbacks, but let the host pass them to the view. The host | |||
depends on a proper return value when IPlugView::onKeyDown is called, otherwise the Plug-in view may | |||
cause a malfunction of the host's key command handling! | |||
depends on a proper return value when IPlugView::onKeyDown is called, otherwise the plug-in view may | |||
cause a malfunction of the host's key command handling. | |||
\see IPlugFrame, \ref platformUIType | |||
*/ | |||
//------------------------------------------------------------------------ | |||
class IPlugView : public FUnknown | |||
{ | |||
public: | |||
@@ -133,7 +131,7 @@ public: | |||
should now be created as well. | |||
Note that the parent is owned by the caller and you are not allowed to alter it in any way | |||
other than adding your own views. | |||
Note that in this call the Plug-in could call a IPlugFrame::resizeView ()! | |||
Note that in this call the plug-in could call a IPlugFrame::resizeView ()! | |||
\param parent : platform handle of the parent window or view | |||
\param type : \ref platformUIType which should be created */ | |||
virtual tresult PLUGIN_API attached (void* parent, FIDString type) = 0; | |||
@@ -164,14 +162,14 @@ public: | |||
/** Returns the size of the platform representation of the view. */ | |||
virtual tresult PLUGIN_API getSize (ViewRect* size) = 0; | |||
/** Resizes the platform representation of the view to the given rect. Note that if the Plug-in | |||
/** Resizes the platform representation of the view to the given rect. Note that if the plug-in | |||
* requests a resize (IPlugFrame::resizeView ()) onSize has to be called afterward. */ | |||
virtual tresult PLUGIN_API onSize (ViewRect* newSize) = 0; | |||
/** Focus changed message. */ | |||
virtual tresult PLUGIN_API onFocus (TBool state) = 0; | |||
/** Sets IPlugFrame object to allow the Plug-in to inform the host about resizing. */ | |||
/** Sets IPlugFrame object to allow the plug-in to inform the host about resizing. */ | |||
virtual tresult PLUGIN_API setFrame (IPlugFrame* frame) = 0; | |||
/** Is view sizable by user. */ | |||
@@ -193,9 +191,8 @@ DECLARE_CLASS_IID (IPlugView, 0x5BC32507, 0xD06049EA, 0xA6151B52, 0x2B755B29) | |||
- [released: 3.0.0] | |||
- [mandatory] | |||
Enables a Plug-in to resize the view and cause the host to resize the window. | |||
Enables a plug-in to resize the view and cause the host to resize the window. | |||
*/ | |||
//------------------------------------------------------------------------ | |||
class IPlugFrame : public FUnknown | |||
{ | |||
public: | |||
@@ -30,12 +30,13 @@ namespace Steinberg { | |||
\ingroup pluginGUI vstIPlug vst366 | |||
- [plug impl] | |||
- [extends IPlugView] | |||
- [released: 3.6.6] | |||
- [optional] | |||
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 view was attached and when the scale | |||
The host calls setContentScaleFactor directly after the plug-in view is attached and when the scale | |||
factor changes (system change or window moved to another screen with different scaling settings). | |||
The host could call setContentScaleFactor in a different context, for example: scaling the | |||
plug-in editor for better readability. | |||
@@ -43,7 +44,7 @@ When a plug-in handles this (by returning kResultTrue), it needs to scale the wi | |||
its view by the scale factor and inform the host via a IPlugFrame::resizeView(), the host will then | |||
call IPlugView::onSize(). | |||
Note that the host is allowed to call setContentScaleFactor() at any time the IPlugView is alive. | |||
Note that the host is allowed to call setContentScaleFactor() at any time the IPlugView is valid. | |||
*/ | |||
class IPlugViewContentScaleSupport : public FUnknown | |||
{ | |||
@@ -26,16 +26,18 @@ | |||
//------------------------------------------------------------------------ | |||
namespace Steinberg { | |||
namespace Vst { | |||
//------------------------------------------------------------------------ | |||
/** Attribute list used in IMessage and IStreamAttributes. | |||
/** Attribute list used in IMessage and IStreamAttributes: Vst::IAttributeList | |||
\ingroup vstIHost vst300 | |||
- [host imp] | |||
- [released: 3.0.0] | |||
- [mandatory] | |||
An attribute list associates values with a key (id: some predefined keys could be found in \ref presetAttributes). */ | |||
//------------------------------------------------------------------------ | |||
class IAttributeList: public FUnknown | |||
An attribute list associates values with a key (id: some predefined keys can be found in \ref | |||
presetAttributes). | |||
*/ | |||
class IAttributeList : public FUnknown | |||
{ | |||
public: | |||
//------------------------------------------------------------------------ | |||
@@ -53,17 +55,18 @@ public: | |||
/** Gets float value. */ | |||
virtual tresult PLUGIN_API getFloat (AttrID id, double& value) = 0; | |||
/** Sets string value (UTF16). */ | |||
/** Sets string value (UTF16) (should be null-terminated!). */ | |||
virtual tresult PLUGIN_API setString (AttrID id, const TChar* string) = 0; | |||
/** Gets string value (UTF16). Note that Size is in Byte, not the string Length! (Do not forget to multiply the length by sizeof (TChar)!) */ | |||
virtual tresult PLUGIN_API getString (AttrID id, TChar* string, uint32 size) = 0; | |||
/** Gets string value (UTF16). Note that Size is in Byte, not the string Length! | |||
Do not forget to multiply the length by sizeof (TChar)! */ | |||
virtual tresult PLUGIN_API getString (AttrID id, TChar* string, uint32 sizeInBytes) = 0; | |||
/** Sets binary data. */ | |||
virtual tresult PLUGIN_API setBinary (AttrID id, const void* data, uint32 size) = 0; | |||
virtual tresult PLUGIN_API setBinary (AttrID id, const void* data, uint32 sizeInBytes) = 0; | |||
/** Gets binary data. */ | |||
virtual tresult PLUGIN_API getBinary (AttrID id, const void*& data, uint32& size) = 0; | |||
virtual tresult PLUGIN_API getBinary (AttrID id, const void*& data, uint32& sizeInBytes) = 0; | |||
//------------------------------------------------------------------------ | |||
static const FUID iid; | |||
}; | |||
@@ -71,15 +74,19 @@ public: | |||
DECLARE_CLASS_IID (IAttributeList, 0x1E5F0AEB, 0xCC7F4533, 0xA2544011, 0x38AD5EE4) | |||
//------------------------------------------------------------------------ | |||
/** Meta attributes of a stream. | |||
\ingroup vstIHost vst360 | |||
/** Meta attributes of a stream: Vst::IStreamAttributes | |||
\ingroup vstIHost vst360 | |||
- [host imp] | |||
- [extends IBStream] | |||
- [released: 3.6.0] | |||
- [optional] | |||
\code | |||
... | |||
Interface to access preset meta information from stream, used, for example, in setState in order to inform the plug-in about | |||
the current context in which the preset loading occurs (Project context or Preset load (see \ref StateType)) | |||
or used to get the full file path of the loaded preset (if available). | |||
\code{.cpp} | |||
//------------------------------------------------------------------------ | |||
#include "pluginterfaces/base/ustring.h" | |||
#include "pluginterfaces/vst/vstpresetkeys.h" | |||
... | |||
@@ -118,11 +125,8 @@ tresult PLUGIN_API MyPlugin::setState (IBStream* state) | |||
return kResultTrue; | |||
} | |||
\endcode | |||
Interface to access preset meta information from stream, used for example in setState in order to inform the plug-in about | |||
the current context in which this preset loading occurs (Project context or Preset load (see \ref StateType)) | |||
or used to get the full file path of the loaded preset (if available). */ | |||
//------------------------------------------------------------------------ | |||
class IStreamAttributes: public FUnknown | |||
*/ | |||
class IStreamAttributes : public FUnknown | |||
{ | |||
public: | |||
//------------------------------------------------------------------------ | |||
@@ -137,7 +141,6 @@ public: | |||
DECLARE_CLASS_IID (IStreamAttributes, 0xD6CE2FFC, 0xEFAF4B8C, 0x9E74F1BB, 0x12DA44B4) | |||
//------------------------------------------------------------------------ | |||
} // namespace Vst | |||
} // namespace Steinberg | |||
@@ -33,13 +33,13 @@ | |||
//------------------------------------------------------------------------ | |||
namespace Steinberg { | |||
namespace Vst { | |||
class IEventList; | |||
class IParameterChanges; | |||
struct ProcessContext; | |||
//------------------------------------------------------------------------ | |||
/** Component Types used as subCategories in PClassInfo2 */ | |||
//------------------------------------------------------------------------ | |||
namespace PlugType | |||
{ | |||
/** | |||
@@ -77,15 +77,17 @@ const CString kInstrumentSynthSampler = "Instrument|Synth|Sampler"; ///< Instrum | |||
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 kNoOfflineProcess = "NoOfflineProcess"; ///< will be NOT used for Plug-in offline processing (will work as normal insert Plug-in) | |||
const CString kOnlyOfflineProcess = "OnlyOfflineProcess"; ///< used for plug-in offline processing (will not work as normal insert plug-in) | |||
const CString kOnlyARA = "OnlyARA"; ///< used for plug-ins that require ARA to operate (will not work as normal insert plug-in) | |||
const CString kNoOfflineProcess = "NoOfflineProcess"; ///< will be NOT used for plug-in offline processing (will work as normal insert plug-in) | |||
const CString kUpDownMix = "Up-Downmix"; ///< used for Mixconverter/Up-Mixer/Down-Mixer | |||
const CString kAnalyzer = "Analyzer"; ///< Meter, Scope, FFT-Display, not selectable as insert plugin | |||
const CString kAnalyzer = "Analyzer"; ///< Meter, Scope, FFT-Display, not selectable as insert plug-in | |||
const CString kAmbisonics = "Ambisonics"; ///< used for Ambisonics channel (FX or Panner/Mixconverter/Up-Mixer/Down-Mixer when combined with other category) | |||
const CString kMono = "Mono"; ///< used for Mono only Plug-in [optional] | |||
const CString kStereo = "Stereo"; ///< used for Stereo only Plug-in [optional] | |||
const CString kSurround = "Surround"; ///< used for Surround only Plug-in [optional] | |||
const CString kMono = "Mono"; ///< used for Mono only plug-in [optional] | |||
const CString kStereo = "Stereo"; ///< used for Stereo only plug-in [optional] | |||
const CString kSurround = "Surround"; ///< used for Surround only plug-in [optional] | |||
//------------------------------------------------------------------------ | |||
/*@}*/ | |||
@@ -93,7 +95,6 @@ const CString kSurround = "Surround"; ///< used for Surround only Plug-in [o | |||
//------------------------------------------------------------------------ | |||
/** Component Flags used as classFlags in PClassInfo2 */ | |||
//------------------------------------------------------------------------ | |||
enum ComponentFlags | |||
{ | |||
//------------------------------------------------------------------------ | |||
@@ -104,8 +105,8 @@ enum ComponentFlags | |||
//------------------------------------------------------------------------ | |||
/** Symbolic sample size. | |||
\see ProcessSetup, ProcessData */ | |||
//------------------------------------------------------------------------ | |||
\see ProcessSetup, ProcessData | |||
*/ | |||
enum SymbolicSampleSizes | |||
{ | |||
kSample32, ///< 32-bit precision | |||
@@ -113,27 +114,27 @@ enum SymbolicSampleSizes | |||
}; | |||
//------------------------------------------------------------------------ | |||
/** Processing mode informs the Plug-in about the context and at which frequency the process call is called. | |||
/** Processing mode informs the plug-in about the context and at which frequency the process call is called. | |||
VST3 defines 3 modes: | |||
- kRealtime: each process call is called at a realtime frequency (defined by [numSamples of ProcessData] / samplerate). | |||
The Plug-in should always try to process as fast as possible in order to let enough time slice to other Plug-ins. | |||
The plug-in should always try to process as fast as possible in order to let enough time slice to other plug-ins. | |||
- kPrefetch: each process call could be called at a variable frequency (jitter, slower / faster than realtime), | |||
the Plug-in should process at the same quality level than realtime, Plug-in must not slow down to realtime | |||
the plug-in should process at the same quality level than realtime, plug-in must not slow down to realtime | |||
(e.g. disk streaming)! | |||
The host should avoid to process in kPrefetch mode such sampler based Plug-in. | |||
The host should avoid to process in kPrefetch mode such sampler based plug-in. | |||
- kOffline: each process call could be faster than realtime or slower, higher quality than realtime could be used. | |||
Plug-ins using disk streaming should be sure that they have enough time in the process call for streaming, | |||
plug-ins using disk streaming should be sure that they have enough time in the process call for streaming, | |||
if needed by slowing down to realtime or slower. | |||
. | |||
Note about Process Modes switching: | |||
-Switching between kRealtime and kPrefetch process modes are done in realtime thread without need of calling | |||
IAudioProcessor::setupProcessing, the Plug-in should check in process call the member processMode of ProcessData | |||
- Switching between kRealtime and kPrefetch process modes are done in realtime thread without need of calling | |||
IAudioProcessor::setupProcessing, the plug-in should check in process call the member processMode of ProcessData | |||
in order to know in which mode it is processed. | |||
-Switching between kRealtime (or kPrefetch) and kOffline requires that the host calls IAudioProcessor::setupProcessing | |||
in order to inform the Plug-in about this mode change. | |||
. | |||
\see ProcessSetup, ProcessData */ | |||
//------------------------------------------------------------------------ | |||
- Switching between kRealtime (or kPrefetch) and kOffline requires that the host calls IAudioProcessor::setupProcessing | |||
in order to inform the plug-in about this mode change. | |||
. | |||
\see ProcessSetup, ProcessData | |||
*/ | |||
enum ProcessModes | |||
{ | |||
kRealtime, ///< realtime processing | |||
@@ -145,21 +146,22 @@ enum ProcessModes | |||
/** kNoTail | |||
* | |||
* to be returned by getTailSamples when no tail is wanted | |||
\see IAudioProcessor::getTailSamples */ | |||
//------------------------------------------------------------------------ | |||
\see IAudioProcessor::getTailSamples | |||
*/ | |||
static const uint32 kNoTail = 0; | |||
//------------------------------------------------------------------------ | |||
/** kInfiniteTail | |||
* | |||
* to be returned by getTailSamples when infinite tail is wanted | |||
\see IAudioProcessor::getTailSamples */ | |||
//------------------------------------------------------------------------ | |||
\see IAudioProcessor::getTailSamples | |||
*/ | |||
static const uint32 kInfiniteTail = kMaxInt32u; | |||
//------------------------------------------------------------------------ | |||
/** Audio processing setup. | |||
\see IAudioProcessor::setupProcessing */ | |||
//------------------------------------------------------------------------ | |||
\see IAudioProcessor::setupProcessing | |||
*/ | |||
struct ProcessSetup | |||
{ | |||
//------------------------------------------------------------------------ | |||
@@ -174,21 +176,21 @@ struct ProcessSetup | |||
/** Processing buffers of an audio bus. | |||
This structure contains the processing buffer for each channel of an audio bus. | |||
- The number of channels (numChannels) must always match the current bus arrangement. | |||
It could be set to value '0' when the host wants to flush the parameters (when the Plug-in is not processed). | |||
It could be set to value '0' when the host wants to flush the parameters (when the plug-in is not processed). | |||
- The size of the channel buffer array must always match the number of channels. So the host | |||
must always supply an array for the channel buffers, regardless if the | |||
bus is active or not. However, if an audio bus is currently inactive, the actual sample | |||
buffer addresses are safe to be null. | |||
- The silence flag is set when every sample of the according buffer has the value '0'. It is | |||
intended to be used as help for optimizations allowing a Plug-in to reduce processing activities. | |||
intended to be used as help for optimizations allowing a plug-in to reduce processing activities. | |||
But even if this flag is set for a channel, the channel buffers must still point to valid memory! | |||
This flag is optional. A host is free to support it or not. | |||
. | |||
\see ProcessData */ | |||
//------------------------------------------------------------------------ | |||
\see ProcessData | |||
*/ | |||
struct AudioBusBuffers | |||
{ | |||
AudioBusBuffers () : numChannels (0), silenceFlags (0), channelBuffers64 (0) {} | |||
AudioBusBuffers () : numChannels (0), silenceFlags (0), channelBuffers64 (nullptr) {} | |||
//------------------------------------------------------------------------ | |||
int32 numChannels; ///< number of audio channels in bus | |||
@@ -206,23 +208,34 @@ struct AudioBusBuffers | |||
The host prepares AudioBusBuffers for each input/output bus, | |||
regardless of the bus activation state. Bus buffer indices always match | |||
with bus indices used in IComponent::getBusInfo of media type kAudio. | |||
\see AudioBusBuffers, IParameterChanges, IEventList, ProcessContext */ | |||
//------------------------------------------------------------------------ | |||
\see AudioBusBuffers, IParameterChanges, IEventList, ProcessContext, IProcessContextRequirements | |||
*/ | |||
struct ProcessData | |||
{ | |||
ProcessData () | |||
: processMode (0), symbolicSampleSize (kSample32), numSamples (0), numInputs (0) | |||
, numOutputs (0), inputs (0), outputs (0), inputParameterChanges (0), outputParameterChanges (0) | |||
, inputEvents (0), outputEvents (0), processContext (0) {} | |||
: processMode (0) | |||
, symbolicSampleSize (kSample32) | |||
, numSamples (0) | |||
, numInputs (0) | |||
, numOutputs (0) | |||
, inputs (nullptr) | |||
, outputs (nullptr) | |||
, inputParameterChanges (nullptr) | |||
, outputParameterChanges (nullptr) | |||
, inputEvents (nullptr) | |||
, outputEvents (nullptr) | |||
, processContext (nullptr) | |||
{ | |||
} | |||
//------------------------------------------------------------------------ | |||
int32 processMode; ///< processing mode - value of \ref ProcessModes | |||
int32 symbolicSampleSize; ///< sample size - value of \ref SymbolicSampleSizes | |||
int32 numSamples; ///< number of samples to process | |||
int32 numInputs; ///< number of audio input buses | |||
int32 numOutputs; ///< number of audio output buses | |||
AudioBusBuffers* inputs; ///< buffers of input buses | |||
AudioBusBuffers* outputs; ///< buffers of output buses | |||
int32 numInputs; ///< number of audio input busses | |||
int32 numOutputs; ///< number of audio output busses | |||
AudioBusBuffers* inputs; ///< buffers of input busses | |||
AudioBusBuffers* outputs; ///< buffers of output busses | |||
IParameterChanges* inputParameterChanges; ///< incoming parameter changes for this block | |||
IParameterChanges* outputParameterChanges; ///< outgoing parameter changes for this block (optional) | |||
@@ -233,60 +246,77 @@ struct ProcessData | |||
}; | |||
//------------------------------------------------------------------------ | |||
/** Audio Processing Interface. | |||
/** Audio processing interface: Vst::IAudioProcessor | |||
\ingroup vstIPlug vst300 | |||
- [plug imp] | |||
- [extends IComponent] | |||
- [released: 3.0.0] | |||
- [mandatory] | |||
This interface must always be supported by audio processing Plug-ins. */ | |||
//------------------------------------------------------------------------ | |||
class IAudioProcessor: public FUnknown | |||
This interface must always be supported by audio processing plug-ins. | |||
*/ | |||
class IAudioProcessor : public FUnknown | |||
{ | |||
public: | |||
//------------------------------------------------------------------------ | |||
/** Try to set (from host) a predefined arrangement for inputs and outputs. | |||
The host should always deliver the same number of input and output buses than the Plug-in needs | |||
(see \ref IComponent::getBusCount). | |||
The Plug-in returns kResultFalse if wanted arrangements are not supported. | |||
If the Plug-in accepts these arrangements, it should modify its buses to match the new arrangements | |||
(asked by the host with IComponent::getInfo () or IAudioProcessor::getBusArrangement ()) and then return kResultTrue. | |||
If the Plug-in does not accept these arrangements, but can adapt its current arrangements (according to the wanted ones), | |||
it should modify its buses arrangements and return kResultFalse. */ | |||
/** Try to set (host => plug-in) a wanted arrangement for inputs and outputs. | |||
The host should always deliver the same number of input and output busses than the plug-in | |||
needs (see \ref IComponent::getBusCount). The plug-in has 3 possibilities to react on this | |||
setBusArrangements call:\n | |||
1. The plug-in accepts these arrangements, then it should modify, if needed, its busses to match | |||
these new arrangements (later on asked by the host with IComponent::getBusInfo () or | |||
IAudioProcessor::getBusArrangement ()) and then should return kResultTrue.\n | |||
2. The plug-in does not accept or support these requested arrangements for all | |||
inputs/outputs or just for some or only one bus, but the plug-in can try to adapt its current | |||
arrangements according to the requested ones (requested arrangements for kMain busses should be | |||
handled with more priority than the ones for kAux busses), then it should modify its busses arrangements | |||
and should return kResultFalse.\n | |||
3. Same than the point 2 above the plug-in does not support these requested arrangements | |||
but the plug-in cannot find corresponding arrangements, the plug-in could keep its current arrangement | |||
or fall back to a default arrangement by modifying its busses arrangements and should return kResultFalse.\n | |||
\param inputs pointer to an array of /ref SpeakerArrangement | |||
\param numIns number of /ref SpeakerArrangement in inputs array | |||
\param outputs pointer to an array of /ref SpeakerArrangement | |||
\param numOuts number of /ref SpeakerArrangement in outputs array | |||
Returns kResultTrue when Arrangements is supported and is the current one, else returns kResultFalse. */ | |||
virtual tresult PLUGIN_API setBusArrangements (SpeakerArrangement* inputs, int32 numIns, | |||
SpeakerArrangement* outputs, int32 numOuts) = 0; | |||
/** Gets the bus arrangement for a given direction (input/output) and index. | |||
Note: IComponent::getInfo () and IAudioProcessor::getBusArrangement () should be always return the same | |||
information about the buses arrangements. */ | |||
Note: IComponent::getBusInfo () and IAudioProcessor::getBusArrangement () should be always return the same | |||
information about the busses arrangements. */ | |||
virtual tresult PLUGIN_API getBusArrangement (BusDirection dir, int32 index, SpeakerArrangement& arr) = 0; | |||
/** Asks if a given sample size is supported see \ref SymbolicSampleSizes. */ | |||
virtual tresult PLUGIN_API canProcessSampleSize (int32 symbolicSampleSize) = 0; | |||
/** Gets the current Latency in samples. | |||
The returned value defines the group delay or the latency of the Plug-in. For example, if the Plug-in internally needs | |||
to look in advance (like compressors) 512 samples then this Plug-in should report 512 as latency. | |||
If during the use of the Plug-in this latency change, the Plug-in has to inform the host by | |||
The returned value defines the group delay or the latency of the plug-in. For example, if the plug-in internally needs | |||
to look in advance (like compressors) 512 samples then this plug-in should report 512 as latency. | |||
If during the use of the plug-in this latency change, the plug-in has to inform the host by | |||
using IComponentHandler::restartComponent (kLatencyChanged), this could lead to audio playback interruption | |||
because the host has to recompute its internal mixer delay compensation. | |||
Note that for player live recording this latency should be zero or small. */ | |||
virtual uint32 PLUGIN_API getLatencySamples () = 0; | |||
/** Called in disable state (not active) before processing will begin. */ | |||
/** Called in disable state (setActive not called with true) before setProcessing is called and processing will begin. */ | |||
virtual tresult PLUGIN_API setupProcessing (ProcessSetup& setup) = 0; | |||
/** Informs the Plug-in about the processing state. This will be called before any process calls start with true and after with false. | |||
Note that setProcessing (false) may be called after setProcessing (true) without any process calls. | |||
In this call the Plug-in should do only light operation (no memory allocation or big setup reconfiguration), | |||
this could be used to reset some buffers (like Delay line or Reverb). */ | |||
/** Informs the plug-in about the processing state. This will be called before any process calls | |||
start with true and after with false. | |||
Note that setProcessing (false) may be called after setProcessing (true) without any process | |||
calls. | |||
Note this function could be called in the UI or in Processing Thread, thats why the plug-in | |||
should only light operation (no memory allocation or big setup reconfiguration), | |||
this could be used to reset some buffers (like Delay line or Reverb). | |||
The host has to be sure that it is called only when the plug-in is enable (setActive (true) | |||
was called). */ | |||
virtual tresult PLUGIN_API setProcessing (TBool state) = 0; | |||
/** The Process call, where all information (parameter changes, event, audio buffer) are passed. */ | |||
virtual tresult PLUGIN_API process (ProcessData& data) = 0; | |||
/** Gets tail size in samples. For example, if the Plug-in is a Reverb Plug-in and it knows that | |||
/** Gets tail size in samples. For example, if the plug-in is a Reverb plug-in and it knows that | |||
the maximum length of the Reverb is 2sec, then it has to return in getTailSamples() | |||
(in VST2 it was getGetTailSize ()): 2*sampleRate. | |||
This information could be used by host for offline processing, process optimization and | |||
@@ -304,40 +334,40 @@ public: | |||
DECLARE_CLASS_IID (IAudioProcessor, 0x42043F99, 0xB7DA453C, 0xA569E79D, 0x9AAEC33D) | |||
//------------------------------------------------------------------------ | |||
/** Extended IAudioProcessor interface for a component. | |||
/** Extended IAudioProcessor interface for a component: Vst::IAudioPresentationLatency | |||
\ingroup vstIPlug vst310 | |||
- [plug imp] | |||
- [extends IAudioProcessor] | |||
- [released: 3.1.0] | |||
- [optional] | |||
Inform the Plug-in about how long from the moment of generation/acquiring (from file or from Input) | |||
it will take for its input to arrive, and how long it will take for its output to be presented (to output or to Speaker). | |||
Inform the plug-in about how long from the moment of generation/acquiring (from file or from Input) | |||
it will take for its input to arrive, and how long it will take for its output to be presented (to output or to speaker). | |||
Note for Input Presentation Latency: when reading from file, the first Plug-in will have an input presentation latency set to zero. | |||
When monitoring audio input from a Audio Device, then this initial input latency will be the input latency of the Audio Device itself. | |||
Note for Input Presentation Latency: when reading from file, the first plug-in will have an input presentation latency set to zero. | |||
When monitoring audio input from an audio device, the initial input latency is the input latency of the audio device itself. | |||
Note for Output Presentation Latency: when writing to a file, the last Plug-in will have an output presentation latency set to zero. | |||
When the output of this Plug-in is connected to a Audio Device then this initial output latency will be the output | |||
latency of the Audio Device itself. | |||
Note for Output Presentation Latency: when writing to a file, the last plug-in will have an output presentation latency set to zero. | |||
When the output of this plug-in is connected to an audio device, the initial output latency is the output | |||
latency of the audio device itself. | |||
A value of zero means either no latency or an unknown latency. | |||
A value of zero either means no latency or an unknown latency. | |||
Each Plug-in adding a latency (returning a none zero value for IAudioProcessor::getLatencySamples) will modify the input | |||
presentation latency of the next Plug-ins in the mixer routing graph and will modify the output presentation latency | |||
of the previous Plug-ins. | |||
Each plug-in adding a latency (returning a none zero value for IAudioProcessor::getLatencySamples) will modify the input | |||
presentation latency of the next plug-ins in the mixer routing graph and will modify the output presentation latency | |||
of the previous plug-ins. | |||
\n | |||
\image html "iaudiopresentationlatency_usage.png" | |||
\n | |||
\see IAudioProcessor | |||
\see IComponent*/ | |||
//------------------------------------------------------------------------ | |||
class IAudioPresentationLatency: public FUnknown | |||
\see IComponent | |||
*/ | |||
class IAudioPresentationLatency : public FUnknown | |||
{ | |||
public: | |||
//------------------------------------------------------------------------ | |||
/** Informs the Plug-in about the Audio Presentation Latency in samples for a given direction (kInput/kOutput) and bus index. */ | |||
/** Informs the plug-in about the Audio Presentation Latency in samples for a given direction (kInput/kOutput) and bus index. */ | |||
virtual tresult PLUGIN_API setAudioPresentationLatencySamples (BusDirection dir, int32 busIndex, uint32 latencyInSamples) = 0; | |||
//------------------------------------------------------------------------ | |||
@@ -346,6 +376,50 @@ public: | |||
DECLARE_CLASS_IID (IAudioPresentationLatency, 0x309ECE78, 0xEB7D4fae, 0x8B2225D9, 0x09FD08B6) | |||
//------------------------------------------------------------------------ | |||
/** Extended IAudioProcessor interface for a component: Vst::IProcessContextRequirements | |||
\ingroup vstIPlug vst370 | |||
- [plug imp] | |||
- [extends IAudioProcessor] | |||
- [released: 3.7.0] | |||
- [mandatory] | |||
To get accurate process context information (Vst::ProcessContext), it is now required to implement this interface and | |||
return the desired bit mask of flags which your audio effect needs. If you do not implement this | |||
interface, you may not get any information at all of the process function. | |||
The host asks for this information once between initialize and setActive. It cannot be changed afterwards. | |||
This gives the host the opportunity to better optimize the audio process graph when it knows which | |||
plug-ins need which information. | |||
Plug-Ins built with an earlier SDK version (< 3.7) will still get the old information, but the information | |||
may not be as accurate as when using this interface. | |||
*/ | |||
class IProcessContextRequirements : public FUnknown | |||
{ | |||
public: | |||
enum Flags | |||
{ | |||
kNeedSystemTime = 1 << 0, // kSystemTimeValid | |||
kNeedContinousTimeSamples = 1 << 1, // kContTimeValid | |||
kNeedProjectTimeMusic = 1 << 2, // kProjectTimeMusicValid | |||
kNeedBarPositionMusic = 1 << 3, // kBarPositionValid | |||
kNeedCycleMusic = 1 << 4, // kCycleValid | |||
kNeedSamplesToNextClock = 1 << 5, // kClockValid | |||
kNeedTempo = 1 << 6, // kTempoValid | |||
kNeedTimeSignature = 1 << 7, // kTimeSigValid | |||
kNeedChord = 1 << 8, // kChordValid | |||
kNeedFrameRate = 1 << 9, // kSmpteValid | |||
kNeedTransportState = 1 << 10, // kPlaying, kCycleActive, kRecording | |||
}; | |||
virtual uint32 PLUGIN_API getProcessContextRequirements () = 0; | |||
//------------------------------------------------------------------------ | |||
static const FUID iid; | |||
}; | |||
DECLARE_CLASS_IID (IProcessContextRequirements, 0x2A654303, 0xEF764E3D, 0x95B5FE83, 0x730EF6D0) | |||
//------------------------------------------------------------------------ | |||
} // namespace Vst | |||
} // namespace Steinberg | |||
@@ -27,16 +27,15 @@ namespace Steinberg { | |||
namespace Vst { | |||
//------------------------------------------------------------------------ | |||
/** Extended Plug-in interface IEditController. | |||
/** Extended plug-in interface IEditController: Vst::IAutomationState | |||
\ingroup vstIPlug vst365 | |||
- [plug imp] | |||
- [extends IEditController] | |||
- [released: 3.6.5] | |||
- [optional] | |||
Hosts could inform the Plug-in about its current automation state (Read/Write/Nothing). | |||
Hosts can inform the plug-in about its current automation state (Read/Write/Nothing). | |||
*/ | |||
//------------------------------------------------------------------------ | |||
class IAutomationState : public FUnknown | |||
{ | |||
public: | |||
@@ -59,6 +58,7 @@ public: | |||
DECLARE_CLASS_IID (IAutomationState, 0xB4E8287F, 0x1BB346AA, 0x83A46667, 0x68937BAB) | |||
//------------------------------------------------------------------------ | |||
} // namespace Vst | |||
} // namespace Steinberg | |||
@@ -26,6 +26,7 @@ | |||
//------------------------------------------------------------------------ | |||
namespace Steinberg { | |||
namespace Vst { | |||
/** For Channel Context Info Interface */ | |||
namespace ChannelContext { | |||
@@ -35,22 +36,24 @@ namespace ChannelContext { | |||
//------------------------------------------------------------------------ | |||
//------------------------------------------------------------------------ | |||
/** Channel Context Interface. | |||
/** Channel context interface: Vst::IInfoListener | |||
\ingroup vstIHost vst365 | |||
- [plug imp] | |||
- [extends IEditController] | |||
- [released: 3.6.5] | |||
- [optional] | |||
Allows the host to inform the Plug-in about the context in which the Plug-in is instantiated, | |||
mainly channel based info (color, name, index,...). Index could be defined inside a namespace | |||
(for example index start from 1 to N for Type Input/Output Channel (Index namespace) and index | |||
Allows the host to inform the plug-in about the context in which the plug-in is instantiated, | |||
mainly channel based info (color, name, index,...). Index can be defined inside a namespace | |||
(for example, index start from 1 to N for Type Input/Output Channel (Index namespace) and index | |||
start from 1 to M for Type Audio Channel).\n | |||
As soon as the Plug-in provides this IInfoListener interface, the host will call setChannelContextInfos | |||
As soon as the plug-in provides this IInfoListener interface, the host will call setChannelContextInfos | |||
for each change occurring to this channel (new name, new color, new indexation,...) | |||
\section IChannelContextExample Example | |||
\code | |||
\code{.cpp} | |||
//------------------------------------------------------------------------ | |||
tresult PLUGIN_API MyPlugin::setChannelContextInfos (IAttributeList* list) | |||
{ | |||
if (list) | |||
@@ -62,7 +65,7 @@ tresult PLUGIN_API MyPlugin::setChannelContextInfos (IAttributeList* list) | |||
... | |||
} | |||
// get the Channel Name where we, as Plug-in, are instantiated | |||
// get the Channel Name where we, as plug-in, are instantiated | |||
String128 name; | |||
if (list->getString (ChannelContext::kChannelNameKey, name, sizeof (name)) == kResultTrue) | |||
{ | |||
@@ -116,7 +119,7 @@ tresult PLUGIN_API MyPlugin::setChannelContextInfos (IAttributeList* list) | |||
... | |||
} | |||
// get Plug-in Channel Location | |||
// get plug-in Channel Location | |||
int64 location; | |||
if (list->getInt (ChannelContext::kChannelPluginLocationKey, location) == kResultTrue) | |||
{ | |||
@@ -140,9 +143,9 @@ tresult PLUGIN_API MyPlugin::setChannelContextInfos (IAttributeList* list) | |||
// do not forget to call addRef () if you want to keep this list | |||
} | |||
} | |||
\endcode */ | |||
//------------------------------------------------------------------------ | |||
class IInfoListener: public FUnknown | |||
\endcode | |||
*/ | |||
class IInfoListener : public FUnknown | |||
{ | |||
public: | |||
/** Receive the channel context infos from host. */ | |||
@@ -156,7 +159,6 @@ DECLARE_CLASS_IID (IInfoListener, 0x0F194781, 0x8D984ADA, 0xBBA0C1EF, 0xC011D8D0 | |||
//------------------------------------------------------------------------ | |||
/** Values used for kChannelPluginLocationKey */ | |||
//------------------------------------------------------------------------ | |||
enum ChannelPluginLocation | |||
{ | |||
kPreVolumeFader = 0, | |||
@@ -166,13 +168,23 @@ enum ChannelPluginLocation | |||
//------------------------------------------------------------------------ | |||
//------------------------------------------------------------------------ | |||
// Colors | |||
typedef uint32 ColorSpec; ///< ARGB (Alpha-Red-Green-Blue) | |||
// Colors | |||
//------------------------------------------------------------------------ | |||
/** \defgroup vst3typedef VST 3 Data Types */ | |||
/*@{*/ | |||
//------------------------------------------------------------------------ | |||
/** ARGB (Alpha-Red-Green-Blue) */ | |||
typedef uint32 ColorSpec; | |||
typedef uint8 ColorComponent; | |||
/*@}*/ | |||
/** Returns the Blue part of the given ColorSpec */ | |||
inline ColorComponent GetBlue (ColorSpec cs) {return (ColorComponent)(cs & 0x000000FF); } | |||
/** Returns the Green part of the given ColorSpec */ | |||
inline ColorComponent GetGreen (ColorSpec cs) {return (ColorComponent)((cs >> 8) & 0x000000FF); } | |||
/** Returns the Red part of the given ColorSpec */ | |||
inline ColorComponent GetRed (ColorSpec cs) {return (ColorComponent)((cs >> 16) & 0x000000FF); } | |||
/** Returns the Alpha part of the given ColorSpec */ | |||
inline ColorComponent GetAlpha (ColorSpec cs) {return (ColorComponent)((cs >> 24) & 0x000000FF); } | |||
//------------------------------------------------------------------------ | |||
@@ -213,10 +225,10 @@ const CString kChannelIndexNamespaceLengthKey = "channel index namespace length" | |||
/** PNG image representation as binary [optional] */ | |||
const CString kChannelImageKey = "channel image"; | |||
/** integer (int64) [optional]: routing position of the Plug-in in the channel (see ChannelPluginLocation) */ | |||
/** integer (int64) [optional]: routing position of the plug-in in the channel (see ChannelPluginLocation) */ | |||
const CString kChannelPluginLocationKey = "channel plugin location"; | |||
//------------------------------------------------------------------------ | |||
//------------------------------------------------------------------------ | |||
} // namespace ChannelContext | |||
} // namespace Vst | |||
} // namespace Steinberg | |||
@@ -17,7 +17,7 @@ | |||
#pragma once | |||
#include "pluginterfaces/base/ipluginbase.h" | |||
#include "vsttypes.h" | |||
#include "pluginterfaces/vst/vsttypes.h" | |||
//------------------------------------------------------------------------ | |||
#include "pluginterfaces/base/falignpush.h" | |||
@@ -28,31 +28,36 @@ class IBStream; | |||
//------------------------------------------------------------------------ | |||
/** All VST specific interfaces are located in Vst namespace */ | |||
//------------------------------------------------------------------------ | |||
namespace Vst { | |||
const int32 kDefaultFactoryFlags = PFactoryInfo::kUnicode; ///< Standard value for PFactoryInfo::flags | |||
/** Standard value for PFactoryInfo::flags */ | |||
const int32 kDefaultFactoryFlags = PFactoryInfo::kUnicode; | |||
#define BEGIN_FACTORY_DEF(vendor,url,email) using namespace Steinberg; \ | |||
EXPORT_FACTORY IPluginFactory* PLUGIN_API GetPluginFactory () { \ | |||
SMTG_EXPORT_SYMBOL IPluginFactory* PLUGIN_API GetPluginFactory () { \ | |||
if (!gPluginFactory) \ | |||
{ static PFactoryInfo factoryInfo (vendor,url,email,Vst::kDefaultFactoryFlags); \ | |||
{ \ | |||
static PFactoryInfo factoryInfo (vendor, url, email, Vst::kDefaultFactoryFlags); \ | |||
gPluginFactory = new CPluginFactory (factoryInfo); | |||
//------------------------------------------------------------------------ | |||
/** \defgroup vstBus VST Buses | |||
/** \defgroup vstBus VST busses | |||
Bus Description | |||
A bus can be understood as a "collection of data channels" belonging together. | |||
It describes a data input or a data output of the Plug-in. | |||
A VST component can define any desired number of buses, but this number must \b never change. | |||
Dynamic usage of buses is handled in the host by activating and deactivating buses. | |||
The component has to define the maximum number of supported buses and it has to | |||
define which of them are active by default. A host that can handle multiple buses, | |||
allows the user to activate buses that were initially inactive. | |||
It describes a data input or a data output of the plug-in. | |||
A VST component can define any desired number of busses. | |||
Dynamic usage of busses is handled in the host by activating and deactivating busses. | |||
All busses are initially inactive. | |||
The component has to define the maximum number of supported busses and it has to | |||
define which of them have to be activated by default after instantiation of the plug-in (This is | |||
only a wish, the host is allow to not follow it, and only activate the first bus for example). | |||
A host that can handle multiple busses, allows the user to activate busses which are initially all inactive. | |||
The kMain busses have to place before any others kAux busses. | |||
See also: IComponent::getBusInfo, IComponent::activateBus | |||
@{*/ | |||
*/ | |||
/*@{*/ | |||
//------------------------------------------------------------------------ | |||
/** Bus media types */ | |||
@@ -82,7 +87,8 @@ enum BusTypes | |||
//------------------------------------------------------------------------ | |||
/** BusInfo: | |||
This is the structure used with getBusInfo, informing the host about what is a specific given bus. | |||
\n See also: IComponent::getBusInfo */ | |||
\n See also: Steinberg::Vst::IComponent::getBusInfo | |||
*/ | |||
struct BusInfo | |||
{ | |||
MediaType mediaType; ///< Media type - has to be a value of \ref MediaTypes | |||
@@ -96,7 +102,15 @@ struct BusInfo | |||
uint32 flags; ///< flags - a combination of \ref BusFlags | |||
enum BusFlags | |||
{ | |||
kDefaultActive = 1 << 0 ///< bus active per default | |||
/** The bus should be activated by the host per default on instantiation (activateBus call is requested). | |||
By default a bus is inactive. */ | |||
kDefaultActive = 1 << 0, | |||
/** The bus does not contain ordinary audio data, but data used for control changes at sample rate. | |||
The data is in the same format as the audio data [-1..1]. | |||
A host has to prevent unintended routing to speakers to prevent damage. | |||
Only valid for audio media type busses. | |||
[released: 3.7.0] */ | |||
kIsControlVoltage = 1 << 1 | |||
}; | |||
}; | |||
@@ -108,15 +122,16 @@ enum IoModes | |||
{ | |||
kSimple = 0, ///< 1:1 Input / Output. Only used for Instruments. See \ref vst3IoMode | |||
kAdvanced, ///< n:m Input / Output. Only used for Instruments. | |||
kOfflineProcessing ///< Plug-in used in an offline processing context | |||
kOfflineProcessing ///< plug-in used in an offline processing context | |||
}; | |||
//------------------------------------------------------------------------ | |||
/** Routing Information: | |||
When the Plug-in supports multiple I/O buses, a host may want to know how the buses are related. The | |||
When the plug-in supports multiple I/O busses, a host may want to know how the busses are related. The | |||
relation of an event-input-channel to an audio-output-bus in particular is of interest to the host | |||
(in order to relate MIDI-tracks to audio-channels) | |||
\n See also: IComponent::getRoutingInfo, \ref vst3Routing */ | |||
\n See also: IComponent::getRoutingInfo, \ref vst3Routing | |||
*/ | |||
struct RoutingInfo | |||
{ | |||
MediaType mediaType; ///< media type see \ref MediaTypes | |||
@@ -127,7 +142,7 @@ struct RoutingInfo | |||
//------------------------------------------------------------------------ | |||
// IComponent Interface | |||
//------------------------------------------------------------------------ | |||
/** Component Base Interface | |||
/** Component base interface: Vst::IComponent | |||
\ingroup vstIPlug vst300 | |||
- [plug imp] | |||
- [released: 3.0.0] | |||
@@ -137,8 +152,9 @@ This is the basic interface for a VST component and must always be supported. | |||
It contains the common parts of any kind of processing class. The parts that | |||
are specific to a media type are defined in a separate interface. An implementation | |||
component must provide both the specific interface and IComponent. | |||
\see IPluginBase | |||
*/ | |||
class IComponent: public IPluginBase | |||
class IComponent : public IPluginBase | |||
{ | |||
public: | |||
//------------------------------------------------------------------------ | |||
@@ -148,19 +164,22 @@ public: | |||
/** Called before 'initialize' to set the component usage (optional). See \ref IoModes */ | |||
virtual tresult PLUGIN_API setIoMode (IoMode mode) = 0; | |||
/** Called after the Plug-in is initialized. See \ref MediaTypes, BusDirections */ | |||
/** Called after the plug-in is initialized. See \ref MediaTypes, BusDirections */ | |||
virtual int32 PLUGIN_API getBusCount (MediaType type, BusDirection dir) = 0; | |||
/** Called after the Plug-in is initialized. See \ref MediaTypes, BusDirections */ | |||
/** Called after the plug-in is initialized. See \ref MediaTypes, BusDirections */ | |||
virtual tresult PLUGIN_API getBusInfo (MediaType type, BusDirection dir, int32 index, BusInfo& bus /*out*/) = 0; | |||
/** Retrieves routing information (to be implemented when more than one regular input or output bus exists). | |||
The inInfo always refers to an input bus while the returned outInfo must refer to an output bus! */ | |||
virtual tresult PLUGIN_API getRoutingInfo (RoutingInfo& inInfo, RoutingInfo& outInfo /*out*/) = 0; | |||
/** Called upon (de-)activating a bus in the host application. The Plug-in should only processed an activated bus, | |||
the host could provide less see \ref AudioBusBuffers in the process call (see \ref IAudioProcessor::process) if last buses are not activated */ | |||
virtual tresult PLUGIN_API activateBus (MediaType type, BusDirection dir, int32 index, TBool state) = 0; | |||
/** Called upon (de-)activating a bus in the host application. The plug-in should only processed | |||
an activated bus, the host could provide less see \ref AudioBusBuffers in the process call | |||
(see \ref IAudioProcessor::process) if last busses are not activated. An already activated bus | |||
does not need to be reactivated after a IAudioProcessor::setBusArrangements call. */ | |||
virtual tresult PLUGIN_API activateBus (MediaType type, BusDirection dir, int32 index, | |||
TBool state) = 0; | |||
/** Activates / deactivates the component. */ | |||
virtual tresult PLUGIN_API setActive (TBool state) = 0; | |||
@@ -17,7 +17,7 @@ | |||
#pragma once | |||
#include "pluginterfaces/base/funknown.h" | |||
#include "vsttypes.h" | |||
#include "pluginterfaces/vst/vsttypes.h" | |||
//------------------------------------------------------------------------ | |||
#include "pluginterfaces/base/falignpush.h" | |||
@@ -30,30 +30,35 @@ namespace Vst { | |||
class IContextMenu; | |||
//------------------------------------------------------------------------ | |||
/** Extended Host callback interface IComponentHandler3 for an edit controller. | |||
/** Extended host callback interface Vst::IComponentHandler3 for an edit controller. | |||
\ingroup vstIHost vst350 | |||
- [host imp] | |||
- [extends IComponentHandler] | |||
- [released: 3.5.0] | |||
- [optional] | |||
A Plug-in can ask the host to create a context menu for a given exported Parameter ID or a generic context menu.\n | |||
A plug-in can ask the host to create a context menu for a given exported parameter ID or a generic context menu.\n | |||
The host may pre-fill this context menu with specific items regarding the parameter ID like "Show automation for parameter", | |||
"MIDI learn" etc...\n | |||
The Plug-in can use the context menu in two ways : | |||
- add its own items to the menu via the IContextMenu interface and call IContextMenu::popup(..) to pop-up it. See the \ref IContextMenuExample. | |||
- extract the host menu items and add them to its own created context menu | |||
The plug-in can use the context menu in two ways : | |||
- add its own items to the menu via the IContextMenu interface and call IContextMenu::popup(..) to create the pop-up. See the \ref IContextMenuExample. | |||
- extract the host menu items and add them to a context menu created by the plug-in. | |||
\b Note: You can and should use this even if you don't add your own items to the menu as this is considered to be a big user value. | |||
\b Note: You can and should use this even if you do not add your own items to the menu as this is considered to be a big user value. | |||
\sa IContextMenu | |||
\sa IContextMenuTarget | |||
\section IContextMenuExample Example | |||
Adding Plug-in specific items to the context menu | |||
\code | |||
\section IContextMenuExample Examples | |||
- For example, Cubase adds its owned entries in the context menu opened with right-click on an exported parameter when the plug-in uses createContextMenu. | |||
\image html "contextmenuexample.png" | |||
\n | |||
- Adding plug-in specific items to the context menu: | |||
\code{.cpp} | |||
//------------------------------------------------------------------------ | |||
class PluginContextMenuTarget : public IContextMenuTarget, public FObject | |||
{ | |||
public: | |||
@@ -61,8 +66,8 @@ public: | |||
virtual tresult PLUGIN_API executeMenuItem (int32 tag) | |||
{ | |||
// this will be called if the user has executed one of the menu items of the Plug-in. | |||
// It won't be called for items of the host. | |||
// this will be called if the user has executed one of the menu items of the plug-in. | |||
// It will not be called for items of the host. | |||
switch (tag) | |||
{ | |||
case 1: break; | |||
@@ -110,14 +115,13 @@ void popupContextMenu (IComponentHandler* componentHandler, IPlugView* view, con | |||
} | |||
\endcode | |||
*/ | |||
//------------------------------------------------------------------------ | |||
class IComponentHandler3 : public FUnknown | |||
{ | |||
public: | |||
/** Creates a host context menu for a Plug-in: | |||
/** Creates a host context menu for a plug-in: | |||
- If paramID is zero, the host may create a generic context menu. | |||
- The IPlugView object must be valid. | |||
- The return IContextMenu object needs to be released afterwards by the Plug-in. | |||
- The return IContextMenu object needs to be released afterwards by the plug-in. | |||
*/ | |||
virtual IContextMenu* PLUGIN_API createContextMenu (IPlugView* plugView, const ParamID* paramID) = 0; | |||
//------------------------------------------------------------------------ | |||
@@ -127,7 +131,7 @@ public: | |||
DECLARE_CLASS_IID (IComponentHandler3, 0x69F11617, 0xD26B400D, 0xA4B6B964, 0x7B6EBBAB) | |||
//------------------------------------------------------------------------ | |||
/** Context Menu Item Target Interface. | |||
/** Context Menu Item Target interface: Vst::IContextMenuTarget | |||
\ingroup vstIHost vstIPlug vst350 | |||
- [host imp] | |||
- [plug imp] | |||
@@ -137,9 +141,8 @@ DECLARE_CLASS_IID (IComponentHandler3, 0x69F11617, 0xD26B400D, 0xA4B6B964, 0x7B6 | |||
A receiver of a menu item should implement this interface, which will be called after the user has selected | |||
this menu item. | |||
See IComponentHandler3 for more. | |||
\see IComponentHandler3 for more information. | |||
*/ | |||
//------------------------------------------------------------------------ | |||
class IContextMenuTarget : public FUnknown | |||
{ | |||
public: | |||
@@ -168,7 +171,7 @@ struct IContextMenuItem | |||
}; | |||
}; | |||
//------------------------------------------------------------------------ | |||
/** Context Menu Interface. | |||
/** Context Menu interface: Vst::IContextMenu | |||
\ingroup vstIHost vst350 | |||
- [host imp] | |||
- [create with IComponentHandler3::createContextMenu(..)] | |||
@@ -177,11 +180,10 @@ struct IContextMenuItem | |||
A context menu is composed of Item (entry). A Item is defined by a name, a tag, a flag | |||
and a associated target (called when this item will be selected/executed). | |||
With IContextMenu the Plug-in can retrieve a Item, add a Item, remove a Item and pop-up the menu. | |||
With IContextMenu the plug-in can retrieve a Item, add a Item, remove a Item and pop-up the menu. | |||
See IComponentHandler3 for more. | |||
\see IComponentHandler3 for more information. | |||
*/ | |||
//------------------------------------------------------------------------ | |||
class IContextMenu : public FUnknown | |||
{ | |||
public: | |||
@@ -199,7 +201,7 @@ public: | |||
/** Removes a menu item. */ | |||
virtual tresult PLUGIN_API removeItem (const Item& item, IContextMenuTarget* target) = 0; | |||
/** Pop-ups the menu. Coordinates are relative to the top-left position of the Plug-ins view. */ | |||
/** Pop-ups the menu. Coordinates are relative to the top-left position of the plug-ins view. */ | |||
virtual tresult PLUGIN_API popup (UCoord x, UCoord y) = 0; | |||
//------------------------------------------------------------------------ | |||
@@ -17,7 +17,7 @@ | |||
#pragma once | |||
#include "pluginterfaces/base/ipluginbase.h" | |||
#include "vsttypes.h" | |||
#include "pluginterfaces/vst/vsttypes.h" | |||
//------------------------------------------------------------------------ | |||
#include "pluginterfaces/base/falignpush.h" | |||
@@ -37,9 +37,12 @@ class IBStream; | |||
//------------------------------------------------------------------------ | |||
namespace Vst { | |||
//------------------------------------------------------------------------ | |||
/** Controller Parameter Info. */ | |||
//------------------------------------------------------------------------ | |||
/** Controller Parameter Info. | |||
* A parameter info describes a parameter of the controller. | |||
* The id must always be the same for a parameter as this uniquely identifies the parameter. | |||
*/ | |||
struct ParameterInfo | |||
{ | |||
//------------------------------------------------------------------------ | |||
@@ -48,23 +51,25 @@ struct ParameterInfo | |||
String128 shortTitle; ///< parameter shortTitle (e.g. "Vol") | |||
String128 units; ///< parameter unit (e.g. "dB") | |||
int32 stepCount; ///< number of discrete steps (0: continuous, 1: toggle, discrete value otherwise | |||
///< (corresponding to max - min, for example: 127 for a min = 0 and a max = 127) - see \ref vst3parameterIntro) | |||
///< (corresponding to max - min, for example: 127 for a min = 0 and a max = 127) - see \ref vst3ParameterIntro) | |||
ParamValue defaultNormalizedValue; ///< default normalized value [0,1] (in case of discrete value: defaultNormalizedValue = defDiscreteValue / stepCount) | |||
UnitID unitId; ///< id of unit this parameter belongs to (see \ref vst3UnitsIntro) | |||
UnitID unitId; ///< id of unit this parameter belongs to (see \ref vst3Units) | |||
int32 flags; ///< ParameterFlags (see below) | |||
enum ParameterFlags | |||
{ | |||
kNoFlags = 0, ///< no flags wanted | |||
kCanAutomate = 1 << 0, ///< parameter can be automated | |||
kIsReadOnly = 1 << 1, ///< parameter cannot be changed from outside (implies that kCanAutomate is false) | |||
kIsReadOnly = 1 << 1, ///< parameter cannot be changed from outside the plug-in (implies that kCanAutomate is NOT set) | |||
kIsWrapAround = 1 << 2, ///< attempts to set the parameter value out of the limits will result in a wrap around [SDK 3.0.2] | |||
kIsList = 1 << 3, ///< parameter should be displayed as list in generic editor or automation editing [SDK 3.1.0] | |||
kIsHidden = 1 << 4, ///< parameter should be NOT displayed and cannot be changed from outside the plug-in | |||
///< (implies that kCanAutomate is NOT set and kIsReadOnly is set) [SDK 3.7.0] | |||
kIsProgramChange = 1 << 15, ///< parameter is a program change (unitId gives info about associated unit | |||
///< - see \ref vst3UnitPrograms) | |||
kIsBypass = 1 << 16 ///< special bypass parameter (only one allowed): Plug-in can handle bypass | |||
///< (highly recommended to export a bypass parameter for effect Plug-in) | |||
///< - see \ref vst3ProgramLists) | |||
kIsBypass = 1 << 16 ///< special bypass parameter (only one allowed): plug-in can handle bypass | |||
///< (highly recommended to export a bypass parameter for effect plug-in) | |||
}; | |||
//------------------------------------------------------------------------ | |||
}; | |||
@@ -78,48 +83,101 @@ const CString kEditor = "editor"; | |||
//------------------------------------------------------------------------ | |||
/** Flags used for IComponentHandler::restartComponent */ | |||
//------------------------------------------------------------------------ | |||
enum RestartFlags | |||
{ | |||
kReloadComponent = 1 << 0, ///< The Component should be reloaded [SDK 3.0.0] | |||
kIoChanged = 1 << 1, ///< Input and/or Output Bus configuration has changed [SDK 3.0.0] | |||
kParamValuesChanged = 1 << 2, ///< Multiple parameter values have changed | |||
///< (as result of a program change for example) [SDK 3.0.0] | |||
kLatencyChanged = 1 << 3, ///< Latency has changed (IAudioProcessor.getLatencySamples) [SDK 3.0.0] | |||
kParamTitlesChanged = 1 << 4, ///< Parameter titles or default values or flags have changed [SDK 3.0.0] | |||
kMidiCCAssignmentChanged = 1 << 5, ///< MIDI Controller Assignments have changed [SDK 3.0.1] | |||
kNoteExpressionChanged = 1 << 6, ///< Note Expression has changed (info, count, PhysicalUIMapping, ...) [SDK 3.5.0] | |||
kIoTitlesChanged = 1 << 7, ///< Input and/or Output bus titles have changed [SDK 3.5.0] | |||
kPrefetchableSupportChanged = 1 << 8, ///< Prefetch support has changed (\see IPrefetchableSupport) [SDK 3.6.1] | |||
kRoutingInfoChanged = 1 << 9 ///< RoutingInfo has changed (\see IComponent) [SDK 3.6.6] | |||
/** The Component should be reloaded | |||
* The host has to unload completely the plug-in (controller/processor) and reload it. | |||
* [SDK 3.0.0] */ | |||
kReloadComponent = 1 << 0, | |||
/** Input / Output Bus configuration has changed | |||
* The plug-in informs the host that either the bus configuration or the bus count has changed. | |||
* The host has to deactivate the plug-in, asks the plug-in for its wanted new bus configurations, | |||
* adapts its processing graph and reactivate the plug-in. | |||
* [SDK 3.0.0] */ | |||
kIoChanged = 1 << 1, | |||
/** Multiple parameter values have changed (as result of a program change for example) | |||
* The host invalidates all caches of parameter values and asks the edit controller for the current values. | |||
* [SDK 3.0.0] */ | |||
kParamValuesChanged = 1 << 2, | |||
/** Latency has changed | |||
* The plug informs the host that its latency has changed, getLatencySamples should return the new latency after setActive (true) was called | |||
* The host has to deactivate and reactivate the plug-in, then afterwards the host could ask for the current latency (getLatencySamples) | |||
* see IAudioProcessor::getLatencySamples | |||
* [SDK 3.0.0] */ | |||
kLatencyChanged = 1 << 3, | |||
/** Parameter titles, default values or flags (ParameterFlags) have changed | |||
* The host invalidates all caches of parameter infos and asks the edit controller for the current infos. | |||
* [SDK 3.0.0] */ | |||
kParamTitlesChanged = 1 << 4, | |||
/** MIDI Controllers and/or Program Changes Assignments have changed | |||
* The plug-in informs the host that its MIDI-CC mapping has changed (for example after a MIDI learn or new loaded preset) | |||
* or if the stepCount or UnitID of a ProgramChange parameter has changed. | |||
* The host has to rebuild the MIDI-CC => parameter mapping (getMidiControllerAssignment) | |||
* and reread program changes parameters (stepCount and associated unitID) | |||
* [SDK 3.0.1] */ | |||
kMidiCCAssignmentChanged = 1 << 5, | |||
/** Note Expression has changed (info, count, PhysicalUIMapping, ...) | |||
* Either the note expression type info, the count of note expressions or the physical UI mapping has changed. | |||
* The host invalidates all caches of note expression infos and asks the edit controller for the current ones. | |||
* See INoteExpressionController, NoteExpressionTypeInfo and INoteExpressionPhysicalUIMapping | |||
* [SDK 3.5.0] */ | |||
kNoteExpressionChanged = 1 << 6, | |||
/** Input / Output bus titles have changed | |||
* The host invalidates all caches of bus titles and asks the edit controller for the current titles. | |||
* [SDK 3.5.0] */ | |||
kIoTitlesChanged = 1 << 7, | |||
/** Prefetch support has changed | |||
* The plug-in informs the host that its PrefetchSupport has changed | |||
* The host has to deactivate the plug-in, calls IPrefetchableSupport::getPrefetchableSupport and reactivate the plug-in | |||
* see IPrefetchableSupport | |||
* [SDK 3.6.1] */ | |||
kPrefetchableSupportChanged = 1 << 8, | |||
/** RoutingInfo has changed | |||
* The plug-in informs the host that its internal routing (relation of an event-input-channel to an audio-output-bus) has changed | |||
* The host ask the plug-in for the new routing with IComponent::getRoutingInfo, \ref vst3Routing | |||
* see IComponent | |||
* [SDK 3.6.6] */ | |||
kRoutingInfoChanged = 1 << 9 | |||
}; | |||
//------------------------------------------------------------------------ | |||
/** Host callback interface for an edit controller. | |||
/** Host callback interface for an edit controller: Vst::IComponentHandler | |||
\ingroup vstIHost vst300 | |||
- [host imp] | |||
- [released: 3.0.0] | |||
- [mandatory] | |||
Allow transfer of parameter editing to component (processor) via host and support automation. | |||
Cause the host to react on configuration changes (restartComponent) | |||
Cause the host to react on configuration changes (restartComponent). | |||
\see IEditController */ | |||
//------------------------------------------------------------------------ | |||
class IComponentHandler: public FUnknown | |||
\see \ref IEditController | |||
*/ | |||
class IComponentHandler : public FUnknown | |||
{ | |||
public: | |||
//------------------------------------------------------------------------ | |||
/** To be called before calling a performEdit (e.g. on mouse-click-down event). */ | |||
/** To be called before calling a performEdit (e.g. on mouse-click-down event). | |||
This must be called in the UI-Thread context! */ | |||
virtual tresult PLUGIN_API beginEdit (ParamID id) = 0; | |||
/** Called between beginEdit and endEdit to inform the handler that a given parameter has a new value. */ | |||
/** Called between beginEdit and endEdit to inform the handler that a given parameter has a new | |||
* value. This must be called in the UI-Thread context! */ | |||
virtual tresult PLUGIN_API performEdit (ParamID id, ParamValue valueNormalized) = 0; | |||
/** To be called after calling a performEdit (e.g. on mouse-click-up event). */ | |||
/** To be called after calling a performEdit (e.g. on mouse-click-up event). | |||
This must be called in the UI-Thread context! */ | |||
virtual tresult PLUGIN_API endEdit (ParamID id) = 0; | |||
/** Instructs host to restart the component. This should be called in the UI-Thread context! | |||
/** Instructs host to restart the component. This must be called in the UI-Thread context! | |||
\param flags is a combination of RestartFlags */ | |||
virtual tresult PLUGIN_API restartComponent (int32 flags) = 0; | |||
@@ -130,7 +188,7 @@ public: | |||
DECLARE_CLASS_IID (IComponentHandler, 0x93A0BEA3, 0x0BD045DB, 0x8E890B0C, 0xC1E46AC6) | |||
//------------------------------------------------------------------------ | |||
/** Extended Host callback interface IComponentHandler2 for an edit controller | |||
/** Extended host callback interface for an edit controller: Vst::IComponentHandler2 | |||
\ingroup vstIHost vst310 | |||
- [host imp] | |||
- [extends IComponentHandler] | |||
@@ -138,63 +196,64 @@ DECLARE_CLASS_IID (IComponentHandler, 0x93A0BEA3, 0x0BD045DB, 0x8E890B0C, 0xC1E4 | |||
- [optional] | |||
One part handles: | |||
- Setting dirty state of Plug-in | |||
- requesting the host to open the editor | |||
- Setting dirty state of the plug-in | |||
- Requesting the host to open the editor | |||
The other part handles parameter group editing from Plug-in UI. It wraps a set of \ref IComponentHandler::beginEdit / | |||
\ref IComponentHandler::performEdit / \ref IComponentHandler::endEdit functions (see \ref IComponentHandler) | |||
The other part handles parameter group editing from the plug-in UI. It wraps a set of \ref IComponentHandler::beginEdit / | |||
\ref Steinberg::Vst::IComponentHandler::performEdit / \ref Steinberg::Vst::IComponentHandler::endEdit functions (see \ref IComponentHandler) | |||
which should use the same timestamp in the host when writing automation. | |||
This allows for better synchronizing multiple parameter changes at once. | |||
This allows for better synchronizing of multiple parameter changes at once. | |||
\section IComponentHandler2Example Examples of different use cases | |||
\code | |||
//-------------------------------------- | |||
// in case of multiple switch buttons (with associated ParamID 1 and 3) | |||
// on mouse down : | |||
hostHandler2->startGroupEdit (); | |||
hostHandler->beginEdit (1); | |||
hostHandler->beginEdit (3); | |||
hostHandler->performEdit (1, 1.0); | |||
hostHandler->performEdit (3, 0.0); // the opposite of paramID 1 for example | |||
.... | |||
// on mouse up : | |||
hostHandler->endEdit (1); | |||
hostHandler->endEdit (3); | |||
hostHandler2->finishGroupEdit (); | |||
.... | |||
.... | |||
//-------------------------------------- | |||
// in case of multiple faders (with associated ParamID 1 and 3) | |||
// on mouse down : | |||
hostHandler2->startGroupEdit (); | |||
hostHandler->beginEdit (1); | |||
hostHandler->beginEdit (3); | |||
hostHandler2->finishGroupEdit (); | |||
.... | |||
// on mouse move : | |||
hostHandler2->startGroupEdit (); | |||
hostHandler->performEdit (1, x); // x the wanted value | |||
hostHandler->performEdit (3, x); | |||
hostHandler2->finishGroupEdit (); | |||
.... | |||
// on mouse up : | |||
hostHandler2->startGroupEdit (); | |||
hostHandler->endEdit (1); | |||
hostHandler->endEdit (3); | |||
hostHandler2->finishGroupEdit (); | |||
\code{.cpp} | |||
//-------------------------------------- | |||
// we are in the editcontroller... | |||
// in case of multiple switch buttons (with associated ParamID 1 and 3) | |||
// on mouse down : | |||
hostHandler2->startGroupEdit (); | |||
hostHandler->beginEdit (1); | |||
hostHandler->beginEdit (3); | |||
hostHandler->performEdit (1, 1.0); | |||
hostHandler->performEdit (3, 0.0); // the opposite of paramID 1 for example | |||
.... | |||
// on mouse up : | |||
hostHandler->endEdit (1); | |||
hostHandler->endEdit (3); | |||
hostHandler2->finishGroupEdit (); | |||
.... | |||
.... | |||
//-------------------------------------- | |||
// in case of multiple faders (with associated ParamID 1 and 3) | |||
// on mouse down : | |||
hostHandler2->startGroupEdit (); | |||
hostHandler->beginEdit (1); | |||
hostHandler->beginEdit (3); | |||
hostHandler2->finishGroupEdit (); | |||
.... | |||
// on mouse move : | |||
hostHandler2->startGroupEdit (); | |||
hostHandler->performEdit (1, x); // x the wanted value | |||
hostHandler->performEdit (3, x); | |||
hostHandler2->finishGroupEdit (); | |||
.... | |||
// on mouse up : | |||
hostHandler2->startGroupEdit (); | |||
hostHandler->endEdit (1); | |||
hostHandler->endEdit (3); | |||
hostHandler2->finishGroupEdit (); | |||
\endcode | |||
\see IComponentHandler | |||
\see IEditController*/ | |||
//------------------------------------------------------------------------ | |||
class IComponentHandler2: public FUnknown | |||
\see \ref IComponentHandler, \ref IEditController | |||
*/ | |||
class IComponentHandler2 : public FUnknown | |||
{ | |||
public: | |||
//------------------------------------------------------------------------ | |||
/** Tells host that the Plug-in is dirty (something besides parameters has changed since last save), | |||
/** Tells host that the plug-in is dirty (something besides parameters has changed since last save), | |||
if true the host should apply a save before quitting. */ | |||
virtual tresult PLUGIN_API setDirty (TBool state) = 0; | |||
/** Tells host that it should open the Plug-in editor the next time it's possible. | |||
/** Tells host that it should open the plug-in editor the next time it's possible. | |||
You should use this instead of showing an alert and blocking the program flow (especially on loading projects). */ | |||
virtual tresult PLUGIN_API requestOpenEditor (FIDString name = ViewType::kEditor) = 0; | |||
@@ -214,24 +273,33 @@ public: | |||
DECLARE_CLASS_IID (IComponentHandler2, 0xF040B4B3, 0xA36045EC, 0xABCDC045, 0xB4D5A2CC) | |||
//------------------------------------------------------------------------ | |||
/** Extended Host callback interface IComponentHandlerBusActivation for an edit controller. | |||
/** Extended host callback interface for an edit controller: Vst::IComponentHandlerBusActivation | |||
\ingroup vstIHost vst368 | |||
- [host imp] | |||
- [extends IComponentHandler] | |||
- [released: 3.6.8] | |||
- [optional] | |||
Allows the Plug-in to request the host to activate or deactivate a specific bus, | |||
if the host accepts it will call later on IComponent::activateBus (see \ref IComponent::activateBus). | |||
Useful especially for Instrument with more than 1 outputs, where the user could request | |||
from the Plug-in UI a given output bus activation. | |||
Allows the plug-in to request the host to activate or deactivate a specific bus. | |||
If the host accepts this request, it will call later on \ref IComponent::activateBus. | |||
This is particularly useful for instruments with more than 1 outputs, where the user could request | |||
from the plug-in UI a given output bus activation. | |||
\see \ref IComponentHandler */ | |||
//------------------------------------------------------------------------ | |||
\code{.cpp} | |||
// somewhere in your code when you need to inform the host to enable a specific Bus. | |||
FUnknownPtr<IComponentHandlerBusActivation> busActivation (componentHandler); | |||
if (busActivation) | |||
{ | |||
// here we want to activate our audio input sidechain (the 2cd input bus: index 1) | |||
busActivation->requestBusActivation (kAudio, kInput, 1, true); | |||
} | |||
\endcode | |||
\see \ref IComponentHandler | |||
*/ | |||
class IComponentHandlerBusActivation : public FUnknown | |||
{ | |||
public: | |||
//------------------------------------------------------------------------ | |||
//------------------------------------------------------------------------ | |||
/** request the host to activate or deactivate a specific bus. */ | |||
virtual tresult PLUGIN_API requestBusActivation (MediaType type, BusDirection dir, int32 index, | |||
TBool state) = 0; | |||
@@ -243,16 +311,84 @@ public: | |||
DECLARE_CLASS_IID (IComponentHandlerBusActivation, 0x067D02C1, 0x5B4E274D, 0xA92D90FD, 0x6EAF7240) | |||
//------------------------------------------------------------------------ | |||
/** Edit controller component interface. | |||
/** Extended host callback interface for an edit controller: Vst::IProgress | |||
\ingroup vstIHost vst370 | |||
- [host imp] | |||
- [extends IComponentHandler] | |||
- [released: 3.7.0] | |||
- [optional] | |||
Allows the plug-in to request the host to create a progress for some specific tasks which take | |||
some time. The host can visualize the progress as read-only UI elements. For example, | |||
after loading a project where a plug-in needs to load extra | |||
data (e.g. samples) in a background thread, this enables the host to get and visualize the current status of the loading | |||
progress and to inform the user when the loading is finished. | |||
Note: During the progress, the host can unload the plug-in at any time. Make sure that the plug-in | |||
supports this use case. | |||
\section IProgressExample Example | |||
\code{.cpp} | |||
//-------------------------------------- | |||
// we are in the editcontroller: | |||
// as member: IProgress::ID mProgressID; | |||
FUnknownPtr<IProgress> progress (componentHandler); | |||
if (progress) | |||
progress->start (IProgress::ProgressType::UIBackgroundTask, STR ("Load Samples..."), mProgressID); | |||
// ... | |||
myProgressValue += incProgressStep; | |||
FUnknownPtr<IProgress> progress (componentHandler); | |||
if (progress) | |||
progress->update (mProgressID, myProgressValue); | |||
// ... | |||
FUnknownPtr<IProgress> progress (componentHandler); | |||
if (progress) | |||
progress->finish (mProgressID); | |||
\endcode | |||
\see \ref IComponentHandler | |||
*/ | |||
class IProgress : public FUnknown | |||
{ | |||
public: | |||
//------------------------------------------------------------------------ | |||
enum ProgressType : uint32 | |||
{ | |||
AsyncStateRestoration = 0, ///< plug-in state is restored async (in a background Thread) | |||
UIBackgroundTask ///< a plug-in task triggered by a UI action | |||
}; | |||
using ID = uint64; | |||
/** Start a new progress of a given type and optional Description. outID is as ID created by the | |||
* host to identify this newly created progress (for update and finish method) */ | |||
virtual tresult PLUGIN_API start (ProgressType type, const tchar* optionalDescription, | |||
ID& outID) = 0; | |||
/** Update the progress value (normValue between [0, 1]) associated to the given id */ | |||
virtual tresult PLUGIN_API update (ID id, ParamValue normValue) = 0; | |||
/** Finish the progress associated to the given id */ | |||
virtual tresult PLUGIN_API finish (ID id) = 0; | |||
//------------------------------------------------------------------------ | |||
static const FUID iid; | |||
}; | |||
DECLARE_CLASS_IID (IProgress, 0x00C9DC5B, 0x9D904254, 0x91A388C8, 0xB4E91B69) | |||
//------------------------------------------------------------------------ | |||
/** Edit controller component interface: Vst::IEditController | |||
\ingroup vstIPlug vst300 | |||
- [plug imp] | |||
- [released: 3.0.0] | |||
- [mandatory] | |||
The Controller part of an effect or instrument with parameter handling (export, definition, conversion...). | |||
\see IComponent::getControllerClassId, IMidiMapping */ | |||
//------------------------------------------------------------------------ | |||
class IEditController: public IPluginBase | |||
The controller part of an effect or instrument with parameter handling (export, definition, conversion...). | |||
\see \ref IComponent::getControllerClassId, \ref IMidiMapping | |||
*/ | |||
class IEditController : public IPluginBase | |||
{ | |||
public: | |||
//------------------------------------------------------------------------ | |||
@@ -277,7 +413,7 @@ public: | |||
virtual tresult PLUGIN_API getParamValueByString (ParamID id, TChar* string /*in*/, ParamValue& valueNormalized /*out*/) = 0; | |||
/** Returns for a given paramID and a normalized value its plain representation | |||
(for example 90 for 90db - see \ref vst3AutomationIntro). */ | |||
(for example -6 for -6dB - see \ref vst3AutomationIntro). */ | |||
virtual ParamValue PLUGIN_API normalizedParamToPlain (ParamID id, ParamValue valueNormalized) = 0; | |||
/** Returns for a given paramID and a plain value its normalized value. (see \ref vst3AutomationIntro) */ | |||
virtual ParamValue PLUGIN_API plainParamToNormalized (ParamID id, ParamValue plainValue) = 0; | |||
@@ -290,11 +426,12 @@ public: | |||
virtual tresult PLUGIN_API setParamNormalized (ParamID id, ParamValue value) = 0; | |||
// handler ---------------------------- | |||
/** Gets from host a handler. */ | |||
/** Gets from host a handler which allows the Plugin-in to communicate with the host. | |||
Note: This is mandatory if the host is using the IEditController! */ | |||
virtual tresult PLUGIN_API setComponentHandler (IComponentHandler* handler) = 0; | |||
// view ------------------------------- | |||
/** Creates the editor view of the Plug-in, currently only "editor" is supported, see \ref ViewType. | |||
/** Creates the editor view of the plug-in, currently only "editor" is supported, see \ref ViewType. | |||
The life time of the editor view will never exceed the life time of this controller instance. */ | |||
virtual IPlugView* PLUGIN_API createView (FIDString name) = 0; | |||
@@ -306,7 +443,6 @@ DECLARE_CLASS_IID (IEditController, 0xDCD7BBE3, 0x7742448D, 0xA874AACC, 0x979C75 | |||
//------------------------------------------------------------------------ | |||
/** Knob Mode */ | |||
//------------------------------------------------------------------------ | |||
enum KnobModes | |||
{ | |||
kCircularMode = 0, ///< Circular with jump to clicked position | |||
@@ -314,33 +450,39 @@ enum KnobModes | |||
kLinearMode ///< Linear: depending on vertical movement | |||
}; | |||
typedef int32 KnobMode; ///< Knob Mode | |||
//------------------------------------------------------------------------ | |||
/** \defgroup vst3typedef VST 3 Data Types */ | |||
/*@{*/ | |||
//------------------------------------------------------------------------ | |||
/** Knob Mode Type */ | |||
typedef int32 KnobMode; | |||
/*@}*/ | |||
//------------------------------------------------------------------------ | |||
/** Edit controller component interface extension. | |||
/** Edit controller component interface extension: Vst::IEditController2 | |||
\ingroup vstIPlug vst310 | |||
- [plug imp] | |||
- [extends IEditController] | |||
- [released: 3.1.0] | |||
- [optional] | |||
Extension to inform the Plug-in about the host Knob Mode, | |||
and to open the Plug-in about box or help documentation. | |||
Extension to allow the host to inform the plug-in about the host Knob Mode, | |||
and to open the plug-in about box or help documentation. | |||
\see IEditController*/ | |||
//------------------------------------------------------------------------ | |||
class IEditController2: public FUnknown | |||
\see \ref IEditController, \ref EditController | |||
*/ | |||
class IEditController2 : public FUnknown | |||
{ | |||
public: | |||
/** Host could set the Knob Mode for the Plug-in. Return kResultFalse means not supported mode. \see KnobModes. */ | |||
/** Host could set the Knob Mode for the plug-in. Return kResultFalse means not supported mode. \see KnobModes. */ | |||
virtual tresult PLUGIN_API setKnobMode (KnobMode mode) = 0; | |||
/** Host could ask to open the Plug-in help (could be: opening a PDF document or link to a web page). | |||
/** Host could ask to open the plug-in help (could be: opening a PDF document or link to a web page). | |||
The host could call it with onlyCheck set to true for testing support of open Help. | |||
Return kResultFalse means not supported function. */ | |||
virtual tresult PLUGIN_API openHelp (TBool onlyCheck) = 0; | |||
/** Host could ask to open the Plug-in about box. | |||
/** Host could ask to open the plug-in about box. | |||
The host could call it with onlyCheck set to true for testing support of open AboutBox. | |||
Return kResultFalse means not supported function. */ | |||
virtual tresult PLUGIN_API openAboutBox (TBool onlyCheck) = 0; | |||
@@ -352,7 +494,7 @@ public: | |||
DECLARE_CLASS_IID (IEditController2, 0x7F4EFE59, 0xF3204967, 0xAC27A3AE, 0xAFB63038) | |||
//------------------------------------------------------------------------ | |||
/** MIDI Mapping Interface. | |||
/** MIDI Mapping interface: Vst::IMidiMapping | |||
\ingroup vstIPlug vst301 | |||
- [plug imp] | |||
- [extends IEditController] | |||
@@ -362,20 +504,52 @@ DECLARE_CLASS_IID (IEditController2, 0x7F4EFE59, 0xF3204967, 0xAC27A3AE, 0xAFB63 | |||
MIDI controllers are not transmitted directly to a VST component. MIDI as hardware protocol has | |||
restrictions that can be avoided in software. Controller data in particular come along with unclear | |||
and often ignored semantics. On top of this they can interfere with regular parameter automation and | |||
the host is unaware of what happens in the Plug-in when passing MIDI controllers directly. | |||
the host is unaware of what happens in the plug-in when passing MIDI controllers directly. | |||
So any functionality that is to be controlled by MIDI controllers must be exported as regular parameter. | |||
The host will transform incoming MIDI controller data using this interface and transmit them as normal | |||
The host will transform incoming MIDI controller data using this interface and transmit them as regular | |||
parameter change. This allows the host to automate them in the same way as other parameters. | |||
CtrlNumber could be typical MIDI controller value extended to some others values like pitch bend or | |||
after touch (see \ref ControllerNumbers). | |||
If the mapping has changed, the Plug-in should call IComponentHandler::restartComponent (kMidiCCAssignmentChanged) | |||
to inform the host about this change. */ | |||
//------------------------------------------------------------------------ | |||
class IMidiMapping: public FUnknown | |||
CtrlNumber can be a typical MIDI controller value extended to some others values like pitchbend or | |||
aftertouch (see \ref ControllerNumbers). | |||
If the mapping has changed, the plug-in must call IComponentHandler::restartComponent (kMidiCCAssignmentChanged) | |||
to inform the host about this change. | |||
\section IMidiMappingExample Example | |||
\code{.cpp} | |||
//-------------------------------------- | |||
// in myeditcontroller.h | |||
class MyEditController: public EditControllerEx1, public IMidiMapping | |||
{ | |||
public: | |||
//... | |||
//---IMidiMapping--------------------------- | |||
tresult PLUGIN_API getMidiControllerAssignment (int32 busIndex, int16 channel, CtrlNumber midiControllerNumber, ParamID& id) SMTG_OVERRIDE; | |||
//---Interface--------- | |||
OBJ_METHODS (MyEditController, EditControllerEx1) | |||
DEFINE_INTERFACES | |||
DEF_INTERFACE (IMidiMapping) | |||
END_DEFINE_INTERFACES (MyEditController) | |||
REFCOUNT_METHODS (MyEditController) | |||
}; | |||
//-------------------------------------- | |||
// in myeditcontroller.cpp | |||
tresult PLUGIN_API MyEditController::getMidiControllerAssignment (int32 busIndex, int16 midiChannel, CtrlNumber midiControllerNumber, ParamID& tag) | |||
{ | |||
// for my first Event bus and for MIDI channel 0 and for MIDI CC Volume only | |||
if (busIndex == 0 && midiChannel == 0 && midiControllerNumber == kCtrlVolume) | |||
{ | |||
tag = kGainId; | |||
return kResultTrue; | |||
} | |||
return kResultFalse; | |||
} | |||
\endcode | |||
*/ | |||
class IMidiMapping : public FUnknown | |||
{ | |||
public: | |||
/** Gets an (preferred) associated ParamID for a given Input Event Bus index, channel and MIDI Controller. | |||
* @param[in] busIndex - index of Input Event Bus | |||
* @param[in] channel - channel of the bus | |||
@@ -392,24 +566,31 @@ public: | |||
DECLARE_CLASS_IID (IMidiMapping, 0xDF0FF9F7, 0x49B74669, 0xB63AB732, 0x7ADBF5E5) | |||
//------------------------------------------------------------------------ | |||
/** Parameter Editing from Host. | |||
/** Parameter Editing from host: Vst::IEditControllerHostEditing | |||
\ingroup vstIPlug vst350 | |||
- [plug imp] | |||
- [extends IEditController] | |||
- [released: 3.5.0] | |||
- [optional] | |||
If this interface is implemented by the edit controller and when performing edits from outside | |||
the Plug-in (host / remote) of a not automatable and not read only flagged parameter (kind of helper parameter), | |||
If this interface is implemented by the edit controller, and when performing edits from outside | |||
the plug-in (host / remote) of a not automatable and not read-only, and not hidden flagged parameter (kind of helper parameter), | |||
the host will start with a beginEditFromHost before calling setParamNormalized and end with an endEditFromHost. | |||
Here the sequencing, the host will call: | |||
- beginEditFromHost () | |||
- setParamNormalized () | |||
- setParamNormalized () | |||
- ... | |||
- endEditFromHost () | |||
\see IEditController */ | |||
Here the sequence that the host will call: | |||
\section IEditControllerExample Example | |||
\code{.cpp} | |||
//------------------------------------------------------------------------ | |||
plugEditController->beginEditFromHost (id); | |||
plugEditController->setParamNormalized (id, value); | |||
plugEditController->setParamNormalized (id, value + 0.1); | |||
// ... | |||
plugEditController->endEditFromHost (id); | |||
\endcode | |||
\see \ref IEditController | |||
*/ | |||
class IEditControllerHostEditing : public FUnknown | |||
{ | |||
public: | |||
@@ -26,12 +26,24 @@ | |||
//------------------------------------------------------------------------ | |||
namespace Steinberg { | |||
namespace Vst { | |||
//------------------------------------------------------------------------ | |||
/** Reserved note identifier (noteId) range for a plug-in. Guaranteed not used by the host. */ | |||
enum NoteIDUserRange | |||
{ | |||
kNoteIDUserRangeLowerBound = -10000, | |||
kNoteIDUserRangeUpperBound = -1000, | |||
}; | |||
//------------------------------------------------------------------------ | |||
/** Note-on event specific data. Used in \ref Event (union)*/ | |||
/** Note-on event specific data. Used in \ref Event (union) | |||
\ingroup vstEventGrp | |||
Pitch uses the twelve-tone equal temperament tuning (12-TET). | |||
*/ | |||
struct NoteOnEvent | |||
{ | |||
int16 channel; ///< channel index in event bus | |||
int16 pitch; ///< range [0, 127] = [C-2, G8] with A3=440Hz | |||
int16 pitch; ///< range [0, 127] = [C-2, G8] with A3=440Hz (12-TET: twelve-tone equal temperament) | |||
float tuning; ///< 1.f = +1 cent, -1.f = -1 cent | |||
float velocity; ///< range [0.0, 1.0] | |||
int32 length; ///< in sample frames (optional, Note Off has to follow in any case!) | |||
@@ -39,18 +51,22 @@ struct NoteOnEvent | |||
}; | |||
//------------------------------------------------------------------------ | |||
/** Note-off event specific data. Used in \ref Event (union)*/ | |||
/** Note-off event specific data. Used in \ref Event (union) | |||
\ingroup vstEventGrp | |||
*/ | |||
struct NoteOffEvent | |||
{ | |||
int16 channel; ///< channel index in event bus | |||
int16 pitch; ///< range [0, 127] = [C-2, G8] with A3=440Hz | |||
int16 pitch; ///< range [0, 127] = [C-2, G8] with A3=440Hz (12-TET) | |||
float velocity; ///< range [0.0, 1.0] | |||
int32 noteId; ///< associated noteOn identifier (if not available then -1) | |||
float tuning; ///< 1.f = +1 cent, -1.f = -1 cent | |||
}; | |||
//------------------------------------------------------------------------ | |||
/** Data event specific data. Used in \ref Event (union)*/ | |||
/** Data event specific data. Used in \ref Event (union) | |||
\ingroup vstEventGrp | |||
*/ | |||
struct DataEvent | |||
{ | |||
uint32 size; ///< size in bytes of the data block bytes | |||
@@ -65,7 +81,9 @@ struct DataEvent | |||
}; | |||
//------------------------------------------------------------------------ | |||
/** PolyPressure event specific data. Used in \ref Event (union)*/ | |||
/** PolyPressure event specific data. Used in \ref Event (union) | |||
\ingroup vstEventGrp | |||
*/ | |||
struct PolyPressureEvent | |||
{ | |||
int16 channel; ///< channel index in event bus | |||
@@ -75,7 +93,9 @@ struct PolyPressureEvent | |||
}; | |||
//------------------------------------------------------------------------ | |||
/** Chord event specific data. Used in \ref Event (union)*/ | |||
/** Chord event specific data. Used in \ref Event (union) | |||
\ingroup vstEventGrp | |||
*/ | |||
struct ChordEvent | |||
{ | |||
int16 root; ///< range [0, 127] = [C-2, G8] with A3=440Hz | |||
@@ -87,7 +107,9 @@ struct ChordEvent | |||
}; | |||
//------------------------------------------------------------------------ | |||
/** Scale event specific data. Used in \ref Event (union)*/ | |||
/** Scale event specific data. Used in \ref Event (union) | |||
\ingroup vstEventGrp | |||
*/ | |||
struct ScaleEvent | |||
{ | |||
int16 root; ///< range [0, 127] = root Note/Transpose Factor | |||
@@ -98,7 +120,12 @@ struct ScaleEvent | |||
}; | |||
//------------------------------------------------------------------------ | |||
/** Legacy MIDI CC Out event specific data. Used in \ref Event (union)*/ | |||
/** Legacy MIDI CC Out event specific data. Used in \ref Event (union) | |||
\ingroup vstEventGrp | |||
- [released: 3.6.12] | |||
This kind of event is reserved for generating MIDI CC as output event for kEvent Bus during the process call. | |||
*/ | |||
struct LegacyMIDICCOutEvent | |||
{ | |||
uint8 controlNumber;///< see enum ControllerNumbers [0, 255] | |||
@@ -108,8 +135,10 @@ struct LegacyMIDICCOutEvent | |||
}; | |||
//------------------------------------------------------------------------ | |||
/** Event */ | |||
//------------------------------------------------------------------------ | |||
/** Event | |||
\ingroup vstEventGrp | |||
Structure representing a single Event of different types associated to a specific event (\ref kEvent) bus. | |||
*/ | |||
struct Event | |||
{ | |||
int32 busIndex; ///< event bus index | |||
@@ -156,15 +185,15 @@ struct Event | |||
}; | |||
//------------------------------------------------------------------------ | |||
/** List of events to process. | |||
/** List of events to process: Vst::IEventList | |||
\ingroup vstIHost vst300 | |||
- [host imp] | |||
- [released: 3.0.0] | |||
- [mandatory] | |||
\see ProcessData, Event */ | |||
//------------------------------------------------------------------------ | |||
class IEventList: public FUnknown | |||
\see ProcessData, Event | |||
*/ | |||
class IEventList : public FUnknown | |||
{ | |||
public: | |||
//------------------------------------------------------------------------ | |||
@@ -21,17 +21,18 @@ | |||
//------------------------------------------------------------------------ | |||
namespace Steinberg { | |||
namespace Vst { | |||
//------------------------------------------------------------------------ | |||
/** Basic Host Callback Interface. | |||
/** Basic host callback interface: Vst::IHostApplication | |||
\ingroup vstIHost vst300 | |||
- [host imp] | |||
- [passed as 'context' in to IPluginBase::initialize () ] | |||
- [released: 3.0.0] | |||
- [mandatory] | |||
Basic VST host application interface. */ | |||
//------------------------------------------------------------------------ | |||
class IHostApplication: public FUnknown | |||
Basic VST host application interface. | |||
*/ | |||
class IHostApplication : public FUnknown | |||
{ | |||
public: | |||
//------------------------------------------------------------------------ | |||
@@ -48,28 +49,29 @@ public: | |||
DECLARE_CLASS_IID (IHostApplication, 0x58E595CC, 0xDB2D4969, 0x8B6AAF8C, 0x36A664E5) | |||
//------------------------------------------------------------------------ | |||
/** Helper to allocate a message */ | |||
inline IMessage* allocateMessage (IHostApplication* host) | |||
{ | |||
TUID iid; | |||
IMessage::iid.toTUID (iid); | |||
IMessage* m = 0; | |||
IMessage* m = nullptr; | |||
if (host->createInstance (iid, iid, (void**)&m) == kResultOk) | |||
return m; | |||
return 0; | |||
return nullptr; | |||
} | |||
//------------------------------------------------------------------------ | |||
/** VST 3 to VST 2 Wrapper Interface. | |||
/** VST 3 to VST 2 Wrapper interface: Vst::IVst3ToVst2Wrapper | |||
\ingroup vstIHost vst310 | |||
- [host imp] | |||
- [passed as 'context' to IPluginBase::initialize () ] | |||
- [released: 3.1.0] | |||
- [mandatory] | |||
Informs the Plug-in that a VST 3 to VST 2 wrapper is used between the Plug-in and the real host. | |||
Implemented by the VST 2 Wrapper. */ | |||
//------------------------------------------------------------------------ | |||
class IVst3ToVst2Wrapper: public FUnknown | |||
Informs the plug-in that a VST 3 to VST 2 wrapper is used between the plug-in and the real host. | |||
Implemented by the VST 2 Wrapper. | |||
*/ | |||
class IVst3ToVst2Wrapper : public FUnknown | |||
{ | |||
public: | |||
//------------------------------------------------------------------------ | |||
@@ -79,17 +81,17 @@ public: | |||
DECLARE_CLASS_IID (IVst3ToVst2Wrapper, 0x29633AEC, 0x1D1C47E2, 0xBB85B97B, 0xD36EAC61) | |||
//------------------------------------------------------------------------ | |||
/** VST 3 to AU Wrapper Interface. | |||
/** VST 3 to AU Wrapper interface: Vst::IVst3ToAUWrapper | |||
\ingroup vstIHost vst310 | |||
- [host imp] | |||
- [passed as 'context' to IPluginBase::initialize () ] | |||
- [released: 3.1.0] | |||
- [mandatory] | |||
Informs the Plug-in that a VST 3 to AU wrapper is used between the Plug-in and the real host. | |||
Implemented by the AU Wrapper. */ | |||
//------------------------------------------------------------------------ | |||
class IVst3ToAUWrapper: public FUnknown | |||
Informs the plug-in that a VST 3 to AU wrapper is used between the plug-in and the real host. | |||
Implemented by the AU Wrapper. | |||
*/ | |||
class IVst3ToAUWrapper : public FUnknown | |||
{ | |||
public: | |||
//------------------------------------------------------------------------ | |||
@@ -99,16 +101,16 @@ public: | |||
DECLARE_CLASS_IID (IVst3ToAUWrapper, 0xA3B8C6C5, 0xC0954688, 0xB0916F0B, 0xB697AA44) | |||
//------------------------------------------------------------------------ | |||
/** VST 3 to AAX Wrapper Interface. | |||
/** VST 3 to AAX Wrapper interface: Vst::IVst3ToAAXWrapper | |||
\ingroup vstIHost vst368 | |||
- [host imp] | |||
- [passed as 'context' to IPluginBase::initialize () ] | |||
- [released: 3.6.8] | |||
- [mandatory] | |||
Informs the Plug-in that a VST 3 to AAX wrapper is used between the Plug-in and the real host. | |||
Implemented by the AAX Wrapper. */ | |||
//------------------------------------------------------------------------ | |||
Informs the plug-in that a VST 3 to AAX wrapper is used between the plug-in and the real host. | |||
Implemented by the AAX Wrapper. | |||
*/ | |||
class IVst3ToAAXWrapper : public FUnknown | |||
{ | |||
public: | |||
@@ -118,7 +120,7 @@ public: | |||
DECLARE_CLASS_IID (IVst3ToAAXWrapper, 0x6D319DC6, 0x60C56242, 0xB32C951B, 0x93BEF4C6) | |||
//------------------------------------------------------------------------ | |||
/** Wrapper MPE Support Interface | |||
/** Wrapper MPE Support interface: Vst::IVst3WrapperMPESupport | |||
\ingroup vstIHost vst3612 | |||
- [host imp] | |||
- [passed as 'context' to IPluginBase::initialize () ] | |||
@@ -127,13 +129,12 @@ DECLARE_CLASS_IID (IVst3ToAAXWrapper, 0x6D319DC6, 0x60C56242, 0xB32C951B, 0x93BE | |||
Implemented on wrappers that support MPE to Note Expression translation. | |||
Per default MPE input processing is enabled, the masterChannel will be zero, the memberBeginChannel | |||
By default, MPE input processing is enabled, the masterChannel will be zero, the memberBeginChannel | |||
will be one and the memberEndChannel will be 14. | |||
As MPE is a subset of the VST3 Note Expression feature, mapping from the three MPE expressions is | |||
handled via the INoteExpressionPhysicalUIMapping interface. | |||
*/ | |||
//------------------------------------------------------------------------ | |||
class IVst3WrapperMPESupport : public FUnknown | |||
{ | |||
public: | |||
@@ -33,9 +33,9 @@ class IInterAppAudioPresetManager; | |||
- [released: 3.6.0] | |||
- [optional] | |||
Implemented by the InterAppAudio Wrapper. */ | |||
//------------------------------------------------------------------------ | |||
class IInterAppAudioHost: public FUnknown | |||
Implemented by the InterAppAudio Wrapper. | |||
*/ | |||
class IInterAppAudioHost : public FUnknown | |||
{ | |||
public: | |||
/** get the size of the screen | |||
@@ -92,13 +92,12 @@ public: | |||
DECLARE_CLASS_IID (IInterAppAudioHost, 0x0CE5743D, 0x68DF415E, 0xAE285BD4, 0xE2CDC8FD) | |||
//------------------------------------------------------------------------ | |||
/** Extended Plug-in interface IEditController for Inter-App Audio connection state change notifications | |||
/** Extended plug-in interface IEditController for Inter-App Audio connection state change notifications | |||
\ingroup vstIPlug vst360 | |||
- [plug imp] | |||
- [extends IEditController] | |||
- [released: 3.6.0] | |||
*/ | |||
//------------------------------------------------------------------------ | |||
class IInterAppAudioConnectionNotification : public FUnknown | |||
{ | |||
public: | |||
@@ -114,23 +113,22 @@ public: | |||
DECLARE_CLASS_IID (IInterAppAudioConnectionNotification, 0x6020C72D, 0x5FC24AA1, 0xB0950DB5, 0xD7D6D5CF) | |||
//------------------------------------------------------------------------ | |||
/** Extended Plug-in interface IEditController for Inter-App Audio Preset Management | |||
/** Extended plug-in interface IEditController for Inter-App Audio Preset Management | |||
\ingroup vstIPlug vst360 | |||
- [plug imp] | |||
- [extends IEditController] | |||
- [released: 3.6.0] | |||
*/ | |||
//------------------------------------------------------------------------ | |||
class IInterAppAudioPresetManager : public FUnknown | |||
{ | |||
public: | |||
/** TODO */ | |||
/** Open the Preset Browser in order to load a preset */ | |||
virtual tresult PLUGIN_API runLoadPresetBrowser () = 0; | |||
/** TODO */ | |||
/** Open the Preset Browser in order to save a preset */ | |||
virtual tresult PLUGIN_API runSavePresetBrowser () = 0; | |||
/** TODO */ | |||
/** Load the next available preset */ | |||
virtual tresult PLUGIN_API loadNextPreset () = 0; | |||
/** TODO */ | |||
/** Load the previous available preset */ | |||
virtual tresult PLUGIN_API loadPreviousPreset () = 0; | |||
//------------------------------------------------------------------------ | |||
@@ -25,18 +25,19 @@ | |||
//------------------------------------------------------------------------ | |||
namespace Steinberg { | |||
namespace Vst { | |||
//------------------------------------------------------------------------ | |||
/** Private Plug-in message. | |||
/** Private plug-in message: Vst::IMessage | |||
\ingroup vstIHost vst300 | |||
- [host imp] | |||
- [create via IHostApplication::createInstance] | |||
- [released: 3.0.0] | |||
- [mandatory] | |||
Messages are sent from a VST-controller component to a VST-editor component and vice versa. | |||
\see IAttributeList, IConnectionPoint, \ref vst3Communication */ | |||
//------------------------------------------------------------------------ | |||
class IMessage: public FUnknown | |||
Messages are sent from a VST controller component to a VST editor component and vice versa. | |||
\see IAttributeList, IConnectionPoint, \ref vst3Communication | |||
*/ | |||
class IMessage : public FUnknown | |||
{ | |||
public: | |||
//------------------------------------------------------------------------ | |||
@@ -56,7 +57,7 @@ public: | |||
DECLARE_CLASS_IID (IMessage, 0x936F033B, 0xC6C047DB, 0xBB0882F8, 0x13C1E613) | |||
//------------------------------------------------------------------------ | |||
/** Connect a component with another one. | |||
/** Connect a component with another one: Vst::IConnectionPoint | |||
\ingroup vstIPlug vst300 | |||
- [plug imp] | |||
- [host imp] | |||
@@ -66,9 +67,9 @@ DECLARE_CLASS_IID (IMessage, 0x936F033B, 0xC6C047DB, 0xBB0882F8, 0x13C1E613) | |||
This interface is used for the communication of separate components. | |||
Note that some hosts will place a proxy object between the components so that they are not directly connected. | |||
\see \ref vst3Communication*/ | |||
//------------------------------------------------------------------------ | |||
class IConnectionPoint: public FUnknown | |||
\see \ref vst3Communication | |||
*/ | |||
class IConnectionPoint : public FUnknown | |||
{ | |||
public: | |||
//------------------------------------------------------------------------ | |||
@@ -19,9 +19,9 @@ | |||
//------------------------------------------------------------------------ | |||
namespace Steinberg { | |||
namespace Vst { | |||
//------------------------------------------------------------------------ | |||
/** Controller Numbers (MIDI) */ | |||
//------------------------------------------------------------------------ | |||
enum ControllerNumbers | |||
{ | |||
kCtrlBankSelectMSB = 0, ///< Bank Select MSB | |||
@@ -78,10 +78,10 @@ enum ControllerNumbers | |||
//---Effect Controllers--- | |||
kCtrlEff1Depth = 91, ///< Effect 1 Depth (Reverb Send Level) | |||
kCtrlEff2Depth = 92, ///< Effect 2 Depth | |||
kCtrlEff2Depth = 92, ///< Effect 2 Depth (Tremolo Level) | |||
kCtrlEff3Depth = 93, ///< Effect 3 Depth (Chorus Send Level) | |||
kCtrlEff4Depth = 94, ///< Effect 4 Depth (Delay/Variation Level) | |||
kCtrlEff5Depth = 95, ///< Effect 5 Depth | |||
kCtrlEff4Depth = 94, ///< Effect 4 Depth (Delay/Variation/Detune Level) | |||
kCtrlEff5Depth = 95, ///< Effect 5 Depth (Phaser Level) | |||
kCtrlDataIncrement = 96, ///< Data Increment (+1) | |||
kCtrlDataDecrement = 97, ///< Data Decrement (-1) | |||
@@ -101,14 +101,14 @@ enum ControllerNumbers | |||
kCtrlPolyModeOn = 127, ///< Poly Mode On | |||
//---Extra-------------------------- | |||
kAfterTouch = 128, ///< After Touch | |||
kPitchBend = 129, ///< Pitch Bend | |||
kAfterTouch = 128, ///< After Touch (associated to Channel Pressure) | |||
kPitchBend = 129, ///< Pitch Bend Change | |||
kCountCtrlNumber, ///< Count of Controller Number | |||
//---Extra for kLegacyMIDICCOutEvent- | |||
kCtrlProgramChange = 130, ///< Program Change (use LegacyMIDICCOutEvent.value only) | |||
kCtrlPolyPressure = 131, ///< Poly Pressure (use LegacyMIDICCOutEvent.value for pitch and | |||
kCtrlPolyPressure = 131, ///< Polyphonic Key Pressure (use LegacyMIDICCOutEvent.value for pitch and | |||
/// LegacyMIDICCOutEvent.value2 for pressure) | |||
kCtrlQuarterFrame = 132 ///< Quarter Frame ((use LegacyMIDICCOutEvent.value only) | |||
}; | |||
@@ -24,7 +24,7 @@ namespace Steinberg { | |||
namespace Vst { | |||
//------------------------------------------------------------------------ | |||
/** MIDI Learn Interface. | |||
/** MIDI Learn interface: Vst::IMidiLearn | |||
\ingroup vstIPlug vst3612 | |||
- [plug imp] | |||
- [extends IEditController] | |||
@@ -32,12 +32,61 @@ namespace Vst { | |||
- [optional] | |||
If this interface is implemented by the edit controller, the host will call this method whenever | |||
there is live MIDI-CC input for the plug-in. This way the plug-in can change it's MIDI-CC parameter | |||
there is live MIDI-CC input for the plug-in. This way, the plug-in can change its MIDI-CC parameter | |||
mapping and inform the host via the IComponentHandler::restartComponent with the | |||
kMidiCCAssignmentChanged flag. | |||
Use this if you want to implement custom MIDI-Learn functionality in your plug-in. | |||
*/ | |||
\code{.cpp} | |||
//------------------------------------------------ | |||
// in MyController class declaration | |||
class MyController : public Vst::EditController, public Vst::IMidiLearn | |||
{ | |||
// ... | |||
//--- IMidiLearn --------------------------------- | |||
tresult PLUGIN_API onLiveMIDIControllerInput (int32 busIndex, int16 channel, | |||
CtrlNumber midiCC) SMTG_OVERRIDE; | |||
// ... | |||
OBJ_METHODS (MyController, Vst::EditController) | |||
DEFINE_INTERFACES | |||
// ... | |||
DEF_INTERFACE (Vst::IMidiLearn) | |||
END_DEFINE_INTERFACES (Vst::EditController) | |||
//... | |||
} | |||
//------------------------------------------------ | |||
// in mycontroller.cpp | |||
#include "pluginterfaces/vst/ivstmidilearn.h | |||
namespace Steinberg { | |||
namespace Vst { | |||
DEF_CLASS_IID (IMidiLearn) | |||
} | |||
} | |||
//------------------------------------------------------------------------ | |||
tresult PLUGIN_API MyController::onLiveMIDIControllerInput (int32 busIndex, | |||
int16 channel, CtrlNumber midiCC) | |||
{ | |||
// if we are not in doMIDILearn (triggered by a UI button for example) | |||
// or wrong channel then return | |||
if (!doMIDILearn || busIndex != 0 || channel != 0 || midiLearnParamID == InvalidParamID) | |||
return kResultFalse; | |||
// adapt our internal MIDICC -> parameterID mapping | |||
midiCCMapping[midiCC] = midiLearnParamID; | |||
// new mapping then inform the host that our MIDI assignment has changed | |||
if (auto componentHandler = getComponentHandler ()) | |||
{ | |||
componentHandler->restartComponent (kMidiCCAssignmentChanged); | |||
} | |||
return kResultTrue; | |||
} | |||
\endcode | |||
*/ | |||
class IMidiLearn : public FUnknown | |||
{ | |||
public: | |||
@@ -17,16 +17,25 @@ | |||
#pragma once | |||
#include "pluginterfaces/base/funknown.h" | |||
#include "vsttypes.h" | |||
#include "pluginterfaces/vst/vsttypes.h" | |||
//------------------------------------------------------------------------ | |||
#include "pluginterfaces/base/falignpush.h" | |||
//------------------------------------------------------------------------ | |||
//------------------------------------------------------------------------ | |||
namespace Steinberg { | |||
namespace Vst { | |||
//------------------------------------------------------------------------ | |||
/** \defgroup vst3typedef VST 3 Data Types */ | |||
/*@{*/ | |||
//------------------------------------------------------------------------ | |||
/** Note Expression Types */ | |||
typedef uint32 NoteExpressionTypeID; | |||
/** Note Expression Value */ | |||
typedef double NoteExpressionValue; | |||
/*@}*/ | |||
//------------------------------------------------------------------------ | |||
/** NoteExpressionTypeIDs describes the type of the note expression. | |||
@@ -44,13 +53,13 @@ enum NoteExpressionTypeIDs : uint32 | |||
kVibratoTypeID, ///< Vibrato | |||
kExpressionTypeID, ///< Expression | |||
kBrightnessTypeID, ///< Brightness | |||
kTextTypeID, ///< TODO: | |||
kTextTypeID, ///< See NoteExpressionTextEvent | |||
kPhonemeTypeID, ///< TODO: | |||
kCustomStart = 100000, ///< start of custom note expression type ids | |||
kCustomEnd = 200000, ///< end of custom note expression type ids | |||
kInvalidTypeID = 0xFFFFFFFF ///< indicates an invalid note expression type | |||
kInvalidTypeID = 0xFFFFFFFF ///< indicates an invalid note expression type | |||
}; | |||
//------------------------------------------------------------------------ | |||
@@ -60,13 +69,12 @@ This structure is part of the NoteExpressionTypeInfo structure, it describes for | |||
and a stepCount when the given NoteExpressionTypeID is limited to discrete values (like on/off state). | |||
\see NoteExpressionTypeInfo | |||
*/ | |||
//------------------------------------------------------------------------ | |||
struct NoteExpressionValueDescription | |||
{ | |||
NoteExpressionValue defaultValue; ///< default normalized value [0,1] | |||
NoteExpressionValue minimum; ///< minimum normalized value [0,1] | |||
NoteExpressionValue maximum; ///< maximum normalized value [0,1] | |||
int32 stepCount; ///< number of discrete steps (0: continuous, 1: toggle, discrete value otherwise - see \ref vst3parameterIntro) | |||
NoteExpressionValue defaultValue; ///< default normalized value [0,1] | |||
NoteExpressionValue minimum; ///< minimum normalized value [0,1] | |||
NoteExpressionValue maximum; ///< maximum normalized value [0,1] | |||
int32 stepCount; ///< number of discrete steps (0: continuous, 1: toggle, discrete value otherwise - see \ref vst3ParameterIntro) | |||
}; | |||
#if SMTG_OS_WINDOWS && !SMTG_PLATFORM_64 | |||
@@ -75,13 +83,12 @@ struct NoteExpressionValueDescription | |||
//------------------------------------------------------------------------ | |||
/** Note Expression Value event. Used in \ref Event (union) | |||
A note expression event affects one single playing note (referring its noteId). | |||
This kind of event is send from host to the Plug-in like other events (NoteOnEvent, NoteOffEvent,...) in \ref ProcessData during the process call. | |||
This kind of event is send from host to the plug-in like other events (NoteOnEvent, NoteOffEvent,...) in \ref ProcessData during the process call. | |||
Note expression events for a specific noteId can only occur after a NoteOnEvent. The host must take care that the event list (\ref IEventList) is properly sorted. | |||
Expression events are always absolute normalized values [0.0, 1.0]. | |||
The predefined types have a predefined mapping of the normalized values (see \ref NoteExpressionTypeIDs) | |||
\sa INoteExpressionController | |||
*/ | |||
//------------------------------------------------------------------------ | |||
struct NoteExpressionValueEvent | |||
{ | |||
NoteExpressionTypeID typeId; ///< see \ref NoteExpressionTypeID | |||
@@ -94,8 +101,8 @@ struct NoteExpressionValueEvent | |||
/** Note Expression Text event. Used in Event (union) | |||
A Expression event affects one single playing note. \sa INoteExpressionController | |||
\see NoteExpressionTypeInfo*/ | |||
//------------------------------------------------------------------------ | |||
\see NoteExpressionTypeInfo | |||
*/ | |||
struct NoteExpressionTextEvent | |||
{ | |||
NoteExpressionTypeID typeId; ///< see \ref NoteExpressionTypeID (kTextTypeID or kPhoneticTypeID) | |||
@@ -112,18 +119,17 @@ struct NoteExpressionTextEvent | |||
#endif | |||
//------------------------------------------------------------------------ | |||
/** NoteExpressionTypeInfo is the structure describing a note expression supported by the Plug-in. | |||
/** NoteExpressionTypeInfo is the structure describing a note expression supported by the plug-in. | |||
This structure is used by the method \ref INoteExpressionController::getNoteExpressionInfo. | |||
\see INoteExpressionController | |||
*/ | |||
//------------------------------------------------------------------------ | |||
struct NoteExpressionTypeInfo | |||
{ | |||
NoteExpressionTypeID typeId; ///< unique identifier of this note Expression type | |||
String128 title; ///< note Expression type title (e.g. "Volume") | |||
String128 shortTitle; ///< note Expression type short title (e.g. "Vol") | |||
String128 units; ///< note Expression type unit (e.g. "dB") | |||
int32 unitId; ///< id of unit this NoteExpression belongs to (see \ref vst3UnitsIntro), in order to sort the note expression, it is possible to use unitId like for parameters. -1 means no unit used. | |||
int32 unitId; ///< id of unit this NoteExpression belongs to (see \ref vst3Units), in order to sort the note expression, it is possible to use unitId like for parameters. -1 means no unit used. | |||
NoteExpressionValueDescription valueDesc; ///< value description see \ref NoteExpressionValueDescription | |||
ParamID associatedParameterId; ///< optional associated parameter ID (for mapping from note expression to global (using the parameter automation for example) and back). Only used when kAssociatedParameterIDValid is set in flags. | |||
@@ -138,14 +144,14 @@ struct NoteExpressionTypeInfo | |||
}; | |||
//------------------------------------------------------------------------ | |||
/** Extended Plug-in interface IEditController for note expression event support | |||
/** Extended plug-in interface IEditController for note expression event support: Vst::INoteExpressionController | |||
\ingroup vstIPlug vst350 | |||
- [plug imp] | |||
- [extends IEditController] | |||
- [released: 3.5.0] | |||
- [optional] | |||
With this Plug-in interface, the host can retrieve all necessary note expression information supported by the Plug-in. | |||
With this plug-in interface, the host can retrieve all necessary note expression information supported by the plug-in. | |||
Note expression information (\ref NoteExpressionTypeInfo) are specific for given channel and event bus. | |||
Note that there is only one NoteExpressionTypeID per given channel of an event bus. | |||
@@ -153,11 +159,10 @@ Note that there is only one NoteExpressionTypeID per given channel of an event b | |||
The method getNoteExpressionStringByValue allows conversion from a normalized value to a string representation | |||
and the getNoteExpressionValueByString method from a string to a normalized value. | |||
When the note expression state changes (for example when switching presets) the Plug-in needs | |||
When the note expression state changes (for example when switching presets) the plug-in needs | |||
to inform the host about it via \ref IComponentHandler::restartComponent (kNoteExpressionChanged). | |||
*/ | |||
//------------------------------------------------------------------------ | |||
class INoteExpressionController: public FUnknown | |||
class INoteExpressionController : public FUnknown | |||
{ | |||
public: | |||
/** Returns number of supported note change types for event bus index and channel. */ | |||
@@ -185,10 +190,10 @@ DECLARE_CLASS_IID (INoteExpressionController, 0xB7F8F859, 0x41234872, 0x91169581 | |||
*/ | |||
enum KeyswitchTypeIDs : uint32 | |||
{ | |||
kNoteOnKeyswitchTypeID = 0, ///< press before noteOn is played | |||
kOnTheFlyKeyswitchTypeID, ///< press while noteOn is played | |||
kOnReleaseKeyswitchTypeID, ///< press before entering release | |||
kKeyRangeTypeID ///< key should be maintained pressed for playing | |||
kNoteOnKeyswitchTypeID = 0, ///< press before noteOn is played | |||
kOnTheFlyKeyswitchTypeID, ///< press while noteOn is played | |||
kOnReleaseKeyswitchTypeID, ///< press before entering release | |||
kKeyRangeTypeID ///< key should be maintained pressed for playing | |||
}; | |||
typedef uint32 KeyswitchTypeID; | |||
@@ -200,34 +205,33 @@ This structure is used by the method \ref IKeyswitchController::getKeyswitchInfo | |||
*/ | |||
struct KeyswitchInfo | |||
{ | |||
KeyswitchTypeID typeId; ///< see KeyswitchTypeID | |||
String128 title; ///< name of key switch (e.g. "Accentuation") | |||
String128 shortTitle; ///< short title (e.g. "Acc") | |||
KeyswitchTypeID typeId; ///< see KeyswitchTypeID | |||
String128 title; ///< name of key switch (e.g. "Accentuation") | |||
String128 shortTitle; ///< short title (e.g. "Acc") | |||
int32 keyswitchMin; ///< associated main key switch min (value between [0, 127]) | |||
int32 keyswitchMax; ///< associated main key switch max (value between [0, 127]) | |||
int32 keyRemapped; /** optional remapped key switch (default -1), the Plug-in could provide one remapped | |||
key for a key switch (allowing better location on the keyboard of the key switches) */ | |||
int32 keyswitchMin; ///< associated main key switch min (value between [0, 127]) | |||
int32 keyswitchMax; ///< associated main key switch max (value between [0, 127]) | |||
int32 keyRemapped; /** optional remapped key switch (default -1), the plug-in could provide one remapped | |||
key for a key switch (allowing better location on the keyboard of the key switches) */ | |||
int32 unitId; ///< id of unit this key switch belongs to (see \ref vst3UnitsIntro), -1 means no unit used. | |||
int32 unitId; ///< id of unit this key switch belongs to (see \ref vst3Units), -1 means no unit used. | |||
int32 flags; ///< not yet used (set to 0) | |||
int32 flags; ///< not yet used (set to 0) | |||
}; | |||
//------------------------------------------------------------------------ | |||
/** Extended Plug-in interface IEditController for key switches support | |||
/** Extended plug-in interface IEditController for key switches support: Vst::IKeyswitchController | |||
\ingroup vstIPlug vst350 | |||
- [plug imp] | |||
- [extends IEditController] | |||
- [released: 3.5.0] | |||
- [optional] | |||
When a (instrument) Plug-in supports such interface, the host could get from the Plug-in the current set | |||
When a (instrument) plug-in supports such interface, the host could get from the plug-in the current set | |||
of used key switches (megatrig/articulation) for a given channel of a event bus and then automatically use them (like in Cubase 6) to | |||
create VST Expression Map (allowing to associated symbol to a given articulation / key switch). | |||
*/ | |||
//------------------------------------------------------------------------ | |||
class IKeyswitchController: public FUnknown | |||
class IKeyswitchController : public FUnknown | |||
{ | |||
public: | |||
/** Returns number of supported key switches for event bus index and channel. */ | |||
@@ -17,7 +17,7 @@ | |||
#pragma once | |||
#include "pluginterfaces/base/funknown.h" | |||
#include "vsttypes.h" | |||
#include "pluginterfaces/vst/vsttypes.h" | |||
//------------------------------------------------------------------------ | |||
#include "pluginterfaces/base/falignpush.h" | |||
@@ -27,33 +27,35 @@ | |||
namespace Steinberg { | |||
namespace Vst { | |||
//---------------------------------------------------------------------- | |||
/** Queue of changes for a specific parameter. | |||
/** Queue of changes for a specific parameter: Vst::IParamValueQueue | |||
\ingroup vstIHost vst300 | |||
- [host imp] | |||
- [released: 3.0.0] | |||
- [mandatory] | |||
The change queue can be interpreted as segment of an automation curve. For each | |||
processing block a segment with the size of the block is transmitted to the processor. | |||
processing block, a segment with the size of the block is transmitted to the processor. | |||
The curve is expressed as sampling points of a linear approximation of | |||
the original automation curve. If the original already is a linear curve it can | |||
the original automation curve. If the original already is a linear curve, it can | |||
be transmitted precisely. A non-linear curve has to be converted to a linear | |||
approximation by the host. Every point of the value queue defines a linear | |||
section of the curve as a straight line from the previous point of a block to | |||
the new one. So the Plug-in can calculate the value of the curve for any sample | |||
the new one. So the plug-in can calculate the value of the curve for any sample | |||
position in the block. | |||
<b>Implicit Points:</b> \n | |||
In each processing block the section of the curve for each parameter is transmitted. | |||
In each processing block, the section of the curve for each parameter is transmitted. | |||
In order to reduce the amount of points, the point at block position 0 can be omitted. | |||
- If the curve has a slope of 0 over a period of multiple blocks, only one point is | |||
transmitted for the block where the constant curve section starts. The queue for the following | |||
blocks will be empty as long as the curve slope is 0. | |||
- If the curve has a constant slope other than 0 over the period of several blocks, only | |||
the value for the last sample of the block is transmitted. In this case the last valid point | |||
the value for the last sample of the block is transmitted. In this case, the last valid point | |||
is at block position -1. The processor can calculate the value for each sample in the block | |||
by using a linear interpolation: | |||
\code | |||
\code{.cpp} | |||
//------------------------------------------------------------------------ | |||
double x1 = -1; // position of last point related to current buffer | |||
double y1 = currentParameterValue; // last transmitted value | |||
@@ -70,15 +72,16 @@ double offset = y1 - (slope * x1); | |||
double curveValue = (slope * bufferTime) + offset; // bufferTime is any position in buffer | |||
\endcode | |||
<b>Jumps:</b> \n | |||
\b Jumps: | |||
\n | |||
A jump in the automation curve has to be transmitted as two points: one with the | |||
old value and one with the new value at the next sample position. | |||
\image html "automation.jpg" | |||
\see IParameterChanges, ProcessData | |||
See \ref IParameterChanges, \ref ProcessData | |||
*/ | |||
//---------------------------------------------------------------------- | |||
class IParamValueQueue: public FUnknown | |||
class IParamValueQueue : public FUnknown | |||
{ | |||
public: | |||
//------------------------------------------------------------------------ | |||
@@ -101,19 +104,19 @@ public: | |||
DECLARE_CLASS_IID (IParamValueQueue, 0x01263A18, 0xED074F6F, 0x98C9D356, 0x4686F9BA) | |||
//---------------------------------------------------------------------- | |||
/** All parameter changes of a processing block. | |||
/** All parameter changes of a processing block: Vst::IParameterChanges | |||
\ingroup vstIHost vst300 | |||
- [host imp] | |||
- [released: 3.0.0] | |||
- [mandatory] | |||
This interface is used to transmit any changes that shall be applied to parameters | |||
This interface is used to transmit any changes to be applied to parameters | |||
in the current processing block. A change can be caused by GUI interaction as | |||
well as automation. They are transmitted as a list of queues (IParamValueQueue) | |||
well as automation. They are transmitted as a list of queues (\ref IParamValueQueue) | |||
containing only queues for parameters that actually did change. | |||
\see IParamValueQueue, ProcessData */ | |||
//---------------------------------------------------------------------- | |||
class IParameterChanges: public FUnknown | |||
See \ref IParamValueQueue, \ref ProcessData | |||
*/ | |||
class IParameterChanges : public FUnknown | |||
{ | |||
public: | |||
//------------------------------------------------------------------------ | |||
@@ -0,0 +1,143 @@ | |||
//------------------------------------------------------------------------ | |||
// Project : VST SDK | |||
// | |||
// Category : Interfaces | |||
// Filename : pluginterfaces/vst/ivstparameterfunctionname.h | |||
// Created by : Steinberg, 03/2020 | |||
// Description : VST Parameter Function Name Interface | |||
// | |||
//----------------------------------------------------------------------------- | |||
// This file is part of a Steinberg SDK. It is subject to the license terms | |||
// in the LICENSE file found in the top-level directory of this distribution | |||
// and at www.steinberg.net/sdklicenses. | |||
// No part of the SDK, including this file, may be copied, modified, propagated, | |||
// or distributed except according to the terms contained in the LICENSE file. | |||
//----------------------------------------------------------------------------- | |||
#pragma once | |||
#include "pluginterfaces/base/funknown.h" | |||
#include "pluginterfaces/vst/vsttypes.h" | |||
//------------------------------------------------------------------------ | |||
#include "pluginterfaces/base/falignpush.h" | |||
//------------------------------------------------------------------------ | |||
//------------------------------------------------------------------------ | |||
namespace Steinberg { | |||
namespace Vst { | |||
namespace FunctionNameType { | |||
//-------------------------------------------------------------------- | |||
const CString kCompGainReduction = "Comp:GainReduction"; /** */ | |||
const CString kCompGainReductionMax = "Comp:GainReductionMax"; | |||
const CString kCompGainReductionPeakHold = "Comp:GainReductionPeakHold"; | |||
const CString kCompResetGainReductionMax = "Comp:ResetGainReductionMax"; | |||
const CString kLowLatencyMode = "LowLatencyMode"; /** Useful for live situation where low | |||
latency is required: | |||
0 means LowLatency disable, | |||
1 means LowLatency enable */ | |||
const CString kDryWetMix = "DryWetMix"; /** Allowing to mix the original (Dry) Signal with the processed one (Wet): | |||
0.0 means Dry Signal only, | |||
0.5 means 50% Dry Signal + 50% Wet Signal, | |||
1.0 means Wet Signal only */ | |||
const CString kRandomize = "Randomize"; /** Allow to assign some randomized values to some | |||
parameters in a controlled way*/ | |||
} // FunctionNameType | |||
//------------------------------------------------------------------------ | |||
/** Edit controller component interface extension: Vst::IParameterFunctionName | |||
\ingroup vstIPlug vst370 | |||
- [plug imp] | |||
- [extends IEditController] | |||
- [released: 3.7.0] | |||
- [optional] | |||
This interface allows the host to get a parameter associated to a specific meaning (a functionName) for a given unit. | |||
The host can use this information, for example, for drawing a Gain Reduction meter in its own UI. | |||
In order to get the plain value of this parameter, the host should use the IEditController::normalizedParamToPlain. | |||
The host can automatically map parameters to dedicated UI controls, such as the wet-dry mix knob or Randomize button. | |||
\section IParameterFunctionNameExample Example | |||
\code{.cpp} | |||
//------------------------------------------------------------------------ | |||
// here an example of how a VST3 plug-in could support this IParameterFunctionName interface. | |||
// we need to define somewhere the iids: | |||
in MyController class declaration | |||
class MyController : public Vst::EditController, public Vst::IParameterFunctionName | |||
{ | |||
... | |||
tresult PLUGIN_API getParameterIDFromFunctionName (UnitID unitID, FIDString functionName, | |||
Vst::ParamID& paramID) override; | |||
... | |||
OBJ_METHODS (MyController, Vst::EditController) | |||
DEFINE_INTERFACES | |||
... | |||
DEF_INTERFACE (Vst::IParameterFunctionName) | |||
END_DEFINE_INTERFACES (Vst::EditController) | |||
... | |||
} | |||
#include "ivstparameterfunctionname.h" | |||
namespace Steinberg { | |||
namespace Vst { | |||
DEF_CLASS_IID (IParameterFunctionName) | |||
} | |||
} | |||
//------------------------------------------------------------------------ | |||
tresult PLUGIN_API MyController::getParameterIDFromFunctionName (UnitID unitID, FIDString functionName, | |||
Vst::ParamID& paramID) | |||
{ | |||
using namespace Vst; | |||
paramID = kNoParamId; | |||
if (unitID == kRootUnitId && FIDStringsEqual (functionName, kCompGainReduction)) | |||
paramID = kMyGainReductionId; | |||
return (paramID != kNoParamId) ? kResultOk : kResultFalse; | |||
} | |||
//--- a host implementation example: -------------------- | |||
... | |||
FUnknownPtr<Vst::IParameterFunctionName> functionName (mEditController->getIEditController ()); | |||
if (functionName) | |||
{ | |||
Vst::ParamID paramID; | |||
if (functionName->getParameterIDFromFunctionName (Vst::FunctionNameType::kCompGainReduction, paramID) == kResultTrue) | |||
{ | |||
// paramID could be cached for performance issue | |||
ParamValue norm = mEditController->getIEditController ()->getParamNormalized (paramID); | |||
ParamValue plain = mEditController->getIEditController ()->normalizedParamToPlain (paramID, norm); | |||
// plain is something like -6 (-6dB) | |||
} | |||
} | |||
\endcode | |||
*/ | |||
class IParameterFunctionName : public FUnknown | |||
{ | |||
public: | |||
//------------------------------------------------------------------------ | |||
/** Gets for the given unitID the associated paramID to a function Name. | |||
Returns kResultFalse when no found parameter (paramID is set to kNoParamId in this case). */ | |||
virtual tresult PLUGIN_API getParameterIDFromFunctionName (UnitID unitID, FIDString functionName, ParamID& paramID) = 0; | |||
//------------------------------------------------------------------------ | |||
static const FUID iid; | |||
}; | |||
DECLARE_CLASS_IID (IParameterFunctionName, 0x6D21E1DC, 0x91199D4B, 0xA2A02FEF, 0x6C1AE55C) | |||
//------------------------------------------------------------------------ | |||
} // namespace Vst | |||
} // namespace Steinberg | |||
//------------------------------------------------------------------------ | |||
#include "pluginterfaces/base/falignpop.h" | |||
//------------------------------------------------------------------------ |
@@ -27,11 +27,17 @@ 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 | |||
expression. | |||
\see PhysicalUIMap | |||
*/ | |||
enum PhysicalUITypeIDs | |||
{ | |||
@@ -50,7 +56,8 @@ enum PhysicalUITypeIDs | |||
//------------------------------------------------------------------------ | |||
/** PhysicalUIMap describes a mapping of a noteExpression Type to a Physical UI Type. | |||
It is used in PhysicalUIMapList. | |||
\see PhysicalUIMapList */ | |||
\see PhysicalUIMapList | |||
*/ | |||
struct PhysicalUIMap | |||
{ | |||
/** This represents the physical UI. /see PhysicalUITypeIDs, this is set by the caller of | |||
@@ -65,7 +72,8 @@ struct PhysicalUIMap | |||
//------------------------------------------------------------------------ | |||
/** PhysicalUIMapList describes a list of PhysicalUIMap | |||
\see INoteExpressionPhysicalUIMapping*/ | |||
\see INoteExpressionPhysicalUIMapping | |||
*/ | |||
struct PhysicalUIMapList | |||
{ | |||
/** Count of entries in the map array, set by the caller of getPhysicalUIMapping. */ | |||
@@ -76,21 +84,51 @@ struct PhysicalUIMapList | |||
}; | |||
//------------------------------------------------------------------------ | |||
/** Extended Plug-in interface IEditController for note expression event support | |||
/** Extended plug-in interface IEditController for note expression event support: Vst::INoteExpressionPhysicalUIMapping | |||
\ingroup vstIPlug vst3611 | |||
- [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 | |||
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 | |||
tresult PLUGIN_API myPlug::::getPhysicalUIMapping (int32 busIndex, int16 channel, PhysicalUIMapList& list) | |||
\code{.cpp} | |||
//------------------------------------------------------------------------ | |||
// here an example of how a VST3 plug-in could support this INoteExpressionPhysicalUIMapping interface. | |||
// we need to define somewhere the iids: | |||
//in MyController class declaration | |||
class MyController : public Vst::EditController, public Vst::INoteExpressionPhysicalUIMapping | |||
{ | |||
// ... | |||
//--- INoteExpressionPhysicalUIMapping --------------------------------- | |||
tresult PLUGIN_API getPhysicalUIMapping (int32 busIndex, int16 channel, PhysicalUIMapList& list) SMTG_OVERRIDE; | |||
// ... | |||
OBJ_METHODS (MyController, Vst::EditController) | |||
DEFINE_INTERFACES | |||
// ... | |||
DEF_INTERFACE (Vst::INoteExpressionPhysicalUIMapping) | |||
END_DEFINE_INTERFACES (Vst::EditController) | |||
//... | |||
} | |||
// In mycontroller.cpp | |||
#include "pluginterfaces/vst/ivstnoteexpression.h" | |||
namespace Steinberg { | |||
namespace Vst { | |||
DEF_CLASS_IID (INoteExpressionPhysicalUIMapping) | |||
} | |||
} | |||
//------------------------------------------------------------------------ | |||
tresult PLUGIN_API MyController::getPhysicalUIMapping (int32 busIndex, int16 channel, PhysicalUIMapList& list) | |||
{ | |||
if (busIndex == 0 && channel == 0) | |||
{ | |||
@@ -106,7 +144,8 @@ tresult PLUGIN_API myPlug::::getPhysicalUIMapping (int32 busIndex, int16 channel | |||
} | |||
return kResultFalse; | |||
} | |||
\endcode */ | |||
\endcode | |||
*/ | |||
class INoteExpressionPhysicalUIMapping : public FUnknown | |||
{ | |||
public: | |||
@@ -17,22 +17,25 @@ | |||
#pragma once | |||
#include "pluginterfaces/base/funknown.h" | |||
#include "vsttypes.h" | |||
#include "pluginterfaces/vst/vsttypes.h" | |||
//------------------------------------------------------------------------ | |||
namespace Steinberg { | |||
namespace Vst { | |||
//------------------------------------------------------------------------ | |||
/** Host callback interface for an edit controller. | |||
/** Host callback interface for an edit controller: Vst::IPlugInterfaceSupport | |||
\ingroup vstIHost vst3612 | |||
- [host imp] | |||
- [released: 3.6.12] | |||
- [optional] | |||
Allow a Plug-in to ask the host if a given Plug-in interface is supported/used by the host. | |||
Allows a plug-in to ask the host if a given plug-in interface is supported/used by the host. | |||
It is implemented by the hostContext given when the component is initialized. | |||
\code | |||
\section IPlugInterfaceSupportExample Example | |||
\code{.cpp} | |||
//------------------------------------------------------------------------ | |||
tresult PLUGIN_API MyPluginController::initialize (FUnknown* context) | |||
{ | |||
// ... | |||
@@ -45,8 +48,8 @@ tresult PLUGIN_API MyPluginController::initialize (FUnknown* context) | |||
// ... | |||
} | |||
\endcode | |||
\see IPluginBase */ | |||
//------------------------------------------------------------------------ | |||
\see IPluginBase | |||
*/ | |||
class IPlugInterfaceSupport : public FUnknown | |||
{ | |||
public: | |||
@@ -17,7 +17,7 @@ | |||
#pragma once | |||
#include "pluginterfaces/base/funknown.h" | |||
#include "vsttypes.h" | |||
#include "pluginterfaces/vst/vsttypes.h" | |||
//------------------------------------------------------------------------ | |||
#include "pluginterfaces/base/falignpush.h" | |||
@@ -29,7 +29,7 @@ namespace Vst { | |||
//------------------------------------------------------------------------ | |||
// IParameterFinder Interface | |||
//------------------------------------------------------------------------ | |||
/** Extension for IPlugView to find view parameters (lookup value under mouse support) | |||
/** Extension for IPlugView to find view parameters (lookup value under mouse support): Vst::IParameterFinder | |||
\ingroup pluginGUI vst302 | |||
- [plug imp] | |||
- [extends IPlugView] | |||
@@ -45,7 +45,7 @@ class IParameterFinder: public FUnknown | |||
{ | |||
public: | |||
//------------------------------------------------------------------------ | |||
/** Find out which parameter in Plug-in view is at given position (relative to Plug-in view). */ | |||
/** Find out which parameter in plug-in view is at given position (relative to plug-in view). */ | |||
virtual tresult PLUGIN_API findParameter (int32 xPos, int32 yPos, ParamID& resultTag /*out*/) = 0; | |||
//------------------------------------------------------------------------ | |||
static const FUID iid; | |||
@@ -27,7 +27,15 @@ | |||
namespace Steinberg { | |||
namespace Vst { | |||
// ------------------------------------------------------------------------ | |||
/** \defgroup vst3typedef VST 3 Data Types */ | |||
/*@{*/ | |||
//------------------------------------------------------------------------ | |||
/** Prefetchable Support Type */ | |||
typedef uint32 PrefetchableSupport; | |||
/*@}*/ | |||
/** Prefetchable Support Enum */ | |||
enum ePrefetchableSupport | |||
{ | |||
kIsNeverPrefetchable = 0, ///< every instance of the plug does not support prefetch processing | |||
@@ -39,19 +47,21 @@ enum ePrefetchableSupport | |||
//------------------------------------------------------------------------ | |||
// IPrefetchableSupport Interface | |||
//------------------------------------------------------------------------ | |||
/** Indicates that the Plug-in could or not support Prefetch (dynamically). | |||
/** Indicates that the plug-in could or not support Prefetch (dynamically): Vst::IPrefetchableSupport | |||
\ingroup vstIPlug vst365 | |||
- [plug imp] | |||
- [extends IComponent] | |||
- [released: 3.6.5] | |||
- [optional] | |||
The Plug-in should implement this interface if it needs to dynamically change between Prefetchable or not. | |||
By default (without implementing this interface) the host will decide in which mode the Plug-in will be process. | |||
For more info about Prefetch processing mode check ProcessModes::kPrefetch documentation. | |||
The plug-in should implement this interface if it needs to dynamically change between prefetchable or not. | |||
By default (without implementing this interface) the host decides in which mode the plug-in is processed. | |||
For more info about the prefetch processing mode check the ProcessModes::kPrefetch documentation. | |||
\section IPrefetchableSupportExample Example | |||
\code | |||
\code{.cpp} | |||
//------------------------------------------------------------------------ | |||
tresult PLUGIN_API myPlug::getPrefetchableSupport (PrefetchableSupport& prefetchable) | |||
{ | |||
prefetchable = kIsNeverPrefetchable; | |||
@@ -64,21 +74,23 @@ tresult PLUGIN_API myPlug::getPrefetchableSupport (PrefetchableSupport& prefetch | |||
} | |||
return kResultOk; | |||
} | |||
\endcode */ | |||
\endcode | |||
*/ | |||
class IPrefetchableSupport : public FUnknown | |||
{ | |||
public: | |||
//------------------------------------------------------------------------ | |||
/** retrieve the current prefetch support. Use IComponentHandler::restartComponent (kPrefetchableSupportChanged) | |||
to inform the host that this support has changed. */ | |||
//------------------------------------------------------------------------ | |||
/** retrieve the current prefetch support. Use IComponentHandler::restartComponent | |||
(kPrefetchableSupportChanged) to inform the host that this support has changed. */ | |||
virtual tresult PLUGIN_API getPrefetchableSupport (PrefetchableSupport& prefetchable /*out*/) = 0; | |||
//------------------------------------------------------------------------ | |||
//------------------------------------------------------------------------ | |||
static const FUID iid; | |||
}; | |||
DECLARE_CLASS_IID (IPrefetchableSupport, 0x8AE54FDA, 0xE93046B9, 0xA28555BC, 0xDC98E21E) | |||
//------------------------------------------------------------------------ | |||
} // namespace Vst | |||
} // namespace Steinberg | |||
@@ -17,7 +17,7 @@ | |||
#pragma once | |||
#include "pluginterfaces/base/funknown.h" | |||
#include "vsttypes.h" | |||
#include "pluginterfaces/vst/vsttypes.h" | |||
//------------------------------------------------------------------------ | |||
#include "pluginterfaces/base/falignpush.h" | |||
@@ -27,17 +27,29 @@ | |||
namespace Steinberg { | |||
namespace Vst { | |||
//------------------------------------------------------------------------ | |||
/** Frame Rate */ | |||
//------------------------------------------------------------------------ | |||
/** Frame Rate | |||
A frame rate describes the number of image (frame) displayed per second. | |||
Some examples: | |||
- 23.976 fps is framesPerSecond: 24 and flags: kPullDownRate | |||
- 24 fps is framesPerSecond: 24 and flags: 0 | |||
- 25 fps is framesPerSecond: 25 and flags: 0 | |||
- 29.97 drop fps is framesPerSecond: 30 and flags: kDropRate|kPullDownRate | |||
- 29.97 fps is framesPerSecond: 30 and flags: kPullDownRate | |||
- 30 fps is framesPerSecond: 30 and flags: 0 | |||
- 30 drop fps is framesPerSecond: 30 and flags: kDropRate | |||
- 50 fps is framesPerSecond: 50 and flags: 0 | |||
- 59.94 fps is framesPerSecond: 60 and flags: kPullDownRate | |||
- 60 fps is framesPerSecond: 60 and flags: 0 | |||
*/ | |||
struct FrameRate | |||
{ | |||
//------------------------------------------------------------------------ | |||
enum FrameRateFlags | |||
{ | |||
kPullDownRate = 1 << 0, ///< for ex. HDTV: 23.976 fps with 24 as frame rate | |||
kDropRate = 1 << 1 ///< for ex. 29.97 fps drop with 30 as frame rate | |||
kPullDownRate = 1 << 0, | |||
kDropRate = 1 << 1 | |||
}; | |||
//------------------------------------------------------------------------ | |||
uint32 framesPerSecond; ///< frame rate | |||
uint32 flags; ///< flags #FrameRateFlags | |||
//------------------------------------------------------------------------ | |||
@@ -47,21 +59,21 @@ struct FrameRate | |||
/** Description of a chord. | |||
A chord is described with a key note, a root note and the | |||
\copydoc chordMask | |||
\see ProcessContext*/ | |||
//------------------------------------------------------------------------ | |||
\see ProcessContext | |||
*/ | |||
struct Chord | |||
{ | |||
//------------------------------------------------------------------------ | |||
uint8 keyNote; ///< key note in chord | |||
uint8 rootNote; ///< lowest note in chord | |||
/** Bitmask of a chord. | |||
/** Bitmask of a chord. \n | |||
1st bit set: minor second; 2nd bit set: major second, and so on. \n | |||
There is \b no bit for the keynote (root of the chord) because it is inherently always present. \n | |||
Examples: | |||
- XXXX 0000 0100 1000 (= 0x0048) -> major chord\n | |||
- XXXX 0000 0100 0100 (= 0x0044) -> minor chord\n | |||
- XXXX 0010 0100 0100 (= 0x0244) -> minor chord with minor seventh */ | |||
- XXXX 0000 0100 1000 (= 0x0048) -> major chord | |||
- XXXX 0000 0100 0100 (= 0x0044) -> minor chord | |||
- XXXX 0010 0100 0100 (= 0x0244) -> minor chord with minor seventh */ | |||
int16 chordMask; | |||
enum Masks { | |||
@@ -73,15 +85,14 @@ struct Chord | |||
//------------------------------------------------------------------------ | |||
/** Audio processing context. | |||
For each processing block the host provides timing information and | |||
musical parameters that can change over time. For a host that supports jumps | |||
(like cycle) it is possible to split up a processing block into multiple parts in | |||
order to provide a correct project time inside of every block, but this behaviour | |||
is not mandatory. Since the timing will be correct at the beginning of the next block | |||
again, a host that is dependent on a fixed processing block size can choose to neglect | |||
For each processing block the host provides timing information and musical parameters that can | |||
change over time. For a host that supports jumps (like cycle) it is possible to split up a | |||
processing block into multiple parts in order to provide a correct project time inside of every | |||
block, but this behavior is not mandatory. Since the timing will be correct at the beginning of the | |||
next block again, a host that is dependent on a fixed processing block size can choose to neglect | |||
this problem. | |||
\see IAudioProcessor, ProcessData*/ | |||
//------------------------------------------------------------------------ | |||
\see IAudioProcessor, ProcessData | |||
*/ | |||
struct ProcessContext | |||
{ | |||
//------------------------------------------------------------------------ | |||
@@ -109,27 +120,27 @@ struct ProcessContext | |||
uint32 state; ///< a combination of the values from \ref StatesAndFlags | |||
double sampleRate; ///< current sample rate (always valid) | |||
TSamples projectTimeSamples; ///< project time in samples (always valid) | |||
double sampleRate; ///< current sample rate (always valid) | |||
TSamples projectTimeSamples; ///< project time in samples (always valid) | |||
int64 systemTime; ///< system time in nanoseconds (optional) | |||
TSamples continousTimeSamples; ///< project time, without loop (optional) | |||
int64 systemTime; ///< system time in nanoseconds (optional) | |||
TSamples continousTimeSamples; ///< project time, without loop (optional) | |||
TQuarterNotes projectTimeMusic; ///< musical position in quarter notes (1.0 equals 1 quarter note) | |||
TQuarterNotes barPositionMusic; ///< last bar start position, in quarter notes | |||
TQuarterNotes cycleStartMusic; ///< cycle start in quarter notes | |||
TQuarterNotes cycleEndMusic; ///< cycle end in quarter notes | |||
TQuarterNotes projectTimeMusic; ///< musical position in quarter notes (1.0 equals 1 quarter note) (optional) | |||
TQuarterNotes barPositionMusic; ///< last bar start position, in quarter notes (optional) | |||
TQuarterNotes cycleStartMusic; ///< cycle start in quarter notes (optional) | |||
TQuarterNotes cycleEndMusic; ///< cycle end in quarter notes (optional) | |||
double tempo; ///< tempo in BPM (Beats Per Minute) | |||
int32 timeSigNumerator; ///< time signature numerator (e.g. 3 for 3/4) | |||
int32 timeSigDenominator; ///< time signature denominator (e.g. 4 for 3/4) | |||
double tempo; ///< tempo in BPM (Beats Per Minute) (optional) | |||
int32 timeSigNumerator; ///< time signature numerator (e.g. 3 for 3/4) (optional) | |||
int32 timeSigDenominator; ///< time signature denominator (e.g. 4 for 3/4) (optional) | |||
Chord chord; ///< musical info | |||
Chord chord; ///< musical info (optional) | |||
int32 smpteOffsetSubframes; ///< SMPTE (sync) offset in subframes (1/80 of frame) | |||
FrameRate frameRate; ///< frame rate | |||
int32 smpteOffsetSubframes; ///< SMPTE (sync) offset in subframes (1/80 of frame) (optional) | |||
FrameRate frameRate; ///< frame rate (optional) | |||
int32 samplesToNextClock; ///< MIDI Clock Resolution (24 Per Quarter Note), can be negative (nearest) | |||
int32 samplesToNextClock; ///< MIDI Clock Resolution (24 Per Quarter Note), can be negative (nearest) (optional) | |||
//------------------------------------------------------------------------ | |||
}; | |||
@@ -44,7 +44,7 @@ struct RepresentationInfo | |||
memset (host, 0, kNameSize); | |||
} | |||
RepresentationInfo (char8* _vendor, char8* _name = 0, char8* _version = 0, char8* _host = 0) | |||
RepresentationInfo (char8* _vendor, char8* _name = nullptr, char8* _version = nullptr, char8* _host = nullptr) | |||
{ | |||
memset (vendor, 0, kNameSize); | |||
if (_vendor) | |||
@@ -73,29 +73,29 @@ struct RepresentationInfo | |||
//------------------------------------------------------------------------ | |||
//------------------------------------------------------------------------ | |||
/** Extended Plug-in interface IEditController for a component. | |||
/** Extended plug-in interface IEditController for a component: Vst::IXmlRepresentationController | |||
\ingroup vstIPlug vst350 | |||
- [plug imp] | |||
- [extends IEditController] | |||
- [released: 3.5.0] | |||
- [optional] | |||
A Representation based on XML is a way to export and structure, group Plug-ins parameters for a specific remote (could be hardware or software rack (like quickcontrols)). | |||
A representation based on XML is a way to export, structure, and group plug-ins parameters for a specific remote (hardware or software rack (such as quick controls)). | |||
\n | |||
It allows to describe more precisely each parameter (what is the best matching to a knob, different titles lengths matching limited remote display,...).\n See an \ref Example. | |||
It allows to describe each parameter more precisely (what is the best matching to a knob, different title lengths matching limited remote display,...).\n See an \ref Example. | |||
\n\n | |||
- A Representation is composed of Pages (this means that to see all exported parameters the user has to navigate through the pages). | |||
- A Page is composed of Cells (for example 8 Cells per page). | |||
- A Cell is composed of Layers (for example a cell could have a knob, a display and a button which are 3 Layers). | |||
- A Layer is associated to a Plug-in parameter using the ParameterID as identifier: | |||
- it could be a knob with a display for Title and/or value, this display uses the same parameterId, but it could an another one. | |||
- Switch | |||
- link which allows to jump directly to a subpage (an another page) | |||
- A representation is composed of pages (this means that to see all exported parameters, the user has to navigate through the pages). | |||
- A page is composed of cells (for example 8 cells per page). | |||
- A cell is composed of layers (for example a cell could have a knob, a display, and a button, which means 3 layers). | |||
- A layer is associated to a plug-in parameter using the ParameterID as identifier: | |||
- it could be a knob with a display for title and/or value, this display uses the same parameterId, but it could an another one. | |||
- switch | |||
- link which allows to jump directly to a subpage (another page) | |||
- more... See Vst::LayerType | |||
. | |||
\n | |||
This Representation is implemented as XML text following the Document Type Definition (DTD): http://dtd.steinberg.net/VST-Remote-1.1.dtd | |||
This representation is implemented as XML text following the Document Type Definition (DTD): http://dtd.steinberg.net/VST-Remote-1.1.dtd | |||
\section Example | |||
Here an example of what should be passed in the stream of getXmlRepresentationStream: | |||
@@ -177,20 +177,19 @@ Here an example of what should be passed in the stream of getXmlRepresentationSt | |||
</vstXML> | |||
\endcode | |||
*/ | |||
//------------------------------------------------------------------------ | |||
class IXmlRepresentationController: public FUnknown | |||
class IXmlRepresentationController : public FUnknown | |||
{ | |||
public: | |||
/** Retrieves a stream containing a XmlRepresentation for a wanted representation info */ | |||
virtual tresult PLUGIN_API getXmlRepresentationStream (RepresentationInfo& info /*in*/, IBStream* stream /*out*/) = 0; | |||
virtual tresult PLUGIN_API getXmlRepresentationStream (RepresentationInfo& info /*in*/, | |||
IBStream* stream /*out*/) = 0; | |||
//------------------------------------------------------------------------ | |||
//------------------------------------------------------------------------ | |||
static const FUID iid; | |||
}; | |||
DECLARE_CLASS_IID (IXmlRepresentationController, 0xA81A0471, 0x48C34DC4, 0xAC30C9E1, 0x3C8393D5) | |||
//------------------------------------------------------------------------ | |||
/** Defines for XML representation Tags and Attributes */ | |||
@@ -254,7 +253,6 @@ DECLARE_CLASS_IID (IXmlRepresentationController, 0xA81A0471, 0x48C34DC4, 0xAC30C | |||
//------------------------------------------------------------------------ | |||
/** Layer Types used in a VST XML Representation */ | |||
//------------------------------------------------------------------------ | |||
namespace LayerType | |||
{ | |||
enum | |||
@@ -280,13 +278,12 @@ namespace LayerType | |||
,"link" | |||
,"display" | |||
,"fader" | |||
,0 | |||
,nullptr | |||
}; | |||
}; | |||
//------------------------------------------------------------------------ | |||
/** Curve Types used in a VST XML Representation */ | |||
//------------------------------------------------------------------------ | |||
namespace CurveType | |||
{ | |||
const CString kSegment = "segment"; ///< | |||
@@ -295,7 +292,6 @@ namespace CurveType | |||
//------------------------------------------------------------------------ | |||
/** Attributes used to defined a Layer in a VST XML Representation */ | |||
//------------------------------------------------------------------------ | |||
namespace Attributes | |||
{ | |||
const CString kStyle = ATTR_STYLE; ///< string attribute : See AttributesStyle for available string value | |||
@@ -308,7 +304,6 @@ namespace Attributes | |||
//------------------------------------------------------------------------ | |||
/** Attributes Function used to defined the function of a Layer in a VST XML Representation */ | |||
//------------------------------------------------------------------------ | |||
namespace AttributesFunction | |||
{ | |||
/// Global Style | |||
@@ -330,7 +325,6 @@ namespace AttributesFunction | |||
//------------------------------------------------------------------------ | |||
/** Attributes Style associated a specific Layer Type in a VST XML Representation */ | |||
//------------------------------------------------------------------------ | |||
namespace AttributesStyle | |||
{ | |||
/// Global Style | |||
@@ -356,13 +350,11 @@ namespace AttributesStyle | |||
//------------------------------------------------------------------------ | |||
/** Attributes Flags defining a Layer in a VST XML Representation */ | |||
//------------------------------------------------------------------------ | |||
namespace AttributesFlags | |||
{ | |||
const CString kHideableFlag = "hideable"; ///< the associated layer marked as hideable allows a remote to hide or make it not usable a parameter when the associated value is inactive | |||
}; | |||
//------------------------------------------------------------------------ | |||
} // namespace Vst | |||
} // namespace Steinberg | |||
@@ -9,7 +9,7 @@ | |||
// | |||
//----------------------------------------------------------------------------- | |||
// LICENSE | |||
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved | |||
// (c) 2020, Steinberg Media Technologies GmbH, All Rights Reserved | |||
//----------------------------------------------------------------------------- | |||
// Redistribution and use in source and binary forms, with or without modification, | |||
// are permitted provided that the following conditions are met: | |||
@@ -84,6 +84,26 @@ public: | |||
DECLARE_CLASS_IID (ITestPlugProvider, 0x86BE70EE, 0x4E99430F, 0x978F1E6E, 0xD68FB5BA) | |||
//------------------------------------------------------------------------ | |||
/** Test Helper extension. | |||
* \ingroup TestClass | |||
*/ | |||
class ITestPlugProvider2 : public ITestPlugProvider | |||
{ | |||
public: | |||
/** get the plugin factory. | |||
* | |||
* The reference count of the returned factory object is not increased when calling this | |||
* function. | |||
*/ | |||
virtual IPluginFactory* PLUGIN_API getPluginFactory () = 0; | |||
//------------------------------------------------------------------------ | |||
static const FUID iid; | |||
}; | |||
DECLARE_CLASS_IID (ITestPlugProvider2, 0xC7C75364, 0x7B8343AC, 0xA4495B0A, 0x3E5A46C7) | |||
//------------------------------------------------------------------------ | |||
} // Vst | |||
} // Steinberg |
@@ -17,21 +17,21 @@ | |||
#pragma once | |||
#include "pluginterfaces/base/funknown.h" | |||
#include "vsttypes.h" | |||
#include "pluginterfaces/vst/vsttypes.h" | |||
//------------------------------------------------------------------------ | |||
#include "pluginterfaces/base/falignpush.h" | |||
//------------------------------------------------------------------------ | |||
//------------------------------------------------------------------------ | |||
namespace Steinberg { | |||
class IBStream; | |||
//------------------------------------------------------------------------ | |||
namespace Vst { | |||
//------------------------------------------------------------------------ | |||
/** Special UnitIDs for UnitInfo */ | |||
static const UnitID kRootUnitId = 0; ///< identifier for the top level unit (root) | |||
static const UnitID kNoParentUnitId = -1; ///< used for the root unit which doesn't have a parent. | |||
static const UnitID kNoParentUnitId = -1; ///< used for the root unit which does not have a parent. | |||
//------------------------------------------------------------------------ | |||
/** Special ProgramListIDs for UnitInfo */ | |||
@@ -39,8 +39,8 @@ static const ProgramListID kNoProgramListId = -1; ///< no programs are used in t | |||
//------------------------------------------------------------------------ | |||
/** Basic Unit Description. | |||
\see IUnitInfo */ | |||
//------------------------------------------------------------------------ | |||
\see IUnitInfo | |||
*/ | |||
struct UnitInfo | |||
{ | |||
UnitID id; ///< unit identifier | |||
@@ -51,8 +51,8 @@ struct UnitInfo | |||
//------------------------------------------------------------------------ | |||
/** Basic Program List Description. | |||
\see IUnitInfo */ | |||
//------------------------------------------------------------------------ | |||
\see IUnitInfo | |||
*/ | |||
struct ProgramListInfo | |||
{ | |||
ProgramListID id; ///< program list identifier | |||
@@ -65,7 +65,7 @@ struct ProgramListInfo | |||
static const int32 kAllProgramInvalid = -1; ///< all program information is invalid | |||
//------------------------------------------------------------------------ | |||
/** Host callback for unit support. | |||
/** Host callback for unit support: Vst::IUnitHandler | |||
\ingroup vstIHost vst300 | |||
- [host imp] | |||
- [extends IComponentHandler] | |||
@@ -75,16 +75,16 @@ static const int32 kAllProgramInvalid = -1; ///< all program information is inv | |||
Host callback interface, used with IUnitInfo. | |||
Retrieve via queryInterface from IComponentHandler. | |||
\see \ref vst3Units, IUnitInfo */ | |||
//------------------------------------------------------------------------ | |||
class IUnitHandler: public FUnknown | |||
\see \ref vst3Units, IUnitInfo | |||
*/ | |||
class IUnitHandler : public FUnknown | |||
{ | |||
public: | |||
//------------------------------------------------------------------------ | |||
/** Notify host when a module is selected in Plug-in GUI. */ | |||
/** Notify host when a module is selected in plug-in GUI. */ | |||
virtual tresult PLUGIN_API notifyUnitSelection (UnitID unitId) = 0; | |||
/** Tell host that the Plug-in controller changed a program list (rename, load, PitchName changes). | |||
/** Tell host that the plug-in controller changed a program list (rename, load, PitchName changes). | |||
\param listId is the specified program list ID to inform. | |||
\param programIndex : when kAllProgramInvalid, all program information is invalid, otherwise only the program of given index. */ | |||
virtual tresult PLUGIN_API notifyProgramListChange (ProgramListID listId, int32 programIndex) = 0; | |||
@@ -95,9 +95,8 @@ public: | |||
DECLARE_CLASS_IID (IUnitHandler, 0x4B5147F8, 0x4654486B, 0x8DAB30BA, 0x163A3C56) | |||
//------------------------------------------------------------------------ | |||
/** Host callback for extended unit support. | |||
/** Host callback for extended unit support: Vst::IUnitHandler2 | |||
\ingroup vstIHost vst365 | |||
- [host imp] | |||
- [extends IUnitHandler] | |||
@@ -107,8 +106,12 @@ DECLARE_CLASS_IID (IUnitHandler, 0x4B5147F8, 0x4654486B, 0x8DAB30BA, 0x163A3C56) | |||
Host callback interface, used with IUnitInfo. | |||
Retrieve via queryInterface from IComponentHandler. | |||
\see \ref vst3Units, IUnitHandler */ | |||
//------------------------------------------------------------------------ | |||
The plug-in has the possibility to inform the host with notifyUnitByBusChange that something has | |||
changed in the bus - unit assignment, the host then has to recall IUnitInfo::getUnitByBus in order | |||
to get the new relations between busses and unit. | |||
\see \ref vst3Units, IUnitHandler | |||
*/ | |||
class IUnitHandler2 : public FUnknown | |||
{ | |||
public: | |||
@@ -122,24 +125,23 @@ public: | |||
DECLARE_CLASS_IID (IUnitHandler2, 0xF89F8CDF, 0x699E4BA5, 0x96AAC9A4, 0x81452B01) | |||
//------------------------------------------------------------------------ | |||
/** Edit controller extension to describe the Plug-in structure. | |||
/** Edit controller extension to describe the plug-in structure: Vst::IUnitInfo | |||
\ingroup vstIPlug vst300 | |||
- [plug imp] | |||
- [extends IEditController] | |||
- [released: 3.0.0] | |||
- [optional] | |||
IUnitInfo describes the internal structure of the Plug-in. | |||
IUnitInfo describes the internal structure of the plug-in. | |||
- The root unit is the component itself, so getUnitCount must return 1 at least. | |||
- The root unit id has to be 0 (kRootUnitId). | |||
- Each unit can reference one program list - this reference must not change. | |||
- Each unit using a program list, references one program of the list. | |||
- Each unit, using a program list, references one program of the list. | |||
\see \ref vst3Units, IUnitHandler */ | |||
//------------------------------------------------------------------------ | |||
class IUnitInfo: public FUnknown | |||
\see \ref vst3Units, IUnitHandler | |||
*/ | |||
class IUnitInfo : public FUnknown | |||
{ | |||
public: | |||
//------------------------------------------------------------------------ | |||
@@ -167,7 +169,7 @@ public: | |||
virtual tresult PLUGIN_API hasProgramPitchNames (ProgramListID listId, int32 programIndex) = 0; | |||
/** Gets the PitchName for a given program list ID, program index and pitch. | |||
If PitchNames are changed the Plug-in should inform the host with IUnitHandler::notifyProgramListChange. */ | |||
If PitchNames are changed the plug-in should inform the host with IUnitHandler::notifyProgramListChange. */ | |||
virtual tresult PLUGIN_API getProgramPitchName (ProgramListID listId, int32 programIndex, | |||
int16 midiPitch, String128 name /*out*/) = 0; | |||
@@ -197,19 +199,19 @@ public: | |||
DECLARE_CLASS_IID (IUnitInfo, 0x3D4BD6B5, 0x913A4FD2, 0xA886E768, 0xA5EB92C1) | |||
//------------------------------------------------------------------------ | |||
/** Component extension to access program list data. | |||
/** Component extension to access program list data: Vst::IProgramListData | |||
\ingroup vstIPlug vst300 | |||
- [plug imp] | |||
- [extends IComponent] | |||
- [released: 3.0.0] | |||
- [optional] | |||
A component can either support program list data via this interface or | |||
unit preset data (IUnitData), but not both! | |||
A component can support program list data via this interface or/and | |||
unit preset data (IUnitData). | |||
\see \ref vst3UnitPrograms */ | |||
//------------------------------------------------------------------------ | |||
class IProgramListData: public FUnknown | |||
\see IUnitData, \ref vst3MultitimbralPrograms | |||
*/ | |||
class IProgramListData : public FUnknown | |||
{ | |||
public: | |||
//------------------------------------------------------------------------ | |||
@@ -229,19 +231,19 @@ public: | |||
DECLARE_CLASS_IID (IProgramListData, 0x8683B01F, 0x7B354F70, 0xA2651DEC, 0x353AF4FF) | |||
//------------------------------------------------------------------------ | |||
/** Component extension to access unit data. | |||
/** Component extension to access unit data: Vst::IUnitData | |||
\ingroup vstIPlug vst300 | |||
- [plug imp] | |||
- [extends IComponent] | |||
- [released: 3.0.0] | |||
- [optional] | |||
A component can either support unit preset data via this interface or | |||
program list data (IProgramListData), but not both! | |||
A component can support unit preset data via this interface or | |||
program list data (IProgramListData). | |||
\see \ref vst3UnitPrograms */ | |||
//------------------------------------------------------------------------ | |||
class IUnitData: public FUnknown | |||
\see \ref vst3ProgramLists | |||
*/ | |||
class IUnitData : public FUnknown | |||
{ | |||
public: | |||
//------------------------------------------------------------------------ | |||
@@ -15,9 +15,8 @@ | |||
//----------------------------------------------------------------------------- | |||
#pragma once | |||
#include "vsttypes.h" | |||
//#include "pluginterfaces/base/ftype.h" | |||
#include "pluginterfaces/vst/vsttypes.h" | |||
//------------------------------------------------------------------------ | |||
namespace Steinberg { | |||
@@ -29,7 +28,9 @@ namespace Vst { | |||
A SpeakerArrangement is a bitset combination of speakers. For example: | |||
\code | |||
const SpeakerArrangement kStereo = kSpeakerL | kSpeakerR; // => hex: 0x03 / binary: 0011. | |||
\endcode*/ | |||
\endcode | |||
\see IAudioProcessor::getBusArrangement () and IAudioProcessor::setBusArrangements () | |||
*/ | |||
//------------------------------------------------------------------------ | |||
//------------------------------------------------------------------------ | |||
@@ -76,14 +77,14 @@ const Speaker kSpeakerACN13 = (Speaker)1 << 47; ///< Ambisonic ACN 13 | |||
const Speaker kSpeakerACN14 = (Speaker)1 << 48; ///< Ambisonic ACN 14 | |||
const Speaker kSpeakerACN15 = (Speaker)1 << 49; ///< Ambisonic ACN 15 | |||
const Speaker kSpeakerTsl = 1 << 24; ///< Top Side Left (Tsl) | |||
const Speaker kSpeakerTsr = 1 << 25; ///< Top Side Right (Tsr) | |||
const Speaker kSpeakerLcs = 1 << 26; ///< Left of Center Surround (Lcs) - Back Left Center | |||
const Speaker kSpeakerRcs = 1 << 27; ///< Right of Center Surround (Rcs) - Back Right Center | |||
const Speaker kSpeakerTsl = (Speaker)1 << 24; ///< Top Side Left (Tsl) | |||
const Speaker kSpeakerTsr = (Speaker)1 << 25; ///< Top Side Right (Tsr) | |||
const Speaker kSpeakerLcs = (Speaker)1 << 26; ///< Left of Center Surround (Lcs) - Back Left Center | |||
const Speaker kSpeakerRcs = (Speaker)1 << 27; ///< Right of Center Surround (Rcs) - Back Right Center | |||
const Speaker kSpeakerBfl = 1 << 28; ///< Bottom Front Left (Bfl) | |||
const Speaker kSpeakerBfc = 1 << 29; ///< Bottom Front Center (Bfc) | |||
const Speaker kSpeakerBfr = 1 << 30; ///< Bottom Front Right (Bfr) | |||
const Speaker kSpeakerBfl = (Speaker)1 << 28; ///< Bottom Front Left (Bfl) | |||
const Speaker kSpeakerBfc = (Speaker)1 << 29; ///< Bottom Front Center (Bfc) | |||
const Speaker kSpeakerBfr = (Speaker)1 << 30; ///< Bottom Front Right (Bfr) | |||
const Speaker kSpeakerPl = (Speaker)1 << 31; ///< Proximity Left (Pl) | |||
const Speaker kSpeakerPr = (Speaker)1 << 32; ///< Proximity Right (Pr) | |||
@@ -97,8 +98,7 @@ const Speaker kSpeakerBrr = (Speaker)1 << 37; ///< Bottom Rear Right (Brr) | |||
/** @}*/ | |||
//------------------------------------------------------------------------ | |||
/** Speaker Arrangement Definitions (SpeakerArrangement)*/ | |||
//------------------------------------------------------------------------ | |||
/** Speaker Arrangement Definitions (SpeakerArrangement) */ | |||
namespace SpeakerArr | |||
{ | |||
//------------------------------------------------------------------------ | |||
@@ -116,21 +116,22 @@ const SpeakerArrangement kStereoTF = kSpeakerTfl | kSpeakerTfr; ///< Tfl Tfr | |||
const SpeakerArrangement kStereoTS = kSpeakerTsl | kSpeakerTsr; ///< Tsl Tsr | |||
const SpeakerArrangement kStereoTR = kSpeakerTrl | kSpeakerTrr; ///< Trl Trr | |||
const SpeakerArrangement kStereoBF = kSpeakerBfl | kSpeakerBfr; ///< Bfl Bfr | |||
const SpeakerArrangement kCineFront = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLc | kSpeakerRc; ///< L R C Lc Rc | |||
/** L R C */ | |||
const SpeakerArrangement k30Cine = kSpeakerL | kSpeakerR | kSpeakerC; | |||
/** L R S */ | |||
const SpeakerArrangement k30Music = kSpeakerL | kSpeakerR | kSpeakerS; | |||
/** L R C Lfe */ | |||
/** L R C Lfe */ | |||
const SpeakerArrangement k31Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe; | |||
/** L R S */ | |||
const SpeakerArrangement k30Music = kSpeakerL | kSpeakerR | kSpeakerCs; | |||
/** L R Lfe S */ | |||
const SpeakerArrangement k31Music = kSpeakerL | kSpeakerR | kSpeakerLfe | kSpeakerS; | |||
const SpeakerArrangement k31Music = kSpeakerL | kSpeakerR | kSpeakerLfe | kSpeakerCs; | |||
/** L R C S (LCRS) */ | |||
const SpeakerArrangement k40Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerS; | |||
const SpeakerArrangement k40Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerCs; | |||
/** L R C Lfe S (LCRS+Lfe) */ | |||
const SpeakerArrangement k41Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerCs; | |||
/** L R Ls Rs (Quadro) */ | |||
const SpeakerArrangement k40Music = kSpeakerL | kSpeakerR | kSpeakerLs | kSpeakerRs; | |||
/** L R C Lfe S (LCRS+Lfe) */ | |||
const SpeakerArrangement k41Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerS; | |||
/** L R Lfe Ls Rs (Quadro+Lfe) */ | |||
const SpeakerArrangement k41Music = kSpeakerL | kSpeakerR | kSpeakerLfe | kSpeakerLs | kSpeakerRs; | |||
/** L R C Ls Rs */ | |||
@@ -139,35 +140,48 @@ const SpeakerArrangement k50 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeake | |||
const SpeakerArrangement k51 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs; | |||
/** L R C Ls Rs Cs */ | |||
const SpeakerArrangement k60Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerCs; | |||
/** L R Ls Rs Sl Sr */ | |||
const SpeakerArrangement k60Music = kSpeakerL | kSpeakerR | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr; | |||
/** L R C Lfe Ls Rs Cs */ | |||
const SpeakerArrangement k61Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerCs; | |||
/** L R Ls Rs Sl Sr */ | |||
const SpeakerArrangement k60Music = kSpeakerL | kSpeakerR | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr; | |||
/** L R Lfe Ls Rs Sl Sr */ | |||
const SpeakerArrangement k61Music = kSpeakerL | kSpeakerR | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr; | |||
/** L R C Ls Rs Lc Rc */ | |||
const SpeakerArrangement k70Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc; | |||
/** L R C Ls Rs Sl Sr */ | |||
const SpeakerArrangement k70Music = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr; | |||
/** L R C Lfe Ls Rs Lc Rc */ | |||
const SpeakerArrangement k71Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc; | |||
const SpeakerArrangement k71CineFullFront= k71Cine; | |||
/** L R C Lfe Ls Rs Lcs Rcs */ | |||
const SpeakerArrangement k71CineFullRear = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerLcs | kSpeakerRcs; | |||
const SpeakerArrangement k71CineFullFront = k71Cine; | |||
/** L R C Ls Rs Sl Sr */ | |||
const SpeakerArrangement k70Music = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr; | |||
/** L R C Lfe Ls Rs Sl Sr */ | |||
const SpeakerArrangement k71Music = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr; | |||
/** L R C Lfe Ls Rs Lcs Rcs */ | |||
const SpeakerArrangement k71CineFullRear = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerLcs | kSpeakerRcs; | |||
const SpeakerArrangement k71CineSideFill = k71Music; | |||
/** L R C Lfe Ls Rs Pl Pr */ | |||
const SpeakerArrangement k71Proximity = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerPl | kSpeakerPr; | |||
/** L R C Ls Rs Lc Rc Cs */ | |||
const SpeakerArrangement k80Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc | kSpeakerCs; | |||
/** L R C Ls Rs Cs Sl Sr */ | |||
const SpeakerArrangement k80Music = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerCs | kSpeakerSl | kSpeakerSr; | |||
/** L R C Lfe Ls Rs Lc Rc Cs */ | |||
const SpeakerArrangement k81Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc | kSpeakerCs; | |||
/** L R C Ls Rs Cs Sl Sr */ | |||
const SpeakerArrangement k80Music = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerCs | kSpeakerSl | kSpeakerSr; | |||
/** L R C Lfe Ls Rs Cs Sl Sr */ | |||
const SpeakerArrangement k81Music = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerCs | kSpeakerSl | kSpeakerSr; | |||
/** L R C Ls Rs Lc Rc Sl Sr */ | |||
const SpeakerArrangement k90Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc | | |||
kSpeakerSl | kSpeakerSr; | |||
/** L R C Lfe Ls Rs Lc Rc Sl Sr */ | |||
const SpeakerArrangement k91Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc | | |||
kSpeakerSl | kSpeakerSr; | |||
/** L R C Ls Rs Lc Rc Cs Sl Sr */ | |||
const SpeakerArrangement k100Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc | kSpeakerCs | | |||
kSpeakerSl | kSpeakerSr; | |||
/** L R C Lfe Ls Rs Lc Rc Cs Sl Sr */ | |||
const SpeakerArrangement k101Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc | kSpeakerCs | | |||
kSpeakerSl | kSpeakerSr; | |||
/** First-Order with Ambisonic Channel Number (ACN) ordering and SN3D normalization */ | |||
const SpeakerArrangement kAmbi1stOrderACN = kSpeakerACN0 | kSpeakerACN1 | kSpeakerACN2 | kSpeakerACN3; | |||
@@ -180,84 +194,122 @@ const SpeakerArrangement kAmbi3rdOrderACN = kAmbi2cdOrderACN | kSpeakerACN9 | kS | |||
/*-----------*/ | |||
/* 3D formats */ | |||
/*-----------*/ | |||
/** L R Ls Rs Tfl Tfr Trl Trr */ | |||
/** L R Ls Rs Tfl Tfr Trl Trr */ // 4.0.4 | |||
const SpeakerArrangement k80Cube = kSpeakerL | kSpeakerR | kSpeakerLs | kSpeakerRs | kSpeakerTfl| kSpeakerTfr| kSpeakerTrl | kSpeakerTrr; | |||
/** L R C Lfe Ls Rs Cs Tc */ | |||
/** L R C Lfe Ls Rs Cs Tc */ // 6.1.1 | |||
const SpeakerArrangement k71CineTopCenter = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerCs | kSpeakerTc; | |||
/** L R C Lfe Ls Rs Cs Tfc */ | |||
/** L R C Lfe Ls Rs Cs Tfc */ // 6.1.1 | |||
const SpeakerArrangement k71CineCenterHigh = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerCs | kSpeakerTfc; | |||
/** L R C Lfe Ls Rs Tfl Tfr */ | |||
/** L R C Lfe Ls Rs Tfl Tfr */ // 5.1.2 | |||
const SpeakerArrangement k71CineFrontHigh = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerTfl | kSpeakerTfr; | |||
const SpeakerArrangement k71MPEG3D = k71CineFrontHigh; | |||
/** L R C Lfe Ls Rs Tsl Tsr */ | |||
/** L R C Lfe Ls Rs Tsl Tsr */ // 5.1.2 | |||
const SpeakerArrangement k71CineSideHigh = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerTsl | kSpeakerTsr; | |||
/** L R Lfe Ls Rs Tfl Tfc Tfr Bfc */ | |||
/** L R Lfe Ls Rs Tfl Tfc Tfr Bfc */ // 4.1.4 | |||
const SpeakerArrangement k81MPEG3D = kSpeakerL | kSpeakerR | kSpeakerLfe | kSpeakerLs | kSpeakerRs | | |||
kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerBfc; | |||
kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerBfc; | |||
/** L R C Ls Rs Tfl Tfr Trl Trr */ | |||
/** L R C Ls Rs Tfl Tfr Trl Trr */ // 5.0.4 | |||
const SpeakerArrangement k90 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | | |||
kSpeakerTfl| kSpeakerTfr | kSpeakerTrl | kSpeakerTrr; | |||
kSpeakerTfl| kSpeakerTfr | kSpeakerTrl | kSpeakerTrr; | |||
const SpeakerArrangement k50_4 = k90; | |||
/** L R C Lfe Ls Rs Tfl Tfr Trl Trr */ | |||
/** L R C Lfe Ls Rs Tfl Tfr Trl Trr */ // 5.1.4 | |||
const SpeakerArrangement k91 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | | |||
kSpeakerTfl| kSpeakerTfr | kSpeakerTrl | kSpeakerTrr; | |||
kSpeakerTfl| kSpeakerTfr | kSpeakerTrl | kSpeakerTrr; | |||
const SpeakerArrangement k51_4 = k91; | |||
/** L R C Lfe Ls Rs Sl Sr Tsl Tsr */ | |||
const SpeakerArrangement k71_2 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | | |||
kSpeakerRs | kSpeakerSl | kSpeakerSr | kSpeakerTsl | kSpeakerTsr; | |||
const SpeakerArrangement k91Atmos = k71_2; | |||
/** L R C Ls Rs Sl Sr Tsl Tsr */ // 7.0.2 | |||
const SpeakerArrangement k70_2 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | | |||
kSpeakerSl | kSpeakerSr | kSpeakerTsl | kSpeakerTsr; | |||
/** L R C Lfe Ls Rs Sl Sr Tsl Tsr */ // 7.1.2 | |||
const SpeakerArrangement k71_2 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | | |||
kSpeakerSl | kSpeakerSr | kSpeakerTsl | kSpeakerTsr; | |||
const SpeakerArrangement k91Atmos = k71_2; // 9.1 Dolby Atmos (3D) | |||
/** L R C Ls Rs Tc Tfl Tfr Trl Trr */ | |||
/** L R C Ls Rs Sl Sr Tfl Tfr Trl Trr */ // 7.0.4 | |||
const SpeakerArrangement k70_4 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr | | |||
kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr; | |||
/** L R C Lfe Ls Rs Sl Sr Tfl Tfr Trl Trr */ // 7.1.4 | |||
const SpeakerArrangement k71_4 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr | | |||
kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr; | |||
const SpeakerArrangement k111MPEG3D = k71_4; | |||
/** L R C Ls Rs Sl Sr Tfl Tfr Trl Trr Tsl Tsr */ // 7.0.6 | |||
const SpeakerArrangement k70_6 = kSpeakerL | kSpeakerR | kSpeakerC | | |||
kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr | | |||
kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr | kSpeakerTsl | kSpeakerTsr; | |||
/** L R C Lfe Ls Rs Sl Sr Tfl Tfr Trl Trr Tsl Tsr */ // 7.1.6 | |||
const SpeakerArrangement k71_6 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | | |||
kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr | | |||
kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr | kSpeakerTsl | kSpeakerTsr; | |||
/** L R C Ls Rs Lc Rc Sl Sr Tfl Tfr Trl Trr */ // 9.0.4 | |||
const SpeakerArrangement k90_4 = kSpeakerL | kSpeakerR | kSpeakerC | | |||
kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc | kSpeakerSl | kSpeakerSr | | |||
kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr; | |||
/** L R C Lfe Ls Rs Lc Rc Sl Sr Tfl Tfr Trl Trr */ // 9.1.4 | |||
const SpeakerArrangement k91_4 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | | |||
kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc | kSpeakerSl | kSpeakerSr | | |||
kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr; | |||
/** L R C Lfe Ls Rs Lc Rc Sl Sr Tfl Tfr Trl Trr Tsl Tsr */ // 9.0.6 | |||
const SpeakerArrangement k90_6 = kSpeakerL | kSpeakerR | kSpeakerC | | |||
kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc | kSpeakerSl | kSpeakerSr | | |||
kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr | kSpeakerTsl | kSpeakerTsr; | |||
/** L R C Lfe Ls Rs Lc Rc Sl Sr Tfl Tfr Trl Trr Tsl Tsr */ // 9.1.6 | |||
const SpeakerArrangement k91_6 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | | |||
kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc | kSpeakerSl | kSpeakerSr | | |||
kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr | kSpeakerTsl | kSpeakerTsr; | |||
/** L R C Ls Rs Tc Tfl Tfr Trl Trr */ // 5.0.5 | |||
const SpeakerArrangement k100 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | | |||
kSpeakerTc | kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr; | |||
/** L R C Lfe Ls Rs Tc Tfl Tfr Trl Trr */ | |||
kSpeakerTc | kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr; | |||
/** L R C Lfe Ls Rs Tc Tfl Tfr Trl Trr */ // 5.1.5 | |||
const SpeakerArrangement k101 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | | |||
kSpeakerTc | kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr; | |||
kSpeakerTc | kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr; | |||
const SpeakerArrangement k101MPEG3D = k101; | |||
/** L R C Lfe Ls Rs Tfl Tfc Tfr Trl Trr Lfe2 */ | |||
/** L R C Lfe Ls Rs Tfl Tfc Tfr Trl Trr Lfe2 */ // 5.2.5 | |||
const SpeakerArrangement k102 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | | |||
kSpeakerTfl| kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr | kSpeakerLfe2; | |||
kSpeakerTfl| kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr | kSpeakerLfe2; | |||
/** L R C Ls Rs Tc Tfl Tfc Tfr Trl Trr */ | |||
/** L R C Ls Rs Tc Tfl Tfc Tfr Trl Trr */ // 5.0.6 | |||
const SpeakerArrangement k110 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | | |||
kSpeakerTc | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr; | |||
/** L R C Lfe Ls Rs Tc Tfl Tfc Tfr Trl Trr */ | |||
kSpeakerTc | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr; | |||
/** L R C Lfe Ls Rs Tc Tfl Tfc Tfr Trl Trr */ // 5.1.6 | |||
const SpeakerArrangement k111 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | | |||
kSpeakerTc | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr; | |||
kSpeakerTc | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr; | |||
/** L R C Ls Rs Sl Sr Tfl Tfr Trl Trr */ | |||
const SpeakerArrangement k70_4 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr | | |||
kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr; | |||
/** L R C Lfe Ls Rs Sl Sr Tfl Tfr Trl Trr */ | |||
const SpeakerArrangement k71_4 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr | | |||
kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr; | |||
const SpeakerArrangement k111MPEG3D = k71_4; | |||
/** L R C Lfe Ls Rs Lc Rc Tfl Tfc Tfr Trl Trr Lfe2 */ | |||
/** L R C Lfe Ls Rs Lc Rc Tfl Tfc Tfr Trl Trr Lfe2 */ // 7.2.5 | |||
const SpeakerArrangement k122 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc | | |||
kSpeakerTfl| kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr | kSpeakerLfe2; | |||
/** L R C Ls Rs Sl Sr Tc Tfl Tfc Tfr Trl Trr */ | |||
kSpeakerTfl| kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr | kSpeakerLfe2; | |||
/** L R C Ls Rs Sl Sr Tc Tfl Tfc Tfr Trl Trr */ // 7.0.6 | |||
const SpeakerArrangement k130 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr | | |||
kSpeakerTc | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr; | |||
/** L R C Lfe Ls Rs Sl Sr Tc Tfl Tfc Tfr Trl Trr */ | |||
kSpeakerTc | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr; | |||
/** L R C Lfe Ls Rs Sl Sr Tc Tfl Tfc Tfr Trl Trr */ // 7.1.6 | |||
const SpeakerArrangement k131 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr | | |||
kSpeakerTc | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr; | |||
kSpeakerTc | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr; | |||
/** L R Ls Rs Sl Sr Tfl Tfr Trl Trr Bfl Bfr Brl Brr */ | |||
/** L R Ls Rs Sl Sr Tfl Tfr Trl Trr Bfl Bfr Brl Brr */ // 6.0.4.4 | |||
const SpeakerArrangement k140 = kSpeakerL | kSpeakerR | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr | | |||
kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr | | |||
kSpeakerBfl | kSpeakerBfr | kSpeakerBrl | kSpeakerBrr; | |||
kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr | | |||
kSpeakerBfl | kSpeakerBfr | kSpeakerBrl | kSpeakerBrr; | |||
/** L R C Lfe Ls Rs Lc Rc Cs Sl Sr Tc Tfl Tfc Tfr Trl Trc Trr Lfe2 Tsl Tsr Bfl Bfc Bfr */ | |||
const SpeakerArrangement k222 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc | kSpeakerCs | kSpeakerSl | kSpeakerSr | | |||
kSpeakerTc | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrc | kSpeakerTrr | kSpeakerLfe2 | kSpeakerTsl | kSpeakerTsr | | |||
kSpeakerBfl| kSpeakerBfc | kSpeakerBfr; | |||
/** L R C Ls Rs Lc Rc Cs Sl Sr Tc Tfl Tfc Tfr Trl Trc Trr Tsl Tsr Bfl Bfc Bfr */ // 10.0.9.3 | |||
const SpeakerArrangement k220 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc | kSpeakerCs | kSpeakerSl | kSpeakerSr | | |||
kSpeakerTc | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrc | kSpeakerTrr | kSpeakerTsl | kSpeakerTsr | | |||
kSpeakerBfl| kSpeakerBfc | kSpeakerBfr; | |||
/** L R C Lfe Ls Rs Lc Rc Cs Sl Sr Tc Tfl Tfc Tfr Trl Trc Trr Lfe2 Tsl Tsr Bfl Bfc Bfr */ // 10.2.9.3 | |||
const SpeakerArrangement k222 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc | kSpeakerCs | kSpeakerSl | kSpeakerSr | | |||
kSpeakerTc | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrc | kSpeakerTrr | kSpeakerLfe2 | kSpeakerTsl | kSpeakerTsr | | |||
kSpeakerBfl| kSpeakerBfc | kSpeakerBfr; | |||
//------------------------------------------------------------------------ | |||
/** Speaker Arrangement String Representation. | |||
@@ -274,6 +326,7 @@ const CString kStringStereoTF = "Stereo (Tfl Tfr)"; | |||
const CString kStringStereoTS = "Stereo (Tsl Tsr)"; | |||
const CString kStringStereoTR = "Stereo (Trl Trr)"; | |||
const CString kStringStereoBF = "Stereo (Bfl Bfr)"; | |||
const CString kStringCineFront = "Cine Front"; | |||
const CString kString30Cine = "LRC"; | |||
const CString kString30Music = "LRS"; | |||
@@ -289,10 +342,14 @@ const CString kString60Cine = "6.0 Cine"; | |||
const CString kString60Music = "6.0 Music"; | |||
const CString kString61Cine = "6.1 Cine"; | |||
const CString kString61Music = "6.1 Music"; | |||
const CString kString70Cine = "7.0 Cine (SDDS)"; | |||
const CString kString70Music = "7.0 Music (Dolby)"; | |||
const CString kString71Cine = "7.1 Cine (SDDS)"; | |||
const CString kString71Music = "7.1 Music (Dolby)"; | |||
const CString kString70Cine = "7.0 SDDS"; | |||
const CString kString70CineOld = "7.0 Cine (SDDS)"; | |||
const CString kString70Music = "7.0"; | |||
const CString kString70MusicOld = "7.0 Music (Dolby)"; | |||
const CString kString71Cine = "7.1 SDDS"; | |||
const CString kString71CineOld = "7.1 Cine (SDDS)"; | |||
const CString kString71Music = "7.1"; | |||
const CString kString71MusicOld = "7.1 Music (Dolby)"; | |||
const CString kString71CineTopCenter = "7.1 Cine Top Center"; | |||
const CString kString71CineCenterHigh = "7.1 Cine Center High"; | |||
const CString kString71CineFrontHigh = "7.1 Cine Front High"; | |||
@@ -304,11 +361,24 @@ const CString kString80Music = "8.0 Music"; | |||
const CString kString80Cube = "8.0 Cube"; | |||
const CString kString81Cine = "8.1 Cine"; | |||
const CString kString81Music = "8.1 Music"; | |||
const CString kString90Cine = "9.0 Cine"; | |||
const CString kString91Cine = "9.1 Cine"; | |||
const CString kString100Cine = "10.0 Cine"; | |||
const CString kString101Cine = "10.1 Cine"; | |||
const CString kString102 = "10.2 Experimental"; | |||
const CString kString122 = "12.2"; | |||
const CString kString50_4 = "5.0.4"; | |||
const CString kString51_4 = "5.1.4"; | |||
const CString kString91Atmos = "9.1 Dolby Atmos"; | |||
const CString kString122 = "12.2"; | |||
const CString kString50_4 = "5.0.4"; | |||
const CString kString51_4 = "5.1.4"; | |||
const CString kString70_2 = "7.0.2"; | |||
const CString kString71_2 = "7.1.2"; | |||
const CString kString70_4 = "7.0.4"; | |||
const CString kString71_4 = "7.1.4"; | |||
const CString kString70_6 = "7.0.6"; | |||
const CString kString71_6 = "7.1.6"; | |||
const CString kString90_4 = "9.0.4"; | |||
const CString kString91_4 = "9.1.4"; | |||
const CString kString90_6 = "9.0.6"; | |||
const CString kString91_6 = "9.1.6"; | |||
const CString kString100 = "10.0 Auro-3D"; | |||
const CString kString101 = "10.1 Auro-3D"; | |||
const CString kString110 = "11.0 Auro-3D"; | |||
@@ -316,10 +386,9 @@ const CString kString111 = "11.1 Auro-3D"; | |||
const CString kString130 = "13.0 Auro-3D"; | |||
const CString kString131 = "13.1 Auro-3D"; | |||
const CString kString81MPEG = "8.1 MPEG"; | |||
const CString kString70_4 = "7.0.4"; | |||
const CString kString71_4 = "7.1.4"; | |||
const CString kString140 = "14.0"; | |||
const CString kString222 = "22.2"; | |||
const CString kString220 = "22.0"; | |||
const CString kStringAmbi1stOrder = "1st Order Ambisonics"; | |||
const CString kStringAmbi2cdOrder = "2nd Order Ambisonics"; | |||
const CString kStringAmbi3rdOrder = "3rd Order Ambisonics"; | |||
@@ -340,6 +409,7 @@ const CString kStringStereoTFS = "Tfl Tfr"; | |||
const CString kStringStereoTSS = "Tsl Tsr"; | |||
const CString kStringStereoTRS = "Trl Trr"; | |||
const CString kStringStereoBFS = "Bfl Bfr"; | |||
const CString kStringCineFrontS = "L R C Lc Rc"; | |||
const CString kString30CineS = "L R C"; | |||
const CString kString30MusicS = "L R S"; | |||
const CString kString31CineS = "L R C LFE"; | |||
@@ -369,15 +439,26 @@ const CString kString71CineFrontHighS = "L R C LFE Ls Rs Tfl Tfl"; | |||
const CString kString71CineSideHighS = "L R C LFE Ls Rs Tsl Tsl"; | |||
const CString 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 kString100CineS = "L R C Ls Rs Lc Rc Cs Sl Sr"; | |||
const CString kString101CineS = "L R C Lfe Ls Rs Lc Rc Cs Sl Sr"; | |||
const CString kString50_4S = "L R C Ls Rs Tfl Tfr Trl Trr"; | |||
const CString kString51_4S = "L R C LFE Ls Rs Tfl Tfr Trl Trr"; | |||
const CString kString91AtmosS = "L R C LFE Ls Rs Sl Sr Tsl Tsr"; | |||
const CString kString70_2S = "L R C Ls Rs Sl Sr Tsl Tsr"; | |||
const CString kString71_2S = "L R C LFE Ls Rs Sl Sr Tsl Tsr"; | |||
const CString kString70_4S = "L R C Ls Rs Sl Sr Tfl Tfr Trl Trr"; | |||
const CString kString71_4S = "L R C LFE Ls Rs Sl Sr Tfl Tfr Trl Trr"; | |||
const CString kString70_6S = "L R C Ls Rs Sl Sr Tfl Tfr Trl Trr Tsl Tsr"; | |||
const CString kString71_6S = "L R C LFE Ls Rs Sl Sr Tfl Tfr Trl Trr Tsl Tsr"; | |||
const CString kString90_4S = "L R C Ls Rs Lc Rc Sl Sr Tfl Tfr Trl Trr"; | |||
const CString kString91_4S = "L R C LFE Ls Rs Lc Rc Sl Sr Tfl Tfr Trl Trr"; | |||
const CString kString90_6S = "L R C Ls Rs Lc Rc Sl Sr Tfl Tfr Trl Trr Tsl Tsr"; | |||
const CString kString91_6S = "L R C LFE Ls Rs Lc Rc Sl Sr Tfl Tfr Trl Trr Tsl Tsr"; | |||
const CString kString100S = "L R C Ls Rs Tc Tfl Tfr Trl Trr"; | |||
const CString kString101S = "L R C LFE Ls Rs Tc Tfl Tfr Trl Trr"; | |||
const CString kString110S = "L R C Ls Rs Tc Tfl Tfc Tfr Trl Trr"; | |||
const CString kString111S = "L R C LFE Ls Rs Tc Tfl Tfc Tfr Trl Trr"; | |||
const CString kStringk70_4S = "L R C Ls Rs Sl Sr Tfl Tfr Trl Trr"; | |||
const CString kStringk71_4S = "L R C LFE Ls Rs Sl Sr Tfl Tfr Trl Trr"; | |||
const CString kString130S = "L R C Ls Rs Sl Sr Tc Tfl Tfc Tfr Trl Trr"; | |||
const CString kString131S = "L R C LFE Ls Rs Sl Sr Tc Tfl Tfc Tfr Trl Trr"; | |||
const CString kString102S = "L R C LFE Ls Rs Tfl Tfc Tfr Trl Trr LFE2"; | |||
@@ -385,6 +466,7 @@ const CString kString122S = "L R C LFE Ls Rs Lc Rc Tfl Tfc Tfr Trl Trr LFE2"; | |||
const CString kString81MPEGS = "L R LFE Ls Rs Tfl Tfc Tfr Bfc"; | |||
const CString 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 kStringAmbi1stOrderS = "0 1 2 3"; | |||
const CString kStringAmbi2cdOrderS = "0 1 2 3 4 5 6 7 8"; | |||
@@ -469,6 +551,61 @@ inline bool isAuro (const SpeakerArrangement& arr) | |||
return false; | |||
} | |||
//------------------------------------------------------------------------ | |||
/** Returns true if arrangement contains top (upper layer) speakers */ | |||
inline bool hasTopSpeakers (const SpeakerArrangement& arr) | |||
{ | |||
if (arr & kSpeakerTc || arr & kSpeakerTfl || arr & kSpeakerTfc || arr & kSpeakerTfr || | |||
arr & kSpeakerTrl || arr & kSpeakerTrc || arr & kSpeakerTrr || arr & kSpeakerTsl || | |||
arr & kSpeakerTsr) | |||
return true; | |||
return false; | |||
} | |||
//------------------------------------------------------------------------ | |||
/** Returns true if arrangement contains bottom (lower layer) speakers */ | |||
inline bool hasBottomSpeakers (const SpeakerArrangement& arr) | |||
{ | |||
if (arr & kSpeakerBfl || arr & kSpeakerBfc || arr & kSpeakerBfl || arr & kSpeakerBfc || | |||
arr & kSpeakerBfr) | |||
return true; | |||
return false; | |||
} | |||
//------------------------------------------------------------------------ | |||
/** Returns true if arrangement contains middle layer (at ears level) speakers */ | |||
inline bool hasMiddleSpeakers (const SpeakerArrangement& arr) | |||
{ | |||
if (arr & kSpeakerL || arr & kSpeakerR || arr & kSpeakerC || arr & kSpeakerLs || | |||
arr & kSpeakerRs || arr & kSpeakerLc || arr & kSpeakerRc || arr & kSpeakerCs || | |||
arr & kSpeakerSl || arr & kSpeakerSr || arr & kSpeakerM || arr & kSpeakerPl || | |||
arr & kSpeakerPr || arr & kSpeakerLcs || arr & kSpeakerRcs) | |||
return true; | |||
return false; | |||
} | |||
//------------------------------------------------------------------------ | |||
/** Returns true if arrangement contains LFE speakers */ | |||
inline bool hasLfe (const SpeakerArrangement& arr) | |||
{ | |||
if (arr & kSpeakerLfe || arr & kSpeakerLfe2) | |||
return true; | |||
return false; | |||
} | |||
//------------------------------------------------------------------------ | |||
/** Returns true if arrangement is a 3D configuration ((top or bottom) and middle) */ | |||
inline bool is3D (const SpeakerArrangement& arr) | |||
{ | |||
bool top = hasTopSpeakers (arr); | |||
bool bottom = hasBottomSpeakers (arr); | |||
bool middle = hasMiddleSpeakers (arr); | |||
if (((top || bottom) && middle) || (top && bottom)) | |||
return true; | |||
return false; | |||
} | |||
//------------------------------------------------------------------------ | |||
/** Returns true if arrangement is a Auro configuration. */ | |||
inline bool isAmbisonics (const SpeakerArrangement& arr) | |||
@@ -482,8 +619,7 @@ inline bool isAmbisonics (const SpeakerArrangement& arr) | |||
//------------------------------------------------------------------------ | |||
/** Returns the speaker arrangement associated to a string representation. | |||
Returns kEmpty if no associated arrangement is known. | |||
*/ | |||
Returns kEmpty if no associated arrangement is known. */ | |||
inline SpeakerArrangement getSpeakerArrangementFromString (CString arrStr) | |||
{ | |||
if (!strcmp8 (arrStr, kStringMono)) | |||
@@ -506,6 +642,8 @@ inline SpeakerArrangement getSpeakerArrangementFromString (CString arrStr) | |||
return kStereoTR; | |||
if (!strcmp8 (arrStr, kStringStereoBF)) | |||
return kStereoBF; | |||
if (!strcmp8 (arrStr, kStringCineFront)) | |||
return kCineFront; | |||
if (!strcmp8 (arrStr, kString30Cine)) | |||
return k30Cine; | |||
if (!strcmp8 (arrStr, kString30Music)) | |||
@@ -534,13 +672,13 @@ inline SpeakerArrangement getSpeakerArrangementFromString (CString arrStr) | |||
return k61Cine; | |||
if (!strcmp8 (arrStr, kString61Music)) | |||
return k61Music; | |||
if (!strcmp8 (arrStr, kString70Cine)) | |||
if (!strcmp8 (arrStr, kString70Cine) || !strcmp8 (arrStr, kString70CineOld)) | |||
return k70Cine; | |||
if (!strcmp8 (arrStr, kString70Music)) | |||
if (!strcmp8 (arrStr, kString70Music) || !strcmp8 (arrStr, kString70MusicOld)) | |||
return k70Music; | |||
if (!strcmp8 (arrStr, kString71Cine)) | |||
if (!strcmp8 (arrStr, kString71Cine) || !strcmp8 (arrStr, kString71CineOld)) | |||
return k71Cine; | |||
if (!strcmp8 (arrStr, kString71Music)) | |||
if (!strcmp8 (arrStr, kString71Music) || !strcmp8 (arrStr, kString71MusicOld)) | |||
return k71Music; | |||
if (!strcmp8 (arrStr, kString71Proximity)) | |||
return k71Proximity; | |||
@@ -568,14 +706,40 @@ inline SpeakerArrangement getSpeakerArrangementFromString (CString arrStr) | |||
return k71CineSideHigh; | |||
if (!strcmp8 (arrStr, kString71CineFullRear)) | |||
return k71CineFullRear; | |||
if (!strcmp8 (arrStr, kString90Cine)) | |||
return k90Cine; | |||
if (!strcmp8 (arrStr, kString91Cine)) | |||
return k91Cine; | |||
if (!strcmp8 (arrStr, kString100Cine)) | |||
return k100Cine; | |||
if (!strcmp8 (arrStr, kString101Cine)) | |||
return k101Cine; | |||
if (!strcmp8 (arrStr, kString50_4)) | |||
return k50_4; | |||
if (!strcmp8 (arrStr, kString51_4)) | |||
return k51_4; | |||
if (!strcmp8 (arrStr, kString81MPEG)) | |||
return k81MPEG3D; | |||
if (!strcmp8 (arrStr, kString91Atmos)) | |||
return k91Atmos; | |||
if (!strcmp8 (arrStr, kString70_2)) | |||
return k70_2; | |||
if (!strcmp8 (arrStr, kString71_2)) | |||
return k71_2; | |||
if (!strcmp8 (arrStr, kString70_4)) | |||
return k70_4; | |||
if (!strcmp8 (arrStr, kString71_4)) | |||
return k71_4; | |||
if (!strcmp8 (arrStr, kString70_6)) | |||
return k70_6; | |||
if (!strcmp8 (arrStr, kString71_6)) | |||
return k71_6; | |||
if (!strcmp8 (arrStr, kString90_4)) | |||
return k90_4; | |||
if (!strcmp8 (arrStr, kString91_4)) | |||
return k91_4; | |||
if (!strcmp8 (arrStr, kString90_6)) | |||
return k90_6; | |||
if (!strcmp8 (arrStr, kString91_6)) | |||
return k91_6; | |||
if (!strcmp8 (arrStr, kString100)) | |||
return k100; | |||
if (!strcmp8 (arrStr, kString101)) | |||
@@ -584,10 +748,6 @@ inline SpeakerArrangement getSpeakerArrangementFromString (CString arrStr) | |||
return k110; | |||
if (!strcmp8 (arrStr, kString111)) | |||
return k111; | |||
if (!strcmp8 (arrStr, kString70_4)) | |||
return k70_4; | |||
if (!strcmp8 (arrStr, kString71_4)) | |||
return k71_4; | |||
if (!strcmp8 (arrStr, kString130)) | |||
return k130; | |||
if (!strcmp8 (arrStr, kString131)) | |||
@@ -596,6 +756,8 @@ inline SpeakerArrangement getSpeakerArrangementFromString (CString arrStr) | |||
return k140; | |||
if (!strcmp8 (arrStr, kString222)) | |||
return k222; | |||
if (!strcmp8 (arrStr, kString220)) | |||
return k220; | |||
if (!strcmp8 (arrStr, kStringAmbi1stOrder)) | |||
return kAmbi1stOrderACN; | |||
if (!strcmp8 (arrStr, kStringAmbi2cdOrder)) | |||
@@ -607,8 +769,7 @@ inline SpeakerArrangement getSpeakerArrangementFromString (CString arrStr) | |||
//------------------------------------------------------------------------ | |||
/** Returns the string representation of a given speaker arrangement. | |||
Returns kStringEmpty if arr is unknown. | |||
*/ | |||
Returns kStringEmpty if arr is unknown. */ | |||
inline CString getSpeakerArrangementString (SpeakerArrangement arr, bool withSpeakersName) | |||
{ | |||
switch (arr) | |||
@@ -623,6 +784,7 @@ inline CString getSpeakerArrangementString (SpeakerArrangement arr, bool withSpe | |||
case kStereoTS: return withSpeakersName ? kStringStereoTSS : kStringStereoTS; | |||
case kStereoTR: return withSpeakersName ? kStringStereoTRS : kStringStereoTR; | |||
case kStereoBF: return withSpeakersName ? kStringStereoBFS : kStringStereoBF; | |||
case kCineFront: return withSpeakersName ? kStringCineFrontS : kStringCineFront; | |||
case k30Cine: return withSpeakersName ? kString30CineS : kString30Cine; | |||
case k30Music: return withSpeakersName ? kString30MusicS : kString30Music; | |||
case k31Cine: return withSpeakersName ? kString31CineS : kString31Cine; | |||
@@ -655,7 +817,10 @@ inline CString getSpeakerArrangementString (SpeakerArrangement arr, bool withSpe | |||
case k71CineFrontHigh: return withSpeakersName ? kString71CineFrontHighS : kString71CineFrontHigh; | |||
case k71CineSideHigh: return withSpeakersName ? kString71CineSideHighS : kString71CineSideHigh; | |||
case k71CineFullRear: return withSpeakersName ? kString71CineFullRearS : kString71CineFullRear; | |||
case k91Atmos: return withSpeakersName ? kString91AtmosS : kString91Atmos; | |||
case k90Cine: return withSpeakersName ? kString90CineS : kString90Cine; | |||
case k91Cine: return withSpeakersName ? kString91CineS : kString91Cine; | |||
case k100Cine: return withSpeakersName ? kString100CineS : kString100Cine; | |||
case k101Cine: return withSpeakersName ? kString101CineS : kString101Cine; | |||
case k100: return withSpeakersName ? kString100S : kString100; | |||
case k101: return withSpeakersName ? kString101S : kString101; | |||
case k110: return withSpeakersName ? kString110S : kString110; | |||
@@ -663,13 +828,21 @@ inline CString getSpeakerArrangementString (SpeakerArrangement arr, bool withSpe | |||
case k50_4: return withSpeakersName ? kString50_4S : kString50_4; | |||
case k51_4: return withSpeakersName ? kString51_4S : kString51_4; | |||
case k70_4: return withSpeakersName ? kStringk70_4S : kString70_4; | |||
case k71_4: return withSpeakersName ? kStringk71_4S : kString71_4; | |||
case k70_2: return withSpeakersName ? kString70_2S : kString70_2; | |||
case k71_2: return withSpeakersName ? kString71_2S : kString71_2; | |||
case k70_4: return withSpeakersName ? kString70_4S : kString70_4; | |||
case k71_4: return withSpeakersName ? kString71_4S : kString71_4; | |||
case k70_6: return withSpeakersName ? kString70_6S : kString70_6; | |||
case k71_6: return withSpeakersName ? kString71_6S : kString71_6; | |||
case k90_4: return withSpeakersName ? kString90_4S : kString90_4; | |||
case k91_4: return withSpeakersName ? kString91_4S : kString91_4; | |||
case k90_6: return withSpeakersName ? kString90_6S : kString90_6; | |||
case k91_6: return withSpeakersName ? kString91_6S : kString91_6; | |||
case k130: return withSpeakersName ? kString130S : kString130; | |||
case k131: return withSpeakersName ? kString131S : kString131; | |||
case k140: return withSpeakersName ? kString140S : kString140; | |||
case k222: return withSpeakersName ? kString222S : kString222; | |||
case k220: return withSpeakersName ? kString220S : kString220; | |||
break; | |||
} | |||
@@ -684,8 +857,7 @@ inline CString getSpeakerArrangementString (SpeakerArrangement arr, bool withSpe | |||
} | |||
//------------------------------------------------------------------------ | |||
/** Returns a CString representation of a given speaker in a given arrangement | |||
*/ | |||
/** Returns a CString representation of a given speaker in a given arrangement */ | |||
inline CString getSpeakerShortName (const SpeakerArrangement& arr, int32 index) | |||
{ | |||
SpeakerArrangement arrTmp = arr; | |||
@@ -726,7 +898,7 @@ inline CString getSpeakerShortName (const SpeakerArrangement& arr, int32 index) | |||
return "Lc"; | |||
if (speaker == kSpeakerRc) | |||
return "Rc"; | |||
if (speaker == kSpeakerS) | |||
if (speaker == kSpeakerCs) | |||
return "S"; | |||
if (speaker == kSpeakerSl) | |||
return "Sl"; | |||
@@ -22,20 +22,39 @@ | |||
namespace Steinberg { | |||
namespace Vst { | |||
//------------------------------------------------------------------------ | |||
/** VST3 SDK Version */ | |||
#ifndef kVstVersionString | |||
#define kVstVersionString "VST 3.6.13" ///< SDK version for PClassInfo2 | |||
#define kVstVersionString "VST 3.7.2" ///< SDK version for PClassInfo2 | |||
#endif | |||
#define kVstVersionMajor 3 | |||
#define kVstVersionMinor 6 | |||
#define kVstVersionSub 13 | |||
#define kVstVersionMinor 7 | |||
#define kVstVersionSub 2 | |||
// this allows to write things like: #if VST_VERSION >= 0x030500 // note that 3.10.0 is 0x030a00 | |||
#define VST_VERSION ((kVstVersionMajor << 16) | (kVstVersionMinor << 8) | kVstVersionSub) | |||
// Versions History which allows to write such code: | |||
// #if VST_VERSION >= VST_3_6_5_VERSION | |||
#define VST_3_7_2_VERSION 0x030702 | |||
#define VST_3_7_1_VERSION 0x030701 | |||
#define VST_3_7_0_VERSION 0x030700 | |||
#define VST_3_6_14_VERSION 0x03060E | |||
#define VST_3_6_13_VERSION 0x03060D | |||
#define VST_3_6_12_VERSION 0x03060C | |||
#define VST_3_6_11_VERSION 0x03060B | |||
#define VST_3_6_10_VERSION 0x03060A | |||
#define VST_3_6_9_VERSION 0x030609 | |||
#define VST_3_6_8_VERSION 0x030608 | |||
#define VST_3_6_7_VERSION 0x030607 | |||
#define VST_3_6_6_VERSION 0x030606 | |||
#define VST_3_6_5_VERSION 0x030605 | |||
#define VST_3_6_0_VERSION 0x030600 | |||
#define VST_3_5_0_VERSION 0x030500 | |||
#define VST_3_1_0_VERSION 0x030100 | |||
#define VST_3_0_0_VERSION 0x030000 | |||
//------------------------------------------------------------------------ | |||
/** \defgroup vst3typedef VST 3 Data Types | |||
*/ | |||
/** \defgroup vst3typedef VST 3 Data Types */ | |||
/*@{*/ | |||
//------------------------------------------------------------------------ | |||
// String Types | |||
@@ -1,6 +1,6 @@ | |||
//----------------------------------------------------------------------------- | |||
// LICENSE | |||
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved | |||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved | |||
//----------------------------------------------------------------------------- | |||
// Redistribution and use in source and binary forms, with or without modification, | |||
// are permitted provided that the following conditions are met: | |||
@@ -1,9 +1,9 @@ | |||
# Welcome to VST SDK 3 public_sdk | |||
# Welcome to VST 3 SDK public_sdk | |||
Here are located: | |||
- helper classes implementing VST3 Interfaces | |||
- samples of VST3 hosting and VST3 Plug-Ins | |||
- samples of VST3 Hosting and VST3 Plug-Ins | |||
- AAX Wrapper | |||
- AU Wrapper | |||
- AUv3 Wrapper | |||
@@ -12,4 +12,7 @@ Here are located: | |||
## License & Usage guidelines | |||
More details are found at [www.steinberg.net/sdklicenses_vst3](http://www.steinberg.net/sdklicenses_vst3) | |||
More details are found at [VST 3 SDK public_sdk License](https://forums.steinberg.net/t/vst-3-sdk-public-sdk-license/695592) | |||
---- | |||
Return to [VST 3 SDK](https://github.com/steinbergmedia/vst3sdk) |
@@ -8,7 +8,7 @@ | |||
// | |||
//----------------------------------------------------------------------------- | |||
// LICENSE | |||
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved | |||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved | |||
//----------------------------------------------------------------------------- | |||
// Redistribution and use in source and binary forms, with or without modification, | |||
// are permitted provided that the following conditions are met: | |||
@@ -105,7 +105,7 @@ tresult PLUGIN_API MemoryStream::read (void* data, int32 numBytes, int32* numByt | |||
if (numBytes) | |||
{ | |||
memcpy (data, &memory[cursor], numBytes); | |||
memcpy (data, &memory[cursor], static_cast<size_t> (numBytes)); | |||
cursor += numBytes; | |||
} | |||
} | |||
@@ -137,7 +137,7 @@ tresult PLUGIN_API MemoryStream::write (void* buffer, int32 numBytes, int32* num | |||
// Copy data | |||
if (memory && cursor >= 0 && numBytes > 0) | |||
{ | |||
memcpy (&memory[cursor], buffer, numBytes); | |||
memcpy (&memory[cursor], buffer, static_cast<size_t> (numBytes)); | |||
// Update cursor | |||
cursor += numBytes; | |||
} | |||
@@ -187,7 +187,7 @@ tresult PLUGIN_API MemoryStream::tell (int64* pos) | |||
} | |||
//------------------------------------------------------------------------ | |||
TSize MemoryStream::getSize () | |||
TSize MemoryStream::getSize () const | |||
{ | |||
return size; | |||
} | |||
@@ -258,7 +258,7 @@ void MemoryStream::setSize (TSize s) | |||
} | |||
//------------------------------------------------------------------------ | |||
char* MemoryStream::getData () | |||
char* MemoryStream::getData () const | |||
{ | |||
return memory; | |||
} | |||
@@ -8,7 +8,7 @@ | |||
// | |||
//----------------------------------------------------------------------------- | |||
// LICENSE | |||
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved | |||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved | |||
//----------------------------------------------------------------------------- | |||
// Redistribution and use in source and binary forms, with or without modification, | |||
// are permitted provided that the following conditions are met: | |||
@@ -44,7 +44,6 @@ namespace Steinberg { | |||
/** Memory based Stream for IBStream implementation (using malloc). | |||
\ingroup sdkBase | |||
*/ | |||
//------------------------------------------------------------------------ | |||
class MemoryStream : public IBStream | |||
{ | |||
public: | |||
@@ -54,14 +53,14 @@ public: | |||
virtual ~MemoryStream (); | |||
//---IBStream--------------------------------------- | |||
virtual tresult PLUGIN_API read (void* buffer, int32 numBytes, int32* numBytesRead) SMTG_OVERRIDE; | |||
virtual tresult PLUGIN_API write (void* buffer, int32 numBytes, int32* numBytesWritten) SMTG_OVERRIDE; | |||
virtual tresult PLUGIN_API seek (int64 pos, int32 mode, int64* result) SMTG_OVERRIDE; | |||
virtual tresult PLUGIN_API tell (int64* pos) SMTG_OVERRIDE; | |||
tresult PLUGIN_API read (void* buffer, int32 numBytes, int32* numBytesRead) SMTG_OVERRIDE; | |||
tresult PLUGIN_API write (void* buffer, int32 numBytes, int32* numBytesWritten) SMTG_OVERRIDE; | |||
tresult PLUGIN_API seek (int64 pos, int32 mode, int64* result) SMTG_OVERRIDE; | |||
tresult PLUGIN_API tell (int64* pos) SMTG_OVERRIDE; | |||
TSize getSize (); ///< returns the current memory size | |||
TSize getSize () const; ///< returns the current memory size | |||
void setSize (TSize size); ///< set the memory size, a realloc will occur if memory already used | |||
char* getData (); ///< returns the memory pointer | |||
char* getData () const; ///< returns the memory pointer | |||
char* detachData (); ///< returns the memory pointer and give up ownership | |||
bool truncate (); ///< realloc to the current use memory size if needed | |||
bool truncateToCursor (); ///< truncate memory at current cursor position | |||
@@ -8,7 +8,7 @@ | |||
// | |||
//----------------------------------------------------------------------------- | |||
// LICENSE | |||
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved | |||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved | |||
//----------------------------------------------------------------------------- | |||
// Redistribution and use in source and binary forms, with or without modification, | |||
// are permitted provided that the following conditions are met: | |||
@@ -42,7 +42,7 @@ namespace Steinberg { | |||
// CPluginView implementation | |||
//------------------------------------------------------------------------ | |||
CPluginView::CPluginView (const ViewRect* _rect) | |||
: rect (0, 0, 0, 0), systemWindow (nullptr), plugFrame (nullptr) | |||
: rect (0, 0, 0, 0) | |||
{ | |||
if (_rect) | |||
rect = *_rect; | |||
@@ -8,7 +8,7 @@ | |||
// | |||
//----------------------------------------------------------------------------- | |||
// LICENSE | |||
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved | |||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved | |||
//----------------------------------------------------------------------------- | |||
// Redistribution and use in source and binary forms, with or without modification, | |||
// are permitted provided that the following conditions are met: | |||
@@ -44,10 +44,9 @@ namespace Steinberg { | |||
//------------------------------------------------------------------------ | |||
/** Plug-In view default implementation. | |||
\ingroup sdkBase | |||
Can be used as base class for an IPlugView implementation. */ | |||
//------------------------------------------------------------------------ | |||
class CPluginView: public FObject, | |||
public IPlugView | |||
Can be used as base class for an IPlugView implementation. | |||
*/ | |||
class CPluginView : public FObject, public IPlugView | |||
{ | |||
public: | |||
//------------------------------------------------------------------------ | |||
@@ -55,13 +54,13 @@ public: | |||
virtual ~CPluginView (); | |||
/** Returns its current frame rectangle. */ | |||
const ViewRect& getRect () const { return rect; } | |||
const ViewRect& getRect () const { return rect; } | |||
/** Sets a new frame rectangle. */ | |||
void setRect (const ViewRect& r) { rect = r; } | |||
void setRect (const ViewRect& r) { rect = r; } | |||
/** Checks if this view is attached to its parent view. */ | |||
bool isAttached () const { return systemWindow != nullptr; } | |||
bool isAttached () const { return systemWindow != nullptr; } | |||
/** Calls when this view will be attached to its parent view. */ | |||
virtual void attachedToParent () {} | |||
@@ -75,28 +74,42 @@ public: | |||
tresult PLUGIN_API removed () SMTG_OVERRIDE; | |||
tresult PLUGIN_API onWheel (float /*distance*/) SMTG_OVERRIDE { return kResultFalse; } | |||
tresult PLUGIN_API onKeyDown (char16 /*key*/, int16 /*keyMsg*/, int16 /*modifiers*/) SMTG_OVERRIDE { return kResultFalse; } | |||
tresult PLUGIN_API onKeyUp (char16 /*key*/, int16 /*keyMsg*/, int16 /*modifiers*/) SMTG_OVERRIDE { return kResultFalse; } | |||
tresult PLUGIN_API onKeyDown (char16 /*key*/, int16 /*keyMsg*/, | |||
int16 /*modifiers*/) SMTG_OVERRIDE | |||
{ | |||
return kResultFalse; | |||
} | |||
tresult PLUGIN_API onKeyUp (char16 /*key*/, int16 /*keyMsg*/, int16 /*modifiers*/) SMTG_OVERRIDE | |||
{ | |||
return kResultFalse; | |||
} | |||
tresult PLUGIN_API getSize (ViewRect* size) SMTG_OVERRIDE; | |||
tresult PLUGIN_API onSize (ViewRect* newSize) SMTG_OVERRIDE; | |||
tresult PLUGIN_API onFocus (TBool /*state*/) SMTG_OVERRIDE { return kResultFalse; } | |||
tresult PLUGIN_API setFrame (IPlugFrame* frame) SMTG_OVERRIDE { plugFrame = frame; return kResultTrue; } | |||
tresult PLUGIN_API setFrame (IPlugFrame* frame) SMTG_OVERRIDE | |||
{ | |||
plugFrame = frame; | |||
return kResultTrue; | |||
} | |||
tresult PLUGIN_API canResize () SMTG_OVERRIDE { return kResultFalse; } | |||
tresult PLUGIN_API checkSizeConstraint (ViewRect* /*rect*/) SMTG_OVERRIDE { return kResultFalse; } | |||
tresult PLUGIN_API checkSizeConstraint (ViewRect* /*rect*/) SMTG_OVERRIDE | |||
{ | |||
return kResultFalse; | |||
} | |||
//---Interface------ | |||
OBJ_METHODS (CPluginView, FObject) | |||
DEFINE_INTERFACES | |||
DEF_INTERFACE (IPlugView) | |||
END_DEFINE_INTERFACES (FObject) | |||
REFCOUNT_METHODS(FObject) | |||
REFCOUNT_METHODS (FObject) | |||
//------------------------------------------------------------------------ | |||
protected: | |||
ViewRect rect; | |||
void* systemWindow; | |||
IPlugFrame* plugFrame; | |||
void* systemWindow {nullptr}; | |||
IPlugFrame* plugFrame {nullptr}; | |||
}; | |||
} // namespace | |||
} // namespace |
@@ -8,7 +8,7 @@ | |||
// | |||
//----------------------------------------------------------------------------- | |||
// LICENSE | |||
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved | |||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved | |||
//----------------------------------------------------------------------------- | |||
// Redistribution and use in source and binary forms, with or without modification, | |||
// are permitted provided that the following conditions are met: | |||
@@ -164,15 +164,16 @@ public: | |||
HostAttribute (int64 value) : size (0), type (kInteger) { v.intValue = value; } | |||
HostAttribute (double value) : size (0), type (kFloat) { v.floatValue = value; } | |||
HostAttribute (const TChar* value, uint32 size) : size (size), type (kString) | |||
/** size is in code unit (count of TChar) */ | |||
HostAttribute (const TChar* value, uint32 sizeInCodeUnit) : size (sizeInCodeUnit), type (kString) | |||
{ | |||
v.stringValue = new TChar[size]; | |||
memcpy (v.stringValue, value, size * sizeof (TChar)); | |||
v.stringValue = new TChar[sizeInCodeUnit]; | |||
memcpy (v.stringValue, value, sizeInCodeUnit * sizeof (TChar)); | |||
} | |||
HostAttribute (const void* value, uint32 size) : size (size), type (kBinary) | |||
HostAttribute (const void* value, uint32 sizeInBytes) : size (sizeInBytes), type (kBinary) | |||
{ | |||
v.binaryValue = new char[size]; | |||
memcpy (v.binaryValue, value, size); | |||
v.binaryValue = new char[sizeInBytes]; | |||
memcpy (v.binaryValue, value, sizeInBytes); | |||
} | |||
~HostAttribute () | |||
{ | |||
@@ -182,14 +183,15 @@ public: | |||
int64 intValue () const { return v.intValue; } | |||
double floatValue () const { return v.floatValue; } | |||
const TChar* stringValue (uint32& stringSize) | |||
/** sizeInCodeUnit is in code unit (count of TChar) */ | |||
const TChar* stringValue (uint32& sizeInCodeUnit) | |||
{ | |||
stringSize = size; | |||
sizeInCodeUnit = size; | |||
return v.stringValue; | |||
} | |||
const void* binaryValue (uint32& binarySize) | |||
const void* binaryValue (uint32& sizeInBytes) | |||
{ | |||
binarySize = size; | |||
sizeInBytes = size; | |||
return v.binaryValue; | |||
} | |||
@@ -207,8 +209,6 @@ protected: | |||
Type type; | |||
}; | |||
using mapIterator = std::map<String, HostAttribute*>::iterator; | |||
//----------------------------------------------------------------------------- | |||
//----------------------------------------------------------------------------- | |||
//----------------------------------------------------------------------------- | |||
@@ -222,7 +222,7 @@ HostAttributeList::HostAttributeList () | |||
//----------------------------------------------------------------------------- | |||
HostAttributeList::~HostAttributeList () | |||
{ | |||
std::map<String, HostAttribute*>::reverse_iterator it = list.rbegin (); | |||
auto it = list.rbegin (); | |||
while (it != list.rend ()) | |||
{ | |||
delete it->second; | |||
@@ -234,7 +234,7 @@ HostAttributeList::~HostAttributeList () | |||
//----------------------------------------------------------------------------- | |||
void HostAttributeList::removeAttrID (AttrID aid) | |||
{ | |||
mapIterator it = list.find (aid); | |||
auto it = list.find (aid); | |||
if (it != list.end ()) | |||
{ | |||
delete it->second; | |||
@@ -253,7 +253,7 @@ tresult PLUGIN_API HostAttributeList::setInt (AttrID aid, int64 value) | |||
//----------------------------------------------------------------------------- | |||
tresult PLUGIN_API HostAttributeList::getInt (AttrID aid, int64& value) | |||
{ | |||
mapIterator it = list.find (aid); | |||
auto it = list.find (aid); | |||
if (it != list.end () && it->second) | |||
{ | |||
value = it->second->intValue (); | |||
@@ -273,7 +273,7 @@ tresult PLUGIN_API HostAttributeList::setFloat (AttrID aid, double value) | |||
//----------------------------------------------------------------------------- | |||
tresult PLUGIN_API HostAttributeList::getFloat (AttrID aid, double& value) | |||
{ | |||
mapIterator it = list.find (aid); | |||
auto it = list.find (aid); | |||
if (it != list.end () && it->second) | |||
{ | |||
value = it->second->floatValue (); | |||
@@ -286,42 +286,43 @@ tresult PLUGIN_API HostAttributeList::getFloat (AttrID aid, double& value) | |||
tresult PLUGIN_API HostAttributeList::setString (AttrID aid, const TChar* string) | |||
{ | |||
removeAttrID (aid); | |||
list[aid] = new HostAttribute (string, String (const_cast<TChar*> (string)).length ()); | |||
// + 1 for the null-terminate | |||
list[aid] = new HostAttribute (string, String (string).length () + 1); | |||
return kResultTrue; | |||
} | |||
//----------------------------------------------------------------------------- | |||
tresult PLUGIN_API HostAttributeList::getString (AttrID aid, TChar* string, uint32 size) | |||
tresult PLUGIN_API HostAttributeList::getString (AttrID aid, TChar* string, uint32 sizeInBytes) | |||
{ | |||
mapIterator it = list.find (aid); | |||
auto it = list.find (aid); | |||
if (it != list.end () && it->second) | |||
{ | |||
uint32 stringSize = 0; | |||
const TChar* _string = it->second->stringValue (stringSize); | |||
memcpy (string, _string, std::min<uint32> (stringSize, size) * sizeof (TChar)); | |||
uint32 sizeInCodeUnit = 0; | |||
const TChar* _string = it->second->stringValue (sizeInCodeUnit); | |||
memcpy (string, _string, std::min<uint32> (sizeInCodeUnit * sizeof (TChar), sizeInBytes)); | |||
return kResultTrue; | |||
} | |||
return kResultFalse; | |||
} | |||
//----------------------------------------------------------------------------- | |||
tresult PLUGIN_API HostAttributeList::setBinary (AttrID aid, const void* data, uint32 size) | |||
tresult PLUGIN_API HostAttributeList::setBinary (AttrID aid, const void* data, uint32 sizeInBytes) | |||
{ | |||
removeAttrID (aid); | |||
list[aid] = new HostAttribute (data, size); | |||
list[aid] = new HostAttribute (data, sizeInBytes); | |||
return kResultTrue; | |||
} | |||
//----------------------------------------------------------------------------- | |||
tresult PLUGIN_API HostAttributeList::getBinary (AttrID aid, const void*& data, uint32& size) | |||
tresult PLUGIN_API HostAttributeList::getBinary (AttrID aid, const void*& data, uint32& sizeInBytes) | |||
{ | |||
mapIterator it = list.find (aid); | |||
auto it = list.find (aid); | |||
if (it != list.end () && it->second) | |||
{ | |||
data = it->second->binaryValue (size); | |||
data = it->second->binaryValue (sizeInBytes); | |||
return kResultTrue; | |||
} | |||
size = 0; | |||
sizeInBytes = 0; | |||
return kResultFalse; | |||
} | |||
} | |||
@@ -8,7 +8,7 @@ | |||
// | |||
//----------------------------------------------------------------------------- | |||
// LICENSE | |||
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved | |||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved | |||
//----------------------------------------------------------------------------- | |||
// Redistribution and use in source and binary forms, with or without modification, | |||
// are permitted provided that the following conditions are met: | |||
@@ -82,9 +82,9 @@ public: | |||
tresult PLUGIN_API setFloat (AttrID aid, double value) SMTG_OVERRIDE; | |||
tresult PLUGIN_API 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 size) SMTG_OVERRIDE; | |||
tresult PLUGIN_API setBinary (AttrID aid, const void* data, uint32 size) SMTG_OVERRIDE; | |||
tresult PLUGIN_API getBinary (AttrID aid, const void*& data, uint32& size) SMTG_OVERRIDE; | |||
tresult PLUGIN_API getString (AttrID aid, TChar* string, uint32 sizeInBytes) SMTG_OVERRIDE; | |||
tresult PLUGIN_API setBinary (AttrID aid, const void* data, uint32 sizeInBytes) SMTG_OVERRIDE; | |||
tresult PLUGIN_API getBinary (AttrID aid, const void*& data, uint32& sizeInBytes) SMTG_OVERRIDE; | |||
DECLARE_FUNKNOWN_METHODS | |||
protected: | |||
@@ -8,7 +8,7 @@ | |||
// | |||
//----------------------------------------------------------------------------- | |||
// LICENSE | |||
// (c) 2018, Steinberg Media Technologies GmbH, All Rights Reserved | |||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved | |||
//----------------------------------------------------------------------------- | |||
// Redistribution and use in source and binary forms, with or without modification, | |||
// are permitted provided that the following conditions are met: | |||
@@ -91,6 +91,11 @@ PlugInterfaceSupport::PlugInterfaceSupport () | |||
//---VST 3.6.12-------------------------------- | |||
addPlugInterfaceSupported (IMidiLearn::iid); | |||
//---VST 3.7----------------------------------- | |||
addPlugInterfaceSupported (IProcessContextRequirements::iid); | |||
addPlugInterfaceSupported (IParameterFunctionName::iid); | |||
addPlugInterfaceSupported (IProgress::iid); | |||
*/ | |||
} | |||
@@ -8,7 +8,7 @@ | |||
// | |||
//----------------------------------------------------------------------------- | |||
// LICENSE | |||
// (c) 2018, Steinberg Media Technologies GmbH, All Rights Reserved | |||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved | |||
//----------------------------------------------------------------------------- | |||
// Redistribution and use in source and binary forms, with or without modification, | |||
// are permitted provided that the following conditions are met: | |||
@@ -8,7 +8,7 @@ | |||
// | |||
//----------------------------------------------------------------------------- | |||
// LICENSE | |||
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved | |||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved | |||
//----------------------------------------------------------------------------- | |||
// Redistribution and use in source and binary forms, with or without modification, | |||
// are permitted provided that the following conditions are met: | |||
@@ -8,7 +8,7 @@ | |||
// | |||
//----------------------------------------------------------------------------- | |||
// LICENSE | |||
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved | |||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved | |||
//----------------------------------------------------------------------------- | |||
// Redistribution and use in source and binary forms, with or without modification, | |||
// are permitted provided that the following conditions are met: | |||
@@ -49,8 +49,8 @@ namespace Vst { | |||
//------------------------------------------------------------------------ | |||
/** Basic Bus object. | |||
\ingroup vstClasses */ | |||
//------------------------------------------------------------------------ | |||
\ingroup vstClasses | |||
*/ | |||
class Bus: public FObject | |||
{ | |||
public: | |||
@@ -81,14 +81,14 @@ public: | |||
protected: | |||
String name; ///< name | |||
BusType busType; ///< kMain or kAux, see \ref BusTypes | |||
int32 flags; ///< flags, see \ref BusFlags | |||
int32 flags; ///< flags, see \ref BusInfo::BusFlags | |||
TBool active; ///< activation state | |||
}; | |||
//------------------------------------------------------------------------ | |||
/** Description of an Event Bus. | |||
\ingroup vstClasses */ | |||
//------------------------------------------------------------------------ | |||
\ingroup vstClasses | |||
*/ | |||
class EventBus: public Bus | |||
{ | |||
public: | |||
@@ -109,8 +109,8 @@ protected: | |||
//------------------------------------------------------------------------ | |||
/** Description of an Audio Bus. | |||
\ingroup vstClasses */ | |||
//------------------------------------------------------------------------ | |||
\ingroup vstClasses | |||
*/ | |||
class AudioBus: public Bus | |||
{ | |||
public: | |||
@@ -135,9 +135,9 @@ protected: | |||
}; | |||
//------------------------------------------------------------------------ | |||
/** List of Buses. | |||
\ingroup vstClasses */ | |||
//------------------------------------------------------------------------ | |||
/** List of Busses. | |||
\ingroup vstClasses | |||
*/ | |||
class BusList: public FObject, public std::vector<IPtr<Vst::Bus> > | |||
{ | |||
public: | |||
@@ -8,7 +8,7 @@ | |||
// | |||
//----------------------------------------------------------------------------- | |||
// LICENSE | |||
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved | |||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved | |||
//----------------------------------------------------------------------------- | |||
// Redistribution and use in source and binary forms, with or without modification, | |||
// are permitted provided that the following conditions are met: | |||
@@ -59,7 +59,7 @@ tresult PLUGIN_API Component::initialize (FUnknown* context) | |||
//------------------------------------------------------------------------ | |||
tresult PLUGIN_API Component::terminate () | |||
{ | |||
// remove all buses | |||
// remove all busses | |||
removeAllBusses (); | |||
return ComponentBase::terminate (); | |||
@@ -210,7 +210,7 @@ tresult Component::renameBus (MediaType type, BusDirection dir, int32 index, | |||
tresult getSpeakerChannelIndex (SpeakerArrangement arrangement, uint64 speaker, int32& channel) | |||
{ | |||
channel = SpeakerArr::getSpeakerIndex (speaker, arrangement); | |||
return channel < 0 ? kResultFalse : kResultTrue; | |||
return (channel < 0) == true ? kResultFalse : kResultTrue; | |||
} | |||
} // namespace Vst | |||
} // namespace Steinberg |
@@ -8,7 +8,7 @@ | |||
// | |||
//----------------------------------------------------------------------------- | |||
// LICENSE | |||
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved | |||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved | |||
//----------------------------------------------------------------------------- | |||
// Redistribution and use in source and binary forms, with or without modification, | |||
// are permitted provided that the following conditions are met: | |||
@@ -47,8 +47,8 @@ namespace Vst { | |||
//------------------------------------------------------------------------ | |||
/** Default implementation for a VST 3 Component. | |||
\ingroup vstClasses | |||
Can be used as base class for a VST 3 component implementation. */ | |||
//------------------------------------------------------------------------ | |||
Can be used as base class for a VST 3 component implementation. | |||
*/ | |||
class Component : public ComponentBase, public IComponent | |||
{ | |||
public: | |||
@@ -60,10 +60,10 @@ public: | |||
/** Sets the controller Class ID associated to its component. */ | |||
void setControllerClass (const FUID& cid) { controllerClass = cid; } | |||
/** Removes all Audio Buses. */ | |||
/** Removes all Audio Busses. */ | |||
tresult removeAudioBusses (); | |||
/** Removes all Event Buses. */ | |||
/** Removes all Event Busses. */ | |||
tresult removeEventBusses (); | |||
/** Renames a specific bus. Do not forget to inform the host about this (see \ref | |||
@@ -8,7 +8,7 @@ | |||
// | |||
//----------------------------------------------------------------------------- | |||
// LICENSE | |||
// (c) 2019, Steinberg Media Technologies GmbH, All Rights Reserved | |||
// (c) 2021, Steinberg Media Technologies GmbH, All Rights Reserved | |||
//----------------------------------------------------------------------------- | |||
// Redistribution and use in source and binary forms, with or without modification, | |||
// are permitted provided that the following conditions are met: | |||
@@ -43,7 +43,7 @@ namespace Vst { | |||
//------------------------------------------------------------------------ | |||
// ComponentBase Implementation | |||
//------------------------------------------------------------------------ | |||
ComponentBase::ComponentBase () : hostContext (nullptr), peerConnection (nullptr) | |||
ComponentBase::ComponentBase () | |||
{ | |||
} | |||
@@ -60,8 +60,6 @@ tresult PLUGIN_API ComponentBase::initialize (FUnknown* context) | |||
return kResultFalse; | |||
hostContext = context; | |||
if (hostContext) | |||
hostContext->addRef (); | |||
return kResultOk; | |||
} | |||
@@ -70,18 +68,13 @@ tresult PLUGIN_API ComponentBase::initialize (FUnknown* context) | |||
tresult PLUGIN_API ComponentBase::terminate () | |||
{ | |||
// release host interfaces | |||
if (hostContext) | |||
{ | |||
hostContext->release (); | |||
hostContext = nullptr; | |||
} | |||
hostContext = nullptr; | |||
// in case host did not disconnect us, | |||
// release peer now | |||
if (peerConnection) | |||
{ | |||
peerConnection->disconnect (this); | |||
peerConnection->release (); | |||
peerConnection = nullptr; | |||
} | |||
@@ -99,7 +92,6 @@ tresult PLUGIN_API ComponentBase::connect (IConnectionPoint* other) | |||
return kResultFalse; | |||
peerConnection = other; | |||
peerConnection->addRef (); | |||
return kResultOk; | |||
} | |||
@@ -108,7 +100,6 @@ tresult PLUGIN_API ComponentBase::disconnect (IConnectionPoint* other) | |||
{ | |||
if (peerConnection && other == peerConnection) | |||
{ | |||
peerConnection->release (); | |||
peerConnection = nullptr; | |||
return kResultOk; | |||
} | |||
@@ -121,11 +112,10 @@ tresult PLUGIN_API ComponentBase::notify (IMessage* message) | |||
if (!message) | |||
return kInvalidArgument; | |||
if (!strcmp (message->getMessageID (), "TextMessage")) | |||
if (FIDStringsEqual (message->getMessageID (), "TextMessage")) | |||
{ | |||
TChar string[256] = {0}; | |||
if (message->getAttributes ()->getString ("Text", string, | |||
sizeof (string) / sizeof (char16)) == kResultOk) | |||
if (message->getAttributes ()->getString ("Text", string, sizeof (string)) == kResultOk) | |||
{ | |||
String tmp (string); | |||
tmp.toMultiByte (kCP_Utf8); | |||
@@ -137,7 +127,7 @@ tresult PLUGIN_API ComponentBase::notify (IMessage* message) | |||
} | |||
//------------------------------------------------------------------------ | |||
IMessage* ComponentBase::allocateMessage () | |||
IMessage* ComponentBase::allocateMessage () const | |||
{ | |||
FUnknownPtr<IHostApplication> hostApp (hostContext); | |||
if (hostApp) | |||
@@ -146,7 +136,7 @@ IMessage* ComponentBase::allocateMessage () | |||
} | |||
//------------------------------------------------------------------------ | |||
tresult ComponentBase::sendMessage (IMessage* message) | |||
tresult ComponentBase::sendMessage (IMessage* message) const | |||
{ | |||
if (message != nullptr && getPeer () != nullptr) | |||
return getPeer ()->notify (message); | |||
@@ -154,19 +144,29 @@ tresult ComponentBase::sendMessage (IMessage* message) | |||
} | |||
//------------------------------------------------------------------------ | |||
tresult ComponentBase::sendTextMessage (const char8* text) | |||
tresult ComponentBase::sendTextMessage (const char8* text) const | |||
{ | |||
IMessage* message = allocateMessage (); | |||
if (!message) | |||
return kResultFalse; | |||
if (auto msg = owned (allocateMessage ())) | |||
{ | |||
msg->setMessageID ("TextMessage"); | |||
String tmp (text, kCP_Utf8); | |||
if (tmp.length () >= 256) | |||
tmp.remove (255); | |||
msg->getAttributes ()->setString ("Text", tmp.text16 ()); | |||
return sendMessage (msg); | |||
} | |||
return kResultFalse; | |||
} | |||
FReleaser msgReleaser (message); | |||
message->setMessageID ("TextMessage"); | |||
String tmp (text, kCP_Utf8); | |||
if (tmp.length () >= 256) | |||
tmp.remove (255); | |||
message->getAttributes ()->setString ("Text", tmp.text16 ()); | |||
return sendMessage (message); | |||
//------------------------------------------------------------------------ | |||
tresult ComponentBase::sendMessageID (const char* messageID) const | |||
{ | |||
if (auto msg = owned (allocateMessage ())) | |||
{ | |||
msg->setMessageID (messageID); | |||
return sendMessage (msg); | |||
} | |||
return kResultFalse; | |||
} | |||
//------------------------------------------------------------------------ | |||