From 8428bbe8265d4b33ee5eab3c04d024e8c4a85ef2 Mon Sep 17 00:00:00 2001 From: juan Date: Sat, 19 Mar 2016 17:47:52 +0100 Subject: [PATCH] deleted the vst sdk from the repository --- vst/pluginterfaces/base/conststringtable.cpp | 123 - vst/pluginterfaces/base/conststringtable.h | 62 - vst/pluginterfaces/base/falignpop.h | 46 - vst/pluginterfaces/base/falignpush.h | 51 - vst/pluginterfaces/base/fplatform.h | 135 - vst/pluginterfaces/base/fstrdefs.h | 314 -- vst/pluginterfaces/base/ftypes.h | 204 -- vst/pluginterfaces/base/funknown.cpp | 472 --- vst/pluginterfaces/base/funknown.h | 468 --- vst/pluginterfaces/base/futils.h | 97 - vst/pluginterfaces/base/fvariant.h | 221 -- vst/pluginterfaces/base/geoconstants.h | 113 - vst/pluginterfaces/base/ibstream.h | 110 - vst/pluginterfaces/base/icloneable.h | 62 - vst/pluginterfaces/base/ierrorcontext.h | 65 - vst/pluginterfaces/base/ipersistent.h | 180 - vst/pluginterfaces/base/ipluginbase.h | 417 --- vst/pluginterfaces/base/istringresult.h | 98 - vst/pluginterfaces/base/iupdatehandler.h | 119 - vst/pluginterfaces/base/keycodes.h | 166 - vst/pluginterfaces/base/pluginbasefwd.h | 50 - vst/pluginterfaces/base/smartpointer.h | 235 -- vst/pluginterfaces/base/ustring.cpp | 216 -- vst/pluginterfaces/base/ustring.h | 130 - vst/pluginterfaces/gui/iplugview.h | 200 -- vst/pluginterfaces/test/itest.h | 171 - vst/pluginterfaces/vst/ivstattributes.h | 163 - vst/pluginterfaces/vst/ivstaudioprocessor.h | 360 -- vst/pluginterfaces/vst/ivstautomationstate.h | 84 - .../vst/ivstchannelcontextinfo.h | 243 -- vst/pluginterfaces/vst/ivstcomponent.h | 211 -- vst/pluginterfaces/vst/ivstcontextmenu.h | 230 -- vst/pluginterfaces/vst/ivsteditcontroller.h | 416 --- vst/pluginterfaces/vst/ivstevents.h | 197 -- vst/pluginterfaces/vst/ivsthostapplication.h | 115 - vst/pluginterfaces/vst/ivstinterappaudio.h | 161 - vst/pluginterfaces/vst/ivstmessage.h | 112 - vst/pluginterfaces/vst/ivstmidicontrollers.h | 130 - vst/pluginterfaces/vst/ivstnoteexpression.h | 266 -- vst/pluginterfaces/vst/ivstparameterchanges.h | 158 - vst/pluginterfaces/vst/ivstplugview.h | 79 - .../vst/ivstprefetchablesupport.h | 101 - vst/pluginterfaces/vst/ivstprocesscontext.h | 160 - vst/pluginterfaces/vst/ivstrepresentation.h | 390 --- vst/pluginterfaces/vst/ivstunits.h | 282 -- vst/pluginterfaces/vst/vstpresetkeys.h | 447 --- vst/pluginterfaces/vst/vstpshpack4.h | 48 - vst/pluginterfaces/vst/vsttypes.h | 751 ---- vst/pluginterfaces/vst2.x/aeffect.h | 392 --- vst/pluginterfaces/vst2.x/aeffectx.h | 1170 ------- vst/pluginterfaces/vst2.x/vstfxstore.h | 128 - vst/public.sdk/source/common/memorystream.cpp | 316 -- vst/public.sdk/source/common/memorystream.h | 77 - vst/public.sdk/source/common/pluginview.cpp | 114 - vst/public.sdk/source/common/pluginview.h | 99 - vst/public.sdk/source/main/dllmain.cpp | 101 - vst/public.sdk/source/main/macexport.exp | 3 - vst/public.sdk/source/main/macmain.cpp | 110 - .../source/main/pluginfactoryvst3.cpp | 274 -- .../source/main/pluginfactoryvst3.h | 173 - .../source/vst/auwrapper/NSDataIBStream.h | 90 - .../source/vst/auwrapper/NSDataIBStream.mm | 204 -- .../source/vst/auwrapper/again/Info.plist | 115 - .../again/again.xcodeproj/project.pbxproj | 363 -- .../vst/auwrapper/again/audiounitconfig.h | 59 - .../vst/auwrapper/again/config/again.xcconfig | 49 - .../again/config/again_debug.xcconfig | 36 - .../again/config/again_release.xcconfig | 36 - .../source/vst/auwrapper/again/doc.cpp | 47 - .../source/vst/auwrapper/aucarbonview.h | 81 - .../source/vst/auwrapper/aucarbonview.mm | 165 - .../source/vst/auwrapper/aucocoaview.h | 66 - .../source/vst/auwrapper/aucocoaview.mm | 229 -- .../source/vst/auwrapper/auresource.r | 83 - vst/public.sdk/source/vst/auwrapper/ausdk.mm | 80 - .../source/vst/auwrapper/auwrapper.h | 330 -- .../source/vst/auwrapper/auwrapper.mm | 2477 ------------- .../auwrapper.xcodeproj/project.pbxproj | 645 ---- .../source/vst/auwrapper/auwrapper_prefix.pch | 36 - .../vst/auwrapper/config/ausdkpath.xcconfig | 36 - .../vst/auwrapper/config/auwrapper.xcconfig | 42 - .../auwrapper/config/auwrapper_debug.xcconfig | 38 - .../config/auwrapper_release.xcconfig | 38 - .../auwrapper/generateCocoaClassNamePrefix.rb | 14 - .../source/vst/hosting/eventlist.cpp | 106 - vst/public.sdk/source/vst/hosting/eventlist.h | 71 - .../source/vst/hosting/hostclasses.cpp | 294 -- .../source/vst/hosting/hostclasses.h | 110 - .../source/vst/hosting/parameterchanges.cpp | 322 -- .../source/vst/hosting/parameterchanges.h | 138 - .../source/vst/hosting/processdata.cpp | 219 -- .../source/vst/hosting/processdata.h | 185 - .../source/vst/interappaudio/AudioIO.h | 149 - .../source/vst/interappaudio/AudioIO.mm | 558 --- .../source/vst/interappaudio/HostApp.h | 91 - .../source/vst/interappaudio/HostApp.mm | 164 - .../source/vst/interappaudio/MidiIO.h | 90 - .../source/vst/interappaudio/MidiIO.mm | 221 -- .../vst/interappaudio/PresetBrowserView.xib | 73 - .../PresetBrowserViewController.h | 57 - .../PresetBrowserViewController.mm | 270 -- .../source/vst/interappaudio/PresetManager.h | 90 - .../source/vst/interappaudio/PresetManager.mm | 279 -- .../vst/interappaudio/PresetSaveView.xib | 67 - .../interappaudio/PresetSaveViewController.h | 52 - .../interappaudio/PresetSaveViewController.mm | 169 - .../source/vst/interappaudio/SettingsView.xib | 77 - .../interappaudio/SettingsViewController.h | 47 - .../interappaudio/SettingsViewController.mm | 142 - .../source/vst/interappaudio/VST3Editor.h | 80 - .../source/vst/interappaudio/VST3Editor.mm | 118 - .../source/vst/interappaudio/VST3Plugin.h | 141 - .../source/vst/interappaudio/VST3Plugin.mm | 606 ---- .../VSTInterAppAudioAppDelegateBase.h | 55 - .../VSTInterAppAudioAppDelegateBase.mm | 209 -- .../source/vst/testsuite/vsttestsuite.cpp | 2803 --------------- .../source/vst/testsuite/vsttestsuite.h | 718 ---- .../source/vst/vst2wrapper/vst2wrapper.cpp | 3084 ----------------- .../source/vst/vst2wrapper/vst2wrapper.h | 310 -- .../vst/vst2wrapper/vst2wrapper.sdk.cpp | 45 - .../vst/vst2wrapper/win/vst2wrapper.vcxproj | 171 - .../vst2wrapper/win/vst2wrapper_vc10.vcxproj | 168 - .../vst2wrapper/win/vst2wrapper_vc8.vcproj | 382 -- .../vst2wrapper/win/vst2wrapper_vc9.vcproj | 385 -- vst/public.sdk/source/vst/vstaudioeffect.cpp | 180 - vst/public.sdk/source/vst/vstaudioeffect.h | 112 - vst/public.sdk/source/vst/vstbus.cpp | 102 - vst/public.sdk/source/vst/vstbus.h | 161 - vst/public.sdk/source/vst/vstcomponent.cpp | 202 -- vst/public.sdk/source/vst/vstcomponent.h | 116 - .../source/vst/vstcomponentbase.cpp | 176 - vst/public.sdk/source/vst/vstcomponentbase.h | 103 - .../source/vst/vsteditcontroller.cpp | 702 ---- vst/public.sdk/source/vst/vsteditcontroller.h | 333 -- vst/public.sdk/source/vst/vstguieditor.cpp | 358 -- vst/public.sdk/source/vst/vstguieditor.h | 108 - vst/public.sdk/source/vst/vstinitiids.cpp | 114 - .../source/vst/vstnoteexpressiontypes.cpp | 267 -- .../source/vst/vstnoteexpressiontypes.h | 146 - vst/public.sdk/source/vst/vstparameters.cpp | 451 --- vst/public.sdk/source/vst/vstparameters.h | 226 -- vst/public.sdk/source/vst/vstpresetfile.cpp | 887 ----- vst/public.sdk/source/vst/vstpresetfile.h | 303 -- .../source/vst/vstrepresentation.cpp | 410 --- vst/public.sdk/source/vst/vstrepresentation.h | 166 - .../source/vst/vstsinglecomponenteffect.cpp | 260 -- .../source/vst/vstsinglecomponenteffect.h | 141 - vst/public.sdk/source/vst2.x/aeffeditor.h | 80 - vst/public.sdk/source/vst2.x/audioeffect.cpp | 725 ---- vst/public.sdk/source/vst2.x/audioeffect.h | 196 -- vst/public.sdk/source/vst2.x/audioeffectx.cpp | 1567 --------- vst/public.sdk/source/vst2.x/audioeffectx.h | 270 -- vst/public.sdk/source/vst2.x/vstplugmain.cpp | 90 - vst/public.sdk/source/vst3stdsdk.cpp | 40 - 154 files changed, 40253 deletions(-) delete mode 100644 vst/pluginterfaces/base/conststringtable.cpp delete mode 100644 vst/pluginterfaces/base/conststringtable.h delete mode 100644 vst/pluginterfaces/base/falignpop.h delete mode 100644 vst/pluginterfaces/base/falignpush.h delete mode 100644 vst/pluginterfaces/base/fplatform.h delete mode 100644 vst/pluginterfaces/base/fstrdefs.h delete mode 100644 vst/pluginterfaces/base/ftypes.h delete mode 100644 vst/pluginterfaces/base/funknown.cpp delete mode 100644 vst/pluginterfaces/base/funknown.h delete mode 100644 vst/pluginterfaces/base/futils.h delete mode 100644 vst/pluginterfaces/base/fvariant.h delete mode 100644 vst/pluginterfaces/base/geoconstants.h delete mode 100644 vst/pluginterfaces/base/ibstream.h delete mode 100644 vst/pluginterfaces/base/icloneable.h delete mode 100644 vst/pluginterfaces/base/ierrorcontext.h delete mode 100644 vst/pluginterfaces/base/ipersistent.h delete mode 100644 vst/pluginterfaces/base/ipluginbase.h delete mode 100644 vst/pluginterfaces/base/istringresult.h delete mode 100644 vst/pluginterfaces/base/iupdatehandler.h delete mode 100644 vst/pluginterfaces/base/keycodes.h delete mode 100644 vst/pluginterfaces/base/pluginbasefwd.h delete mode 100644 vst/pluginterfaces/base/smartpointer.h delete mode 100644 vst/pluginterfaces/base/ustring.cpp delete mode 100644 vst/pluginterfaces/base/ustring.h delete mode 100644 vst/pluginterfaces/gui/iplugview.h delete mode 100644 vst/pluginterfaces/test/itest.h delete mode 100644 vst/pluginterfaces/vst/ivstattributes.h delete mode 100644 vst/pluginterfaces/vst/ivstaudioprocessor.h delete mode 100644 vst/pluginterfaces/vst/ivstautomationstate.h delete mode 100644 vst/pluginterfaces/vst/ivstchannelcontextinfo.h delete mode 100644 vst/pluginterfaces/vst/ivstcomponent.h delete mode 100644 vst/pluginterfaces/vst/ivstcontextmenu.h delete mode 100644 vst/pluginterfaces/vst/ivsteditcontroller.h delete mode 100644 vst/pluginterfaces/vst/ivstevents.h delete mode 100644 vst/pluginterfaces/vst/ivsthostapplication.h delete mode 100644 vst/pluginterfaces/vst/ivstinterappaudio.h delete mode 100644 vst/pluginterfaces/vst/ivstmessage.h delete mode 100644 vst/pluginterfaces/vst/ivstmidicontrollers.h delete mode 100644 vst/pluginterfaces/vst/ivstnoteexpression.h delete mode 100644 vst/pluginterfaces/vst/ivstparameterchanges.h delete mode 100644 vst/pluginterfaces/vst/ivstplugview.h delete mode 100644 vst/pluginterfaces/vst/ivstprefetchablesupport.h delete mode 100644 vst/pluginterfaces/vst/ivstprocesscontext.h delete mode 100644 vst/pluginterfaces/vst/ivstrepresentation.h delete mode 100644 vst/pluginterfaces/vst/ivstunits.h delete mode 100644 vst/pluginterfaces/vst/vstpresetkeys.h delete mode 100644 vst/pluginterfaces/vst/vstpshpack4.h delete mode 100644 vst/pluginterfaces/vst/vsttypes.h delete mode 100644 vst/pluginterfaces/vst2.x/aeffect.h delete mode 100644 vst/pluginterfaces/vst2.x/aeffectx.h delete mode 100644 vst/pluginterfaces/vst2.x/vstfxstore.h delete mode 100644 vst/public.sdk/source/common/memorystream.cpp delete mode 100644 vst/public.sdk/source/common/memorystream.h delete mode 100644 vst/public.sdk/source/common/pluginview.cpp delete mode 100644 vst/public.sdk/source/common/pluginview.h delete mode 100644 vst/public.sdk/source/main/dllmain.cpp delete mode 100644 vst/public.sdk/source/main/macexport.exp delete mode 100644 vst/public.sdk/source/main/macmain.cpp delete mode 100644 vst/public.sdk/source/main/pluginfactoryvst3.cpp delete mode 100644 vst/public.sdk/source/main/pluginfactoryvst3.h delete mode 100644 vst/public.sdk/source/vst/auwrapper/NSDataIBStream.h delete mode 100644 vst/public.sdk/source/vst/auwrapper/NSDataIBStream.mm delete mode 100644 vst/public.sdk/source/vst/auwrapper/again/Info.plist delete mode 100644 vst/public.sdk/source/vst/auwrapper/again/again.xcodeproj/project.pbxproj delete mode 100644 vst/public.sdk/source/vst/auwrapper/again/audiounitconfig.h delete mode 100644 vst/public.sdk/source/vst/auwrapper/again/config/again.xcconfig delete mode 100644 vst/public.sdk/source/vst/auwrapper/again/config/again_debug.xcconfig delete mode 100644 vst/public.sdk/source/vst/auwrapper/again/config/again_release.xcconfig delete mode 100644 vst/public.sdk/source/vst/auwrapper/again/doc.cpp delete mode 100644 vst/public.sdk/source/vst/auwrapper/aucarbonview.h delete mode 100644 vst/public.sdk/source/vst/auwrapper/aucarbonview.mm delete mode 100644 vst/public.sdk/source/vst/auwrapper/aucocoaview.h delete mode 100644 vst/public.sdk/source/vst/auwrapper/aucocoaview.mm delete mode 100644 vst/public.sdk/source/vst/auwrapper/auresource.r delete mode 100644 vst/public.sdk/source/vst/auwrapper/ausdk.mm delete mode 100644 vst/public.sdk/source/vst/auwrapper/auwrapper.h delete mode 100644 vst/public.sdk/source/vst/auwrapper/auwrapper.mm delete mode 100644 vst/public.sdk/source/vst/auwrapper/auwrapper.xcodeproj/project.pbxproj delete mode 100644 vst/public.sdk/source/vst/auwrapper/auwrapper_prefix.pch delete mode 100644 vst/public.sdk/source/vst/auwrapper/config/ausdkpath.xcconfig delete mode 100644 vst/public.sdk/source/vst/auwrapper/config/auwrapper.xcconfig delete mode 100644 vst/public.sdk/source/vst/auwrapper/config/auwrapper_debug.xcconfig delete mode 100644 vst/public.sdk/source/vst/auwrapper/config/auwrapper_release.xcconfig delete mode 100644 vst/public.sdk/source/vst/auwrapper/generateCocoaClassNamePrefix.rb delete mode 100644 vst/public.sdk/source/vst/hosting/eventlist.cpp delete mode 100644 vst/public.sdk/source/vst/hosting/eventlist.h delete mode 100644 vst/public.sdk/source/vst/hosting/hostclasses.cpp delete mode 100644 vst/public.sdk/source/vst/hosting/hostclasses.h delete mode 100644 vst/public.sdk/source/vst/hosting/parameterchanges.cpp delete mode 100644 vst/public.sdk/source/vst/hosting/parameterchanges.h delete mode 100644 vst/public.sdk/source/vst/hosting/processdata.cpp delete mode 100644 vst/public.sdk/source/vst/hosting/processdata.h delete mode 100644 vst/public.sdk/source/vst/interappaudio/AudioIO.h delete mode 100644 vst/public.sdk/source/vst/interappaudio/AudioIO.mm delete mode 100644 vst/public.sdk/source/vst/interappaudio/HostApp.h delete mode 100644 vst/public.sdk/source/vst/interappaudio/HostApp.mm delete mode 100644 vst/public.sdk/source/vst/interappaudio/MidiIO.h delete mode 100644 vst/public.sdk/source/vst/interappaudio/MidiIO.mm delete mode 100644 vst/public.sdk/source/vst/interappaudio/PresetBrowserView.xib delete mode 100644 vst/public.sdk/source/vst/interappaudio/PresetBrowserViewController.h delete mode 100644 vst/public.sdk/source/vst/interappaudio/PresetBrowserViewController.mm delete mode 100644 vst/public.sdk/source/vst/interappaudio/PresetManager.h delete mode 100644 vst/public.sdk/source/vst/interappaudio/PresetManager.mm delete mode 100644 vst/public.sdk/source/vst/interappaudio/PresetSaveView.xib delete mode 100644 vst/public.sdk/source/vst/interappaudio/PresetSaveViewController.h delete mode 100644 vst/public.sdk/source/vst/interappaudio/PresetSaveViewController.mm delete mode 100644 vst/public.sdk/source/vst/interappaudio/SettingsView.xib delete mode 100644 vst/public.sdk/source/vst/interappaudio/SettingsViewController.h delete mode 100644 vst/public.sdk/source/vst/interappaudio/SettingsViewController.mm delete mode 100644 vst/public.sdk/source/vst/interappaudio/VST3Editor.h delete mode 100644 vst/public.sdk/source/vst/interappaudio/VST3Editor.mm delete mode 100644 vst/public.sdk/source/vst/interappaudio/VST3Plugin.h delete mode 100644 vst/public.sdk/source/vst/interappaudio/VST3Plugin.mm delete mode 100644 vst/public.sdk/source/vst/interappaudio/VSTInterAppAudioAppDelegateBase.h delete mode 100644 vst/public.sdk/source/vst/interappaudio/VSTInterAppAudioAppDelegateBase.mm delete mode 100644 vst/public.sdk/source/vst/testsuite/vsttestsuite.cpp delete mode 100644 vst/public.sdk/source/vst/testsuite/vsttestsuite.h delete mode 100644 vst/public.sdk/source/vst/vst2wrapper/vst2wrapper.cpp delete mode 100644 vst/public.sdk/source/vst/vst2wrapper/vst2wrapper.h delete mode 100644 vst/public.sdk/source/vst/vst2wrapper/vst2wrapper.sdk.cpp delete mode 100644 vst/public.sdk/source/vst/vst2wrapper/win/vst2wrapper.vcxproj delete mode 100644 vst/public.sdk/source/vst/vst2wrapper/win/vst2wrapper_vc10.vcxproj delete mode 100644 vst/public.sdk/source/vst/vst2wrapper/win/vst2wrapper_vc8.vcproj delete mode 100644 vst/public.sdk/source/vst/vst2wrapper/win/vst2wrapper_vc9.vcproj delete mode 100644 vst/public.sdk/source/vst/vstaudioeffect.cpp delete mode 100644 vst/public.sdk/source/vst/vstaudioeffect.h delete mode 100644 vst/public.sdk/source/vst/vstbus.cpp delete mode 100644 vst/public.sdk/source/vst/vstbus.h delete mode 100644 vst/public.sdk/source/vst/vstcomponent.cpp delete mode 100644 vst/public.sdk/source/vst/vstcomponent.h delete mode 100644 vst/public.sdk/source/vst/vstcomponentbase.cpp delete mode 100644 vst/public.sdk/source/vst/vstcomponentbase.h delete mode 100644 vst/public.sdk/source/vst/vsteditcontroller.cpp delete mode 100644 vst/public.sdk/source/vst/vsteditcontroller.h delete mode 100644 vst/public.sdk/source/vst/vstguieditor.cpp delete mode 100644 vst/public.sdk/source/vst/vstguieditor.h delete mode 100644 vst/public.sdk/source/vst/vstinitiids.cpp delete mode 100644 vst/public.sdk/source/vst/vstnoteexpressiontypes.cpp delete mode 100644 vst/public.sdk/source/vst/vstnoteexpressiontypes.h delete mode 100644 vst/public.sdk/source/vst/vstparameters.cpp delete mode 100644 vst/public.sdk/source/vst/vstparameters.h delete mode 100644 vst/public.sdk/source/vst/vstpresetfile.cpp delete mode 100644 vst/public.sdk/source/vst/vstpresetfile.h delete mode 100644 vst/public.sdk/source/vst/vstrepresentation.cpp delete mode 100644 vst/public.sdk/source/vst/vstrepresentation.h delete mode 100644 vst/public.sdk/source/vst/vstsinglecomponenteffect.cpp delete mode 100644 vst/public.sdk/source/vst/vstsinglecomponenteffect.h delete mode 100644 vst/public.sdk/source/vst2.x/aeffeditor.h delete mode 100644 vst/public.sdk/source/vst2.x/audioeffect.cpp delete mode 100644 vst/public.sdk/source/vst2.x/audioeffect.h delete mode 100644 vst/public.sdk/source/vst2.x/audioeffectx.cpp delete mode 100644 vst/public.sdk/source/vst2.x/audioeffectx.h delete mode 100644 vst/public.sdk/source/vst2.x/vstplugmain.cpp delete mode 100644 vst/public.sdk/source/vst3stdsdk.cpp diff --git a/vst/pluginterfaces/base/conststringtable.cpp b/vst/pluginterfaces/base/conststringtable.cpp deleted file mode 100644 index cb5ff65c..00000000 --- a/vst/pluginterfaces/base/conststringtable.cpp +++ /dev/null @@ -1,123 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : SDK Core -// -// Category : SDK Core Interfaces -// Filename : pluginterfaces/base/conststringtable.cpp -// Created by : Steinberg, 09/2007 -// Description : constant unicode string table -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//------------------------------------------------------------------------------ - -#include "conststringtable.h" -#include -#include - -namespace Steinberg -{ - -static std::map* stringMap; -static std::map* charMap; - -static char16* generateUTF16 (const char8* str); - -//---------------------------------------------------------------------------- -ConstStringTable* ConstStringTable::instance () -{ - static ConstStringTable stringTable; - return &stringTable; -} - -//---------------------------------------------------------------------------- -const char16* ConstStringTable::getString (const char8* str) const -{ - std::map::iterator iter = stringMap->find (str); - if (iter != stringMap->end ()) - return iter->second; - char16* uStr = generateUTF16 (str); - stringMap->insert (std::make_pair (str, uStr)); - return uStr; -} - -//---------------------------------------------------------------------------- -const char16 ConstStringTable::getString (const char8 str) const -{ - std::map::iterator iter = charMap->find (str); - if (iter != charMap->end ()) - return iter->second; - char16 uStr = 0; -#if BYTEORDER == kBigEndian - char8* puStr = (char8*)&uStr; - puStr[1] = str; -#else - uStr = str; -#endif - charMap->insert (std::make_pair (str, uStr)); - return uStr; -} - -//---------------------------------------------------------------------------- -ConstStringTable::ConstStringTable () -{ - stringMap = new std::map; - charMap = new std::map; -} - -//---------------------------------------------------------------------------- -ConstStringTable::~ConstStringTable () -{ - // free out allocated strings - { - std::map::iterator iter = stringMap->begin (); - while (iter != stringMap->end ()) - { - delete [] iter->second; - iter++; - } - } // delete iterator on map before deleting the map - - delete stringMap; - delete charMap; -} - -//---------------------------------------------------------------------------- -char16* generateUTF16 (const char8* str) -{ - int32 len = (int32)strlen (str); - char16* result = new char16[len+1]; - for (int32 i = 0; i < len; i++) - { - #if BYTEORDER == kBigEndian - char8* pChr = (char8*)&result[i]; - pChr[0] = 0; - pChr[1] = str[i]; - #else - result[i] = str[i]; - #endif - } - result[len] = 0; - return result; -} -} // namespace Steinberg diff --git a/vst/pluginterfaces/base/conststringtable.h b/vst/pluginterfaces/base/conststringtable.h deleted file mode 100644 index 51af81c8..00000000 --- a/vst/pluginterfaces/base/conststringtable.h +++ /dev/null @@ -1,62 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : SDK Core -// -// Category : SDK Core Interfaces -// Filename : pluginterfaces/base/conststringtable.h -// Created by : Steinberg, 09/2007 -// Description : constant unicode string table -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//------------------------------------------------------------------------------ - -#ifndef __conststringtable__ -#define __conststringtable__ - -#include "ftypes.h" - -namespace Steinberg { - -//------------------------------------------------------------------------ -/** Constant unicode string table. -Used for conversion from ASCII string literals to char16. -*/ -//------------------------------------------------------------------------ -class ConstStringTable -{ -public: - static ConstStringTable* instance (); - - /** Returns a char16 string of a ASCII string literal*/ - const char16* getString (const char8* str) const; - /** Returns a char16 character of a ASCII character */ - const char16 getString (const char8 str) const; - -protected: - ConstStringTable (); - ~ConstStringTable (); -}; -} // namespace - -#endif // __conststringtable__ diff --git a/vst/pluginterfaces/base/falignpop.h b/vst/pluginterfaces/base/falignpop.h deleted file mode 100644 index 1c611186..00000000 --- a/vst/pluginterfaces/base/falignpop.h +++ /dev/null @@ -1,46 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : SDK Core -// -// Category : SDK Core Interfaces -// Filename : pluginterfaces/base/falignpop.h -// Created by : Steinberg, 01/2004 -// Description : Restore alignment settings -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//------------------------------------------------------------------------------ - -//--------------------------------------------------------------------------------------------------- -#if TARGET_API_MAC_CARBON - #if PLATFORM_64 - #pragma pack(pop) - #else - #pragma options align=reset - #endif -#elif defined __BORLANDC__ - #pragma -a- -#elif WINDOWS - #pragma pack(pop) -#endif -//--------------------------------------------------------------------------------------------------- diff --git a/vst/pluginterfaces/base/falignpush.h b/vst/pluginterfaces/base/falignpush.h deleted file mode 100644 index c2fc2773..00000000 --- a/vst/pluginterfaces/base/falignpush.h +++ /dev/null @@ -1,51 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : SDK Core -// -// Category : SDK Core Interfaces -// Filename : pluginterfaces/base/falignpush.h -// Created by : Steinberg, 01/2004 -// Description : Set alignment settings -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//------------------------------------------------------------------------------ - -//---------------------------------------------------------------------------------------------- -#if TARGET_API_MAC_CARBON - #if PLATFORM_64 - #pragma pack(push, 16) - #else - #pragma options align=mac68k - #endif -#elif defined __BORLANDC__ - #pragma -a8 -#elif WINDOWS - #pragma pack(push) - #if PLATFORM_64 - #pragma pack(16) - #else - #pragma pack(8) - #endif -#endif -//---------------------------------------------------------------------------------------------- diff --git a/vst/pluginterfaces/base/fplatform.h b/vst/pluginterfaces/base/fplatform.h deleted file mode 100644 index 2941f99a..00000000 --- a/vst/pluginterfaces/base/fplatform.h +++ /dev/null @@ -1,135 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : SDK Core -// -// Category : SDK Core Interfaces -// Filename : pluginterfaces/base/fplatform.h -// Created by : Steinberg, 01/2004 -// Description : Detect platform and set define -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//------------------------------------------------------------------------------ - -#ifndef __fplatform__ -#define __fplatform__ - -#define kLittleEndian 0 -#define kBigEndian 1 - -#undef PLUGIN_API - -#undef WINDOWS -#undef MAC - -#if defined (_WIN32) // WIN32 AND WIN64 - #define WINDOWS 1 - #define BYTEORDER kLittleEndian - #define COM_COMPATIBLE 1 - #define PLUGIN_API __stdcall - - #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 - - #pragma warning (3 : 4189) // local variable is initialized but not referenced - #pragma warning (3 : 4238) // nonstandard extension used : class rvalue used as lvalue - - #if defined (_WIN64) // WIN64 only - #define PLATFORM_64 1 - #endif - #ifndef WIN32 - #define WIN32 1 - #endif - - #ifdef __cplusplus - #define SMTG_CPP11 __cplusplus >= 201103L || _MSC_VER >= 1600 || __INTEL_CXX11_MODE__ - #define SMTG_CPP11_STDLIBSUPPORT SMTG_CPP11 - #endif -#elif __UNIX__ - #if LINUX - #define BYTEORDER kLittleEndian - #else - #define BYTEORDER kBigEndian - #endif - #define COM_COMPATIBLE 0 - #define PLUGIN_API -#elif __APPLE__ // Mac and iOS - #include - #define MAC 1 - #define PTHREADS 1 - #if !TARGET_OS_IPHONE - #ifndef __CF_USE_FRAMEWORK_INCLUDES__ - #define __CF_USE_FRAMEWORK_INCLUDES__ - #endif - #ifndef TARGET_API_MAC_CARBON - #define TARGET_API_MAC_CARBON 1 - #endif - #endif - #if __LP64__ - #define PLATFORM_64 1 - #endif - #if defined (__BIG_ENDIAN__) - #define BYTEORDER kBigEndian - #else - #define BYTEORDER kLittleEndian - #endif - #define COM_COMPATIBLE 0 - #define PLUGIN_API - - #if !defined(__PLIST__) && !defined(SMTG_DISABLE_DEFAULT_DIAGNOSTICS) - #ifdef __clang__ - #pragma GCC diagnostic ignored "-Wswitch-enum" - #pragma GCC diagnostic ignored "-Wparentheses" - #pragma GCC diagnostic ignored "-Wuninitialized" - #if __clang_major__ >= 3 - #pragma GCC diagnostic ignored "-Wtautological-compare" - #pragma GCC diagnostic ignored "-Wunused-value" - #if __clang_major__ >= 4 || __clang_minor__ >= 1 - #pragma GCC diagnostic ignored "-Wswitch" - #pragma GCC diagnostic ignored "-Wcomment" - #endif - #if __clang_major__ >= 5 - #pragma GCC diagnostic ignored "-Wunsequenced" - #if __clang_minor__ >= 1 - #pragma GCC diagnostic ignored "-Wunused-const-variable" - #endif - #endif - #endif - #endif - #endif - #ifdef __cplusplus - #include - #define SMTG_CPP11 (__cplusplus >= 201103L || __INTEL_CXX11_MODE__) - #define SMTG_CPP11_STDLIBSUPPORT (defined (_LIBCPP_VERSION) && SMTG_CPP11) - #endif -#else - #pragma error unknown platform - -#endif - -#endif diff --git a/vst/pluginterfaces/base/fstrdefs.h b/vst/pluginterfaces/base/fstrdefs.h deleted file mode 100644 index 88b73cf9..00000000 --- a/vst/pluginterfaces/base/fstrdefs.h +++ /dev/null @@ -1,314 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : SDK Core -// -// Category : SDK Core Interfaces -// Filename : pluginterfaces/base/fstrdefs.h -// Created by : Steinberg, 01/2004 -// Description : Definitions for handling strings (Unicode / ASCII / Platforms) -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//------------------------------------------------------------------------------ - -#ifndef __fstrdefs__ -#define __fstrdefs__ - -#include "ftypes.h" - -//---------------------------------------------------------------------------- -// string methods defines unicode / ASCII -//---------------------------------------------------------------------------- - -// 16 bit string operations -#if SMTG_CPP11 // if c++11 unicode string literals - #define SMTG_CPP11_CAT_PRIVATE_DONT_USE(a,b) a ## b - #if WINDOWS - #define STR16(x) SMTG_CPP11_CAT_PRIVATE_DONT_USE(L,x) - #else - #define STR16(x) SMTG_CPP11_CAT_PRIVATE_DONT_USE(u,x) - #endif -#else - #include "conststringtable.h" - #define STR16(x) Steinberg::ConstStringTable::instance ()->getString (x) -#endif - -#ifdef UNICODE - #define STR(x) STR16(x) - #define tStrBufferSize(buffer) (sizeof(buffer)/sizeof(Steinberg::tchar)) - -#else - #define STR(x) x - #define tStrBufferSize(buffer) (sizeof(buffer)) -#endif - -#define str8BufferSize(buffer) (sizeof(buffer)/sizeof(Steinberg::char8)) -#define str16BufferSize(buffer) (sizeof(buffer)/sizeof(Steinberg::char16)) - -#if WINDOWS -#define FORMAT_INT64A "I64d" -#define FORMAT_UINT64A "I64u" - -#elif MAC -#define FORMAT_INT64A "lld" -#define FORMAT_UINT64A "llu" -#define stricmp strcasecmp -#define strnicmp strncasecmp -#endif - -#ifdef UNICODE -#define FORMAT_INT64W STR(FORMAT_INT64A) -#define FORMAT_UINT64W STR(FORMAT_UINT64A) - -#define FORMAT_INT64 FORMAT_INT64W -#define FORMAT_UINT64 FORMAT_UINT64W -#else -#define FORMAT_INT64 FORMAT_INT64A -#define FORMAT_UINT64 FORMAT_UINT64A -#endif - - -//---------------------------------------------------------------------------- -// newline -//---------------------------------------------------------------------------- -#if WINDOWS -#define ENDLINE_A "\r\n" -#define ENDLINE_W STR ("\r\n") -#elif MAC -#define ENDLINE_A "\r" -#define ENDLINE_W STR ("\r") -#endif - -#ifdef UNICODE -#define ENDLINE ENDLINE_W -#else -#define ENDLINE ENDLINE_A -#endif - -#if WINDOWS && !defined(__GNUC__) && defined(_MSC_VER) && (_MSC_VER < 1900) -#define stricmp _stricmp -#define strnicmp _strnicmp -#define snprintf _snprintf -#endif - -namespace Steinberg { - -//---------------------------------------------------------------------------- -static const tchar kEmptyString[] = { 0 }; -static const char8 kEmptyString8[] = { 0 }; -static const char16 kEmptyString16[] = { 0 }; - -#ifdef UNICODE -static const tchar kInfiniteSymbol[] = { 0x221E, 0 }; -#else -static const tchar* const kInfiniteSymbol = STR ("oo"); -#endif - -//---------------------------------------------------------------------------- -template -inline int32 _tstrlen (const T* wcs) -{ - const T* eos = wcs; - - while (*eos++) - ; - - return (int32)(eos - wcs - 1); -} - -inline int32 tstrlen (const tchar* str) {return _tstrlen (str);} -inline int32 strlen8 (const char8* str) {return _tstrlen (str);} -inline int32 strlen16 (const char16* str) {return _tstrlen (str);} - -//---------------------------------------------------------------------------- -template -inline int32 _tstrcmp (const T* src, const T* dst) -{ - while (*src == *dst && *dst) - { - src++; - dst++; - } - - if (*src == 0 && *dst == 0) - return 0; - else if (*src == 0) - return -1; - else if (*dst == 0) - return 1; - else - return (int32)(*src - *dst); -} - -inline int32 tstrcmp (const tchar* src, const tchar* dst) {return _tstrcmp (src, dst);} -inline int32 strcmp8 (const char8* src, const char8* dst) {return _tstrcmp (src, dst);} -inline int32 strcmp16 (const char16* src, const char16* dst) {return _tstrcmp (src, dst);} - -template -inline int32 strcmpT (const T* first, const T* last); - -template <> -inline int32 strcmpT (const char8* first, const char8* last) { return _tstrcmp (first, last); } - -template <> -inline int32 strcmpT (const char16* first, const char16* last) { return _tstrcmp (first, last); } - -//---------------------------------------------------------------------------- -template -inline int32 _tstrncmp (const T* first, const T* last, uint32 count) -{ - if (count == 0) - return 0; - - while (--count && *first && *first == *last) - { - first++; - last++; - } - - if (*first == 0 && *last == 0) - return 0; - else if (*first == 0) - return -1; - else if (*last == 0) - return 1; - else - return (int32)(*first - *last); -} - -inline int32 tstrncmp (const tchar* first, const tchar* last, uint32 count) {return _tstrncmp (first, last, count);} -inline int32 strncmp8 (const char8* first, const char8* last, uint32 count) {return _tstrncmp (first, last, count);} -inline int32 strncmp16 (const char16* first, const char16* last, uint32 count) {return _tstrncmp (first, last, count);} - -template -inline int32 strncmpT (const T* first, const T* last, uint32 count); - -template <> -inline int32 strncmpT (const char8* first, const char8* last, uint32 count) { return _tstrncmp (first, last, count); } - -template <> -inline int32 strncmpT (const char16* first, const char16* last, uint32 count) {return _tstrncmp (first, last, count); } - -//---------------------------------------------------------------------------- -template -inline T* _tstrcpy (T* dst, const T* src) -{ - T* cp = dst; - while ((*cp++ = *src++) != 0) /* copy string */ - ; - return dst; -} -inline tchar* tstrcpy (tchar* dst, const tchar* src) {return _tstrcpy (dst, src);} -inline char8* strcpy8 (char8* dst, const char8* src) {return _tstrcpy (dst, src);} -inline char16* strcpy16 (char16* dst, const char16* src) {return _tstrcpy (dst, src);} - - -//---------------------------------------------------------------------------- -template -inline T* _tstrncpy (T* dest, const T* source, uint32 count) -{ - T* start = dest; - while (count && (*dest++ = *source++) != 0) /* copy string */ - count--; - - if (count) /* pad out with zeroes */ - { - while (--count) - *dest++ = 0; - } - return start; -} - -inline tchar* tstrncpy (tchar* dest, const tchar* source, uint32 count) {return _tstrncpy (dest, source, count);} -inline char8* strncpy8 (char8* dest, const char8* source, uint32 count) {return _tstrncpy (dest, source, count);} -inline char16* strncpy16 (char16* dest, const char16* source, uint32 count) {return _tstrncpy (dest, source, count);} - - -//---------------------------------------------------------------------------- -template -inline T* _tstrcat (T* dst, const T* src) -{ - T* cp = dst; - - while (*cp) - cp++; /* find end of dst */ - - while ((*cp++ = *src++) != 0) /* Copy src to end of dst */ - ; - - return dst; /* return dst */ -} - -inline tchar* tstrcat (tchar* dst, const tchar* src) {return _tstrcat (dst, src); } -inline char8* strcat8 (char8* dst, const char8* src) {return _tstrcat (dst, src); } -inline char16* strcat16 (char16* dst, const char16* src) {return _tstrcat (dst, src); } - - -//---------------------------------------------------------------------------- -inline void str8ToStr16 (char16* dst, const char8* src, int32 n = -1) -{ - int32 i = 0; - for (;;) - { - if (i == n) - { - dst [i] = 0; - return; - } - - #if BYTEORDER == kBigEndian - char8* pChr = (char8*)&dst[i]; - pChr[0] = 0; - pChr[1] = src[i]; - #else - dst[i] = src[i]; - #endif - - if (src[i] == 0) - break; - - i++; - } - - while (n > i) - { - dst[i] = 0; - i++; - } -} - -//------------------------------------------------------------------------ -inline bool FIDStringsEqual (FIDString id1, FIDString id2) -{ - return (id1 && id2) ? (strcmp8 (id1, id2) == 0) : false; -} - - -static const uint32 kPrintfBufferSize = 4096; - - -} // namespace - - - -#endif diff --git a/vst/pluginterfaces/base/ftypes.h b/vst/pluginterfaces/base/ftypes.h deleted file mode 100644 index ddcc9f74..00000000 --- a/vst/pluginterfaces/base/ftypes.h +++ /dev/null @@ -1,204 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : SDK Core -// -// Category : SDK Core Interfaces -// Filename : pluginterfaces/base/ftypes.h -// Created by : Steinberg, 01/2004 -// Description : Basic data types -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//------------------------------------------------------------------------------ - -#ifndef __ftypes__ -#define __ftypes__ - -#include "fplatform.h" - -//#define UNICODE_OFF // disable / enable unicode - -#ifdef UNICODE_OFF - #ifdef UNICODE - #undef UNICODE - #endif -#else - #define UNICODE 1 -#endif - -#ifdef UNICODE -#define _UNICODE 1 -#endif - -namespace Steinberg -{ -//----------------------------------------------------------------- -// Integral Types - typedef char int8; - typedef unsigned char uint8; - typedef unsigned char uchar; - - typedef short int16; - typedef unsigned short uint16; - -#if (MAC && __LP64__) || TARGET_OS_IPHONE - typedef int int32; - typedef unsigned int uint32; -#else - typedef long int32; - typedef unsigned long uint32; -#endif - - static const int32 kMaxLong = 0x7fffffff; - static const int32 kMinLong = (-0x7fffffff - 1); - static const int32 kMaxInt32 = kMaxLong; - static const int32 kMinInt32 = kMinLong; - static const uint32 kMaxInt32u = 0xffffffff; - -#if WINDOWS && !defined(__GNUC__) - typedef __int64 int64; - typedef unsigned __int64 uint64; - static const int64 kMaxInt64 = 9223372036854775807i64; - static const int64 kMinInt64 = (-9223372036854775807i64 - 1); -#else - typedef long long int64; - typedef unsigned long long uint64; - static const int64 kMaxInt64 = 0x7fffffffffffffffLL; - static const int64 kMinInt64 = (-0x7fffffffffffffffLL-1); -#endif - static const uint64 kMaxInt64u = uint64 (0xffffffff) | (uint64 (0xffffffff) << 32); - -//----------------------------------------------------------------- -// other Semantic Types - typedef int64 TSize; // byte (or other) sizes - typedef int32 tresult; // result code -//----------------------------------------------------------------- - static const float kMaxFloat = 3.40282346638528860E38; - static const double kMaxDouble = 1.7976931348623158E308; - -#if PLATFORM_64 - typedef uint64 TPtrInt; -#else - typedef uint32 TPtrInt; -#endif - -//------------------------------------------------------------------ -// Boolean - typedef uint8 TBool; - -//------------------------------------------------------------------ -// Char / Strings - typedef char char8; -#ifdef _NATIVE_WCHAR_T_DEFINED - typedef __wchar_t char16; -#elif SMTG_CPP11 - typedef char16_t char16; -#else - typedef int16 char16; -#endif - -#ifdef UNICODE - typedef char16 tchar; -#else - typedef char8 tchar; -#endif - - typedef const char8* CStringA; - typedef const char16* CStringW; - typedef const tchar* CString; - inline bool strEmpty (const tchar* str) { return (!str || *str == 0); } - inline bool str8Empty (const char8* str) { return (!str || *str == 0); } - inline bool str16Empty (const char16* str) { return (!str || *str == 0); } - - typedef const char8* FIDString; // identifier as string (used for attributes, messages) - - const FIDString kPlatformStringWin = "WIN"; - const FIDString kPlatformStringMac = "MAC"; - const FIDString kPlatformStringIOS = "IOS"; -#if WINDOWS - const FIDString kPlatformString = kPlatformStringWin; -#elif TARGET_OS_IPHONE - const FIDString kPlatformString = kPlatformStringIOS; -#elif MAC - const FIDString kPlatformString = kPlatformStringMac; -#endif - -//------------------------------------------------------------------------ -/** Coordinates */ - typedef int32 UCoord; - static const UCoord kMaxCoord = ((UCoord)0x7FFFFFFF); - static const UCoord kMinCoord = ((UCoord)-0x7FFFFFFF); -} // namespace Steinberg - - -//---------------------------------------------------------------------------- -/** Byte-order Conversion Macros */ -//---------------------------------------------------------------------------- -#define SWAP_32(l) { \ - unsigned char* p = (unsigned char*)& (l); \ - unsigned char t; \ - t = p[0]; p[0] = p[3]; p[3] = t; t = p[1]; p[1] = p[2]; p[2] = t; } - -#define SWAP_16(w) { \ - unsigned char* p = (unsigned char*)& (w); \ - unsigned char t; \ - t = p[0]; p[0] = p[1]; p[1] = t; } - -#define SWAP_64(i) { \ - unsigned char* p = (unsigned char*)& (i); \ - unsigned char t; \ - t = p[0]; p[0] = p[7]; p[7] = t; t = p[1]; p[1] = p[6]; p[6] = t; \ - t = p[2]; p[2] = p[5]; p[5] = t; t = p[3]; p[3] = p[4]; p[4] = t;} - -namespace Steinberg -{ - static inline void FSwap (int8&) {} - static inline void FSwap (uint8&) {} - static inline void FSwap (int16& i16) { SWAP_16 (i16) } - static inline void FSwap (uint16& i16) { SWAP_16 (i16) } - static inline void FSwap (int32& i32) { SWAP_32 (i32) } - static inline void FSwap (uint32& i32) { SWAP_32 (i32) } - static inline void FSwap (int64& i64) { SWAP_64 (i64) } - static inline void FSwap (uint64& i64) { SWAP_64 (i64) } -} - -// always inline macros (only when RELEASE is 1) -//---------------------------------------------------------------------------- -#if RELEASE - #if MAC - #define SMTG_ALWAYS_INLINE __inline__ __attribute__((__always_inline__)) - #define SMTG_NEVER_INLINE __attribute__((noinline)) - #elif WINDOWS - #define SMTG_ALWAYS_INLINE __forceinline - #define SMTG_NEVER_INLINE __declspec(noinline) - #endif -#endif - -#ifndef SMTG_ALWAYS_INLINE - #define SMTG_ALWAYS_INLINE inline -#endif -#ifndef SMTG_NEVER_INLINE - #define SMTG_NEVER_INLINE -#endif - -#endif // __ftypes__ diff --git a/vst/pluginterfaces/base/funknown.cpp b/vst/pluginterfaces/base/funknown.cpp deleted file mode 100644 index 7485e20a..00000000 --- a/vst/pluginterfaces/base/funknown.cpp +++ /dev/null @@ -1,472 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : SDK Core -// -// Category : SDK Core Interfaces -// Filename : pluginterfaces/base/funknown.cpp -// Created by : Steinberg, 01/2004 -// Description : Basic Interface -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//------------------------------------------------------------------------------ - -#ifndef __funknown__ -#include "funknown.h" -#endif - -#include "fstrdefs.h" - -#include - -#if WINDOWS -#include -#endif - -#if MAC -#include -#include - -#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 - -namespace Steinberg { - -//------------------------------------------------------------------------ -#if COM_COMPATIBLE -#if WINDOWS -#define GuidStruct GUID -#else -struct GuidStruct -{ - uint32 Data1; - uint16 Data2; - uint16 Data3; - uint8 Data4[8]; -}; -#endif -#endif - -static void toString8 (char8* string, const char* data, int32 i1, int32 i2); -static void fromString8 (const char8* string, char* data, int32 i1, int32 i2); -static uint32 makeLong (uint8 b1, uint8 b2, uint8 b3, uint8 b4); - -//------------------------------------------------------------------------ -// FUnknownPrivate -//------------------------------------------------------------------------ -namespace FUnknownPrivate { -//------------------------------------------------------------------------ -int32 PLUGIN_API atomicAdd (int32& var, int32 d) -{ -#if WINDOWS - return InterlockedExchangeAdd (&var, d) + d; -#elif MAC - return OSAtomicAdd32Barrier (d, (int32_t*)&var); -#else - var += d; - return var; -#endif -} -} // FUnknownPrivate - -//------------------------------------------------------------------------ -// FUID implementation -//------------------------------------------------------------------------ - -FUID::FUID () -{ - memset (data, 0, sizeof (TUID)); -} - -//------------------------------------------------------------------------ -FUID::FUID (uint32 l1, uint32 l2, uint32 l3, uint32 l4) -{ - from4Int (l1, l2, l3, l4); -} - -//------------------------------------------------------------------------ -FUID::FUID (const FUID& f) -{ - memcpy (data, f.data, sizeof (TUID)); -} - -//------------------------------------------------------------------------ -bool FUID::generate () -{ -#if WINDOWS - GUID guid; - HRESULT hr = CoCreateGuid (&guid); - switch (hr) - { - case RPC_S_OK: - memcpy (data, (char*)&guid, sizeof (TUID)); - return true; - - case RPC_S_UUID_LOCAL_ONLY: - default: - return false; - } - -#elif MAC - CFUUIDRef uuid = CFUUIDCreate (kCFAllocatorDefault); - if (uuid) - { - CFUUIDBytes bytes = CFUUIDGetUUIDBytes (uuid); - memcpy (data, (char*)&bytes, sizeof (TUID)); - CFRelease (uuid); - return true; - } - return false; - -#else - // implement me! - return false; -#endif -} - -//------------------------------------------------------------------------ -bool FUID::isValid () const -{ - TUID nulluid = {0}; - - return memcmp (data, nulluid, sizeof (TUID)) != 0; -} - -//------------------------------------------------------------------------ -FUID& FUID::operator = (const FUID& f) -{ - memcpy (data, f.data, sizeof (TUID)); - return *this; -} - -//------------------------------------------------------------------------ -FUID& FUID::operator = (FIDString uid) -{ - memcpy (data, uid, sizeof (TUID)); - return *this; -} - -//------------------------------------------------------------------------ -FUID& FUID::operator = (TUID uid) -{ - memcpy (data, uid, sizeof (TUID)); - return *this; -} - - -//------------------------------------------------------------------------ -void FUID::from4Int (uint32 l1, uint32 l2, uint32 l3, uint32 l4) -{ -#if COM_COMPATIBLE - data [0] = (char)((l1 & 0x000000FF) ); - data [1] = (char)((l1 & 0x0000FF00) >> 8); - data [2] = (char)((l1 & 0x00FF0000) >> 16); - data [3] = (char)((l1 & 0xFF000000) >> 24); - data [4] = (char)((l2 & 0x00FF0000) >> 16); - data [5] = (char)((l2 & 0xFF000000) >> 24); - data [6] = (char)((l2 & 0x000000FF) ); - data [7] = (char)((l2 & 0x0000FF00) >> 8); - data [8] = (char)((l3 & 0xFF000000) >> 24); - data [9] = (char)((l3 & 0x00FF0000) >> 16); - data [10] = (char)((l3 & 0x0000FF00) >> 8); - data [11] = (char)((l3 & 0x000000FF) ); - data [12] = (char)((l4 & 0xFF000000) >> 24); - data [13] = (char)((l4 & 0x00FF0000) >> 16); - data [14] = (char)((l4 & 0x0000FF00) >> 8); - data [15] = (char)((l4 & 0x000000FF) ); -#else - data [0] = (char)((l1 & 0xFF000000) >> 24); - data [1] = (char)((l1 & 0x00FF0000) >> 16); - data [2] = (char)((l1 & 0x0000FF00) >> 8); - data [3] = (char)((l1 & 0x000000FF) ); - data [4] = (char)((l2 & 0xFF000000) >> 24); - data [5] = (char)((l2 & 0x00FF0000) >> 16); - data [6] = (char)((l2 & 0x0000FF00) >> 8); - data [7] = (char)((l2 & 0x000000FF) ); - data [8] = (char)((l3 & 0xFF000000) >> 24); - data [9] = (char)((l3 & 0x00FF0000) >> 16); - data [10] = (char)((l3 & 0x0000FF00) >> 8); - data [11] = (char)((l3 & 0x000000FF) ); - data [12] = (char)((l4 & 0xFF000000) >> 24); - data [13] = (char)((l4 & 0x00FF0000) >> 16); - data [14] = (char)((l4 & 0x0000FF00) >> 8); - data [15] = (char)((l4 & 0x000000FF) ); -#endif -} - -//------------------------------------------------------------------------ -void FUID::to4Int (uint32& d1, uint32& d2, uint32& d3, uint32& d4) const -{ - d1 = getLong1 (); - d2 = getLong2 (); - d3 = getLong3 (); - d4 = getLong4 (); -} - -//------------------------------------------------------------------------ -uint32 FUID::getLong1 () const -{ -#if COM_COMPATIBLE - return makeLong (data[3], data[2], data [1], data [0]); -#else - return makeLong (data[0], data[1], data [2], data [3]); -#endif -} - -//------------------------------------------------------------------------ -uint32 FUID::getLong2 () const -{ -#if COM_COMPATIBLE - return makeLong (data[5], data[4], data [7], data [6]); -#else - return makeLong (data[4], data[5], data [6], data [7]); -#endif -} - -//------------------------------------------------------------------------ -uint32 FUID::getLong3 () const -{ -#if COM_COMPATIBLE - return makeLong (data[8], data[9], data [10], data [11]); -#else - return makeLong (data[8], data[9], data [10], data [11]); -#endif -} - -//------------------------------------------------------------------------ -uint32 FUID::getLong4 () const -{ -#if COM_COMPATIBLE - return makeLong (data[12], data[13], data [14], data [15]); -#else - return makeLong (data[12], data[13], data [14], data [15]); -#endif -} - -//------------------------------------------------------------------------ -void FUID::toString (char8* string) const -{ - if (!string) - return; - - #if COM_COMPATIBLE - GuidStruct* g = (GuidStruct*)data; - - char8 s[17]; - Steinberg::toString8 (s, data, 8, 16); - - sprintf (string, "%08X%04X%04X%s", g->Data1, g->Data2, g->Data3, s); - #else - Steinberg::toString8 (string, data, 0, 16); - #endif -} - -//------------------------------------------------------------------------ -bool FUID::fromString (const char8* string) -{ - if (!string || !*string) - return false; - if (strlen (string) != 32) - return false; - - #if COM_COMPATIBLE - GuidStruct g; - char s[33]; - - strcpy (s, string); - s[8] = 0; - sscanf (s, "%x", &g.Data1); - strcpy (s, string + 8); - s[4] = 0; - sscanf (s, "%hx", &g.Data2); - strcpy (s, string + 12); - s[4] = 0; - sscanf (s, "%hx", &g.Data3); - - memcpy (data, &g, 8); - Steinberg::fromString8 (string + 16, data, 8, 16); - #else - Steinberg::fromString8 (string, data, 0, 16); - #endif - - return true; -} - -//------------------------------------------------------------------------ -bool FUID::fromRegistryString (const char8* string) -{ - if (!string || !*string) - return false; - if (strlen (string) != 38) - return false; - - // e.g. {c200e360-38c5-11ce-ae62-08002b2b79ef} - - #if COM_COMPATIBLE - GuidStruct g; - char8 s[10]; - - strncpy (s, string + 1, 8); - s[8] = 0; - sscanf (s, "%x", &g.Data1); - strncpy (s, string + 10, 4); - s[4] = 0; - sscanf (s, "%hx", &g.Data2); - strncpy (s, string + 15, 4); - s[4] = 0; - sscanf (s, "%hx", &g.Data3); - memcpy (data, &g, 8); - - Steinberg::fromString8 (string + 20, data, 8, 10); - Steinberg::fromString8 (string + 25, data, 10, 16); - #else - Steinberg::fromString8 (string + 1, data, 0, 4); - Steinberg::fromString8 (string + 10, data, 4, 6); - Steinberg::fromString8 (string + 15, data, 6, 8); - Steinberg::fromString8 (string + 20, data, 8, 10); - Steinberg::fromString8 (string + 25, data, 10, 16); - #endif - - return true; -} - -//------------------------------------------------------------------------ -void FUID::toRegistryString (char8* string) const -{ - // e.g. {c200e360-38c5-11ce-ae62-08002b2b79ef} - - #if COM_COMPATIBLE - GuidStruct* g = (GuidStruct*)data; - - char8 s1[5]; - Steinberg::toString8 (s1, data, 8, 10); - - char8 s2[13]; - Steinberg::toString8 (s2, data, 10, 16); - - sprintf (string, "{%08X-%04X-%04X-%s-%s}", g->Data1, g->Data2, g->Data3, s1, s2); - #else - char8 s1[9]; - Steinberg::toString8 (s1, data, 0, 4); - char8 s2[5]; - Steinberg::toString8 (s2, data, 4, 6); - char8 s3[5]; - Steinberg::toString8 (s3, data, 6, 8); - char8 s4[5]; - Steinberg::toString8 (s4, data, 8, 10); - char8 s5[13]; - Steinberg::toString8 (s5, data, 10, 16); - - sprintf (string, "{%s-%s-%s-%s-%s}", s1, s2, s3, s4, s5); - #endif -} - -//------------------------------------------------------------------------ -void FUID::print (char8* string, int32 style) const -{ - if (!string) // no string: debug output - { - char8 str [128]; - print (str, style); - - #if WINDOWS - OutputDebugStringA (str); - OutputDebugStringA ("\n"); - #else - fprintf (stdout, "%s\n", str); - #endif - return; - } - - uint32 l1, l2, l3, l4; - to4Int (l1, l2, l3, l4); - - switch (style) - { - case kINLINE_UID: - sprintf (string, "INLINE_UID (0x%08X, 0x%08X, 0x%08X, 0x%08X)", l1, l2, l3, l4); - break; - - case kDECLARE_UID: - sprintf (string, "DECLARE_UID (0x%08X, 0x%08X, 0x%08X, 0x%08X)", l1, l2, l3, l4); - break; - - case kFUID: - sprintf (string, "FUID (0x%08X, 0x%08X, 0x%08X, 0x%08X)", l1, l2, l3, l4); - break; - - case kCLASS_UID: - default: - sprintf (string, "DECLARE_CLASS_IID (Interface, 0x%08X, 0x%08X, 0x%08X, 0x%08X)", l1, l2, l3, l4); - break; - } -} - -//------------------------------------------------------------------------ -void FUID::toTUID (TUID result) const -{ - memcpy (result, data, sizeof (TUID)); -} - - -//------------------------------------------------------------------------ -// helpers -//------------------------------------------------------------------------ -static uint32 makeLong (uint8 b1, uint8 b2, uint8 b3, uint8 b4) -{ - return (uint32(b1) << 24) | (uint32(b2) << 16) | (uint32(b3) << 8) | uint32(b4); -} - -//------------------------------------------------------------------------ -static void toString8 (char8* string, const char* data, int32 i1, int32 i2) -{ - *string = 0; - for (int32 i = i1; i < i2; i++) - { - char8 s[3]; - sprintf (s, "%02X", (uint8)data[i]); - strcat (string, s); - } -} - -//------------------------------------------------------------------------ -static void fromString8 (const char8* string, char* data, int32 i1, int32 i2) -{ - for (int32 i = i1; i < i2; i++) - { - char8 s[3]; - s[0] = *string++; - s[1] = *string++; - s[2] = 0; - - int32 d = 0; - sscanf (s, "%2x", &d); - data[i] = (char)d; - } -} - -} // Steinberg diff --git a/vst/pluginterfaces/base/funknown.h b/vst/pluginterfaces/base/funknown.h deleted file mode 100644 index 4e73b2cc..00000000 --- a/vst/pluginterfaces/base/funknown.h +++ /dev/null @@ -1,468 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : SDK Core -// -// Category : SDK Core Interfaces -// Filename : pluginterfaces/base/funknown.h -// Created by : Steinberg, 01/2004 -// Description : Basic Interface -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//------------------------------------------------------------------------------ - -#ifndef __funknown__ -#define __funknown__ - -#include "pluginterfaces/base/ftypes.h" -#include "pluginterfaces/base/smartpointer.h" -#include - -//------------------------------------------------------------------------ -/*! \defgroup pluginBase Basic Interfaces -*/ -//------------------------------------------------------------------------ - -//------------------------------------------------------------------------ -// Unique Identifier macros -//------------------------------------------------------------------------ - -#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) ) \ -} -#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) ) \ -} -#endif - -//------------------------------------------------------------------------ -#define DECLARE_UID(name, l1, l2, l3, l4) \ - ::Steinberg::TUID name = INLINE_UID (l1, l2, l3, l4); - -//------------------------------------------------------------------------ -#define EXTERN_UID(name) \ - extern const ::Steinberg::TUID name; - - -#ifdef INIT_CLASS_IID -#define DECLARE_CLASS_IID(ClassName, l1, l2, l3, l4) static const ::Steinberg::TUID ClassName##_iid = INLINE_UID (l1, l2, l3, l4); \ -const ::Steinberg::FUID ClassName::iid (ClassName##_iid); -#else -#define DECLARE_CLASS_IID(ClassName, l1, l2, l3, l4) static const ::Steinberg::TUID ClassName##_iid = INLINE_UID (l1, l2, l3, l4); -#endif -#define DEF_CLASS_IID(ClassName) const ::Steinberg::FUID ClassName::iid (ClassName##_iid); - -#define INLINE_UID_OF(ClassName) ClassName##_iid - -#define INLINE_UID_FROM_FUID(x) INLINE_UID(x.getLong1 (), x.getLong2 (), x.getLong3 (), x.getLong4 ()) - -//------------------------------------------------------------------------ -// FUnknown implementation macros -//------------------------------------------------------------------------ - -#define DECLARE_FUNKNOWN_METHODS \ -public: \ - virtual ::Steinberg::tresult PLUGIN_API queryInterface (const ::Steinberg::TUID _iid, void** obj); \ - virtual ::Steinberg::uint32 PLUGIN_API addRef (); \ - virtual ::Steinberg::uint32 PLUGIN_API release (); \ -protected : \ - ::Steinberg::int32 __funknownRefCount; \ -public: - -//------------------------------------------------------------------------ - -#define DELEGATE_REFCOUNT(ClassName) \ -public: \ - virtual ::Steinberg::uint32 PLUGIN_API addRef () { return ClassName::addRef (); } \ - virtual ::Steinberg::uint32 PLUGIN_API release () { return ClassName::release (); } - -//------------------------------------------------------------------------ -#define IMPLEMENT_REFCOUNT(ClassName) \ -::Steinberg::uint32 PLUGIN_API ClassName::addRef () \ -{ \ - return ::Steinberg::FUnknownPrivate::atomicAdd (__funknownRefCount, 1); \ -} \ -::Steinberg::uint32 PLUGIN_API ClassName::release () \ -{ \ - if (::Steinberg::FUnknownPrivate::atomicAdd (__funknownRefCount, -1) == 0) \ - { \ - delete this; \ - return 0; \ - } \ - return __funknownRefCount; \ -} - -//------------------------------------------------------------------------ -#define FUNKNOWN_CTOR { __funknownRefCount = 1; } -#define FUNKNOWN_DTOR - -//------------------------------------------------------------------------ -#define QUERY_INTERFACE(iid, obj, InterfaceIID, InterfaceName) \ -if (::Steinberg::FUnknownPrivate::iidEqual (iid, InterfaceIID)) \ -{ \ - addRef (); \ - *obj = static_cast< InterfaceName* >(this); \ - return ::Steinberg::kResultOk; \ -} - -//------------------------------------------------------------------------ -#define IMPLEMENT_QUERYINTERFACE(ClassName, InterfaceName, ClassIID) \ -::Steinberg::tresult PLUGIN_API ClassName::queryInterface (const ::Steinberg::TUID _iid, void** obj) \ -{ \ - QUERY_INTERFACE (_iid, obj, ::Steinberg::FUnknown::iid, InterfaceName) \ - QUERY_INTERFACE (_iid, obj, ClassIID, InterfaceName) \ - *obj = 0; \ - return ::Steinberg::kNoInterface; \ -} - -//------------------------------------------------------------------------ -#define IMPLEMENT_FUNKNOWN_METHODS(ClassName,InterfaceName,ClassIID) \ - IMPLEMENT_REFCOUNT (ClassName) \ - IMPLEMENT_QUERYINTERFACE (ClassName, InterfaceName, ClassIID) - -//------------------------------------------------------------------------ -// Result Codes -//------------------------------------------------------------------------ - -namespace Steinberg { - -//------------------------------------------------------------------------ -#if COM_COMPATIBLE -#if WINDOWS -enum -{ - kNoInterface = static_cast(0x80004002L), // E_NOINTERFACE - kResultOk = static_cast(0x00000000L), // S_OK - kResultTrue = kResultOk, - kResultFalse = static_cast(0x00000001L), // S_FALSE - kInvalidArgument = static_cast(0x80070057L), // E_INVALIDARG - kNotImplemented = static_cast(0x80004001L), // E_NOTIMPL - kInternalError = static_cast(0x80004005L), // E_FAIL - kNotInitialized = static_cast(0x8000FFFFL), // E_UNEXPECTED - kOutOfMemory = static_cast(0x8007000EL) // E_OUTOFMEMORY -}; -#else -enum -{ - kNoInterface = static_cast(0x80000004L), // E_NOINTERFACE - kResultOk = static_cast(0x00000000L), // S_OK - kResultTrue = kResultOk, - kResultFalse = static_cast(0x00000001L), // S_FALSE - kInvalidArgument = static_cast(0x80000003L), // E_INVALIDARG - kNotImplemented = static_cast(0x80000001L), // E_NOTIMPL - kInternalError = static_cast(0x80000008L), // E_FAIL - kNotInitialized = static_cast(0x8000FFFFL), // E_UNEXPECTED - kOutOfMemory = static_cast(0x80000002L) // E_OUTOFMEMORY -}; -#endif -#else -enum -{ - kNoInterface = -1, - kResultOk, - kResultTrue = kResultOk, - kResultFalse, - kInvalidArgument, - kNotImplemented, - kInternalError, - kNotInitialized, - kOutOfMemory -}; -#endif - -//------------------------------------------------------------------------ -typedef int64 LARGE_INT; // obsolete - -//------------------------------------------------------------------------ -// FUID class declaration -//------------------------------------------------------------------------ -typedef int8 TUID[16]; ///< plain UID type - -//------------------------------------------------------------------------ -/* FUnknown private */ -namespace FUnknownPrivate { -SMTG_ALWAYS_INLINE bool iidEqual (const void* iid1, const void* iid2) -{ - const uint64* p1 = reinterpret_cast (iid1); - const uint64* p2 = reinterpret_cast (iid2); - return p1[0] == p2[0] && p1[1] == p2[1]; -} - -int32 PLUGIN_API atomicAdd (int32& value, int32 amount); -} - -//------------------------------------------------------------------------ -/** Handling 16 Byte Globaly Unique Identifiers. -\ingroup pluginBase - -Each interface declares its identifier as static member inside the interface -namespace (e.g. FUnknown::iid). -*/ -//------------------------------------------------------------------------ -class FUID -{ -public: -//------------------------------------------------------------------------ - FUID (); - inline FUID (const TUID uid); - FUID (uint32 l1, uint32 l2, uint32 l3, uint32 l4); - FUID (const FUID&); - virtual ~FUID () {} - - /** Generates a new Unique Identifier (UID). - Will return true for success. If the return value is false, either no - UID is generated or the UID is not guaranteed to be unique worldwide. */ - bool generate (); - - /** Checks if the UID data is valid. - The default constructor initializes the memory with zeros. */ - bool isValid () const; - - FUID& operator = (const FUID& f); - FUID& operator = (FIDString uid); - FUID& operator = (TUID uid); - - bool operator == (const FUID& f) const { return ::Steinberg::FUnknownPrivate::iidEqual (data, f.data); } - bool operator == (FIDString uid) const { return ::Steinberg::FUnknownPrivate::iidEqual (data, uid); } - bool operator == (TUID uid) const { return ::Steinberg::FUnknownPrivate::iidEqual (data, uid); } - - bool operator < (const FUID& f) const { return memcmp (data, f.data, sizeof (TUID)) < 0; } - bool operator < (FIDString uid) const { return memcmp (data, uid, sizeof (TUID)) < 0; } - bool operator < (TUID uid) const { return memcmp (data, uid, sizeof (TUID)) < 0; } - - bool operator != (const FUID& f) const { return !::Steinberg::FUnknownPrivate::iidEqual (data, f.data); } - bool operator != (FIDString uid) const { return !::Steinberg::FUnknownPrivate::iidEqual (data, uid); } - bool operator != (TUID uid) const { return !::Steinberg::FUnknownPrivate::iidEqual (data, uid); } - - operator FIDString () const { return data; } - operator char* () { return data; } - - uint32 getLong1 () const; - uint32 getLong2 () const; - uint32 getLong3 () const; - uint32 getLong4 () const; - - 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]; - - /** Converts UID to a string. - The string will be 32 characters long, representing the hexadecimal values - of each data byte (e.g. "9127BE30160E4BB69966670AA6087880"). */ - void toString (char8* string) const; - - /** Sets the UID data from a string. - The string has to be 32 characters long, where each character-pair is - the ASCII-encoded hexadecimal value of the corresponding data byte. */ - bool fromString (const char8* string); - - /** Converts UID to a string in MicrosoftŪ 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. */ - bool fromRegistryString (const char8* string); - - enum UIDPrintStyle - { - kINLINE_UID, ///< "INLINE_UID (0x00000000, 0x00000000, 0x00000000, 0x00000000)" - kDECLARE_UID, ///< "DECLARE_UID (0x00000000, 0x00000000, 0x00000000, 0x00000000)" - kFUID, ///< "FUID (0x00000000, 0x00000000, 0x00000000, 0x00000000)" - kCLASS_UID ///< "DECLARE_CLASS_IID (Interface, 0x00000000, 0x00000000, 0x00000000, 0x00000000)" - }; - /** Prints the UID to a string (or debug output if string is NULL). - \param string is the output string if not NULL. - \param style can be chosen from the FUID::UIDPrintStyle enumeration. */ - void print (char8* string = 0, int32 style = kINLINE_UID) const; - - void toTUID (TUID result) const; - - inline const TUID& toTUID () const - { - return data; - } - -//------------------------------------------------------------------------ -protected: - TUID data; -}; - -//------------------------------------------------------------------------ -inline FUID::FUID (const TUID uid) -{ - memset (data, 0, sizeof (TUID)); - if (uid) - memcpy (data, uid, sizeof (TUID)); -} - -//------------------------------------------------------------------------ -// FUnknown -//------------------------------------------------------------------------ -/** The basic interface of all interfaces. -\ingroup pluginBase - -- The FUnknown::queryInterface method is used to retrieve pointers to other - interfaces of the object. -- FUnknown::addRef and FUnknown::release manage the lifetime of the object. - If no more references exist, the object is destroyed in memory. - -Interfaces are identified by 16 byte Globally Unique Identifiers. -The SDK provides a class called FUID for this purpose. - -\sa \ref howtoClass */ -//------------------------------------------------------------------------ -class FUnknown -{ -public: -//------------------------------------------------------------------------ - /** Query for a pointer to the specified interface. - Returns kResultOk on success or kNoInterface if the object does not implement the interface. - The object has to call addRef when returning an interface. - \param _iid : (in) 16 Byte interface identifier (-> FUID) - \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. - \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. - If the reference count reaches zero, the object will be destroyed in memory. */ - virtual uint32 PLUGIN_API release () = 0; - -//------------------------------------------------------------------------ - static const FUID iid; -//------------------------------------------------------------------------ -}; - -DECLARE_CLASS_IID (FUnknown, 0x00000000, 0x00000000, 0xC0000000, 0x00000046) - -//------------------------------------------------------------------------ -// FUnknownPtr -//------------------------------------------------------------------------ -/** FUnknownPtr - automatic interface conversion and smart pointer in one. - This template class can be used for interface conversion like this: - \code - IPtr path = owned (FHostCreate (IPath, hostClasses)); - FUnknownPtr path2 (path); // does a query interface for IPath2 - if (path2) - ... - \endcode -*/ -//------------------------------------------------------------------------ -template -class FUnknownPtr : public IPtr -{ -public: -//------------------------------------------------------------------------ - inline FUnknownPtr (FUnknown* unknown); // query interface - inline FUnknownPtr (const FUnknownPtr& p) : IPtr (p) {} - inline FUnknownPtr () {} - - inline FUnknownPtr& operator=(const FUnknownPtr& p) {IPtr::operator=(p); return *this;} - inline I* operator=(FUnknown* unknown); - inline I* getInterface () { return this->ptr; } -}; - -//------------------------------------------------------------------------ -template -inline FUnknownPtr::FUnknownPtr (FUnknown* unknown) -{ - if (unknown && unknown->queryInterface (I::iid, (void**)&this->ptr) != kResultOk) - this->ptr = 0; -} - -//------------------------------------------------------------------------ -template -inline I* FUnknownPtr::operator=(FUnknown* unknown) -{ - I* newPtr = 0; - if (unknown && unknown->queryInterface (I::iid, (void**)&newPtr) == kResultOk) - { - OPtr rel (newPtr); - return IPtr::operator=(newPtr); - } - - return IPtr::operator=(0); -} - - -//------------------------------------------------------------------------ -// FReleaser (obsolete) -//------------------------------------------------------------------------ -/** Release an interface using automatic object (obsolete). -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 -Usage example with OPtr: - \code - void someFunction () - { - OPtr 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) {} - ~FReleaser () { if (u) u->release (); } - - FUnknown* u; -}; - -} - -#endif diff --git a/vst/pluginterfaces/base/futils.h b/vst/pluginterfaces/base/futils.h deleted file mode 100644 index ae6e8573..00000000 --- a/vst/pluginterfaces/base/futils.h +++ /dev/null @@ -1,97 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : SDK Core -// -// Category : SDK Core Interfaces -// Filename : pluginterfaces/base/futils.h -// Created by : Steinberg, 01/2004 -// Description : Basic utilities -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//------------------------------------------------------------------------------ - -#ifndef __futils__ -#define __futils__ - -namespace Steinberg -{ - //---------------------------------------------------------------------------- - // min/max/etc. template functions - template - inline const T& Min (const T& a, const T& b) - { - return b < a ? b : a; - } - - template - inline const T& Max (const T& a, const T& b) - { - return a < b ? b : a; - } - - template - inline T Abs (const T& value) - { - return (value >= (T)0) ? value : -value; - } - - template - inline T Sign (const T& value) - { - return (value == (T)0) ? 0 : ((value >= (T)0) ? 1 : -1); - } - - template - inline T Bound (T minval, T maxval, T x) - { - if (x < minval) - return minval; - else if (x > maxval) - return maxval; - return x; - } - - template - void Swap (T& t1, T& t2) - { - T tmp = t1; - t1 = t2; - t2 = tmp; - } - - template - bool IsApproximateEqual (T t1, T t2, T epsilon) - { - if (t1 == t2) - return true; - T diff = t1 - t2; - if (diff < 0.0) - diff = -diff; - if (diff < epsilon) - return true; - return false; - } -} - -#endif diff --git a/vst/pluginterfaces/base/fvariant.h b/vst/pluginterfaces/base/fvariant.h deleted file mode 100644 index 47cb7b91..00000000 --- a/vst/pluginterfaces/base/fvariant.h +++ /dev/null @@ -1,221 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : SDK Core -// -// Category : SDK Core Interfaces -// Filename : pluginterfaces/base/fvariant.h -// Created by : Steinberg, 01/2004 -// Description : Basic Interface -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//------------------------------------------------------------------------------ - -#pragma once - -#include "pluginterfaces/base/fstrdefs.h" - -//------------------------------------------------------------------------ -namespace Steinberg { - -//------------------------------------------------------------------------ -// FVariant struct declaration -//------------------------------------------------------------------------ -/** A Value of variable type. - \ingroup pluginBase - */ -class FVariant -{ -//------------------------------------------------------------------------ -public: - enum - { - kEmpty = 0, - kInteger = 1 << 0, - kFloat = 1 << 1, - kString8 = 1 << 2, - kObject = 1 << 3, - kOwner = 1 << 4, - kString16 = 1 << 5 - }; - -//------------------------------------------------------------------------ - // ctors - inline FVariant () { memset (this, 0, sizeof (FVariant)); } - inline FVariant (const FVariant& variant); - - inline FVariant (int64 v) : type (kInteger), intValue (v) {} - inline FVariant (double v) : type (kFloat), floatValue (v) {} - inline FVariant (const char8* str) : type (kString8), string8 (str) {} - inline FVariant (const char16* str) : type (kString16), string16 (str) {} - inline FVariant (FUnknown* obj, bool owner = false) : type (kObject), object (obj) - { - setOwner (owner); - } - inline ~FVariant () { empty (); } - -//------------------------------------------------------------------------ - inline FVariant& operator= (const FVariant& variant); - - inline void setInt (int64 v) - { - empty (); - type = kInteger; - intValue = v; - } - inline void setFloat (double v) - { - empty (); - type = kFloat; - floatValue = v; - } - inline void setString8 (const char8* v) - { - empty (); - type = kString8; - string8 = v; - } - inline void setString16 (const char16* v) - { - empty (); - type = kString16; - string16 = v; - } - - inline void setObject (FUnknown* obj) - { - empty (); - type = kObject; - object = obj; - } - - inline int64 getInt () const { return (type & kInteger) ? intValue : 0; } - inline double getFloat () const { return (type & kFloat) ? floatValue : 0.; } - inline double getNumber () const - { - return (type & kInteger) ? static_cast (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 FUnknown* getObject () const { return (type & kObject) ? object : 0; } - - inline uint16 getType () const { return static_cast (type & ~(kOwner)); } - inline bool isEmpty () const { return getType () == kEmpty; } - inline bool isOwner () const { return (type & kOwner) != 0; } - inline bool isString () const { return (type & (kString8 | kString16)) != 0; } - inline void setOwner (bool state) - { - if (state) - type |= kOwner; - else - type &= ~kOwner; - } - - void empty (); -//------------------------------------------------------------------------ - uint16 type; - union - { - int64 intValue; - double floatValue; - const char8* string8; - const char16* string16; - FUnknown* object; - }; -}; - -//------------------------------------------------------------------------ -inline bool operator== (const FVariant& v1, const FVariant& v2) -{ -#if PLATFORM_64 - return v1.type == v2.type && v1.intValue == v2.intValue; -#else - if (v1.type != v2.type) - return false; - if (v1.type & (FVariant::kString8 | FVariant::kString16 | FVariant::kObject)) - return v1.string8 == v2.string8; // pointer type comparisons - return v1.intValue == v2.intValue; // intValue & double comparison - -#endif -} - -//------------------------------------------------------------------------ -inline bool operator!= (const FVariant& v1, const FVariant& v2) { return !(v1 == v2); } - -//------------------------------------------------------------------------ -inline FVariant::FVariant (const FVariant& variant) : type (kEmpty) { *this = variant; } - -//------------------------------------------------------------------------ -inline void FVariant::empty () -{ - if (type & kOwner) - { - if ((type & kString8) && string8) - delete[] string8; - else if ((type & kString16) && string16) - delete[] string16; - - else if ((type & kObject) && object) - object->release (); - } - memset (this, 0, sizeof (FVariant)); -} - -//------------------------------------------------------------------------ -inline FVariant& FVariant::operator= (const FVariant& variant) -{ - empty (); - - type = variant.type; - - if ((type & kString8) && variant.string8) - { - string8 = new char8[strlen (variant.string8) + 1]; - strcpy (const_cast (string8), variant.string8); - type |= kOwner; - } - else if ((type & kString16) && variant.string16) - { - int32 len = strlen16 (variant.string16); - string16 = new char16[len + 1]; - char16* tmp = const_cast (string16); - memcpy (tmp, variant.string16, len * sizeof (char16)); - tmp[len] = 0; - type |= kOwner; - } - else if ((type & kObject) && variant.object) - { - object = variant.object; - object->addRef (); - type |= kOwner; - } - else - intValue = variant.intValue; // copy memory - - return *this; -} - -//------------------------------------------------------------------------ -} // Steinberg diff --git a/vst/pluginterfaces/base/geoconstants.h b/vst/pluginterfaces/base/geoconstants.h deleted file mode 100644 index 840c88f4..00000000 --- a/vst/pluginterfaces/base/geoconstants.h +++ /dev/null @@ -1,113 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : SDK Core -// -// Category : SDK Core Interfaces -// Filename : pluginterfaces/base/geoconstants.h -// Created by : Steinberg, 11/2014 -// Description : Defines orientations and directions as also used by fpoint.h and frect.h -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//------------------------------------------------------------------------------ - -#pragma once - -//------------------------------------------------------------------------ -namespace Steinberg { - -//------------------------------------------------------------------------ -enum Direction -{ - kNorth, - kNorthEast, - kEast, - kSouthEast, - kSouth, - kSouthWest, - kWest, - kNorthWest, - kNoDirection, //same position or center point of a geometry - - kNumberOfDirections -}; - -//------------------------------------------------------------------------ -enum Orientation -{ - kHorizontal, - kVertical, - kNumberOfOrientations -}; - -//------------------------------------------------------------------------ -namespace GeoConstants { - -//------------------------------------------------------------------------ -inline Direction toOpposite (Direction dir) -{ - switch (dir) - { - case kNorth : return kSouth; - case kNorthEast : return kSouthWest; - case kEast : return kWest; - case kSouthEast : return kNorthWest; - case kSouth : return kNorth; - case kSouthWest : return kNorthEast; - case kWest : return kEast; - case kNorthWest : return kSouthEast; - case kNoDirection : return kNoDirection; - default: - return kNumberOfDirections; - } -} - -//------------------------------------------------------------------------ -inline Orientation toOrientation (Direction dir) -{ - switch (dir) - { - case kNorth : return kVertical; - case kEast : return kHorizontal; - case kSouth : return kVertical; - case kWest : return kHorizontal; - default: - return kNumberOfOrientations; - } -} - -//------------------------------------------------------------------------ -inline Orientation toOrthogonalOrientation (Orientation dir) -{ - switch (dir) - { - case kVertical : return kHorizontal; - case kHorizontal : return kVertical; - default: - return kNumberOfOrientations; - } -} - -//------------------------------------------------------------------------ -} // namespace GeoConstants -} // namespace Steinberg diff --git a/vst/pluginterfaces/base/ibstream.h b/vst/pluginterfaces/base/ibstream.h deleted file mode 100644 index 7a4231ff..00000000 --- a/vst/pluginterfaces/base/ibstream.h +++ /dev/null @@ -1,110 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : SDK Core -// -// Category : SDK Core Interfaces -// Filename : pluginterfaces/base/ibstream.h -// Created by : Steinberg, 01/2004 -// Description : Interface for reading/writing streams -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//------------------------------------------------------------------------------ - -#ifndef __ibstream__ -#define __ibstream__ - -#include "funknown.h" - -namespace Steinberg { - -//------------------------------------------------------------------------ -/** Base class for streams. -\ingroup pluginBase -- 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: - enum IStreamSeekMode - { - kIBSeekSet = 0, ///< set absolute seek position - kIBSeekCur, ///< set seek position relative to current position - kIBSeekEnd ///< set seek position relative to stream end - }; - -//------------------------------------------------------------------------ - /** Reads binary data from stream. - \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; - - /** 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; - - /** 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; - - /** Gets current stream read-write position. - \param pos : is assigned the current position if function succeeds */ - virtual tresult PLUGIN_API tell (int64* pos) = 0; -//------------------------------------------------------------------------ - static const FUID iid; -}; - -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) */ -//------------------------------------------------------------------------ -class ISizeableStream: public FUnknown -{ -public: -//------------------------------------------------------------------------ - /** Return the stream size */ - virtual tresult PLUGIN_API getStreamSize (int64& size) = 0; - /** Set the steam size. File streams can only be resized if they are write enabled. */ - virtual tresult PLUGIN_API setStreamSize (int64 size) = 0; - -//------------------------------------------------------------------------ - static const FUID iid; -}; -DECLARE_CLASS_IID (ISizeableStream, 0x04F9549E, 0xE02F4E6E, 0x87E86A87, 0x47F4E17F) - - -} // namespace Steinberg - -#endif // __ibstream__ - diff --git a/vst/pluginterfaces/base/icloneable.h b/vst/pluginterfaces/base/icloneable.h deleted file mode 100644 index f33c328d..00000000 --- a/vst/pluginterfaces/base/icloneable.h +++ /dev/null @@ -1,62 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : SDK Core -// -// Category : SDK Core Interfaces -// Filename : pluginterfaces/base/icloneable.h -// Created by : Steinberg, 11/2007 -// Description : Interface for object copies -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//------------------------------------------------------------------------------ - -#ifndef __icloneable__ -#define __icloneable__ - -#include "funknown.h" - -namespace Steinberg { - -//------------------------------------------------------------------------ -/** Interface allowing an object to be copied. -[plug & host imp] \n -[released: N4.12] \n -*/ -//------------------------------------------------------------------------ -class ICloneable : public FUnknown -{ -public: -//------------------------------------------------------------------------ - /** Create exact copy of the object */ - virtual FUnknown* PLUGIN_API clone () = 0; -//------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (ICloneable, 0xD45406B9, 0x3A2D4443, 0x9DAD9BA9, 0x85A1454B) - -} - -#endif - diff --git a/vst/pluginterfaces/base/ierrorcontext.h b/vst/pluginterfaces/base/ierrorcontext.h deleted file mode 100644 index cb769fc0..00000000 --- a/vst/pluginterfaces/base/ierrorcontext.h +++ /dev/null @@ -1,65 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : SDK Core -// -// Category : SDK Core Interfaces -// Filename : pluginterfaces/base/ierrorcontext.h -// Created by : Steinberg, 02/2008 -// Description : Error Context Interface -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//------------------------------------------------------------------------------ - -#ifndef __ierrorcontext__ -#define __ierrorcontext__ - -#include "pluginterfaces/base/funknown.h" - -namespace Steinberg { - -class IString; - -//------------------------------------------------------------------------ -/** Interface for error handling. -[plug imp] \n -[released: Sequel 2] */ -//------------------------------------------------------------------------ -class IErrorContext : public FUnknown -{ -public: -//------------------------------------------------------------------------ - /** Tells the plug-in to not show any UI elements on errors. */ - virtual void PLUGIN_API disableErrorUI (bool state) = 0; - /** If an error happens and disableErrorUI was not set this should return kResultTrue if the plug-in already showed a message to the user what happened. */ - virtual tresult PLUGIN_API errorMessageShown () = 0; - /** Fill message with error string. The host may show this to the user. */ - virtual tresult PLUGIN_API getErrorMessage (IString* message) = 0; - -//------------------------------------------------------------------------ - static const FUID iid; -}; -DECLARE_CLASS_IID (IErrorContext, 0x12BCD07B, 0x7C694336, 0xB7DA77C3, 0x444A0CD0) - -} // namespace -#endif \ No newline at end of file diff --git a/vst/pluginterfaces/base/ipersistent.h b/vst/pluginterfaces/base/ipersistent.h deleted file mode 100644 index 3d442bc4..00000000 --- a/vst/pluginterfaces/base/ipersistent.h +++ /dev/null @@ -1,180 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : SDK Core -// -// Category : SDK Core Interfaces -// Filename : pluginterfaces/base/ipersistent.h -// Created by : Steinberg, 09/2004 -// Description : Plug-In Storage Interfaces -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//------------------------------------------------------------------------------ - -#ifndef __ipersistent__ -#define __ipersistent__ - -#include "pluginterfaces/base/funknown.h" - -namespace Steinberg { - -class FVariant; -class IAttributes; -//------------------------------------------------------------------------ -/** Persistent Object Interface. -[plug imp] \n -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 - .... - - .... - -\endcode -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: -//------------------------------------------------------------------------ - /** The class ID must be a 16 bytes unique id that is used to create the object. - This ID is also used to identify the preset list when used with presets. */ - virtual tresult PLUGIN_API getClassID (char8* uid) = 0; - /** Store all members/data in the passed IAttributes. */ - virtual tresult PLUGIN_API saveAttributes (IAttributes* ) = 0; - /** Restore all members/data from the passed IAttributes. */ - virtual tresult PLUGIN_API loadAttributes (IAttributes* ) = 0; -//------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IPersistent, 0xBA1A4637, 0x3C9F46D0, 0xA65DBA0E, 0xB85DA829) - - -typedef FIDString IAttrID; -//------------------------------------------------------------------------ -/** Object Data Archive Interface. -[host imp] \n -- store data/objects/binary/subattributes in the archive -- read stored data from the archive - -All data stored to the archive are identified by a string (IAttrID), which must be unique on each -IAttribute level. - -The basic set/get methods make use of the FVariant class defined in 'funknown.h'. -For a more convenient usage of this interface, you should use the functions defined -in namespace PAttributes (public.sdk/source/common/pattributes.h+cpp) !! - -\ingroup frameworkHostClasses -*/ -//------------------------------------------------------------------------ -class IAttributes: public FUnknown -{ -public: -//------------------------------------------------------------------------ - /*! \name Methods to write attributes - ******************************************************************************************************** */ - //@{ - /** Store any data in the archive. It is even possible to store sub-attributes by creating - a new IAttributes instance via the IHostClasses interface and pass it to the parent in the - FVariant. In this case the archive must take the ownership of the newly created object, which - is true for all objects that have been created only for storing. You tell the archive to take - ownership by adding the FVariant::kOwner flag to the FVariant::type member (data.type |= FVariant::kOwner). - When using the PAttributes functions, this is done through a function parameter.*/ - virtual tresult PLUGIN_API set (IAttrID attrID, const FVariant& data) = 0; - - /** Store a list of data in the archive. Please note that the type of data is not mixable! So - you can only store a list of integers or a list of doubles/strings/etc. You can also store a list - of subattributes or other objects that implement the IPersistent interface.*/ - virtual tresult PLUGIN_API queue (IAttrID listID, const FVariant& data) = 0; - - /** Store binary data in the archive. Parameter 'copyBytes' specifies if the passed data should be copied. - The archive cannot take the ownership of binary data. Either it just references a buffer in order - to write it to a file (copyBytes = false) or it copies the data to its own buffers (copyBytes = true). - When binary data should be stored in the default pool for example, you must always copy it!*/ - virtual tresult PLUGIN_API setBinaryData (IAttrID attrID, void* data, uint32 bytes, bool copyBytes) = 0; - //@} - - /*! \name Methods to read attributes - ******************************************************************************************************** */ - //@{ - /** Get data previously stored to the archive. */ - virtual tresult PLUGIN_API get (IAttrID attrID, FVariant& data) = 0; - - /** Get list of data previously stored to the archive. As long as there are queue members the method - will return kResultTrue. When the queue is empty, the methods returns kResultFalse. All lists except from - object lists can be reset which means that the items can be read once again. \see IAttributes::resetQueue */ - virtual tresult PLUGIN_API unqueue (IAttrID listID, FVariant& data) = 0; - - /** Get the amount of items in a queue. */ - virtual int32 PLUGIN_API getQueueItemCount (IAttrID) = 0; - - /** Reset a queue. If you need to restart reading a queue, you have to reset it. You can reset a queue at any time.*/ - virtual tresult PLUGIN_API resetQueue (IAttrID attrID) = 0; - - /** Reset all queues in the archive.*/ - virtual tresult PLUGIN_API resetAllQueues () = 0; - - /** Read binary data from the archive. The data is copied into the passed buffer. The size of that buffer - must fit the size of data stored in the archive which can be queried via IAttributes::getBinaryDataSize */ - virtual tresult PLUGIN_API getBinaryData (IAttrID attrID, void* data, uint32 bytes) = 0; - /** Get the size in bytes of binary data in the archive. */ - virtual uint32 PLUGIN_API getBinaryDataSize (IAttrID attrID) = 0; - //@} - -//------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IAttributes, 0xFA1E32F9, 0xCA6D46F5, 0xA982F956, 0xB1191B58) - -//------------------------------------------------------------------------ -/** Extended access to Attributes; supports Attribute retrieval via iteration. -[host imp] \n -[released] C7/N6 \n -\ingroup frameworkHostClasses -*/ -//------------------------------------------------------------------------ -class IAttributes2 : public IAttributes -{ -public: - /** Returns the number of existing attributes. */ - virtual int32 PLUGIN_API countAttributes () const = 0; - /** Returns the attribute's ID for the given index. */ - virtual IAttrID PLUGIN_API getAttributeID (int32 index) const = 0; -//------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IAttributes2, 0x1382126A, 0xFECA4871, 0x97D52A45, 0xB042AE99) - -} - -#endif diff --git a/vst/pluginterfaces/base/ipluginbase.h b/vst/pluginterfaces/base/ipluginbase.h deleted file mode 100644 index a4e41f3c..00000000 --- a/vst/pluginterfaces/base/ipluginbase.h +++ /dev/null @@ -1,417 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : SDK Core -// -// Category : SDK Core Interfaces -// Filename : pluginterfaces/base/ipluginbase.h -// Created by : Steinberg, 01/2004 -// Description : Basic Plug-in Interfaces -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//------------------------------------------------------------------------------ - -#ifndef __ipluginbase__ -#define __ipluginbase__ - -#include "funknown.h" -#include "fstrdefs.h" - -namespace Steinberg { - -//------------------------------------------------------------------------ -/** Basic interface to a Plug-in component. -\ingroup pluginBase -- [plug imp] -- initialize/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. -A list of supported host context interfaces should be included in the documentation -of a specific category. */ -//------------------------------------------------------------------------ -class IPluginBase: public FUnknown -{ -public: -//------------------------------------------------------------------------ - /** The host passes a number of interfaces as context to initialize the Plug-in class. - @note Extensive memory allocations etc. should be performed in this method rather than in the class' constructor! - If the method does NOT return kResultOk, the object is released immediately. In this case terminate is not called! */ - virtual tresult PLUGIN_API initialize (FUnknown* context) = 0; - - /** 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; - -//------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IPluginBase, 0x22888DDB, 0x156E45AE, 0x8358B348, 0x08190625) - - -//------------------------------------------------------------------------ -/** Basic Information about the class factory of the Plug-in. -\ingroup pluginBase -*/ -//------------------------------------------------------------------------ -struct PFactoryInfo -{ -//------------------------------------------------------------------------ - enum FactoryFlags - { - kNoFlags = 0, ///< Nothing - kClassesDiscardable = 1 << 0, ///< The number of exported classes can change each time the Module is loaded. If this flag is set, the host does not cache class information. This leads to a longer startup time because the host always has to load the Module to get the current class information. - kLicenseCheck = 1 << 1, ///< Class IDs of components are interpreted as Syncrosoft-License (LICENCE_UID). Loaded in a Steinberg host, the module will not be loaded when the license is not valid - kComponentNonDiscardable = 1 << 3, ///< Component won't be unloaded until process exit - kUnicode = 1 << 4 ///< Components have entirely unicode encoded strings. (True for VST 3 Plug-ins so far) - }; - - enum - { - kURLSize = 256, - kEmailSize = 128, - kNameSize = 64 - }; - -//------------------------------------------------------------------------ - char8 vendor[kNameSize]; ///< e.g. "Steinberg Media Technologies" - char8 url[kURLSize]; ///< e.g. "http://www.steinberg.de" - char8 email[kEmailSize]; ///< e.g. "info@steinberg.de" - int32 flags; ///< (see above) -//------------------------------------------------------------------------ - PFactoryInfo (const char8* _vendor, const char8* _url, const char8* _email, int32 _flags) - { - strncpy8 (vendor, _vendor, kNameSize); - strncpy8 (url, _url, kURLSize); - strncpy8 (email, _email, kEmailSize); - flags = _flags; -#ifdef UNICODE - flags |= kUnicode; -#endif - } - PFactoryInfo () { memset (this, 0, sizeof (PFactoryInfo)); } -}; - -//------------------------------------------------------------------------ -/** Basic Information about a class provided by the Plug-in. -\ingroup pluginBase -*/ -//------------------------------------------------------------------------ -struct PClassInfo -{ -//------------------------------------------------------------------------ - enum ClassCardinality - { - kManyInstances = 0x7FFFFFFF - }; - - enum - { - kCategorySize = 32, - kNameSize = 64 - }; -//------------------------------------------------------------------------ - TUID cid; ///< Class ID 16 Byte class GUID - int32 cardinality; ///< cardinality of the class, set to kManyInstances (see \ref ClassCardinality) - char8 category[kCategorySize]; ///< class category, host uses this to categorize interfaces - char8 name[kNameSize]; ///< class name, visible to the user -//------------------------------------------------------------------------ - - PClassInfo (TUID _cid, int32 _cardinality, const char8* _category, const char8* _name) - { - memset (this, 0, sizeof (PClassInfo)); - memcpy (cid, _cid, sizeof (TUID)); - if (_category) - strncpy8 (category, _category, kCategorySize); - if (_name) - strncpy8 (name, _name, kNameSize); - cardinality = _cardinality; - } - PClassInfo () { memset (this, 0, sizeof (PClassInfo)); } -}; - - -//------------------------------------------------------------------------ -// IPluginFactory interface declaration -//------------------------------------------------------------------------ -/** Class factory that any Plug-in defines for creating class instances. -\ingroup pluginBase -- [plug imp] - -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 -mechanism to create instances of these classes (that usually define the IPluginBase interface). - - An implementation is provided in public.sdk/source/common/pluginfactory.cpp -\see GetPluginFactory -*/ -//------------------------------------------------------------------------ -class IPluginFactory : public FUnknown -{ -public: -//------------------------------------------------------------------------ - /** Fill a PFactoryInfo structure with information about the Plug-in vendor. */ - virtual tresult PLUGIN_API getFactoryInfo (PFactoryInfo* info) = 0; - - /** Returns the number of exported classes by this factory. - If you are using the CPluginFactory implementation provided by the SDK, it returns the number of classes you registered with CPluginFactory::registerClass. */ - virtual int32 PLUGIN_API countClasses () = 0; - - /** Fill a PClassInfo structure with information about the class at the specified index. */ - virtual tresult PLUGIN_API getClassInfo (int32 index, PClassInfo* info) = 0; - - /** Create a new class instance. */ - virtual tresult PLUGIN_API createInstance (FIDString cid, FIDString _iid, void** obj) = 0; - -//------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IPluginFactory, 0x7A4D811C, 0x52114A1F, 0xAED9D2EE, 0x0B43BF9F) - - -//------------------------------------------------------------------------ -/** 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) - char8 category[PClassInfo::kCategorySize]; ///< class category, host uses this to categorize interfaces - char8 name[PClassInfo::kNameSize]; ///< class name, visible to the user - - enum { - kVendorSize = 64, - kVersionSize = 64, - kSubCategoriesSize = 128 - }; - - uint32 classFlags; ///< flags used for a specific category, must be defined where category is defined - char8 subCategories[kSubCategoriesSize]; ///< module specific subcategories, can be more than one, logically added by the \c OR operator - char8 vendor[kVendorSize]; ///< overwrite vendor information from factory info - char8 version[kVersionSize]; ///< Version string (e.g. "1.0.0.512" with Major.Minor.Subversion.Build) - char8 sdkVersion[kVersionSize]; ///< SDK version used to build this class (e.g. "VST 3.0") - -//------------------------------------------------------------------------ - - PClassInfo2 (const TUID _cid, int32 _cardinality, const char8* _category, const char8* _name, - int32 _classFlags, const char8* _subCategories, const char8* _vendor, const char8* _version, - const char8* _sdkVersion) - { - memset (this, 0, sizeof (PClassInfo2)); - memcpy (cid, _cid, sizeof (TUID)); - cardinality = _cardinality; - if (_category) - strncpy8 (category, _category, PClassInfo::kCategorySize); - if (_name) - strncpy8 (name, _name, PClassInfo::kNameSize); - classFlags = _classFlags; - if (_subCategories) - strncpy8 (subCategories, _subCategories, kSubCategoriesSize); - if (_vendor) - strncpy8 (vendor, _vendor, kVendorSize); - if (_version) - strncpy8 (version, _version, kVersionSize); - if (_sdkVersion) - strncpy8 (sdkVersion, _sdkVersion, kVersionSize); - } - PClassInfo2 () { memset (this, 0, sizeof (PClassInfo2)); } -}; - -//------------------------------------------------------------------------ -// IPluginFactory2 interface declaration -//------------------------------------------------------------------------ -/** Version 2 of class factory supporting PClassInfo2. -\ingroup pluginBase -\copydoc IPluginFactory -*/ -//------------------------------------------------------------------------ -class IPluginFactory2 : public IPluginFactory -{ -public: -//------------------------------------------------------------------------ - /** Returns the class info (version 2) for a given index. */ - virtual tresult PLUGIN_API getClassInfo2 (int32 index, PClassInfo2* info) = 0; - -//------------------------------------------------------------------------ - static const FUID iid; -}; -DECLARE_CLASS_IID (IPluginFactory2, 0x0007B650, 0xF24B4C0B, 0xA464EDB9, 0xF00B2ABB) - - -//------------------------------------------------------------------------ -/** Unicode Version of Basic Information about a class provided by the Plug-in */ -//------------------------------------------------------------------------ -struct PClassInfoW -{ -//------------------------------------------------------------------------ - TUID cid; ///< see \ref PClassInfo - int32 cardinality; ///< see \ref PClassInfo - char8 category[PClassInfo::kCategorySize]; ///< see \ref PClassInfo - char16 name[PClassInfo::kNameSize]; ///< see \ref PClassInfo - - enum { - kVendorSize = 64, - kVersionSize = 64, - kSubCategoriesSize = 128 - }; - - uint32 classFlags; ///< flags used for a specific category, must be defined where category is defined - char8 subCategories[kSubCategoriesSize];///< module specific subcategories, can be more than one, logically added by the \c OR operator - char16 vendor[kVendorSize]; ///< overwrite vendor information from factory info - char16 version[kVersionSize]; ///< Version string (e.g. "1.0.0.512" with Major.Minor.Subversion.Build) - char16 sdkVersion[kVersionSize]; ///< SDK version used to build this class (e.g. "VST 3.0") - -//------------------------------------------------------------------------ - PClassInfoW (const TUID _cid, int32 _cardinality, const char8* _category, const char16* _name, - int32 _classFlags, const char8* _subCategories, const char16* _vendor, const char16* _version, - const char16* _sdkVersion) - { - memset (this, 0, sizeof (PClassInfoW)); - memcpy (cid, _cid, sizeof (TUID)); - cardinality = _cardinality; - if (_category) - strncpy8 (category, _category, PClassInfo::kCategorySize); - if (_name) - strncpy16 (name, _name, PClassInfo::kNameSize); - classFlags = _classFlags; - if (_subCategories) - strncpy8 (subCategories, _subCategories, kSubCategoriesSize); - if (_vendor) - strncpy16 (vendor, _vendor, kVendorSize); - if (_version) - strncpy16 (version, _version, kVersionSize); - if (_sdkVersion) - strncpy16 (sdkVersion, _sdkVersion, kVersionSize); - } - PClassInfoW () { memset (this, 0, sizeof (PClassInfoW)); } - - void fromAscii (const PClassInfo2& ci2) - { - memcpy (cid, ci2.cid, sizeof (TUID)); - cardinality = ci2.cardinality; - strncpy8 (category, ci2.category, PClassInfo::kCategorySize); - str8ToStr16 (name, ci2.name, PClassInfo::kNameSize); - classFlags = ci2.classFlags; - strncpy8 (subCategories, ci2.subCategories, kSubCategoriesSize); - - str8ToStr16 (vendor, ci2.vendor, kVendorSize); - str8ToStr16 (version, ci2.version, kVersionSize); - str8ToStr16 (sdkVersion, ci2.sdkVersion, kVersionSize); - } -}; - - -//------------------------------------------------------------------------ -// IPluginFactory3 interface declaration -//------------------------------------------------------------------------ -/** Version 3 of class factory supporting PClassInfoW. -\ingroup pluginBase -\copydoc IPluginFactory -*/ -//------------------------------------------------------------------------ -class IPluginFactory3 : public IPluginFactory2 -{ -public: -//------------------------------------------------------------------------ - /** Returns the unicode class info for a given index. */ - virtual tresult PLUGIN_API getClassInfoUnicode (int32 index, PClassInfoW* info) = 0; - - /** Receives information about host*/ - virtual tresult PLUGIN_API setHostContext (FUnknown* context) = 0; - -//------------------------------------------------------------------------ - static const FUID iid; -}; -DECLARE_CLASS_IID (IPluginFactory3, 0x4555A2AB, 0xC1234E57, 0x9B122910, 0x36878931) -} - - -//------------------------------------------------------------------------ -#define LICENCE_UID(l1, l2, l3, l4) \ -{ \ - (int8)((l1 & 0xFF000000) >> 24), (int8)((l1 & 0x00FF0000) >> 16), \ - (int8)((l1 & 0x0000FF00) >> 8), (int8)((l1 & 0x000000FF) ), \ - (int8)((l2 & 0xFF000000) >> 24), (int8)((l2 & 0x00FF0000) >> 16), \ - (int8)((l2 & 0x0000FF00) >> 8), (int8)((l2 & 0x000000FF) ), \ - (int8)((l3 & 0xFF000000) >> 24), (int8)((l3 & 0x00FF0000) >> 16), \ - (int8)((l3 & 0x0000FF00) >> 8), (int8)((l3 & 0x000000FF) ), \ - (int8)((l4 & 0xFF000000) >> 24), (int8)((l4 & 0x00FF0000) >> 16), \ - (int8)((l4 & 0x0000FF00) >> 8), (int8)((l4 & 0x000000FF) ) \ -} - - -//------------------------------------------------------------------------ -// GetPluginFactory -//------------------------------------------------------------------------ -/** Plug-in entrypoint. -\ingroup pluginBase -Any Plug-in must define and export this function. \n -A typical implementation of GetPluginFactory looks like this - \code - IPluginFactory* PLUGIN_API GetPluginFactory () - { - if (!gPluginFactory) - { - 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; - } - \endcode -\see \ref loadPlugin -*/ -//------------------------------------------------------------------------ -extern "C" -{ - Steinberg::IPluginFactory* PLUGIN_API GetPluginFactory (); - typedef Steinberg::IPluginFactory* (PLUGIN_API *GetFactoryProc) (); -} - -#endif // __ipluginbase__ diff --git a/vst/pluginterfaces/base/istringresult.h b/vst/pluginterfaces/base/istringresult.h deleted file mode 100644 index 9c6e4209..00000000 --- a/vst/pluginterfaces/base/istringresult.h +++ /dev/null @@ -1,98 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : SDK Core -// -// Category : SDK Core Interfaces -// Filename : pluginterfaces/base/istringresult.h -// Created by : Steinberg, 01/2005 -// Description : Strings Interface -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//------------------------------------------------------------------------------ - -#ifndef __istringresult__ -#define __istringresult__ - -#include "pluginterfaces/base/funknown.h" - -namespace Steinberg { - -//------------------------------------------------------------------------ -/** Interface to return an ascii string of variable size. - 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] */ -//------------------------------------------------------------------------ -class IStringResult : public FUnknown -{ -public: -//------------------------------------------------------------------------ - virtual void PLUGIN_API setText (const char8* text) = 0; - -//------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IStringResult, 0x550798BC, 0x872049DB, 0x84920A15, 0x3B50B7A8) - - -//------------------------------------------------------------------------ -/** Interface to a string of variable size and encoding. -[host imp] or [plug imp] \n -[released: ] */ -//------------------------------------------------------------------------ -class IString : public FUnknown -{ -public: -//------------------------------------------------------------------------ - /** Assign ASCII string */ - virtual void PLUGIN_API setText8 (const char8* text) = 0; - /** Assign unicode string */ - virtual void PLUGIN_API setText16 (const char16* text) = 0; - - /** Return ASCII string. If the string is unicode so far, it will be converted. - So you need to be careful, because the conversion can result in data loss. - It is save though to call getText8 if isWideString() returns false */ - virtual const char8* PLUGIN_API getText8 () = 0; - /** Return unicode string. If the string is ASCII so far, it will be converted. */ - virtual const char16* PLUGIN_API getText16 () = 0; - - /** !Do not use this method! Early implementations take the given pointer as - internal string and this will cause problems because 'free' will be used to delete the passed memory. - Later implementations will redirect 'take' to setText8 and setText16 */ - virtual void PLUGIN_API take (void* s, bool isWide) = 0; - - /** Returns true if the string is in unicode format, returns false if the string is ASCII */ - virtual bool PLUGIN_API isWideString () const = 0; - -//------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IString, 0xF99DB7A3, 0x0FC14821, 0x800B0CF9, 0x8E348EDF) - -} // namespace -#endif diff --git a/vst/pluginterfaces/base/iupdatehandler.h b/vst/pluginterfaces/base/iupdatehandler.h deleted file mode 100644 index 9c2d9d29..00000000 --- a/vst/pluginterfaces/base/iupdatehandler.h +++ /dev/null @@ -1,119 +0,0 @@ -//------------------------------------------------------------------------ -// Project : Steinberg Module Architecture SDK -// -// Category : Basic Host Service Interfaces -// Filename : pluginterfaces/base/iupdatehandler.h -// Created by : Steinberg, 01/2004 -// Description : Update handling -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//------------------------------------------------------------------------------ - -#ifndef __iupdatehandler__ -#define __iupdatehandler__ - -#include "pluginterfaces/base/funknown.h" - -namespace Steinberg { - -class IDependent; - -//------------------------------------------------------------------------ -/** Host implements dependency handling for plugins. -[host imp] \n -[get this interface from IHostClasses] \n -[released N3.1] \n - -- Install/Remove change notifications -- Trigger updates when an object has changed - -Can be used between host-objects and the Plug-In or -inside the Plug-In to handle internal updates! - -\see IDependent -\ingroup frameworkHostClasses -*/ -//------------------------------------------------------------------------ -class IUpdateHandler: public FUnknown -{ -public: -//------------------------------------------------------------------------ - /** Install update notification for given object. It is essential to - remove all dependencies again using 'removeDependent'! Dependencies - are not removed automatically when the 'object' is released! - \param object : interface to object that sends change notifications - \param dependent : interface through which the update is passed */ - virtual tresult PLUGIN_API addDependent (FUnknown* object, IDependent* dependent) = 0; - - /** Remove a previously installed dependency.*/ - virtual tresult PLUGIN_API removeDependent (FUnknown* object, IDependent* dependent) = 0; - - /** Inform all dependents, that object has changed. - \param object is the object that has changed - \param message is a value of enum IDependent::ChangeMessage, usually IDependent::kChanged - can be - a private message as well (only known to sender and dependent)*/ - virtual tresult PLUGIN_API triggerUpdates (FUnknown* object, int32 message) = 0; - - /** Same as triggerUpdates, but delivered in idle (usefull to collect updates).*/ - virtual tresult PLUGIN_API deferUpdates (FUnknown* object, int32 message) = 0; - static const FUID iid; -}; - -DECLARE_CLASS_IID (IUpdateHandler, 0xF5246D56, 0x86544d60, 0xB026AFB5, 0x7B697B37) - -//------------------------------------------------------------------------ -/** A dependent will get notified about changes of a model. -[plug imp] -- notify changes of a model - -\see IUpdateHandler -\ingroup frameworkHostClasses -*/ -//------------------------------------------------------------------------ -class IDependent: public FUnknown -{ -public: -//------------------------------------------------------------------------ - /** Inform the dependent, that the passed FUnknown has changed. */ - virtual void PLUGIN_API update (FUnknown* changedUnknown, int32 message) = 0; - - enum ChangeMessage - { - kWillChange, - kChanged, - kDestroyed, - kWillDestroy, - - kStdChangeMessageLast = kWillDestroy - }; - //------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IDependent, 0xF52B7AAE, 0xDE72416d, 0x8AF18ACE, 0x9DD7BD5E) - -} - -#endif diff --git a/vst/pluginterfaces/base/keycodes.h b/vst/pluginterfaces/base/keycodes.h deleted file mode 100644 index b2b29223..00000000 --- a/vst/pluginterfaces/base/keycodes.h +++ /dev/null @@ -1,166 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : SDK Core -// -// Category : SDK Core Interfaces -// Filename : pluginterfaces/base/keycodes.h -// Created by : Steinberg, 01/2004 -// Description : Key Code Definitions -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#ifndef __plugkeycodes__ -#define __plugkeycodes__ - -#include "pluginterfaces/base/ftypes.h" - -namespace Steinberg { -//------------------------------------------------------------------------------ -/** Virtual Key Codes. -OS-independent enumeration of virtual keycodes. -*/ -//------------------------------------------------------------------------------ -enum VirtualKeyCodes -{ - KEY_BACK = 1, - KEY_TAB, - KEY_CLEAR, - KEY_RETURN, - KEY_PAUSE, - KEY_ESCAPE, - KEY_SPACE, - KEY_NEXT, - KEY_END, - KEY_HOME, - - KEY_LEFT, - KEY_UP, - KEY_RIGHT, - KEY_DOWN, - KEY_PAGEUP, - KEY_PAGEDOWN, - - KEY_SELECT, - KEY_PRINT, - KEY_ENTER, - KEY_SNAPSHOT, - KEY_INSERT, - KEY_DELETE, - KEY_HELP, - KEY_NUMPAD0, - KEY_NUMPAD1, - KEY_NUMPAD2, - KEY_NUMPAD3, - KEY_NUMPAD4, - KEY_NUMPAD5, - KEY_NUMPAD6, - KEY_NUMPAD7, - KEY_NUMPAD8, - KEY_NUMPAD9, - KEY_MULTIPLY, - KEY_ADD, - KEY_SEPARATOR, - KEY_SUBTRACT, - KEY_DECIMAL, - KEY_DIVIDE, - KEY_F1, - KEY_F2, - KEY_F3, - KEY_F4, - KEY_F5, - KEY_F6, - KEY_F7, - KEY_F8, - KEY_F9, - KEY_F10, - KEY_F11, - KEY_F12, - KEY_NUMLOCK, - KEY_SCROLL, - - KEY_SHIFT, - KEY_CONTROL, - KEY_ALT, - - KEY_EQUALS, // only occurs on a Mac - KEY_CONTEXTMENU, // Windows only - - // multimedia keys - KEY_MEDIA_PLAY, - KEY_MEDIA_STOP, - KEY_MEDIA_PREV, - KEY_MEDIA_NEXT, - KEY_VOLUME_UP, - KEY_VOLUME_DOWN, - - KEY_F13, - KEY_F14, - KEY_F15, - KEY_F16, - KEY_F17, - KEY_F18, - KEY_F19, - - VKEY_FIRST_CODE = KEY_BACK, - VKEY_LAST_CODE = KEY_F19, - - VKEY_FIRST_ASCII = 128 - /* - KEY_0 - KEY_9 are the same as ASCII '0' - '9' (0x30 - 0x39) + FIRST_ASCII - KEY_A - KEY_Z are the same as ASCII 'A' - 'Z' (0x41 - 0x5A) + FIRST_ASCII - */ -}; - -//------------------------------------------------------------------------------ -inline tchar VirtualKeyCodeToChar (uint8 vKey) -{ - if (vKey >= VKEY_FIRST_ASCII) - return (tchar)(vKey - VKEY_FIRST_ASCII + 0x30); - else if (vKey == KEY_SPACE) - return ' '; - return 0; -} - -//------------------------------------------------------------------------------ -inline uint8 CharToVirtualKeyCode (tchar character) -{ - if ((character >= 0x30 && character <= 0x39) || (character >= 0x41 && character <= 0x5A)) - return (uint8)(character - 0x30 + VKEY_FIRST_ASCII); - if (character == ' ') - return (uint8)KEY_SPACE; - return 0; -} - -//------------------------------------------------------------------------------ -enum KeyModifier -{ - kShiftKey = 1 << 0, ///< same on both PC and Mac - kAlternateKey = 1 << 1, ///< same on both PC and Mac - kCommandKey = 1 << 2, ///< windows ctrl key; mac cmd key (apple button) - kControlKey = 1 << 3 ///< windows: not assigned, mac: ctrl key -}; -} - -#endif // __plugkeycodes__ diff --git a/vst/pluginterfaces/base/pluginbasefwd.h b/vst/pluginterfaces/base/pluginbasefwd.h deleted file mode 100644 index fb82d994..00000000 --- a/vst/pluginterfaces/base/pluginbasefwd.h +++ /dev/null @@ -1,50 +0,0 @@ -//------------------------------------------------------------------------ -// Project : SDK Base -// Version : 1.0 -// -// Category : SDK Core Interfaces -// Filename : pluginterfaces/base/pluginbasefwd.h -// Created by : Steinberg, 10/2014 -// Description : Forward declarations for pluginterfaces base module -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#pragma once - -namespace Steinberg { - -class FUnknown; -class FUID; - -template class IPtr; - -class ICloneable; -class IDependent; -class IUpdateHandler; - -class IBStream; - -} // Steinberg diff --git a/vst/pluginterfaces/base/smartpointer.h b/vst/pluginterfaces/base/smartpointer.h deleted file mode 100644 index 1033768f..00000000 --- a/vst/pluginterfaces/base/smartpointer.h +++ /dev/null @@ -1,235 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : SDK Core -// -// Category : SDK Core Interfaces -// Filename : pluginterfaces/base/funknown.h -// Created by : Steinberg, 01/2004 -// Description : Basic Interface -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//------------------------------------------------------------------------------ - -#pragma once - -#include "pluginterfaces/base/fplatform.h" -#if SMTG_CPP11_STDLIBSUPPORT -#include -#endif - -//------------------------------------------------------------------------ -namespace Steinberg { - -//------------------------------------------------------------------------ -// IPtr -//------------------------------------------------------------------------ -/** IPtr - Smart pointer template class. - \ingroup pluginBase - - - can be used as an I* pointer - - handles refCount of the interface - - Usage example: - \code - IPtr path (sharedPath); - if (path) - path->ascend (); - \endcode - */ -//------------------------------------------------------------------------ -template -class IPtr -{ -public: -//------------------------------------------------------------------------ - inline IPtr (I* ptr, bool addRef = true); - inline IPtr (const IPtr&); - - template - inline IPtr (const IPtr& other) - : ptr (other.get ()) - { - if (ptr) - ptr->addRef (); - } - - inline IPtr (); - inline ~IPtr (); - - inline I* operator= (I* ptr); - - inline IPtr& operator= (const IPtr& other); - - template - inline IPtr& operator= (const IPtr& other) - { - operator= (other.get ()); - return *this; - } - - inline operator I* () const { return ptr; } // act as I* - inline I* operator-> () const { return ptr; } // act as I* - - inline I* get () const { return ptr; } - -#if SMTG_CPP11_STDLIBSUPPORT - inline IPtr (IPtr&& movePtr) : ptr (nullptr) { *this = std::move (movePtr); } - inline IPtr& operator= (IPtr&& movePtr) - { - if (ptr) - ptr->release (); - ptr = movePtr.ptr; - movePtr.ptr = nullptr; - return *this; - } -#endif -//------------------------------------------------------------------------ -protected: - I* ptr; -}; - -//------------------------------------------------------------------------ -template -inline IPtr::IPtr (I* _ptr, bool addRef) -: ptr (_ptr) -{ - if (ptr && addRef) - ptr->addRef (); -} - -//------------------------------------------------------------------------ -template -inline IPtr::IPtr (const IPtr& other) -: ptr (other.ptr) -{ - if (ptr) - ptr->addRef (); -} - -//------------------------------------------------------------------------ -template -inline IPtr::IPtr () -: ptr (0) -{ -} - -//------------------------------------------------------------------------ -template -inline IPtr::~IPtr () -{ - if (ptr) - ptr->release (); -} - -//------------------------------------------------------------------------ -template -inline I* IPtr::operator= (I* _ptr) -{ - if (_ptr != ptr) - { - if (ptr) - ptr->release (); - ptr = _ptr; - if (ptr) - ptr->addRef (); - } - return ptr; -} - -//------------------------------------------------------------------------ -template -inline IPtr& IPtr::operator= (const IPtr& _ptr) -{ - operator= (_ptr.ptr); - return *this; -} - -//------------------------------------------------------------------------ -/** OPtr - "owning" smart pointer used for newly created FObjects. - \ingroup pluginBase - - FUnknown implementations are supposed to have a refCount of 1 right after creation. - So using an IPtr on newly created objects would lead to a leak. - Instead the OPtr can be used in this case. \n - Example: - \code - OPtr path = FHostCreate (IPath, hostClasses); - // no release is needed... - \endcode - The assignment operator takes ownership of a new object and releases the old. - So its safe to write: - \code - OPtr path = FHostCreate (IPath, hostClasses); - path = FHostCreate (IPath, hostClasses); - path = 0; - \endcode - This is the difference to using an IPtr with addRef=false. - \code - // DONT DO THIS: - IPtr path (FHostCreate (IPath, hostClasses), false); - path = FHostCreate (IPath, hostClasses); - path = 0; - \endcode - This will lead to a leak! - */ -//------------------------------------------------------------------------ -template -class OPtr : public IPtr -{ -public: -//------------------------------------------------------------------------ - inline OPtr (I* p) : IPtr (p, false) {} - inline OPtr (const IPtr& p) : IPtr (p) {} - inline OPtr (const OPtr& p) : IPtr (p) {} - inline OPtr () {} - inline I* operator= (I* _ptr) - { - if (_ptr != this->ptr) - { - if (this->ptr) - this->ptr->release (); - this->ptr = _ptr; - } - return this->ptr; - } -}; - -//------------------------------------------------------------------------ -/** Assigning newly created object to an IPtr. - Example: - \code - IPtr path = owned (FHostCreate (IPath, hostClasses)); - \endcode - which is a slightly shorter form of writing: - \code - IPtr path = OPtr (FHostCreate (IPath, hostClasses)); - \endcode - */ -template -IPtr owned (I* p) -{ - return IPtr (p, false); -} - -//------------------------------------------------------------------------ -} // Steinberg diff --git a/vst/pluginterfaces/base/ustring.cpp b/vst/pluginterfaces/base/ustring.cpp deleted file mode 100644 index 01494340..00000000 --- a/vst/pluginterfaces/base/ustring.cpp +++ /dev/null @@ -1,216 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : SDK Core -// -// Category : Helpers -// Filename : pluginterfaces/base/ustring.cpp -// Created by : Steinberg, 12/2005 -// Description : UTF-16 String class -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//------------------------------------------------------------------------------ - -#include "ustring.h" - -#if WINDOWS -#include -#pragma warning (disable : 4996) - -#elif MAC -#include - -#endif - -//------------------------------------------------------------------------ -namespace Steinberg { - -//------------------------------------------------------------------------ -/** Copy strings of different character width. */ -//------------------------------------------------------------------------ -template -void StringCopy (TDstChar* dst, int32 dstSize, const TSrcChar* src, int32 srcSize = -1) -{ - int32 count = dstSize; - if (srcSize >= 0 && srcSize < dstSize) - count = srcSize; - for (int32 i = 0; i < count; i++) - { - dst[i] = (TDstChar)src[i]; - if (src[i] == 0) - break; - } - dst[dstSize - 1] = 0; -} - -//------------------------------------------------------------------------ -/** Find length of null-terminated string. */ -//------------------------------------------------------------------------ -template -int32 StringLength (const TSrcChar* src, int32 srcSize = -1) -{ - if (srcSize == 0) - return 0; - int32 length = 0; - while (src[length]) - { - length++; - if (srcSize > 0 && length >= srcSize) - break; - } - return length; -} - -//------------------------------------------------------------------------ -// UString -//------------------------------------------------------------------------ -int32 UString::getLength () const -{ - return StringLength (thisBuffer, thisSize); -} - -//------------------------------------------------------------------------ -UString& UString::assign (const char16* src, int32 srcSize) -{ - StringCopy (thisBuffer, thisSize, src, srcSize); - return *this; -} - -//------------------------------------------------------------------------ -UString& UString::append (const char16* src, int32 srcSize) -{ - int32 length = getLength (); - StringCopy (thisBuffer + length, thisSize - length, src, srcSize); - return *this; -} - -//------------------------------------------------------------------------ -const UString& UString::copyTo (char16* dst, int32 dstSize) const -{ - StringCopy (dst, dstSize, thisBuffer, thisSize); - return *this; -} - -//------------------------------------------------------------------------ -UString& UString::fromAscii (const char* src, int32 srcSize) -{ - StringCopy (thisBuffer, thisSize, src, srcSize); - return *this; -} - -//------------------------------------------------------------------------ -const UString& UString::toAscii (char* dst, int32 dstSize) const -{ - StringCopy (dst, dstSize, thisBuffer, thisSize); - return *this; -} - -//------------------------------------------------------------------------ -bool UString::scanFloat (double& value) const -{ -#if WINDOWS - return swscanf ((const wchar_t*)thisBuffer, L"%lf", &value) == 1; - -#elif TARGET_API_MAC_CARBON - CFStringRef cfStr = CFStringCreateWithBytes (0, (const UInt8 *)thisBuffer, getLength () * 2, kCFStringEncodingUTF16, false); - if (cfStr) - { - value = CFStringGetDoubleValue (cfStr); - CFRelease (cfStr); - return true; - } - return false; - -#else - // implement me! - return false; -#endif -} - -//------------------------------------------------------------------------ -bool UString::printFloat (double value, int32 precision) -{ -#if WINDOWS - return swprintf ((wchar_t*)thisBuffer, L"%.*lf", precision, value) == 1; -#elif MAC - bool result = false; - CFStringRef cfStr = CFStringCreateWithFormat (0, 0, CFSTR("%.*lf"), precision, value); - if (cfStr) - { - memset (thisBuffer, 0, thisSize); - CFRange range = {0, CFStringGetLength (cfStr)}; - CFStringGetBytes (cfStr, range, kCFStringEncodingUTF16, 0, false, (UInt8*)thisBuffer, thisSize, 0); - CFRelease (cfStr); - } - return result; -#else - // implement me! - return false; -#endif -} - -//------------------------------------------------------------------------ -bool UString::scanInt (int64& value) const -{ -#if WINDOWS - return swscanf ((const wchar_t*)thisBuffer, L"%I64d", &value) == 1; - -#elif MAC - CFStringRef cfStr = CFStringCreateWithBytes (0, (const UInt8 *)thisBuffer, getLength () * 2, kCFStringEncodingUTF16, false); - if (cfStr) - { - value = CFStringGetIntValue (cfStr); - CFRelease (cfStr); - return true; - } - return false; - -#else - // implement me! - return false; -#endif -} - -//------------------------------------------------------------------------ -bool UString::printInt (int64 value) -{ -#if WINDOWS - return swprintf ((wchar_t*)thisBuffer, L"%I64d", value) == 1; - -#elif MAC - CFStringRef cfStr = CFStringCreateWithFormat (0, 0, CFSTR("%lld"), value); - if (cfStr) - { - memset (thisBuffer, 0, thisSize); - CFRange range = {0, CFStringGetLength (cfStr)}; - CFStringGetBytes (cfStr, range, kCFStringEncodingUTF16, 0, false, (UInt8*)thisBuffer, thisSize, 0); - CFRelease (cfStr); - return true; - } - return false; -#else - // implement me! - return false; -#endif -} -} // namespace Steinberg diff --git a/vst/pluginterfaces/base/ustring.h b/vst/pluginterfaces/base/ustring.h deleted file mode 100644 index d7441a96..00000000 --- a/vst/pluginterfaces/base/ustring.h +++ /dev/null @@ -1,130 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : SDK Core -// -// Category : Helpers -// Filename : pluginterfaces/base/ustring.h -// Created by : Steinberg, 12/2005 -// Description : UTF-16 String class -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//------------------------------------------------------------------------------ - -#ifndef __ustring__ -#define __ustring__ - -#include "ftypes.h" - -//------------------------------------------------------------------------ -namespace Steinberg { - -//------------------------------------------------------------------------ -/** UTF-16 string class without buffer management. */ -//------------------------------------------------------------------------ -class UString -{ -public: -//------------------------------------------------------------------------ - 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 length of string (in code units). */ - int32 getLength () const; - - /** Copy from UTF-16 buffer. */ - UString& assign (const char16* src, int32 srcSize = -1); - - /** Append UTF-16 buffer. */ - UString& append (const char16* src, int32 srcSize = -1); - - /** Copy to UTF-16 buffer. */ - const UString& copyTo (char16* dst, int32 dstSize) const; - - /** Copy from ASCII string. */ - UString& fromAscii (const char* src, int32 srcSize = -1); - UString& assign (const char* src, int32 srcSize = -1) { return fromAscii (src, srcSize); } - - /** Copy to ASCII string. */ - const UString& toAscii (char* dst, int32 dstSize) const; - - /** Scan integer from string. */ - bool scanInt (int64& value) const; - - /** Print integer to string. */ - bool printInt (int64 value); - - /** Scan float from string. */ - bool scanFloat (double& value) const; - - /** Print float to string. */ - bool printFloat (double value, int32 precision = 4); -//------------------------------------------------------------------------ -protected: - char16* thisBuffer; - int32 thisSize; -}; - -//------------------------------------------------------------------------ -/** UTF-16 string with fixed buffer size. */ -//------------------------------------------------------------------------ -template -class UStringBuffer: public UString -{ -public: -//------------------------------------------------------------------------ - 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); } - - /** Construct from ASCII string. */ - 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 -} // namespace Steinberg - -//------------------------------------------------------------------------ -#define USTRING(asciiString) Steinberg::UString256 (asciiString) -#define USTRINGSIZE(var) (sizeof (var) / sizeof (Steinberg::char16)) - -//------------------------------------------------------------------------ - -#endif diff --git a/vst/pluginterfaces/gui/iplugview.h b/vst/pluginterfaces/gui/iplugview.h deleted file mode 100644 index 6239ada4..00000000 --- a/vst/pluginterfaces/gui/iplugview.h +++ /dev/null @@ -1,200 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : SDK Core -// -// Category : SDK GUI Interfaces -// Filename : pluginterfaces/gui/iplugview.h -// Created by : Steinberg, 12/2007 -// Description : Plug-in User Interface -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//------------------------------------------------------------------------------ - -#ifndef __iplugview__ -#define __iplugview__ - -#include "../base/funknown.h" - -namespace Steinberg { - -class IPlugFrame; - -//------------------------------------------------------------------------ -/*! \defgroup pluginGUI Graphical User Interface -*/ - -//------------------------------------------------------------------------ -/** Graphical rectangle structure. Used with IPlugView. -\ingroup pluginGUI -*/ -//------------------------------------------------------------------------ -struct ViewRect -{ -//------------------------------------------------------------------------ - ViewRect (int32 l = 0, int32 t = 0, int32 r = 0, int32 b = 0) - : left (l), top (t), right (r), bottom (b) {} - - int32 left; - int32 top; - int32 right; - int32 bottom; -//------------------------------------------------------------------------ - int32 getWidth () const { return right - left; } - int32 getHeight () const { return bottom - top; } -//------------------------------------------------------------------------ -}; - -//------------------------------------------------------------------------ -/** \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 parent parameter in IPlugView::attached() is a HWND handle. You should attach a child window to it. */ -const FIDString kPlatformTypeHWND = "HWND"; ///< HWND handle. (Microsoft Windows) - -/** The parent parameter in IPlugView::attached() is a WindowRef. You should attach a HIViewRef to the content view of the window. */ -const FIDString kPlatformTypeHIView = "HIView"; ///< HIViewRef. (Mac OS X) - -/** The parent parameter in IPlugView::attached() is a NSView pointer. You should attach a NSView to it. */ -const FIDString kPlatformTypeNSView = "NSView"; ///< NSView pointer. (Mac OS X) - -/** The parent parameter in IPlugView::attached() is a UIView pointer. You should attach an UIView to it. */ -const FIDString kPlatformTypeUIView = "UIView"; ///< UIView pointer. (iOS) -/*@}*/ -//------------------------------------------------------------------------ - -//------------------------------------------------------------------------ -/** Plug-in definition of a view. -\ingroup pluginGUI -- [plug imp] - -\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 -a view to be resized: -\n -- Host : 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 calls IPlugView::onSize(). - \n \n -- Plug-in : The Plug-in can call IPlugFrame::resizeView () and cause the host to resize the window. - Afterwards IPlugView::onSize() is called. -. -\n -Please only resize the platform representation of the view when IPlugView::onSize() is called. - -\par Keyboard handling -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 disfunction of the -host's key command handling! - -\see IPlugFrame, \ref platformUIType -*/ -//------------------------------------------------------------------------ -class IPlugView: public FUnknown -{ -public: -//------------------------------------------------------------------------ - /** Is Platform UI Type supported - \param type : IDString of \ref platformUIType */ - virtual tresult PLUGIN_API isPlatformTypeSupported (FIDString type) = 0; - - /** The parent window of the view has been created, the - (platform) representation of the view 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. - \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; - - /** The parent window of the view is about to be destroyed. - You have to remove all your own views from the parent window or view. */ - virtual tresult PLUGIN_API removed () = 0; - - /** Handling of mouse wheel. */ - virtual tresult PLUGIN_API onWheel (float distance) = 0; - - /** Handling of keyboard events : Key Down. - \param key : unicode code of key - \param keyCode : virtual keycode for non ascii keys - see \ref VirtualKeyCodes in keycodes.h - \param modifiers : any combination of modifiers - see \ref KeyModifier in keycodes.h - \return kResultTrue if the key is handled, otherwise kResultFalse. \n - Please note that kResultTrue must only be returned if the key has really been handled. - Otherwise key command handling of the host might be blocked! */ - virtual tresult PLUGIN_API onKeyDown (char16 key, int16 keyCode, int16 modifiers) = 0; - - /** Handling of keyboard events : Key Up. - \param key : unicode code of key - \param keyCode : virtual keycode for non ascii keys - see \ref VirtualKeyCodes in keycodes.h - \param modifiers : any combination of KeyModifier - see \ref KeyModifier in keycodes.h - \return kResultTrue if the key is handled, otherwise return kResultFalse. */ - virtual tresult PLUGIN_API onKeyUp (char16 key, int16 keyCode, int16 modifiers) = 0; - - /** 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. */ - 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. */ - virtual tresult PLUGIN_API setFrame (IPlugFrame* frame) = 0; - - /** Is view sizable by user. */ - virtual tresult PLUGIN_API canResize () = 0; - - /** On live resize this is called to check if the view can be resized to the given rect, if not adjust the rect to the allowed size. */ - virtual tresult PLUGIN_API checkSizeConstraint (ViewRect* rect) = 0; -//------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IPlugView, 0x5BC32507, 0xD06049EA, 0xA6151B52, 0x2B755B29) - -//------------------------------------------------------------------------ -/** Callback interface passed to IPlugView. -\ingroup pluginGUI -- [host imp] - -Enables a Plug-in to resize the view and cause the host to resize the window. -*/ -//------------------------------------------------------------------------ -class IPlugFrame: public FUnknown -{ -public: -//------------------------------------------------------------------------ - /** Called to inform the host about the resize of a given view. */ - virtual tresult PLUGIN_API resizeView (IPlugView* view, ViewRect* newSize) = 0; -//------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IPlugFrame, 0x367FAF01, 0xAFA94693, 0x8D4DA2A0, 0xED0882A3) -} // namespace Steinberg - -#endif diff --git a/vst/pluginterfaces/test/itest.h b/vst/pluginterfaces/test/itest.h deleted file mode 100644 index 3c50c2c1..00000000 --- a/vst/pluginterfaces/test/itest.h +++ /dev/null @@ -1,171 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : SDK Core -// -// Category : SDK Core Interfaces -// Filename : pluginterfaces/test/itest.h -// Created by : Steinberg, 01/2005 -// Description : Test Interface - Availability Depends on HOST -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2014, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//------------------------------------------------------------------------------ - -#ifndef __itest__ -#define __itest__ - -#ifndef __funknown__ -#include "../base/funknown.h" -#endif - -#ifndef kTestClass -#define kTestClass "Test Class" ///< A class for automated tests -#endif - -namespace Steinberg { - -class ITestResult; - -//------------------------------------------------------------------------ -// ITest interface declaration -//------------------------------------------------------------------------ -class ITest : public FUnknown -{ -public: -//------------------------------------------------------------------------ - /** called immediately before the test is actually run. - Usually this will be used to setup the test environment. - \return true upon success */ - virtual bool PLUGIN_API setup () = 0; - - /** execute the test. - \param testResult : points to a test result where the test can - (optionally) add an error message. - \return true upon success - \sa ITestResult */ - virtual bool PLUGIN_API run (ITestResult* testResult) = 0; - - /** called after the test has run. This method shall be used to - deconstruct a test environment that has been setup with ITest::setup (). - \return true upon success */ - virtual bool PLUGIN_API teardown () = 0; - - /** This function is used to provide information about the performed - testcase. What is done, what is validated and what has to be prepared - before executing the test (in case of half-automated tests). - \return null terminated string upon success, zero otherwise */ - virtual const tchar* PLUGIN_API getDescription () {return 0;} -//------------------------------------------------------------------------ - static const FUID iid; -}; - -#ifdef UNICODE -DECLARE_CLASS_IID (ITest, 0xFE64FC19, 0x95684F53, 0xAAA78DC8, 0x7228338E) -#else -DECLARE_CLASS_IID (ITest, 0x9E2E608B, 0x64C64CF8, 0x839059BD, 0xA194032D) -#endif - -//------------------------------------------------------------------------ -// ITestResult interface declaration -//------------------------------------------------------------------------ -/** Test Result message logger -[host imp] -when a test is called, a pointer to an ITestResult is passed in, so the -test class can output error messages -*/ -//------------------------------------------------------------------------ -class ITestResult : public FUnknown -{ -public: -//------------------------------------------------------------------------ - /** add an error message */ - virtual void PLUGIN_API addErrorMessage (const tchar* msg) = 0; - virtual void PLUGIN_API addMessage (const tchar* msg) = 0; -//------------------------------------------------------------------------ - static const FUID iid; -}; - -#ifdef UNICODE -DECLARE_CLASS_IID (ITestResult, 0x69796279, 0xF651418B, 0xB24D79B7, 0xD7C527F4) -#else -DECLARE_CLASS_IID (ITestResult, 0xCE13B461, 0x5334451D, 0xB3943E99, 0x7446885B) -#endif - -//------------------------------------------------------------------------ -// ITestSuite interface declaration -//------------------------------------------------------------------------ -/** A collection of tests supporting a hierarchical ordering -[host imp] -[create via hostclasses]*/ -//------------------------------------------------------------------------ -class ITestSuite : public FUnknown -{ -public: -//------------------------------------------------------------------------ - /** append a new test */ - virtual tresult PLUGIN_API addTest (FIDString name, ITest* test) = 0; - - /** append an entire test suite as a child suite */ - virtual tresult PLUGIN_API addTestSuite (FIDString name, ITestSuite* testSuite) = 0; - - virtual tresult PLUGIN_API setEnvironment (ITest* environment) = 0; - -//------------------------------------------------------------------------ - static const FUID iid; -}; - -#ifdef UNICODE -DECLARE_CLASS_IID (ITestSuite, 0x5CA7106F, 0x98784AA5, 0xB4D30D71, 0x2F5F1498) -#else -DECLARE_CLASS_IID (ITestSuite, 0x81724C94, 0xE9F64F65, 0xACB104E9, 0xCC702253) -#endif - -//------------------------------------------------------------------------ -// ITestFactory interface declaration -//------------------------------------------------------------------------ -/** Class factory that any testable module defines for creating tests -that will be executed from the host -[plug imp] \n -*/ -//------------------------------------------------------------------------ -class ITestFactory : public FUnknown -{ -public: -//------------------------------------------------------------------------ - /** create the tests that this module provides. - \param parentSuite : the test suite that the newly created tests - shall register with. */ - virtual tresult PLUGIN_API createTests (FUnknown* context, ITestSuite* parentSuite) = 0; -//------------------------------------------------------------------------ - static const FUID iid; -}; - -#ifdef UNICODE -DECLARE_CLASS_IID (ITestFactory, 0xAB483D3A, 0x15264650, 0xBF86EEF6, 0x9A327A93) -#else -DECLARE_CLASS_IID (ITestFactory, 0xE77EA913, 0x58AA4838, 0x986A4620, 0x53579080) -#endif - -} - -#endif diff --git a/vst/pluginterfaces/vst/ivstattributes.h b/vst/pluginterfaces/vst/ivstattributes.h deleted file mode 100644 index c92bcd89..00000000 --- a/vst/pluginterfaces/vst/ivstattributes.h +++ /dev/null @@ -1,163 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Interfaces -// Filename : pluginterfaces/vst/ivstattributes.h -// Created by : Steinberg, 05/2006 -// Description : VST Attribute Interfaces -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#pragma once - -#include "pluginterfaces/base/funknown.h" -#include "pluginterfaces/vst/vsttypes.h" - -//------------------------------------------------------------------------ -#include "pluginterfaces/base/falignpush.h" -//------------------------------------------------------------------------ - -//------------------------------------------------------------------------ -namespace Steinberg { -namespace Vst { -//------------------------------------------------------------------------ -/** Attribute list used in IMessage and IStreamAttributes. -\ingroup vstIHost vst300 -- [host imp] -- [released: 3.0.0] - -An attribute list associates values with a key (id: some predefined keys could be found in \ref presetAttributes). */ -//------------------------------------------------------------------------ -class IAttributeList: public FUnknown -{ -public: -//------------------------------------------------------------------------ - typedef const char* AttrID; - - /** Sets integer value. */ - virtual tresult PLUGIN_API setInt (AttrID id, int64 value) = 0; - - /** Gets integer value. */ - virtual tresult PLUGIN_API getInt (AttrID id, int64& value) = 0; - - /** Sets float value. */ - virtual tresult PLUGIN_API setFloat (AttrID id, double value) = 0; - - /** Gets float value. */ - virtual tresult PLUGIN_API getFloat (AttrID id, double& value) = 0; - - /** Sets string value (UTF16). */ - 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; - - /** Sets binary data. */ - virtual tresult PLUGIN_API setBinary (AttrID id, const void* data, uint32 size) = 0; - - /** Gets binary data. */ - virtual tresult PLUGIN_API getBinary (AttrID id, const void*& data, uint32& size) = 0; -//------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IAttributeList, 0x1E5F0AEB, 0xCC7F4533, 0xA2544011, 0x38AD5EE4) - -//------------------------------------------------------------------------ -/** Meta attributes of a stream. -\ingroup vstIHost vst360 -- [host imp] -- [extends IBStream] -- [released: 3.6.0] - -\code -... -#include "pluginterfaces/base/ustring.h" -#include "pluginterfaces/vst/vstpresetkeys.h" -... - -tresult PLUGIN_API MyPlugin::setState (IBStream* state) -{ - FUnknownPtr stream (state); - if (stream) - { - IAttributeList* list = stream->getAttributes (); - if (list) - { - // get the current type (project/Default..) of this state - String128 string; - if (list->getString (PresetAttributes::kStateType, string, 128 * sizeof (TChar)) == kResultTrue) - { - UString128 tmp (string); - char ascii[128]; - tmp.toAscii (ascii, 128); - if (!strncmp (ascii, StateType::kProject, strlen (StateType::kProject))) - { - // we are in project loading context... - } - } - - // get the full file path of this state - TChar fullPath[1024]; - if (list->getString (PresetAttributes::kFilePathStringType, fullPath, 1024 * sizeof (TChar)) == kResultTrue) - { - // here we have the full path ... - } - } - } - - //...read the state here..... - 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 -{ -public: - //------------------------------------------------------------------------ - /** Gets filename (without file extension) of the stream. */ - virtual tresult PLUGIN_API getFileName (String128 name) = 0; - - /** Gets meta information list. */ - virtual IAttributeList* PLUGIN_API getAttributes () = 0; - //------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IStreamAttributes, 0xD6CE2FFC, 0xEFAF4B8C, 0x9E74F1BB, 0x12DA44B4) - - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg - -//------------------------------------------------------------------------ -#include "pluginterfaces/base/falignpop.h" -//------------------------------------------------------------------------ diff --git a/vst/pluginterfaces/vst/ivstaudioprocessor.h b/vst/pluginterfaces/vst/ivstaudioprocessor.h deleted file mode 100644 index 363b20a2..00000000 --- a/vst/pluginterfaces/vst/ivstaudioprocessor.h +++ /dev/null @@ -1,360 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Interfaces -// Filename : pluginterfaces/vst/ivstaudioprocessor.h -// Created by : Steinberg, 10/2005 -// Description : VST Audio Processing Interfaces -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#pragma once - -#include "ivstcomponent.h" - -//------------------------------------------------------------------------ -#include "pluginterfaces/base/falignpush.h" -//------------------------------------------------------------------------ - -//------------------------------------------------------------------------ -/** Class Category Name for Audio Processor Component */ -//------------------------------------------------------------------------ -#ifndef kVstAudioEffectClass -#define kVstAudioEffectClass "Audio Module Class" -#endif - -//------------------------------------------------------------------------ -namespace Steinberg { -namespace Vst { -class IEventList; -class IParameterChanges; -struct ProcessContext; - -//------------------------------------------------------------------------ -/** Component Types used as subCategories in PClassInfo2 */ -//------------------------------------------------------------------------ -namespace PlugType -{ -/** -\defgroup plugType Plug-in Type used for subCategories */ -/*@{*/ -//------------------------------------------------------------------------ -const CString kFxAnalyzer = "Fx|Analyzer"; ///< Scope, FFT-Display, Loudness Processing... -const CString kFxDelay = "Fx|Delay"; ///< Delay, Multi-tap Delay, Ping-Pong Delay... -const CString kFxDistortion = "Fx|Distortion"; ///< Amp Simulator, Sub-Harmonic, SoftClipper... -const CString kFxDynamics = "Fx|Dynamics"; ///< Compressor, Expander, Gate, Limiter, Maximizer, Tape Simulator, EnvelopeShaper... -const CString kFxEQ = "Fx|EQ"; ///< Equalization, Graphical EQ... -const CString kFxFilter = "Fx|Filter"; ///< WahWah, ToneBooster, Specific Filter,... -const CString kFx = "Fx"; ///< others type (not categorized) -const CString kFxInstrument = "Fx|Instrument"; ///< Fx which could be loaded as Instrument too -const CString kFxInstrumentExternal = "Fx|Instrument|External"; ///< Fx which could be loaded as Instrument too and is external (wrapped Hardware) -const CString kFxSpatial = "Fx|Spatial"; ///< MonoToStereo, StereoEnhancer,... -const CString kFxGenerator = "Fx|Generator"; ///< Tone Generator, Noise Generator... -const CString kFxMastering = "Fx|Mastering"; ///< Dither, Noise Shaping,... -const CString kFxModulation = "Fx|Modulation"; ///< Phaser, Flanger, Chorus, Tremolo, Vibrato, AutoPan, Rotary, Cloner... -const CString kFxPitchShift = "Fx|Pitch Shift"; ///< Pitch Processing, Pitch Correction, Vocal Tuning... -const CString kFxRestoration = "Fx|Restoration"; ///< Denoiser, Declicker,... -const CString kFxReverb = "Fx|Reverb"; ///< Reverberation, Room Simulation, Convolution Reverb... -const CString kFxSurround = "Fx|Surround"; ///< dedicated to surround processing: LFE Splitter, Bass Manager... -const CString kFxTools = "Fx|Tools"; ///< Volume, Mixer, Tuner... -const CString kFxNetwork = "Fx|Network"; ///< using Network - -const CString kInstrument = "Instrument"; ///< Effect used as instrument (sound generator), not as insert -const CString kInstrumentDrum = "Instrument|Drum"; ///< Instrument for Drum sounds -const CString kInstrumentSampler = "Instrument|Sampler"; ///< Instrument based on Samples -const CString kInstrumentSynth = "Instrument|Synth"; ///< Instrument based on Synthesis -const CString kInstrumentSynthSampler = "Instrument|Synth|Sampler"; ///< Instrument based on Synthesis and Samples -const CString kInstrumentExternal = "Instrument|External";///< External Instrument (wrapped Hardware) - -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 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 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] - -//------------------------------------------------------------------------ -/*@}*/ -} - -//------------------------------------------------------------------------ -/** Component Flags used as classFlags in PClassInfo2 */ -//------------------------------------------------------------------------ -enum ComponentFlags -{ -//------------------------------------------------------------------------ - kDistributable = 1 << 0, ///< Component can be run on remote computer - kSimpleModeSupported = 1 << 1 ///< Component supports simple IO mode (or works in simple mode anyway) see \ref vst3IoMode -//------------------------------------------------------------------------ -}; - -//------------------------------------------------------------------------ -/** Symbolic sample size. -\see ProcessSetup, ProcessData */ -//------------------------------------------------------------------------ -enum SymbolicSampleSizes -{ - kSample32, ///< 32-bit precision - kSample64 ///< 64-bit precision -}; - -//------------------------------------------------------------------------ -/** 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. -- 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 - (e.g. disk streaming)! - 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, - 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 - 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 */ -//------------------------------------------------------------------------ -enum ProcessModes -{ - kRealtime, ///< realtime processing - kPrefetch, ///< prefetch processing - kOffline ///< offline processing -}; - -//------------------------------------------------------------------------ -/** Tail enum. -\see IAudioProcessor::getTailSamples */ -//------------------------------------------------------------------------ -enum TailEnum -{ - kNoTail = 0, ///< to be returned by getTailSamples when no tail is wanted - kInfiniteTail = kMaxInt32u ///< to be returned by getTailSamples when infinite tail is wanted -}; - -//------------------------------------------------------------------------ -/** Audio processing setup. -\see IAudioProcessor::setupProcessing */ -//------------------------------------------------------------------------ -struct ProcessSetup -{ -//------------------------------------------------------------------------ - int32 processMode; ///< \ref ProcessModes - int32 symbolicSampleSize; ///< \ref SymbolicSampleSizes - int32 maxSamplesPerBlock; ///< maximum number of samples per audio block - SampleRate sampleRate; ///< sample rate -//------------------------------------------------------------------------ -}; - -//------------------------------------------------------------------------ -/** 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). -- 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. - 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 */ -//------------------------------------------------------------------------ -struct AudioBusBuffers -{ - AudioBusBuffers () : numChannels (0), silenceFlags (0), channelBuffers64 (0) {} - -//------------------------------------------------------------------------ - int32 numChannels; ///< number of audio channels in bus - uint64 silenceFlags; ///< Bitset of silence state per channel - union - { - Sample32** channelBuffers32; ///< sample buffers to process with 32-bit precision - Sample64** channelBuffers64; ///< sample buffers to process with 64-bit precision - }; -//------------------------------------------------------------------------ -}; - -//------------------------------------------------------------------------ -/** Any data needed in audio processing. - 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 */ -//------------------------------------------------------------------------ -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) {} - -//------------------------------------------------------------------------ - 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 - - IParameterChanges* inputParameterChanges; ///< incoming parameter changes for this block - IParameterChanges* outputParameterChanges; ///< outgoing parameter changes for this block (optional) - IEventList* inputEvents; ///< incoming events for this block (optional) - IEventList* outputEvents; ///< outgoing events for this block (optional) - ProcessContext* processContext; ///< processing context (optional, but most welcome) -//------------------------------------------------------------------------ -}; - -//------------------------------------------------------------------------ -/** Audio Processing Interface. -\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 -{ -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. */ - 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. */ - 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 - 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. */ - 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). */ - 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 - 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 - downmix (avoiding signal cut (clicks)). - It should return: - - kNoTail when no tail - - x * sampleRate when x Sec tail. - - kInfiniteTail when infinite tail. */ - virtual uint32 PLUGIN_API getTailSamples () = 0; - -//------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IAudioProcessor, 0x42043F99, 0xB7DA453C, 0xA569E79D, 0x9AAEC33D) - -//------------------------------------------------------------------------ -/** Extended IAudioProcessor interface for a component. -\ingroup vstIPlug vst310 -- [plug imp] -- [extends IAudioProcessor] -- [released: 3.1.0] - -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 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. - -A value of zero means either 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. -\see IAudioProcessor -\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. */ - virtual tresult PLUGIN_API setAudioPresentationLatencySamples (BusDirection dir, int32 busIndex, uint32 latencyInSamples) = 0; - - //------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IAudioPresentationLatency, 0x309ECE78, 0xEB7D4fae, 0x8B2225D9, 0x09FD08B6) - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg - -//------------------------------------------------------------------------ -#include "pluginterfaces/base/falignpop.h" -//------------------------------------------------------------------------ diff --git a/vst/pluginterfaces/vst/ivstautomationstate.h b/vst/pluginterfaces/vst/ivstautomationstate.h deleted file mode 100644 index 58fd8725..00000000 --- a/vst/pluginterfaces/vst/ivstautomationstate.h +++ /dev/null @@ -1,84 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Interfaces -// Filename : pluginterfaces/vst/ivstautomationstate.h -// Created by : Steinberg, 02/2015 -// Description : VST Automation State Interface -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- -#pragma once - -#include "pluginterfaces/vst/vsttypes.h" - -//------------------------------------------------------------------------ -#include "pluginterfaces/base/falignpush.h" -//------------------------------------------------------------------------ - -//------------------------------------------------------------------------ -namespace Steinberg { -namespace Vst { - -//------------------------------------------------------------------------ -/** Extended IComponent interface for a component. -\ingroup vstIPlug vst365 -- [plug imp] -- [extends IComponent] -- [released: 3.6.5] -- [optional] - -Hosts could inform the Plug-in about its current automation state (Read/Write/Nothing). -*/ -//------------------------------------------------------------------------ -class IAutomationState : public FUnknown -{ -public: -//------------------------------------------------------------------------ - enum AutomationStates - { - kNoAutomation = 0, ///< Not Read and not Write - kReadState = 1 << 0, ///< Read state - kWriteState = 1 << 1, ///< Write state - - kReadWriteState = kReadState | kWriteState, ///< Read and Write enable - }; - - /** Sets the current Automation state. */ - virtual tresult PLUGIN_API setAutomationState (int32 state) = 0; - -//------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IAutomationState, 0xB4E8287F, 0x1BB346AA, 0x83A46667, 0x68937BAB) - -} // namespace Vst -} // namespace Steinberg - -//------------------------------------------------------------------------ -#include "pluginterfaces/base/falignpop.h" -//------------------------------------------------------------------------ diff --git a/vst/pluginterfaces/vst/ivstchannelcontextinfo.h b/vst/pluginterfaces/vst/ivstchannelcontextinfo.h deleted file mode 100644 index e0d8eab9..00000000 --- a/vst/pluginterfaces/vst/ivstchannelcontextinfo.h +++ /dev/null @@ -1,243 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Interfaces -// Filename : pluginterfaces/vst/ivstchannelcontextinfo.h -// Created by : Steinberg, 02/2014 -// Description : VST Channel Context Info Interface -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- -#pragma once - -#include "pluginterfaces/vst/vsttypes.h" -#include "pluginterfaces/vst/ivstattributes.h" - -//------------------------------------------------------------------------ -#include "pluginterfaces/base/falignpush.h" -//------------------------------------------------------------------------ - -//------------------------------------------------------------------------ -namespace Steinberg { -namespace Vst { -/** For Channel Context Info Interface */ -namespace ChannelContext { - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ -/** Channel Context Interface. -\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 -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 -for each change occurring to this channel (new name, new color, new indexation,...) - -\section IChannelContextExample Example -\code -tresult PLUGIN_API MyPlugin::setChannelContextInfos (IAttributeList* list) -{ - if (list) - { - // optional we can ask for the Channel Name Length - int64 length; - if (list->getInt (ChannelContext::kChannelNameLengthKey, length) == kResultTrue) - { - ... - } - - // get the Channel Name where we, as Plug-in, are instantiated - String128 name; - if (list->getString (ChannelContext::kChannelNameKey, name, sizeof (name)) == kResultTrue) - { - ... - } - - // get the Channel UID - if (list->getString (ChannelContext::kChannelUIDKey, name, sizeof (name)) == kResultTrue) - { - ... - } - - // get Channel Index - int64 index; - if (list->getInt (ChannelContext::kChannelIndexKey, index) == kResultTrue) - { - ... - } - - // get the Channel Color - int64 color; - if (list->getInt (ChannelContext::kChannelColorKey, color) == kResultTrue) - { - uint32 channelColor = (uint32)color; - String str; - str.printf ("%x%x%x%x", ChannelContext::GetAlpha (channelColor), - ChannelContext::GetRed (channelColor), - ChannelContext::GetGreen (channelColor), - ChannelContext::GetBlue (channelColor)); - String128 string128; - Steinberg::UString (string128, 128).fromAscii (str); - ... - } - - // get Channel Index Namespace Order of the current used index namespace - if (list->getInt (ChannelContext::kChannelIndexNamespaceOrderKey, index) == kResultTrue) - { - ... - } - - // get the channel Index Namespace Length - if (list->getInt (ChannelContext::kChannelIndexNamespaceLengthKey, length) == kResultTrue) - { - ... - } - - // get the channel Index Namespace - String128 namespaceName; - if (list->getString (ChannelContext::kChannelIndexNamespaceKey, namespaceName, sizeof (namespaceName)) == kResultTrue) - { - ... - } - - // get Plugin Channel Location - int64 location; - if (list->getInt (ChannelContext::kChannelPluginLocationKey, location) == kResultTrue) - { - String128 string128; - switch (location) - { - case ChannelContext::kPreVolumeFader: - Steinberg::UString (string128, 128).fromAscii ("PreVolFader"); - break; - case ChannelContext::kPostVolumeFader: - Steinberg::UString (string128, 128).fromAscii ("PostVolFader"); - break; - case ChannelContext::kUsedAsPanner: - Steinberg::UString (string128, 128).fromAscii ("UsedAsPanner"); - break; - default: Steinberg::UString (string128, 128).fromAscii ("unknown!"); - break; - } - } - - // do not forget to call addRef () if you want to keep this list - } -} -\endcode */ -//------------------------------------------------------------------------ -class IInfoListener: public FUnknown -{ -public: - /** Receive the channel context infos from host. */ - virtual tresult PLUGIN_API setChannelContextInfos (IAttributeList* list) = 0; - - static const FUID iid; -}; - -DECLARE_CLASS_IID (IInfoListener, 0x0F194781, 0x8D984ADA, 0xBBA0C1EF, 0xC011D8D0) - - -//------------------------------------------------------------------------ -/** Values used for kChannelPluginLocationKey */ -//------------------------------------------------------------------------ -enum ChannelPluginLocation -{ - kPreVolumeFader = 0, - kPostVolumeFader, - kUsedAsPanner -}; - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ -// Colors -typedef uint32 ColorSpec; ///< ARGB (Alpha-Red-Green-Blue) -typedef uint8 ColorComponent; - -inline ColorComponent GetBlue (ColorSpec cs) {return (ColorComponent)(cs & 0x000000FF); } -inline ColorComponent GetGreen (ColorSpec cs) {return (ColorComponent)((cs >> 8) & 0x000000FF); } -inline ColorComponent GetRed (ColorSpec cs) {return (ColorComponent)((cs >> 16) & 0x000000FF); } -inline ColorComponent GetAlpha (ColorSpec cs) {return (ColorComponent)((cs >> 24) & 0x000000FF); } - -//------------------------------------------------------------------------ -/** Keys used as AttrID (Attribute ID) in the return IAttributeList of - * IInfoListener::setChannelContextInfos */ -//------------------------------------------------------------------------ -/** string (TChar) [optional]: unique id string used to identify a channel */ -const CString kChannelUIDKey = "channel uid"; - -/** integer (int64) [optional]: number of characters in kChannelUIDKey */ -const CString kChannelUIDLengthKey = "channel uid length"; - -/** string (TChar) [optional]: name of the channel like displayed in the mixer */ -const CString kChannelNameKey = "channel name"; - -/** integer (int64) [optional]: number of characters in kChannelNameKey */ -const CString kChannelNameLengthKey = "channel name length"; - -/** color (ColorSpec) [optional]: used color for the channel in mixer or track */ -const CString kChannelColorKey = "channel color"; - -/** integer (int64) [optional]: index of the channel in a channel index namespace, start with 1 not * 0! */ -const CString kChannelIndexKey = "channel index"; - -/** integer (int64) [optional]: define the order of the current used index namespace, start with 1 not 0! - For example: - index namespace is "Input" -> order 1, - index namespace is "Channel" -> order 2, - index namespace is "Output" -> order 3 */ -const CString kChannelIndexNamespaceOrderKey = "channel index namespace order"; - -/** string (TChar) [optional]: name of the channel index namespace for example "Input", "Output", "Channel", ... */ -const CString kChannelIndexNamespaceKey = "channel index namespace"; - -/** integer (int64) [optional]: number of characters in kChannelIndexNamespaceKey */ -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) */ -const CString kChannelPluginLocationKey = "channel plugin location"; -//------------------------------------------------------------------------ - -} // namespace ChannelContext -} // namespace Vst -} // namespace Steinberg - -//------------------------------------------------------------------------ -#include "pluginterfaces/base/falignpop.h" -//------------------------------------------------------------------------ diff --git a/vst/pluginterfaces/vst/ivstcomponent.h b/vst/pluginterfaces/vst/ivstcomponent.h deleted file mode 100644 index 7088d4ab..00000000 --- a/vst/pluginterfaces/vst/ivstcomponent.h +++ /dev/null @@ -1,211 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Interfaces -// Filename : pluginterfaces/vst/ivstcomponent.h -// Created by : Steinberg, 04/2005 -// Description : Basic VST Interfaces -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#pragma once - -#include "pluginterfaces/base/ipluginbase.h" -#include "vsttypes.h" - -//------------------------------------------------------------------------ -#include "pluginterfaces/base/falignpush.h" -//------------------------------------------------------------------------ - -namespace Steinberg { -class IBStream; - -//------------------------------------------------------------------------ -/** All VST specific interfaces are located in Vst namespace */ -//------------------------------------------------------------------------ -namespace Vst { -const int32 kDefaultFactoryFlags = PFactoryInfo::kUnicode; ///< Standard value for PFactoryInfo::flags - -#define BEGIN_FACTORY_DEF(vendor,url,email) using namespace Steinberg; \ - EXPORT_FACTORY IPluginFactory* PLUGIN_API GetPluginFactory () { \ - if (!gPluginFactory) \ - { static PFactoryInfo factoryInfo (vendor,url,email,Vst::kDefaultFactoryFlags); \ - gPluginFactory = new CPluginFactory (factoryInfo); - -//------------------------------------------------------------------------ -/** \defgroup vstBus VST Buses -@{*/ - -//------------------------------------------------------------------------ -/** Bus media types */ -//------------------------------------------------------------------------ -enum MediaTypes -{ -//------------------------------------------------------------------------ - kAudio = 0, ///< audio - kEvent, ///< events - kNumMediaTypes -//------------------------------------------------------------------------ -}; - -//------------------------------------------------------------------------ -/** Bus directions */ -//------------------------------------------------------------------------ -enum BusDirections -{ -//------------------------------------------------------------------------ - kInput = 0, ///< input bus - kOutput ///< output bus -//------------------------------------------------------------------------ -}; - -//------------------------------------------------------------------------ -/** Bus types */ -//------------------------------------------------------------------------ -enum BusTypes -{ -//------------------------------------------------------------------------ - kMain = 0, ///< main bus - kAux ///< auxilliary bus (sidechain) -//------------------------------------------------------------------------ -}; - -//------------------------------------------------------------------------ -/** 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. - -See also: IComponent::getBusInfo , IComponent::activateBus -*/ -//------------------------------------------------------------------------ -struct BusInfo -{ -//------------------------------------------------------------------------ - MediaType mediaType; ///< Media type - has to be a value of \ref MediaTypes - BusDirection direction; ///< input or output \ref BusDirections - int32 channelCount; ///< number of channels (if used then need to be recheck after \ref IAudioProcessor::setBusArrangements is called) - String128 name; ///< name of the bus - BusType busType; ///< main or aux - has to be a value of \ref BusTypes - uint32 flags; ///< flags - a combination of \ref BusFlags - enum BusFlags - { - kDefaultActive = 1 << 0 ///< bus active per default - }; -//------------------------------------------------------------------------ -}; - -/*@}*/ - -//------------------------------------------------------------------------ -/** I/O modes */ -//------------------------------------------------------------------------ -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 -}; - -//------------------------------------------------------------------------ -/** Routing Information. - When the Plug-in supports multiple I/O buses, a host may want to know how the - buses 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 */ -//------------------------------------------------------------------------ -struct RoutingInfo -{ - MediaType mediaType; ///< media type see \ref MediaTypes - int32 busIndex; ///< bus index - int32 channel; ///< channel (-1 for all channels) -}; - -//------------------------------------------------------------------------ -// IComponent Interface -//------------------------------------------------------------------------ -/** Component Base Interface. -\ingroup vstIPlug vst300 -- [plug imp] -- [released: 3.0.0] -- [mandatory] - -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. -*/ -class IComponent: public IPluginBase -{ -public: -//------------------------------------------------------------------------ - /** Called before initializing the component to get information about the controller class. */ - virtual tresult PLUGIN_API getControllerClassId (TUID classId) = 0; - - /** 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 */ - virtual int32 PLUGIN_API getBusCount (MediaType type, BusDirection dir) = 0; - - /** 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; - - /** Activates / deactivates the component. */ - virtual tresult PLUGIN_API setActive (TBool state) = 0; - - /** Sets complete state of component. */ - virtual tresult PLUGIN_API setState (IBStream* state) = 0; - - /** Retrieves complete state of component. */ - virtual tresult PLUGIN_API getState (IBStream* state) = 0; - -//------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IComponent, 0xE831FF31, 0xF2D54301, 0x928EBBEE, 0x25697802) - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg - -//------------------------------------------------------------------------ -#include "pluginterfaces/base/falignpop.h" -//------------------------------------------------------------------------ diff --git a/vst/pluginterfaces/vst/ivstcontextmenu.h b/vst/pluginterfaces/vst/ivstcontextmenu.h deleted file mode 100644 index f44d9e40..00000000 --- a/vst/pluginterfaces/vst/ivstcontextmenu.h +++ /dev/null @@ -1,230 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Interfaces -// Filename : pluginterfaces/vst/ivstcontextmenu.h -// Created by : Steinberg, 10/2010 -// Description : VST Context Menu Interfaces -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#pragma once - -#include "pluginterfaces/base/funknown.h" -#include "vsttypes.h" - -//------------------------------------------------------------------------ -#include "pluginterfaces/base/falignpush.h" -//------------------------------------------------------------------------ - -namespace Steinberg { -class IPlugView; - -namespace Vst { -class IContextMenu; - -//------------------------------------------------------------------------ -/** Extended Host callback interface IComponentHandler3 for an edit controller. -\ingroup vstIHost vst350 -- [host imp] -- [extends IComponentHandler] -- [released: 3.5.0] - -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 - -\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. - -\sa IContextMenu -\sa IContextMenuTarget - -\section IContextMenuExample Example -Adding Plug-in specific items to the context menu -\code -class PluginContextMenuTarget : public IContextMenuTarget, public FObject -{ -public: - PluginContextMenuTarget () {} - - 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. - switch (tag) - { - case 1: break; - case 2: break; - } - return kResultTrue; - } - - OBJ_METHODS(PluginContextMenuTarget, FObject) - DEFINE_INTERFACES - DEF_INTERFACE (IContextMenuTarget) - END_DEFINE_INTERFACES (FObject) - REFCOUNT_METHODS(FObject) -}; - -// The following is the code to create the context menu -void popupContextMenu (IComponentHandler* componentHandler, IPlugView* view, const ParamID* paramID, UCoord x, UCoord y) -{ - if (componentHandler == 0 || view == 0) - return; - FUnknownPtr handler (componentHandler); - if (handler == 0) - return; - IContextMenu* menu = handler->createContextMenu (view, paramID); - if (menu) - { - // here you can add your entries (optional) - PluginContextMenuTarget* target = new PluginContextMenuTarget (); - - IContextMenu::Item item = {0}; - UString128 ("My Item 1").copyTo (item.name, 128); - item.tag = 1; - menu->addItem (item, target); - - UString128 ("My Item 2").copyTo (item.name, 128); - item.tag = 2; - menu->addItem (item, target); - target->release (); - //--end of adding new entries - - // here the the context menu will be pop-up (and it waits a user interaction) - menu->popup (x, y); - menu->release (); - } -} -\endcode -*/ -//------------------------------------------------------------------------ -class IComponentHandler3 : public FUnknown -{ -public: - /** 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. - */ - virtual IContextMenu* PLUGIN_API createContextMenu (IPlugView* plugView, const ParamID* paramID) = 0; - //------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IComponentHandler3, 0x69F11617, 0xD26B400D, 0xA4B6B964, 0x7B6EBBAB) - -//------------------------------------------------------------------------ -/** Context Menu Item Target Interface. -\ingroup vstIHost vstIPlug vst350 -- [host imp] -- [plug imp] -- [released: 3.5.0] - -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. -*/ -//------------------------------------------------------------------------ -class IContextMenuTarget : public FUnknown -{ -public: - /** Called when an menu item was executed. */ - virtual tresult PLUGIN_API executeMenuItem (int32 tag) = 0; - //------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IContextMenuTarget, 0x3CDF2E75, 0x85D34144, 0xBF86D36B, 0xD7C4894D) - -//------------------------------------------------------------------------ -/** Context Menu Interface. -\ingroup vstIHost vst350 -- [host imp] -- [create with IComponentHandler3::createContextMenu(..)] -- [released: 3.5.0] - -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. - -See IComponentHandler3 for more. -*/ -//------------------------------------------------------------------------ -class IContextMenu : public FUnknown -{ -public: - /** Item is a entry element of the context menu. */ - struct Item - { - String128 name; ///< Name of the item - int32 tag; ///< Identifier tag of the item - int32 flags; ///< Flags of the item - - enum Flags { - kIsSeparator = 1 << 0, ///< Item is a separator - kIsDisabled = 1 << 1, ///< Item is disabled - kIsChecked = 1 << 2, ///< Item is checked - kIsGroupStart = 1 << 3 | kIsDisabled, ///< Item is a group start (like sub folder) - kIsGroupEnd = 1 << 4 | kIsSeparator, ///< Item is a group end - }; - }; - - /** Gets the number of menu items. */ - virtual int32 PLUGIN_API getItemCount () = 0; - - /** Gets a menu item and its target (target could be not assigned). */ - virtual tresult PLUGIN_API getItem (int32 index, Item& item /*out*/, IContextMenuTarget** target /*out*/) = 0; - - /** Adds a menu item and its target. */ - virtual tresult PLUGIN_API addItem (const Item& item, IContextMenuTarget* target) = 0; - - /** 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. */ - virtual tresult PLUGIN_API popup (UCoord x, UCoord y) = 0; - - //------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IContextMenu, 0x2E93C863, 0x0C9C4588, 0x97DBECF5, 0xAD17817D) - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg - -//------------------------------------------------------------------------ -#include "pluginterfaces/base/falignpop.h" -//------------------------------------------------------------------------ diff --git a/vst/pluginterfaces/vst/ivsteditcontroller.h b/vst/pluginterfaces/vst/ivsteditcontroller.h deleted file mode 100644 index 69319033..00000000 --- a/vst/pluginterfaces/vst/ivsteditcontroller.h +++ /dev/null @@ -1,416 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Interfaces -// Filename : pluginterfaces/vst/ivsteditcontroller.h -// Created by : Steinberg, 09/2005 -// Description : VST Edit Controller Interfaces -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#pragma once - -#include "pluginterfaces/base/ipluginbase.h" -#include "vsttypes.h" - -//------------------------------------------------------------------------ -#include "pluginterfaces/base/falignpush.h" -//------------------------------------------------------------------------ - -//------------------------------------------------------------------------ -/** Class Category Name for Controller Component */ -//------------------------------------------------------------------------ -#ifndef kVstComponentControllerClass -#define kVstComponentControllerClass "Component Controller Class" -#endif - -//------------------------------------------------------------------------ -namespace Steinberg { -class IPlugView; -class IBStream; - -//------------------------------------------------------------------------ -namespace Vst { -//------------------------------------------------------------------------ -/** Controller Parameter Info. */ -//------------------------------------------------------------------------ -struct ParameterInfo -{ -//------------------------------------------------------------------------ - ParamID id; ///< unique identifier of this parameter (named tag too) - String128 title; ///< parameter title (e.g. "Volume") - 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) - 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) - - int32 flags; ///< ParameterFlags (see below) - enum ParameterFlags - { - kCanAutomate = 1 << 0, ///< parameter can be automated - kIsReadOnly = 1 << 1, ///< parameter cannot be changed from outside (implies that kCanAutomate is false) - 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] - - 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) - }; -//------------------------------------------------------------------------ -}; - -//------------------------------------------------------------------------ -/** View Types used for IEditController::createView */ -//------------------------------------------------------------------------ -namespace ViewType { -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...) [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] -}; - -//------------------------------------------------------------------------ -/** Host callback interface for an edit controller. -\ingroup vstIHost vst300 -- [host imp] -- [released: 3.0.0] - -Allow transfer of parameter editing to component (processor) via host and support automation. -Cause the host to react on configuration changes (restartComponent) - -\see IEditController */ -//------------------------------------------------------------------------ -class IComponentHandler: public FUnknown -{ -public: -//------------------------------------------------------------------------ - /** To be called before calling a performEdit (e.g. on mouse-click-down event). */ - 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. */ - virtual tresult PLUGIN_API performEdit (ParamID id, ParamValue valueNormalized) = 0; - - /** To be called after calling a performEdit (e.g. on mouse-click-up event). */ - virtual tresult PLUGIN_API endEdit (ParamID id) = 0; - - /** Instructs host to restart the component. This should be called in the UI-Thread context! - \param flags is a combination of RestartFlags */ - virtual tresult PLUGIN_API restartComponent (int32 flags) = 0; - -//------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IComponentHandler, 0x93A0BEA3, 0x0BD045DB, 0x8E890B0C, 0xC1E46AC6) - -//------------------------------------------------------------------------ -/** Extended Host callback interface IComponentHandler2 for an edit controller. -\ingroup vstIHost vst310 -- [host imp] -- [extends IComponentHandler] -- [released: 3.1.0] - -One part handles: -- Setting dirty state of 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) -which should use the same timestamp in the host when writing automation. -This allows for better synchronizing 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 (); -\endcode -\see IComponentHandler -\see IEditController*/ -//------------------------------------------------------------------------ -class IComponentHandler2: public FUnknown -{ -public: - //------------------------------------------------------------------------ - /** 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. - 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; - - //------------------------------------------------------------------------ - /** Starts the group editing (call before a \ref IComponentHandler::beginEdit), - the host will keep the current timestamp at this call and will use it for all \ref IComponentHandler::beginEdit - / \ref IComponentHandler::performEdit / \ref IComponentHandler::endEdit calls until a \ref finishGroupEdit (). */ - virtual tresult PLUGIN_API startGroupEdit () = 0; - - /** Finishes the group editing started by a \ref startGroupEdit (call after a \ref IComponentHandler::endEdit). */ - virtual tresult PLUGIN_API finishGroupEdit () = 0; - - //------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IComponentHandler2, 0xF040B4B3, 0xA36045EC, 0xABCDC045, 0xB4D5A2CC) - -//------------------------------------------------------------------------ -/** Edit controller component interface. -\ingroup vstIPlug vst300 -- [plug imp] -- [released: 3.0.0] - -The Controller part of an effect or instrument with parameter handling (export, definition, conversion...). -\see IComponent::getControllerClassId, IMidiMapping */ -//------------------------------------------------------------------------ -class IEditController: public IPluginBase -{ -public: -//------------------------------------------------------------------------ - /** Receives the component state. */ - virtual tresult PLUGIN_API setComponentState (IBStream* state) = 0; - - /** Sets the controller state. */ - virtual tresult PLUGIN_API setState (IBStream* state) = 0; - - /** Gets the controller state. */ - virtual tresult PLUGIN_API getState (IBStream* state) = 0; - - // parameters ------------------------- - /** Returns the number of parameters exported. */ - virtual int32 PLUGIN_API getParameterCount () = 0; - /** Gets for a given index the parameter information. */ - virtual tresult PLUGIN_API getParameterInfo (int32 paramIndex, ParameterInfo& info /*out*/) = 0; - - /** Gets for a given paramID and normalized value its associated string representation. */ - virtual tresult PLUGIN_API getParamStringByValue (ParamID id, ParamValue valueNormalized /*in*/, String128 string /*out*/) = 0; - /** Gets for a given paramID and string its normalized value. */ - 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). */ - 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; - - /** Returns the normalized value of the parameter associated to the paramID. */ - virtual ParamValue PLUGIN_API getParamNormalized (ParamID id) = 0; - /** Sets the normalized value to the parameter associated to the paramID. The controller must never - pass this value-change back to the host via the IComponentHandler. It should update the according - GUI element(s) only!*/ - virtual tresult PLUGIN_API setParamNormalized (ParamID id, ParamValue value) = 0; - - // handler ---------------------------- - /** Gets from host a handler. */ - 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. - 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; - -//------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IEditController, 0xDCD7BBE3, 0x7742448D, 0xA874AACC, 0x979C759E) - -//------------------------------------------------------------------------ -/** Knob Mode */ -//------------------------------------------------------------------------ -enum KnobModes -{ - kCircularMode = 0, ///< Circular with jump to clicked position - kRelativCircularMode, ///< Circular without jump to clicked position - kLinearMode ///< Linear: depending on vertical movement -}; - -typedef int32 KnobMode; ///< Knob Mode - -//------------------------------------------------------------------------ -/** Edit controller component interface extension. -\ingroup vstIPlug vst310 -- [plug imp] -- [extends IEditController] -- [released: 3.1.0] - -Extension 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 -{ -public: - /** 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). - 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. - 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; - - //------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IEditController2, 0x7F4EFE59, 0xF3204967, 0xAC27A3AE, 0xAFB63038) - -//------------------------------------------------------------------------ -/** MIDI Mapping Interface. -\ingroup vstIPlug vst301 -- [plug imp] -- [extends IEditController] -- [released: 3.0.1] - -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. - -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 -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 -{ -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 - * @param[in] midiControllerNumber - see \ref ControllerNumbers for expected values (could be bigger than 127) - * @param[in] id - return the associated ParamID to the given midiControllerNumber - */ - virtual tresult PLUGIN_API getMidiControllerAssignment (int32 busIndex, int16 channel, - CtrlNumber midiControllerNumber, ParamID& id/*out*/) = 0; - - //------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IMidiMapping, 0xDF0FF9F7, 0x49B74669, 0xB63AB732, 0x7ADBF5E5) - -//------------------------------------------------------------------------ -/** Parameter Editing from Host. -\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), -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 */ -//------------------------------------------------------------------------ -class IEditControllerHostEditing : public FUnknown -{ -public: - /** Called before a setParamNormalized sequence, a endEditFromHost will be call at the end of the editing action. */ - virtual tresult PLUGIN_API beginEditFromHost (ParamID paramID) = 0; - - /** Called after a beginEditFromHost and a sequence of setParamNormalized. */ - virtual tresult PLUGIN_API endEditFromHost (ParamID paramID) = 0; - - //------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IEditControllerHostEditing, 0xC1271208, 0x70594098, 0xB9DD34B3, 0x6BB0195E) - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg - -//------------------------------------------------------------------------ -#include "pluginterfaces/base/falignpop.h" -//------------------------------------------------------------------------ diff --git a/vst/pluginterfaces/vst/ivstevents.h b/vst/pluginterfaces/vst/ivstevents.h deleted file mode 100644 index 1007b3bc..00000000 --- a/vst/pluginterfaces/vst/ivstevents.h +++ /dev/null @@ -1,197 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Interfaces -// Filename : pluginterfaces/vst/ivstevents.h -// Created by : Steinberg, 11/2005 -// Description : VST Events (MIDI) Interfaces -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#pragma once - -#include "pluginterfaces/vst/ivstprocesscontext.h" -#include "pluginterfaces/vst/ivstnoteexpression.h" - -//------------------------------------------------------------------------ -#include "pluginterfaces/base/falignpush.h" -//------------------------------------------------------------------------ - -//------------------------------------------------------------------------ -namespace Steinberg { -namespace Vst { -//------------------------------------------------------------------------ -/** Note-on event specific data. Used in \ref Event (union)*/ -struct NoteOnEvent -{ - int16 channel; ///< channel index in event bus - int16 pitch; ///< range [0, 127] = [C-2, G8] with A3=440Hz - 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!) - int32 noteId; ///< note identifier (if not available then -1) -}; - -//------------------------------------------------------------------------ -/** Note-off event specific data. Used in \ref Event (union)*/ -struct NoteOffEvent -{ - int16 channel; ///< channel index in event bus - int16 pitch; ///< range [0, 127] = [C-2, G8] with A3=440Hz - 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)*/ -struct DataEvent -{ - uint32 size; ///< size in bytes of the data block bytes - uint32 type; ///< type of this data block (see \ref DataTypes) - const uint8* bytes; ///< pointer to the data block - - /** Value for DataEvent::type */ - enum DataTypes - { - kMidiSysEx = 0 ///< for MIDI system exclusive message - }; -}; - -//------------------------------------------------------------------------ -/** PolyPressure event specific data. Used in \ref Event (union)*/ -struct PolyPressureEvent -{ - int16 channel; ///< channel index in event bus - int16 pitch; ///< range [0, 127] = [C-2, G8] with A3=440Hz - float pressure; ///< range [0.0, 1.0] - int32 noteId; ///< event should be applied to the noteId (if not -1) -}; - -//------------------------------------------------------------------------ -/** Chord event specific data. Used in \ref Event (union)*/ -struct ChordEvent -{ - int16 root; ///< range [0, 127] = [C-2, G8] with A3=440Hz - int16 bassNote; ///< range [0, 127] = [C-2, G8] with A3=440Hz - int16 mask; ///< root is bit 0 - uint16 textLen; ///< the number of characters (TChar) between the beginning of text and the terminating - ///< null character (without including the terminating null character itself) - const TChar* text; ///< UTF-16, null terminated Hosts Chord Name -}; - -//------------------------------------------------------------------------ -/** Scale event specific data. Used in \ref Event (union)*/ -struct ScaleEvent -{ - int16 root; ///< range [0, 127] = root Note/Transpose Factor - int16 mask; ///< Bit 0 = C, Bit 1 = C#, ... (0x5ab5 = Major Scale) - uint16 textLen; ///< the number of characters (TChar) between the beginning of text and the terminating - ///< null character (without including the terminating null character itself) - const TChar* text; ///< UTF-16, null terminated, Hosts Scale Name -}; - -//------------------------------------------------------------------------ -/** Event */ -//------------------------------------------------------------------------ -struct Event -{ - int32 busIndex; ///< event bus index - int32 sampleOffset; ///< sample frames related to the current block start sample position - TQuarterNotes ppqPosition; ///< position in project - uint16 flags; ///< combination of \ref EventFlags - - /** Event Flags - used for Event::flags */ - enum EventFlags - { - kIsLive = 1 << 0, ///< indicates that the event is played live (directly from keyboard) - - kUserReserved1 = 1 << 14, ///< reserved for user (for internal use) - kUserReserved2 = 1 << 15 ///< reserved for user (for internal use) - }; - - /** Event Types - used for Event::type */ - enum EventTypes - { - kNoteOnEvent = 0, ///< is \ref NoteOnEvent - kNoteOffEvent, ///< is \ref NoteOffEvent - kDataEvent, ///< is \ref DataEvent - kPolyPressureEvent, ///< is \ref PolyPressureEvent - kNoteExpressionValueEvent, ///< is \ref NoteExpressionValueEvent - kNoteExpressionTextEvent, ///< is \ref NoteExpressionTextEvent - kChordEvent, ///< is \ref ChordEvent - kScaleEvent ///< is \ref ScaleEvent - }; - - uint16 type; ///< a value from \ref EventTypes - union - { - NoteOnEvent noteOn; ///< type == kNoteOnEvent - NoteOffEvent noteOff; ///< type == kNoteOffEvent - DataEvent data; ///< type == kDataEvent - PolyPressureEvent polyPressure; ///< type == kPolyPressureEvent - NoteExpressionValueEvent noteExpressionValue; ///< type == kNoteExpressionValueEvent - NoteExpressionTextEvent noteExpressionText; ///< type == kNoteExpressionTextEvent - ChordEvent chord; ///< type == kChordEvent - ScaleEvent scale; ///< type == kScaleEvent - }; -}; - -//------------------------------------------------------------------------ -/** List of events to process. -\ingroup vstIHost vst300 -- [host imp] -- [released: 3.0.0] - -\see ProcessData, Event */ -//------------------------------------------------------------------------ -class IEventList: public FUnknown -{ -public: -//------------------------------------------------------------------------ - /** Returns the count of events. */ - virtual int32 PLUGIN_API getEventCount () = 0; - - /** Gets parameter by index. */ - virtual tresult PLUGIN_API getEvent (int32 index, Event& e /*out*/) = 0; - - /** Adds a new event. */ - virtual tresult PLUGIN_API addEvent (Event& e /*in*/) = 0; - -//------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IEventList, 0x3A2C4214, 0x346349FE, 0xB2C4F397, 0xB9695A44) - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg - -//------------------------------------------------------------------------ -#include "pluginterfaces/base/falignpop.h" -//------------------------------------------------------------------------ diff --git a/vst/pluginterfaces/vst/ivsthostapplication.h b/vst/pluginterfaces/vst/ivsthostapplication.h deleted file mode 100644 index 1c08c245..00000000 --- a/vst/pluginterfaces/vst/ivsthostapplication.h +++ /dev/null @@ -1,115 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Interfaces -// Filename : pluginterfaces/vst/ivsthostapplication.h -// Created by : Steinberg, 04/2006 -// Description : VST Host Interface -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#pragma once - -#include "pluginterfaces/vst/ivstmessage.h" - -//------------------------------------------------------------------------ -namespace Steinberg { -namespace Vst { -//------------------------------------------------------------------------ -/** Basic Host Callback Interface. -\ingroup vstIHost vst300 -- [host imp] -- [passed as 'context' in to IPluginBase::initialize () ] - -Basic VST host application interface. */ -//------------------------------------------------------------------------ -class IHostApplication: public FUnknown -{ -public: -//------------------------------------------------------------------------ - /** Gets host application name. */ - virtual tresult PLUGIN_API getName (String128 name) = 0; - - /** Creates host object (e.g. Vst::IMessage). */ - virtual tresult PLUGIN_API createInstance (TUID cid, TUID _iid, void** obj) = 0; - -//------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IHostApplication, 0x58E595CC, 0xDB2D4969, 0x8B6AAF8C, 0x36A664E5) - -//------------------------------------------------------------------------ -inline IMessage* allocateMessage (IHostApplication* host) -{ - TUID iid; - IMessage::iid.toTUID (iid); - IMessage* m = 0; - if (host->createInstance (iid, iid, (void**)&m) == kResultOk) - return m; - return 0; -} - -//------------------------------------------------------------------------ -/** VST 3 to VST 2 Wrapper Interface. -\ingroup vstIHost vst310 -- [host imp] -- [passed as 'context' to IPluginBase::initialize () ] - -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: - //------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IVst3ToVst2Wrapper, 0x29633AEC, 0x1D1C47E2, 0xBB85B97B, 0xD36EAC61) - -//------------------------------------------------------------------------ -/** VST 3 to AU Wrapper Interface. -\ingroup vstIHost vst310 -- [host imp] -- [passed as 'context' to IPluginBase::initialize () ] - -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: - //------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IVst3ToAUWrapper, 0xA3B8C6C5, 0xC0954688, 0xB0916F0B, 0xB697AA44) - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg diff --git a/vst/pluginterfaces/vst/ivstinterappaudio.h b/vst/pluginterfaces/vst/ivstinterappaudio.h deleted file mode 100644 index dfe5f25e..00000000 --- a/vst/pluginterfaces/vst/ivstinterappaudio.h +++ /dev/null @@ -1,161 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Interfaces -// Filename : pluginterfaces/vst/ivstinterappaudio.h -// Created by : Steinberg, 08/2013 -// Description : VST InterAppAudio Interfaces -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#pragma once - -#include "pluginterfaces/base/funknown.h" - -//------------------------------------------------------------------------ -namespace Steinberg { -struct ViewRect; -namespace Vst { -struct Event; -class IInterAppAudioPresetManager; - -//------------------------------------------------------------------------ -/** Inter-App Audio host Interface. -\ingroup vstIHost vst360 -- [host imp] -- [passed as 'context' to IPluginBase::initialize () ] -- [released: 3.6.0] - -Implemented by the InterAppAudio Wrapper. */ -//------------------------------------------------------------------------ -class IInterAppAudioHost: public FUnknown -{ -public: - /** get the size of the screen - * @param size size of the screen - * @param scale scale of the screen - * @return kResultTrue on success - */ - virtual tresult PLUGIN_API getScreenSize (ViewRect* size, float* scale) = 0; - - /** get status of connection - * @return kResultTrue if an Inter-App Audio connection is established - */ - virtual tresult PLUGIN_API connectedToHost () = 0; - - /** switch to the host. - * @return kResultTrue on success - */ - virtual tresult PLUGIN_API switchToHost () = 0; - - /** send a remote control event to the host - * @param event event type, see AudioUnitRemoteControlEvent in the iOS SDK documentation for possible types - * @return kResultTrue on success - */ - virtual tresult PLUGIN_API sendRemoteControlEvent (uint32 event) = 0; - - /** ask for the host icon. - * @param icon pointer to a CGImageRef - * @return kResultTrue on success - */ - virtual tresult PLUGIN_API getHostIcon (void** icon) = 0; - - /** schedule an event from the user interface thread - * @param event the event to schedule - * @return kResultTrue on success - */ - virtual tresult PLUGIN_API scheduleEventFromUI (Event& event) = 0; - - /** get the preset manager - * @param cid class ID to use by the preset manager - * @return the preset manager. Needs to be released by called. - */ - virtual IInterAppAudioPresetManager* PLUGIN_API createPresetManager (const TUID& cid) = 0; - - /** show the settings view - * currently includes MIDI settings and Tempo setting - * @return kResultTrue on success - */ - virtual tresult PLUGIN_API showSettingsView () = 0; - - //------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IInterAppAudioHost, 0x0CE5743D, 0x68DF415E, 0xAE285BD4, 0xE2CDC8FD) - -//------------------------------------------------------------------------ -/** Extended IEditController interface for Inter-App Audio connection state change notifications -\ingroup vstIPlug vst360 -- [plug imp] -- [extends IEditController] -- [released: 3.6.0] -*/ -//------------------------------------------------------------------------ -class IInterAppAudioConnectionNotification : public FUnknown -{ -public: - /** called when the Inter-App Audio connection state changes - * @param newState true if an Inter-App Audio connection is established, otherwise false - */ - virtual void PLUGIN_API onInterAppAudioConnectionStateChange (TBool newState) = 0; - - //------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IInterAppAudioConnectionNotification, 0x6020C72D, 0x5FC24AA1, 0xB0950DB5, 0xD7D6D5CF) - -//------------------------------------------------------------------------ -/** Extended IEditController interface for Inter-App Audio Preset Management -\ingroup vstIPlug vst360 -- [plug imp] -- [extends IEditController] -- [released: 3.6.0] -*/ -//------------------------------------------------------------------------ -class IInterAppAudioPresetManager : public FUnknown -{ -public: - /** TODO */ - virtual tresult PLUGIN_API runLoadPresetBrowser () = 0; - /** TODO */ - virtual tresult PLUGIN_API runSavePresetBrowser () = 0; - /** TODO */ - virtual tresult PLUGIN_API loadNextPreset () = 0; - /** TODO */ - virtual tresult PLUGIN_API loadPreviousPreset () = 0; - - //------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IInterAppAudioPresetManager, 0xADE6FCC4, 0x46C94E1D, 0xB3B49A80, 0xC93FEFDD) - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg diff --git a/vst/pluginterfaces/vst/ivstmessage.h b/vst/pluginterfaces/vst/ivstmessage.h deleted file mode 100644 index a5b99b4d..00000000 --- a/vst/pluginterfaces/vst/ivstmessage.h +++ /dev/null @@ -1,112 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Interfaces -// Filename : pluginterfaces/vst/ivstmessage.h -// Created by : Steinberg, 04/2005 -// Description : VST Message Interfaces -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#pragma once - -#include "pluginterfaces/vst/ivstattributes.h" - -//------------------------------------------------------------------------ -#include "pluginterfaces/base/falignpush.h" -//------------------------------------------------------------------------ - -//------------------------------------------------------------------------ -namespace Steinberg { -namespace Vst { -//------------------------------------------------------------------------ -/** Private Plug-in message. -\ingroup vstIHost vst300 -- [host imp] -- [create via IHostApplication::createInstance] -- [released: 3.0.0] - -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: -//------------------------------------------------------------------------ - /** Returns the message ID (for example "TextMessage"). */ - virtual FIDString PLUGIN_API getMessageID () = 0; - - /** Sets a message ID (for example "TextMessage"). */ - virtual void PLUGIN_API setMessageID (FIDString id /*in*/) = 0; - - /** Returns the attribute list associated to the message. */ - virtual IAttributeList* PLUGIN_API getAttributes () = 0; - -//------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IMessage, 0x936F033B, 0xC6C047DB, 0xBB0882F8, 0x13C1E613) - -//------------------------------------------------------------------------ -/** Connect a component with another one. -\ingroup vstIPlug vst300 -- [plug imp] -- [host imp] -- [released: 3.0.0] - -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 -{ -public: -//------------------------------------------------------------------------ - /** Connects this instance with another connection point. */ - virtual tresult PLUGIN_API connect (IConnectionPoint* other) = 0; - - /** Disconnects a given connection point from this. */ - virtual tresult PLUGIN_API disconnect (IConnectionPoint* other) = 0; - - /** Called when a message has been sent from the connection point to this. */ - virtual tresult PLUGIN_API notify (IMessage* message) = 0; - -//------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IConnectionPoint, 0x70A4156F, 0x6E6E4026, 0x989148BF, 0xAA60D8D1) - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg - -//------------------------------------------------------------------------ -#include "pluginterfaces/base/falignpop.h" -//------------------------------------------------------------------------ diff --git a/vst/pluginterfaces/vst/ivstmidicontrollers.h b/vst/pluginterfaces/vst/ivstmidicontrollers.h deleted file mode 100644 index 481a6ee2..00000000 --- a/vst/pluginterfaces/vst/ivstmidicontrollers.h +++ /dev/null @@ -1,130 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Interfaces -// Filename : pluginterfaces/vst/ivstmidicontrollers.h -// Created by : Steinberg, 02/2006 -// Description : VST MIDI Controller Enumeration -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#pragma once - -//------------------------------------------------------------------------ -namespace Steinberg { -namespace Vst { -//------------------------------------------------------------------------ -/** Controller Numbers (MIDI) */ -//------------------------------------------------------------------------ -enum ControllerNumbers -{ - kCtrlBankSelectMSB = 0, ///< Bank Select MSB - kCtrlModWheel = 1, ///< Modulation Wheel - kCtrlBreath = 2, ///< Breath controller - - kCtrlFoot = 4, ///< Foot Controller - kCtrlPortaTime = 5, ///< Portamento Time - kCtrlDataEntryMSB = 6, ///< Data Entry MSB - kCtrlVolume = 7, ///< Channel Volume (formerly Main Volume) - kCtrlBalance = 8, ///< Balance - - kCtrlPan = 10, ///< Pan - kCtrlExpression = 11, ///< Expression - kCtrlEffect1 = 12, ///< Effect Control 1 - kCtrlEffect2 = 13, ///< Effect Control 2 - - //---General Purpose Controllers #1 to #4--- - kCtrlGPC1 = 16, ///< General Purpose Controller #1 - kCtrlGPC2 = 17, ///< General Purpose Controller #2 - kCtrlGPC3 = 18, ///< General Purpose Controller #3 - kCtrlGPC4 = 19, ///< General Purpose Controller #4 - - kCtrlBankSelectLSB = 32, ///< Bank Select LSB - - kCtrlDataEntryLSB = 38, ///< Data Entry LSB - - kCtrlSustainOnOff = 64, ///< Damper Pedal On/Off (Sustain) - kCtrlPortaOnOff = 65, ///< Portamento On/Off - kCtrlSustenutoOnOff = 66, ///< Sustenuto On/Off - kCtrlSoftPedalOnOff = 67, ///< Soft Pedal On/Off - kCtrlLegatoFootSwOnOff= 68, ///< Legato Footswitch On/Off - kCtrlHold2OnOff = 69, ///< Hold 2 On/Off - - //---Sound Controllers #1 to #10--- - kCtrlSoundVariation = 70, ///< Sound Variation - kCtrlFilterCutoff = 71, ///< Filter Cutoff (Timbre/Harmonic Intensity) - kCtrlReleaseTime = 72, ///< Release Time - kCtrlAttackTime = 73, ///< Attack Time - kCtrlFilterResonance= 74, ///< Filter Resonance (Brightness) - kCtrlDecayTime = 75, ///< Decay Time - kCtrlVibratoRate = 76, ///< Vibrato Rate - kCtrlVibratoDepth = 77, ///< Vibrato Depth - kCtrlVibratoDelay = 78, ///< Vibrato Delay - kCtrlSoundCtrler10 = 79, ///< undefined - - //---General Purpose Controllers #5 to #8--- - kCtrlGPC5 = 80, ///< General Purpose Controller #5 - kCtrlGPC6 = 81, ///< General Purpose Controller #6 - kCtrlGPC7 = 82, ///< General Purpose Controller #7 - kCtrlGPC8 = 83, ///< General Purpose Controller #8 - - kCtrlPortaControl = 84, ///< Portamento Control - - //---Effect Controllers--- - kCtrlEff1Depth = 91, ///< Effect 1 Depth (Reverb Send Level) - kCtrlEff2Depth = 92, ///< Effect 2 Depth - kCtrlEff3Depth = 93, ///< Effect 3 Depth (Chorus Send Level) - kCtrlEff4Depth = 94, ///< Effect 4 Depth (Delay/Variation Level) - kCtrlEff5Depth = 95, ///< Effect 5 Depth - - kCtrlDataIncrement = 96, ///< Data Increment (+1) - kCtrlDataDecrement = 97, ///< Data Decrement (-1) - kCtrlNRPNSelectLSB = 98, ///< NRPN Select LSB - kCtrlNRPNSelectMSB = 99, ///< NRPN Select MSB - kCtrlRPNSelectLSB = 100, ///< RPN Select LSB - kCtrlRPNSelectMSB = 101, ///< RPN Select MSB - - //---Other Channel Mode Messages--- - kCtrlAllSoundsOff = 120, ///< All Sounds Off - kCtrlResetAllCtrlers = 121, ///< Reset All Controllers - kCtrlLocalCtrlOnOff = 122, ///< Local Control On/Off - kCtrlAllNotesOff = 123, ///< All Notes Off - kCtrlOmniModeOff = 124, ///< Omni Mode Off + All Notes Off - kCtrlOmniModeOn = 125, ///< Omni Mode On + All Notes Off - kCtrlPolyModeOnOff = 126, ///< Poly Mode On/Off + All Sounds Off - kCtrlPolyModeOn = 127, ///< Poly Mode On - - //---Extra-------------------------- - kAfterTouch = 128, ///< After Touch - kPitchBend, ///< Pitch Bend - - kCountCtrlNumber ///< Count of Controller Number -}; - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg diff --git a/vst/pluginterfaces/vst/ivstnoteexpression.h b/vst/pluginterfaces/vst/ivstnoteexpression.h deleted file mode 100644 index 7257d1f7..00000000 --- a/vst/pluginterfaces/vst/ivstnoteexpression.h +++ /dev/null @@ -1,266 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Interfaces -// Filename : pluginterfaces/vst/ivstnoteexpression.h -// Created by : Steinberg, 10/2010 -// Description : VST Note Expression Interfaces -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#pragma once - -#include "pluginterfaces/base/funknown.h" -#include "vsttypes.h" - -//------------------------------------------------------------------------ -#include "pluginterfaces/base/falignpush.h" -//------------------------------------------------------------------------ - -namespace Steinberg { -namespace Vst { -typedef uint32 NoteExpressionTypeID; -typedef double NoteExpressionValue; - -//------------------------------------------------------------------------ -/** NoteExpressionTypeIDs describes the type of the note expression. -VST predefines some types like volume, pan, tuning by defining their ranges and curves. -Used by NoteExpressionEvent::typeId and NoteExpressionTypeID::typeId -\see NoteExpressionTypeInfo -*/ -enum NoteExpressionTypeIDs -{ - kVolumeTypeID = 0, ///< Volume, plain range [0 = -oo , 0.25 = 0dB, 0.5 = +6dB, 1 = +12dB]: plain = 20 * log (4 * norm) - kPanTypeID, ///< Panning (L-R), plain range [0 = left, 0.5 = center, 1 = right] - kTuningTypeID, ///< Tuning, plain range [0 = -120.0 (ten octaves down), 0.5 none, 1 = +120.0 (ten octaves up)] - ///< plain = 240 * (norm - 0.5) and norm = plain / 240 + 0.5 - ///< oneOctave is 12.0 / 240.0; oneHalfTune = 1.0 / 240.0; - kVibratoTypeID, ///< Vibrato - kExpressionTypeID, ///< Expression - kBrightnessTypeID, ///< Brightness - kTextTypeID, ///< TODO: - kPhonemeTypeID, ///< TODO: - - kCustomStart = 100000 ///< custom note change type ids must start from here -}; - -//------------------------------------------------------------------------ -/** Description of a Note Expression Type -This structure is part of the NoteExpressionTypeInfo structure, it describes for given NoteExpressionTypeID its default value -(for example 0.5 for a kTuningTypeID (kIsBipolar: centered)), its minimum and maximum (for predefined NoteExpressionTypeID the full range is predefined too) -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) -}; - -#if WINDOWS && !PLATFORM_64 -#include "pluginterfaces/vst/vstpshpack4.h" -#endif -//------------------------------------------------------------------------ -/** 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. -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 - int32 noteId; ///< associated note identifier to apply the change - - NoteExpressionValue value; ///< normalized value [0.0, 1.0]. -}; - -//------------------------------------------------------------------------ -/** Note Expression Text event. Used in Event (union) -A Expression event affects one single playing note. \sa INoteExpressionController - -\see NoteExpressionTypeInfo*/ -//------------------------------------------------------------------------ -struct NoteExpressionTextEvent -{ - NoteExpressionTypeID typeId; ///< see \ref NoteExpressionTypeID (kTextTypeID or kPhoneticTypeID) - int32 noteId; ///< associated note identifier to apply the change - - uint32 textLen; ///< the number of characters (TChar) between the beginning of text and the terminating - ///< null character (without including the terminating null character itself) - - const TChar* text; ///< UTF-16, null terminated -}; - -#if WINDOWS && !PLATFORM_64 -#include "pluginterfaces/base/falignpop.h" -#endif - -//------------------------------------------------------------------------ -/** 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. - 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. - - int32 flags; ///< NoteExpressionTypeFlags (see below) - enum NoteExpressionTypeFlags - { - kIsBipolar = 1 << 0, ///< event is bipolar (centered), otherwise unipolar - kIsOneShot = 1 << 1, ///< event occurs only one time for its associated note (at begin of the noteOn) - kIsAbsolute = 1 << 2, ///< This note expression will apply an absolute change to the sound (not relative (offset)) - kAssociatedParameterIDValid = 1 << 3,///< indicates that the associatedParameterID is valid and could be used - }; -}; - -//------------------------------------------------------------------------ -/** Extended IEditController interface for note expression event support. -\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. -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. - -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 (per example when switching presets) the Plug-in needs -to inform the host about it via \ref IComponentHandler::restartComponent (kNoteExpressionChanged). -*/ -//------------------------------------------------------------------------ -class INoteExpressionController: public FUnknown -{ -public: - /** Returns number of supported note change types for event bus index and channel. */ - virtual int32 PLUGIN_API getNoteExpressionCount (int32 busIndex, int16 channel) = 0; - - /** Returns note change type info. */ - virtual tresult PLUGIN_API getNoteExpressionInfo (int32 busIndex, int16 channel, int32 noteExpressionIndex, NoteExpressionTypeInfo& info /*out*/) = 0; - - /** Gets a user readable representation of the normalized note change value. */ - virtual tresult PLUGIN_API getNoteExpressionStringByValue (int32 busIndex, int16 channel, NoteExpressionTypeID id, NoteExpressionValue valueNormalized /*in*/, String128 string /*out*/) = 0; - - /** Converts the user readable representation to the normalized note change value. */ - virtual tresult PLUGIN_API getNoteExpressionValueByString (int32 busIndex, int16 channel, NoteExpressionTypeID id, const TChar* string /*in*/, NoteExpressionValue& valueNormalized /*out*/) = 0; - - //------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (INoteExpressionController, 0xB7F8F859, 0x41234872, 0x91169581, 0x4F3721A3) - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ -/** KeyswitchTypeIDs describes the type of a key switch -\see KeyswitchInfo -*/ -enum KeyswitchTypeIDs -{ - 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; - -//------------------------------------------------------------------------ -/** KeyswitchInfo is the structure describing a key switch -This structure is used by the method \ref IKeyswitchController::getKeyswitchInfo. -\see IKeyswitchController -*/ -struct KeyswitchInfo -{ - 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 unitId; ///< id of unit this key switch belongs to (see \ref vst3UnitsIntro), -1 means no unit used. - - int32 flags; ///< not yet used (set to 0) -}; - -//------------------------------------------------------------------------ -/** Extended IEditController interface for key switches support. -\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 -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 -{ -public: - /** Returns number of supported key switches for event bus index and channel. */ - virtual int32 PLUGIN_API getKeyswitchCount (int32 busIndex, int16 channel) = 0; - - /** Returns key switch info. */ - virtual tresult PLUGIN_API getKeyswitchInfo (int32 busIndex, int16 channel, int32 keySwitchIndex, KeyswitchInfo& info /*out*/) = 0; - - //------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IKeyswitchController, 0x1F2F76D3, 0xBFFB4B96, 0xB99527A5, 0x5EBCCEF4) - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg - -//------------------------------------------------------------------------ -#include "pluginterfaces/base/falignpop.h" -//------------------------------------------------------------------------ diff --git a/vst/pluginterfaces/vst/ivstparameterchanges.h b/vst/pluginterfaces/vst/ivstparameterchanges.h deleted file mode 100644 index a63a8942..00000000 --- a/vst/pluginterfaces/vst/ivstparameterchanges.h +++ /dev/null @@ -1,158 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Interfaces -// Filename : pluginterfaces/vst/ivstparameterchanges.h -// Created by : Steinberg, 09/2005 -// Description : VST Parameter Change Interfaces -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#pragma once - -#include "pluginterfaces/base/funknown.h" -#include "vsttypes.h" - -//------------------------------------------------------------------------ -#include "pluginterfaces/base/falignpush.h" -//------------------------------------------------------------------------ - -//---------------------------------------------------------------------- -namespace Steinberg { -namespace Vst { -//---------------------------------------------------------------------- -/** Queue of changes for a specific parameter. -\ingroup vstIHost vst300 -- [host imp] -- [released: 3.0.0] - -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. -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 -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 -position in the block. - -Implicit Points: \n -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 -is at block position -1. The processor can calculate the value for each sample in the block -by using a linear interpolation: -\code -double x1 = -1; // position of last point related to current buffer -double y1 = currentParameterValue; // last transmitted value - -int32 pointTime = 0; -ParamValue pointValue = 0; -IParamValueQueue::getPoint (0, pointTime, pointValue); - -double x2 = pointTime; -double y2 = pointValue; - -double slope = (y2 - y1) / (x2 - x1); -double offset = y1 - (slope * x1); - -double curveValue = (slope * bufferTime) + offset; // bufferTime is any position in buffer -\endcode - -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 -*/ -//---------------------------------------------------------------------- -class IParamValueQueue: public FUnknown -{ -public: -//------------------------------------------------------------------------ - /** Returns its associated ID. */ - virtual ParamID PLUGIN_API getParameterId () = 0; - - /** Returns count of points in the queue. */ - virtual int32 PLUGIN_API getPointCount () = 0; - - /** Gets the value and offset at a given index. */ - virtual tresult PLUGIN_API getPoint (int32 index, int32& sampleOffset /*out*/, ParamValue& value /*out*/) = 0; - - /** Adds a new value at the end of the queue, its index is returned. */ - virtual tresult PLUGIN_API addPoint (int32 sampleOffset, ParamValue value, int32& index /*out*/) = 0; - -//------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IParamValueQueue, 0x01263A18, 0xED074F6F, 0x98C9D356, 0x4686F9BA) - -//---------------------------------------------------------------------- -/** All parameter changes of a processing block. -\ingroup vstIHost vst300 -- [host imp] -- [released: 3.0.0] - -This interface is used to transmit any changes that shall be applied to paramaters -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) -containing only queues for paramaters that actually did change. -\see IParamValueQueue, ProcessData */ -//---------------------------------------------------------------------- -class IParameterChanges: public FUnknown -{ -public: -//------------------------------------------------------------------------ - /** Returns count of Parameter changes in the list. */ - virtual int32 PLUGIN_API getParameterCount () = 0; - - /** Returns the queue at a given index. */ - virtual IParamValueQueue* PLUGIN_API getParameterData (int32 index) = 0; - - /** Adds a new parameter queue with a given ID at the end of the list, - returns it and its index in the parameter changes list. */ - virtual IParamValueQueue* PLUGIN_API addParameterData (const Vst::ParamID& id, int32& index /*out*/) = 0; - -//------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IParameterChanges, 0xA4779663, 0x0BB64A56, 0xB44384A8, 0x466FEB9D) - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg - -//------------------------------------------------------------------------ -#include "pluginterfaces/base/falignpop.h" -//------------------------------------------------------------------------ diff --git a/vst/pluginterfaces/vst/ivstplugview.h b/vst/pluginterfaces/vst/ivstplugview.h deleted file mode 100644 index 0d6fa4e0..00000000 --- a/vst/pluginterfaces/vst/ivstplugview.h +++ /dev/null @@ -1,79 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Interfaces -// Filename : pluginterfaces/vst/ivstplugview.h -// Created by : Steinberg, 01/2009 -// Description : Plug-in User Interface Extension -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//------------------------------------------------------------------------------ - -#pragma once - -#include "pluginterfaces/base/funknown.h" -#include "vsttypes.h" - -//------------------------------------------------------------------------ -#include "pluginterfaces/base/falignpush.h" -//------------------------------------------------------------------------ - -//------------------------------------------------------------------------ -namespace Steinberg { -namespace Vst { -//------------------------------------------------------------------------ -// IParameterFinder Interface -//------------------------------------------------------------------------ -/** Extension for IPlugView to find view parameters (lookup value under mouse support). -\ingroup pluginGUI vst302 -- [plug imp] -- [extends IPlugView] -- [released: 3.0.2] - -It is highly recommended to implement this interface. -A host can implement important functionality when a plug-in supports this interface. - -For example, all Steinberg hosts require this interface in order to support the "AI Knob". -*/ -class IParameterFinder: public FUnknown -{ -public: - //------------------------------------------------------------------------ - /** 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; -}; - -DECLARE_CLASS_IID (IParameterFinder, 0x0F618302, 0x215D4587, 0xA512073C, 0x77B9D383) - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg - -//------------------------------------------------------------------------ -#include "pluginterfaces/base/falignpop.h" -//------------------------------------------------------------------------ diff --git a/vst/pluginterfaces/vst/ivstprefetchablesupport.h b/vst/pluginterfaces/vst/ivstprefetchablesupport.h deleted file mode 100644 index 850ace51..00000000 --- a/vst/pluginterfaces/vst/ivstprefetchablesupport.h +++ /dev/null @@ -1,101 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Interfaces -// Filename : pluginterfaces/vst/ivstprefetchablesupport.h -// Created by : Steinberg, 02/2015 -// Description : VST Prefetchable Support Interface -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#pragma once - -#include "pluginterfaces/vst/vsttypes.h" -#include "pluginterfaces/vst/ivstattributes.h" - -//------------------------------------------------------------------------ -#include "pluginterfaces/base/falignpush.h" -//------------------------------------------------------------------------ - -//------------------------------------------------------------------------ -namespace Steinberg { -namespace Vst { - -typedef uint32 PrefetchableSupport; -enum ePrefetchableSupport -{ - kIsNeverPrefetchable = 0, ///< every instance of the plug does not support prefetch processing - kIsYetPrefetchable, ///< in the current state the plug support prefetch processing - kIsNotYetPrefetchable, ///< in the current state the plug does not support prefetch processing - kNumPrefetchableSupport -}; - -//------------------------------------------------------------------------ -// IPrefetchableSupport Interface -//------------------------------------------------------------------------ -/** Indicates that the Plug-in could or not support Prefetch (dynamically). -\ingroup vstIPlug vst365 -- [plug imp] -- [extends IComponent] -- [released: 3.6.5] -- [optional] - -\section IPrefetchableSupportExample Example -\code -tresult PLUGIN_API myPlug::getPrefetchableSupport (PrefetchableSupport& prefetchable) -{ - prefetchable = kIsNeverPrefetchable; - - switch (myPrefetchableMode) - { - case 0: prefetchable = kIsNeverPrefetchable; break; - case 1: prefetchable = kIsYetPrefetchable; break; - case 2: prefetchable = kIsNotYetPrefetchable; break; - } - return kResultOk; -} -\endcode */ -class IPrefetchableSupport : public FUnknown -{ -public: - //------------------------------------------------------------------------ - /** 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 - -//------------------------------------------------------------------------ -#include "pluginterfaces/base/falignpop.h" -//------------------------------------------------------------------------ diff --git a/vst/pluginterfaces/vst/ivstprocesscontext.h b/vst/pluginterfaces/vst/ivstprocesscontext.h deleted file mode 100644 index 7348b60e..00000000 --- a/vst/pluginterfaces/vst/ivstprocesscontext.h +++ /dev/null @@ -1,160 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Interfaces -// Filename : pluginterfaces/vst/ivstprocesscontext.h -// Created by : Steinberg, 10/2005 -// Description : VST Processing Context Interfaces -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#pragma once - -#include "pluginterfaces/base/funknown.h" -#include "vsttypes.h" - -//------------------------------------------------------------------------ -#include "pluginterfaces/base/falignpush.h" -//------------------------------------------------------------------------ - -//------------------------------------------------------------------------ -namespace Steinberg { -namespace Vst { -//------------------------------------------------------------------------ -/** Frame Rate */ -//------------------------------------------------------------------------ -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 - }; -//------------------------------------------------------------------------ - uint32 framesPerSecond; ///< frame rate - uint32 flags; ///< flags #FrameRateFlags -//------------------------------------------------------------------------ -}; - -//------------------------------------------------------------------------ -/** Description of a chord. -A chord is described with a key note, a root note and the -\copydoc chordMask -\see ProcessContext*/ -//------------------------------------------------------------------------ -struct Chord -{ -//------------------------------------------------------------------------ - uint8 keyNote; ///< key note in chord - uint8 rootNote; ///< lowest note in chord - - /** Bitmask of a chord. - 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 */ - int16 chordMask; - - enum Masks { - kChordMask = 0x0FFF, ///< mask for chordMask - kReservedMask = 0xF000 ///< reserved for future use - }; -//------------------------------------------------------------------------ -}; - -//------------------------------------------------------------------------ -/** 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 -this problem. -\see IAudioProcessor, ProcessData*/ -//------------------------------------------------------------------------ -struct ProcessContext -{ -//------------------------------------------------------------------------ - /** Transport state & other flags */ - enum StatesAndFlags - { - kPlaying = 1 << 1, ///< currently playing - kCycleActive = 1 << 2, ///< cycle is active - kRecording = 1 << 3, ///< currently recording - - kSystemTimeValid = 1 << 8, ///< systemTime contains valid information - kContTimeValid = 1 << 17, ///< continousTimeSamples contains valid information - - kProjectTimeMusicValid = 1 << 9,///< projectTimeMusic contains valid information - kBarPositionValid = 1 << 11, ///< barPositionMusic contains valid information - kCycleValid = 1 << 12, ///< cycleStartMusic and barPositionMusic contain valid information - - kTempoValid = 1 << 10, ///< tempo contains valid information - kTimeSigValid = 1 << 13, ///< timeSigNumerator and timeSigDenominator contain valid information - kChordValid = 1 << 18, ///< chord contains valid information - - kSmpteValid = 1 << 14, ///< smpteOffset and frameRate contain valid information - kClockValid = 1 << 15 ///< samplesToNextClock valid - }; - - 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) - - 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 - - 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) - - Chord chord; ///< musical info - - int32 smpteOffsetSubframes; ///< SMPTE (sync) offset in subframes (1/80 of frame) - FrameRate frameRate; ///< frame rate - - int32 samplesToNextClock; ///< MIDI Clock Resolution (24 Per Quarter Note), can be negative (nearest) -//------------------------------------------------------------------------ -}; - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg - -//------------------------------------------------------------------------ -#include "pluginterfaces/base/falignpop.h" -//------------------------------------------------------------------------ diff --git a/vst/pluginterfaces/vst/ivstrepresentation.h b/vst/pluginterfaces/vst/ivstrepresentation.h deleted file mode 100644 index cb7a2927..00000000 --- a/vst/pluginterfaces/vst/ivstrepresentation.h +++ /dev/null @@ -1,390 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Interfaces -// Filename : pluginterfaces/vst/ivstrepresentation.h -// Created by : Steinberg, 08/2010 -// Description : VST Representation Interface -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#pragma once - -#include "pluginterfaces/base/funknown.h" -#include "pluginterfaces/vst/vsttypes.h" - -//------------------------------------------------------------------------ -#include "pluginterfaces/base/falignpush.h" -//------------------------------------------------------------------------ - -//------------------------------------------------------------------------ -namespace Steinberg { -class IBStream; - -namespace Vst { - -//------------------------------------------------------------------------ -/** RepresentationInfo is the structure describing a representation -This structure is used in the function \see IXmlRepresentationController::getXmlRepresentationStream. -\see IXmlRepresentationController -*/ -struct RepresentationInfo -{ - RepresentationInfo () - { - memset (vendor, 0, kNameSize); - memset (name, 0, kNameSize); - memset (version, 0, kNameSize); - memset (host, 0, kNameSize); - } - - RepresentationInfo (char8* _vendor, char8* _name = 0, char8* _version = 0, char8* _host = 0) - { - memset (vendor, 0, kNameSize); - if (_vendor) - strcpy (vendor, _vendor); - memset (name, 0, kNameSize); - if (_name) - strcpy (name, _name); - memset (version, 0, kNameSize); - if (_version) - strcpy (version, _version); - memset (host, 0, kNameSize); - if (_host) - strcpy (host, _host); - } - - enum - { - kNameSize = 64 - }; - char8 vendor[kNameSize]; ///< Vendor name of the associated representation (remote) (eg. "Yamaha"). - char8 name[kNameSize]; ///< Representation (remote) Name (eg. "O2"). - char8 version[kNameSize]; ///< Version of this "Remote" (eg. "1.0"). - char8 host[kNameSize]; ///< Optional: used if the representation is for a given host only (eg. "Nuendo"). -}; - - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ -/** Extended IEditController interface for a component. -\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)). -\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. - \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) - - 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 - -\section Example -Here an example of what should be passed in the stream of getXmlRepresentationStream: - -\code - - - - - My name - 2010-12-31 - This is an example for 4 Cells per Page for the Remote named ProductRemote - from company HardwareCompany. - - - - - - - - Mix dry/wet - Mix - - - - - - - - - - Delay - Dly - - - - - - - Spatial - Spat - - - - - - - - - Width + - Widt - - - - - - - - - - - - Sync Note + - Note - - - - - - - - - Rate - - - - - - -\endcode -*/ -//------------------------------------------------------------------------ -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; - - //------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IXmlRepresentationController, 0xA81A0471, 0x48C34DC4, 0xAC30C9E1, 0x3C8393D5) - - -//------------------------------------------------------------------------ -/** Defines for XML representation Tags and Attributes */ - -#define ROOTXML_TAG "vstXML" - -#define COMMENT_TAG "comment" -#define CELL_TAG "cell" -#define CELLGROUP_TAG "cellGroup" -#define CELLGROUPTEMPLATE_TAG "cellGroupTemplate" -#define CURVE_TAG "curve" -#define CURVETEMPLATE_TAG "curveTemplate" -#define DATE_TAG "date" -#define LAYER_TAG "layer" -#define NAME_TAG "name" -#define ORIGINATOR_TAG "originator" -#define PAGE_TAG "page" -#define PAGETEMPLATE_TAG "pageTemplate" -#define PLUGIN_TAG "plugin" -#define VALUE_TAG "value" -#define VALUEDISPLAY_TAG "valueDisplay" -#define VALUELIST_TAG "valueList" -#define REPRESENTATION_TAG "representation" -#define SEGMENT_TAG "segment" -#define SEGMENTLIST_TAG "segmentList" -#define TITLEDISPLAY_TAG "titleDisplay" - -#define ATTR_CATEGORY "category" -#define ATTR_CLASSID "classID" -#define ATTR_ENDPOINT "endPoint" -#define ATTR_INDEX "index" -#define ATTR_FLAGS "flags" -#define ATTR_FUNCTION "function" -#define ATTR_HOST "host" -#define ATTR_LEDSTYLE "ledStyle" -#define ATTR_LENGTH "length" -#define ATTR_LINKEDTO "linkedTo" -#define ATTR_NAME "name" -#define ATTR_ORDER "order" -#define ATTR_PAGE "page" -#define ATTR_PARAMID "parameterID" -#define ATTR_STARTPOINT "startPoint" -#define ATTR_STYLE "style" -#define ATTR_SWITCHSTYLE "switchStyle" -#define ATTR_TEMPLATE "template" -#define ATTR_TURNSPERFULLRANGE "turnsPerFullRange" -#define ATTR_TYPE "type" -#define ATTR_UNITID "unitID" -#define ATTR_VARIABLES "variables" -#define ATTR_VENDOR "vendor" -#define ATTR_VERSION "version" - -//------------------------------------------------------------------------ -/** Defines some predefined Representation Remote Names */ -#define GENERIC "Generic" -#define GENERIC_4_CELLS "Generic 4 Cells" -#define GENERIC_8_CELLS "Generic 8 Cells" -#define GENERIC_12_CELLS "Generic 12 Cells" -#define GENERIC_24_CELLS "Generic 24 Cells" -#define GENERIC_N_CELLS "Generic %d Cells" -#define QUICK_CONTROL_8_CELLS "Quick Controls 8 Cells" - -//------------------------------------------------------------------------ -/** Layer Types used in a VST XML Representation */ -//------------------------------------------------------------------------ -namespace LayerType -{ - enum - { - kKnob = 0, ///< a knob (encoder or not) - kPressedKnob, ///< a knob which is used by pressing and turning - kSwitchKnob, ///< knob could be pressed to simulate a switch - kSwitch, ///< a "on/off" button - kLED, ///< LED like VU-meter or display around a knob - kLink, ///< indicates that this layer is a folder linked to an another INode (page) - kDisplay, ///< only for text display (not really a control) - kFader, ///< a fader - kEndOfLayerType - }; - - /** FIDString variant of the LayerType */ - static const FIDString layerTypeFIDString[] = { - "knob" - ,"pressedKnob" - ,"switchKnob" - ,"switch" - ,"LED" - ,"link" - ,"display" - ,"fader" - ,0 - }; -}; - -//------------------------------------------------------------------------ -/** Curve Types used in a VST XML Representation */ -//------------------------------------------------------------------------ -namespace CurveType -{ - const CString kSegment = "segment"; ///< - const CString kValueList = "valueList"; ///< -}; - -//------------------------------------------------------------------------ -/** 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 - const CString kLEDStyle = ATTR_LEDSTYLE; ///< string attribute : See AttributesStyle for available string value - const CString kSwitchStyle = ATTR_SWITCHSTYLE; ///< string attribute : See AttributesStyle for available string value - const CString kKnobTurnsPerFullRange = ATTR_TURNSPERFULLRANGE; ///< float attribute - const CString kFunction = ATTR_FUNCTION; ///< string attribute : See AttributesFunction for available string value - const CString kFlags = ATTR_FLAGS; ///< string attribute : See AttributesFlags for available string value -}; - -//------------------------------------------------------------------------ -/** Attributes Function used to defined the function of a Layer in a VST XML Representation */ -//------------------------------------------------------------------------ -namespace AttributesFunction -{ - /// Global Style - const CString kPanPosCenterXFunc = "PanPosCenterX"; ///< Gravity point X-axis (L-R) (for stereo: middle between left and right) - const CString kPanPosCenterYFunc = "PanPosCenterY"; ///< Gravity point Y-axis (Front-Rear) - const CString kPanPosFrontLeftXFunc = "PanPosFrontLeftX"; ///< Left channel Position in X-axis - const CString kPanPosFrontLeftYFunc = "PanPosFrontLeftY"; ///< Left channel Position in Y-axis - const CString kPanPosFrontRightXFunc = "PanPosFrontRightX"; ///< Right channel Position in X-axis - const CString kPanPosFrontRightYFunc = "PanPosFrontRightY"; ///< Right channel Position in Y-axis - const CString kPanRotationFunc = "PanRotation"; ///< Rotation around the Center (gravity point) - const CString kPanLawFunc = "PanLaw"; ///< Panning Law - const CString kPanMirrorModeFunc = "PanMirrorMode"; ///< Panning Mirror Mode - const CString kPanLfeGainFunc = "PanLfeGain"; ///< Panning LFE Gain - const CString kGainReductionFunc = "GainReduction"; ///< Gain Reduction for compressor - const CString kSoloFunc = "Solo"; ///< Solo - const CString kMuteFunc = "Mute"; ///< Mute - const CString kVolumeFunc = "Volume"; ///< Volume -}; - -//------------------------------------------------------------------------ -/** Attributes Style associated a specific Layer Type in a VST XML Representation */ -//------------------------------------------------------------------------ -namespace AttributesStyle -{ - /// Global Style - const CString kInverseStyle = "inverse"; ///< the associated layer should use the inverse value of parameter (1 - x). - - /// LED Style - const CString kLEDWrapLeftStyle = "wrapLeft"; ///< |======>----- (the default one if not specified) - const CString kLEDWrapRightStyle = "wrapRight"; ///< -------<====| - const CString kLEDSpreadStyle = "spread"; ///< ---<==|==>--- - const CString kLEDBoostCutStyle = "boostCut"; ///< ------|===>-- - const CString kLEDSingleDotStyle = "singleDot"; ///< --------|---- - - /// Switch Style - const CString kSwitchPushStyle = "push"; ///< Apply only when pressed, unpressed will reset the value to min. - const CString kSwitchPushIncLoopedStyle = "pushIncLooped"; ///< Push will increment the value. When the max is reached it will restart with min. - ///< The default one if not specified (with 2 states values it is a OnOff switch). - const CString kSwitchPushDecLoopedStyle = "pushDecLooped"; ///< Push will decrement the value. When the min is reached it will restart with max. - const CString kSwitchPushIncStyle = "pushInc"; ///< Increment after each press (delta depends of the curve). - const CString kSwitchPushDecStyle = "pushDec"; ///< Decrement after each press (delta depends of the curve). - const CString kSwitchLatchStyle = "latch"; ///< Each push-release will change the value between min and max. - ///< A timeout between push and release could be used to simulate a push style (if timeout is reached). -}; - -//------------------------------------------------------------------------ -/** 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 - -//------------------------------------------------------------------------ -#include "pluginterfaces/base/falignpop.h" -//------------------------------------------------------------------------ diff --git a/vst/pluginterfaces/vst/ivstunits.h b/vst/pluginterfaces/vst/ivstunits.h deleted file mode 100644 index 880b0d2a..00000000 --- a/vst/pluginterfaces/vst/ivstunits.h +++ /dev/null @@ -1,282 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Interfaces -// Filename : pluginterfaces/vst/ivstunits.h -// Created by : Steinberg, 2005 -// Description : VST Units Interfaces -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#pragma once - -#include "pluginterfaces/base/funknown.h" -#include "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. - -//------------------------------------------------------------------------ -/** Special ProgramListIDs for UnitInfo */ -static const ProgramListID kNoProgramListId = -1; ///< no programs are used in the unit. - -//------------------------------------------------------------------------ -/** Basic Unit Description. -\see IUnitInfo */ -//------------------------------------------------------------------------ -struct UnitInfo -{ - UnitID id; ///< unit identifier - UnitID parentUnitId; ///< identifier of parent unit (kNoParentUnitId: does not apply, this unit is the root) - String128 name; ///< name, optional for the root component, required otherwise - ProgramListID programListId; ///< id of program list used in unit (kNoProgramListId = no programs used in this unit) -}; - -//------------------------------------------------------------------------ -/** Basic Program List Description. -\see IUnitInfo */ -//------------------------------------------------------------------------ -struct ProgramListInfo -{ - ProgramListID id; ///< program list identifier - String128 name; ///< name of program list - int32 programCount; ///< number of programs in this list -}; - -//------------------------------------------------------------------------ -/** Special programIndex value for IUnitHandler::notifyProgramListChange */ -static const int32 kAllProgramInvalid = -1; ///< all program information is invalid - -//------------------------------------------------------------------------ -/** Host callback for unit support. -\ingroup vstIHost vst300 -- [host imp] -- [extends IComponentHandler] -- [released: 3.0.0] - -Host callback interface, used with IUnitInfo. -Retrieve via queryInterface from IComponentHandler. - -\see \ref vst3Units, IUnitInfo */ -//------------------------------------------------------------------------ -class IUnitHandler: public FUnknown -{ -public: -//------------------------------------------------------------------------ - /** 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). - \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; - -//------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IUnitHandler, 0x4B5147F8, 0x4654486B, 0x8DAB30BA, 0x163A3C56) - - -//------------------------------------------------------------------------ -/** Host callback for extended unit support. -\ingroup vstIHost vst365 -- [host imp] -- [extends IUnitHandler] -- [released: 3.6.5] - -Host callback interface, used with IUnitInfo. -Retrieve via queryInterface from IComponentHandler. - -\see \ref vst3Units, IUnitHandler */ -//------------------------------------------------------------------------ -class IUnitHandler2 : public FUnknown -{ -public: - //------------------------------------------------------------------------ - /** Tell host that assignment Unit-Bus defined by IUnitInfo::getUnitByBus has changed. */ - virtual tresult PLUGIN_API notifyUnitByBusChange () = 0; - - //------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IUnitHandler2, 0xF89F8CDF, 0x699E4BA5, 0x96AAC9A4, 0x81452B01) - - -//------------------------------------------------------------------------ -/** Edit controller extension to describe the Plug-in structure. -\ingroup vstIPlug vst300 -- [plug imp] -- [extends IEditController] -- [released: 3.0.0] - -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. - -\see \ref vst3Units, IUnitHandler */ -//------------------------------------------------------------------------ -class IUnitInfo: public FUnknown -{ -public: -//------------------------------------------------------------------------ - /** Returns the flat count of units. */ - virtual int32 PLUGIN_API getUnitCount () = 0; - - /** Gets UnitInfo for a given index in the flat list of unit. */ - virtual tresult PLUGIN_API getUnitInfo (int32 unitIndex, UnitInfo& info /*out*/) = 0; - - /** Component intern program structure. */ - /** Gets the count of Program List. */ - virtual int32 PLUGIN_API getProgramListCount () = 0; - - /** Gets for a given index the Program List Info. */ - virtual tresult PLUGIN_API getProgramListInfo (int32 listIndex, ProgramListInfo& info /*out*/) = 0; - - /** Gets for a given program list ID and program index its program name. */ - virtual tresult PLUGIN_API getProgramName (ProgramListID listId, int32 programIndex, String128 name /*out*/) = 0; - - /** Gets for a given program list ID, program index and attributeId the associated attribute value. */ - virtual tresult PLUGIN_API getProgramInfo (ProgramListID listId, int32 programIndex, - CString attributeId /*in*/, String128 attributeValue /*out*/) = 0; - - /** Returns kResultTrue if the given program index of a given program list ID supports PitchNames. */ - 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. */ - virtual tresult PLUGIN_API getProgramPitchName (ProgramListID listId, int32 programIndex, - int16 midiPitch, String128 name /*out*/) = 0; - - // units selection -------------------- - /** Gets the current selected unit. */ - virtual UnitID PLUGIN_API getSelectedUnit () = 0; - - /** Sets a new selected unit. */ - virtual tresult PLUGIN_API selectUnit (UnitID unitId) = 0; - - /** Gets the according unit if there is an unambiguous relation between a channel or a bus and a unit. - This method mainly is intended to find out which unit is related to a given MIDI input channel. */ - virtual tresult PLUGIN_API getUnitByBus (MediaType type, BusDirection dir, int32 busIndex, - int32 channel, UnitID& unitId /*out*/) = 0; - - /** Receives a preset data stream. - - If the component supports program list data (IProgramListData), the destination of the data - stream is the program specified by list-Id and program index (first and second parameter) - - If the component supports unit data (IUnitData), the destination is the unit specified by the first - parameter - in this case parameter programIndex is < 0). */ - virtual tresult PLUGIN_API setUnitProgramData (int32 listOrUnitId, int32 programIndex, IBStream* data) = 0; - -//------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IUnitInfo, 0x3D4BD6B5, 0x913A4FD2, 0xA886E768, 0xA5EB92C1) - -//------------------------------------------------------------------------ -/** Component extension to access program list data. -\ingroup vstIPlug vst300 -- [plug imp] -- [extends IComponent] -- [released: 3.0.0] - -A component can either support program list data via this interface or -unit preset data (IUnitData), but not both! - -\see \ref vst3UnitPrograms */ -//------------------------------------------------------------------------ -class IProgramListData: public FUnknown -{ -public: -//------------------------------------------------------------------------ - /** Returns kResultTrue if the given Program List ID supports Program Data. */ - virtual tresult PLUGIN_API programDataSupported (ProgramListID listId) = 0; - - /** Gets for a given program list ID and program index the program Data. */ - virtual tresult PLUGIN_API getProgramData (ProgramListID listId, int32 programIndex, IBStream* data) = 0; - - /** Sets for a given program list ID and program index a program Data. */ - virtual tresult PLUGIN_API setProgramData (ProgramListID listId, int32 programIndex, IBStream* data) = 0; - -//------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IProgramListData, 0x8683B01F, 0x7B354F70, 0xA2651DEC, 0x353AF4FF) - -//------------------------------------------------------------------------ -/** Component extension to access unit data. -\ingroup vstIPlug vst300 -- [plug imp] -- [extends IComponent] -- [released: 3.0.0] - -A component can either support unit preset data via this interface or -program list data (IProgramListData), but not both! - -\see \ref vst3UnitPrograms */ -//------------------------------------------------------------------------ -class IUnitData: public FUnknown -{ -public: -//------------------------------------------------------------------------ - /** Returns kResultTrue if the specified unit supports export and import of preset data. */ - virtual tresult PLUGIN_API unitDataSupported (UnitID unitID) = 0; - - /** Gets the preset data for the specified unit. */ - virtual tresult PLUGIN_API getUnitData (UnitID unitId, IBStream* data) = 0; - - /** Sets the preset data for the specified unit. */ - virtual tresult PLUGIN_API setUnitData (UnitID unitId, IBStream* data) = 0; - -//------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IUnitData, 0x6C389611, 0xD391455D, 0xB870B833, 0x94A0EFDD) - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg - -//------------------------------------------------------------------------ -#include "pluginterfaces/base/falignpop.h" -//------------------------------------------------------------------------ diff --git a/vst/pluginterfaces/vst/vstpresetkeys.h b/vst/pluginterfaces/vst/vstpresetkeys.h deleted file mode 100644 index e1c08a68..00000000 --- a/vst/pluginterfaces/vst/vstpresetkeys.h +++ /dev/null @@ -1,447 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Interfaces -// Filename : pluginterfaces/vst/vstpresetkeys.h -// Created by : Steinberg, 2006 -// Description : VST Preset Keys -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#pragma once - -#include "vsttypes.h" - -//------------------------------------------------------------------------ -namespace Steinberg { -namespace Vst { -//------------------------------------------------------------------------ -/** Predefined Preset Attributes */ -//------------------------------------------------------------------------ -namespace PresetAttributes -{ -/** -\defgroup presetAttributes Predefined Preset Attributes*/ -/*@{*/ -const CString kPlugInName = "PlugInName"; ///< Plug-in name -const CString kPlugInCategory = "PlugInCategory"; ///< eg. "Fx|Dynamics", "Instrument", "Instrument|Synth" - -const CString kInstrument = "MusicalInstrument";///< eg. instrument group (like 'Piano' or 'Piano|A. Piano') -const CString kStyle = "MusicalStyle"; ///< eg. 'Pop', 'Jazz', 'Classic' -const CString kCharacter = "MusicalCharacter"; ///< eg. instrument nature (like 'Soft' 'Dry' 'Acoustic') - -const CString kStateType = "StateType"; ///< Type of the given state see \ref StateType : Project / Default Preset or Normal Preset -const CString kFilePathStringType = "FilePathString"; ///< Full file path string (if available) where the preset comes from (be sure to use a bigger string when asking for it (with 1024 characters)) -/*@}*/ -}; - -//------------------------------------------------------------------------ -/** Predefined StateType used for Key kStateType */ -//------------------------------------------------------------------------ -namespace StateType { -/** -\defgroup stateType Context of State Restoration */ -/*@{*/ -//------------------------------------------------------------------------ -const CString kProject = "Project"; ///< the state is restored from a project loading or it is saved in a project -const CString kDefault = "Default"; ///< the state is restored from a preset (marked as default) or the host wants to store a default state of the plug-in - -//------------------------------------------------------------------------ -/*@}*/ -} - -//------------------------------------------------------------------------ -/** Predefined Musical Instrument */ -//------------------------------------------------------------------------ -namespace MusicalInstrument -{ -/** -\defgroup musicalInstrument Predefined Musical Instrument */ -/*@{*/ -const CString kAccordion = "Accordion"; -const CString kAccordionAccordion = "Accordion|Accordion"; -const CString kAccordionHarmonica = "Accordion|Harmonica"; -const CString kAccordionOther = "Accordion|Other"; - -const CString kBass = "Bass"; -const CString kBassABass = "Bass|A. Bass"; -const CString kBassEBass = "Bass|E. Bass"; -const CString kBassSynthBass = "Bass|Synth Bass"; -const CString kBassOther = "Bass|Other"; - -const CString kBrass = "Brass"; -const CString kBrassFrenchHorn = "Brass|French Horn"; -const CString kBrassTrumpet = "Brass|Trumpet"; -const CString kBrassTrombone = "Brass|Trombone"; -const CString kBrassTuba = "Brass|Tuba"; -const CString kBrassSection = "Brass|Section"; -const CString kBrassSynth = "Brass|Synth"; -const CString kBrassOther = "Brass|Other"; - -const CString kChromaticPerc = "Chromatic Perc"; -const CString kChromaticPercBell = "Chromatic Perc|Bell"; -const CString kChromaticPercMallett = "Chromatic Perc|Mallett"; -const CString kChromaticPercWood = "Chromatic Perc|Wood"; -const CString kChromaticPercPercussion = "Chromatic Perc|Percussion"; -const CString kChromaticPercTimpani = "Chromatic Perc|Timpani"; -const CString kChromaticPercOther = "Chromatic Perc|Other"; - -const CString kDrumPerc = "Drum&Perc"; -const CString kDrumPercDrumsetGM = "Drum&Perc|Drumset GM"; -const CString kDrumPercDrumset = "Drum&Perc|Drumset"; -const CString kDrumPercDrumMenues = "Drum&Perc|Drum Menues"; -const CString kDrumPercBeats = "Drum&Perc|Beats"; -const CString kDrumPercPercussion = "Drum&Perc|Percussion"; -const CString kDrumPercKickDrum = "Drum&Perc|Kick Drum"; -const CString kDrumPercSnareDrum = "Drum&Perc|Snare Drum"; -const CString kDrumPercToms = "Drum&Perc|Toms"; -const CString kDrumPercHiHats = "Drum&Perc|HiHats"; -const CString kDrumPercCymbals = "Drum&Perc|Cymbals"; -const CString kDrumPercOther = "Drum&Perc|Other"; - -const CString kEthnic = "Ethnic"; -const CString kEthnicAsian = "Ethnic|Asian"; -const CString kEthnicAfrican = "Ethnic|African"; -const CString kEthnicEuropean = "Ethnic|European"; -const CString kEthnicLatin = "Ethnic|Latin"; -const CString kEthnicAmerican = "Ethnic|American"; -const CString kEthnicAlien = "Ethnic|Alien"; -const CString kEthnicOther = "Ethnic|Other"; - -const CString kGuitar = "Guitar/Plucked"; -const CString kGuitarAGuitar = "Guitar/Plucked|A. Guitar"; -const CString kGuitarEGuitar = "Guitar/Plucked|E. Guitar"; -const CString kGuitarHarp = "Guitar/Plucked|Harp"; -const CString kGuitarEthnic = "Guitar/Plucked|Ethnic"; -const CString kGuitarOther = "Guitar/Plucked|Other"; - -const CString kKeyboard = "Keyboard"; -const CString kKeyboardClavi = "Keyboard|Clavi"; -const CString kKeyboardEPiano = "Keyboard|E. Piano"; -const CString kKeyboardHarpsichord = "Keyboard|Harpsichord"; -const CString kKeyboardOther = "Keyboard|Other"; - -const CString kMusicalFX = "Musical FX"; -const CString kMusicalFXHitsStabs = "Musical FX|Hits&Stabs"; -const CString kMusicalFXMotion = "Musical FX|Motion"; -const CString kMusicalFXSweeps = "Musical FX|Sweeps"; -const CString kMusicalFXBeepsBlips = "Musical FX|Beeps&Blips"; -const CString kMusicalFXScratches = "Musical FX|Scratches"; -const CString kMusicalFXOther = "Musical FX|Other"; - -const CString kOrgan = "Organ"; -const CString kOrganElectric = "Organ|Electric"; -const CString kOrganPipe = "Organ|Pipe"; -const CString kOrganOther = "Organ|Other"; - -const CString kPiano = "Piano"; -const CString kPianoAPiano = "Piano|A. Piano"; -const CString kPianoEGrand = "Piano|E. Grand"; -const CString kPianoOther = "Piano|Other"; - -const CString kSoundFX = "Sound FX"; -const CString kSoundFXNature = "Sound FX|Nature"; -const CString kSoundFXMechanical = "Sound FX|Mechanical"; -const CString kSoundFXSynthetic = "Sound FX|Synthetic"; -const CString kSoundFXOther = "Sound FX|Other"; - -const CString kStrings = "Strings"; -const CString kStringsViolin = "Strings|Violin"; -const CString kStringsViola = "Strings|Viola"; -const CString kStringsCello = "Strings|Cello"; -const CString kStringsBass = "Strings|Bass"; -const CString kStringsSection = "Strings|Section"; -const CString kStringsSynth = "Strings|Synth"; -const CString kStringsOther = "Strings|Other"; - -const CString kSynthLead = "Synth Lead"; -const CString kSynthLeadAnalog = "Synth Lead|Analog"; -const CString kSynthLeadDigital = "Synth Lead|Digital"; -const CString kSynthLeadArpeggio = "Synth Lead|Arpeggio"; -const CString kSynthLeadOther = "Synth Lead|Other"; - -const CString kSynthPad = "Synth Pad"; -const CString kSynthPadSynthChoir = "Synth Pad|Synth Choir"; -const CString kSynthPadAnalog = "Synth Pad|Analog"; -const CString kSynthPadDigital = "Synth Pad|Digital"; -const CString kSynthPadMotion = "Synth Pad|Motion"; -const CString kSynthPadOther = "Synth Pad|Other"; - -const CString kSynthComp = "Synth Comp"; -const CString kSynthCompAnalog = "Synth Comp|Analog"; -const CString kSynthCompDigital = "Synth Comp|Digital"; -const CString kSynthCompOther = "Synth Comp|Other"; - -const CString kVocal = "Vocal"; -const CString kVocalLeadVocal = "Vocal|Lead Vocal"; -const CString kVocalAdlibs = "Vocal|Adlibs"; -const CString kVocalChoir = "Vocal|Choir"; -const CString kVocalSolo = "Vocal|Solo"; -const CString kVocalFX = "Vocal|FX"; -const CString kVocalSpoken = "Vocal|Spoken"; -const CString kVocalOther = "Vocal|Other"; - -const CString kWoodwinds = "Woodwinds"; -const CString kWoodwindsEthnic = "Woodwinds|Ethnic"; -const CString kWoodwindsFlute = "Woodwinds|Flute"; -const CString kWoodwindsOboe = "Woodwinds|Oboe"; -const CString kWoodwindsEnglHorn = "Woodwinds|Engl. Horn"; -const CString kWoodwindsClarinet = "Woodwinds|Clarinet"; -const CString kWoodwindsSaxophone = "Woodwinds|Saxophone"; -const CString kWoodwindsBassoon = "Woodwinds|Bassoon"; -const CString kWoodwindsOther = "Woodwinds|Other"; -/*@}*/ -}; - -//------------------------------------------------------------------------ -/** Predefined Musical Style */ -//------------------------------------------------------------------------ -namespace MusicalStyle -{ -/** -\defgroup musicalStyle Predefined Musical Style */ -/*@{*/ -const CString kAlternativeIndie = "Alternative/Indie"; -const CString kAlternativeIndieGothRock = "Alternative/Indie|Goth Rock"; -const CString kAlternativeIndieGrunge = "Alternative/Indie|Grunge"; -const CString kAlternativeIndieNewWave = "Alternative/Indie|New Wave"; -const CString kAlternativeIndiePunk = "Alternative/Indie|Punk"; -const CString kAlternativeIndieCollegeRock = "Alternative/Indie|College Rock"; -const CString kAlternativeIndieDarkWave = "Alternative/Indie|Dark Wave"; -const CString kAlternativeIndieHardcore = "Alternative/Indie|Hardcore"; - -const CString kAmbientChillOut = "Ambient/ChillOut"; -const CString kAmbientChillOutNewAgeMeditation = "Ambient/ChillOut|New Age/Meditation"; -const CString kAmbientChillOutDarkAmbient = "Ambient/ChillOut|Dark Ambient"; -const CString kAmbientChillOutDowntempo = "Ambient/ChillOut|Downtempo"; -const CString kAmbientChillOutLounge = "Ambient/ChillOut|Lounge"; - -const CString kBlues = "Blues"; -const CString kBluesAcousticBlues = "Blues|Acoustic Blues"; -const CString kBluesCountryBlues = "Blues|Country Blues"; -const CString kBluesElectricBlues = "Blues|Electric Blues"; -const CString kBluesChicagoBlues = "Blues|Chicago Blues"; - -const CString kClassical = "Classical"; -const CString kClassicalBaroque = "Classical|Baroque"; -const CString kClassicalChamberMusic = "Classical|Chamber Music"; -const CString kClassicalMedieval = "Classical|Medieval"; -const CString kClassicalModernComposition = "Classical|Modern Composition"; -const CString kClassicalOpera = "Classical|Opera"; -const CString kClassicalGregorian = "Classical|Gregorian"; -const CString kClassicalRenaissance = "Classical|Renaissance"; -const CString kClassicalClassic = "Classical|Classic"; -const CString kClassicalRomantic = "Classical|Romantic"; -const CString kClassicalSoundtrack = "Classical|Soundtrack"; - -const CString kCountry = "Country"; -const CString kCountryCountryWestern = "Country|Country/Western"; -const CString kCountryHonkyTonk = "Country|Honky Tonk"; -const CString kCountryUrbanCowboy = "Country|Urban Cowboy"; -const CString kCountryBluegrass = "Country|Bluegrass"; -const CString kCountryAmericana = "Country|Americana"; -const CString kCountrySquaredance = "Country|Squaredance"; -const CString kCountryNorthAmericanFolk = "Country|North American Folk"; - -const CString kElectronicaDance = "Electronica/Dance"; -const CString kElectronicaDanceMinimal = "Electronica/Dance|Minimal"; -const CString kElectronicaDanceClassicHouse = "Electronica/Dance|Classic House"; -const CString kElectronicaDanceElektroHouse = "Electronica/Dance|Elektro House"; -const CString kElectronicaDanceFunkyHouse = "Electronica/Dance|Funky House"; -const CString kElectronicaDanceIndustrial = "Electronica/Dance|Industrial"; -const CString kElectronicaDanceElectronicBodyMusic = "Electronica/Dance|Electronic Body Music"; -const CString kElectronicaDanceTripHop = "Electronica/Dance|Trip Hop"; -const CString kElectronicaDanceTechno = "Electronica/Dance|Techno"; -const CString kElectronicaDanceDrumNBassJungle = "Electronica/Dance|Drum'n'Bass/Jungle"; -const CString kElectronicaDanceElektro = "Electronica/Dance|Elektro"; -const CString kElectronicaDanceTrance = "Electronica/Dance|Trance"; -const CString kElectronicaDanceDub = "Electronica/Dance|Dub"; -const CString kElectronicaDanceBigBeats = "Electronica/Dance|Big Beats"; - -const CString kExperimental = "Experimental"; -const CString kExperimentalNewMusic = "Experimental|New Music"; -const CString kExperimentalFreeImprovisation = "Experimental|Free Improvisation"; -const CString kExperimentalElectronicArtMusic = "Experimental|Electronic Art Music"; -const CString kExperimentalNoise = "Experimental|Noise"; - -const CString kJazz = "Jazz"; -const CString kJazzNewOrleansJazz = "Jazz|New Orleans Jazz"; -const CString kJazzTraditionalJazz = "Jazz|Traditional Jazz"; -const CString kJazzOldtimeJazzDixiland = "Jazz|Oldtime Jazz/Dixiland"; -const CString kJazzFusion = "Jazz|Fusion"; -const CString kJazzAvantgarde = "Jazz|Avantgarde"; -const CString kJazzLatinJazz = "Jazz|Latin Jazz"; -const CString kJazzFreeJazz = "Jazz|Free Jazz"; -const CString kJazzRagtime = "Jazz|Ragtime"; - -const CString kPop = "Pop"; -const CString kPopBritpop = "Pop|Britpop"; -const CString kPopRock = "Pop|Pop/Rock"; -const CString kPopTeenPop = "Pop|Teen Pop"; -const CString kPopChartDance = "Pop|Chart Dance"; -const CString kPop80sPop = "Pop|80's Pop"; -const CString kPopDancehall = "Pop|Dancehall"; -const CString kPopDisco = "Pop|Disco"; - -const CString kRockMetal = "Rock/Metal"; -const CString kRockMetalBluesRock = "Rock/Metal|Blues Rock"; -const CString kRockMetalClassicRock = "Rock/Metal|Classic Rock"; -const CString kRockMetalHardRock = "Rock/Metal|Hard Rock"; -const CString kRockMetalRockRoll = "Rock/Metal|Rock & Roll"; -const CString kRockMetalSingerSongwriter = "Rock/Metal|Singer/Songwriter"; -const CString kRockMetalHeavyMetal = "Rock/Metal|Heavy Metal"; -const CString kRockMetalDeathBlackMetal = "Rock/Metal|Death/Black Metal"; -const CString kRockMetalNuMetal = "Rock/Metal|NuMetal"; -const CString kRockMetalReggae = "Rock/Metal|Reggae"; -const CString kRockMetalBallad = "Rock/Metal|Ballad"; -const CString kRockMetalAlternativeRock = "Rock/Metal|Alternative Rock"; -const CString kRockMetalRockabilly = "Rock/Metal|Rockabilly"; -const CString kRockMetalThrashMetal = "Rock/Metal|Thrash Metal"; -const CString kRockMetalProgressiveRock = "Rock/Metal|Progressive Rock"; - -const CString kUrbanHipHopRB = "Urban (Hip-Hop / R&B)"; -const CString kUrbanHipHopRBClassic = "Urban (Hip-Hop / R&B)|Classic R&B"; -const CString kUrbanHipHopRBModern = "Urban (Hip-Hop / R&B)|Modern R&B"; -const CString kUrbanHipHopRBPop = "Urban (Hip-Hop / R&B)|R&B Pop"; -const CString kUrbanHipHopRBWestCoastHipHop = "Urban (Hip-Hop / R&B)|WestCoast Hip-Hop"; -const CString kUrbanHipHopRBEastCoastHipHop = "Urban (Hip-Hop / R&B)|EastCoast Hip-Hop"; -const CString kUrbanHipHopRBRapHipHop = "Urban (Hip-Hop / R&B)|Rap/Hip Hop"; -const CString kUrbanHipHopRBSoul = "Urban (Hip-Hop / R&B)|Soul"; -const CString kUrbanHipHopRBFunk = "Urban (Hip-Hop / R&B)|Funk"; - -const CString kWorldEthnic = "World/Ethnic"; -const CString kWorldEthnicAfrica = "World/Ethnic|Africa"; -const CString kWorldEthnicAsia = "World/Ethnic|Asia"; -const CString kWorldEthnicCeltic = "World/Ethnic|Celtic"; -const CString kWorldEthnicEurope = "World/Ethnic|Europe"; -const CString kWorldEthnicKlezmer = "World/Ethnic|Klezmer"; -const CString kWorldEthnicScandinavia = "World/Ethnic|Scandinavia"; -const CString kWorldEthnicEasternEurope = "World/Ethnic|Eastern Europe"; -const CString kWorldEthnicIndiaOriental = "World/Ethnic|India/Oriental"; -const CString kWorldEthnicNorthAmerica = "World/Ethnic|North America"; -const CString kWorldEthnicSouthAmerica = "World/Ethnic|South America"; -const CString kWorldEthnicAustralia = "World/Ethnic|Australia"; -/*@}*/ -}; - -//------------------------------------------------------------------------ -/** Predefined Musical Character */ -//------------------------------------------------------------------------ -namespace MusicalCharacter -{ -/** -\defgroup musicalCharacter Predefined Musical Character */ -/*@{*/ -//----TYPE------------------------------------ -const CString kMono = "Mono"; -const CString kPoly = "Poly"; - -const CString kSplit = "Split"; -const CString kLayer = "Layer"; - -const CString kGlide = "Glide"; -const CString kGlissando = "Glissando"; - -const CString kMajor = "Major"; -const CString kMinor = "Minor"; - -const CString kSingle = "Single"; -const CString kEnsemble = "Ensemble"; - -const CString kAcoustic = "Acoustic"; -const CString kElectric = "Electric"; - -const CString kAnalog = "Analog"; -const CString kDigital = "Digital"; - -const CString kVintage = "Vintage"; -const CString kModern = "Modern"; - -const CString kOld = "Old"; -const CString kNew = "New"; - -//----TONE------------------------------------ -const CString kClean = "Clean"; -const CString kDistorted = "Distorted"; - -const CString kDry = "Dry"; -const CString kProcessed = "Processed"; - -const CString kHarmonic = "Harmonic"; -const CString kDissonant = "Dissonant"; - -const CString kClear = "Clear"; -const CString kNoisy = "Noisy"; - -const CString kThin = "Thin"; -const CString kRich = "Rich"; - -const CString kDark = "Dark"; -const CString kBright = "Bright"; - -const CString kCold = "Cold"; -const CString kWarm = "Warm"; - -const CString kMetallic = "Metallic"; -const CString kWooden = "Wooden"; - -const CString kGlass = "Glass"; -const CString kPlastic = "Plastic"; - -//----ENVELOPE------------------------------------ -const CString kPercussive = "Percussive"; -const CString kSoft = "Soft"; - -const CString kFast = "Fast"; -const CString kSlow = "Slow"; - -const CString kShort = "Short"; -const CString kLong = "Long"; - -const CString kAttack = "Attack"; -const CString kRelease = "Release"; - -const CString kDecay = "Decay"; -const CString kSustain = "Sustain"; - -const CString kFastAttack = "Fast Attack"; -const CString kSlowAttack = "Slow Attack"; - -const CString kShortRelease = "Short Release"; -const CString kLongRelease = "Long Release"; - -const CString kStatic = "Static"; -const CString kMoving = "Moving"; - -const CString kLoop = "Loop"; -const CString kOneShot = "One Shot"; -/*@}*/ -}; - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg diff --git a/vst/pluginterfaces/vst/vstpshpack4.h b/vst/pluginterfaces/vst/vstpshpack4.h deleted file mode 100644 index 751af900..00000000 --- a/vst/pluginterfaces/vst/vstpshpack4.h +++ /dev/null @@ -1,48 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Interfaces -// Filename : pluginterfaces/vst/vstpshpack4.h -// Created by : Steinberg, 05/2010 -// Description : This file turns 4 Bytes packing of structures on. The file -// pluginterfaces/base/falignpop.h is the complement to this file. -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#pragma once - -//---------------------------------------------------------------------------------------------- -#if defined __BORLANDC__ - #pragma -a4 -#else - #if (_MSC_VER >= 800 && !defined(_M_I86)) || defined(_PUSHPOP_SUPPORTED) - #pragma warning(disable:4103) - #endif - - #pragma pack(push) - #pragma pack(4) -#endif diff --git a/vst/pluginterfaces/vst/vsttypes.h b/vst/pluginterfaces/vst/vsttypes.h deleted file mode 100644 index 7e86fd0f..00000000 --- a/vst/pluginterfaces/vst/vsttypes.h +++ /dev/null @@ -1,751 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Interfaces -// Filename : pluginterfaces/vst/vsttypes.h -// Created by : Steinberg, 12/2005 -// Description : common defines -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#pragma once - -#include "pluginterfaces/base/fstrdefs.h" - -//------------------------------------------------------------------------ -namespace Steinberg { -namespace Vst { -//------------------------------------------------------------------------ -#ifndef kVstVersionString -#define kVstVersionString "VST 3.6.5" ///< SDK version for PClassInfo2 -#endif - -#define kVstVersionMajor 3 -#define kVstVersionMinor 6 -#define kVstVersionSub 5 - -// 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) - -//------------------------------------------------------------------------ -// struct alignment definitions -//------------------------------------------------------------------------ -#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) - #define VST3_STRUCT struct __attribute__((aligned(4))) -#elif WINDOWS - #if PLATFORM_64 - #define VST3_PACKED_SIZE 8 - #else - #define VST3_PACKED_SIZE 4 - #endif - #define VST3_STRUCT __declspec(align(VST3_PACKED_SIZE)) struct -#else - #error "unsupported compiler" -#endif - -//------------------------------------------------------------------------ -/** \defgroup vst3typedef VST 3 Data Types -*/ -/*@{*/ -//------------------------------------------------------------------------ -// string types -//------------------------------------------------------------------------ -typedef char16 TChar; ///< UTF-16 character -typedef TChar String128[128]; ///< 128 character UTF-16 string -typedef const char8* CString; ///< C-String - -//------------------------------------------------------------------------ -// general -//------------------------------------------------------------------------ -typedef int32 MediaType; ///< media type (audio/event) -typedef int32 BusDirection; ///< bus direction (in/out) -typedef int32 BusType; ///< bus type (main/aux) -typedef int32 IoMode; ///< I/O mode -typedef int32 UnitID; ///< unit identifier -typedef double ParamValue; ///< parameter value type -typedef uint32 ParamID; ///< parameter identifier -typedef int32 ProgramListID; ///< program list identifier -typedef int16 CtrlNumber; ///< MIDI controller number (see \ref ControllerNumbers for allowed values) - -typedef double TQuarterNotes; ///< time expressed in quarter notes -typedef int64 TSamples; ///< time expressed in audio samples - -typedef uint32 ColorSpec; ///< color defining by 4 component ARGB value (Alpha/Red/Green/Blue) - -//------------------------------------------------------------------------ -// Audio Types -//------------------------------------------------------------------------ -typedef float Sample32; ///< 32-bit precision audio sample -typedef double Sample64; ///< 64-bit precision audio sample -typedef double SampleRate; ///< sample rate -/*@}*/ - -//------------------------------------------------------------------------ -/** \defgroup speakerArrangements Speaker Arrangements -\image html "vst3_speaker_types.jpg" -\n -A SpeakerArrangement is a bitset combination of speakers. For example: -\code -const SpeakerArrangement kStereo = kSpeakerL | kSpeakerR; // => hex: 0x03 / binary: 0011. -\endcode*/ -//------------------------------------------------------------------------ -/**@{*/ -typedef uint64 SpeakerArrangement; ///< Bitset of speakers -typedef uint64 Speaker; ///< Bit for one speaker -/**@}*/ - -//------------------------------------------------------------------------ -/** Speaker Definitions. -\ingroup speakerArrangements */ -//------------------------------------------------------------------------ -/**@{*/ -const Speaker kSpeakerL = 1 << 0; ///< Left (L) -const Speaker kSpeakerR = 1 << 1; ///< Right (R) -const Speaker kSpeakerC = 1 << 2; ///< Center (C) -const Speaker kSpeakerLfe = 1 << 3; ///< Subbass (Lfe) -const Speaker kSpeakerLs = 1 << 4; ///< Left Surround (Ls) -const Speaker kSpeakerRs = 1 << 5; ///< Right Surround (Rs) -const Speaker kSpeakerLc = 1 << 6; ///< Left of Center (Lc) -const Speaker kSpeakerRc = 1 << 7; ///< Right of Center (Rc) -const Speaker kSpeakerS = 1 << 8; ///< Surround (S) -const Speaker kSpeakerCs = kSpeakerS; ///< Center of Surround (Cs) = Surround (S) -const Speaker kSpeakerSl = 1 << 9; ///< Side Left (Sl) -const Speaker kSpeakerSr = 1 << 10; ///< Side Right (Sr) -const Speaker kSpeakerTm = 1 << 11; ///< Top Middle - Center Over-head (Tm) -const Speaker kSpeakerTfl = 1 << 12; ///< Top Front Left (Tfl) -const Speaker kSpeakerTfc = 1 << 13; ///< Top Front Center (Tfc) -const Speaker kSpeakerTfr = 1 << 14; ///< Top Front Right (Tfr) -const Speaker kSpeakerTrl = 1 << 15; ///< Top Rear Left (Trl) -const Speaker kSpeakerTrc = 1 << 16; ///< Top Rear Center (Trc) -const Speaker kSpeakerTrr = 1 << 17; ///< Top Rear Right (Trr) -const Speaker kSpeakerLfe2 = 1 << 18; ///< Subbass 2 (Lfe2) -const Speaker kSpeakerM = 1 << 19; ///< Mono (M) - -const Speaker kSpeakerW = 1 << 20; ///< B-Format W -const Speaker kSpeakerX = 1 << 21; ///< B-Format X -const Speaker kSpeakerY = 1 << 22; ///< B-Format Y -const Speaker kSpeakerZ = 1 << 23; ///< B-Format Z - -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) -const Speaker kSpeakerRcs = 1 << 27; ///< Right of Center Surround (Rcs) - -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 kSpeakerPl = (Speaker)1 << 31; ///< Proximity Left (Pl) -const Speaker kSpeakerPr = (Speaker)1 << 32; ///< Proximity Right (Pr) -//------------------------------------------------------------------------ -/** @}*/ - -//------------------------------------------------------------------------ -/** Speaker Arrangement Definitions (SpeakerArrangement)*/ -//------------------------------------------------------------------------ -namespace SpeakerArr -{ -//------------------------------------------------------------------------ -/** Speaker Arrangement Definitions. -\ingroup speakerArrangements */ -/*@{*/ -const SpeakerArrangement kEmpty = 0; ///< empty arrangement -const SpeakerArrangement kMono = kSpeakerM; ///< M -const SpeakerArrangement kStereo = kSpeakerL | kSpeakerR; ///< L R -const SpeakerArrangement kStereoSurround = kSpeakerLs | kSpeakerRs; ///< Ls Rs -const SpeakerArrangement kStereoCenter = kSpeakerLc | kSpeakerRc; ///< Lc Rc -const SpeakerArrangement kStereoSide = kSpeakerSl | kSpeakerSr; ///< Sl Sr -const SpeakerArrangement kStereoCLfe = kSpeakerC | kSpeakerLfe; ///< C Lfe -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 - -/** L R C */ -const SpeakerArrangement k30Cine = kSpeakerL | kSpeakerR | kSpeakerC; -/** L R S */ -const SpeakerArrangement k30Music = kSpeakerL | kSpeakerR | kSpeakerS; -/** L R C Lfe */ -const SpeakerArrangement k31Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe; -/** L R Lfe S */ -const SpeakerArrangement k31Music = kSpeakerL | kSpeakerR | kSpeakerLfe | kSpeakerS; -/** L R C S (LCRS) */ -const SpeakerArrangement k40Cine = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerS; -/** 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 */ -const SpeakerArrangement k50 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs; -/** L R C Lfe Ls Rs */ -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 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; -/** L R C Lfe Ls Rs Sl Sr */ -const SpeakerArrangement k71Music = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr; -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 Lfe Ls Rs Cs Sl Sr */ -const SpeakerArrangement k81Music = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerCs | kSpeakerSl | kSpeakerSr; - -/** W X Y Z (First Order) */ -const SpeakerArrangement kBFormat1stOrder = kSpeakerW | kSpeakerX | kSpeakerY | kSpeakerZ; -const SpeakerArrangement kBFormat = kBFormat1stOrder; - -/*-----------*/ -/* 3D formats */ -/*-----------*/ -/** L R Ls Rs Tfl Tfr Trl Trr */ -const SpeakerArrangement k80Cube = kSpeakerL | kSpeakerR | kSpeakerLs | kSpeakerRs | kSpeakerTfl| kSpeakerTfr| kSpeakerTrl | kSpeakerTrr; -/** L R C Lfe Ls Rs Cs Tm */ -const SpeakerArrangement k71CineTopCenter = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerCs | kSpeakerTm; -/** L R C Lfe Ls Rs Cs Tfc */ -const SpeakerArrangement k71CineCenterHigh = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerCs | kSpeakerTfc; -/** L R C Lfe Ls Rs Tfl Tfr */ -const SpeakerArrangement k71CineFrontHigh = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerTfl | kSpeakerTfr; -const SpeakerArrangement k71MPEG3D = k71CineFrontHigh; -/** L R C Lfe Ls Rs Tsl Tsr */ -const SpeakerArrangement k71CineSideHigh = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerTsl | kSpeakerTsr; - -/** L R Lfe Ls Rs Tfl Tfc Tfr Bfc */ -const SpeakerArrangement k81MPEG3D = kSpeakerL | kSpeakerR | kSpeakerLfe | kSpeakerLs | kSpeakerRs | - kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerBfc; - -/** L R C Ls Rs Tfl Tfr Trl Trr */ -const SpeakerArrangement k90 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | - kSpeakerTfl| kSpeakerTfr | kSpeakerTrl | kSpeakerTrr; -/** L R C Lfe Ls Rs Tfl Tfr Trl Trr */ -const SpeakerArrangement k91 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | - kSpeakerTfl| kSpeakerTfr | kSpeakerTrl | kSpeakerTrr; - -/** 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 Tm Tfl Tfr Trl Trr */ -const SpeakerArrangement k100 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | - kSpeakerTm | kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr; -/** L R C Lfe Ls Rs Tm Tfl Tfr Trl Trr */ -const SpeakerArrangement k101 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | - kSpeakerTm | kSpeakerTfl | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr; -const SpeakerArrangement k101MPEG3D = k101; - -/** L R C Lfe Ls Rs Tfl Tfc Tfr Trl Trr Lfe2 */ -const SpeakerArrangement k102 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | - kSpeakerTfl| kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr | kSpeakerLfe2; - -/** L R C Ls Rs Tm Tfl Tfc Tfr Trl Trr */ -const SpeakerArrangement k110 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | - kSpeakerTm | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr; -/** L R C Lfe Ls Rs Tm Tfl Tfc Tfr Trl Trr */ -const SpeakerArrangement k111 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | - kSpeakerTm | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr; -/** L R C Lfe Ls Rs Lc Rc Tfl Tfc Tfr Trl Trr Lfe2 */ -const SpeakerArrangement k122 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerLc | kSpeakerRc | - kSpeakerTfl| kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr | kSpeakerLfe2; -/** L R C Ls Rs Cs Tm Tfl Tfc Tfr Trl Trc Trr */ -const SpeakerArrangement k130 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr | - kSpeakerTm | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr; -/** L R C Lfe Ls Rs Cs Tm Tfl Tfc Tfr Trl Trc Trr */ -const SpeakerArrangement k131 = kSpeakerL | kSpeakerR | kSpeakerC | kSpeakerLfe | kSpeakerLs | kSpeakerRs | kSpeakerSl | kSpeakerSr | - kSpeakerTm | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrr; - -/** L R C Lfe Ls Rs Lc Rc Cs Sl Sr Tm 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 | - kSpeakerTm | kSpeakerTfl | kSpeakerTfc | kSpeakerTfr | kSpeakerTrl | kSpeakerTrc | kSpeakerTrr | kSpeakerLfe2 | kSpeakerTsl | kSpeakerTsr | - kSpeakerBfl| kSpeakerBfc | kSpeakerBfr; - -//------------------------------------------------------------------------ -/** Speaker Arrangement String Representation. -\ingroup speakerArrangements */ -/*@{*/ -const CString kStringEmpty = ""; -const CString kStringMono = "Mono"; -const CString kStringStereo = "Stereo"; -const CString kStringStereoR = "Stereo (Ls Rs)"; -const CString kStringStereoC = "Stereo (Lc Rc)"; -const CString kStringStereoSide = "Stereo (Sl Sr)"; -const CString kStringStereoCLfe = "Stereo (C LFE)"; -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 kString30Cine = "LRC"; -const CString kString30Music = "LRS"; -const CString kString31Cine = "LRC+LFE"; -const CString kString31Music = "LRS+LFE"; -const CString kString40Cine = "LRCS"; -const CString kString40Music = "Quadro"; -const CString kString41Cine = "LRCS+LFE"; -const CString kString41Music = "Quadro+LFE"; -const CString kString50 = "5.0"; -const CString kString51 = "5.1"; -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"; -const CString kString70Music = "7.0 Music"; -const CString kString71Cine = "7.1 Cine"; -const CString kString71Music = "7.1 Music"; -const CString kString71CineTopCenter = "7.1 Cine Top Center"; -const CString kString71CineCenterHigh = "7.1 Cine Center High"; -const CString kString71CineFrontHigh = "7.1 Cine Front High"; -const CString kString71CineSideHigh = "7.1 Cine Side High"; -const CString kString71CineFullRear = "7.1 Cine Full Rear"; -const CString kString71Proximity = "7.1 Proximity"; -const CString kString80Cine = "8.0 Cine"; -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 kString102 = "10.2"; -const CString kString122 = "12.2"; -const CString kString90 = "9.0"; -const CString kString91 = "9.1"; -const CString kString91Atmos = "9.1 Atmos"; -const CString kString100 = "10.0"; -const CString kString101 = "10.1"; -const CString kString110 = "11.0"; -const CString kString111 = "11.1"; -const CString kString130 = "13.0"; -const CString kString131 = "13.1"; -const CString kString81MPEG = "8.1 MPEG"; -const CString kString222 = "22.2"; -const CString kStringBFormat1stOrder = "BFormat"; -/*@}*/ - -//------------------------------------------------------------------------ -/** Speaker Arrangement String Representation with Speakers Name. -\ingroup speakerArrangements */ -/*@{*/ -const CString kStringMonoS = "M"; -const CString kStringStereoS = "L R"; -const CString kStringStereoRS = "Ls Rs"; -const CString kStringStereoCS = "Lc Rc"; -const CString kStringStereoSS = "Sl Sr"; -const CString kStringStereoCLfeS= "C LFE"; -const CString kStringStereoTFS = "Tfl Tfr"; -const CString kStringStereoTSS = "Tsl Tsr"; -const CString kStringStereoTRS = "Trl Trr"; -const CString kStringStereoBFS = "Bfl Bfr"; -const CString kString30CineS = "L R C"; -const CString kString30MusicS = "L R S"; -const CString kString31CineS = "L R C LFE"; -const CString kString31MusicS = "L R LFE S"; -const CString kString40CineS = "L R C S"; -const CString kString40MusicS = "L R Ls Rs"; -const CString kString41CineS = "L R C LFE S"; -const CString kString41MusicS = "L R LFE Ls Rs"; -const CString kString50S = "L R C Ls Rs"; -const CString kString51S = "L R C LFE Ls Rs"; -const CString kString60CineS = "L R C Ls Rs Cs"; -const CString kString60MusicS = "L R Ls Rs Sl Sr"; -const CString kString61CineS = "L R C LFE Ls Rs Cs"; -const CString kString61MusicS = "L R LFE Ls Rs Sl Sr"; -const CString kString70CineS = "L R C Ls Rs Lc Rc"; -const CString kString70MusicS = "L R C Ls Rs Sl Sr"; -const CString kString71CineS = "L R C LFE Ls Rs Lc Rc"; -const CString kString71MusicS = "L R C LFE Ls Rs Sl Sr"; -const CString kString80CineS = "L R C Ls Rs Lc Rc Cs"; -const CString kString80MusicS = "L R C Ls Rs Cs Sl Sr"; -const CString kString81CineS = "L R C LFE Ls Rs Lc Rc Cs"; -const CString kString81MusicS = "L R C LFE Ls Rs Cs Sl Sr"; -const CString kString80CubeS = "L R Ls Rs Tfl Tfr Trl Trr"; -const CString kStringBFormat1stOrderS = "W X Y Z"; -const CString kString71CineTopCenterS = "L R C LFE Ls Rs Cs Tm"; -const CString kString71CineCenterHighS = "L R C LFE Ls Rs Cs Tfc"; -const CString kString71CineFrontHighS = "L R C LFE Ls Rs Tfl Tfl"; -const CString kString71CineSideHighS = "L R C LFE Ls Rs Tsl Tsl"; -const CString kString71CineFullRearS = "L R C LFE Ls Rs Lcs Rcs"; -const CString kString71ProximityS = "L R C LFE Ls Rs Pl Pr"; -const CString kString90S = "L R C Ls Rs Tfl Tfr Trl Trr"; -const CString kString91S = "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 kString100S = "L R C Ls Rs Tm Tfl Tfr Trl Trr"; -const CString kString101S = "L R C LFE Ls Rs Tm Tfl Tfr Trl Trr"; -const CString kString110S = "L R C Ls Rs Tm Tfl Tfc Tfr Trl Trr"; -const CString kString111S = "L R C LFE Ls Rs Tm Tfl Tfc Tfr Trl Trr"; -const CString kString130S = "L R C Ls Rs Sl Sr Tm Tfl Tfc Tfr Trl Trr"; -const CString kString131S = "L R C LFE Ls Rs Sl Sr Tm Tfl Tfc Tfr Trl Trr"; -const CString kString102S = "L R C LFE Ls Rs Tfl Tfc Tfr Trl Trr LFE2"; -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 kString222S = "L R C LFE Ls Rs Lc Rc Cs Sl Sr Tm Tfl Tfc Tfr Trl Trc Trr LFE2 Tsl Tsr Bfl Bfc Bfr"; - -/*@}*/ - -//------------------------------------------------------------------------ -/** Returns number of channels used in speaker arrangement. -\ingroup speakerArrangements */ -/*@{*/ -inline int32 getChannelCount (SpeakerArrangement arr) -{ - int32 count = 0; - while (arr) - { - if (arr & (SpeakerArrangement)1) - ++count; - arr >>= 1; - } - return count; -} - -//------------------------------------------------------------------------ -/** Returns the index of a given speaker in a speaker arrangement (-1 if speaker is not part of the arrangement). */ -inline int32 getSpeakerIndex (Speaker speaker, SpeakerArrangement arrangement) -{ - // check if speaker is present in arrangement - if ((arrangement & speaker) == 0) - return -1; - - int32 result = 0; - Speaker i = 1; - while (i < speaker) - { - if (arrangement & i) - result++; - i <<= 1; - } - - return result; -} - -//------------------------------------------------------------------------ -/** Returns the speaker arrangement associated to a string representation. - Returns kEmpty if no associated arrangement is known. -*/ -inline SpeakerArrangement getSpeakerArrangementFromString (CString arrStr) -{ - if (!strcmp8 (arrStr, kStringMono)) - return kMono; - if (!strcmp8 (arrStr, kStringStereo)) - return kStereo; - if (!strcmp8 (arrStr, kStringStereoR)) - return kStereoSurround; - if (!strcmp8 (arrStr, kStringStereoC)) - return kStereoCenter; - if (!strcmp8 (arrStr, kStringStereoSide)) - return kStereoSide; - if (!strcmp8 (arrStr, kStringStereoCLfe)) - return kStereoCLfe; - if (!strcmp8 (arrStr, kStringStereoTF)) - return kStereoTF; - if (!strcmp8 (arrStr, kStringStereoTS)) - return kStereoTS; - if (!strcmp8 (arrStr, kStringStereoTR)) - return kStereoTR; - if (!strcmp8 (arrStr, kStringStereoBF)) - return kStereoBF; - if (!strcmp8 (arrStr, kString30Cine)) - return k30Cine; - if (!strcmp8 (arrStr, kString30Music)) - return k30Music; - if (!strcmp8 (arrStr, kString31Cine)) - return k31Cine; - if (!strcmp8 (arrStr, kString31Music)) - return k31Music; - if (!strcmp8 (arrStr, kString40Cine)) - return k40Cine; - if (!strcmp8 (arrStr, kString40Music)) - return k40Music; - if (!strcmp8 (arrStr, kString41Cine)) - return k41Cine; - if (!strcmp8 (arrStr, kString41Music)) - return k41Music; - if (!strcmp8 (arrStr, kString50)) - return k50; - if (!strcmp8 (arrStr, kString51)) - return k51; - if (!strcmp8 (arrStr, kString60Cine)) - return k60Cine; - if (!strcmp8 (arrStr, kString60Music)) - return k60Music; - if (!strcmp8 (arrStr, kString61Cine)) - return k61Cine; - if (!strcmp8 (arrStr, kString61Music)) - return k61Music; - if (!strcmp8 (arrStr, kString70Cine)) - return k70Cine; - if (!strcmp8 (arrStr, kString70Music)) - return k70Music; - if (!strcmp8 (arrStr, kString71Cine)) - return k71Cine; - if (!strcmp8 (arrStr, kString71Music)) - return k71Music; - if (!strcmp8 (arrStr, kString71Proximity)) - return k71Proximity; - if (!strcmp8 (arrStr, kString80Cine)) - return k80Cine; - if (!strcmp8 (arrStr, kString80Music)) - return k80Music; - if (!strcmp8 (arrStr, kString81Cine)) - return k81Cine; - if (!strcmp8 (arrStr, kString81Music)) - return k81Music; - if (!strcmp8 (arrStr, kString102)) - return k102; - if (!strcmp8 (arrStr, kString122)) - return k122; - if (!strcmp8 (arrStr, kString80Cube)) - return k80Cube; - if (!strcmp8 (arrStr, kStringBFormat1stOrder)) - return kBFormat1stOrder; - if (!strcmp8 (arrStr, kString71CineTopCenter)) - return k71CineTopCenter; - if (!strcmp8 (arrStr, kString71CineCenterHigh)) - return k71CineCenterHigh; - if (!strcmp8 (arrStr, kString71CineFrontHigh)) - return k71CineFrontHigh; - if (!strcmp8 (arrStr, kString71CineSideHigh)) - return k71CineSideHigh; - if (!strcmp8 (arrStr, kString71CineFullRear)) - return k71CineFullRear; - if (!strcmp8 (arrStr, kString90)) - return k90; - if (!strcmp8 (arrStr, kString81MPEG)) - return k81MPEG3D; - if (!strcmp8 (arrStr, kString91)) - return k91; - if (!strcmp8 (arrStr, kString91Atmos)) - return k91Atmos; - if (!strcmp8 (arrStr, kString100)) - return k100; - if (!strcmp8 (arrStr, kString101)) - return k101; - if (!strcmp8 (arrStr, kString110)) - return k110; - if (!strcmp8 (arrStr, kString111)) - return k111; - if (!strcmp8 (arrStr, kString130)) - return k130; - if (!strcmp8 (arrStr, kString131)) - return k131; - if (!strcmp8 (arrStr, kString222)) - return k222; - return kEmpty; -} - -//------------------------------------------------------------------------ -/** Returns the string representation of a given speaker arrangement. - Returns kStringEmpty if arr is unknown. -*/ -inline CString getSpeakerArrangementString (SpeakerArrangement arr, bool withSpeakersName) -{ - switch (arr) - { - case kMono: return withSpeakersName ? kStringMonoS : kStringMono; - case kStereo: return withSpeakersName ? kStringStereoS : kStringStereo; - case kStereoSurround: return withSpeakersName ? kStringStereoRS : kStringStereoR; - case kStereoCenter: return withSpeakersName ? kStringStereoCS : kStringStereoC; - case kStereoSide: return withSpeakersName ? kStringStereoSS : kStringStereoSide; - case kStereoCLfe: return withSpeakersName ? kStringStereoCLfeS: kStringStereoCLfe; - case kStereoTF: return withSpeakersName ? kStringStereoTFS : kStringStereoTF; - case kStereoTS: return withSpeakersName ? kStringStereoTSS : kStringStereoTS; - case kStereoTR: return withSpeakersName ? kStringStereoTRS : kStringStereoTR; - case kStereoBF: return withSpeakersName ? kStringStereoBFS : kStringStereoBF; - case k30Cine: return withSpeakersName ? kString30CineS : kString30Cine; - case k30Music: return withSpeakersName ? kString30MusicS : kString30Music; - case k31Cine: return withSpeakersName ? kString31CineS : kString31Cine; - case k31Music: return withSpeakersName ? kString31MusicS : kString31Music; - case k40Cine: return withSpeakersName ? kString40CineS : kString40Cine; - case k40Music: return withSpeakersName ? kString40MusicS : kString40Music; - case k41Cine: return withSpeakersName ? kString41CineS : kString41Cine; - case k41Music: return withSpeakersName ? kString41MusicS : kString41Music; - case k50: return withSpeakersName ? kString50S : kString50; - case k51: return withSpeakersName ? kString51S : kString51; - case k60Cine: return withSpeakersName ? kString60CineS : kString60Cine; - case k60Music: return withSpeakersName ? kString60MusicS : kString60Music; - case k61Cine: return withSpeakersName ? kString61CineS : kString61Cine; - case k61Music: return withSpeakersName ? kString61MusicS : kString61Music; - case k70Cine: return withSpeakersName ? kString70CineS : kString70Cine; - case k70Music: return withSpeakersName ? kString70MusicS : kString70Music; - case k71Cine: return withSpeakersName ? kString71CineS : kString71Cine; - case k71Music: return withSpeakersName ? kString71MusicS : kString71Music; - case k71Proximity: return withSpeakersName ? kString71ProximityS : kString71Proximity; - case k80Cine: return withSpeakersName ? kString80CineS : kString80Cine; - case k80Music: return withSpeakersName ? kString80MusicS : kString80Music; - case k81Cine: return withSpeakersName ? kString81CineS : kString81Cine; - case k81Music: return withSpeakersName ? kString81MusicS : kString81Music; - case k81MPEG3D: return withSpeakersName ? kString81MPEGS : kString81MPEG; - case k102: return withSpeakersName ? kString102S : kString102; - case k122: return withSpeakersName ? kString122S : kString122; - case k80Cube: return withSpeakersName ? kString80CubeS : kString80Cube; - case kBFormat1stOrder: return withSpeakersName ? kStringBFormat1stOrderS : kStringBFormat1stOrder; - case k71CineTopCenter: return withSpeakersName ? kString71CineTopCenterS : kString71CineTopCenter; - case k71CineCenterHigh: return withSpeakersName ? kString71CineCenterHighS : kString71CineCenterHigh; - case k71CineFrontHigh: return withSpeakersName ? kString71CineFrontHighS : kString71CineFrontHigh; - case k71CineSideHigh: return withSpeakersName ? kString71CineSideHighS : kString71CineSideHigh; - case k71CineFullRear: return withSpeakersName ? kString71CineFullRearS : kString71CineFullRear; - case k90: return withSpeakersName ? kString90S : kString90; - case k91: return withSpeakersName ? kString91S : kString91; - case k91Atmos: return withSpeakersName ? kString91AtmosS : kString91Atmos; - case k100: return withSpeakersName ? kString100S : kString100; - case k101: return withSpeakersName ? kString101S : kString101; - case k110: return withSpeakersName ? kString110S : kString110; - case k111: return withSpeakersName ? kString111S : kString111; - case k130: return withSpeakersName ? kString130S : kString130; - case k131: return withSpeakersName ? kString131S : kString131; - case k222: return withSpeakersName ? kString222S : kString222; - break; - } - return kStringEmpty; -} - -//------------------------------------------------------------------------ -/** Returns a CString representation of a given speaker in a given arrangement -*/ -inline CString getSpeakerShortName (const SpeakerArrangement& arr, int32 index) -{ - SpeakerArrangement arrTmp = arr; - - bool found = false; - int32 index2 = -1; - int32 pos = -1; - while (arrTmp) - { - if (arrTmp & 0x1) - index2++; - pos++; - if (index2 == index) - { - found = true; - break; - } - arrTmp = arrTmp >> 1; - } - - if (!found) - return ""; - - switch ((Speaker)1 << pos) - { - case kSpeakerL: - return "L"; - case kSpeakerR: - return "R"; - case kSpeakerC: - return "C"; - case kSpeakerLfe: - return "LFE"; - case kSpeakerLs: - return "Ls"; - case kSpeakerRs: - return "Rs"; - case kSpeakerLc: - return "Lc"; - case kSpeakerRc: - return "Rc"; - case kSpeakerS: - return "S"; - case kSpeakerSl: - return "Sl"; - case kSpeakerSr: - return "Sr"; - case kSpeakerTm: - return "Tm"; - case kSpeakerTfl: - return "Tfl"; - case kSpeakerTfc: - return "Tfc"; - case kSpeakerTfr: - return "Tfr"; - case kSpeakerTrl: - return "Trl"; - case kSpeakerTrc: - return "Trc"; - case kSpeakerTrr: - return "Trr"; - case kSpeakerLfe2: - return "LFE2"; - case kSpeakerM: - return "M"; - - case kSpeakerW: - return "W"; - case kSpeakerX: - return "X"; - case kSpeakerY: - return "Y"; - case kSpeakerZ: - return "Z"; - - case kSpeakerTsl: - return "Tsl"; - case kSpeakerTsr: - return "Tsr"; - case kSpeakerLcs: - return "Lcs"; - case kSpeakerRcs: - return "Rcs"; - - case kSpeakerBfl: - return "Bfl"; - case kSpeakerBfc: - return "Bfc"; - case kSpeakerBfr: - return "Bfr"; - case kSpeakerPl: - return "Pl"; - case kSpeakerPr: - return "Pr"; - } - return ""; -} - -/*@}*/ - -//------------------------------------------------------------------------ -} // namespace SpeakerArr -} // namespace Vst -} // namespace Steinberg diff --git a/vst/pluginterfaces/vst2.x/aeffect.h b/vst/pluginterfaces/vst2.x/aeffect.h deleted file mode 100644 index 2df21ec5..00000000 --- a/vst/pluginterfaces/vst2.x/aeffect.h +++ /dev/null @@ -1,392 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 2.4 -// -// Category : VST 2.x Interfaces -// Filename : pluginterfaces/vst2.x/aeffect.h -// Created by : Steinberg, 01/2004 -// Description : Definition of AEffect structure (VST 1.0) -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#ifndef __aeffect__ -#define __aeffect__ - -//------------------------------------------------------------------------------------------------------- -// gcc based compiler, or CodeWarrior on Mac OS X -#if ((defined(__GNUC__) && (defined(__APPLE_CPP__) || defined(__APPLE_CC__))) || (defined (__MWERKS__) && defined (__MACH__))) - #ifndef TARGET_API_MAC_CARBON - #define TARGET_API_MAC_CARBON 1 - #endif - #if __ppc__ - #ifndef VST_FORCE_DEPRECATED - #define VST_FORCE_DEPRECATED 0 - #endif - #endif -#endif - -#ifdef _WIN32 - #ifndef WIN32 - #define WIN32 1 - #endif -#endif - -#if TARGET_API_MAC_CARBON - #ifdef __LP64__ - #pragma options align=power - #else - #pragma options align=mac68k - #endif - #define VSTCALLBACK -#elif defined __BORLANDC__ - #pragma -a8 - #pragma options push -a8 -#elif defined(__GNUC__) - #pragma pack(push,8) - #define VSTCALLBACK __cdecl -#elif defined(WIN32) || defined(__FLAT__) || defined CBUILDER - #pragma pack(push) - #pragma pack(8) - #define VSTCALLBACK __cdecl -#else - #define VSTCALLBACK -#endif -//------------------------------------------------------------------------------------------------------- - -#include // for strncpy - -//------------------------------------------------------------------------------------------------------- -// VST Version -//------------------------------------------------------------------------------------------------------- - -/** Define SDK Version (you can generate different versions (from 2.0 to 2.4) of this SDK by setting the unwanted extensions to 0). */ -#define VST_2_1_EXTENSIONS 1 ///< Version 2.1 extensions (08-06-2000) -#define VST_2_2_EXTENSIONS 1 ///< Version 2.2 extensions (08-06-2001) -#define VST_2_3_EXTENSIONS 1 ///< Version 2.3 extensions (20-05-2003) -#ifndef VST_2_4_EXTENSIONS -#define VST_2_4_EXTENSIONS 1 ///< Version 2.4 extensions (01-01-2006) -#endif - -/** Current VST Version */ -#if VST_2_4_EXTENSIONS - #define kVstVersion 2400 -#elif VST_2_3_EXTENSIONS - #define kVstVersion 2300 -#elif VST_2_2_EXTENSIONS - #define kVstVersion 2200 -#elif VST_2_1_EXTENSIONS - #define kVstVersion 2100 -#else - #define kVstVersion 2 -#endif - -/** Disable for Hosts to serve Plug-ins below VST 2.4 */ -#ifndef VST_FORCE_DEPRECATED -#define VST_FORCE_DEPRECATED VST_2_4_EXTENSIONS -#endif - -/** Declares identifier as deprecated. */ -#if VST_FORCE_DEPRECATED -#define DECLARE_VST_DEPRECATED(identifier) __##identifier##Deprecated -#else -#define DECLARE_VST_DEPRECATED(identifier) identifier -#endif - -/** Define for 64 Bit Platform. */ -#ifndef VST_64BIT_PLATFORM -#define VST_64BIT_PLATFORM _WIN64 || __LP64__ -#endif - -//------------------------------------------------------------------------------------------------------- -// Integral Types -//------------------------------------------------------------------------------------------------------- - -typedef char VstInt8; ///< 8 bit integer type - -#ifdef WIN32 - typedef short VstInt16; ///< 16 bit integer type - typedef int VstInt32; ///< 32 bit integer type - typedef __int64 VstInt64; ///< 64 bit integer type -#else - #include - typedef int16_t VstInt16; ///< 16 bit integer type - typedef int32_t VstInt32; ///< 32 bit integer type - typedef int64_t VstInt64; ///< 64 bit integer type -#endif - -//------------------------------------------------------------------------------------------------------- -// Generic Types -//------------------------------------------------------------------------------------------------------- - -#if VST_64BIT_PLATFORM -typedef VstInt64 VstIntPtr; ///< platform-dependent integer type, same size as pointer -#else -typedef VstInt32 VstIntPtr; ///< platform-dependent integer type, same size as pointer -#endif - -//------------------------------------------------------------------------------------------------------- -// Misc. Definition -//------------------------------------------------------------------------------------------------------- -#undef CCONST -typedef struct AEffect AEffect; - -//------------------------------------------------------------------------------------------------------- -/// @cond ignore -typedef VstIntPtr (VSTCALLBACK *audioMasterCallback) (AEffect* effect, VstInt32 opcode, VstInt32 index, VstIntPtr value, void* ptr, float opt); -typedef VstIntPtr (VSTCALLBACK *AEffectDispatcherProc) (AEffect* effect, VstInt32 opcode, VstInt32 index, VstIntPtr value, void* ptr, float opt); -typedef void (VSTCALLBACK *AEffectProcessProc) (AEffect* effect, float** inputs, float** outputs, VstInt32 sampleFrames); -typedef void (VSTCALLBACK *AEffectProcessDoubleProc) (AEffect* effect, double** inputs, double** outputs, VstInt32 sampleFrames); -typedef void (VSTCALLBACK *AEffectSetParameterProc) (AEffect* effect, VstInt32 index, float parameter); -typedef float (VSTCALLBACK *AEffectGetParameterProc) (AEffect* effect, VstInt32 index); -/// @endcond - -/** Four Character Constant (for AEffect->uniqueID) */ -#define CCONST(a, b, c, d) \ - ((((VstInt32)a) << 24) | (((VstInt32)b) << 16) | (((VstInt32)c) << 8) | (((VstInt32)d) << 0)) - -/** AEffect magic number */ -#define kEffectMagic CCONST ('V', 's', 't', 'P') - -//------------------------------------------------------------------------------------------------------- -/** Basic VST Effect "C" Interface. */ -//------------------------------------------------------------------------------------------------------- -struct AEffect -{ -//------------------------------------------------------------------------------------------------------- - VstInt32 magic; ///< must be #kEffectMagic ('VstP') - - /** Host to Plug-in dispatcher @see AudioEffect::dispatcher */ - AEffectDispatcherProc dispatcher; - - /** \deprecated Accumulating process mode is deprecated in VST 2.4! Use AEffect::processReplacing instead! */ - AEffectProcessProc DECLARE_VST_DEPRECATED (process); - - /** Set new value of automatable parameter @see AudioEffect::setParameter */ - AEffectSetParameterProc setParameter; - - /** Returns current value of automatable parameter @see AudioEffect::getParameter*/ - AEffectGetParameterProc getParameter; - - VstInt32 numPrograms; ///< number of programs - VstInt32 numParams; ///< all programs are assumed to have numParams parameters - VstInt32 numInputs; ///< number of audio inputs - VstInt32 numOutputs; ///< number of audio outputs - - VstInt32 flags; ///< @see VstAEffectFlags - - VstIntPtr resvd1; ///< reserved for Host, must be 0 - VstIntPtr resvd2; ///< reserved for Host, must be 0 - - VstInt32 initialDelay; ///< for algorithms which need input in the first place (Group delay or latency in Samples). This value should be initialized in a resume state. - - VstInt32 DECLARE_VST_DEPRECATED (realQualities); ///< \deprecated unused member - VstInt32 DECLARE_VST_DEPRECATED (offQualities); ///< \deprecated unused member - float DECLARE_VST_DEPRECATED (ioRatio); ///< \deprecated unused member - - void* object; ///< #AudioEffect class pointer - void* user; ///< user-defined pointer - - VstInt32 uniqueID; ///< registered unique identifier (register it at Steinberg 3rd party support Web). This is used to identify a plug-in during save+load of preset and project. - VstInt32 version; ///< plug-in version (example 1100 for version 1.1.0.0) - - /** Process audio samples in replacing mode @see AudioEffect::processReplacing */ - AEffectProcessProc processReplacing; - -#if VST_2_4_EXTENSIONS - /** Process double-precision audio samples in replacing mode @see AudioEffect::processDoubleReplacing */ - AEffectProcessDoubleProc processDoubleReplacing; - - char future[56]; ///< reserved for future use (please zero) -#else - char future[60]; ///< reserved for future use (please zero) -#endif // VST_2_4_EXTENSIONS -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -/** AEffect flags */ -//------------------------------------------------------------------------------------------------------- -enum VstAEffectFlags -{ -//------------------------------------------------------------------------------------------------------- - effFlagsHasEditor = 1 << 0, ///< set if the plug-in provides a custom editor - effFlagsCanReplacing = 1 << 4, ///< supports replacing process mode (which should the default mode in VST 2.4) - effFlagsProgramChunks = 1 << 5, ///< program data is handled in formatless chunks - effFlagsIsSynth = 1 << 8, ///< plug-in is a synth (VSTi), Host may assign mixer channels for its outputs - effFlagsNoSoundInStop = 1 << 9, ///< plug-in does not produce sound when input is all silence - -#if VST_2_4_EXTENSIONS - effFlagsCanDoubleReplacing = 1 << 12, ///< plug-in supports double precision processing -#endif - - DECLARE_VST_DEPRECATED (effFlagsHasClip) = 1 << 1, ///< \deprecated deprecated in VST 2.4 - DECLARE_VST_DEPRECATED (effFlagsHasVu) = 1 << 2, ///< \deprecated deprecated in VST 2.4 - DECLARE_VST_DEPRECATED (effFlagsCanMono) = 1 << 3, ///< \deprecated deprecated in VST 2.4 - DECLARE_VST_DEPRECATED (effFlagsExtIsAsync) = 1 << 10, ///< \deprecated deprecated in VST 2.4 - DECLARE_VST_DEPRECATED (effFlagsExtHasBuffer) = 1 << 11 ///< \deprecated deprecated in VST 2.4 -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -/** Basic dispatcher Opcodes (Host to Plug-in) */ -//------------------------------------------------------------------------------------------------------- -enum AEffectOpcodes -{ - effOpen = 0, ///< no arguments @see AudioEffect::open - effClose, ///< no arguments @see AudioEffect::close - - effSetProgram, ///< [value]: new program number @see AudioEffect::setProgram - effGetProgram, ///< [return value]: current program number @see AudioEffect::getProgram - effSetProgramName, ///< [ptr]: char* with new program name, limited to #kVstMaxProgNameLen @see AudioEffect::setProgramName - effGetProgramName, ///< [ptr]: char buffer for current program name, limited to #kVstMaxProgNameLen @see AudioEffect::getProgramName - - effGetParamLabel, ///< [ptr]: char buffer for parameter label, limited to #kVstMaxParamStrLen @see AudioEffect::getParameterLabel - effGetParamDisplay, ///< [ptr]: char buffer for parameter display, limited to #kVstMaxParamStrLen @see AudioEffect::getParameterDisplay - effGetParamName, ///< [ptr]: char buffer for parameter name, limited to #kVstMaxParamStrLen @see AudioEffect::getParameterName - - DECLARE_VST_DEPRECATED (effGetVu), ///< \deprecated deprecated in VST 2.4 - - effSetSampleRate, ///< [opt]: new sample rate for audio processing @see AudioEffect::setSampleRate - effSetBlockSize, ///< [value]: new maximum block size for audio processing @see AudioEffect::setBlockSize - effMainsChanged, ///< [value]: 0 means "turn off", 1 means "turn on" @see AudioEffect::suspend @see AudioEffect::resume - - effEditGetRect, ///< [ptr]: #ERect** receiving pointer to editor size @see ERect @see AEffEditor::getRect - effEditOpen, ///< [ptr]: system dependent Window pointer, e.g. HWND on Windows @see AEffEditor::open - effEditClose, ///< no arguments @see AEffEditor::close - - DECLARE_VST_DEPRECATED (effEditDraw), ///< \deprecated deprecated in VST 2.4 - DECLARE_VST_DEPRECATED (effEditMouse), ///< \deprecated deprecated in VST 2.4 - DECLARE_VST_DEPRECATED (effEditKey), ///< \deprecated deprecated in VST 2.4 - - effEditIdle, ///< no arguments @see AEffEditor::idle - - DECLARE_VST_DEPRECATED (effEditTop), ///< \deprecated deprecated in VST 2.4 - DECLARE_VST_DEPRECATED (effEditSleep), ///< \deprecated deprecated in VST 2.4 - DECLARE_VST_DEPRECATED (effIdentify), ///< \deprecated deprecated in VST 2.4 - - effGetChunk, ///< [ptr]: void** for chunk data address [index]: 0 for bank, 1 for program @see AudioEffect::getChunk - effSetChunk, ///< [ptr]: chunk data [value]: byte size [index]: 0 for bank, 1 for program @see AudioEffect::setChunk - - effNumOpcodes -}; - -//------------------------------------------------------------------------------------------------------- -/** Basic dispatcher Opcodes (Plug-in to Host) */ -//------------------------------------------------------------------------------------------------------- -enum AudioMasterOpcodes -{ -//------------------------------------------------------------------------------------------------------- - audioMasterAutomate = 0, ///< [index]: parameter index [opt]: parameter value @see AudioEffect::setParameterAutomated - audioMasterVersion, ///< [return value]: Host VST version (for example 2400 for VST 2.4) @see AudioEffect::getMasterVersion - audioMasterCurrentId, ///< [return value]: current unique identifier on shell plug-in @see AudioEffect::getCurrentUniqueId - audioMasterIdle, ///< no arguments @see AudioEffect::masterIdle - DECLARE_VST_DEPRECATED (audioMasterPinConnected) ///< \deprecated deprecated in VST 2.4 r2 -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -/** String length limits (in characters excl. 0 byte) */ -//------------------------------------------------------------------------------------------------------- -enum VstStringConstants -{ -//------------------------------------------------------------------------------------------------------- - kVstMaxProgNameLen = 24, ///< used for #effGetProgramName, #effSetProgramName, #effGetProgramNameIndexed - kVstMaxParamStrLen = 8, ///< used for #effGetParamLabel, #effGetParamDisplay, #effGetParamName - kVstMaxVendorStrLen = 64, ///< used for #effGetVendorString, #audioMasterGetVendorString - kVstMaxProductStrLen = 64, ///< used for #effGetProductString, #audioMasterGetProductString - kVstMaxEffectNameLen = 32 ///< used for #effGetEffectName -//------------------------------------------------------------------------------------------------------- -}; - -#ifdef __cplusplus -#define VST_INLINE inline -#else -#define VST_INLINE -#endif - -//------------------------------------------------------------------------------------------------------- -/** String copy taking care of null terminator. */ -//------------------------------------------------------------------------------------------------------- -VST_INLINE char* vst_strncpy (char* dst, const char* src, size_t maxLen) -{ - char* result = strncpy (dst, src, maxLen); - dst[maxLen] = 0; - return result; -} - -//------------------------------------------------------------------------------------------------------- -/** String concatenation taking care of null terminator. */ -//------------------------------------------------------------------------------------------------------- -VST_INLINE char* vst_strncat (char* dst, const char* src, size_t maxLen) -{ - char* result = strncat (dst, src, maxLen); - dst[maxLen] = 0; - return result; -} - -#ifdef __cplusplus -//------------------------------------------------------------------------------------------------------- -/** Cast #VstIntPtr to pointer. */ -//------------------------------------------------------------------------------------------------------- -template inline T* FromVstPtr (VstIntPtr& arg) -{ - T** address = (T**)&arg; - return *address; -} - -//------------------------------------------------------------------------------------------------------- -/** Cast pointer to #VstIntPtr. */ -//------------------------------------------------------------------------------------------------------- -template inline VstIntPtr ToVstPtr (T* ptr) -{ - VstIntPtr* address = (VstIntPtr*)&ptr; - return *address; -} -#endif // __cplusplus - -//------------------------------------------------------------------------------------------------------- -/** Structure used for #effEditGetRect. */ -//------------------------------------------------------------------------------------------------------- -struct ERect -{ -//------------------------------------------------------------------------------------------------------- - VstInt16 top; ///< top coordinate - VstInt16 left; ///< left coordinate - VstInt16 bottom; ///< bottom coordinate - VstInt16 right; ///< right coordinate -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -#if TARGET_API_MAC_CARBON - #pragma options align=reset -#elif defined(WIN32) || defined(__FLAT__) || defined(__GNUC__) - #pragma pack(pop) -#elif defined __BORLANDC__ - #pragma -a- -#endif - -#endif // __aeffect__ diff --git a/vst/pluginterfaces/vst2.x/aeffectx.h b/vst/pluginterfaces/vst2.x/aeffectx.h deleted file mode 100644 index 29e7cd8d..00000000 --- a/vst/pluginterfaces/vst2.x/aeffectx.h +++ /dev/null @@ -1,1170 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 2.4 -// -// Category : VST 2.x Interfaces -// Filename : pluginterfaces/vst2.x/aeffectx.h -// Created by : Steinberg, 01/2004 -// Description : Definition of auxiliary structures, extensions from VST 1.0 to VST 2.4 -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#ifndef __aeffectx__ -#define __aeffectx__ - -// VST 1.0 is included -#ifndef __aeffect__ -#include "aeffect.h" -#endif - -//------------------------------------------------------------------------------------------------------- -// Define some compiler flags -#if TARGET_API_MAC_CARBON - #ifdef __LP64__ - #pragma options align=power - #else - #pragma options align=mac68k - #endif -#elif defined __BORLANDC__ - #pragma -a8 - #pragma options push -a8 -#elif defined(__GNUC__) - #pragma pack(push,8) -#elif defined(WIN32) || defined(__FLAT__) - #pragma pack(push) - #pragma pack(8) -#endif -//------------------------------------------------------------------------------------------------------- - -//------------------------------------------------------------------------------------------------------- -/** String length limits (in characters excl. 0 byte). */ -//------------------------------------------------------------------------------------------------------- -enum Vst2StringConstants -{ -//------------------------------------------------------------------------------------------------------- - kVstMaxNameLen = 64, ///< used for #MidiProgramName, #MidiProgramCategory, #MidiKeyName, #VstSpeakerProperties, #VstPinProperties - kVstMaxLabelLen = 64, ///< used for #VstParameterProperties->label, #VstPinProperties->label - kVstMaxShortLabelLen = 8, ///< used for #VstParameterProperties->shortLabel, #VstPinProperties->shortLabel - kVstMaxCategLabelLen = 24, ///< used for #VstParameterProperties->label - kVstMaxFileNameLen = 100 ///< used for #VstAudioFile->name -//------------------------------------------------------------------------------------------------------- -}; -//------------------------------------------------------------------------------------------------------- -// VstEvent -//------------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------------- -/** A generic timestamped event. */ -//------------------------------------------------------------------------------------------------------- -typedef struct VstEvent -{ -//------------------------------------------------------------------------------------------------------- - VstInt32 type; ///< @see VstEventTypes - VstInt32 byteSize; ///< size of this event, excl. type and byteSize - VstInt32 deltaFrames; ///< sample frames related to the current block start sample position - VstInt32 flags; ///< generic flags, none defined yet - - char data[16]; ///< data size may vary, depending on event type -//------------------------------------------------------------------------------------------------------- -} VstEvent; - -//------------------------------------------------------------------------------------------------------- -/** VstEvent Types used by #VstEvent. */ -//------------------------------------------------------------------------------------------------------- -enum VstEventTypes -{ -//------------------------------------------------------------------------------------------------------- - kVstMidiType = 1, ///< MIDI event @see VstMidiEvent - DECLARE_VST_DEPRECATED (kVstAudioType), ///< \deprecated unused event type - DECLARE_VST_DEPRECATED (kVstVideoType), ///< \deprecated unused event type - DECLARE_VST_DEPRECATED (kVstParameterType), ///< \deprecated unused event type - DECLARE_VST_DEPRECATED (kVstTriggerType), ///< \deprecated unused event type - kVstSysExType ///< MIDI system exclusive @see VstMidiSysexEvent -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -/** A block of events for the current processed audio block. */ -//------------------------------------------------------------------------------------------------------- -struct VstEvents -{ -//------------------------------------------------------------------------------------------------------- - VstInt32 numEvents; ///< number of Events in array - VstIntPtr reserved; ///< zero (Reserved for future use) - VstEvent* events[2]; ///< event pointer array, variable size -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -/** MIDI Event (to be casted from VstEvent). */ -//------------------------------------------------------------------------------------------------------- -struct VstMidiEvent -{ -//------------------------------------------------------------------------------------------------------- - VstInt32 type; ///< #kVstMidiType - VstInt32 byteSize; ///< sizeof (VstMidiEvent) - VstInt32 deltaFrames; ///< sample frames related to the current block start sample position - VstInt32 flags; ///< @see VstMidiEventFlags - VstInt32 noteLength; ///< (in sample frames) of entire note, if available, else 0 - VstInt32 noteOffset; ///< offset (in sample frames) into note from note start if available, else 0 - char midiData[4]; ///< 1 to 3 MIDI bytes; midiData[3] is reserved (zero) - char detune; ///< -64 to +63 cents; for scales other than 'well-tempered' ('microtuning') - char noteOffVelocity; ///< Note Off Velocity [0, 127] - char reserved1; ///< zero (Reserved for future use) - char reserved2; ///< zero (Reserved for future use) -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -/** Flags used in #VstMidiEvent. */ -//------------------------------------------------------------------------------------------------------- -enum VstMidiEventFlags -{ -//------------------------------------------------------------------------------------------------------- - kVstMidiEventIsRealtime = 1 << 0 ///< means that this event is played life (not in playback from a sequencer track).\n This allows the Plug-In to handle these flagged events with higher priority, especially when the Plug-In has a big latency (AEffect::initialDelay) -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -/** MIDI Sysex Event (to be casted from #VstEvent). */ -//------------------------------------------------------------------------------------------------------- -struct VstMidiSysexEvent -{ -//------------------------------------------------------------------------------------------------------- - VstInt32 type; ///< #kVstSysexType - VstInt32 byteSize; ///< sizeof (VstMidiSysexEvent) - VstInt32 deltaFrames; ///< sample frames related to the current block start sample position - VstInt32 flags; ///< none defined yet (should be zero) - VstInt32 dumpBytes; ///< byte size of sysexDump - VstIntPtr resvd1; ///< zero (Reserved for future use) - char* sysexDump; ///< sysex dump - VstIntPtr resvd2; ///< zero (Reserved for future use) -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -// VstTimeInfo -//------------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------------- -/** VstTimeInfo requested via #audioMasterGetTime. @see AudioEffectX::getTimeInfo - -\note VstTimeInfo::samplePos :Current Position. It must always be valid, and should not cost a lot to ask for. The sample position is ahead of the time displayed to the user. In sequencer stop mode, its value does not change. A 32 bit integer is too small for sample positions, and it's a double to make it easier to convert between ppq and samples. -\note VstTimeInfo::ppqPos : At tempo 120, 1 quarter makes 1/2 second, so 2.0 ppq translates to 48000 samples at 48kHz sample rate. -.25 ppq is one sixteenth note then. if you need something like 480ppq, you simply multiply ppq by that scaler. -\note VstTimeInfo::barStartPos : Say we're at bars/beats readout 3.3.3. That's 2 bars + 2 q + 2 sixteenth, makes 2 * 4 + 2 + .25 = 10.25 ppq. at tempo 120, that's 10.25 * .5 = 5.125 seconds, times 48000 = 246000 samples (if my calculator servers me well :-). -\note VstTimeInfo::samplesToNextClock : MIDI Clock Resolution (24 per Quarter Note), can be negative the distance to the next midi clock (24 ppq, pulses per quarter) in samples. unless samplePos falls precicely on a midi clock, this will either be negative such that the previous MIDI clock is addressed, or positive when referencing the following (future) MIDI clock. -*/ -//------------------------------------------------------------------------------------------------------- -struct VstTimeInfo -{ -//------------------------------------------------------------------------------------------------------- - double samplePos; ///< current Position in audio samples (always valid) - double sampleRate; ///< current Sample Rate in Herz (always valid) - double nanoSeconds; ///< System Time in nanoseconds (10^-9 second) - double ppqPos; ///< Musical Position, in Quarter Note (1.0 equals 1 Quarter Note) - double tempo; ///< current Tempo in BPM (Beats Per Minute) - double barStartPos; ///< last Bar Start Position, in Quarter Note - double cycleStartPos; ///< Cycle Start (left locator), in Quarter Note - double cycleEndPos; ///< Cycle End (right locator), in Quarter Note - VstInt32 timeSigNumerator; ///< Time Signature Numerator (e.g. 3 for 3/4) - VstInt32 timeSigDenominator; ///< Time Signature Denominator (e.g. 4 for 3/4) - VstInt32 smpteOffset; ///< SMPTE offset (in SMPTE subframes (bits; 1/80 of a frame)). The current SMPTE position can be calculated using #samplePos, #sampleRate, and #smpteFrameRate. - VstInt32 smpteFrameRate; ///< @see VstSmpteFrameRate - VstInt32 samplesToNextClock; ///< MIDI Clock Resolution (24 Per Quarter Note), can be negative (nearest clock) - VstInt32 flags; ///< @see VstTimeInfoFlags -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -/** Flags used in #VstTimeInfo. */ -//------------------------------------------------------------------------------------------------------- -enum VstTimeInfoFlags -{ -//------------------------------------------------------------------------------------------------------- - kVstTransportChanged = 1, ///< indicates that play, cycle or record state has changed - kVstTransportPlaying = 1 << 1, ///< set if Host sequencer is currently playing - kVstTransportCycleActive = 1 << 2, ///< set if Host sequencer is in cycle mode - kVstTransportRecording = 1 << 3, ///< set if Host sequencer is in record mode - kVstAutomationWriting = 1 << 6, ///< set if automation write mode active (record parameter changes) - kVstAutomationReading = 1 << 7, ///< set if automation read mode active (play parameter changes) - kVstNanosValid = 1 << 8, ///< VstTimeInfo::nanoSeconds valid - kVstPpqPosValid = 1 << 9, ///< VstTimeInfo::ppqPos valid - kVstTempoValid = 1 << 10, ///< VstTimeInfo::tempo valid - kVstBarsValid = 1 << 11, ///< VstTimeInfo::barStartPos valid - kVstCyclePosValid = 1 << 12, ///< VstTimeInfo::cycleStartPos and VstTimeInfo::cycleEndPos valid - kVstTimeSigValid = 1 << 13, ///< VstTimeInfo::timeSigNumerator and VstTimeInfo::timeSigDenominator valid - kVstSmpteValid = 1 << 14, ///< VstTimeInfo::smpteOffset and VstTimeInfo::smpteFrameRate valid - kVstClockValid = 1 << 15 ///< VstTimeInfo::samplesToNextClock valid -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -/** SMPTE Frame Rates. */ -//------------------------------------------------------------------------------------------------------- -enum VstSmpteFrameRate -{ -//------------------------------------------------------------------------------------------------------- - kVstSmpte24fps = 0, ///< 24 fps - kVstSmpte25fps = 1, ///< 25 fps - kVstSmpte2997fps = 2, ///< 29.97 fps - kVstSmpte30fps = 3, ///< 30 fps - kVstSmpte2997dfps = 4, ///< 29.97 drop - kVstSmpte30dfps = 5, ///< 30 drop - - kVstSmpteFilm16mm = 6, ///< Film 16mm - kVstSmpteFilm35mm = 7, ///< Film 35mm - kVstSmpte239fps = 10, ///< HDTV: 23.976 fps - kVstSmpte249fps = 11, ///< HDTV: 24.976 fps - kVstSmpte599fps = 12, ///< HDTV: 59.94 fps - kVstSmpte60fps = 13 ///< HDTV: 60 fps -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -/** Variable IO for Offline Processing. */ -//------------------------------------------------------------------------------------------------------- -struct VstVariableIo -{ -//------------------------------------------------------------------------------------------------------- - float** inputs; ///< input audio buffers - float** outputs; ///< output audio buffers - VstInt32 numSamplesInput; ///< number of incoming samples - VstInt32 numSamplesOutput; ///< number of outgoing samples - VstInt32* numSamplesInputProcessed; ///< number of samples actually processed of input - VstInt32* numSamplesOutputProcessed; ///< number of samples actually processed of output -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -/** Language code returned by audioMasterGetLanguage. */ -//------------------------------------------------------------------------------------------------------- -enum VstHostLanguage -{ -//------------------------------------------------------------------------------------------------------- - kVstLangEnglish = 1, ///< English - kVstLangGerman, ///< German - kVstLangFrench, ///< French - kVstLangItalian, ///< Italian - kVstLangSpanish, ///< Spanish - kVstLangJapanese ///< Japanese -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -/** VST 2.x dispatcher Opcodes (Plug-in to Host). Extension of #AudioMasterOpcodes */ -//------------------------------------------------------------------------------------------------------- -enum AudioMasterOpcodesX -{ -//------------------------------------------------------------------------------------------------------- - DECLARE_VST_DEPRECATED (audioMasterWantMidi) = DECLARE_VST_DEPRECATED (audioMasterPinConnected) + 2, ///< \deprecated deprecated in VST 2.4 - - audioMasterGetTime, ///< [return value]: #VstTimeInfo* or null if not supported [value]: request mask @see VstTimeInfoFlags @see AudioEffectX::getTimeInfo - audioMasterProcessEvents, ///< [ptr]: pointer to #VstEvents @see VstEvents @see AudioEffectX::sendVstEventsToHost - - DECLARE_VST_DEPRECATED (audioMasterSetTime), ///< \deprecated deprecated in VST 2.4 - DECLARE_VST_DEPRECATED (audioMasterTempoAt), ///< \deprecated deprecated in VST 2.4 - DECLARE_VST_DEPRECATED (audioMasterGetNumAutomatableParameters), ///< \deprecated deprecated in VST 2.4 - DECLARE_VST_DEPRECATED (audioMasterGetParameterQuantization), ///< \deprecated deprecated in VST 2.4 - - audioMasterIOChanged, ///< [return value]: 1 if supported @see AudioEffectX::ioChanged - - DECLARE_VST_DEPRECATED (audioMasterNeedIdle), ///< \deprecated deprecated in VST 2.4 - - audioMasterSizeWindow, ///< [index]: new width [value]: new height [return value]: 1 if supported @see AudioEffectX::sizeWindow - audioMasterGetSampleRate, ///< [return value]: current sample rate @see AudioEffectX::updateSampleRate - audioMasterGetBlockSize, ///< [return value]: current block size @see AudioEffectX::updateBlockSize - audioMasterGetInputLatency, ///< [return value]: input latency in audio samples @see AudioEffectX::getInputLatency - audioMasterGetOutputLatency, ///< [return value]: output latency in audio samples @see AudioEffectX::getOutputLatency - - DECLARE_VST_DEPRECATED (audioMasterGetPreviousPlug), ///< \deprecated deprecated in VST 2.4 - DECLARE_VST_DEPRECATED (audioMasterGetNextPlug), ///< \deprecated deprecated in VST 2.4 - DECLARE_VST_DEPRECATED (audioMasterWillReplaceOrAccumulate), ///< \deprecated deprecated in VST 2.4 - - audioMasterGetCurrentProcessLevel, ///< [return value]: current process level @see VstProcessLevels - audioMasterGetAutomationState, ///< [return value]: current automation state @see VstAutomationStates - - audioMasterOfflineStart, ///< [index]: numNewAudioFiles [value]: numAudioFiles [ptr]: #VstAudioFile* @see AudioEffectX::offlineStart - audioMasterOfflineRead, ///< [index]: bool readSource [value]: #VstOfflineOption* @see VstOfflineOption [ptr]: #VstOfflineTask* @see VstOfflineTask @see AudioEffectX::offlineRead - audioMasterOfflineWrite, ///< @see audioMasterOfflineRead @see AudioEffectX::offlineRead - audioMasterOfflineGetCurrentPass, ///< @see AudioEffectX::offlineGetCurrentPass - audioMasterOfflineGetCurrentMetaPass, ///< @see AudioEffectX::offlineGetCurrentMetaPass - - DECLARE_VST_DEPRECATED (audioMasterSetOutputSampleRate), ///< \deprecated deprecated in VST 2.4 - DECLARE_VST_DEPRECATED (audioMasterGetOutputSpeakerArrangement), ///< \deprecated deprecated in VST 2.4 - - audioMasterGetVendorString, ///< [ptr]: char buffer for vendor string, limited to #kVstMaxVendorStrLen @see AudioEffectX::getHostVendorString - audioMasterGetProductString, ///< [ptr]: char buffer for vendor string, limited to #kVstMaxProductStrLen @see AudioEffectX::getHostProductString - audioMasterGetVendorVersion, ///< [return value]: vendor-specific version @see AudioEffectX::getHostVendorVersion - audioMasterVendorSpecific, ///< no definition, vendor specific handling @see AudioEffectX::hostVendorSpecific - - DECLARE_VST_DEPRECATED (audioMasterSetIcon), ///< \deprecated deprecated in VST 2.4 - - audioMasterCanDo, ///< [ptr]: "can do" string [return value]: 1 for supported - audioMasterGetLanguage, ///< [return value]: language code @see VstHostLanguage - - DECLARE_VST_DEPRECATED (audioMasterOpenWindow), ///< \deprecated deprecated in VST 2.4 - DECLARE_VST_DEPRECATED (audioMasterCloseWindow), ///< \deprecated deprecated in VST 2.4 - - audioMasterGetDirectory, ///< [return value]: FSSpec on MAC, else char* @see AudioEffectX::getDirectory - audioMasterUpdateDisplay, ///< no arguments - audioMasterBeginEdit, ///< [index]: parameter index @see AudioEffectX::beginEdit - audioMasterEndEdit, ///< [index]: parameter index @see AudioEffectX::endEdit - audioMasterOpenFileSelector, ///< [ptr]: VstFileSelect* [return value]: 1 if supported @see AudioEffectX::openFileSelector - audioMasterCloseFileSelector, ///< [ptr]: VstFileSelect* @see AudioEffectX::closeFileSelector - - DECLARE_VST_DEPRECATED (audioMasterEditFile), ///< \deprecated deprecated in VST 2.4 - - DECLARE_VST_DEPRECATED (audioMasterGetChunkFile), ///< \deprecated deprecated in VST 2.4 [ptr]: char[2048] or sizeof (FSSpec) [return value]: 1 if supported @see AudioEffectX::getChunkFile - - DECLARE_VST_DEPRECATED (audioMasterGetInputSpeakerArrangement) ///< \deprecated deprecated in VST 2.4 -}; - -//------------------------------------------------------------------------------------------------------- -/** VST 2.x dispatcher Opcodes (Host to Plug-in). Extension of #AEffectOpcodes */ -//------------------------------------------------------------------------------------------------------- -enum AEffectXOpcodes -{ -//------------------------------------------------------------------------------------------------------- - effProcessEvents = effSetChunk + 1 ///< [ptr]: #VstEvents* @see AudioEffectX::processEvents - - , effCanBeAutomated ///< [index]: parameter index [return value]: 1=true, 0=false @see AudioEffectX::canParameterBeAutomated - , effString2Parameter ///< [index]: parameter index [ptr]: parameter string [return value]: true for success @see AudioEffectX::string2parameter - - , DECLARE_VST_DEPRECATED (effGetNumProgramCategories) ///< \deprecated deprecated in VST 2.4 - - , effGetProgramNameIndexed ///< [index]: program index [ptr]: buffer for program name, limited to #kVstMaxProgNameLen [return value]: true for success @see AudioEffectX::getProgramNameIndexed - - , DECLARE_VST_DEPRECATED (effCopyProgram) ///< \deprecated deprecated in VST 2.4 - , DECLARE_VST_DEPRECATED (effConnectInput) ///< \deprecated deprecated in VST 2.4 - , DECLARE_VST_DEPRECATED (effConnectOutput) ///< \deprecated deprecated in VST 2.4 - - , effGetInputProperties ///< [index]: input index [ptr]: #VstPinProperties* [return value]: 1 if supported @see AudioEffectX::getInputProperties - , effGetOutputProperties ///< [index]: output index [ptr]: #VstPinProperties* [return value]: 1 if supported @see AudioEffectX::getOutputProperties - , effGetPlugCategory ///< [return value]: category @see VstPlugCategory @see AudioEffectX::getPlugCategory - - , DECLARE_VST_DEPRECATED (effGetCurrentPosition) ///< \deprecated deprecated in VST 2.4 - , DECLARE_VST_DEPRECATED (effGetDestinationBuffer) ///< \deprecated deprecated in VST 2.4 - - , effOfflineNotify ///< [ptr]: #VstAudioFile array [value]: count [index]: start flag @see AudioEffectX::offlineNotify - , effOfflinePrepare ///< [ptr]: #VstOfflineTask array [value]: count @see AudioEffectX::offlinePrepare - , effOfflineRun ///< [ptr]: #VstOfflineTask array [value]: count @see AudioEffectX::offlineRun - - , effProcessVarIo ///< [ptr]: #VstVariableIo* @see AudioEffectX::processVariableIo - , effSetSpeakerArrangement ///< [value]: input #VstSpeakerArrangement* [ptr]: output #VstSpeakerArrangement* @see AudioEffectX::setSpeakerArrangement - - , DECLARE_VST_DEPRECATED (effSetBlockSizeAndSampleRate) ///< \deprecated deprecated in VST 2.4 - - , effSetBypass ///< [value]: 1 = bypass, 0 = no bypass @see AudioEffectX::setBypass - , effGetEffectName ///< [ptr]: buffer for effect name, limited to #kVstMaxEffectNameLen @see AudioEffectX::getEffectName - - , DECLARE_VST_DEPRECATED (effGetErrorText) ///< \deprecated deprecated in VST 2.4 - - , effGetVendorString ///< [ptr]: buffer for effect vendor string, limited to #kVstMaxVendorStrLen @see AudioEffectX::getVendorString - , effGetProductString ///< [ptr]: buffer for effect vendor string, limited to #kVstMaxProductStrLen @see AudioEffectX::getProductString - , effGetVendorVersion ///< [return value]: vendor-specific version @see AudioEffectX::getVendorVersion - , effVendorSpecific ///< no definition, vendor specific handling @see AudioEffectX::vendorSpecific - , effCanDo ///< [ptr]: "can do" string [return value]: 0: "don't know" -1: "no" 1: "yes" @see AudioEffectX::canDo - , effGetTailSize ///< [return value]: tail size (for example the reverb time of a reverb plug-in); 0 is default (return 1 for 'no tail') - - , DECLARE_VST_DEPRECATED (effIdle) ///< \deprecated deprecated in VST 2.4 - , DECLARE_VST_DEPRECATED (effGetIcon) ///< \deprecated deprecated in VST 2.4 - , DECLARE_VST_DEPRECATED (effSetViewPosition) ///< \deprecated deprecated in VST 2.4 - - , effGetParameterProperties ///< [index]: parameter index [ptr]: #VstParameterProperties* [return value]: 1 if supported @see AudioEffectX::getParameterProperties - - , DECLARE_VST_DEPRECATED (effKeysRequired) ///< \deprecated deprecated in VST 2.4 - - , effGetVstVersion ///< [return value]: VST version @see AudioEffectX::getVstVersion - -#if VST_2_1_EXTENSIONS - , effEditKeyDown ///< [index]: ASCII character [value]: virtual key [opt]: modifiers [return value]: 1 if key used @see AEffEditor::onKeyDown - , effEditKeyUp ///< [index]: ASCII character [value]: virtual key [opt]: modifiers [return value]: 1 if key used @see AEffEditor::onKeyUp - , effSetEditKnobMode ///< [value]: knob mode 0: circular, 1: circular relativ, 2: linear (CKnobMode in VSTGUI) @see AEffEditor::setKnobMode - - , effGetMidiProgramName ///< [index]: MIDI channel [ptr]: #MidiProgramName* [return value]: number of used programs, 0 if unsupported @see AudioEffectX::getMidiProgramName - , effGetCurrentMidiProgram ///< [index]: MIDI channel [ptr]: #MidiProgramName* [return value]: index of current program @see AudioEffectX::getCurrentMidiProgram - , effGetMidiProgramCategory ///< [index]: MIDI channel [ptr]: #MidiProgramCategory* [return value]: number of used categories, 0 if unsupported @see AudioEffectX::getMidiProgramCategory - , effHasMidiProgramsChanged ///< [index]: MIDI channel [return value]: 1 if the #MidiProgramName(s) or #MidiKeyName(s) have changed @see AudioEffectX::hasMidiProgramsChanged - , effGetMidiKeyName ///< [index]: MIDI channel [ptr]: #MidiKeyName* [return value]: true if supported, false otherwise @see AudioEffectX::getMidiKeyName - - , effBeginSetProgram ///< no arguments @see AudioEffectX::beginSetProgram - , effEndSetProgram ///< no arguments @see AudioEffectX::endSetProgram -#endif // VST_2_1_EXTENSIONS - -#if VST_2_3_EXTENSIONS - , effGetSpeakerArrangement ///< [value]: input #VstSpeakerArrangement* [ptr]: output #VstSpeakerArrangement* @see AudioEffectX::getSpeakerArrangement - , effShellGetNextPlugin ///< [ptr]: buffer for plug-in name, limited to #kVstMaxProductStrLen [return value]: next plugin's uniqueID @see AudioEffectX::getNextShellPlugin - - , effStartProcess ///< no arguments @see AudioEffectX::startProcess - , effStopProcess ///< no arguments @see AudioEffectX::stopProcess - , effSetTotalSampleToProcess ///< [value]: number of samples to process, offline only! @see AudioEffectX::setTotalSampleToProcess - , effSetPanLaw ///< [value]: pan law [opt]: gain @see VstPanLawType @see AudioEffectX::setPanLaw - - , effBeginLoadBank ///< [ptr]: #VstPatchChunkInfo* [return value]: -1: bank can't be loaded, 1: bank can be loaded, 0: unsupported @see AudioEffectX::beginLoadBank - , effBeginLoadProgram ///< [ptr]: #VstPatchChunkInfo* [return value]: -1: prog can't be loaded, 1: prog can be loaded, 0: unsupported @see AudioEffectX::beginLoadProgram -#endif // VST_2_3_EXTENSIONS - -#if VST_2_4_EXTENSIONS - , effSetProcessPrecision ///< [value]: @see VstProcessPrecision @see AudioEffectX::setProcessPrecision - , effGetNumMidiInputChannels ///< [return value]: number of used MIDI input channels (1-15) @see AudioEffectX::getNumMidiInputChannels - , effGetNumMidiOutputChannels ///< [return value]: number of used MIDI output channels (1-15) @see AudioEffectX::getNumMidiOutputChannels -#endif // VST_2_4_EXTENSIONS -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -/** Symbolic precision constants used for effSetProcessPrecision. */ -//------------------------------------------------------------------------------------------------------- -enum VstProcessPrecision -{ - kVstProcessPrecision32 = 0, ///< single precision float (32bits) - kVstProcessPrecision64 ///< double precision (64bits) -}; - -//------------------------------------------------------------------------------------------------------- -/** Parameter Properties used in #effGetParameterProperties. */ -//------------------------------------------------------------------------------------------------------- -struct VstParameterProperties -{ -//------------------------------------------------------------------------------------------------------- - float stepFloat; ///< float step - float smallStepFloat; ///< small float step - float largeStepFloat; ///< large float step - char label[kVstMaxLabelLen];///< parameter label - VstInt32 flags; ///< @see VstParameterFlags - VstInt32 minInteger; ///< integer minimum - VstInt32 maxInteger; ///< integer maximum - VstInt32 stepInteger; ///< integer step - VstInt32 largeStepInteger; ///< large integer step - char shortLabel[kVstMaxShortLabelLen]; ///< short label, recommended: 6 + delimiter - - // The following are for remote controller display purposes. - // Note that the kVstParameterSupportsDisplayIndex flag must be set. - // Host can scan all parameters, and find out in what order - // to display them: - - VstInt16 displayIndex; ///< index where this parameter should be displayed (starting with 0) - - // Host can also possibly display the parameter group (category), such as... - // --------------------------- - // Osc 1 - // Wave Detune Octave Mod - // --------------------------- - // ...if the plug-in supports it (flag #kVstParameterSupportsDisplayCategory) - - VstInt16 category; ///< 0: no category, else group index + 1 - VstInt16 numParametersInCategory; ///< number of parameters in category - VstInt16 reserved; ///< zero - char categoryLabel[kVstMaxCategLabelLen]; ///< category label, e.g. "Osc 1" - - char future[16]; ///< reserved for future use -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -/** Flags used in #VstParameterProperties. */ -//------------------------------------------------------------------------------------------------------- -enum VstParameterFlags -{ -//------------------------------------------------------------------------------------------------------- - kVstParameterIsSwitch = 1 << 0, ///< parameter is a switch (on/off) - kVstParameterUsesIntegerMinMax = 1 << 1, ///< minInteger, maxInteger valid - kVstParameterUsesFloatStep = 1 << 2, ///< stepFloat, smallStepFloat, largeStepFloat valid - kVstParameterUsesIntStep = 1 << 3, ///< stepInteger, largeStepInteger valid - kVstParameterSupportsDisplayIndex = 1 << 4, ///< displayIndex valid - kVstParameterSupportsDisplayCategory = 1 << 5, ///< category, etc. valid - kVstParameterCanRamp = 1 << 6 ///< set if parameter value can ramp up/down -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -/** Pin Properties used in #effGetInputProperties and #effGetOutputProperties. */ -//------------------------------------------------------------------------------------------------------- -struct VstPinProperties -{ -//------------------------------------------------------------------------------------------------------- - char label[kVstMaxLabelLen]; ///< pin name - VstInt32 flags; ///< @see VstPinPropertiesFlags - VstInt32 arrangementType; ///< @see VstSpeakerArrangementType - char shortLabel[kVstMaxShortLabelLen]; ///< short name (recommended: 6 + delimiter) - - char future[48]; ///< reserved for future use -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -/** Flags used in #VstPinProperties. */ -//------------------------------------------------------------------------------------------------------- -enum VstPinPropertiesFlags -{ -//------------------------------------------------------------------------------------------------------- - kVstPinIsActive = 1 << 0, ///< pin is active, ignored by Host - kVstPinIsStereo = 1 << 1, ///< pin is first of a stereo pair - kVstPinUseSpeaker = 1 << 2 ///< #VstPinProperties::arrangementType is valid and can be used to get the wanted arrangement -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -/** Plug-in Categories. */ -//------------------------------------------------------------------------------------------------------- -enum VstPlugCategory -{ -//------------------------------------------------------------------------------------------------------- - kPlugCategUnknown = 0, ///< Unknown, category not implemented - kPlugCategEffect, ///< Simple Effect - kPlugCategSynth, ///< VST Instrument (Synths, samplers,...) - kPlugCategAnalysis, ///< Scope, Tuner, ... - kPlugCategMastering, ///< Dynamics, ... - kPlugCategSpacializer, ///< Panners, ... - kPlugCategRoomFx, ///< Delays and Reverbs - kPlugSurroundFx, ///< Dedicated surround processor - kPlugCategRestoration, ///< Denoiser, ... - kPlugCategOfflineProcess, ///< Offline Process - kPlugCategShell, ///< Plug-in is container of other plug-ins @see effShellGetNextPlugin - kPlugCategGenerator, ///< ToneGenerator, ... - - kPlugCategMaxCount ///< Marker to count the categories -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -// MIDI Programs -//------------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------------- -/** MIDI Program Description. */ -//------------------------------------------------------------------------------------------------------- -struct MidiProgramName -{ -//------------------------------------------------------------------------------------------------------- - VstInt32 thisProgramIndex; ///< 0 or greater: fill struct for this program index - char name[kVstMaxNameLen]; ///< program name - char midiProgram; ///< -1:off, 0-127 - char midiBankMsb; ///< -1:off, 0-127 - char midiBankLsb; ///< -1:off, 0-127 - char reserved; ///< zero - VstInt32 parentCategoryIndex; ///< -1:no parent category - VstInt32 flags; ///< omni etc. @see VstMidiProgramNameFlags -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -/** Flags used in MidiProgramName. */ -//------------------------------------------------------------------------------------------------------- -enum VstMidiProgramNameFlags -{ -//------------------------------------------------------------------------------------------------------- - kMidiIsOmni = 1 ///< default is multi. for omni mode, channel 0 is used for inquiries and program changes -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -/** MIDI Program Category. */ -//------------------------------------------------------------------------------------------------------- -struct MidiProgramCategory -{ -//------------------------------------------------------------------------------------------------------- - VstInt32 thisCategoryIndex; ///< 0 or greater: fill struct for this category index. - char name[kVstMaxNameLen]; ///< name - VstInt32 parentCategoryIndex; ///< -1:no parent category - VstInt32 flags; ///< reserved, none defined yet, zero. -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -/** MIDI Key Description. */ -//------------------------------------------------------------------------------------------------------- -struct MidiKeyName -{ -//------------------------------------------------------------------------------------------------------- - VstInt32 thisProgramIndex; ///< 0 or greater: fill struct for this program index. - VstInt32 thisKeyNumber; ///< 0 - 127. fill struct for this key number. - char keyName[kVstMaxNameLen]; ///< key name, empty means regular key names - VstInt32 reserved; ///< zero - VstInt32 flags; ///< reserved, none defined yet, zero. -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -// Surround Setup -//------------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------------- -/** Speaker Properties. - The origin for azimuth is right (as by math conventions dealing with radians). - The elevation origin is also right, visualizing a rotation of a circle across the - -pi/pi axis of the horizontal circle. Thus, an elevation of -pi/2 corresponds - to bottom, and a speaker standing on the left, and 'beaming' upwards would have - an azimuth of -pi, and an elevation of pi/2. - For user interface representation, grads are more likely to be used, and the - origins will obviously 'shift' accordingly. */ -//------------------------------------------------------------------------------------------------------- -typedef struct VstSpeakerProperties -{ -//------------------------------------------------------------------------------------------------------- - float azimuth; ///< unit: rad, range: -PI...PI, exception: 10.f for LFE channel - float elevation; ///< unit: rad, range: -PI/2...PI/2, exception: 10.f for LFE channel - float radius; ///< unit: meter, exception: 0.f for LFE channel - float reserved; ///< zero (reserved for future use) - char name[kVstMaxNameLen]; ///< for new setups, new names should be given (L/R/C... won't do) - VstInt32 type; ///< @see VstSpeakerType - - char future[28]; ///< reserved for future use -//------------------------------------------------------------------------------------------------------- -} VstSpeakerProperties; - -//------------------------------------------------------------------------------------------------------- -/** Speaker Arrangement. */ -//------------------------------------------------------------------------------------------------------- -struct VstSpeakerArrangement -{ -//------------------------------------------------------------------------------------------------------- - VstInt32 type; ///< e.g. #kSpeakerArr51 for 5.1 @see VstSpeakerArrangementType - VstInt32 numChannels; ///< number of channels in this speaker arrangement - VstSpeakerProperties speakers[8]; ///< variable sized speaker array -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -/** Speaker Types. */ -//------------------------------------------------------------------------------------------------------- -enum VstSpeakerType -{ -//------------------------------------------------------------------------------------------------------- - kSpeakerUndefined = 0x7fffffff, ///< Undefined - kSpeakerM = 0, ///< Mono (M) - kSpeakerL, ///< Left (L) - kSpeakerR, ///< Right (R) - kSpeakerC, ///< Center (C) - kSpeakerLfe, ///< Subbass (Lfe) - kSpeakerLs, ///< Left Surround (Ls) - kSpeakerRs, ///< Right Surround (Rs) - kSpeakerLc, ///< Left of Center (Lc) - kSpeakerRc, ///< Right of Center (Rc) - kSpeakerS, ///< Surround (S) - kSpeakerCs = kSpeakerS, ///< Center of Surround (Cs) = Surround (S) - kSpeakerSl, ///< Side Left (Sl) - kSpeakerSr, ///< Side Right (Sr) - kSpeakerTm, ///< Top Middle (Tm) - kSpeakerTfl, ///< Top Front Left (Tfl) - kSpeakerTfc, ///< Top Front Center (Tfc) - kSpeakerTfr, ///< Top Front Right (Tfr) - kSpeakerTrl, ///< Top Rear Left (Trl) - kSpeakerTrc, ///< Top Rear Center (Trc) - kSpeakerTrr, ///< Top Rear Right (Trr) - kSpeakerLfe2 ///< Subbass 2 (Lfe2) -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -/** User-defined speaker types, to be extended in the negative range. - Will be handled as their corresponding speaker types with abs values: - e.g abs(#kSpeakerU1) == #kSpeakerL, abs(#kSpeakerU2) == #kSpeakerR) */ -//------------------------------------------------------------------------------------------------------- -enum VstUserSpeakerType -{ -//------------------------------------------------------------------------------------------------------- - kSpeakerU32 = -32, - kSpeakerU31, - kSpeakerU30, - kSpeakerU29, - kSpeakerU28, - kSpeakerU27, - kSpeakerU26, - kSpeakerU25, - kSpeakerU24, - kSpeakerU23, - kSpeakerU22, - kSpeakerU21, - kSpeakerU20, ///< == #kSpeakerLfe2 - kSpeakerU19, ///< == #kSpeakerTrr - kSpeakerU18, ///< == #kSpeakerTrc - kSpeakerU17, ///< == #kSpeakerTrl - kSpeakerU16, ///< == #kSpeakerTfr - kSpeakerU15, ///< == #kSpeakerTfc - kSpeakerU14, ///< == #kSpeakerTfl - kSpeakerU13, ///< == #kSpeakerTm - kSpeakerU12, ///< == #kSpeakerSr - kSpeakerU11, ///< == #kSpeakerSl - kSpeakerU10, ///< == #kSpeakerCs - kSpeakerU9, ///< == #kSpeakerS - kSpeakerU8, ///< == #kSpeakerRc - kSpeakerU7, ///< == #kSpeakerLc - kSpeakerU6, ///< == #kSpeakerRs - kSpeakerU5, ///< == #kSpeakerLs - kSpeakerU4, ///< == #kSpeakerLfe - kSpeakerU3, ///< == #kSpeakerC - kSpeakerU2, ///< == #kSpeakerR - kSpeakerU1 ///< == #kSpeakerL -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -/** Speaker Arrangement Types*/ -//------------------------------------------------------------------------------------------------------- -enum VstSpeakerArrangementType -{ -//------------------------------------------------------------------------------------------------------- - kSpeakerArrUserDefined = -2,///< user defined - kSpeakerArrEmpty = -1, ///< empty arrangement - kSpeakerArrMono = 0, ///< M - kSpeakerArrStereo, ///< L R - kSpeakerArrStereoSurround, ///< Ls Rs - kSpeakerArrStereoCenter, ///< Lc Rc - kSpeakerArrStereoSide, ///< Sl Sr - kSpeakerArrStereoCLfe, ///< C Lfe - kSpeakerArr30Cine, ///< L R C - kSpeakerArr30Music, ///< L R S - kSpeakerArr31Cine, ///< L R C Lfe - kSpeakerArr31Music, ///< L R Lfe S - kSpeakerArr40Cine, ///< L R C S (LCRS) - kSpeakerArr40Music, ///< L R Ls Rs (Quadro) - kSpeakerArr41Cine, ///< L R C Lfe S (LCRS+Lfe) - kSpeakerArr41Music, ///< L R Lfe Ls Rs (Quadro+Lfe) - kSpeakerArr50, ///< L R C Ls Rs - kSpeakerArr51, ///< L R C Lfe Ls Rs - kSpeakerArr60Cine, ///< L R C Ls Rs Cs - kSpeakerArr60Music, ///< L R Ls Rs Sl Sr - kSpeakerArr61Cine, ///< L R C Lfe Ls Rs Cs - kSpeakerArr61Music, ///< L R Lfe Ls Rs Sl Sr - kSpeakerArr70Cine, ///< L R C Ls Rs Lc Rc - kSpeakerArr70Music, ///< L R C Ls Rs Sl Sr - kSpeakerArr71Cine, ///< L R C Lfe Ls Rs Lc Rc - kSpeakerArr71Music, ///< L R C Lfe Ls Rs Sl Sr - kSpeakerArr80Cine, ///< L R C Ls Rs Lc Rc Cs - kSpeakerArr80Music, ///< L R C Ls Rs Cs Sl Sr - kSpeakerArr81Cine, ///< L R C Lfe Ls Rs Lc Rc Cs - kSpeakerArr81Music, ///< L R C Lfe Ls Rs Cs Sl Sr - kSpeakerArr102, ///< L R C Lfe Ls Rs Tfl Tfc Tfr Trl Trr Lfe2 - kNumSpeakerArr -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -// Offline Processing -//------------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------------- -/** Offline Task Description. */ -//------------------------------------------------------------------------------------------------------- -struct VstOfflineTask -{ -//------------------------------------------------------------------------------------------------------- - char processName[96]; ///< set by plug-in - - // audio access - double readPosition; ///< set by plug-in/Host - double writePosition; ///< set by plug-in/Host - VstInt32 readCount; ///< set by plug-in/Host - VstInt32 writeCount; ///< set by plug-in - VstInt32 sizeInputBuffer; ///< set by Host - VstInt32 sizeOutputBuffer; ///< set by Host - void* inputBuffer; ///< set by Host - void* outputBuffer; ///< set by Host - double positionToProcessFrom; ///< set by Host - double numFramesToProcess; ///< set by Host - double maxFramesToWrite; ///< set by plug-in - - // other data access - void* extraBuffer; ///< set by plug-in - VstInt32 value; ///< set by Host or plug-in - VstInt32 index; ///< set by Host or plug-in - - // file attributes - double numFramesInSourceFile; ///< set by Host - double sourceSampleRate; ///< set by Host or plug-in - double destinationSampleRate; ///< set by Host or plug-in - VstInt32 numSourceChannels; ///< set by Host or plug-in - VstInt32 numDestinationChannels;///< set by Host or plug-in - VstInt32 sourceFormat; ///< set by Host - VstInt32 destinationFormat; ///< set by plug-in - char outputText[512]; ///< set by plug-in or Host - - // progress notification - double progress; ///< set by plug-in - VstInt32 progressMode; ///< Reserved for future use - char progressText[100]; ///< set by plug-in - - VstInt32 flags; ///< set by Host and plug-in; see enum #VstOfflineTaskFlags - VstInt32 returnValue; ///< Reserved for future use - void* hostOwned; ///< set by Host - void* plugOwned; ///< set by plug-in - - char future[1024]; ///< Reserved for future use -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -/** Flags used in #VstOfflineTask. */ -//------------------------------------------------------------------------------------------------------- -enum VstOfflineTaskFlags -{ -//------------------------------------------------------------------------------------------------------- - kVstOfflineUnvalidParameter = 1 << 0, ///< set by Host - kVstOfflineNewFile = 1 << 1, ///< set by Host - - kVstOfflinePlugError = 1 << 10, ///< set by plug-in - kVstOfflineInterleavedAudio = 1 << 11, ///< set by plug-in - kVstOfflineTempOutputFile = 1 << 12, ///< set by plug-in - kVstOfflineFloatOutputFile = 1 << 13, ///< set by plug-in - kVstOfflineRandomWrite = 1 << 14, ///< set by plug-in - kVstOfflineStretch = 1 << 15, ///< set by plug-in - kVstOfflineNoThread = 1 << 16 ///< set by plug-in -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -/** Option passed to #offlineRead/#offlineWrite. */ -//------------------------------------------------------------------------------------------------------- -enum VstOfflineOption -{ -//------------------------------------------------------------------------------------------------------- - kVstOfflineAudio, ///< reading/writing audio samples - kVstOfflinePeaks, ///< reading graphic representation - kVstOfflineParameter, ///< reading/writing parameters - kVstOfflineMarker, ///< reading/writing marker - kVstOfflineCursor, ///< reading/moving edit cursor - kVstOfflineSelection, ///< reading/changing selection - kVstOfflineQueryFiles ///< to request the Host to call asynchronously #offlineNotify -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -/** Structure passed to #offlineNotify and #offlineStart */ -//------------------------------------------------------------------------------------------------------- -struct VstAudioFile -{ -//------------------------------------------------------------------------------------------------------- - VstInt32 flags; ///< see enum #VstAudioFileFlags - void* hostOwned; ///< any data private to Host - void* plugOwned; ///< any data private to plug-in - char name[kVstMaxFileNameLen]; ///< file title - VstInt32 uniqueId; ///< uniquely identify a file during a session - double sampleRate; ///< file sample rate - VstInt32 numChannels; ///< number of channels (1 for mono, 2 for stereo...) - double numFrames; ///< number of frames in the audio file - VstInt32 format; ///< Reserved for future use - double editCursorPosition; ///< -1 if no such cursor - double selectionStart; ///< frame index of first selected frame, or -1 - double selectionSize; ///< number of frames in selection, or 0 - VstInt32 selectedChannelsMask; ///< 1 bit per channel - VstInt32 numMarkers; ///< number of markers in the file - VstInt32 timeRulerUnit; ///< see doc for possible values - double timeRulerOffset; ///< offset in time ruler (positive or negative) - double tempo; ///< as BPM (Beats Per Minute) - VstInt32 timeSigNumerator; ///< time signature numerator - VstInt32 timeSigDenominator; ///< time signature denominator - VstInt32 ticksPerBlackNote; ///< resolution - VstInt32 smpteFrameRate; ///< SMPTE rate (set as in #VstTimeInfo) - - char future[64]; ///< Reserved for future use -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -/** Flags used in #VstAudioFile. */ -//------------------------------------------------------------------------------------------------------- -enum VstAudioFileFlags -{ -//------------------------------------------------------------------------------------------------------- - kVstOfflineReadOnly = 1 << 0, ///< set by Host (in call #offlineNotify) - kVstOfflineNoRateConversion = 1 << 1, ///< set by Host (in call #offlineNotify) - kVstOfflineNoChannelChange = 1 << 2, ///< set by Host (in call #offlineNotify) - - kVstOfflineCanProcessSelection = 1 << 10, ///< set by plug-in (in call #offlineStart) - kVstOfflineNoCrossfade = 1 << 11, ///< set by plug-in (in call #offlineStart) - kVstOfflineWantRead = 1 << 12, ///< set by plug-in (in call #offlineStart) - kVstOfflineWantWrite = 1 << 13, ///< set by plug-in (in call #offlineStart) - kVstOfflineWantWriteMarker = 1 << 14, ///< set by plug-in (in call #offlineStart) - kVstOfflineWantMoveCursor = 1 << 15, ///< set by plug-in (in call #offlineStart) - kVstOfflineWantSelect = 1 << 16 ///< set by plug-in (in call #offlineStart) -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -/** Audio file marker. */ -//------------------------------------------------------------------------------------------------------- -struct VstAudioFileMarker -{ -//------------------------------------------------------------------------------------------------------- - double position; ///< marker position - char name[32]; ///< marker name - VstInt32 type; ///< marker type - VstInt32 id; ///< marker identifier - VstInt32 reserved; ///< reserved for future use -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -// Others -//------------------------------------------------------------------------------------------------------- - -//------------------------------------------------------------------------------------------------------- -/** \deprecated Structure used for #openWindow and #closeWindow (deprecated in VST 2.4). */ -//------------------------------------------------------------------------------------------------------- -struct DECLARE_VST_DEPRECATED (VstWindow) -{ -//------------------------------------------------------------------------------------------------------- - char title[128]; - VstInt16 xPos; - VstInt16 yPos; - VstInt16 width; - VstInt16 height; - VstInt32 style; - void* parent; - void* userHandle; - void* winHandle; - - char future[104]; -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -/** Structure used for keyUp/keyDown. */ -//------------------------------------------------------------------------------------------------------- -struct VstKeyCode -{ -//------------------------------------------------------------------------------------------------------- - VstInt32 character; ///< ASCII character - unsigned char virt; ///< @see VstVirtualKey - unsigned char modifier; ///< @see VstModifierKey -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -/** Platform-independent definition of Virtual Keys (used in #VstKeyCode). */ -//------------------------------------------------------------------------------------------------------- -enum VstVirtualKey -{ -//------------------------------------------------------------------------------------------------------- - VKEY_BACK = 1, - VKEY_TAB, - VKEY_CLEAR, - VKEY_RETURN, - VKEY_PAUSE, - VKEY_ESCAPE, - VKEY_SPACE, - VKEY_NEXT, - VKEY_END, - VKEY_HOME, - VKEY_LEFT, - VKEY_UP, - VKEY_RIGHT, - VKEY_DOWN, - VKEY_PAGEUP, - VKEY_PAGEDOWN, - VKEY_SELECT, - VKEY_PRINT, - VKEY_ENTER, - VKEY_SNAPSHOT, - VKEY_INSERT, - VKEY_DELETE, - VKEY_HELP, - VKEY_NUMPAD0, - VKEY_NUMPAD1, - VKEY_NUMPAD2, - VKEY_NUMPAD3, - VKEY_NUMPAD4, - VKEY_NUMPAD5, - VKEY_NUMPAD6, - VKEY_NUMPAD7, - VKEY_NUMPAD8, - VKEY_NUMPAD9, - VKEY_MULTIPLY, - VKEY_ADD, - VKEY_SEPARATOR, - VKEY_SUBTRACT, - VKEY_DECIMAL, - VKEY_DIVIDE, - VKEY_F1, - VKEY_F2, - VKEY_F3, - VKEY_F4, - VKEY_F5, - VKEY_F6, - VKEY_F7, - VKEY_F8, - VKEY_F9, - VKEY_F10, - VKEY_F11, - VKEY_F12, - VKEY_NUMLOCK, - VKEY_SCROLL, - VKEY_SHIFT, - VKEY_CONTROL, - VKEY_ALT, - VKEY_EQUALS -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -/** Modifier flags used in #VstKeyCode. */ -//------------------------------------------------------------------------------------------------------- -enum VstModifierKey -{ -//------------------------------------------------------------------------------------------------------- - MODIFIER_SHIFT = 1<<0, ///< Shift - MODIFIER_ALTERNATE = 1<<1, ///< Alt - MODIFIER_COMMAND = 1<<2, ///< Control on Mac - MODIFIER_CONTROL = 1<<3 ///< Ctrl on PC, Apple on Mac -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -/** File filter used in #VstFileSelect. */ -//------------------------------------------------------------------------------------------------------- -typedef struct VstFileType -{ -//------------------------------------------------------------------------------------------------------- - char name[128]; ///< display name - char macType[8]; ///< MacOS type - char dosType[8]; ///< Windows file extension - char unixType[8]; ///< Unix file extension - char mimeType1[128]; ///< MIME type - char mimeType2[128]; ///< additional MIME type - -#ifdef __cplusplus - VstFileType (const char* _name = 0, const char* _macType = 0, const char* _dosType = 0, - const char* _unixType = 0, const char* _mimeType1 = 0, const char* _mimeType2 = 0) - { - vst_strncpy (name, _name ? _name : "", 127); - vst_strncpy (macType, _macType ? _macType : "", 7); - vst_strncpy (dosType, _dosType ? _dosType : "", 7); - vst_strncpy (unixType, _unixType ? _unixType : "", 7); - vst_strncpy (mimeType1, _mimeType1 ? _mimeType1 : "", 127); - vst_strncpy (mimeType2, _mimeType2 ? _mimeType2 : "", 127); - } -#endif // __cplusplus -//------------------------------------------------------------------------------------------------------- -} VstFileType; - -//------------------------------------------------------------------------------------------------------- -/** File Selector Description used in #audioMasterOpenFileSelector. */ -//------------------------------------------------------------------------------------------------------- -struct VstFileSelect -{ -//------------------------------------------------------------------------------------------------------- - VstInt32 command; ///< @see VstFileSelectCommand - VstInt32 type; ///< @see VstFileSelectType - VstInt32 macCreator; ///< optional: 0 = no creator - VstInt32 nbFileTypes; ///< number of fileTypes - VstFileType* fileTypes; ///< list of fileTypes @see VstFileType - char title[1024]; ///< text to display in file selector's title - char* initialPath; ///< initial path - char* returnPath; ///< use with #kVstFileLoad and #kVstDirectorySelect. null: Host allocates memory, plug-in must call #closeOpenFileSelector! - VstInt32 sizeReturnPath; ///< size of allocated memory for return paths - char** returnMultiplePaths; ///< use with kVstMultipleFilesLoad. Host allocates memory, plug-in must call #closeOpenFileSelector! - VstInt32 nbReturnPath; ///< number of selected paths - VstIntPtr reserved; ///< reserved for Host application - - char future[116]; ///< reserved for future use -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -/** Command constants used in #VstFileSelect structure. */ -//------------------------------------------------------------------------------------------------------- -enum VstFileSelectCommand -{ -//------------------------------------------------------------------------------------------------------- - kVstFileLoad = 0, ///< for loading a file - kVstFileSave, ///< for saving a file - kVstMultipleFilesLoad, ///< for loading multiple files - kVstDirectorySelect ///< for selecting a directory/folder -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -/** Types used in #VstFileSelect structure. */ -//------------------------------------------------------------------------------------------------------- -enum VstFileSelectType -{ -//------------------------------------------------------------------------------------------------------- - kVstFileType = 0 ///< regular file selector -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -/** Structure used for #effBeginLoadBank/#effBeginLoadProgram. */ -//------------------------------------------------------------------------------------------------------- -struct VstPatchChunkInfo -{ -//------------------------------------------------------------------------------------------------------- - VstInt32 version; ///< Format Version (should be 1) - VstInt32 pluginUniqueID; ///< UniqueID of the plug-in - VstInt32 pluginVersion; ///< Plug-in Version - VstInt32 numElements; ///< Number of Programs (Bank) or Parameters (Program) - - char future[48]; ///< Reserved for future use -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -/** PanLaw Type. */ -//------------------------------------------------------------------------------------------------------- -enum VstPanLawType -{ -//------------------------------------------------------------------------------------------------------- - kLinearPanLaw = 0, ///< L = pan * M; R = (1 - pan) * M; - kEqualPowerPanLaw ///< L = pow (pan, 0.5) * M; R = pow ((1 - pan), 0.5) * M; -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -/** Process Levels returned by #audioMasterGetCurrentProcessLevel. */ -//------------------------------------------------------------------------------------------------------- -enum VstProcessLevels -{ -//------------------------------------------------------------------------------------------------------- - kVstProcessLevelUnknown = 0, ///< not supported by Host - kVstProcessLevelUser, ///< 1: currently in user thread (GUI) - kVstProcessLevelRealtime, ///< 2: currently in audio thread (where process is called) - kVstProcessLevelPrefetch, ///< 3: currently in 'sequencer' thread (MIDI, timer etc) - kVstProcessLevelOffline ///< 4: currently offline processing and thus in user thread -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -/** Automation States returned by #audioMasterGetAutomationState. */ -//------------------------------------------------------------------------------------------------------- -enum VstAutomationStates -{ -//------------------------------------------------------------------------------------------------------- - kVstAutomationUnsupported = 0, ///< not supported by Host - kVstAutomationOff, ///< off - kVstAutomationRead, ///< read - kVstAutomationWrite, ///< write - kVstAutomationReadWrite ///< read and write -//------------------------------------------------------------------------------------------------------- -}; - -//------------------------------------------------------------------------------------------------------- -#if TARGET_API_MAC_CARBON - #pragma options align=reset -#elif defined(WIN32) || defined(__FLAT__) || defined(__GNUC__) - #pragma pack(pop) -#elif defined __BORLANDC__ - #pragma -a- -#endif -//------------------------------------------------------------------------------------------------------- - -#endif //__aeffectx__ diff --git a/vst/pluginterfaces/vst2.x/vstfxstore.h b/vst/pluginterfaces/vst2.x/vstfxstore.h deleted file mode 100644 index 9b4c6284..00000000 --- a/vst/pluginterfaces/vst2.x/vstfxstore.h +++ /dev/null @@ -1,128 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 2.4 -// -// Category : VST 2.x Interfaces -// Filename : pluginterfaces/vst2.x/vstfxstore.h -// Created by : Steinberg, 01/2004 -// Description : Definition of Program (fxp) and Bank (fxb) structures -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#ifndef __vstfxstore__ -#define __vstfxstore__ - -#ifndef __aeffect__ -#include "aeffect.h" -#endif - -//------------------------------------------------------------------------------------------------------- -/** Root chunk identifier for Programs (fxp) and Banks (fxb). */ -#define cMagic 'CcnK' - -/** Regular Program (fxp) identifier. */ -#define fMagic 'FxCk' - -/** Regular Bank (fxb) identifier. */ -#define bankMagic 'FxBk' - -/** Program (fxp) identifier for opaque chunk data. */ -#define chunkPresetMagic 'FPCh' - -/** Bank (fxb) identifier for opaque chunk data. */ -#define chunkBankMagic 'FBCh' - -/* - Note: The C data structures below are for illustration only. You can not read/write them directly. - The byte order on disk of fxp and fxb files is Big Endian. You have to swap integer - and floating-point values on Little Endian platforms (Windows, MacIntel)! -*/ - -//------------------------------------------------------------------------------------------------------- -/** Program (fxp) structure. */ -//------------------------------------------------------------------------------------------------------- -typedef struct fxProgram -{ -//------------------------------------------------------------------------------------------------------- - VstInt32 chunkMagic; ///< 'CcnK' - VstInt32 byteSize; ///< size of this chunk, excl. magic + byteSize - - VstInt32 fxMagic; ///< 'FxCk' (regular) or 'FPCh' (opaque chunk) - VstInt32 version; ///< format version (currently 1) - VstInt32 fxID; ///< fx unique ID - VstInt32 fxVersion; ///< fx version - - VstInt32 numParams; ///< number of parameters - char prgName[28]; ///< program name (null-terminated ASCII string) - - union - { - float params[1]; ///< variable sized array with parameter values - struct - { - VstInt32 size; ///< size of program data - char chunk[1]; ///< variable sized array with opaque program data - } data; ///< program chunk data - } content; ///< program content depending on fxMagic -//------------------------------------------------------------------------------------------------------- -} fxProgram; - -//------------------------------------------------------------------------------------------------------- -/** Bank (fxb) structure. */ -//------------------------------------------------------------------------------------------------------- -struct fxBank -{ -//------------------------------------------------------------------------------------------------------- - VstInt32 chunkMagic; ///< 'CcnK' - VstInt32 byteSize; ///< size of this chunk, excl. magic + byteSize - - VstInt32 fxMagic; ///< 'FxBk' (regular) or 'FBCh' (opaque chunk) - VstInt32 version; ///< format version (1 or 2) - VstInt32 fxID; ///< fx unique ID - VstInt32 fxVersion; ///< fx version - - VstInt32 numPrograms; ///< number of programs - -#if VST_2_4_EXTENSIONS - VstInt32 currentProgram; ///< version 2: current program number - char future[124]; ///< reserved, should be zero -#else - char future[128]; ///< reserved, should be zero -#endif - - union - { - fxProgram programs[1]; ///< variable number of programs - struct - { - VstInt32 size; ///< size of bank data - char chunk[1]; ///< variable sized array with opaque bank data - } data; ///< bank chunk data - } content; ///< bank content depending on fxMagic -//------------------------------------------------------------------------------------------------------- -}; - -#endif // __vstfxstore__ diff --git a/vst/public.sdk/source/common/memorystream.cpp b/vst/public.sdk/source/common/memorystream.cpp deleted file mode 100644 index dcbbd5c7..00000000 --- a/vst/public.sdk/source/common/memorystream.cpp +++ /dev/null @@ -1,316 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : SDK Core -// -// Category : Common Classes -// Filename : memorystream.cpp -// Created by : Steinberg, 03/2008 -// Description : IBStream Implementation for memory blocks -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#include "memorystream.h" -#include "pluginterfaces/base/futils.h" -#include - -namespace Steinberg { - -//----------------------------------------------------------------------------- -IMPLEMENT_FUNKNOWN_METHODS (MemoryStream, IBStream, IBStream::iid) -static const TSize kMemGrowAmount = 4096; - -//----------------------------------------------------------------------------- -MemoryStream::MemoryStream (void* data, TSize length) -: memory ((char*)data) -, memorySize (length) -, size (length) -, ownMemory (false) -, allocationError (false) -, cursor (0) -{ - FUNKNOWN_CTOR -} - -//----------------------------------------------------------------------------- -MemoryStream::MemoryStream () -: memory (0) -, memorySize (0) -, size (0) -, ownMemory (true) -, allocationError (false) -, cursor (0) -{ - FUNKNOWN_CTOR -} - -//----------------------------------------------------------------------------- -MemoryStream::~MemoryStream () -{ - if (ownMemory && memory) - ::free (memory); - - FUNKNOWN_DTOR -} - -//----------------------------------------------------------------------------- -tresult PLUGIN_API MemoryStream::read (void* data, int32 numBytes, int32* numBytesRead) -{ - if (memory == 0) - { - if (allocationError) - return kOutOfMemory; - numBytes = 0; - } - else - { - // Does read exceed size ? - if (cursor + numBytes > size) - { - int32 maxBytes = int32 (size - cursor); - - // Has length become zero or negative ? - if (maxBytes <= 0) - { - cursor = size; - numBytes = 0; - } - else - numBytes = maxBytes; - } - - if (numBytes) - { - memcpy (data, &memory[cursor], numBytes); - cursor += numBytes; - } - } - - if (numBytesRead) - *numBytesRead = numBytes; - - return kResultTrue; -} - -//----------------------------------------------------------------------------- -tresult PLUGIN_API MemoryStream::write (void* buffer, int32 numBytes, int32* numBytesWritten) -{ - if (allocationError) - return kOutOfMemory; - if (buffer == 0) - return kInvalidArgument; - - // Does write exceed size ? - TSize requiredSize = cursor + numBytes; - if (requiredSize > size) - { - if (requiredSize > memorySize) - setSize (requiredSize); - else - size = requiredSize; - } - - // Copy data - if (memory && cursor >= 0 && numBytes > 0) - { - memcpy (&memory[cursor], buffer, numBytes); - // Update cursor - cursor += numBytes; - } - else - numBytes = 0; - - if (numBytesWritten) - *numBytesWritten = numBytes; - - return kResultTrue; -} - -//----------------------------------------------------------------------------- -tresult PLUGIN_API MemoryStream::seek (int64 pos, int32 mode, int64* result) -{ - switch (mode) - { - case kIBSeekSet: - cursor = pos; - break; - case kIBSeekCur: - cursor = cursor + pos; - break; - case kIBSeekEnd: - cursor = size + pos; - break; - } - - if (ownMemory == false) - if (cursor > memorySize) - cursor = memorySize; - - if (result) - *result = cursor; - - return kResultTrue; -} - -//----------------------------------------------------------------------------- -tresult PLUGIN_API MemoryStream::tell (int64* pos) -{ - if (!pos) - return kInvalidArgument; - - *pos = cursor; - return kResultTrue; -} - -//------------------------------------------------------------------------ -TSize MemoryStream::getSize () -{ - return size; -} - -//------------------------------------------------------------------------ -void MemoryStream::setSize (TSize s) -{ - if (s <= 0) - { - if (ownMemory && memory) - free (memory); - - memory = 0; - memorySize = 0; - size = 0; - cursor = 0; - return; - } - - TSize newMemorySize = (((Max (memorySize, s) - 1) / kMemGrowAmount) + 1) * kMemGrowAmount; - if (newMemorySize == memorySize) - { - size = s; - return; - } - - if (memory && ownMemory == false) - { - allocationError = true; - return; - } - - ownMemory = true; - char* newMemory = 0; - - if (memory) - { - newMemory = (char*)realloc (memory, (size_t)newMemorySize); - if (newMemory == 0 && newMemorySize > 0) - { - newMemory = (char*)malloc ((size_t)newMemorySize); - if (newMemory) - { - memcpy (newMemory, memory, (size_t)Min (newMemorySize, memorySize)); - free (memory); - } - } - } - else - newMemory = (char*)malloc ((size_t)newMemorySize); - - if (newMemory == 0) - { - if (newMemorySize > 0) - allocationError = true; - - memory = 0; - memorySize = 0; - size = 0; - cursor = 0; - } - else - { - memory = newMemory; - memorySize = newMemorySize; - size = s; - } -} - -//------------------------------------------------------------------------ -char* MemoryStream::getData () -{ - return memory; -} - -//------------------------------------------------------------------------ -char* MemoryStream::detachData () -{ - if (ownMemory) - { - char* result = memory; - memory = 0; - memorySize = 0; - size = 0; - cursor = 0; - return result; - } - return 0; -} - -//------------------------------------------------------------------------ -bool MemoryStream::truncate () -{ - if (ownMemory == false) - return false; - - if (memorySize == size) - return true; - - memorySize = size; - - if (memorySize == 0) - { - if (memory) - { - free (memory); - memory = 0; - } - } - else - { - if (memory) - { - char* newMemory = (char*)realloc (memory, (size_t)memorySize); - if (newMemory) - memory = newMemory; - } - } - return true; -} - -//------------------------------------------------------------------------ -bool MemoryStream::truncateToCursor () -{ - size = cursor; - return truncate (); -} - -} // namespace diff --git a/vst/public.sdk/source/common/memorystream.h b/vst/public.sdk/source/common/memorystream.h deleted file mode 100644 index 71e236a6..00000000 --- a/vst/public.sdk/source/common/memorystream.h +++ /dev/null @@ -1,77 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : SDK Core -// -// Category : Common Classes -// Filename : memorystream.h -// Created by : Steinberg, 03/2008 -// Description : IBStream Implementation for memory blocks -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#pragma once - -#include "pluginterfaces/base/ibstream.h" - -namespace Steinberg { - -//------------------------------------------------------------------------ -/** Memory based Stream for IBStream implementation (using malloc). -\ingroup sdkBase -*/ -//------------------------------------------------------------------------ -class MemoryStream : public IBStream -{ -public: - //------------------------------------------------------------------------ - MemoryStream (); - MemoryStream (void* memory, TSize memorySize); ///< reuse a given memory without getting ownership - virtual ~MemoryStream (); - - //---IBStream--------------------------------------- - virtual tresult PLUGIN_API read (void* buffer, int32 numBytes, int32* numBytesRead); - virtual tresult PLUGIN_API write (void* buffer, int32 numBytes, int32* numBytesWritten); - virtual tresult PLUGIN_API seek (int64 pos, int32 mode, int64* result); - virtual tresult PLUGIN_API tell (int64* pos); - - TSize getSize (); ///< 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* 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 - - //------------------------------------------------------------------------ - DECLARE_FUNKNOWN_METHODS -protected: - char* memory; // memory block - TSize memorySize; // size of the memory block - TSize size; // size of the stream - int64 cursor; // stream pointer - bool ownMemory; // stream has allocated memory itself - bool allocationError; // stream invalid -}; - -} // namespace diff --git a/vst/public.sdk/source/common/pluginview.cpp b/vst/public.sdk/source/common/pluginview.cpp deleted file mode 100644 index 350c5ed6..00000000 --- a/vst/public.sdk/source/common/pluginview.cpp +++ /dev/null @@ -1,114 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : SDK Core -// -// Category : Common Base Classes -// Filename : public.sdk/source/common/pluginview.cpp -// Created by : Steinberg, 01/2004 -// Description : Plug-In View Implementation -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#include "pluginview.h" - -namespace Steinberg { - -//------------------------------------------------------------------------ -// CPluginView implementation -//------------------------------------------------------------------------ -CPluginView::CPluginView (const ViewRect* _rect) -: rect (0, 0, 0, 0) -, systemWindow (0) -, plugFrame (0) -{ - //TODO FUNKNOWN_CTOR - if (_rect) - rect = *_rect; -} - -//------------------------------------------------------------------------ -CPluginView::~CPluginView () -{ - //TODO FUNKNOWN_DTOR -} - -//------------------------------------------------------------------------ -// TODO IMPLEMENT_REFCOUNT (CPluginView) - -//------------------------------------------------------------------------ -/* TODO -tresult PLUGIN_API CPluginView::queryInterface (const char* iid, void** obj) -{ - QUERY_INTERFACE (iid, obj, Steinberg::FUnknown::iid, IPlugView) - QUERY_INTERFACE (iid, obj, Steinberg::IPlugView::iid, IPlugView) - *obj = 0; - return kNoInterface; -}*/ - - -//------------------------------------------------------------------------ -tresult PLUGIN_API CPluginView::isPlatformTypeSupported (FIDString /*type*/) -{ - return kNotImplemented; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API CPluginView::attached (void* parent, FIDString /*type*/) -{ - systemWindow = parent; - - attachedToParent (); - return kResultOk; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API CPluginView::removed () -{ - systemWindow = 0; - - removedFromParent (); - return kResultOk; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API CPluginView::onSize (ViewRect* newSize) -{ - if (newSize) - rect = *newSize; - return kResultTrue; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API CPluginView::getSize (ViewRect* size) -{ - if (size) - { - *size = rect; - return kResultTrue; - } - return kInvalidArgument; -} - -} // end of namespace diff --git a/vst/public.sdk/source/common/pluginview.h b/vst/public.sdk/source/common/pluginview.h deleted file mode 100644 index 88d8ecf2..00000000 --- a/vst/public.sdk/source/common/pluginview.h +++ /dev/null @@ -1,99 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : SDK Core -// -// Category : Common Base Classes -// Filename : public.sdk/source/common/pluginview.h -// Created by : Steinberg, 01/2004 -// Description : Plug-In View Implementation -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#pragma once - -#include "pluginterfaces/gui/iplugview.h" -#include "base/source/fobject.h" - -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 -{ -public: -//------------------------------------------------------------------------ - CPluginView (const ViewRect* rect = 0); - virtual ~CPluginView (); - - /** Returns its current frame rectangle. */ - const ViewRect& getRect () const { return rect; } - - /** Sets a new frame rectangle. */ - void setRect (const ViewRect& r) { rect = r; } - - /** Checks if this view is attached to its parent view. */ - bool isAttached () const { return systemWindow != 0; } - - /** Calls when this view will be attached to its parent view. */ - virtual void attachedToParent () {} - - /** Calls when this view will be removed from its parent view. */ - virtual void removedFromParent () {} - - //---from IPlugView------- - tresult PLUGIN_API isPlatformTypeSupported (FIDString type); - tresult PLUGIN_API attached (void* parent, FIDString type); - tresult PLUGIN_API removed (); - - tresult PLUGIN_API onWheel (float /*distance*/) { return kResultFalse; } - tresult PLUGIN_API onKeyDown (char16 /*key*/, int16 /*keyMsg*/, int16 /*modifiers*/) { return kResultFalse; } - tresult PLUGIN_API onKeyUp (char16 /*key*/, int16 /*keyMsg*/, int16 /*modifiers*/) { return kResultFalse; } - tresult PLUGIN_API getSize (ViewRect* size); - tresult PLUGIN_API onSize (ViewRect* newSize); - - tresult PLUGIN_API onFocus (TBool /*state*/) { return kResultFalse; } - tresult PLUGIN_API setFrame (IPlugFrame* frame) { plugFrame = frame; return kResultTrue; } - - tresult PLUGIN_API canResize () { return kResultFalse; } - tresult PLUGIN_API checkSizeConstraint (ViewRect* /*rect*/) { return kResultFalse; } - - //---Interface------ - OBJ_METHODS (CPluginView, FObject) - DEFINE_INTERFACES - DEF_INTERFACE (IPlugView) - END_DEFINE_INTERFACES (FObject) - REFCOUNT_METHODS(FObject) -//------------------------------------------------------------------------ -protected: - ViewRect rect; - void* systemWindow; - IPlugFrame* plugFrame; -}; - -} // namespace diff --git a/vst/public.sdk/source/main/dllmain.cpp b/vst/public.sdk/source/main/dllmain.cpp deleted file mode 100644 index 1b86be4f..00000000 --- a/vst/public.sdk/source/main/dllmain.cpp +++ /dev/null @@ -1,101 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : SDK Core -// Version : 1.0 -// -// Category : Common Base Classes -// Filename : public.sdk/source/main/dllmain.cpp -// Created by : Steinberg, 01/2004 -// Description : Windows DLL Entry -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- -#include "pluginterfaces/base/ftypes.h" - -#include - -#if defined (_MSC_VER) && defined (DEVELOPMENT) - #include -#endif - -#ifdef UNICODE -#define tstrrchr wcsrchr -#else -#define tstrrchr strrchr -#endif - -//------------------------------------------------------------------------ -HINSTANCE ghInst = 0; -void* moduleHandle = 0; -Steinberg::tchar gPath[MAX_PATH] = {0}; - -//------------------------------------------------------------------------ -#define DllExport __declspec( dllexport ) - -//------------------------------------------------------------------------ -extern bool InitModule (); ///< must be provided by Plug-in: called when the library is loaded -extern bool DeinitModule (); ///< must be provided by Plug-in: called when the library is unloaded - -//------------------------------------------------------------------------ -#ifdef __cplusplus -extern "C" { -#endif - bool DllExport InitDll () ///< must be called from host right after loading dll - { - return InitModule (); - } - bool DllExport ExitDll () ///< must be called from host right before unloading dll - { - return DeinitModule (); - } -#ifdef __cplusplus -} // extern "C" -#endif - -//------------------------------------------------------------------------ -BOOL WINAPI DllMain (HINSTANCE hInst, DWORD dwReason, LPVOID /*lpvReserved*/) -{ - if (dwReason == DLL_PROCESS_ATTACH) - { - #if defined (_MSC_VER) && defined (DEVELOPMENT) - _CrtSetReportMode ( _CRT_WARN, _CRTDBG_MODE_DEBUG ); - _CrtSetReportMode ( _CRT_ERROR, _CRTDBG_MODE_DEBUG ); - _CrtSetReportMode ( _CRT_ASSERT, _CRTDBG_MODE_DEBUG ); - int flag = _CrtSetDbgFlag (_CRTDBG_REPORT_FLAG); - _CrtSetDbgFlag (flag | _CRTDBG_LEAK_CHECK_DF); - #endif - - moduleHandle = ghInst = hInst; - - // gets the path of the component - if (GetModuleFileName (ghInst, gPath, MAX_PATH) > 0) - { - Steinberg::tchar* bkslash = tstrrchr (gPath, TEXT ('\\')); - if (bkslash) - gPath[bkslash - gPath + 1] = 0; - } - } - - return TRUE; -} diff --git a/vst/public.sdk/source/main/macexport.exp b/vst/public.sdk/source/main/macexport.exp deleted file mode 100644 index 0060ddb1..00000000 --- a/vst/public.sdk/source/main/macexport.exp +++ /dev/null @@ -1,3 +0,0 @@ -_GetPluginFactory -_bundleEntry -_bundleExit diff --git a/vst/public.sdk/source/main/macmain.cpp b/vst/public.sdk/source/main/macmain.cpp deleted file mode 100644 index 86a6c776..00000000 --- a/vst/public.sdk/source/main/macmain.cpp +++ /dev/null @@ -1,110 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : SDK Core -// Version : 1.0 -// -// Category : Common Base Classes -// Filename : public.sdk/source/main/macmain.cpp -// Created by : Steinberg, 01/2004 -// Description : Mac OS X Bundle Entry -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#ifndef __CF_USE_FRAMEWORK_INCLUDES__ -#define __CF_USE_FRAMEWORK_INCLUDES__ 1 -#endif - -#include - -#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) -#define EXPORT __attribute__ ((visibility ("default"))) -#else -#define EXPORT -#endif - -//------------------------------------------------------------------------ -CFBundleRef ghInst = 0; -unsigned int bundleRefCounter = 0; // counting for bundleEntry/bundleExit pairs -void* moduleHandle = 0; -#define MAX_PATH 2048 -char gPath[MAX_PATH] = {0}; - -//------------------------------------------------------------------------ -bool InitModule (); ///< must be provided by Plug-in: called when the library is loaded -bool DeinitModule (); ///< must be provided by Plug-in: called when the library is unloaded - -//------------------------------------------------------------------------ -extern "C" -{ - EXPORT bool bundleEntry (CFBundleRef); - EXPORT bool bundleExit (void); -} - -#include - -std::vector< CFBundleRef > gBundleRefs; - -//------------------------------------------------------------------------ -bool bundleEntry (CFBundleRef ref) -{ - if (ref) - { - bundleRefCounter++; - CFRetain (ref); - - // hold all bundle refs until plug-in is fully uninitialized - gBundleRefs.push_back (ref); - - if (!moduleHandle) - { - ghInst = ref; - moduleHandle = ref; - - // optain the bundle path - CFURLRef tempURL = CFBundleCopyBundleURL (ref); - CFURLGetFileSystemRepresentation (tempURL, true, (UInt8*)gPath, MAX_PATH); - CFRelease (tempURL); - } - } - return InitModule (); -} - -//------------------------------------------------------------------------ -bool bundleExit (void) -{ - if (DeinitModule ()) - { - if (--bundleRefCounter == 0) - { // release the CFBundleRef's once all bundleExit clients called in - // there is no way to identify the proper CFBundleRef of the bundleExit call - for (size_t i = 0; i < gBundleRefs.size(); i++) - CFRelease (gBundleRefs[i]); - gBundleRefs.clear(); - } - return true; - } - - return false; -} diff --git a/vst/public.sdk/source/main/pluginfactoryvst3.cpp b/vst/public.sdk/source/main/pluginfactoryvst3.cpp deleted file mode 100644 index f32461f6..00000000 --- a/vst/public.sdk/source/main/pluginfactoryvst3.cpp +++ /dev/null @@ -1,274 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Common Base Classes -// Filename : public.sdk/source/main/pluginfactoryvst3.cpp -// Created by : Steinberg, 01/2004 -// Description : Standard Plug-in Factory -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#include "pluginfactoryvst3.h" -#include "pluginterfaces/gui/iplugview.h" -#include "pluginterfaces/base/ibstream.h" - -#include - -namespace Steinberg { - -CPluginFactory* gPluginFactory = 0; - -DEF_CLASS_IID (IPluginBase) -DEF_CLASS_IID (IPlugView) -DEF_CLASS_IID (IPlugFrame) -DEF_CLASS_IID (IBStream) -DEF_CLASS_IID (IPluginFactory) -DEF_CLASS_IID (IPluginFactory2) -DEF_CLASS_IID (IPluginFactory3) - -//------------------------------------------------------------------------ -// CPluginFactory implementation -//------------------------------------------------------------------------ -CPluginFactory::CPluginFactory (const PFactoryInfo& info) -: classes (0) -, classCount (0) -, maxClassCount (0) -{ - FUNKNOWN_CTOR - - factoryInfo = info; -} - -//------------------------------------------------------------------------ -CPluginFactory::~CPluginFactory () -{ - if (gPluginFactory == this) - gPluginFactory = 0; - - if (classes) - free (classes); - - FUNKNOWN_DTOR -} - -//------------------------------------------------------------------------ -IMPLEMENT_REFCOUNT (CPluginFactory) - -//------------------------------------------------------------------------ -tresult PLUGIN_API CPluginFactory::queryInterface (FIDString _iid, void** obj) -{ - QUERY_INTERFACE (_iid, obj, IPluginFactory::iid, IPluginFactory) - QUERY_INTERFACE (_iid, obj, IPluginFactory2::iid, IPluginFactory2) - QUERY_INTERFACE (_iid, obj, IPluginFactory3::iid, IPluginFactory3) - QUERY_INTERFACE (_iid, obj, FUnknown::iid, IPluginFactory) - *obj = 0; - return kNoInterface; -} - -//------------------------------------------------------------------------ -bool CPluginFactory::registerClass (const PClassInfo* info, - FUnknown* (*createFunc)(void*), void* context) -{ - if (!info || !createFunc) - return false; - - PClassInfo2 info2; - memcpy (&info2, info, sizeof (PClassInfo)); - return registerClass (&info2, createFunc, context); -} - -//------------------------------------------------------------------------ -bool CPluginFactory::registerClass (const PClassInfo2* info, - FUnknown* (*createFunc)(void*), void* context) -{ - if (!info || !createFunc) - return false; - - if (classCount >= maxClassCount) - { - if (!growClasses ()) - return false; - } - - PClassEntry& entry = classes[classCount]; - entry.info8 = *info; - entry.info16.fromAscii (*info); - entry.createFunc = createFunc; - entry.context = context; - entry.isUnicode = false; - - classCount++; - return true; -} - -//------------------------------------------------------------------------ -bool CPluginFactory::registerClass (const PClassInfoW* info, - FUnknown* (*createFunc)(void*), void* context) -{ - if (!info || !createFunc) - return false; - - if (classCount >= maxClassCount) - { - if (!growClasses ()) - return false; - } - - PClassEntry& entry = classes[classCount]; - entry.info16 = *info; - entry.createFunc = createFunc; - entry.context = context; - entry.isUnicode = true; - - classCount++; - return true; -} - -//------------------------------------------------------------------------ -bool CPluginFactory::growClasses () -{ - static const int32 delta = 10; - - size_t size = (maxClassCount + delta) * sizeof (PClassEntry); - void* memory = classes; - - if (!memory) - memory = malloc (size); - else - memory = realloc (memory, size); - - if (!memory) - return false; - - classes = (PClassEntry*)memory; - maxClassCount += delta; - return true; -} - -//------------------------------------------------------------------------ -bool CPluginFactory::isClassRegistered (const FUID& cid) -{ - for (int32 i = 0; i < classCount; i++) - { - if (cid == classes[i].info16.cid) - return true; - } - return false; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API CPluginFactory::getFactoryInfo (PFactoryInfo* info) -{ - if (info) - memcpy (info, &factoryInfo, sizeof (PFactoryInfo)); - return kResultOk; -} - -//------------------------------------------------------------------------ -int32 PLUGIN_API CPluginFactory::countClasses () -{ - return classCount; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API CPluginFactory::getClassInfo (int32 index, PClassInfo* info) -{ - if (info && (index >= 0 && index < classCount)) - { - if (classes[index].isUnicode) - { - memset (info, 0, sizeof (PClassInfo)); - return kResultFalse; - } - - memcpy (info, &classes[index].info8, sizeof (PClassInfo)); - return kResultOk; - } - return kInvalidArgument; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API CPluginFactory::getClassInfo2 (int32 index, PClassInfo2* info) -{ - if (info && (index >= 0 && index < classCount)) - { - if (classes[index].isUnicode) - { - memset (info, 0, sizeof (PClassInfo2)); - return kResultFalse; - } - - memcpy (info, &classes[index].info8, sizeof (PClassInfo2)); - return kResultOk; - } - return kInvalidArgument; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API CPluginFactory::getClassInfoUnicode (int32 index, PClassInfoW* info) -{ - if (info && (index >= 0 && index < classCount)) - { - memcpy (info, &classes[index].info16, sizeof (PClassInfoW)); - return kResultOk; - } - return kInvalidArgument; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API CPluginFactory::createInstance (FIDString cid, FIDString _iid, void** obj) -{ - for (int32 i = 0; i < classCount; i++) - { - if (memcmp (classes[i].info16.cid, cid, sizeof (TUID)) == 0) - { - FUnknown* instance = classes[i].createFunc (classes[i].context); - if (instance) - { - if (instance->queryInterface (_iid, obj) == kResultOk) - { - instance->release (); - return kResultOk; - } - else - instance->release (); - } - break; - } - } - - *obj = 0; - return kNoInterface; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API CPluginFactory::setHostContext (FUnknown* /*context*/) -{ - return kNotImplemented; -} - -} // namespace Steinberg diff --git a/vst/public.sdk/source/main/pluginfactoryvst3.h b/vst/public.sdk/source/main/pluginfactoryvst3.h deleted file mode 100644 index 50d11888..00000000 --- a/vst/public.sdk/source/main/pluginfactoryvst3.h +++ /dev/null @@ -1,173 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Common Base Classes -// Filename : public.sdk/source/main/pluginfactoryvst3.h -// Created by : Steinberg, 01/2004 -// Description : Standard Plug-in Factory -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#pragma once - -#include "pluginterfaces/base/ipluginbase.h" - -namespace Steinberg { - -//------------------------------------------------------------------------ -/** Default Class Factory implementation. -\ingroup sdkBase -\see \ref classFactoryMacros */ -//------------------------------------------------------------------------ -class CPluginFactory : public IPluginFactory3 -{ -public: -//------------------------------------------------------------------------ - CPluginFactory (const PFactoryInfo& info); - virtual ~CPluginFactory (); - -//------------------------------------------------------------------------ - /** Registers a Plug-in class with classInfo version 1, returns true for success. */ - bool registerClass (const PClassInfo* info, - FUnknown* (*createFunc)(void*), - void* context = 0); - - /** Registers a Plug-in class with classInfo version 2, returns true for success. */ - bool registerClass (const PClassInfo2* info, - FUnknown* (*createFunc)(void*), - void* context = 0); - - /** Registers a Plug-in class with classInfo Unicode version, returns true for success. */ - bool registerClass (const PClassInfoW* info, - FUnknown* (*createFunc)(void*), - void* context = 0); - - - /** Check if a class for a given classId is already registered. */ - bool isClassRegistered (const FUID& cid); - -//------------------------------------------------------------------------ - DECLARE_FUNKNOWN_METHODS - - //---from IPluginFactory------ - tresult PLUGIN_API getFactoryInfo (PFactoryInfo* info); - int32 PLUGIN_API countClasses (); - tresult PLUGIN_API getClassInfo (int32 index, PClassInfo* info); - tresult PLUGIN_API createInstance (FIDString cid, FIDString _iid, void** obj); - - //---from IPluginFactory2----- - tresult PLUGIN_API getClassInfo2 (int32 index, PClassInfo2* info); - - //---from IPluginFactory3----- - tresult PLUGIN_API getClassInfoUnicode (int32 index, PClassInfoW* info); - tresult PLUGIN_API setHostContext (FUnknown* context); - -//------------------------------------------------------------------------ -protected: - /// @cond - struct PClassEntry - { - //----------------------------------- - PClassInfo2 info8; - PClassInfoW info16; - - FUnknown* (*createFunc)(void*); - void* context; - bool isUnicode; - //----------------------------------- - }; - /// @endcond - - PFactoryInfo factoryInfo; - PClassEntry* classes; - int32 classCount; - int32 maxClassCount; - - bool growClasses (); -}; - -extern CPluginFactory* gPluginFactory; -//------------------------------------------------------------------------ -} // namespace Steinberg - - -//------------------------------------------------------------------------ -#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) - #define EXPORT_FACTORY __attribute__ ((visibility ("default"))) -#else - #define EXPORT_FACTORY -#endif - -//------------------------------------------------------------------------ -/** \defgroup classFactoryMacros Macros for defining the class factory -\ingroup sdkBase - -\b Example - How to use the class factory macros: -\code -BEGIN_FACTORY ("Steinberg Technologies", - "http://www.steinberg.de", - "mailto:info@steinberg.de", - PFactoryInfo::kNoFlags) - -DEF_CLASS (INLINE_UID (0x00000000, 0x00000000, 0x00000000, 0x00000000), - PClassInfo::kManyInstances, - "Service", - "Test Service", - TestService::newInstance) - -END_FACTORY -\endcode - -@{*/ - -#define BEGIN_FACTORY(vendor,url,email,flags) using namespace Steinberg; \ - EXPORT_FACTORY IPluginFactory* PLUGIN_API GetPluginFactory () { \ - if (!gPluginFactory) \ - { static PFactoryInfo factoryInfo (vendor,url,email,flags); \ - gPluginFactory = new CPluginFactory (factoryInfo); \ - -#define DEF_CLASS(cid,cardinality,category,name,createMethod) \ - { TUID lcid = cid; static PClassInfo componentClass (lcid,cardinality,category,name); \ - gPluginFactory->registerClass (&componentClass,createMethod); } - -#define DEF_CLASS1(cid,cardinality,category,name,createMethod) \ - { static PClassInfo componentClass (cid,cardinality,category,name); \ - gPluginFactory->registerClass (&componentClass,createMethod); } - -#define DEF_CLASS2(cid,cardinality,category,name,classFlags,subCategories,version,sdkVersion,createMethod) \ - { TUID lcid = cid; static PClassInfo2 componentClass (lcid,cardinality,category,name,classFlags,subCategories, 0 ,version,sdkVersion);\ - gPluginFactory->registerClass (&componentClass,createMethod); } - -#define DEF_CLASS_W(cid,cardinality,category,name,classFlags,subCategories,version,sdkVersion,createMethod) \ - { TUID lcid = cid; static PClassInfoUnicode componentClass (lcid,cardinality,category,name,classFlags,subCategories, 0,version,sdkVersion);\ - gPluginFactory->registerClass (&componentClass,createMethod); } - - -#define END_FACTORY } else gPluginFactory->addRef (); \ - return gPluginFactory; } - -/** @} */ diff --git a/vst/public.sdk/source/vst/auwrapper/NSDataIBStream.h b/vst/public.sdk/source/vst/auwrapper/NSDataIBStream.h deleted file mode 100644 index b46214c7..00000000 --- a/vst/public.sdk/source/vst/auwrapper/NSDataIBStream.h +++ /dev/null @@ -1,90 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/auwrapper/NSDataIBStream.h -// Created by : Steinberg, 12/2007 -// Description : VST 3 -> AU Wrapper -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -/// \cond ignore - -#pragma once - -#import -#import "pluginterfaces/base/ibstream.h" -#import "public.sdk/source/vst/hosting/hostclasses.h" - -//------------------------------------------------------------------------ -namespace Steinberg { -namespace Vst { - -//------------------------------------------------------------------------ -class NSDataIBStream : public IBStream, Vst::IStreamAttributes -{ -public: - NSDataIBStream (NSData* data, bool hideAttributes = false); - virtual ~NSDataIBStream (); - - //---from IBStream------------------- - tresult PLUGIN_API read (void* buffer, int32 numBytes, int32* numBytesRead = 0); - tresult PLUGIN_API write (void* buffer, int32 numBytes, int32* numBytesWritten = 0); - tresult PLUGIN_API seek (int64 pos, int32 mode, int64* result = 0); - tresult PLUGIN_API tell (int64* pos); - - //---from Vst::IStreamAttributes----- - virtual tresult PLUGIN_API getFileName (String128 name); - virtual IAttributeList* PLUGIN_API getAttributes (); - - //------------------------------------------------------------------------ - DECLARE_FUNKNOWN_METHODS -protected: - NSData* data; - int64 currentPos; - HostAttributeList attrList; - bool hideAttributes; -}; - -//------------------------------------------------------------------------ -class NSMutableDataIBStream : public NSDataIBStream -{ -public: - NSMutableDataIBStream (NSMutableData* data); - virtual ~NSMutableDataIBStream (); - - tresult PLUGIN_API write (void* buffer, int32 numBytes, int32* numBytesWritten = 0); -//------------------------------------------------------------------------ -protected: - NSMutableData* mdata; -}; - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg - -/// \endcond diff --git a/vst/public.sdk/source/vst/auwrapper/NSDataIBStream.mm b/vst/public.sdk/source/vst/auwrapper/NSDataIBStream.mm deleted file mode 100644 index 32cb91f9..00000000 --- a/vst/public.sdk/source/vst/auwrapper/NSDataIBStream.mm +++ /dev/null @@ -1,204 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/auwrapper/NSDataIBStream.mm -// Created by : Steinberg, 12/2007 -// Description : VST 3 -> AU Wrapper -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -/// \cond ignore - -#include "NSDataIBStream.h" - -#include "pluginterfaces/vst/ivstattributes.h" - -#include - -#if __clang__ -#if __has_feature(objc_arc) && __clang_major__ >= 3 -#define ARC_ENABLED 1 -#endif // __has_feature(objc_arc) -#endif // __clang__ - -namespace Steinberg { -namespace Vst { - -DEF_CLASS_IID(IStreamAttributes) - -//-------------------------------------------------------------------------------------------------------------- -NSDataIBStream::NSDataIBStream (NSData* data, bool hideAttributes) -: data (data) -, currentPos (0) -, hideAttributes (hideAttributes) -{ - FUNKNOWN_CTOR -#if !ARC_ENABLED - [data retain]; -#endif -} - -//-------------------------------------------------------------------------------------------------------------- -NSDataIBStream::~NSDataIBStream () -{ -#if !ARC_ENABLED - [data release]; -#endif - FUNKNOWN_DTOR -} - -//-------------------------------------------------------------------------------------------------------------- -IMPLEMENT_REFCOUNT (NSDataIBStream) - -//-------------------------------------------------------------------------------------------------------------- -tresult PLUGIN_API NSDataIBStream::queryInterface (const TUID iid, void** obj) -{ - QUERY_INTERFACE (iid, obj, FUnknown::iid, IBStream) - QUERY_INTERFACE (iid, obj, IBStream::iid, IBStream) - if (!hideAttributes) - QUERY_INTERFACE (iid, obj, IStreamAttributes::iid, IStreamAttributes) - *obj = 0; - return kNoInterface; -} - -//-------------------------------------------------------------------------------------------------------------- -tresult PLUGIN_API NSDataIBStream::read (void* buffer, int32 numBytes, int32* numBytesRead) -{ - int32 useBytes = std::min (numBytes, (int32)([data length] - currentPos)); - if (useBytes > 0) - { - [data getBytes: buffer range: NSMakeRange (currentPos, useBytes)]; - if (numBytesRead) - *numBytesRead = useBytes; - currentPos += useBytes; - return kResultTrue; - } - return kResultFalse; -} - -//-------------------------------------------------------------------------------------------------------------- -tresult PLUGIN_API NSDataIBStream::write (void* buffer, int32 numBytes, int32* numBytesWritten) -{ - return kResultFalse; -} - -//-------------------------------------------------------------------------------------------------------------- -tresult PLUGIN_API NSDataIBStream::seek (int64 pos, int32 mode, int64* result) -{ - switch (mode) - { - case kIBSeekSet: - { - if (pos <= [data length]) - { - currentPos = pos; - if (result) - tell (result); - return kResultTrue; - } - break; - } - case kIBSeekCur: - { - if (currentPos + pos <= [data length]) - { - currentPos += pos; - if (result) - tell (result); - return kResultTrue; - } - break; - } - case kIBSeekEnd: - { - if ([data length] + pos <= [data length]) - { - currentPos = [data length] + pos; - if (result) - tell (result); - return kResultTrue; - } - break; - } - } - return kResultFalse; -} - -//-------------------------------------------------------------------------------------------------------------- -tresult PLUGIN_API NSDataIBStream::tell (int64* pos) -{ - if (pos) - { - *pos = currentPos; - return kResultTrue; - } - return kResultFalse; -} - -//-------------------------------------------------------------------------------------------------------------- -tresult PLUGIN_API NSDataIBStream::getFileName (String128 name) -{ - return kNotImplemented; -} - -//-------------------------------------------------------------------------------------------------------------- -IAttributeList* PLUGIN_API NSDataIBStream::getAttributes () -{ - return hideAttributes ? 0 : &attrList; -} - -//-------------------------------------------------------------------------------------------------------------- -//-------------------------------------------------------------------------------------------------------------- -//-------------------------------------------------------------------------------------------------------------- -NSMutableDataIBStream::NSMutableDataIBStream (NSMutableData* data) -: NSDataIBStream (data, true) -, mdata (data) -{ -} - -//-------------------------------------------------------------------------------------------------------------- -NSMutableDataIBStream::~NSMutableDataIBStream () -{ - [mdata setLength:currentPos]; -} - -//-------------------------------------------------------------------------------------------------------------- -tresult PLUGIN_API NSMutableDataIBStream::write (void* buffer, int32 numBytes, int32* numBytesWritten) -{ - [mdata replaceBytesInRange:NSMakeRange (currentPos, numBytes) withBytes:buffer]; - if (numBytesWritten) - *numBytesWritten = numBytes; - currentPos += numBytes; - return kResultTrue; -} - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg - -/// \endcond diff --git a/vst/public.sdk/source/vst/auwrapper/again/Info.plist b/vst/public.sdk/source/vst/auwrapper/again/Info.plist deleted file mode 100644 index cb662814..00000000 --- a/vst/public.sdk/source/vst/auwrapper/again/Info.plist +++ /dev/null @@ -1,115 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/auwrapper/again/Info.plist -// Created by : Steinberg, 12/2007 -// Description : VST 3 -> AU Wrapper -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#include "audiounitconfig.h" - - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - kAudioUnitBundleIdentifier - CFBundleName - $(PRODUCT_NAME) - CFBundleInfoDictionaryVersion - 6.0 - CFBundlePackageType - BNDL - CFBundleSignature - ???? - CFBundleVersion - 1.0 - CSResourcesFileMapped - yes - - /* - The "AudioUnit SupportedNumChannels" key is only necessary if you build an effect not an instrument. - You should describe all supported channel configurations. - This example says that it supports Stereo/Stereo or Mono/Mono. - */ - - AudioUnit SupportedNumChannels - - - Outputs - 2 - Inputs - 2 - - - Outputs - 0 - Inputs - 1 - - - Outputs - 1 - Inputs - 1 - - - - AudioUnit Version - kAudioUnitVersion - - /* - Support for the new AUPlugIn model in Mac OS X 10.7 - */ - AudioComponents - - - description - kAUPluginDescription - factoryFunction - AUWrapperFactory - manufacturer - kAUPluginManufacturer - name - kAUPluginName - subtype - kAUPluginSubType - type - kAUPluginType - version - kAudioUnitVersion - - - - - diff --git a/vst/public.sdk/source/vst/auwrapper/again/again.xcodeproj/project.pbxproj b/vst/public.sdk/source/vst/auwrapper/again/again.xcodeproj/project.pbxproj deleted file mode 100644 index 848ccd24..00000000 --- a/vst/public.sdk/source/vst/auwrapper/again/again.xcodeproj/project.pbxproj +++ /dev/null @@ -1,363 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 45; - objects = { - -/* Begin PBXBuildFile section */ - 5088180A09F0CE0A0071BF1A /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5088180909F0CE0A0071BF1A /* CoreFoundation.framework */; }; - 705242CE1B624AEA00CB1108 /* CoreMIDI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 705242CD1B624AEA00CB1108 /* CoreMIDI.framework */; }; - F49C1935156E353900AD946F /* libauwrapper.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F4CE9C0012AE39E6007E91D2 /* libauwrapper.a */; }; - F4F8519C0F1C90840076110E /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F4F851980F1C90840076110E /* AudioToolbox.framework */; }; - F4F8519D0F1C90840076110E /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F4F851990F1C90840076110E /* AudioUnit.framework */; }; - F4F8519E0F1C90840076110E /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F4F8519A0F1C90840076110E /* Carbon.framework */; }; - F4F8519F0F1C90840076110E /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F4F8519B0F1C90840076110E /* Cocoa.framework */; }; - F4F851AD0F1C916D0076110E /* auresource.r in Rez */ = {isa = PBXBuildFile; fileRef = F4F851A90F1C90CA0076110E /* auresource.r */; }; - F4F852040F1C94F70076110E /* doc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F4F852030F1C94F70076110E /* doc.cpp */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - F4CE9BFF12AE39E6007E91D2 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = F4CE9BF412AE39E6007E91D2 /* auwrapper.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = D2AAC046055464E500DB518D; - remoteInfo = auwrapper; - }; - F4CE9C0C12AE39EA007E91D2 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = F4CE9BF412AE39E6007E91D2 /* auwrapper.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = D2AAC045055464E500DB518D; - remoteInfo = auwrapper; - }; - F4CE9C4512AE3B4E007E91D2 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = F4CE9C3C12AE3B4E007E91D2 /* again.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 8D01CCD20486CAD60068D4B7; - remoteInfo = again; - }; - F4CE9C4712AE3B4E007E91D2 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = F4CE9C3C12AE3B4E007E91D2 /* again.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = F4B195E710908B1D003BD204; - remoteInfo = "again single component"; - }; - F4CE9C4912AE3B55007E91D2 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = F4CE9C3C12AE3B4E007E91D2 /* again.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = 8D01CCC60486CAD60068D4B7; - remoteInfo = again; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 508817D609F0C9AD0071BF1A /* Info.plist */ = {isa = PBXFileReference; explicitFileType = text; path = Info.plist; sourceTree = ""; }; - 5088180909F0CE0A0071BF1A /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = ""; }; - 705242CD1B624AEA00CB1108 /* CoreMIDI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMIDI.framework; path = System/Library/Frameworks/CoreMIDI.framework; sourceTree = SDKROOT; }; - F49C1928156E29F200AD946F /* ausdkpath.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ausdkpath.xcconfig; sourceTree = ""; }; - F49C1932156E2FF800AD946F /* again_debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = again_debug.xcconfig; path = config/again_debug.xcconfig; sourceTree = SOURCE_ROOT; }; - F49C1933156E2FF800AD946F /* again_release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = again_release.xcconfig; path = config/again_release.xcconfig; sourceTree = SOURCE_ROOT; }; - F49C1934156E2FF800AD946F /* again.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = again.xcconfig; path = config/again.xcconfig; sourceTree = SOURCE_ROOT; }; - F4CE9BF412AE39E6007E91D2 /* auwrapper.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = auwrapper.xcodeproj; path = ../auwrapper.xcodeproj; sourceTree = SOURCE_ROOT; }; - F4CE9C3C12AE3B4E007E91D2 /* again.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = again.xcodeproj; path = ../../../../samples/vst/again/mac/again.xcodeproj; sourceTree = SOURCE_ROOT; }; - F4F851960F1C8FE00076110E /* again.component */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = again.component; sourceTree = BUILT_PRODUCTS_DIR; }; - F4F851980F1C90840076110E /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = /System/Library/Frameworks/AudioToolbox.framework; sourceTree = ""; }; - F4F851990F1C90840076110E /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = /System/Library/Frameworks/AudioUnit.framework; sourceTree = ""; }; - F4F8519A0F1C90840076110E /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = ""; }; - F4F8519B0F1C90840076110E /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; - F4F851A90F1C90CA0076110E /* auresource.r */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.rez; name = auresource.r; path = ../auresource.r; sourceTree = SOURCE_ROOT; }; - F4F851AA0F1C90DC0076110E /* audiounitconfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = audiounitconfig.h; sourceTree = ""; }; - F4F852030F1C94F70076110E /* doc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = doc.cpp; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 508817D209F0C9AD0071BF1A /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - F49C1935156E353900AD946F /* libauwrapper.a in Frameworks */, - 705242CE1B624AEA00CB1108 /* CoreMIDI.framework in Frameworks */, - 5088180A09F0CE0A0071BF1A /* CoreFoundation.framework in Frameworks */, - F4F8519C0F1C90840076110E /* AudioToolbox.framework in Frameworks */, - F4F8519D0F1C90840076110E /* AudioUnit.framework in Frameworks */, - F4F8519E0F1C90840076110E /* Carbon.framework in Frameworks */, - F4F8519F0F1C90840076110E /* Cocoa.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 508817C209F0C9740071BF1A = { - isa = PBXGroup; - children = ( - 705242CD1B624AEA00CB1108 /* CoreMIDI.framework */, - F4CE9C3C12AE3B4E007E91D2 /* again.xcodeproj */, - F4CE9BF412AE39E6007E91D2 /* auwrapper.xcodeproj */, - 508817D609F0C9AD0071BF1A /* Info.plist */, - F4F851A90F1C90CA0076110E /* auresource.r */, - F4F851AA0F1C90DC0076110E /* audiounitconfig.h */, - F4F852030F1C94F70076110E /* doc.cpp */, - F49C1929156E2C2C00AD946F /* config */, - 5088180609F0CDD00071BF1A /* External Frameworks and Libraries */, - 508817D509F0C9AD0071BF1A /* Products */, - ); - sourceTree = ""; - }; - 508817D509F0C9AD0071BF1A /* Products */ = { - isa = PBXGroup; - children = ( - F4F851960F1C8FE00076110E /* again.component */, - ); - name = Products; - sourceTree = ""; - }; - 5088180609F0CDD00071BF1A /* External Frameworks and Libraries */ = { - isa = PBXGroup; - children = ( - F4F851980F1C90840076110E /* AudioToolbox.framework */, - F4F851990F1C90840076110E /* AudioUnit.framework */, - F4F8519A0F1C90840076110E /* Carbon.framework */, - F4F8519B0F1C90840076110E /* Cocoa.framework */, - 5088180909F0CE0A0071BF1A /* CoreFoundation.framework */, - ); - name = "External Frameworks and Libraries"; - sourceTree = ""; - }; - F49C1929156E2C2C00AD946F /* config */ = { - isa = PBXGroup; - children = ( - F49C1928156E29F200AD946F /* ausdkpath.xcconfig */, - F49C1932156E2FF800AD946F /* again_debug.xcconfig */, - F49C1933156E2FF800AD946F /* again_release.xcconfig */, - F49C1934156E2FF800AD946F /* again.xcconfig */, - ); - name = config; - path = ../config; - sourceTree = ""; - }; - F4CE9BF512AE39E6007E91D2 /* Products */ = { - isa = PBXGroup; - children = ( - F4CE9C0012AE39E6007E91D2 /* libauwrapper.a */, - ); - name = Products; - sourceTree = ""; - }; - F4CE9C3D12AE3B4E007E91D2 /* Products */ = { - isa = PBXGroup; - children = ( - F4CE9C4612AE3B4E007E91D2 /* again.vst3 */, - F4CE9C4812AE3B4E007E91D2 /* again_single.vst3 */, - ); - name = Products; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 508817D309F0C9AD0071BF1A /* again */ = { - isa = PBXNativeTarget; - buildConfigurationList = 508817D709F0C9AE0071BF1A /* Build configuration list for PBXNativeTarget "again" */; - buildPhases = ( - 508817D009F0C9AD0071BF1A /* Resources */, - F4F851B80F1C91870076110E /* Rez */, - 508817D109F0C9AD0071BF1A /* Sources */, - 508817D209F0C9AD0071BF1A /* Frameworks */, - F4F852240F1C970E0076110E /* ShellScript */, - ); - buildRules = ( - ); - dependencies = ( - F4CE9C0D12AE39EA007E91D2 /* PBXTargetDependency */, - F4CE9C4A12AE3B55007E91D2 /* PBXTargetDependency */, - ); - name = again; - productName = again; - productReference = F4F851960F1C8FE00076110E /* again.component */; - productType = "com.apple.product-type.bundle"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 508817C409F0C9740071BF1A /* Project object */ = { - isa = PBXProject; - attributes = { - }; - buildConfigurationList = 508817C509F0C9740071BF1A /* Build configuration list for PBXProject "again" */; - compatibilityVersion = "Xcode 3.1"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - English, - Japanese, - French, - German, - ); - mainGroup = 508817C209F0C9740071BF1A; - productRefGroup = 508817D509F0C9AD0071BF1A /* Products */; - projectDirPath = ""; - projectReferences = ( - { - ProductGroup = F4CE9C3D12AE3B4E007E91D2 /* Products */; - ProjectRef = F4CE9C3C12AE3B4E007E91D2 /* again.xcodeproj */; - }, - { - ProductGroup = F4CE9BF512AE39E6007E91D2 /* Products */; - ProjectRef = F4CE9BF412AE39E6007E91D2 /* auwrapper.xcodeproj */; - }, - ); - projectRoot = ""; - targets = ( - 508817D309F0C9AD0071BF1A /* again */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXReferenceProxy section */ - F4CE9C0012AE39E6007E91D2 /* libauwrapper.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libauwrapper.a; - remoteRef = F4CE9BFF12AE39E6007E91D2 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - F4CE9C4612AE3B4E007E91D2 /* again.vst3 */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = again.vst3; - remoteRef = F4CE9C4512AE3B4E007E91D2 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - F4CE9C4812AE3B4E007E91D2 /* again_single.vst3 */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = again_single.vst3; - remoteRef = F4CE9C4712AE3B4E007E91D2 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; -/* End PBXReferenceProxy section */ - -/* Begin PBXResourcesBuildPhase section */ - 508817D009F0C9AD0071BF1A /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXRezBuildPhase section */ - F4F851B80F1C91870076110E /* Rez */ = { - isa = PBXRezBuildPhase; - buildActionMask = 2147483647; - files = ( - F4F851AD0F1C916D0076110E /* auresource.r in Rez */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXRezBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - F4F852240F1C970E0076110E /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "RESOURCE_PATH=\"$CONFIGURATION_BUILD_DIR/$WRAPPER_NAME/Contents/Resources/\"\ncd \"$RESOURCE_PATH\"\nln -sf ../../../../../../../../../samples/vst/again/mac/build/Debug/again.vst3 plugin.vst3\ncd ~/Library/Audio/Plug-Ins/Components/\nln -sf \"$CONFIGURATION_BUILD_DIR/$WRAPPER_NAME\"\ntouch .\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 508817D109F0C9AD0071BF1A /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - F4F852040F1C94F70076110E /* doc.cpp in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - F4CE9C0D12AE39EA007E91D2 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = auwrapper; - targetProxy = F4CE9C0C12AE39EA007E91D2 /* PBXContainerItemProxy */; - }; - F4CE9C4A12AE3B55007E91D2 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = again; - targetProxy = F4CE9C4912AE3B55007E91D2 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin XCBuildConfiguration section */ - 508817C609F0C9740071BF1A /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = F49C1932156E2FF800AD946F /* again_debug.xcconfig */; - buildSettings = { - PREBINDING = NO; - }; - name = Debug; - }; - 508817C709F0C9740071BF1A /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = F49C1933156E2FF800AD946F /* again_release.xcconfig */; - buildSettings = { - PREBINDING = NO; - }; - name = Release; - }; - 508817D809F0C9AE0071BF1A /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - INFOPLIST_FILE = Info.plist; - }; - name = Debug; - }; - 508817D909F0C9AE0071BF1A /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 508817C509F0C9740071BF1A /* Build configuration list for PBXProject "again" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 508817C609F0C9740071BF1A /* Debug */, - 508817C709F0C9740071BF1A /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 508817D709F0C9AE0071BF1A /* Build configuration list for PBXNativeTarget "again" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 508817D809F0C9AE0071BF1A /* Debug */, - 508817D909F0C9AE0071BF1A /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 508817C409F0C9740071BF1A /* Project object */; -} diff --git a/vst/public.sdk/source/vst/auwrapper/again/audiounitconfig.h b/vst/public.sdk/source/vst/auwrapper/again/audiounitconfig.h deleted file mode 100644 index fa9d18a3..00000000 --- a/vst/public.sdk/source/vst/auwrapper/again/audiounitconfig.h +++ /dev/null @@ -1,59 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/auwrapper/again/audiounitconfig.h -// Created by : Steinberg, 12/2007 -// Description : VST 3 -> AU Wrapper -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -// AUWRAPPER_CHANGE - -/* Bundle Identifier */ -#define kAudioUnitBundleIdentifier com.steinberg.vst3plugin.again.audiounit -/* Version Number (needs to be in hex)*/ -#define kAudioUnitVersion 0xFFFFFFFF -/* Company Name + Effect Name */ -#define kAUPluginName Steinberg: AGain -/* Effect Description */ -#define kAUPluginDescription AGain -/* Audio Unit Type */ -#define kAUPluginType aufx -/* Unique ID */ -#define kAUPluginSubType gain -/* Registered Company ID */ -#define kAUPluginManufacturer Stgb - -// Definitions for the resource file -#define kAudioUnitName "Steinberg: AGain" // same as kAUPluginName -#define kAudioUnitDescription "AGain" // same as kAUPluginDescription -#define kAudioUnitType 'aufx' // same as kAUPluginType -#define kAudioUnitComponentSubType 'gain' // same as kAUPluginSubType -#define kAudioUnitComponentManuf 'Stgb' // same as kAUPluginManufacturer - -#define kAudioUnitCarbonView 1 // if 0 no Carbon view support will be added diff --git a/vst/public.sdk/source/vst/auwrapper/again/config/again.xcconfig b/vst/public.sdk/source/vst/auwrapper/again/config/again.xcconfig deleted file mode 100644 index ba8de208..00000000 --- a/vst/public.sdk/source/vst/auwrapper/again/config/again.xcconfig +++ /dev/null @@ -1,49 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : again.xcconfig -// Created by : Steinberg, 5/24/12 -// Description : Xcode configuration file, VST 3 -> AU Wrapper -// -//------------------------------------------------------------------------ -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#include "../../config/ausdkpath" // AUWRAPPER_CHANGE - -PRODUCT_NAME = again // AUWRAPPER_CHANGE -WRAPPER_EXTENSION = component - -STRIP_STYLE = non-global -OTHER_LDFLAGS = -all_load -GENERATE_MASTER_OBJECT_FILE = YES -KEEP_PRIVATE_EXTERNS = YES -SEPARATE_SYMBOL_EDIT = YES -OTHER_REZFLAGS = -d ppc_$ppc -d i386_$i386 -d ppc64_$ppc64 -d x86_64_$x86_64 -I /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Versions/A/Headers -I /$DEVELOPER_DIR/Examples/CoreAudio/AudioUnits/AUPublic/AUBase -I /$DEVELOPER_DIR/Extras/CoreAudio/AudioUnits/AUPublic/AUBase -I $(CUSTOM_AU_SDK_PATH)/AudioUnits/AUPublic/AUBase -INFOPLIST_PREPROCESS = YES -PRESERVE_DEAD_CODE_INITS_AND_TERMS = YES -DEBUG_INFORMATION_FORMAT = dwarf-with-dsym -INSTALL_PATH = /Library/Audio/Plug-Ins/Components/ diff --git a/vst/public.sdk/source/vst/auwrapper/again/config/again_debug.xcconfig b/vst/public.sdk/source/vst/auwrapper/again/config/again_debug.xcconfig deleted file mode 100644 index 1a042c4f..00000000 --- a/vst/public.sdk/source/vst/auwrapper/again/config/again_debug.xcconfig +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : again_debug.xcconfig -// Created by : Steinberg, 5/24/12 -// Description : Xcode configuration file, VST 3 -> AU Wrapper -// -//------------------------------------------------------------------------ -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#include "../../../../../base/mac/config/debug" // AUWRAPPER_CHANGE -#include "again" diff --git a/vst/public.sdk/source/vst/auwrapper/again/config/again_release.xcconfig b/vst/public.sdk/source/vst/auwrapper/again/config/again_release.xcconfig deleted file mode 100644 index d783cd4f..00000000 --- a/vst/public.sdk/source/vst/auwrapper/again/config/again_release.xcconfig +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : again_release.xcconfig -// Created by : Steinberg, 5/24/12 -// Description : Xcode configuration file, VST 3 -> AU Wrapper -// -//------------------------------------------------------------------------ -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#include "../../../../../base/mac/config/release" // AUWRAPPER_CHANGE -#include "again" diff --git a/vst/public.sdk/source/vst/auwrapper/again/doc.cpp b/vst/public.sdk/source/vst/auwrapper/again/doc.cpp deleted file mode 100644 index dbcdaf6f..00000000 --- a/vst/public.sdk/source/vst/auwrapper/again/doc.cpp +++ /dev/null @@ -1,47 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/auwrapper/again/doc.cpp -// Created by : Steinberg, 12/2007 -// Description : VST 3 -> AU Wrapper -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -/* - How-To use the VST3->AU Wrapper: - - - Make a copy of this project - - search trough the project files for "AUWRAPPER_CHANGE". You may need to change the stuff there especially - if you have moved the project so that some paths are invalid - - edit audiounitconfig.h see comments there - - edit Info.plist see comments there - - edit the "Make Links Script" for easier debugging/development - - - For the release version, you must place a copy or an alias of your vst3 plugin in the resource folder of the bundle named "plugin.vst3" - - */ diff --git a/vst/public.sdk/source/vst/auwrapper/aucarbonview.h b/vst/public.sdk/source/vst/auwrapper/aucarbonview.h deleted file mode 100644 index 1462f769..00000000 --- a/vst/public.sdk/source/vst/auwrapper/aucarbonview.h +++ /dev/null @@ -1,81 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/auwrapper/aucarbonview.h -// Created by : Steinberg, 12/2007 -// Description : VST 3 -> AU Wrapper -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -/// \cond ignore - -#pragma once - -#if !__LP64__ - -#include "AUPublic/AUCarbonViewBase/AUCarbonViewBase.h" -#include "pluginterfaces/vst/ivsteditcontroller.h" -#include "base/source/fobject.h" -#include "pluginterfaces/gui/iplugview.h" - -namespace Steinberg { -namespace Vst { -class AUCarbonPlugFrame; - -//------------------------------------------------------------------------ -class AUCarbonView : public AUCarbonViewBase, public IPlugFrame, public FObject -{ -public: - AUCarbonView (AudioUnitCarbonView auv); - ~AUCarbonView (); - - OSStatus CreateUI (Float32 xoffset, Float32 yoffset); - - OBJ_METHODS(AUCarbonView, FObject) - DEF_INTERFACES_1(IPlugFrame, FObject) - REFCOUNT_METHODS(FObject) - -protected: - tresult PLUGIN_API resizeView (IPlugView* view, ViewRect* vr); - - static OSStatus HIViewAdded (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void* inUserData); - - IEditController* editController; - AUCarbonPlugFrame* plugFrame; - IPlugView* plugView; - HIViewRef hiPlugView; - EventHandlerRef eventHandler; -}; - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg - -#endif // !__LP64__ - -/// \endcond diff --git a/vst/public.sdk/source/vst/auwrapper/aucarbonview.mm b/vst/public.sdk/source/vst/auwrapper/aucarbonview.mm deleted file mode 100644 index 6ef3cec9..00000000 --- a/vst/public.sdk/source/vst/auwrapper/aucarbonview.mm +++ /dev/null @@ -1,165 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/auwrapper/aucarbonview.mm -// Created by : Steinberg, 12/2007 -// Description : VST 3 -> AU Wrapper -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -/// \cond ignore - -#include "aucarbonview.h" - -#if !__LP64__ - -namespace Steinberg { -namespace Vst { - -//-------------------------------------------------------------------------------------------------------------- -AUCarbonView::AUCarbonView (AudioUnitCarbonView auv) -: AUCarbonViewBase (auv) -, editController (0) -, plugView (0) -, hiPlugView (0) -{ -} - -//-------------------------------------------------------------------------------------------------------------- -AUCarbonView::~AUCarbonView () -{ - if (plugView) - { - plugView->setFrame (0); - plugView->removed (); - plugView->release (); - } -} - -//-------------------------------------------------------------------------------------------------------------- -OSStatus AUCarbonView::HIViewAdded (EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData) -{ - UInt32 eventClass = GetEventClass (inEvent); - UInt32 eventKind = GetEventKind (inEvent); - if (eventClass == kEventClassControl && eventKind == kEventControlAddedSubControl) - { - HIViewRef newControl; - if (GetEventParameter (inEvent, kEventParamControlSubControl, typeControlRef, NULL, sizeof (HIViewRef) , NULL , &newControl) == noErr) - { - AUCarbonView* wrapper = (AUCarbonView*)inUserData; - wrapper->hiPlugView = newControl; - RemoveEventHandler (wrapper->eventHandler); - wrapper->eventHandler = 0; - } - } - return eventNotHandledErr; -} - -//-------------------------------------------------------------------------------------------------------------- -OSStatus AUCarbonView::CreateUI (Float32 xoffset, Float32 yoffset) -{ - AudioUnit unit = GetEditAudioUnit (); - if (unit) - { - if (!editController) - { - UInt32 size = sizeof (IEditController*); - if (AudioUnitGetProperty (unit, 64000, kAudioUnitScope_Global, 0, &editController, &size) != noErr) - return kAudioUnitErr_NoConnection; - } - if (editController) - { - plugView = editController->createView (ViewType::kEditor); - if (!plugView) - return kAudioUnitErr_NoConnection; - - HIViewRef contentView; - const EventTypeSpec eventTypes[] = { - { kEventClassControl, kEventControlAddedSubControl }, - }; - OSStatus err = HIViewFindByID (HIViewGetRoot (GetCarbonWindow ()), kHIViewWindowContentID, &contentView); - err = InstallControlEventHandler (contentView, HIViewAdded, 1, eventTypes, this, &eventHandler); - - plugView->setFrame (this); - - if (plugView->attached (GetCarbonWindow (), kPlatformTypeHIView) == kResultTrue) - { - HIViewRemoveFromSuperview (hiPlugView); - EmbedControl (hiPlugView); - HIViewMoveBy (hiPlugView, xoffset, yoffset); - return noErr; - } - else - plugView->setFrame (0); - } - } - return kAudioUnitErr_NoConnection; -} - -//-------------------------------------------------------------------------------------------------------------- -tresult PLUGIN_API AUCarbonView::resizeView (IPlugView* view, ViewRect* vr) -{ - if (vr == 0 || view != plugView) - return kInvalidArgument; - - HIViewRef hiView = GetCarbonPane (); - if (hiView) - { - HIRect r; - if (HIViewGetFrame (hiView, &r) != noErr) - return kResultFalse; - r.size.width = vr->right - vr->left; - r.size.height = vr->bottom - vr->top; - if (HIViewSetFrame (hiView, &r) != noErr) - return kResultFalse; - - if (plugView) - plugView->onSize (vr); - - return kResultTrue; - } - return kResultFalse; -} - -//-------------------------------------------------------------------------------------------------------------- -//COMPONENT_ENTRY(AUCarbonView) -//-------------------------------------------------------------------------------------------------------------- -extern "C" { - ComponentResult AUCarbonViewEntry(ComponentParameters *params, AUCarbonView *obj); - __attribute__ ((visibility ("default"))) ComponentResult AUCarbonViewEntry(ComponentParameters *params, AUCarbonView *obj) - { - return ComponentEntryPoint::Dispatch(params, obj); - } -} - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg -#endif - -/// \endcond diff --git a/vst/public.sdk/source/vst/auwrapper/aucocoaview.h b/vst/public.sdk/source/vst/auwrapper/aucocoaview.h deleted file mode 100644 index 928a8b13..00000000 --- a/vst/public.sdk/source/vst/auwrapper/aucocoaview.h +++ /dev/null @@ -1,66 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/auwrapper/aucocoaview.h -// Created by : Steinberg, 12/2007 -// Description : VST 3 -> AU Wrapper -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -/// \cond ignore - -#pragma once - -#import "aucocoaclassprefix.h" - -#import -#import - -#ifndef SMTG_AU_NAMESPACE -# error define SMTG_AU_NAMESPACE -#endif - -//----------------------------------------------------------------------------- -#define SMTG_AU_PLUGIN_NAMESPACE0(x) x -#define SMTG_AU_PLUGIN_NAMESPACE1(a, b) a##_##b -#define SMTG_AU_PLUGIN_NAMESPACE2(a, b) SMTG_AU_PLUGIN_NAMESPACE1(a,b) -#define SMTG_AU_PLUGIN_NAMESPACE(name) SMTG_AU_PLUGIN_NAMESPACE2(SMTG_AU_PLUGIN_NAMESPACE0(name), SMTG_AU_PLUGIN_NAMESPACE0(SMTG_AU_NAMESPACE)) - -//----------------------------------------------------------------------------- -// SMTG_AU_PLUGIN_NAMESPACE (SMTGAUPluginCocoaView) -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -@interface SMTG_AU_PLUGIN_NAMESPACE (SMTGAUPluginCocoaView) : NSObject -{ -} - -//----------------------------------------------------------------------------- -@end - -/// \endcond diff --git a/vst/public.sdk/source/vst/auwrapper/aucocoaview.mm b/vst/public.sdk/source/vst/auwrapper/aucocoaview.mm deleted file mode 100644 index fe1160a1..00000000 --- a/vst/public.sdk/source/vst/auwrapper/aucocoaview.mm +++ /dev/null @@ -1,229 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/auwrapper/aucocoaview.mm -// Created by : Steinberg, 12/2007 -// Description : VST 3 -> AU Wrapper -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -/// \cond ignore - -#import "aucocoaview.h" -#import "auwrapper.h" -#import "pluginterfaces/vst/ivsteditcontroller.h" -#import "pluginterfaces/gui/iplugview.h" -#import "base/source/fobject.h" - - -namespace Steinberg { -DEF_CLASS_IID(IPlugFrame) - -//-------------------------------------------------------------------------------------------------------------- -class AUPlugFrame : public FObject, public IPlugFrame -//-------------------------------------------------------------------------------------------------------------- -{ -public: - AUPlugFrame (NSView* parent) : parent (parent) {} - tresult PLUGIN_API resizeView (IPlugView* view, ViewRect* vr) - { - NSRect newSize = NSMakeRect ([parent frame].origin.x, [parent frame].origin.y, vr->right - vr->left, vr->bottom - vr->top); - [parent setFrame:newSize]; - return kResultTrue; - } - - OBJ_METHODS(AUPlugFrame, FObject) - DEF_INTERFACES_1(IPlugFrame, FObject) - REFCOUNT_METHODS(FObject) -protected: - NSView* parent; -}; - -} // namespace Steinberg - -using namespace Steinberg; - -//-------------------------------------------------------------------------------------------------------------- -@interface SMTGCocoa_NSViewWrapperForAU : NSView { -//-------------------------------------------------------------------------------------------------------------- - IPlugView* plugView; - Vst::IEditController* editController; - AudioUnit audioUnit; - FObject* dynlib; - AUPlugFrame* plugFrame; - - BOOL isAttached; -} - -- (id) initWithEditController: (Vst::IEditController*) editController audioUnit: (AudioUnit) au preferredSize: (NSSize) size; - -@end - -//-------------------------------------------------------------------------------------------------------------- -// SMTG_AU_PLUGIN_NAMESPACE (SMTGAUPluginCocoaView) -//-------------------------------------------------------------------------------------------------------------- - -//-------------------------------------------------------------------------------------------------------------- -@implementation SMTG_AU_PLUGIN_NAMESPACE (SMTGAUPluginCocoaView) - -//-------------------------------------------------------------------------------------------------------------- -- (unsigned) interfaceVersion -{ - return 0; -} - -//-------------------------------------------------------------------------------------------------------------- -- (NSString *) description -{ - return @"Cocoa View"; -} - -//-------------------------------------------------------------------------------------------------------------- -- (NSView *)uiViewForAudioUnit:(AudioUnit)inAU withSize:(NSSize)inPreferredSize -{ - Vst::IEditController* editController = 0; - UInt32 size = sizeof (Vst::IEditController*); - if (AudioUnitGetProperty (inAU, 64000, kAudioUnitScope_Global, 0, &editController, &size) != noErr) - return nil; - return [[[SMTGCocoa_NSViewWrapperForAU alloc] initWithEditController:editController audioUnit:inAU preferredSize:inPreferredSize] autorelease]; -} - -@end - -//-------------------------------------------------------------------------------------------------------------- -@implementation SMTGCocoa_NSViewWrapperForAU -//-------------------------------------------------------------------------------------------------------------- -- (id) initWithEditController: (Vst::IEditController*) _editController audioUnit: (AudioUnit) au preferredSize: (NSSize) size -{ - self = [super initWithFrame: NSMakeRect (0, 0, size.width, size.height)]; - if (self) - { - editController = _editController; - editController->addRef (); - audioUnit = au; - plugView = editController->createView (Vst::ViewType::kEditor); - if (!plugView || plugView->isPlatformTypeSupported (kPlatformTypeNSView) != kResultTrue) - { - [self dealloc]; - return nil; - } - - plugFrame = NEW AUPlugFrame (self); - plugView->setFrame (plugFrame); - - if (plugView->attached (self, kPlatformTypeNSView) != kResultTrue) - { - [self dealloc]; - return nil; - } - ViewRect vr; - if (plugView->getSize (&vr) == kResultTrue) - { - NSRect newSize = NSMakeRect (0, 0, vr.right - vr.left, vr.bottom - vr.top); - [self setFrame:newSize]; - } - - isAttached = YES; - UInt32 size = sizeof (FObject*); - if (AudioUnitGetProperty (audioUnit, 64001, kAudioUnitScope_Global, 0, &dynlib, &size) == noErr) - dynlib->addRef (); - } - return self; -} - - -//-------------------------------------------------------------------------------------------------------------- -- (void) setFrame: (NSRect) newSize -{ - [super setFrame: newSize]; - ViewRect viewRect (0, 0, newSize.size.width, newSize.size.height); - - if (plugView) - plugView->onSize (&viewRect); -} - - -//-------------------------------------------------------------------------------------------------------------- -- (BOOL)isFlipped { return YES; } - -//-------------------------------------------------------------------------------------------------------------- -- (void)viewDidMoveToSuperview -{ - if (plugView) - { - if ([self superview]) - { - if (!isAttached) - { - isAttached = plugView->attached (self, kPlatformTypeNSView) == kResultTrue; - } - } - else - { - if (isAttached) - { - plugView->removed (); - isAttached = NO; - } - } - } -} - -//-------------------------------------------------------------------------------------------------------------- -- (void) dealloc -{ - if (plugView) - { - if (isAttached) - { - plugView->setFrame (0); - plugView->removed (); - } - plugView->release (); - if (plugFrame) - plugFrame->release (); - - if (editController) - { - Steinberg::uint32 refCount= editController->addRef (); - if (refCount == 2) - editController->terminate (); - - editController->release (); - editController->release (); - editController = 0; - } - } - if (dynlib) - dynlib->release (); - [super dealloc]; -} - -@end - -/// \endcond diff --git a/vst/public.sdk/source/vst/auwrapper/auresource.r b/vst/public.sdk/source/vst/auwrapper/auresource.r deleted file mode 100644 index 32b70af6..00000000 --- a/vst/public.sdk/source/vst/auwrapper/auresource.r +++ /dev/null @@ -1,83 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/auwrapper/auresource.r -// Created by : Steinberg, 12/2007 -// Description : VST 3 -> AU Wrapper -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#include -#include - -#include "audiounitconfig.h" -/* ---------------------------------------------------------------------------------------------------------------------------------------- -// audiounitconfig.h needs the following definitions: - #define kAudioUnitVersion 0xFFFFFFFF // Version Number, needs to be in hex - #define kAudioUnitName "Steinberg: MyVST3 as AudioUnit" // Company Name + Effect Name - #define kAudioUnitDescription "My VST3 as AudioUnit" // Effect Description - #define kAudioUnitType kAudioUnitType_Effect // can be kAudioUnitType_Effect or kAudioUnitType_MusicDevice - #define kAudioUnitComponentSubType 'test' // unique id - #define kAudioUnitComponentManuf 'SMTG' // registered company id - #define kAudioUnitCarbonView 1 // if 0 no Carbon view support will be added -*/ - - -#define kAudioUnitResID_Processor 1000 -#define kAudioUnitResID_CarbonView 9000 - -//----------------------Processor---------------------------------------------- - -#define RES_ID kAudioUnitResID_Processor -#define COMP_TYPE kAudioUnitType -#define COMP_SUBTYPE kAudioUnitComponentSubType -#define COMP_MANUF kAudioUnitComponentManuf - -#define VERSION kAudioUnitVersion -#define NAME kAudioUnitName -#define DESCRIPTION kAudioUnitDescription -#define ENTRY_POINT "AUWrapperEntry" - -#include "AUResources.r" - -#if kAudioUnitCarbonView -//----------------------View---------------------------------------------- - -#define RES_ID kAudioUnitResID_CarbonView -#define COMP_TYPE kAudioUnitCarbonViewComponentType -#define COMP_SUBTYPE kAudioUnitComponentSubType -#define COMP_MANUF kAudioUnitComponentManuf - -#define VERSION kAudioUnitVersion -#define NAME "CarbonView" -#define DESCRIPTION "CarbonView" -#define ENTRY_POINT "AUCarbonViewEntry" - -#include "AUResources.r" - -#endif diff --git a/vst/public.sdk/source/vst/auwrapper/ausdk.mm b/vst/public.sdk/source/vst/auwrapper/ausdk.mm deleted file mode 100644 index 0c22aa87..00000000 --- a/vst/public.sdk/source/vst/auwrapper/ausdk.mm +++ /dev/null @@ -1,80 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/auwrapper/ausdk.mm -// Created by : Steinberg, 12/2007 -// Description : VST 3 -> AU Wrapper -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -/// \cond ignore - -#ifndef MAC_OS_X_VERSION_10_7 - #define MAC_OS_X_VERSION_10_7 1070 -#endif - -#import "PublicUtility/CAAudioChannelLayout.cpp" -#import "PublicUtility/CABundleLocker.cpp" -#import "PublicUtility/CAHostTimeBase.cpp" -#import "PublicUtility/CAStreamBasicDescription.cpp" -#import "PublicUtility/CAVectorUnit.cpp" -#import "PublicUtility/CAAUParameter.cpp" - -#import "AUPublic/AUBase/ComponentBase.cpp" -#import "AUPublic/AUBase/AUScopeElement.cpp" -#import "AUPublic/AUBase/AUOutputElement.cpp" -#import "AUPublic/AUBase/AUInputElement.cpp" -#import "AUPublic/AUBase/AUBase.cpp" - -#if !__LP64__ - #import "AUPublic/AUCarbonViewBase/AUCarbonViewBase.cpp" - #import "AUPublic/AUCarbonViewBase/AUCarbonViewControl.cpp" - #import "AUPublic/AUCarbonViewBase/AUCarbonViewDispatch.cpp" - #import "AUPublic/AUCarbonViewBase/AUControlGroup.cpp" - #import "AUPublic/AUCarbonViewBase/CarbonEventHandler.cpp" -#endif - -#import "AUPublic/Utility/AUTimestampGenerator.cpp" -#import "AUPublic/Utility/AUBuffer.cpp" -#import "AUPublic/Utility/AUBaseHelper.cpp" - -#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7 - #import "AUPublic/OtherBases/AUMIDIEffectBase.cpp" - #import "AUPublic/Utility/AUDebugDispatcher.cpp" -#else - #import "AUPublic/AUBase/AUPlugInDispatch.cpp" -#endif - -#if !CA_USE_AUDIO_PLUGIN_ONLY - #import "AUPublic/AUBase/AUDispatch.cpp" - #import "AUPublic/OtherBases/MusicDeviceBase.cpp" - #import "AUPublic/OtherBases/AUMIDIBase.cpp" - #import "AUPublic/OtherBases/AUEffectBase.cpp" -#endif - -/// \endcond diff --git a/vst/public.sdk/source/vst/auwrapper/auwrapper.h b/vst/public.sdk/source/vst/auwrapper/auwrapper.h deleted file mode 100644 index 5ff3754b..00000000 --- a/vst/public.sdk/source/vst/auwrapper/auwrapper.h +++ /dev/null @@ -1,330 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/auwrapper/auwrapper.h -// Created by : Steinberg, 12/2007 -// Description : VST 3 -> AU Wrapper -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -/** -*************************** -\page auwrapper AudioUnit Wrapper -*************************** -\section AUIntroduction Introduction -*************************** -The VST 3 SDK comes with an AudioUnit wrapper, which can wrap one VST 3 Audio Processor and Edit Controller as an AudioUnit effect/instrument. - -The wrapper is a small dynamic library which loads the VST 3 Plug-in. -As AudioUnits store some important information in their resource fork, this library must be compiled for every VST 3 Plug-in. -\n\n -*************************** -\section AUhowdoesitwork How does it work ? -*************************** - -- build the auwrapper project (public.sdk/source/vst/auwrapper/auwrapper.xcodeproj) -- create a copy of the again AU wrapper example project directory (public.sdk/source/vst/auwrapper/again/) -- rename the copy to your needs -- edit the target settings of the project and change - - Product Name - - Library search path so that it points to the directory where libauwrapper.a exists - - architecture setting so that it only includes architectures the VST 3 Plug-in supports - -- search in the project for AUWRAPPER_CHANGE and change the settings to your needs, especially in : - - edit audiounitconfig.h see comments there - - edit Info.plist see comments there -- edit the "Make Links Script" for easier debugging/development -- build your project -- done... that is all! - -For the release version, you must place a copy or an alias of your VST 3 Plug-in in the resource folder of the bundle named "plugin.vst3" - - */ -/// \cond ignore - -#pragma once - -#if CA_USE_AUDIO_PLUGIN_ONLY -#include "AudioUnits/AUPublic/AUBase/AUBase.h" -#define AUWRAPPER_BASE_CLASS AUBase -#else -#include "AudioUnits/AUPublic/OtherBases/MusicDeviceBase.h" -#define AUWRAPPER_BASE_CLASS MusicDeviceBase -#endif -#include "pluginterfaces/vst/ivstaudioprocessor.h" -#include "pluginterfaces/vst/ivsteditcontroller.h" -#include "pluginterfaces/vst/ivstprocesscontext.h" -#include "pluginterfaces/vst/ivstunits.h" -#include "public.sdk/source/vst/hosting/parameterchanges.h" -#include "public.sdk/source/vst/hosting/processdata.h" -#include "public.sdk/source/vst/hosting/eventlist.h" -#include "base/source/timer.h" -#include "base/source/tdictionary.h" -#include "base/source/tarray.h" -#include "base/source/fstring.h" -#include "base/source/fthread.h" -#include -#include - -namespace Steinberg { -namespace Vst { - -//------------------------------------------------------------------------ -typedef struct MIDIMessageInfoStruct { - UInt8 status; - UInt8 channel; - UInt8 data1; - UInt8 data2; - UInt32 startFrame; -} MIDIMessageInfoStruct; - -//------------------------------------------------------------------------ -class MIDIOutputCallbackHelper -{ -public: - MIDIOutputCallbackHelper () - { - mMIDIMessageList.reserve (16); - mMIDICallbackStruct.midiOutputCallback = NULL; - } - virtual ~MIDIOutputCallbackHelper () {}; - - void SetCallbackInfo (AUMIDIOutputCallback callback, void* userData) - { - mMIDICallbackStruct.midiOutputCallback = callback; - mMIDICallbackStruct.userData = userData; - } - - void AddEvent (UInt8 status, UInt8 channel, UInt8 data1, UInt8 data2, UInt32 inStartFrame) - { - MIDIMessageInfoStruct info = {status, channel, data1, data2, inStartFrame}; - mMIDIMessageList.push_back (info); - } - - void FireAtTimeStamp (const AudioTimeStamp& inTimeStamp) - { - if (!mMIDIMessageList.empty () && mMIDICallbackStruct.midiOutputCallback != 0) - { - // synthesize the packet list and call the MIDIOutputCallback - // iterate through the vector and get each item - std::vector::iterator myIterator; - MIDIPacketList* pktlist = PacketList (); - - for (myIterator = mMIDIMessageList.begin (); myIterator != mMIDIMessageList.end (); myIterator++) - { - MIDIMessageInfoStruct item = *myIterator; - - MIDIPacket* pkt = MIDIPacketListInit (pktlist); - bool tooBig = false; - Byte data[3] = { item.status, item.data1, item.data2 }; - if ((pkt = MIDIPacketListAdd (pktlist, sizeof (mBuffersAllocated), pkt, item.startFrame, 4, const_cast(data))) == NULL) - tooBig = true; - - if (tooBig) - { // send what we have and then clear the buffer and send again - // issue the callback with what we got - OSStatus result = mMIDICallbackStruct.midiOutputCallback (mMIDICallbackStruct.userData, &inTimeStamp, 0, pktlist); - if (result != noErr) - printf ("error calling output callback: %d", (int) result); - - // clear stuff we've already processed, and fire again - mMIDIMessageList.erase (mMIDIMessageList.begin (), myIterator); - this->FireAtTimeStamp (inTimeStamp); - return; - } - } - // fire callback - OSStatus result = mMIDICallbackStruct.midiOutputCallback (mMIDICallbackStruct.userData, &inTimeStamp, 0, pktlist); - if (result != noErr) - printf ("error calling output callback: %d", (int) result); - - mMIDIMessageList.clear (); - } - } - -protected: - typedef std::vector MIDIMessageList; - -private: - MIDIPacketList* PacketList () {return (MIDIPacketList*)mBuffersAllocated;} - - Byte mBuffersAllocated[1024]; - AUMIDIOutputCallbackStruct mMIDICallbackStruct; - MIDIMessageList mMIDIMessageList; -}; - - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ -class AUWrapper -: public AUWRAPPER_BASE_CLASS -, public IComponentHandler -, public ITimerCallback -{ -public: - AUWrapper (ComponentInstanceRecord* ci); - ~AUWrapper (); - - //---ComponentBase--------------------- - ComponentResult Version (); - void PostConstructor (); - - //---AUBase----------------------------- - void Cleanup (); - ComponentResult Initialize (); - AUElement* CreateElement (AudioUnitScope scope, AudioUnitElement element); - UInt32 SupportedNumChannels (const AUChannelInfo** outInfo); - bool StreamFormatWritable (AudioUnitScope scope, AudioUnitElement element); - ComponentResult ChangeStreamFormat (AudioUnitScope inScope, AudioUnitElement inElement, const CAStreamBasicDescription& inPrevFormat, const CAStreamBasicDescription& inNewFormat); - ComponentResult SetConnection (const AudioUnitConnection& inConnection); - ComponentResult GetParameterInfo (AudioUnitScope inScope, AudioUnitParameterID inParameterID, AudioUnitParameterInfo& outParameterInfo); - ComponentResult SetParameter (AudioUnitParameterID inID, AudioUnitScope inScope, AudioUnitElement inElement, AudioUnitParameterValue inValue, UInt32 inBufferOffsetInFrames); - - ComponentResult SaveState (CFPropertyListRef* outData); - ComponentResult RestoreState (CFPropertyListRef inData); - - ComponentResult Render (AudioUnitRenderActionFlags &ioActionFlags, const AudioTimeStamp &inTimeStamp, UInt32 inNumberFrames); - void processOutputEvents (const AudioTimeStamp &inTimeStamp); - - int GetNumCustomUIComponents (); - void GetUIComponentDescs (ComponentDescription* inDescArray); - - ComponentResult GetPropertyInfo (AudioUnitPropertyID inID, AudioUnitScope inScope, AudioUnitElement inElement, UInt32 &outDataSize, Boolean &outWritable); - ComponentResult GetProperty (AudioUnitPropertyID inID, AudioUnitScope inScope, AudioUnitElement inElement, void* outData); - ComponentResult SetProperty (AudioUnitPropertyID inID, AudioUnitScope inScope, AudioUnitElement inElement, const void* inData, UInt32 inDataSize); - - Float64 GetLatency (); - Float64 GetTailTime (); - - //---Factory presets - OSStatus GetPresets (CFArrayRef* outData) const; - OSStatus NewFactoryPresetSet (const AUPreset& inNewFactoryPreset); - - //---MusicDeviceBase------------------------- - ComponentResult StartNote (MusicDeviceInstrumentID inInstrument, MusicDeviceGroupID inGroupID, NoteInstanceID* outNoteInstanceID, UInt32 inOffsetSampleFrame, const MusicDeviceNoteParams &inParams); - ComponentResult StopNote (MusicDeviceGroupID inGroupID, NoteInstanceID inNoteInstanceID, UInt32 inOffsetSampleFrame); - OSStatus GetInstrumentCount (UInt32 &outInstCount) const; - - //---AUMIDIBase------------------------------ - OSStatus HandleNonNoteEvent (UInt8 status, UInt8 channel, UInt8 data1, UInt8 data2, UInt32 inStartFrame); - - //---custom---------------------------------- - void setControllerParameter (ParamID pid, ParamValue value); - - // return for a given midiChannel the unitID and the ProgramListID - bool getProgramListAndUnit (int32 midiChannel, UnitID& unitId, ProgramListID& programListId); - - // restore preset state, add StateType "Project" to stream if loading from project - ComponentResult restoreState (CFPropertyListRef inData, bool fromProject); - - //------------------------------------------------------------------------ -#if !CA_USE_AUDIO_PLUGIN_ONLY - static ComponentResult ComponentEntryDispatch (ComponentParameters* params, AUWrapper* This); -#endif - //------------------------------------------------------------------------ - static CFBundleRef gBundleRef; - //------------------------------------------------------------------------ - DECLARE_FUNKNOWN_METHODS - -protected: - //---from IComponentHandler------------------- - tresult PLUGIN_API beginEdit (ParamID tag); - tresult PLUGIN_API performEdit (ParamID tag, ParamValue valueNormalized); - tresult PLUGIN_API endEdit (ParamID tag); - tresult PLUGIN_API restartComponent (int32 flags); - - //---from ITimerCallback---------------------- - void onTimer (Timer* timer); - - // internal helpers - double getSampleRate () const { return sampleRate; } - void updateProcessContext (); - void syncParameterValues (); - void cacheParameterValues (); - void clearParameterValueCache (); - - virtual IPluginFactory* getFactory (); - void loadVST3Module (); - void unloadVST3Module (); - bool validateChannelPair (int inChannelsIn, int inChannelsOut, const AUChannelInfo* info, UInt32 numChanInfo) const; - - - IAudioProcessor* audioProcessor; - IEditController* editController; - IMidiMapping* midiMapping; - - Timer* timer; - - HostProcessData processData; - ParameterChanges processParamChanges; - ParameterChanges outputParamChanges; - ParameterChangeTransfer transferParamChanges; - ParameterChangeTransfer outputParamTransfer; - ProcessContext processContext; - EventList eventList; - - TDictionary unitInfos; - TArray clumpGroups; - TDictionary cachedParameterInfos; - FLock parameterCacheChanging; - - NoteInstanceID noteCounter; - double sampleRate; - ParamID bypassParamID; - - AUPreset* presets; - int32 numPresets; - ParamID factoryProgramChangedID; - - bool isInstrument; - bool isBypassed; - - AUParameterListenerRef paramListenerRef; - static const int32 kMaxProgramChangeParameters = 16; - ParamID programChangeParameters[kMaxProgramChangeParameters]; // for each midi channel - - MIDIOutputCallbackHelper mCallbackHelper; - EventList outputEvents; -}; - -//-------------------------------------------------------------------------------------------------------------- -class AutoreleasePool -{ -public: - AutoreleasePool () { ap = [[NSAutoreleasePool alloc] init]; } - ~AutoreleasePool () { [ap drain]; } -//-------------------------------------------------------------------------------------------------------------- -protected: - NSAutoreleasePool* ap; -}; - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg - -/// \endcond diff --git a/vst/public.sdk/source/vst/auwrapper/auwrapper.mm b/vst/public.sdk/source/vst/auwrapper/auwrapper.mm deleted file mode 100644 index 613d5b22..00000000 --- a/vst/public.sdk/source/vst/auwrapper/auwrapper.mm +++ /dev/null @@ -1,2477 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/auwrapper/auwrapper.mm -// Created by : Steinberg, 12/2007 -// Description : VST 3 -> AU Wrapper -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -/// \cond ignore - -/* - -Things to do : - - Parameter Mapping could be better (indexed stuff), but needs work if we want to have this - - Speaker Arrangement -> Channel Layout (partially done, just doesn't work always in Logic 8) - - dynamic Bus management - -*/ - -#include "auwrapper.h" -#include "aucocoaview.h" -#include "NSDataIBStream.h" -#include "pluginterfaces/gui/iplugview.h" -#include "pluginterfaces/base/ustring.h" -#include "pluginterfaces/vst/ivstmidicontrollers.h" -#include "pluginterfaces/vst/vsttypes.h" -#include "pluginterfaces/vst/vstpresetkeys.h" -#include "public.sdk/source/vst/hosting/eventlist.h" -#include "public.sdk/source/vst/hosting/processdata.h" -#include "public.sdk/source/vst/hosting/parameterchanges.h" -#include "public.sdk/source/vst/hosting/hostclasses.h" -#include "public.sdk/source/vst/vsteditcontroller.h" -#include "base/source/fdynlib.h" -#include "base/source/fstring.h" -#include -#if !__LP64__ -#include -#endif -#include -#include -#include -#if !CA_USE_AUDIO_PLUGIN_ONLY -#include "CAXException.h" -#endif - -#define SMTG_MAKE_STRING_PRIVATE_DONT_USE(x) # x -#define SMTG_MAKE_STRING(x) SMTG_MAKE_STRING_PRIVATE_DONT_USE(x) - -typedef bool (*bundleEntryPtr)(CFBundleRef); -typedef bool (*bundleExitPtr)(void); - -#include - -// we ignore for the moment that the NSAddImage functions are deprecated -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" - -static bool CopyProcessPath (Steinberg::String& name) -{ - Dl_info info; - if (dladdr ((const void*)CopyProcessPath, &info)) - { - if (info.dli_fname) - { - name.assign (info.dli_fname); - #ifdef UNICODE - name.toWideString (); - #endif - return true; - } - } - return false; -} - -namespace Steinberg { - -//-------------------------------------------------------------------------------------------------------------- -DEF_CLASS_IID(IPluginBase) -DEF_CLASS_IID(IBStream) -DEF_CLASS_IID(IPlugView) -DEF_CLASS_IID(IPluginFactory2) - -//-------------------------------------------------------------------------------------------------------------- -class VST3DynLibrary : public FDynLibrary -{ -public: - VST3DynLibrary () : bundleEntryCalled (false) { gInstance = this; } - - ~VST3DynLibrary () - { - if (isLoaded ()) - { - if (bundleEntryCalled) - { - if (bundleExitPtr bundleExit = (bundleExitPtr)getProcAddress ("bundleExit")) - bundleExit (); - } - - CFRelease ((CFBundleRef)instance); - instance = 0; - isloaded = false; - } - gInstance = 0; - } - - bool init (const tchar* path) - { - if (isLoaded ()) - return true; - - isBundle = false; - - Steinberg::String name (path); - - if (name.getChar16 (0) != STR('/')) // no absoltue path - { - Steinberg::String p; - if (CopyProcessPath (p)) - { - Steinberg::int32 index = p.findLast (STR ('/')); - p.remove (index+1); - name = p + name; - } - } - - CFStringRef fsString = (CFStringRef)name.toCFStringRef (); - CFURLRef url = CFURLCreateWithFileSystemPath (NULL, fsString, kCFURLPOSIXPathStyle, true); - if (url) - { - CFBundleRef bundle = CFBundleCreate (NULL, url); - if (bundle) - { - bundleEntryPtr bundleEntry = (bundleEntryPtr)CFBundleGetFunctionPointerForName (bundle, CFSTR("bundleEntry")); - if (bundleEntry) - bundleEntryCalled = bundleEntry (bundle); - - if (bundleEntryCalled) - { - isBundle = true; - isloaded = true; - instance = (void*)bundle; - } - else - CFRelease (bundle); - } - CFRelease (url); - } - CFRelease (fsString); - - return isLoaded (); - } - - static VST3DynLibrary* gInstance; -protected: - bool bundleEntryCalled; -}; - -VST3DynLibrary* VST3DynLibrary::gInstance = 0; - -namespace Vst { - -const ParamID kNoParamId = std::numeric_limits< ParamID >::max (); - -//-------------------------------------------------------------------------------------------------------------- -DEF_CLASS_IID(IEventList) -DEF_CLASS_IID(IHostApplication) -DEF_CLASS_IID(IParameterChanges) -DEF_CLASS_IID(IParamValueQueue) -DEF_CLASS_IID(IMessage) -DEF_CLASS_IID(IAttributeList) -DEF_CLASS_IID(IComponent) -DEF_CLASS_IID(IComponentHandler) -DEF_CLASS_IID(IAudioProcessor) -DEF_CLASS_IID(IEditController) -DEF_CLASS_IID(IMidiMapping) -DEF_CLASS_IID(IUnitInfo) -DEF_CLASS_IID(IConnectionPoint) -DEF_CLASS_IID (IVst3ToVst2Wrapper) -DEF_CLASS_IID (IVst3ToAUWrapper) - -//-------------------------------------------------------------------------------------------- -class SpeakerArrangementBase -{ -public: - SpeakerArrangementBase () - { - channelLayout.mChannelBitmap = 0; - channelLayout.mChannelLayoutTag = 0; - channelLayout.mNumberChannelDescriptions = 0; - } - - OSStatus setNumChannels (int32 numChannels) - { - switch (numChannels) - { - case 1: channelLayout.mChannelLayoutTag = kAudioChannelLayoutTag_Mono; break; - case 2: channelLayout.mChannelLayoutTag = kAudioChannelLayoutTag_Stereo; break; - case 6: channelLayout.mChannelLayoutTag = kAudioChannelLayoutTag_AudioUnit_5_1; break; - default: return kAudioUnitErr_InvalidProperty; - } - return noErr; - } - -protected: - AudioChannelLayout channelLayout; -}; - -//-------------------------------------------------------------------------------------------- -class MultiChannelOutputElement : public AUOutputElement, public SpeakerArrangementBase -{ -public: - MultiChannelOutputElement (AUBase *audioUnit) : AUOutputElement (audioUnit) {} - - UInt32 GetChannelLayoutTags (AudioChannelLayoutTag* outLayoutTagsPtr) - { - if (AudioChannelLayoutTag_GetNumberOfChannels (channelLayout.mChannelLayoutTag) <= 2) - return 0; - - if (outLayoutTagsPtr) - *outLayoutTagsPtr = channelLayout.mChannelLayoutTag; - return 1; - } - - UInt32 GetAudioChannelLayout (AudioChannelLayout *outMapPtr, Boolean& outWritable) - { - if (AudioChannelLayoutTag_GetNumberOfChannels (channelLayout.mChannelLayoutTag) <= 2) - return 0; - - if (outMapPtr) - *outMapPtr = channelLayout; - outWritable = false; - return sizeof (AudioChannelLayout); - } - - OSStatus SetAudioChannelLayout (const AudioChannelLayout &layout) - { - return kAudioUnitErr_InvalidProperty; - } - - OSStatus SetStreamFormat (const CAStreamBasicDescription &desc) - { - OSStatus err = setNumChannels (desc.NumberChannels ()); - if (err != noErr) - return err; - return AUOutputElement::SetStreamFormat (desc); - } -}; - -//-------------------------------------------------------------------------------------------- -class MultiChannelInputElement : public AUInputElement, public SpeakerArrangementBase -{ -public: - MultiChannelInputElement (AUBase *audioUnit) : AUInputElement (audioUnit) {} - - UInt32 GetChannelLayoutTags (AudioChannelLayoutTag* outLayoutTagsPtr) - { - if (AudioChannelLayoutTag_GetNumberOfChannels (channelLayout.mChannelLayoutTag) <= 2) - return 0; - - if (outLayoutTagsPtr) - *outLayoutTagsPtr = channelLayout.mChannelLayoutTag; - return 1; - } - - UInt32 GetAudioChannelLayout (AudioChannelLayout *outMapPtr, Boolean& outWritable) - { - if (AudioChannelLayoutTag_GetNumberOfChannels (channelLayout.mChannelLayoutTag) <= 2) - return 0; - - if (outMapPtr) - memcpy (outMapPtr, &channelLayout, sizeof (AudioChannelLayout)); - outWritable = false; - return sizeof (AudioChannelLayout); - } - - OSStatus SetAudioChannelLayout (const AudioChannelLayout &layout) - { - return kAudioUnitErr_InvalidProperty; - } - - OSStatus SetStreamFormat (const CAStreamBasicDescription &desc) - { - OSStatus err = setNumChannels (desc.NumberChannels ()); - if (err != noErr) - return err; - return AUInputElement::SetStreamFormat (desc); - } -}; - -//-------------------------------------------------------------------------------------------------------------- -static CFStringRef createCFStringFromString128 (const String128& string) -{ - UString128 str (string); - return CFStringCreateWithCharacters (0, (const UniChar*)string, str.getLength ()); -} - -//-------------------------------------------------------------------------------------------------------------- -static void createString128FromCFString (CFStringRef inString, String128& outString) -{ - CFStringGetCharacters (inString, CFRangeMake (0, std::max (128, CFStringGetLength (inString))), (UniChar*)outString); -} - -//-------------------------------------------------------------------------------------------------------------- -static CFBundleRef GetBundleFromExecutable (const char* filepath) -{ - AutoreleasePool ap; - NSString* execStr = [NSString stringWithCString:filepath encoding:NSUTF8StringEncoding]; - NSString* macOSStr = [execStr stringByDeletingLastPathComponent]; - NSString* contentsStr = [macOSStr stringByDeletingLastPathComponent]; - NSString* bundleStr = [contentsStr stringByDeletingLastPathComponent]; - return CFBundleCreate (0, (CFURLRef)[NSURL fileURLWithPath:bundleStr isDirectory:YES]); - -} - -//-------------------------------------------------------------------------------------------------------------- -static CFBundleRef GetCurrentBundle () -{ - Dl_info info; - if (dladdr ((const void*)GetCurrentBundle, &info)) - { - if (info.dli_fname) - { - return GetBundleFromExecutable (info.dli_fname); - } - } - return 0; -} - -//-------------------------------------------------------------------------------------------------------------- -CFBundleRef AUWrapper::gBundleRef = 0; -static CFIndex gBundleRefCount = 0; -static AUChannelInfo* channelInfos = 0; - -//-------------------------------------------------------------------------------------------------------------- -static void initBundleRef () -{ - if (AUWrapper::gBundleRef == 0) - { - AUWrapper::gBundleRef = GetCurrentBundle (); - gBundleRefCount = CFGetRetainCount (AUWrapper::gBundleRef); - } - else - CFRetain (AUWrapper::gBundleRef); -} - -//-------------------------------------------------------------------------------------------------------------- -static void releaseBundleRef () -{ - CFIndex currentCount = CFGetRetainCount (AUWrapper::gBundleRef); - CFRelease (AUWrapper::gBundleRef); - if (currentCount == gBundleRefCount) - AUWrapper::gBundleRef = 0; -} - -//-------------------------------------------------------------------------------------------------------------- -class AUHostApplication : public HostApplication - , public IVst3ToAUWrapper -{ -public: - virtual tresult PLUGIN_API getName (String128 name) - { - String str ("VST3-AU Wrapper"); - str.copyTo (name, 0, 127); - return kResultTrue; - } - - DEFINE_INTERFACES - DEF_INTERFACE (Vst::IVst3ToAUWrapper) - END_DEFINE_INTERFACES (HostApplication) - REFCOUNT_METHODS(HostApplication) -}; - -static AUHostApplication gHostApp; - -//-------------------------------------------------------------------------------------------------------------- -static void paramChangedListenerProc (void* inRefCon, void* inObject, const AudioUnitParameter* inParameter, AudioUnitParameterValue inValue) -{ - AUWrapper* auWrapper = (AUWrapper*)inRefCon; - if (inParameter && inObject != inRefCon) - auWrapper->setControllerParameter(inParameter->mParameterID, inValue); -} - - -//-------------------------------------------------------------------------------------------------------------- -IMPLEMENT_FUNKNOWN_METHODS(AUWrapper, IComponentHandler, IComponentHandler::iid) -//-------------------------------------------------------------------------------------------------------------- -AUWrapper::AUWrapper (ComponentInstanceRecord* ci) -: AUWRAPPER_BASE_CLASS (ci, 0, 0) -, audioProcessor (0) -, editController (0) -, sampleRate (44100) -, midiMapping (0) -, timer (0) -, noteCounter (0) -, bypassParamID (-1) -, factoryProgramChangedID (-1) -, paramListenerRef (0) -, presets (0) -, numPresets (0) -, isInstrument (false) -, isBypassed (false) -{ - FUNKNOWN_CTOR - AutoreleasePool ap; - initBundleRef (); - - for (int32 i = 0; i < kMaxProgramChangeParameters; i++) - programChangeParameters[i] = kNoParamId; - - processData.processContext = &processContext; - processData.inputParameterChanges = &processParamChanges; - processData.outputParameterChanges = &outputParamChanges; - eventList.setMaxSize (128); - outputEvents.setMaxSize (128); - processData.inputEvents = &eventList; - processData.outputEvents = &outputEvents; - - loadVST3Module (); - - FUnknownPtr factory (getFactory ()); - - if (factory) - { - // find first audio processor class - for (int32 i = 0; i < factory->countClasses (); i++) - { - PClassInfo2 ci; - if (factory->getClassInfo2 (i, &ci) == kResultTrue) - { - if (strcmp (ci.category, kVstAudioEffectClass) == 0) - { - if (factory->createInstance (ci.cid, IAudioProcessor::iid, (void**)&audioProcessor) == kResultTrue) - { - ConstString plugCategory (ci.subCategories); - if (plugCategory.findFirst ("Instrument", -1, ConstString::kCaseInsensitive) >= 0) - isInstrument = true; - break; - } - } - } - } - } - if (audioProcessor) - { - if (FUnknownPtr (audioProcessor)->initialize ((HostApplication*)&gHostApp) != kResultTrue) - return; - - if (audioProcessor->queryInterface (IEditController::iid, (void**)&editController) != kResultTrue) - { - FUnknownPtr component (audioProcessor); - if (component) - { - TUID ccid; - if (component->getControllerClassId (ccid) == kResultTrue) - { - if (factory->createInstance (ccid, IEditController::iid, (void**)&editController) == kResultTrue) - { - if (editController->initialize ((HostApplication*)&gHostApp) != kResultTrue) - { - editController->release (); - editController = 0; - return; - } - - FUnknownPtr controllerConnectionPoint (editController); - FUnknownPtr processorConnectionPoint (audioProcessor); - if (controllerConnectionPoint && processorConnectionPoint) - { - controllerConnectionPoint->connect (processorConnectionPoint); - processorConnectionPoint->connect (controllerConnectionPoint); - } - - NSMutableData* processorData = [[[NSMutableData alloc] init] autorelease]; - NSMutableDataIBStream stream (processorData); - if (FUnknownPtr (audioProcessor)->getState (&stream) == kResultTrue) - { - stream.seek (0, IBStream::kIBSeekSet); - editController->setComponentState (&stream); - } - } - } - } - } - if (editController) - { - editController->setComponentHandler (this); - // initialize buses - FUnknownPtr component (audioProcessor); - int32 inputBusCount = component->getBusCount (kAudio, kInput); - int32 outputBusCount = component->getBusCount (kAudio, kOutput); - CreateElements (); - Inputs ().SetNumberOfElements (inputBusCount); - Outputs ().SetNumberOfElements (outputBusCount); - - SpeakerArrangement sa; - for (int32 inputNo = 0; inputNo < inputBusCount; inputNo++) - { - MultiChannelInputElement* element = dynamic_cast(Inputs ().GetIOElement (inputNo)); - if (element == 0) - continue; - if (audioProcessor->getBusArrangement (kInput, inputNo, sa) == kResultTrue) - { - CAStreamBasicDescription streamDesc (element->GetStreamFormat ()); - streamDesc.ChangeNumberChannels (SpeakerArr::getChannelCount (sa), false); - element->SetStreamFormat (streamDesc); - } - BusInfo info = {0}; - if (component->getBusInfo (kAudio, kInput, inputNo, info) == kResultTrue) - { - String busName (info.name); - CFStringRef busNameString = (CFStringRef)busName.toCFStringRef (); - element->SetName (busNameString); - CFRelease (busNameString); - } - component->activateBus (kAudio, kInput, inputNo, false); - } - for (int32 outputNo = 0; outputNo < outputBusCount; outputNo++) - { - MultiChannelOutputElement* element = dynamic_cast(Outputs ().GetIOElement (outputNo)); - if (element == 0) - continue; - if (audioProcessor->getBusArrangement (kOutput, outputNo, sa) == kResultTrue) - { - CAStreamBasicDescription streamDesc (element->GetStreamFormat ()); - streamDesc.ChangeNumberChannels (SpeakerArr::getChannelCount (sa), false); - element->SetStreamFormat (streamDesc); - } - BusInfo info = {0}; - if (component->getBusInfo (kAudio, kOutput, outputNo, info) == kResultTrue) - { - String busName (info.name); - CFStringRef busNameString = (CFStringRef)busName.toCFStringRef (); - element->SetName (busNameString); - CFRelease (busNameString); - } - component->activateBus (kAudio, kOutput, outputNo, true); - } - processData.prepare (*component); - - // initialize parameters - syncParameterValues (); - cacheParameterValues (); - - editController->queryInterface (IMidiMapping::iid, (void**)&midiMapping); - - transferParamChanges.setMaxParameters (500); - outputParamTransfer.setMaxParameters (500); - - timer = Timer::create (this, 20); - } - } - if (factory) - factory->release (); -} - -//-------------------------------------------------------------------------------------------------------------- -AUWrapper::~AUWrapper () -{ - AutoreleasePool ap; - if (timer) - timer->release (); - if (paramListenerRef) - AUListenerDispose (paramListenerRef); - if (audioProcessor) - { - FUnknownPtr combined (audioProcessor); - if (!combined) - { - FUnknownPtr controllerConnectionPoint (editController); - FUnknownPtr processorConnectionPoint (audioProcessor); - if (controllerConnectionPoint && processorConnectionPoint) - { - controllerConnectionPoint->disconnect (processorConnectionPoint); - processorConnectionPoint->disconnect (controllerConnectionPoint); - } - } - } - if (midiMapping) - { - midiMapping->release (); - midiMapping = 0; - } - if (editController) - { - editController->setComponentHandler (0); - uint32 refCount= editController->addRef (); - if (refCount == 2) - editController->terminate (); - - editController->release (); - editController->release (); - editController = 0; - } - - clearParameterValueCache (); - - if (audioProcessor) - { - FUnknownPtr (audioProcessor)->terminate (); - audioProcessor->release (); - audioProcessor = 0; - } - unloadVST3Module (); - releaseBundleRef (); - - if (presets) - delete presets; - - FUNKNOWN_DTOR -} - -//-------------------------------------------------------------------------------------------------------------- -void AUWrapper::loadVST3Module () -{ - if (VST3DynLibrary::gInstance == 0) - { - if (gBundleRef) - { - String pluginPath; - CFStringRef pluginNameStr = (CFStringRef)CFBundleGetValueForInfoDictionaryKey (gBundleRef, CFSTR("VST3 Plug-in")); - if (!pluginNameStr) - { - NSURL* pluginUrl = (NSURL*)CFBundleCopyResourceURL (gBundleRef, CFSTR("plugin"), CFSTR("vst3"), NULL); - if (!pluginUrl) - { - NSLog (@"VST3 Plug-in not defined in Info Dictionary and not included in bundle"); - return; - } - pluginPath.fromCFStringRef ((CFStringRef)[pluginUrl path]); - [pluginUrl release]; - } - else - { - pluginPath.fromCFStringRef (pluginNameStr); - if (!pluginPath.getChar (0) != STR('/')) - { - FSRef fsRef; - if (FSFindFolder (kLocalDomain, kAudioPlugInsFolderType, false, &fsRef) == noErr) - { - NSURL* url = (NSURL*)CFURLCreateFromFSRef (0, &fsRef); - if (url) - { - String basePath ([[url path] UTF8String]); - basePath.toWideString (kCP_Utf8); - pluginPath.insertAt (0, STR("/VST3/")); - pluginPath.insertAt (0, basePath); - [url release]; - } - } - } - } - - new VST3DynLibrary (); - if (pluginPath.isEmpty () || !VST3DynLibrary::gInstance->init (pluginPath)) - { - VST3DynLibrary::gInstance->release (); - return; - } - } - } - else - VST3DynLibrary::gInstance->addRef (); -} - -//-------------------------------------------------------------------------------------------------------------- -void AUWrapper::unloadVST3Module () -{ - if (VST3DynLibrary::gInstance) - { - VST3DynLibrary::gInstance->release (); - } -} - -//-------------------------------------------------------------------------------------------------------------- -IPluginFactory* AUWrapper::getFactory () -{ - if (VST3DynLibrary::gInstance) - { - GetFactoryProc getPlugFactory = (GetFactoryProc)VST3DynLibrary::gInstance->getProcAddress ("GetPluginFactory"); - if (getPlugFactory) - return getPlugFactory (); - } - return 0; -} - -//-------------------------------------------------------------------------------------------------------------- -// ComponentBase -ComponentResult AUWrapper::Version () -{ - AutoreleasePool ap; - NSString* versionString = (NSString*)CFBundleGetValueForInfoDictionaryKey (gBundleRef, CFSTR("AudioUnit Version")); - if (versionString) - { - int version = 0; - if (sscanf ([versionString UTF8String], "%x", &version) == 1) - return version; - } - return 0xFFFFFFFF; -} - -//-------------------------------------------------------------------------------------------------------------- -void AUWrapper::PostConstructor () -{ - AUWRAPPER_BASE_CLASS::PostConstructor (); -} - -//-------------------------------------------------------------------------------------------------------------- -static SpeakerArrangement numChannelsToSpeakerArrangement (UInt32 numChannels) -{ - switch (numChannels) - { - case 1: return SpeakerArr::kMono; - case 2: return SpeakerArr::kStereo; - case 6: return SpeakerArr::k51; - } - return 0; -} - -//-------------------------------------------------------------------------------------------------------------- -ComponentResult AUWrapper::Initialize () -{ - if (audioProcessor && editController) - { - // match speaker arrangement with AU stream format - FUnknownPtr component (audioProcessor); - int32 inputBusCount = component->getBusCount (kAudio, kInput); - int32 outputBusCount = component->getBusCount (kAudio, kOutput); - - SupportedNumChannels (0); // initialize channelInfos - if (channelInfos) - { - int32 maxBusCount = std::max (inputBusCount, outputBusCount); - for (int32 i = 0; i < maxBusCount; i++) - { - int32 inChannelCount = 0; - int32 outChannelCount = 0; - if (inputBusCount > i) - inChannelCount = Inputs ().GetIOElement (i)->GetStreamFormat ().NumberChannels (); - if (outputBusCount > i) - outChannelCount = Outputs ().GetIOElement (i)->GetStreamFormat ().NumberChannels (); - if (!validateChannelPair (inChannelCount, outChannelCount, channelInfos, SupportedNumChannels (0))) - return kAudioUnitErr_FailedInitialization; - } - } - - SpeakerArrangement inputs[inputBusCount]; - SpeakerArrangement outputs[outputBusCount]; - for (int32 element = 0; element < inputBusCount; element++) - { - const CAStreamBasicDescription desc = Inputs ().GetIOElement (element)->GetStreamFormat (); - inputs[element] = numChannelsToSpeakerArrangement (desc.NumberChannels ()); - } - for (int32 element = 0; element < outputBusCount; element++) - { - const CAStreamBasicDescription desc = Outputs ().GetIOElement (element)->GetStreamFormat (); - outputs[element] = numChannelsToSpeakerArrangement (desc.NumberChannels ()); - } - if (audioProcessor->setBusArrangements(inputs, inputBusCount, outputs, outputBusCount) != kResultTrue) - { - return kAudioUnitErr_FailedInitialization; - } - - // After set Bus Arrangement, the channelbuffers may need to be reallocated -> hence the second prepare! - processData.prepare (*component); - - ProcessSetup ps; - ps.sampleRate = getSampleRate (); - ps.maxSamplesPerBlock = GetMaxFramesPerSlice (); - ps.symbolicSampleSize = kSample32; - ps.processMode = kRealtime; - audioProcessor->setupProcessing (ps); - - component->setActive (true); - - audioProcessor->setProcessing (true); - - if (paramListenerRef == 0) - { - OSStatus status = AUListenerCreate (paramChangedListenerProc, this, CFRunLoopGetCurrent (), kCFRunLoopDefaultMode, 0.2, ¶mListenerRef); - ASSERT (status == noErr) - if (paramListenerRef) - { - AudioUnitParameter sPar; - sPar.mAudioUnit = GetComponentInstance (); - sPar.mParameterID = 0; - sPar.mElement = 0; - sPar.mScope = kAudioUnitScope_Global; - - std::vector programParameters; - - // for each VST3 parameter - for (int32 i = 0; i < editController->getParameterCount (); i++) - { - ParameterInfo pi = {0}; - editController->getParameterInfo (i, pi); - - // do not register bypass - if ((pi.flags & ParameterInfo::kIsBypass) != 0) - { - continue; - } - - sPar.mParameterID = pi.id; - status = AUListenerAddParameter (paramListenerRef, 0, &sPar); - ASSERT (status == noErr) - - if ((pi.flags & ParameterInfo::kIsProgramChange) != 0) - { - programParameters.push_back (pi); - } - } - - // assign programChanges - for (int32 midiChannel = 0; midiChannel < kMaxProgramChangeParameters; midiChannel++) - { - programChangeParameters[midiChannel] = kNoParamId; - UnitID unitId; - ProgramListID programListId; - if (getProgramListAndUnit (midiChannel, unitId, programListId)) - { - for (int32 i = 0; i < (int32)programParameters.size (); i++) - { - const ParameterInfo& paramInfo = programParameters.at (i); - if (paramInfo.unitId == unitId) - { - programChangeParameters[midiChannel] = paramInfo.id; - break; - } - } - } - } - - IUnitInfo* unitInfoController = NULL; - // let's see if there's a preset list (take the first one) - if (editController->queryInterface (IUnitInfo::iid, (void**)&unitInfoController) == kResultTrue && unitInfoController) - { - ProgramListInfo programListInfo; - if (unitInfoController->getProgramListInfo (0, programListInfo) == kResultTrue) - { - factoryProgramChangedID = -1; - numPresets = programListInfo.programCount; - if (programListInfo.programCount > 0) - { - UnitID unitId = -1; - - // find the unit supporting this ProgramList - IUnitInfo* unitInfo = NULL; - if (editController->queryInterface (IUnitInfo::iid, (void**)&unitInfo) == kResultTrue && unitInfo) - { - int32 unitCount = unitInfo->getUnitCount (); - for (int32 i = 0; i < unitCount; i++) - { - UnitInfo unitInfoStruct = {0}; - if (unitInfo->getUnitInfo (i, unitInfoStruct) == kResultTrue) - { - if (programListInfo.id == unitInfoStruct.programListId) - { - unitId = unitInfoStruct.id; - break; - } - } - } - - unitInfo->release (); - } - if (unitId != -1) - { - // find the associated ProgramChange parameter ID - for (int32 i = 0; i < (int32)programParameters.size (); i++) - { - const ParameterInfo& paramInfo = programParameters.at (i); - if (paramInfo.unitId == unitId) - { - factoryProgramChangedID = paramInfo.id; - break; - } - } - if (factoryProgramChangedID != -1) - { - presets = new AUPreset [programListInfo.programCount]; - for (int32 i = 0; i < programListInfo.programCount; i++) - { - String128 name; - unitInfoController->getProgramName (programListInfo.id, i, name); - presets[i].presetNumber = i; - presets[i].presetName = createCFStringFromString128 (name); - } - } - } - } - } - unitInfoController->release (); - } - } - } - - return AUWRAPPER_BASE_CLASS::Initialize (); - } - return -1; -} - -//-------------------------------------------------------------------------------------------------------------- -void AUWrapper::Cleanup () -{ - if (audioProcessor) - { - audioProcessor->setProcessing (false); - - FUnknownPtr component (audioProcessor); - component->setActive (false); - } -} - -//-------------------------------------------------------------------------------------------------------------- -// AUBase -//-------------------------------------------------------------------------------------------- -AUElement* AUWrapper::CreateElement (AudioUnitScope scope, AudioUnitElement element) -{ - switch (scope) - { - case kAudioUnitScope_Output: - return new MultiChannelOutputElement (this); - case kAudioUnitScope_Input: - return new MultiChannelInputElement (this); - } - - return AUWRAPPER_BASE_CLASS::CreateElement (scope, element); -} - -//-------------------------------------------------------------------------------------------------------------- -UInt32 AUWrapper::SupportedNumChannels (const AUChannelInfo** outInfo) -{ - static UInt32 numChannelInfos = 0; - static bool once = true; - if (once && gBundleRef) - { - once = false; - char buffer[128]; - - CFStringRef processName = 0; - ProcessSerialNumber psn; - OSErr err = GetCurrentProcess (&psn); - ASSERT(err == noErr); - OSStatus stat = CopyProcessName (&psn, &processName); - ASSERT(stat == noErr); - CFStringGetCString(processName, buffer, sizeof(buffer), kCFStringEncodingUTF8); - CFRelease (processName); - strncat (buffer, " SupportedNumChannels", sizeof (buffer) - strlen (buffer) - 1); - CFStringRef dictName = CFStringCreateWithCString (kCFAllocatorDefault, buffer, kCFStringEncodingUTF8); - - NSArray* supportedNumChannelsArray = (NSArray*)CFBundleGetValueForInfoDictionaryKey (gBundleRef, dictName); - if (!supportedNumChannelsArray) - supportedNumChannelsArray = (NSArray*)CFBundleGetValueForInfoDictionaryKey (gBundleRef, CFSTR("AudioUnit SupportedNumChannels")); - if (supportedNumChannelsArray) - { - numChannelInfos = [supportedNumChannelsArray count]; - if (numChannelInfos > 0) - { - channelInfos = new AUChannelInfo [numChannelInfos]; - int i = 0; - for (NSDictionary* dict in supportedNumChannelsArray) - { - NSInteger inputs = [[dict objectForKey:@"Inputs"] integerValue]; - NSInteger outputs = [[dict objectForKey:@"Outputs"] integerValue]; - channelInfos[i].inChannels = inputs; - channelInfos[i++].outChannels = outputs; - } - } - } - CFRelease (dictName); - } - if (outInfo) - *outInfo = channelInfos; - return numChannelInfos; -} - -//-------------------------------------------------------------------------------------------------------------- -bool AUWrapper::StreamFormatWritable (AudioUnitScope scope, AudioUnitElement element) -{ - return IsInitialized () ? false : true; -} - -//-------------------------------------------------------------------------------------------------------------- -ComponentResult AUWrapper::ChangeStreamFormat (AudioUnitScope inScope, AudioUnitElement inElement, - const CAStreamBasicDescription& inPrevFormat, const CAStreamBasicDescription& inNewFormat) -{ - if (inPrevFormat.NumberChannels () == inNewFormat.NumberChannels ()) - { - // sample rate change - ComponentResult res = AUWRAPPER_BASE_CLASS::ChangeStreamFormat (inScope, inElement, inPrevFormat, inNewFormat); - if (res == noErr) - sampleRate = inNewFormat.mSampleRate; - return res; - } - else if (inPrevFormat.mSampleRate != inNewFormat.mSampleRate) - sampleRate = inNewFormat.mSampleRate; - else if (IsInitialized () || SupportedNumChannels (0) == 0) - return kAudioUnitErr_Initialized; - - AUIOElement* element; - - switch (inScope) - { - case kAudioUnitScope_Input: - element = Inputs ().GetIOElement (inElement); - break; - case kAudioUnitScope_Output: - element = Outputs ().GetIOElement (inElement); - break; - case kAudioUnitScope_Global: - element = Outputs ().GetIOElement (0); - break; - default: - COMPONENT_THROW (kAudioUnitErr_InvalidScope); - } - OSStatus err = element->SetStreamFormat (inNewFormat); - if (err == noErr) - PropertyChanged (kAudioUnitProperty_StreamFormat, inScope, inElement); - return err; -} - -//-------------------------------------------------------------------------------------------------------------- -ComponentResult AUWrapper::SetConnection (const AudioUnitConnection& inConnection) -{ - ComponentResult result = AUWRAPPER_BASE_CLASS::SetConnection (inConnection); - if (result == noErr) - { - int32 busIndex = inConnection.destInputNumber; - bool active = GetInput (busIndex)->IsActive (); - FUnknownPtr component (audioProcessor); - component->activateBus (kAudio, kInput, busIndex, active); - } - return result; -} - -static const UnitInfo kNoUnitInfo = {0}; -//-------------------------------------------------------------------------------------------------------------- -static void buildUnitInfos (IUnitInfo* unitInfoController, TDictionary& units) -{ - units.removeAll (); - units.error ().object () = kNoUnitInfo; - units.error ().key () = 0; - if (unitInfoController) - { - int32 numUnits = unitInfoController->getUnitCount (); - for (int32 i = 0; i < numUnits; i++) - { - UnitInfo ui; - if (unitInfoController->getUnitInfo (i, ui) == kResultTrue) - units.addKeyAndObject (ui.id, ui); - } - } -} - - -//-------------------------------------------------------------------------------------------------------------- -ComponentResult AUWrapper::GetParameterInfo (AudioUnitScope inScope, AudioUnitParameterID inParameterID, - AudioUnitParameterInfo& outParameterInfo) -{ - if (inScope != kAudioUnitScope_Global) - return kAudioUnitErr_InvalidScope; - - FGuard guard (parameterCacheChanging); - if (cachedParameterInfos.containsKey (inParameterID)) - { - const AudioUnitParameterInfo& auInfo = cachedParameterInfos.lookupObject (inParameterID); - - memcpy (&outParameterInfo, &auInfo, sizeof (AudioUnitParameterInfo)); - if (outParameterInfo.cfNameString) - CFRetain (outParameterInfo.cfNameString); - if (outParameterInfo.unitName) - CFRetain (outParameterInfo.unitName); - - return noErr; - } - - return kAudioUnitErr_InvalidParameter; -} - -//-------------------------------------------------------------------------------------------------------------- -ComponentResult AUWrapper::SetParameter (AudioUnitParameterID inID, AudioUnitScope inScope, AudioUnitElement inElement, - AudioUnitParameterValue inValue, UInt32 inBufferOffsetInFrames) -{ - if (inScope == kAudioUnitScope_Global) - { - if (inID == factoryProgramChangedID) - { - SetAFactoryPresetAsCurrent (presets[(int) ((float) inValue * (float) numPresets)]); - PropertyChanged (kAudioUnitProperty_PresentPreset, kAudioUnitScope_Global, 0); - PropertyChanged (kAudioUnitProperty_CurrentPreset, kAudioUnitScope_Global, 0); - } - - transferParamChanges.addChange (inID, inValue, inBufferOffsetInFrames); - } - return AUWRAPPER_BASE_CLASS::SetParameter (inID, inScope, inElement, inValue, inBufferOffsetInFrames); -} - -//-------------------------------------------------------------------------------------------------------------- -void AUWrapper::setControllerParameter (ParamID pid, ParamValue value) -{ - if (editController && pid != factoryProgramChangedID) - editController->setParamNormalized (pid, value); -} - -//-------------------------------------------------------------------------------------------------------------- -ComponentResult AUWrapper::SaveState (CFPropertyListRef* outData) -{ - ComponentResult result = AUWRAPPER_BASE_CLASS::SaveState (outData); - if (result != noErr) - return result; - - NSMutableDictionary* dict = (NSMutableDictionary*)*outData; - - AutoreleasePool ap; - NSMutableData* processorData = [[[NSMutableData alloc] init] autorelease]; - NSMutableData* controllerData = [[[NSMutableData alloc] init] autorelease]; - if (audioProcessor) - { - NSMutableDataIBStream stream (processorData); - if (FUnknownPtr (audioProcessor)->getState (&stream) != kResultTrue) - { - [processorData setLength:0]; - } - } - if (editController) - { - NSMutableDataIBStream stream (controllerData); - if (editController->getState (&stream) != kResultTrue) - { - [controllerData setLength:0]; - } - } - [dict setValue:processorData forKey:@"Processor State"]; - [dict setValue:controllerData forKey:@"Controller State"]; - *outData = dict; - return result; -} - -//-------------------------------------------------------------------------------------------------------------- -ComponentResult AUWrapper::RestoreState (CFPropertyListRef inData) -{ - return restoreState (inData, false); -} - -//-------------------------------------------------------------------------------------------------------------- -ComponentResult AUWrapper::restoreState (CFPropertyListRef inData, bool fromProject) -{ - AutoreleasePool ap; - - if (CFGetTypeID(inData) != CFDictionaryGetTypeID ()) - return kAudioUnitErr_InvalidPropertyValue; - - AudioComponentDescription desc = GetComponentDescription(); - - CFDictionaryRef dict = static_cast(inData); - - if (CFDictionaryContainsKey (dict, [NSString stringWithCString:kAUPresetPartKey encoding:NSASCIIStringEncoding])) - return kAudioUnitErr_InvalidPropertyValue; - -#define kCurrentSavedStateVersion 0 - - CFNumberRef cfnum = reinterpret_cast(CFDictionaryGetValue (dict, [NSString stringWithCString:kAUPresetVersionKey encoding:NSASCIIStringEncoding])); - if (cfnum == NULL) - return kAudioUnitErr_InvalidPropertyValue; - SInt32 value; - CFNumberGetValue (cfnum, kCFNumberSInt32Type, &value); - if (value != kCurrentSavedStateVersion) - return kAudioUnitErr_InvalidPropertyValue; - - cfnum = reinterpret_cast(CFDictionaryGetValue (dict, [NSString stringWithCString:kAUPresetSubtypeKey encoding:NSASCIIStringEncoding])); - if (cfnum == NULL) - return kAudioUnitErr_InvalidPropertyValue; - CFNumberGetValue (cfnum, kCFNumberSInt32Type, &value); - if (UInt32(value) != desc.componentSubType) - return kAudioUnitErr_InvalidPropertyValue; - - cfnum = reinterpret_cast(CFDictionaryGetValue (dict, [NSString stringWithCString:kAUPresetManufacturerKey encoding:NSASCIIStringEncoding])); - if (cfnum == NULL) - return kAudioUnitErr_InvalidPropertyValue; - CFNumberGetValue (cfnum, kCFNumberSInt32Type, &value); - if (UInt32(value) != desc.componentManufacturer) - return kAudioUnitErr_InvalidPropertyValue; - - ComponentResult result = noErr; - - if (result == noErr && audioProcessor && editController && CFGetTypeID(inData) == CFDictionaryGetTypeID ()) - { - // Note: the bypass state is not part of the AU state - bool wasBypassed = false; - if (bypassParamID != -1) - { - wasBypassed = editController->getParamNormalized (bypassParamID) >= 0.5 ? true : false; - } - - NSDictionary* dict = (NSDictionary*)inData; - - NSData* processorData = [dict valueForKey:@"Processor State"]; - int processLen = [processorData length]; - if (processLen == 0) - return kAudioUnitErr_InvalidPropertyValue; - - if (processorData) - { - NSDataIBStream stream (processorData); - if (fromProject) - stream.getAttributes ()->setString (Vst::PresetAttributes::kStateType, String (Vst::StateType::kProject)); - FUnknownPtr (audioProcessor)->setState (&stream); - } - - NSData* controllerData = [dict valueForKey:@"Controller State"]; - if (controllerData) - { - NSDataIBStream processorStream (processorData); - editController->setComponentState (&processorStream); - - NSDataIBStream stream (controllerData); - if (fromProject) - stream.getAttributes ()->setString (Vst::PresetAttributes::kStateType, String (Vst::StateType::kProject)); - editController->setState (&stream); - syncParameterValues (); - cacheParameterValues (); - } - if (bypassParamID != -1) - { - transferParamChanges.addChange (bypassParamID, wasBypassed ? 1 : 0, 0); - editController->setParamNormalized (bypassParamID, wasBypassed ? 1 : 0); - } - } - return result; -} - -//-------------------------------------------------------------------------------------------------------------- -OSStatus AUWrapper::GetPresets (CFArrayRef* outData) const -{ - if (presets && numPresets > 0) - { - if (outData != 0) - { - CFMutableArrayRef presetsArray = CFArrayCreateMutable (NULL, numPresets, NULL); - for (int32 i = 0; i < numPresets; i++) - { - CFArrayAppendValue (presetsArray, &presets[i]); - } - *outData = (CFArrayRef) presetsArray; - } - return noErr; - } - return kAudioUnitErr_InvalidProperty; -} - -//-------------------------------------------------------------------------------------------------------------- -OSStatus AUWrapper::NewFactoryPresetSet (const AUPreset& inNewFactoryPreset) -{ - if (numPresets > 0) - { - float normalizedValue = (float)inNewFactoryPreset.presetNumber / (float)numPresets; - transferParamChanges.addChange (factoryProgramChangedID, normalizedValue, 0); - editController->setParamNormalized (factoryProgramChangedID, normalizedValue); - - if (inNewFactoryPreset.presetNumber < numPresets) - SetAFactoryPresetAsCurrent (presets[inNewFactoryPreset.presetNumber]); - return noErr; - } - return kAudioUnitErr_InvalidProperty; -} - -//-------------------------------------------------------------------------------------------------------------- -ComponentResult AUWrapper::Render (AudioUnitRenderActionFlags &ioActionFlags, const AudioTimeStamp &inTimeStamp, UInt32 inNumberFrames) -{ - updateProcessContext (); - processContext.systemTime = inTimeStamp.mHostTime; - - processParamChanges.clearQueue (); - transferParamChanges.transferChangesTo (processParamChanges); - processData.numSamples = inNumberFrames; - - for (int32 i = 0; i < Inputs ().GetNumberOfElements (); i++) - { - AUInputElement* input = GetInput (i); - if (input->IsActive ()) - input->PullInput (ioActionFlags, inTimeStamp, i, inNumberFrames); - processData.inputs[i].numChannels = input->GetStreamFormat ().NumberChannels (); - for (int32 channel = 0; channel < input->GetStreamFormat ().NumberChannels (); channel++) - { - processData.inputs[i].channelBuffers32[channel] = input->IsActive () ? (Sample32*)input->GetBufferList ().mBuffers[channel].mData : 0; - } - } - for (int32 i = 0; i < Outputs ().GetNumberOfElements (); i++) - { - AUOutputElement* output = GetOutput (i); - output->PrepareBuffer (inNumberFrames); - processData.outputs[i].numChannels = output->GetStreamFormat ().NumberChannels (); - for (int32 channel = 0; channel < output->GetStreamFormat ().NumberChannels (); channel++) - { - processData.outputs[i].channelBuffers32[channel] = (Sample32*)output->GetBufferList ().mBuffers[channel].mData; - } - } - audioProcessor->process (processData); - - outputParamTransfer.transferChangesFrom (outputParamChanges); - outputParamChanges.clearQueue (); - eventList.clear (); - - ioActionFlags &= ~kAudioUnitRenderAction_OutputIsSilence; - - processOutputEvents (inTimeStamp); - - return noErr; -} - -const uint8 kNoteOff = 0x80; ///< note, off velocity -const uint8 kNoteOn = 0x90; ///< note, on velocity -const uint8 kPolyPressure = 0xA0; ///< note, pressure -const uint8 kController = 0xB0; ///< controller, value -const uint8 kProgramChangeStatus= 0xC0; ///< program change -const uint8 kAfterTouchStatus = 0xD0; ///< channel pressure -const uint8 kPitchBendStatus = 0xE0; ///< lsb, msb - -const float kMidiScaler = 1.f / 127.f; -static const uint8 kChannelMask = 0x0F; -static const uint8 kStatusMask = 0xF0; -static const uint32 kDataMask = 0x7F; - -//-------------------------------------------------------------------------------------------------------------- -inline void AUWrapper::processOutputEvents (const AudioTimeStamp &inTimeStamp) -{ - if (outputEvents.getEventCount () > 0) - { - int32 total = outputEvents.getEventCount (); - Event e = {0}; - - for (int32 i = 0; i < total; i++) - { - if (outputEvents.getEvent (i, e) != kResultOk) - break; - - //--- SYSEX ---------------- - if (e.type == Event::kDataEvent && e.data.type == DataEvent::kMidiSysEx) - { - } - else - { - switch (e.type) - { - case Event::kNoteOnEvent : - { - UInt8 status = (UInt8)(kNoteOn | (e.noteOn.channel & kChannelMask)); - UInt8 data1 = (UInt8)(e.noteOn.pitch & kDataMask); - UInt8 data2 = (UInt8)((int32)(e.noteOn.velocity * 127.f + 0.4999999f) & kDataMask); - UInt8 channel = e.noteOn.channel; - if (data2 == 0) // zero velocity => note off - status = (char)(kNoteOff | (e.noteOn.channel & kChannelMask)); - - mCallbackHelper.AddEvent(status, channel, data1, data2, e.sampleOffset); - } break; - case Event::kNoteOffEvent : - { - UInt8 status = (UInt8)(kNoteOff | (e.noteOff.channel & kChannelMask)); - UInt8 data1 = e.noteOff.pitch; - UInt8 data2 = (UInt8)((int32)(e.noteOff.velocity * 127.f + 0.4999999f) & kDataMask); - UInt8 channel = e.noteOff.channel; - - mCallbackHelper.AddEvent (status, channel, data1, data2, e.sampleOffset); - } break; - } - } - } - - outputEvents.clear (); - mCallbackHelper.FireAtTimeStamp (inTimeStamp); - } -} - -//-------------------------------------------------------------------------------------------- -ComponentResult AUWrapper::GetPropertyInfo (AudioUnitPropertyID inID, AudioUnitScope inScope, - AudioUnitElement inElement, UInt32 &outDataSize, Boolean &outWritable) -{ - switch (inID) - { - //-------------------------- - case kAudioUnitProperty_BypassEffect: - { - if (inScope == kAudioUnitScope_Global && bypassParamID != -1) - { - outWritable = true; - outDataSize = sizeof (UInt32); - return noErr; - } - return kAudioUnitErr_InvalidProperty; - } - //-------------------------- - case kAudioUnitProperty_ParameterClumpName: - { - if (bypassParamID != -1) - { - outWritable = false; - outDataSize = sizeof (AudioUnitParameterNameInfo); - return noErr; - } - break; - } - //-------------------------- - case kAudioUnitProperty_ParameterStringFromValue: - { - if (inScope == kAudioUnitScope_Global) - { - outDataSize = sizeof (AudioUnitParameterStringFromValue); - outWritable = false; - return noErr; - } - return kAudioUnitErr_InvalidProperty; - } - //-------------------------- - case kAudioUnitProperty_ParameterValueFromString: - { - if (inScope == kAudioUnitScope_Global) - { - outDataSize = sizeof (AudioUnitParameterValueFromString); - outWritable = false; - return noErr; - } - return kAudioUnitErr_InvalidProperty; - } - //-------------------------- - case kAudioUnitProperty_ElementName: - { - if (inScope == kAudioUnitScope_Input || inScope == kAudioUnitScope_Output) - { - outDataSize = sizeof (CFStringRef); - return noErr; - } - break; - } - //-------------------------- - case kAudioUnitProperty_CocoaUI: - { - outWritable = false; - outDataSize = sizeof (AudioUnitCocoaViewInfo); - return noErr; - } - //-------------------------- - case kAudioUnitProperty_MIDIOutputCallbackInfo: - { - if (inScope == kAudioUnitScope_Global) - { - outDataSize = sizeof(CFArrayRef); - outWritable = false; - return noErr; - } - break; - } - //-------------------------- - case kAudioUnitProperty_MIDIOutputCallback: - { - if (inScope == kAudioUnitScope_Global) - { - outDataSize = sizeof(AUMIDIOutputCallbackStruct); - outWritable = true; - return noErr; - } - break; - } - //-------------------------- - case 64000: - { - if (editController) - { - outDataSize = sizeof (TPtrInt); - outWritable = false; - return noErr; - } - return kAudioUnitErr_InvalidProperty; - } - //-------------------------- - case 64001: - { - if (VST3DynLibrary::gInstance) - { - outDataSize = sizeof (TPtrInt); - outWritable = false; - return noErr; - } - return kAudioUnitErr_InvalidProperty; - } - } - return AUWRAPPER_BASE_CLASS::GetPropertyInfo (inID, inScope, inElement, outDataSize, outWritable); -} - -//-------------------------------------------------------------------------------------------- -ComponentResult AUWrapper::SetProperty (AudioUnitPropertyID inID, AudioUnitScope inScope, - AudioUnitElement inElement, const void* inData, UInt32 inDataSize) -{ - switch (inID) - { - //-------------------------- - case kAudioUnitProperty_BypassEffect: - { - if (inScope == kAudioUnitScope_Global && bypassParamID != -1) - { - bool tempNewSetting = *((UInt32*)inData) != 0; - transferParamChanges.addChange (bypassParamID, tempNewSetting ? 1 : 0, 0); - editController->setParamNormalized (bypassParamID, tempNewSetting ? 1 : 0); - isBypassed = tempNewSetting; - return noErr; - } - break; - } - //-------------------------- - case kAudioUnitProperty_MIDIOutputCallback: - { - if (inScope == kAudioUnitScope_Global) - { - if (inDataSize < sizeof(AUMIDIOutputCallbackStruct)) return kAudioUnitErr_InvalidPropertyValue; - - AUMIDIOutputCallbackStruct *callbackStruct = (AUMIDIOutputCallbackStruct *)inData; - mCallbackHelper.SetCallbackInfo(callbackStruct->midiOutputCallback, callbackStruct->userData); - return noErr; - } - break; - } - } - return AUWRAPPER_BASE_CLASS::SetProperty (inID, inScope, inElement, inData, inDataSize); -} - -//-------------------------------------------------------------------------------------------- -ComponentResult AUWrapper::GetProperty (AudioUnitPropertyID inID, AudioUnitScope inScope, - AudioUnitElement inElement, void *outData) -{ - switch (inID) - { - //-------------------------- - case kAudioUnitProperty_BypassEffect: - { - if (inScope == kAudioUnitScope_Global && bypassParamID != -1) - { - UInt32 bypass = editController->getParamNormalized (bypassParamID) >= 0.5 ? 1 : 0; - *((UInt32*)outData) = bypass; - return noErr; - } - break; - } - //-------------------------- - case kAudioUnitProperty_ParameterClumpName: - { - AudioUnitParameterNameInfo* parameterNameInfo = (AudioUnitParameterNameInfo *) outData; - int32 clumpId = parameterNameInfo->inID; - - if (clumpId < 1 || clumpId > clumpGroups.total ()) - return kAudioUnitErr_PropertyNotInUse; - - const String& clumpGroup = clumpGroups.at (clumpId-1); - parameterNameInfo->outName = (CFStringRef) clumpGroup.toCFStringRef (); - - return noErr; - } - //-------------------------- - case kAudioUnitProperty_ParameterStringFromValue: - { - if (inScope == kAudioUnitScope_Global) - { - AudioUnitParameterStringFromValue* ps = (AudioUnitParameterStringFromValue*)outData; - String128 paramString; - if (editController->getParamStringByValue (ps->inParamID, ps->inValue ? *ps->inValue : editController->getParamNormalized (ps->inParamID), paramString) == kResultTrue) - ps->outString = createCFStringFromString128 (paramString); - else - ps->outString = CFStringCreateWithCString (0, "", kCFStringEncodingUTF8); - return noErr; - } - return kAudioUnitErr_InvalidProperty; - } - //-------------------------- - case kAudioUnitProperty_ParameterValueFromString: - { - if (inScope == kAudioUnitScope_Global) - { - AudioUnitParameterValueFromString* ps = (AudioUnitParameterValueFromString*)outData; - String128 paramString; - createString128FromCFString (ps->inString, paramString); - ParamValue value; - if (editController->getParamValueByString (ps->inParamID, paramString, value) == kResultTrue) - { - ps->outValue = value; - return noErr; - } - return -1; - } - return kAudioUnitErr_InvalidProperty; - } - //-------------------------- - case kAudioUnitProperty_ElementName: - { - if (inScope == kAudioUnitScope_Input || inScope == kAudioUnitScope_Output) - { - FUnknownPtr component (audioProcessor); - BusInfo busInfo; - if (component->getBusInfo (kAudio, inScope == kAudioUnitScope_Input ? kInput : kOutput, inElement, busInfo) == kResultTrue) - { - outData = (void*)createCFStringFromString128 (busInfo.name); - return noErr; - } - } - return kAudioUnitErr_InvalidProperty; - } - //-------------------------- - case kAudioUnitProperty_CocoaUI: - { - AutoreleasePool ap; - - CFStringRef className = (CFStringRef)[[NSString alloc] initWithCString:SMTG_MAKE_STRING (SMTG_AU_PLUGIN_NAMESPACE (SMTGAUPluginCocoaView)) encoding:NSUTF8StringEncoding]; - const char* image = class_getImageName (objc_getClass (SMTG_MAKE_STRING (SMTG_AU_PLUGIN_NAMESPACE (SMTGAUPluginCocoaView)))); - CFBundleRef bundle = GetBundleFromExecutable (image); - - CFURLRef url = CFBundleCopyBundleURL (bundle); - CFRelease (bundle); - AudioUnitCocoaViewInfo cocoaInfo = { url, className }; - *((AudioUnitCocoaViewInfo *)outData) = cocoaInfo; - return noErr; - } - //-------------------------- - case kAudioUnitProperty_MIDIOutputCallbackInfo: - { - if (inScope == kAudioUnitScope_Global) - { - CFStringRef strs[1]; - strs[0] = CFSTR("MIDI Callback"); - - CFArrayRef callbackArray = CFArrayCreate(NULL, (const void **)strs, 1, &kCFTypeArrayCallBacks); - *(CFArrayRef *)outData = callbackArray; - - return noErr; - } - return kAudioUnitErr_InvalidProperty; - } - //-------------------------- - case 64000: - { - if (editController) - { - TPtrInt ptr = (TPtrInt)editController; - *((TPtrInt*)outData) = ptr; - return noErr; - } - else - *((TPtrInt*)outData) = 0; - return kAudioUnitErr_InvalidProperty; - } - //-------------------------- - case 64001: - { - if (VST3DynLibrary::gInstance) - { - TPtrInt ptr = (TPtrInt)VST3DynLibrary::gInstance; - *((TPtrInt*)outData) = ptr; - return noErr; - } - else - *((TPtrInt*)outData) = 0; - return kAudioUnitErr_InvalidProperty; - } - } - return AUWRAPPER_BASE_CLASS::GetProperty (inID, inScope, inElement, outData); -} - -//-------------------------------------------------------------------------------------------------------------- -int AUWrapper::GetNumCustomUIComponents () -{ - if (editController) - { - static int numUIComponents = 0; - static bool once = true; - if (once) - { - AutoreleasePool ap; - once = false; - IPlugView* plugView = editController->createView (ViewType::kEditor); - if (plugView) - { - - if (plugView->isPlatformTypeSupported (kPlatformTypeHIView) == kResultTrue) - numUIComponents = 1; - plugView->release (); - } - } - return numUIComponents; - } - return 0; -} - -//-------------------------------------------------------------------------------------------------------------- -void AUWrapper::GetUIComponentDescs (ComponentDescription* inDescArray) -{ - #if !__LP64__ - if (editController && GetNumCustomUIComponents () > 0) - { - static OSType subType = 0; - static OSType manuf = 0; - static bool once = true; - if (once) - { - once = false; - short prevResFile = CurResFile (); - CFBundleRef bundle = GetCurrentBundle (); - if (!bundle) - return; - - short resourceFileID = CFBundleOpenBundleResourceMap (bundle); - UseResFile (resourceFileID); - Handle h = Get1Resource ('thng', 9000); - if (h) - { - HLock (h); - OSType* hPtr = (OSType*)*h; - subType = hPtr[1]; - manuf = hPtr[2]; - HUnlock (h); - - } - UseResFile (prevResFile); - CFRelease (bundle); - } - inDescArray[0].componentType = kAudioUnitCarbonViewComponentType; - inDescArray[0].componentSubType = subType; - inDescArray[0].componentManufacturer = manuf; - inDescArray[0].componentFlags = 0; - inDescArray[0].componentFlagsMask = 0; - } - #endif -} - -//-------------------------------------------------------------------------------------------------------------- -Float64 AUWrapper::GetLatency () -{ - Float64 latencyInSeconds = 0.0; - if (audioProcessor) - latencyInSeconds = audioProcessor->getLatencySamples () / getSampleRate (); - return latencyInSeconds; -} - -//-------------------------------------------------------------------------------------------------------------- -Float64 AUWrapper::GetTailTime () -{ - Float64 tailTimeInSeconds = 0.0; - if (audioProcessor) - tailTimeInSeconds = audioProcessor->getTailSamples () / getSampleRate (); - return tailTimeInSeconds; -} - -//-------------------------------------------------------------------------------------------------------------- -// MusicDeviceBase -//-------------------------------------------------------------------------------------------------------------- -ComponentResult AUWrapper::StartNote (MusicDeviceInstrumentID inInstrument, MusicDeviceGroupID inGroupID, - NoteInstanceID* outNoteInstanceID, UInt32 inOffsetSampleFrame, const MusicDeviceNoteParams &inParams) -{ - NoteInstanceID noteID = ((UInt8)inParams.mPitch) | ((noteCounter++) << 8); - - Event e = {0}; - - e.type = Event::kNoteOnEvent; - e.noteOn.pitch = inParams.mPitch; - e.noteOn.velocity = inParams.mVelocity / 127.; - e.noteOn.noteId = noteID; - e.sampleOffset = inOffsetSampleFrame; - - // The Group ID is the channel with a standard midi device - e.noteOn.channel = inGroupID; - - eventList.addEvent (e); - if (outNoteInstanceID) - *outNoteInstanceID = noteID; - return noErr; -} - -//-------------------------------------------------------------------------------------------------------------- -ComponentResult AUWrapper::StopNote (MusicDeviceGroupID inGroupID, NoteInstanceID inNoteInstanceID, UInt32 inOffsetSampleFrame) -{ - UInt32 pitch = inNoteInstanceID & 0xff; - Event e = {0}; - e.type = Event::kNoteOffEvent; - e.noteOn.pitch = pitch; - e.noteOn.velocity = 0; - e.noteOn.noteId = inNoteInstanceID; - e.sampleOffset = inOffsetSampleFrame; - - // The Group ID is the channel with a standard midi device - e.noteOff.channel = inGroupID; - - eventList.addEvent (e); - return noErr; -} - -//-------------------------------------------------------------------------------------------- -OSStatus AUWrapper::GetInstrumentCount (UInt32 &outInstCount) const -{ - outInstCount = 1; - return noErr; -} - -//-------------------------------------------------------------------------------------------------------------- -// AUMIDIBase -//-------------------------------------------------------------------------------------------------------------- -OSStatus AUWrapper::HandleNonNoteEvent (UInt8 status, UInt8 channel, UInt8 data1, UInt8 data2, UInt32 inStartFrame) -{ - OSStatus result = noErr; - - if (status == 0xA0) // kMidiMessage_PolyPressure - { - Event e = {0}; - e.type = Event::kPolyPressureEvent; - e.polyPressure.channel = channel; - e.polyPressure.pitch = data1; - e.polyPressure.pressure = data2 / 127.; - e.sampleOffset = inStartFrame; - - eventList.addEvent (e); - return result; - } - - if (!midiMapping) - return result; - - ParamID pid = 0; - ParamValue value = 0; - CtrlNumber cn = -1; - bool prgChange = false; - - switch (status) - { - case 0xE0: // kMidiMessage_PitchWheel - { - cn = kPitchBend; - unsigned short _14bit; - _14bit = (unsigned short)data2; - _14bit <<= 7; - _14bit |= (unsigned short)data1; - value = (double)_14bit / (double)0x3fff; - break; - } - case 0xD0: // kMidiMessage_ChannelPressure - { - cn = kAfterTouch; - value = data1 / 127.f; - break; - } - case 0xB0: // kMidiMessage_ControlChange - { - cn = data1; - value = data2 / 127.f; - break; - } - case 0xC0: // kMidiMessage_ProgramChange - { - pid = programChangeParameters[channel]; - if (pid != kNoParamId) - { - ParameterInfo paramInfo = {0}; - if (editController->getParameterInfo (pid, paramInfo) == kResultTrue) - { - if (paramInfo.stepCount > 0 && data2 <= paramInfo.stepCount) - { - value = (ParamValue)data2 / (ParamValue)paramInfo.stepCount; - prgChange = true; - } - } - } - } - } - if (prgChange || (cn >= 0 && (midiMapping->getMidiControllerAssignment (0, channel, cn, pid) == kResultTrue))) - { - beginEdit (pid); - performEdit (pid, value); - endEdit (pid); - - // make sure that our edit controller get the changes - int32 index; - IParamValueQueue* vq = outputParamChanges.addParameterData (pid, index); - if (vq) - vq->addPoint (inStartFrame, value, index); - } - return result; -} - -//-------------------------------------------------------------------------------------------------------------- -// IComponentHandler -//-------------------------------------------------------------------------------------------------------------- -tresult PLUGIN_API AUWrapper::beginEdit (ParamID tag) -{ - AudioUnitEvent auEvent; - auEvent.mArgument.mParameter.mAudioUnit = GetComponentInstance (); - auEvent.mArgument.mParameter.mParameterID = tag; - auEvent.mArgument.mParameter.mScope = kAudioUnitScope_Global; - auEvent.mArgument.mParameter.mElement = 0; - auEvent.mEventType = kAudioUnitEvent_BeginParameterChangeGesture; - AUEventListenerNotify (paramListenerRef, NULL, &auEvent); - - return kResultTrue; -} - -//-------------------------------------------------------------------------------------------------------------- -tresult PLUGIN_API AUWrapper::performEdit (ParamID tag, ParamValue valueNormalized) -{ - AudioUnitParameter sPar = {GetComponentInstance (), tag, kAudioUnitScope_Global, 0}; - AUParameterSet (paramListenerRef, NULL, &sPar, valueNormalized, 0); - - AudioUnitEvent auEvent; - auEvent.mArgument.mParameter.mAudioUnit = GetComponentInstance (); - auEvent.mArgument.mParameter.mParameterID = tag; - auEvent.mArgument.mParameter.mScope = kAudioUnitScope_Global; - auEvent.mArgument.mParameter.mElement = 0; - auEvent.mEventType = kAudioUnitEvent_ParameterValueChange; - AUEventListenerNotify (paramListenerRef, NULL, &auEvent); - - return kResultTrue; -} - -//-------------------------------------------------------------------------------------------------------------- -tresult PLUGIN_API AUWrapper::endEdit (ParamID tag) -{ - AudioUnitEvent auEvent; - auEvent.mArgument.mParameter.mAudioUnit = GetComponentInstance (); - auEvent.mArgument.mParameter.mParameterID = tag; - auEvent.mArgument.mParameter.mScope = kAudioUnitScope_Global; - auEvent.mArgument.mParameter.mElement = 0; - auEvent.mEventType = kAudioUnitEvent_EndParameterChangeGesture; - AUEventListenerNotify (paramListenerRef, NULL, &auEvent); - - return kResultTrue; -} - -//-------------------------------------------------------------------------------------------------------------- -tresult PLUGIN_API AUWrapper::restartComponent (int32 flags) -{ - tresult result = kNotImplemented; - - if (flags & kParamValuesChanged) - { - syncParameterValues (); - result = kResultTrue; - } - - if (flags & kParamTitlesChanged) - { - cacheParameterValues (); - result = kResultTrue; - PropertyChanged (kAudioUnitProperty_ParameterList, kAudioUnitScope_Global, 0); - } - - if (flags & kLatencyChanged) - { - AudioUnitEvent auEvent; - auEvent.mArgument.mProperty.mAudioUnit = GetComponentInstance (); - auEvent.mArgument.mProperty.mPropertyID = kAudioUnitProperty_Latency; - auEvent.mArgument.mProperty.mScope = kAudioUnitScope_Global; - auEvent.mArgument.mProperty.mElement = 0; - auEvent.mEventType = kAudioUnitEvent_PropertyChange; - AUEventListenerNotify (paramListenerRef, NULL, &auEvent); - result = kResultTrue; - } - // TODO: finish restartComponent implementation - return result; -} - -//-------------------------------------------------------------------------------------------------------------- -// Helpers -//-------------------------------------------------------------------------------------------------------------- -void AUWrapper::syncParameterValues () -{ - if (editController) - { - for (int32 i = 0; i < editController->getParameterCount (); i++) - { - ParameterInfo pi; - editController->getParameterInfo (i, pi); - if (pi.flags & ParameterInfo::kIsBypass) - { - bypassParamID = pi.id; - } - else - { - ParamValue value = editController->getParamNormalized (pi.id); - GlobalScope ().GetElement (0)->SetParameter (pi.id, value); - } - } - } -} - -//-------------------------------------------------------------------------------------------------------------- -void AUWrapper::cacheParameterValues () -{ - clearParameterValueCache (); - - if (editController) - { - FGuard guard (parameterCacheChanging); - - // This must be cached! - for (int32 i = 0; i < editController->getParameterCount (); i++) - { - AudioUnitParameterInfo auInfo; - ParameterInfo pi; - editController->getParameterInfo (i, pi); - - int32 clumpIdx = 0; // Zero should be reserved for values that are not clumped - - // Build clump group if possible - FUnknownPtr unitInfoController (editController); - if (unitInfoController) - { - if (unitInfos.isEmpty ()) - buildUnitInfos (unitInfoController, unitInfos); - - String fullParamName; - ConstString separator (STR (".")); - bool insertSeparator = false; - - UnitInfo ui = unitInfos.lookupObject (pi.unitId); - while (memcmp (&ui, &kNoUnitInfo, sizeof (UnitInfo)) != 0 && ui.id != kRootUnitId) - { - ConstString unitName (ui.name); - if (unitName.length () > 0) - { - if (insertSeparator) - fullParamName.insertAt (0, separator); - insertSeparator = true; - fullParamName.insertAt (0, unitName); - } - ui = unitInfos.lookupObject (ui.parentUnitId); - } - if (!fullParamName.isEmpty ()) - { - bool insertClump = true; - clumpIdx = 1; - for (int32 i = 0; i < clumpGroups.total (); i++) - { - const String& str = clumpGroups.at (i); - if (str.compare (fullParamName) == 0) - break; - - ++clumpIdx; - } - - if (insertClump) - clumpGroups.add (fullParamName); - } - } - - auInfo.name[0] = 0; - auInfo.cfNameString = createCFStringFromString128 (pi.title); - auInfo.defaultValue = pi.defaultNormalizedValue; - auInfo.minValue = 0; - auInfo.maxValue = 1; - auInfo.unit = kAudioUnitParameterUnit_CustomUnit; - auInfo.unitName = createCFStringFromString128 (pi.units); - - // We release this ourselved when emptying the cache - auInfo.flags = /*kAudioUnitParameterFlag_CFNameRelease |*/ kAudioUnitParameterFlag_HasCFNameString | - kAudioUnitParameterFlag_IsReadable | kAudioUnitParameterFlag_HasName; - - if (clumpIdx > 0) - AUBase::HasClump (auInfo, clumpIdx); - - if (!(pi.flags & ParameterInfo::kIsReadOnly)) - auInfo.flags |= kAudioUnitParameterFlag_IsWritable; - if (!(pi.flags & ParameterInfo::kCanAutomate)) - auInfo.flags |= kAudioUnitParameterFlag_NonRealTime; - if (pi.stepCount == 1) - auInfo.unit = kAudioUnitParameterUnit_Boolean; - - cachedParameterInfos.addKeyAndObject (pi.id, auInfo); - } - } -} - -//-------------------------------------------------------------------------------------------------------------- -void AUWrapper::clearParameterValueCache () -{ - FGuard guard (parameterCacheChanging); - TDictionaryIterator it (cachedParameterInfos); - - while (!it.done ()) - { - CFRelease (it.current ().object ().cfNameString); - CFRelease (it.current ().object ().unitName); - - it.next (); - } - - cachedParameterInfos.removeAll (); -} - -//-------------------------------------------------------------------------------------------------------------- -void AUWrapper::updateProcessContext () -{ - memset (&processContext, 0, sizeof (ProcessContext)); - processContext.sampleRate = getSampleRate (); - Float64 beat = 0; - Float64 tempo = 0; - if (CallHostBeatAndTempo (&beat, &tempo) == noErr) - { - processContext.state |= ProcessContext::kTempoValid | ProcessContext::kProjectTimeMusicValid; - processContext.tempo = tempo; - processContext.projectTimeMusic = beat; - } - UInt32 deltaSampleOffsetToNextBeat = 0; - Float32 timeSigNumerator = 0; - UInt32 timeSigDenominator = 0; - Float64 currentMeasureDownBeat = 0; - if (CallHostMusicalTimeLocation (&deltaSampleOffsetToNextBeat, &timeSigNumerator, &timeSigDenominator, - ¤tMeasureDownBeat) == noErr) - { - processContext.state |= ProcessContext::kTimeSigValid | ProcessContext::kBarPositionValid | ProcessContext::kClockValid; - processContext.timeSigNumerator = timeSigNumerator; - processContext.timeSigDenominator = timeSigDenominator; - processContext.samplesToNextClock = deltaSampleOffsetToNextBeat; - processContext.barPositionMusic = currentMeasureDownBeat; - } - Boolean isPlaying; - Boolean transportStateChanged; - Float64 currentSampleInTimeLine; - Boolean isCycling; - Float64 cycleStartBeat; - Float64 cycleEndBeat; - if (CallHostTransportState (&isPlaying, &transportStateChanged, ¤tSampleInTimeLine, &isCycling, - &cycleStartBeat, &cycleEndBeat) == noErr) - { - processContext.state |= ProcessContext::kCycleValid; - processContext.cycleStartMusic = cycleStartBeat; - processContext.cycleEndMusic = cycleEndBeat; - processContext.projectTimeSamples = currentSampleInTimeLine; - if (isPlaying) - processContext.state |= ProcessContext::kPlaying; - if (isCycling) - processContext.state |= ProcessContext::kCycleActive; - } -} - -//-------------------------------------------------------------------------------------------------------------- -void AUWrapper::onTimer (Timer* timer) -{ - ParamID pid; - ParamValue value; - int32 sampleOffset; - while (outputParamTransfer.getNextChange (pid, value, sampleOffset)) - { - GlobalScope ().GetElement (0)->SetParameter (pid, value); - AudioUnitParameter auParam = {0}; - auParam.mAudioUnit = GetComponentInstance (); - auParam.mElement = 0; - auParam.mScope = kAudioUnitScope_Global; - auParam.mParameterID = pid; - AUParameterListenerNotify (paramListenerRef, 0, &auParam); - editController->setParamNormalized (pid, value); - } - if (isBypassed) - { - ProcessData bypassData = processData; - bypassData.numSamples = 0; - processParamChanges.clearQueue (); - transferParamChanges.transferChangesTo (processParamChanges); - if (processParamChanges.getParameterCount () > 0) - { - audioProcessor->process (bypassData); - outputParamTransfer.transferChangesFrom (outputParamChanges); - outputParamChanges.clearQueue (); - } - } -} - -//-------------------------------------------------------------------------------------------------------------- -bool AUWrapper::validateChannelPair (int inChannelsIn, int inChannelsOut, const AUChannelInfo* info, UInt32 numChanInfo) const -{ - // we've the following cases (some combinations) to test here: - /* - >0 An explicit number of channels on either side - 0 that side (generally input!) has no elements - -1 wild card: - -1,-1 any num channels as long as same channels on in and out - -1,-2 any num channels channels on in and out - special meaning - -2+ indicates total num channs AU can handle - - elements configurable to any num channels, - - element count in scope must be writable - */ - - //now chan layout can contain -1 for either scope (ie. doesn't care) - for (unsigned int i = 0; i < numChanInfo; ++i) - { - //less than zero on both sides - check for special attributes - if ((info[i].inChannels < 0) && (info[i].outChannels < 0)) - { - // these are our wild card matches - if (info[i].inChannels == -1 && info[i].outChannels == -1) - { - if (inChannelsIn && inChannelsOut) { - if (inChannelsOut == inChannelsIn) - return true; - } else - return true; // if one of these is zero, then a -1 means any - } - else if ((info[i].inChannels == -1 && info[i].outChannels == -2) - || (info[i].inChannels == -2 && info[i].outChannels == -1)) - { - return true; - } - // these are our total num channels matches - // element count MUST be writable - else - { - bool outWrite = false; bool inWrite = false; - //IsElementCountWritable (kAudioUnitScope_Output, outWrite); - //IsElementCountWritable (kAudioUnitScope_Input, inWrite); - if (inWrite && outWrite) - { - if ((inChannelsOut <= abs(info[i].outChannels)) - && (inChannelsIn <= abs(info[i].inChannels))) - { - return true; - } - } - } - } - - // special meaning on input, specific num on output - else if (info[i].inChannels < 0) - { - if (info[i].outChannels == inChannelsOut) - { - // can do any in channels - if (info[i].inChannels == -1) - { - return true; - } - // total chans on input - else - { - bool inWrite = false; - //IsElementCountWritable (kAudioUnitScope_Input, inWrite); - if (inWrite && (inChannelsIn <= abs(info[i].inChannels))) - { - return true; - } - } - } - } - - // special meaning on output, specific num on input - else if (info[i].outChannels < 0) - { - if (info[i].inChannels == inChannelsIn) - { - // can do any out channels - if (info[i].outChannels == -1) - { - return true; - } - // total chans on output - else - { - bool outWrite = false; - //IsElementCountWritable (kAudioUnitScope_Output, outWrite); - if (outWrite && (inChannelsOut <= abs(info[i].outChannels))) - { - return true; - } - } - } - } - - // both chans in struct >= 0 - thus has to explicitly match - else if ((info[i].inChannels == inChannelsIn) && (info[i].outChannels == inChannelsOut)) - { - return true; - } - - // now check to see if a wild card on the args (inChannelsIn or inChannelsOut chans is zero) is found - // tells us to match just one side of the scopes - else if (inChannelsIn == 0) - { - if (info[i].outChannels == inChannelsOut) - { - return true; - } - } - else if (inChannelsOut == 0) - { - if (info[i].inChannels == inChannelsIn) - { - return true; - } - } - } - - return false; -} - -//-------------------------------------------------------------------------------------------------------------- -bool AUWrapper::getProgramListAndUnit (int32 midiChannel, UnitID& unitId, ProgramListID& programListId) -{ - programListId = kNoProgramListId; - unitId = -1; - - IUnitInfo* unitInfo = NULL; - - if (editController && editController->queryInterface (IUnitInfo::iid, (void**)&unitInfo) == kResultTrue && unitInfo) - { - if (unitInfo->getUnitByBus (kEvent, kInput, 0, midiChannel, unitId) == kResultTrue) - { - int32 unitCount = unitInfo->getUnitCount (); - for (int32 i = 0; i < unitCount; i++) - { - UnitInfo unitInfoStruct = {0}; - if (unitInfo->getUnitInfo (i, unitInfoStruct) == kResultTrue) - { - if (unitId == unitInfoStruct.id) - { - programListId = unitInfoStruct.programListId; - unitInfo->release (); - return programListId != kNoProgramListId; - } - } - } - } - - unitInfo->release (); - } - return false; -} - -#if !CA_USE_AUDIO_PLUGIN_ONLY - -// copied from AUDispatch.cpp -#if __LP64__ - // comp instance, parameters in forward order - #define PARAM(_typ, _name, _index, _nparams) \ - _typ _name = *(_typ *)¶ms->params[_index + 1]; -#else - // parameters in reverse order, then comp instance - #define PARAM(_typ, _name, _index, _nparams) \ - _typ _name = *(_typ *)¶ms->params[_nparams - 1 - _index]; -#endif - -//-------------------------------------------------------------------------------------------------------------- -ComponentResult AUWrapper::ComponentEntryDispatch (ComponentParameters* params, AUWrapper* This) -{ - OSStatus result = noErr; - - switch (params->what) - { - case kAudioUnitSetPropertySelect: - { - PARAM(AudioUnitPropertyID, inID, 0, 5); - - if (inID == kAudioUnitProperty_ClassInfoFromDocument) - { - PARAM(AudioUnitScope, inScope, 1, 5); - PARAM(AudioUnitElement, inElement, 2, 5); - PARAM(const void *, inData, 3, 5); - PARAM(UInt32, inDataSize, 4, 5); - - ca_require(inDataSize == sizeof(CFPropertyListRef *), InvalidPropertyValue); - ca_require(inScope == kAudioUnitScope_Global, InvalidScope); - result = This->restoreState(*(CFPropertyListRef *)inData, true); - return result; - } - break; - } - } - return AUWRAPPER_BASE_CLASS::ComponentEntryDispatch (params, This); - -InvalidScope: - return kAudioUnitErr_InvalidScope; -InvalidPropertyValue: - return kAudioUnitErr_InvalidPropertyValue; -} -#endif - -//-------------------------------------------------------------------------------------------------------------- -//-------------------------------------------------------------------------------------------------------------- -//-------------------------------------------------------------------------------------------------------------- -class CleanupMemory -{ -public: - CleanupMemory () {} - ~CleanupMemory () - { - if (channelInfos) - { - delete [] channelInfos; - channelInfos = 0; - } - } -}; - -CleanupMemory _gCleanupMemory; -CleanupMemory* gCleanupMemory = &_gCleanupMemory; - -#if __MAC_OS_X_VERSION_MAX_ALLOWED == 1060 // if compiling against the 10.6 sdk -//-------------------------------------------------------------------------------------------------------------- -//COMPONENT_ENTRY(AUWrapper) -//-------------------------------------------------------------------------------------------------------------- -extern "C" { - ComponentResult AUWrapperEntry (ComponentParameters *params, AUWrapper *obj); - __attribute__ ((visibility ("default"))) ComponentResult AUWrapperEntry (ComponentParameters *params, AUWrapper *obj) - { - return ComponentEntryPoint::Dispatch (params, obj); - } -} - -#else -struct AUWrapperLookup { - static AudioComponentMethod Lookup (SInt16 selector) - { - AudioComponentMethod method = AUBaseProcessLookup::Lookup(selector); - if (method) return method; - method = AUMusicLookup::Lookup(selector); - if (method) return method; - method = AUBaseProcessMultipleLookup::Lookup(selector); - if (method) return method; - return NULL; - } -}; -template -class AUFactory : public APFactory -{ -}; - -//-------------------------------------------------------------------------------------------------------------- -// new entry method -extern "C" { - void* AUWrapperFactory(const AudioComponentDescription* inDesc); - __attribute__ ((visibility ("default"))) void* AUWrapperFactory (const AudioComponentDescription* inDesc) - { - return AUFactory::Factory (inDesc); - } -} // extern "C" - -#if !CA_USE_AUDIO_PLUGIN_ONLY -//-------------------------------------------------------------------------------------------------------------- -// old entry method -extern "C" { - ComponentResult AUWrapperEntry (ComponentParameters *params, AUWrapper *obj); - __attribute__ ((visibility ("default"))) ComponentResult AUWrapperEntry (ComponentParameters *params, AUWrapper *obj) - { - return ComponentEntryPoint::Dispatch (params, obj); - } -} -#endif -#endif - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg - -/// \endcond diff --git a/vst/public.sdk/source/vst/auwrapper/auwrapper.xcodeproj/project.pbxproj b/vst/public.sdk/source/vst/auwrapper/auwrapper.xcodeproj/project.pbxproj deleted file mode 100644 index 770a857d..00000000 --- a/vst/public.sdk/source/vst/auwrapper/auwrapper.xcodeproj/project.pbxproj +++ /dev/null @@ -1,645 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 45; - objects = { - -/* Begin PBXBuildFile section */ - F40897DF0F1BAC7800117337 /* processdata.h in Headers */ = {isa = PBXBuildFile; fileRef = F40897D70F1BAC7800117337 /* processdata.h */; }; - F40897E00F1BAC7800117337 /* processdata.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F40897D80F1BAC7800117337 /* processdata.cpp */; }; - F40897E10F1BAC7800117337 /* parameterchanges.h in Headers */ = {isa = PBXBuildFile; fileRef = F40897D90F1BAC7800117337 /* parameterchanges.h */; }; - F40897E20F1BAC7800117337 /* parameterchanges.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F40897DA0F1BAC7800117337 /* parameterchanges.cpp */; }; - F40897E30F1BAC7800117337 /* hostclasses.h in Headers */ = {isa = PBXBuildFile; fileRef = F40897DB0F1BAC7800117337 /* hostclasses.h */; }; - F40897E40F1BAC7800117337 /* hostclasses.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F40897DC0F1BAC7800117337 /* hostclasses.cpp */; }; - F40897E50F1BAC7800117337 /* eventlist.h in Headers */ = {isa = PBXBuildFile; fileRef = F40897DD0F1BAC7800117337 /* eventlist.h */; }; - F40897E60F1BAC7800117337 /* eventlist.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F40897DE0F1BAC7800117337 /* eventlist.cpp */; }; - F40897F10F1BAC9600117337 /* aucarbonview.h in Headers */ = {isa = PBXBuildFile; fileRef = F40897E90F1BAC9600117337 /* aucarbonview.h */; }; - F40897F20F1BAC9600117337 /* aucarbonview.mm in Sources */ = {isa = PBXBuildFile; fileRef = F40897EA0F1BAC9600117337 /* aucarbonview.mm */; }; - F40897F30F1BAC9600117337 /* aucocoaview.h in Headers */ = {isa = PBXBuildFile; fileRef = F40897EB0F1BAC9600117337 /* aucocoaview.h */; }; - F40897F40F1BAC9600117337 /* aucocoaview.mm in Sources */ = {isa = PBXBuildFile; fileRef = F40897EC0F1BAC9600117337 /* aucocoaview.mm */; }; - F40897F50F1BAC9600117337 /* auwrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = F40897ED0F1BAC9600117337 /* auwrapper.h */; }; - F40897F60F1BAC9600117337 /* auwrapper.mm in Sources */ = {isa = PBXBuildFile; fileRef = F40897EE0F1BAC9600117337 /* auwrapper.mm */; }; - F40897F70F1BAC9600117337 /* NSDataIBStream.h in Headers */ = {isa = PBXBuildFile; fileRef = F40897EF0F1BAC9600117337 /* NSDataIBStream.h */; }; - F40897F80F1BAC9600117337 /* NSDataIBStream.mm in Sources */ = {isa = PBXBuildFile; fileRef = F40897F00F1BAC9600117337 /* NSDataIBStream.mm */; }; - F408980A0F1BAF0400117337 /* ustring.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F40898020F1BAF0400117337 /* ustring.cpp */; }; - F408980B0F1BAF0400117337 /* ustring.h in Headers */ = {isa = PBXBuildFile; fileRef = F40898030F1BAF0400117337 /* ustring.h */; }; - F408980C0F1BAF0400117337 /* iplugview.h in Headers */ = {isa = PBXBuildFile; fileRef = F40898050F1BAF0400117337 /* iplugview.h */; }; - F40898BB0F1BB00800117337 /* auwrapper_prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = F40898BA0F1BB00800117337 /* auwrapper_prefix.pch */; }; - F40898C20F1BB10600117337 /* ausdk.mm in Sources */ = {isa = PBXBuildFile; fileRef = F40898C00F1BB10600117337 /* ausdk.mm */; }; - F4D484E3194AEE06003521D9 /* libbase_libc++.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F4A18C3017E6ED9F00D343DC /* libbase_libc++.a */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 53060C5118AA2ECD00285B80 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = F40897CD0F1BAC6B00117337 /* base.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = F41CC3ED180C210300D209D0; - remoteInfo = "base_codecoverage_libc++"; - }; - F40897D10F1BAC6B00117337 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = F40897CD0F1BAC6B00117337 /* base.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = D2AAC046055464E500DB518D; - remoteInfo = base; - }; - F41347D0182796AF00E8C6AB /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = F40897CD0F1BAC6B00117337 /* base.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = F4128A5417EB4B0B00114E59; - remoteInfo = base_ios; - }; - F439864A14D99F8A00913B43 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = F40897CD0F1BAC6B00117337 /* base.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = F412026A14C41F68008F9C84; - remoteInfo = base_codecoverage; - }; - F4A18C2F17E6ED9F00D343DC /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = F40897CD0F1BAC6B00117337 /* base.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = F4306DEB17DDC8800075E8C4; - remoteInfo = "base_libc++"; - }; - F4D484E1194AEE00003521D9 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = F40897CD0F1BAC6B00117337 /* base.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = F4306DA817DDC8800075E8C4; - remoteInfo = "base_libc++"; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - D2AAC046055464E500DB518D /* libauwrapper.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libauwrapper.a; sourceTree = BUILT_PRODUCTS_DIR; }; - F40897CD0F1BAC6B00117337 /* base.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = base.xcodeproj; path = ../../../../base/mac/base.xcodeproj; sourceTree = SOURCE_ROOT; }; - F40897D70F1BAC7800117337 /* processdata.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = processdata.h; path = ../hosting/processdata.h; sourceTree = SOURCE_ROOT; }; - F40897D80F1BAC7800117337 /* processdata.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = processdata.cpp; path = ../hosting/processdata.cpp; sourceTree = SOURCE_ROOT; }; - F40897D90F1BAC7800117337 /* parameterchanges.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = parameterchanges.h; path = ../hosting/parameterchanges.h; sourceTree = SOURCE_ROOT; }; - F40897DA0F1BAC7800117337 /* parameterchanges.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = parameterchanges.cpp; path = ../hosting/parameterchanges.cpp; sourceTree = SOURCE_ROOT; }; - F40897DB0F1BAC7800117337 /* hostclasses.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = hostclasses.h; path = ../hosting/hostclasses.h; sourceTree = SOURCE_ROOT; }; - F40897DC0F1BAC7800117337 /* hostclasses.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = hostclasses.cpp; path = ../hosting/hostclasses.cpp; sourceTree = SOURCE_ROOT; }; - F40897DD0F1BAC7800117337 /* eventlist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = eventlist.h; path = ../hosting/eventlist.h; sourceTree = SOURCE_ROOT; }; - F40897DE0F1BAC7800117337 /* eventlist.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = eventlist.cpp; path = ../hosting/eventlist.cpp; sourceTree = SOURCE_ROOT; }; - F40897E90F1BAC9600117337 /* aucarbonview.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aucarbonview.h; sourceTree = ""; }; - F40897EA0F1BAC9600117337 /* aucarbonview.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = aucarbonview.mm; sourceTree = ""; }; - F40897EB0F1BAC9600117337 /* aucocoaview.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = aucocoaview.h; sourceTree = ""; }; - F40897EC0F1BAC9600117337 /* aucocoaview.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = aucocoaview.mm; sourceTree = ""; }; - F40897ED0F1BAC9600117337 /* auwrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = auwrapper.h; sourceTree = ""; }; - F40897EE0F1BAC9600117337 /* auwrapper.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = auwrapper.mm; sourceTree = ""; }; - F40897EF0F1BAC9600117337 /* NSDataIBStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSDataIBStream.h; sourceTree = ""; }; - F40897F00F1BAC9600117337 /* NSDataIBStream.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NSDataIBStream.mm; sourceTree = ""; }; - F40898020F1BAF0400117337 /* ustring.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ustring.cpp; path = ../../../../pluginterfaces/base/ustring.cpp; sourceTree = SOURCE_ROOT; }; - F40898030F1BAF0400117337 /* ustring.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ustring.h; path = ../../../../pluginterfaces/base/ustring.h; sourceTree = SOURCE_ROOT; }; - F40898050F1BAF0400117337 /* iplugview.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = iplugview.h; path = ../../../../pluginterfaces/gui/iplugview.h; sourceTree = SOURCE_ROOT; }; - F408984C0F1BAF1F00117337 /* CAAudioChannelLayout.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CAAudioChannelLayout.cpp; path = /Developer/Examples/CoreAudio/PublicUtility/CAAudioChannelLayout.cpp; sourceTree = ""; }; - F408984D0F1BAF1F00117337 /* CAAudioChannelLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CAAudioChannelLayout.h; path = /Developer/Examples/CoreAudio/PublicUtility/CAAudioChannelLayout.h; sourceTree = ""; }; - F408984E0F1BAF1F00117337 /* CABundleLocker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CABundleLocker.cpp; path = /Developer/Examples/CoreAudio/PublicUtility/CABundleLocker.cpp; sourceTree = ""; }; - F408984F0F1BAF1F00117337 /* CABundleLocker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CABundleLocker.h; path = /Developer/Examples/CoreAudio/PublicUtility/CABundleLocker.h; sourceTree = ""; }; - F40898500F1BAF1F00117337 /* CAHostTimeBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CAHostTimeBase.cpp; path = /Developer/Examples/CoreAudio/PublicUtility/CAHostTimeBase.cpp; sourceTree = ""; }; - F40898510F1BAF1F00117337 /* CAHostTimeBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CAHostTimeBase.h; path = /Developer/Examples/CoreAudio/PublicUtility/CAHostTimeBase.h; sourceTree = ""; }; - F40898520F1BAF1F00117337 /* CAStreamBasicDescription.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CAStreamBasicDescription.cpp; path = /Developer/Examples/CoreAudio/PublicUtility/CAStreamBasicDescription.cpp; sourceTree = ""; }; - F40898530F1BAF1F00117337 /* CAStreamBasicDescription.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CAStreamBasicDescription.h; path = /Developer/Examples/CoreAudio/PublicUtility/CAStreamBasicDescription.h; sourceTree = ""; }; - F40898540F1BAF1F00117337 /* CAVectorUnit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CAVectorUnit.h; path = /Developer/Examples/CoreAudio/PublicUtility/CAVectorUnit.h; sourceTree = ""; }; - F40898550F1BAF1F00117337 /* CAVectorUnit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CAVectorUnit.cpp; path = /Developer/Examples/CoreAudio/PublicUtility/CAVectorUnit.cpp; sourceTree = ""; }; - F40898560F1BAF1F00117337 /* CAAUParameter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CAAUParameter.cpp; path = /Developer/Examples/CoreAudio/PublicUtility/CAAUParameter.cpp; sourceTree = ""; }; - F40898570F1BAF1F00117337 /* CAAUParameter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CAAUParameter.h; path = /Developer/Examples/CoreAudio/PublicUtility/CAAUParameter.h; sourceTree = ""; }; - F408985A0F1BAF1F00117337 /* AUCarbonViewBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AUCarbonViewBase.cpp; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUCarbonViewBase.cpp; sourceTree = ""; }; - F408985B0F1BAF1F00117337 /* AUCarbonViewBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AUCarbonViewBase.h; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUCarbonViewBase.h; sourceTree = ""; }; - F408985C0F1BAF1F00117337 /* AUCarbonViewControl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AUCarbonViewControl.cpp; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUCarbonViewControl.cpp; sourceTree = ""; }; - F408985D0F1BAF1F00117337 /* AUCarbonViewControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AUCarbonViewControl.h; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUCarbonViewControl.h; sourceTree = ""; }; - F408985E0F1BAF1F00117337 /* AUCarbonViewDispatch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AUCarbonViewDispatch.cpp; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUCarbonViewDispatch.cpp; sourceTree = ""; }; - F408985F0F1BAF1F00117337 /* AUControlGroup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AUControlGroup.cpp; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUControlGroup.cpp; sourceTree = ""; }; - F40898600F1BAF1F00117337 /* AUControlGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AUControlGroup.h; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/AUControlGroup.h; sourceTree = ""; }; - F40898610F1BAF1F00117337 /* CarbonEventHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CarbonEventHandler.cpp; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/CarbonEventHandler.cpp; sourceTree = ""; }; - F40898620F1BAF1F00117337 /* CarbonEventHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CarbonEventHandler.h; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/AUCarbonViewBase/CarbonEventHandler.h; sourceTree = ""; }; - F40898640F1BAF1F00117337 /* ComponentBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ComponentBase.h; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/AUBase/ComponentBase.h; sourceTree = ""; }; - F40898650F1BAF1F00117337 /* ComponentBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ComponentBase.cpp; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/AUBase/ComponentBase.cpp; sourceTree = ""; }; - F40898660F1BAF1F00117337 /* AUScopeElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AUScopeElement.h; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/AUBase/AUScopeElement.h; sourceTree = ""; }; - F40898670F1BAF1F00117337 /* AUScopeElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AUScopeElement.cpp; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/AUBase/AUScopeElement.cpp; sourceTree = ""; }; - F40898680F1BAF1F00117337 /* AUResources.r */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.rez; name = AUResources.r; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/AUBase/AUResources.r; sourceTree = ""; }; - F40898690F1BAF1F00117337 /* AUOutputElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AUOutputElement.h; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/AUBase/AUOutputElement.h; sourceTree = ""; }; - F408986A0F1BAF1F00117337 /* AUOutputElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AUOutputElement.cpp; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/AUBase/AUOutputElement.cpp; sourceTree = ""; }; - F408986B0F1BAF1F00117337 /* AUInputElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AUInputElement.h; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/AUBase/AUInputElement.h; sourceTree = ""; }; - F408986C0F1BAF1F00117337 /* AUInputElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AUInputElement.cpp; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/AUBase/AUInputElement.cpp; sourceTree = ""; }; - F408986D0F1BAF1F00117337 /* AUDispatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AUDispatch.h; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/AUBase/AUDispatch.h; sourceTree = ""; }; - F408986E0F1BAF1F00117337 /* AUDispatch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AUDispatch.cpp; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/AUBase/AUDispatch.cpp; sourceTree = ""; }; - F408986F0F1BAF1F00117337 /* AUBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AUBase.h; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.h; sourceTree = ""; }; - F40898700F1BAF1F00117337 /* AUBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AUBase.cpp; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp; sourceTree = ""; }; - F40898720F1BAF1F00117337 /* MusicDeviceBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MusicDeviceBase.cpp; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/OtherBases/MusicDeviceBase.cpp; sourceTree = ""; }; - F40898730F1BAF1F00117337 /* MusicDeviceBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MusicDeviceBase.h; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/OtherBases/MusicDeviceBase.h; sourceTree = ""; }; - F40898740F1BAF1F00117337 /* AUMIDIEffectBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AUMIDIEffectBase.cpp; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/OtherBases/AUMIDIEffectBase.cpp; sourceTree = ""; }; - F40898750F1BAF1F00117337 /* AUMIDIEffectBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AUMIDIEffectBase.h; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/OtherBases/AUMIDIEffectBase.h; sourceTree = ""; }; - F40898760F1BAF1F00117337 /* AUMIDIBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AUMIDIBase.cpp; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/OtherBases/AUMIDIBase.cpp; sourceTree = ""; }; - F40898770F1BAF1F00117337 /* AUMIDIBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AUMIDIBase.h; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/OtherBases/AUMIDIBase.h; sourceTree = ""; }; - F40898780F1BAF1F00117337 /* AUEffectBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AUEffectBase.h; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/OtherBases/AUEffectBase.h; sourceTree = ""; }; - F40898790F1BAF1F00117337 /* AUEffectBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AUEffectBase.cpp; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/OtherBases/AUEffectBase.cpp; sourceTree = ""; }; - F408987B0F1BAF1F00117337 /* AUTimestampGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AUTimestampGenerator.h; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/Utility/AUTimestampGenerator.h; sourceTree = ""; }; - F408987C0F1BAF1F00117337 /* AUTimestampGenerator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AUTimestampGenerator.cpp; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/Utility/AUTimestampGenerator.cpp; sourceTree = ""; }; - F408987D0F1BAF1F00117337 /* AUSilentTimeout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AUSilentTimeout.h; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/Utility/AUSilentTimeout.h; sourceTree = ""; }; - F408987E0F1BAF1F00117337 /* AUInputFormatConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AUInputFormatConverter.h; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/Utility/AUInputFormatConverter.h; sourceTree = ""; }; - F408987F0F1BAF1F00117337 /* AUDebugDispatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AUDebugDispatcher.h; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/Utility/AUDebugDispatcher.h; sourceTree = ""; }; - F40898800F1BAF1F00117337 /* AUDebugDispatcher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AUDebugDispatcher.cpp; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/Utility/AUDebugDispatcher.cpp; sourceTree = ""; }; - F40898810F1BAF1F00117337 /* AUBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AUBuffer.h; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/Utility/AUBuffer.h; sourceTree = ""; }; - F40898820F1BAF1F00117337 /* AUBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AUBuffer.cpp; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/Utility/AUBuffer.cpp; sourceTree = ""; }; - F40898830F1BAF1F00117337 /* AUBaseHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AUBaseHelper.h; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/Utility/AUBaseHelper.h; sourceTree = ""; }; - F40898840F1BAF1F00117337 /* AUBaseHelper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AUBaseHelper.cpp; path = /Developer/Examples/CoreAudio/AudioUnits/AUPublic/Utility/AUBaseHelper.cpp; sourceTree = ""; }; - F40898BA0F1BB00800117337 /* auwrapper_prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = auwrapper_prefix.pch; sourceTree = ""; }; - F40898C00F1BB10600117337 /* ausdk.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ausdk.mm; sourceTree = ""; }; - F46D7C9F109764E8005CE2DA /* AUViewLocalizedStringKeys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AUViewLocalizedStringKeys.h; path = Examples/CoreAudio/AudioUnits/AUPublic/AUViewBase/AUViewLocalizedStringKeys.h; sourceTree = DEVELOPER_DIR; }; - F49C192E156E2C9600AD946F /* ausdkpath.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = ausdkpath.xcconfig; path = config/ausdkpath.xcconfig; sourceTree = ""; }; - F49C192F156E2C9600AD946F /* auwrapper_debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = auwrapper_debug.xcconfig; path = config/auwrapper_debug.xcconfig; sourceTree = ""; }; - F49C1930156E2C9600AD946F /* auwrapper_release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = auwrapper_release.xcconfig; path = config/auwrapper_release.xcconfig; sourceTree = ""; }; - F49C1931156E2C9600AD946F /* auwrapper.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = auwrapper.xcconfig; path = config/auwrapper.xcconfig; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - D289987405E68DCB004EDB86 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - F4D484E3194AEE06003521D9 /* libbase_libc++.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 08FB7794FE84155DC02AAC07 /* auwrapper */ = { - isa = PBXGroup; - children = ( - F40897CD0F1BAC6B00117337 /* base.xcodeproj */, - F49C192D156E2C7C00AD946F /* config */, - 08FB7795FE84155DC02AAC07 /* Source */, - C6A0FF2B0290797F04C91782 /* Documentation */, - 1AB674ADFE9D54B511CA2CBB /* Products */, - ); - name = auwrapper; - sourceTree = ""; - }; - 08FB7795FE84155DC02AAC07 /* Source */ = { - isa = PBXGroup; - children = ( - F408984A0F1BAF1F00117337 /* CoreAudio */, - F40897F90F1BAD3700117337 /* pluginterfaces */, - F40897D30F1BAC7800117337 /* public.sdk */, - ); - name = Source; - sourceTree = ""; - }; - 1AB674ADFE9D54B511CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - D2AAC046055464E500DB518D /* libauwrapper.a */, - ); - name = Products; - sourceTree = ""; - }; - C6A0FF2B0290797F04C91782 /* Documentation */ = { - isa = PBXGroup; - children = ( - ); - name = Documentation; - sourceTree = ""; - }; - F40897CE0F1BAC6B00117337 /* Products */ = { - isa = PBXGroup; - children = ( - F40897D20F1BAC6B00117337 /* libbase_stdc++.a */, - F4A18C3017E6ED9F00D343DC /* libbase_libc++.a */, - F41347D1182796AF00E8C6AB /* libbase_ios.a */, - F439864B14D99F8A00913B43 /* libbase_codecoverage_stdc++.a */, - 53060C5218AA2ECD00285B80 /* libbase_codecoverage_libc++.a */, - ); - name = Products; - sourceTree = ""; - }; - F40897D30F1BAC7800117337 /* public.sdk */ = { - isa = PBXGroup; - children = ( - F40897D40F1BAC7800117337 /* source */, - ); - name = public.sdk; - sourceTree = ""; - }; - F40897D40F1BAC7800117337 /* source */ = { - isa = PBXGroup; - children = ( - F40897D50F1BAC7800117337 /* vst */, - ); - name = source; - sourceTree = ""; - }; - F40897D50F1BAC7800117337 /* vst */ = { - isa = PBXGroup; - children = ( - F40897E80F1BAC8200117337 /* auwrapper */, - F40897D60F1BAC7800117337 /* hosting */, - ); - name = vst; - sourceTree = ""; - }; - F40897D60F1BAC7800117337 /* hosting */ = { - isa = PBXGroup; - children = ( - F40897DE0F1BAC7800117337 /* eventlist.cpp */, - F40897DD0F1BAC7800117337 /* eventlist.h */, - F40897DC0F1BAC7800117337 /* hostclasses.cpp */, - F40897DB0F1BAC7800117337 /* hostclasses.h */, - F40897DA0F1BAC7800117337 /* parameterchanges.cpp */, - F40897D90F1BAC7800117337 /* parameterchanges.h */, - F40897D80F1BAC7800117337 /* processdata.cpp */, - F40897D70F1BAC7800117337 /* processdata.h */, - ); - name = hosting; - sourceTree = ""; - }; - F40897E80F1BAC8200117337 /* auwrapper */ = { - isa = PBXGroup; - children = ( - F40897E90F1BAC9600117337 /* aucarbonview.h */, - F40897EA0F1BAC9600117337 /* aucarbonview.mm */, - F40897EB0F1BAC9600117337 /* aucocoaview.h */, - F40897EC0F1BAC9600117337 /* aucocoaview.mm */, - F40898C00F1BB10600117337 /* ausdk.mm */, - F40897ED0F1BAC9600117337 /* auwrapper.h */, - F40897EE0F1BAC9600117337 /* auwrapper.mm */, - F40898BA0F1BB00800117337 /* auwrapper_prefix.pch */, - F40897EF0F1BAC9600117337 /* NSDataIBStream.h */, - F40897F00F1BAC9600117337 /* NSDataIBStream.mm */, - ); - name = auwrapper; - sourceTree = ""; - }; - F40897F90F1BAD3700117337 /* pluginterfaces */ = { - isa = PBXGroup; - children = ( - F40897FD0F1BAF0400117337 /* base */, - F40898040F1BAF0400117337 /* gui */, - ); - name = pluginterfaces; - sourceTree = ""; - }; - F40897FD0F1BAF0400117337 /* base */ = { - isa = PBXGroup; - children = ( - F40898020F1BAF0400117337 /* ustring.cpp */, - F40898030F1BAF0400117337 /* ustring.h */, - ); - name = base; - sourceTree = ""; - }; - F40898040F1BAF0400117337 /* gui */ = { - isa = PBXGroup; - children = ( - F40898050F1BAF0400117337 /* iplugview.h */, - ); - name = gui; - sourceTree = ""; - }; - F408984A0F1BAF1F00117337 /* CoreAudio */ = { - isa = PBXGroup; - children = ( - F40898580F1BAF1F00117337 /* AUPublic */, - F408984B0F1BAF1F00117337 /* PublicUtility */, - ); - name = CoreAudio; - sourceTree = ""; - }; - F408984B0F1BAF1F00117337 /* PublicUtility */ = { - isa = PBXGroup; - children = ( - F408984C0F1BAF1F00117337 /* CAAudioChannelLayout.cpp */, - F408984D0F1BAF1F00117337 /* CAAudioChannelLayout.h */, - F408984E0F1BAF1F00117337 /* CABundleLocker.cpp */, - F408984F0F1BAF1F00117337 /* CABundleLocker.h */, - F40898500F1BAF1F00117337 /* CAHostTimeBase.cpp */, - F40898510F1BAF1F00117337 /* CAHostTimeBase.h */, - F40898520F1BAF1F00117337 /* CAStreamBasicDescription.cpp */, - F40898530F1BAF1F00117337 /* CAStreamBasicDescription.h */, - F40898540F1BAF1F00117337 /* CAVectorUnit.h */, - F40898550F1BAF1F00117337 /* CAVectorUnit.cpp */, - F40898560F1BAF1F00117337 /* CAAUParameter.cpp */, - F40898570F1BAF1F00117337 /* CAAUParameter.h */, - ); - name = PublicUtility; - sourceTree = ""; - }; - F40898580F1BAF1F00117337 /* AUPublic */ = { - isa = PBXGroup; - children = ( - F40898630F1BAF1F00117337 /* AUBase */, - F40898590F1BAF1F00117337 /* AUCarbonViewBase */, - F46D7C96109764DE005CE2DA /* AUViewBase */, - F40898710F1BAF1F00117337 /* OtherBases */, - F408987A0F1BAF1F00117337 /* Utility */, - ); - name = AUPublic; - sourceTree = ""; - }; - F40898590F1BAF1F00117337 /* AUCarbonViewBase */ = { - isa = PBXGroup; - children = ( - F408985A0F1BAF1F00117337 /* AUCarbonViewBase.cpp */, - F408985B0F1BAF1F00117337 /* AUCarbonViewBase.h */, - F408985C0F1BAF1F00117337 /* AUCarbonViewControl.cpp */, - F408985D0F1BAF1F00117337 /* AUCarbonViewControl.h */, - F408985E0F1BAF1F00117337 /* AUCarbonViewDispatch.cpp */, - F408985F0F1BAF1F00117337 /* AUControlGroup.cpp */, - F40898600F1BAF1F00117337 /* AUControlGroup.h */, - F40898610F1BAF1F00117337 /* CarbonEventHandler.cpp */, - F40898620F1BAF1F00117337 /* CarbonEventHandler.h */, - ); - name = AUCarbonViewBase; - sourceTree = ""; - }; - F40898630F1BAF1F00117337 /* AUBase */ = { - isa = PBXGroup; - children = ( - F40898640F1BAF1F00117337 /* ComponentBase.h */, - F40898650F1BAF1F00117337 /* ComponentBase.cpp */, - F40898660F1BAF1F00117337 /* AUScopeElement.h */, - F40898670F1BAF1F00117337 /* AUScopeElement.cpp */, - F40898680F1BAF1F00117337 /* AUResources.r */, - F40898690F1BAF1F00117337 /* AUOutputElement.h */, - F408986A0F1BAF1F00117337 /* AUOutputElement.cpp */, - F408986B0F1BAF1F00117337 /* AUInputElement.h */, - F408986C0F1BAF1F00117337 /* AUInputElement.cpp */, - F408986D0F1BAF1F00117337 /* AUDispatch.h */, - F408986E0F1BAF1F00117337 /* AUDispatch.cpp */, - F408986F0F1BAF1F00117337 /* AUBase.h */, - F40898700F1BAF1F00117337 /* AUBase.cpp */, - ); - name = AUBase; - sourceTree = ""; - }; - F40898710F1BAF1F00117337 /* OtherBases */ = { - isa = PBXGroup; - children = ( - F40898720F1BAF1F00117337 /* MusicDeviceBase.cpp */, - F40898730F1BAF1F00117337 /* MusicDeviceBase.h */, - F40898740F1BAF1F00117337 /* AUMIDIEffectBase.cpp */, - F40898750F1BAF1F00117337 /* AUMIDIEffectBase.h */, - F40898760F1BAF1F00117337 /* AUMIDIBase.cpp */, - F40898770F1BAF1F00117337 /* AUMIDIBase.h */, - F40898780F1BAF1F00117337 /* AUEffectBase.h */, - F40898790F1BAF1F00117337 /* AUEffectBase.cpp */, - ); - name = OtherBases; - sourceTree = ""; - }; - F408987A0F1BAF1F00117337 /* Utility */ = { - isa = PBXGroup; - children = ( - F408987B0F1BAF1F00117337 /* AUTimestampGenerator.h */, - F408987C0F1BAF1F00117337 /* AUTimestampGenerator.cpp */, - F408987D0F1BAF1F00117337 /* AUSilentTimeout.h */, - F408987E0F1BAF1F00117337 /* AUInputFormatConverter.h */, - F408987F0F1BAF1F00117337 /* AUDebugDispatcher.h */, - F40898800F1BAF1F00117337 /* AUDebugDispatcher.cpp */, - F40898810F1BAF1F00117337 /* AUBuffer.h */, - F40898820F1BAF1F00117337 /* AUBuffer.cpp */, - F40898830F1BAF1F00117337 /* AUBaseHelper.h */, - F40898840F1BAF1F00117337 /* AUBaseHelper.cpp */, - ); - name = Utility; - sourceTree = ""; - }; - F46D7C96109764DE005CE2DA /* AUViewBase */ = { - isa = PBXGroup; - children = ( - F46D7C9F109764E8005CE2DA /* AUViewLocalizedStringKeys.h */, - ); - name = AUViewBase; - sourceTree = ""; - }; - F49C192D156E2C7C00AD946F /* config */ = { - isa = PBXGroup; - children = ( - F49C192E156E2C9600AD946F /* ausdkpath.xcconfig */, - F49C192F156E2C9600AD946F /* auwrapper_debug.xcconfig */, - F49C1930156E2C9600AD946F /* auwrapper_release.xcconfig */, - F49C1931156E2C9600AD946F /* auwrapper.xcconfig */, - ); - name = config; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - D2AAC043055464E500DB518D /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - F40897DF0F1BAC7800117337 /* processdata.h in Headers */, - F40897E10F1BAC7800117337 /* parameterchanges.h in Headers */, - F40897E30F1BAC7800117337 /* hostclasses.h in Headers */, - F40897E50F1BAC7800117337 /* eventlist.h in Headers */, - F40897F10F1BAC9600117337 /* aucarbonview.h in Headers */, - F40897F30F1BAC9600117337 /* aucocoaview.h in Headers */, - F40897F50F1BAC9600117337 /* auwrapper.h in Headers */, - F40897F70F1BAC9600117337 /* NSDataIBStream.h in Headers */, - F408980B0F1BAF0400117337 /* ustring.h in Headers */, - F408980C0F1BAF0400117337 /* iplugview.h in Headers */, - F40898BB0F1BB00800117337 /* auwrapper_prefix.pch in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - D2AAC045055464E500DB518D /* auwrapper */ = { - isa = PBXNativeTarget; - buildConfigurationList = 1DEB91EB08733DB70010E9CD /* Build configuration list for PBXNativeTarget "auwrapper" */; - buildPhases = ( - 706875341B627C2C00375427 /* Create Namespace Prefix */, - D2AAC043055464E500DB518D /* Headers */, - D2AAC044055464E500DB518D /* Sources */, - D289987405E68DCB004EDB86 /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - F4D484E2194AEE00003521D9 /* PBXTargetDependency */, - ); - name = auwrapper; - productName = auwrapper; - productReference = D2AAC046055464E500DB518D /* libauwrapper.a */; - productType = "com.apple.product-type.library.static"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 08FB7793FE84155DC02AAC07 /* Project object */ = { - isa = PBXProject; - attributes = { - }; - buildConfigurationList = 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "auwrapper" */; - compatibilityVersion = "Xcode 3.1"; - developmentRegion = English; - hasScannedForEncodings = 1; - knownRegions = ( - English, - Japanese, - French, - German, - ); - mainGroup = 08FB7794FE84155DC02AAC07 /* auwrapper */; - projectDirPath = ""; - projectReferences = ( - { - ProductGroup = F40897CE0F1BAC6B00117337 /* Products */; - ProjectRef = F40897CD0F1BAC6B00117337 /* base.xcodeproj */; - }, - ); - projectRoot = ""; - targets = ( - D2AAC045055464E500DB518D /* auwrapper */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXReferenceProxy section */ - 53060C5218AA2ECD00285B80 /* libbase_codecoverage_libc++.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = "libbase_codecoverage_libc++.a"; - remoteRef = 53060C5118AA2ECD00285B80 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - F40897D20F1BAC6B00117337 /* libbase_stdc++.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = "libbase_stdc++.a"; - remoteRef = F40897D10F1BAC6B00117337 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - F41347D1182796AF00E8C6AB /* libbase_ios.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = libbase_ios.a; - remoteRef = F41347D0182796AF00E8C6AB /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - F439864B14D99F8A00913B43 /* libbase_codecoverage_stdc++.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = "libbase_codecoverage_stdc++.a"; - remoteRef = F439864A14D99F8A00913B43 /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - F4A18C3017E6ED9F00D343DC /* libbase_libc++.a */ = { - isa = PBXReferenceProxy; - fileType = archive.ar; - path = "libbase_libc++.a"; - remoteRef = F4A18C2F17E6ED9F00D343DC /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; -/* End PBXReferenceProxy section */ - -/* Begin PBXShellScriptBuildPhase section */ - 706875341B627C2C00375427 /* Create Namespace Prefix */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Create Namespace Prefix"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "ruby ./generateCocoaClassNamePrefix.rb"; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - D2AAC044055464E500DB518D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - F40897E00F1BAC7800117337 /* processdata.cpp in Sources */, - F40897E20F1BAC7800117337 /* parameterchanges.cpp in Sources */, - F40897E40F1BAC7800117337 /* hostclasses.cpp in Sources */, - F40897E60F1BAC7800117337 /* eventlist.cpp in Sources */, - F40897F20F1BAC9600117337 /* aucarbonview.mm in Sources */, - F40897F40F1BAC9600117337 /* aucocoaview.mm in Sources */, - F40897F60F1BAC9600117337 /* auwrapper.mm in Sources */, - F40897F80F1BAC9600117337 /* NSDataIBStream.mm in Sources */, - F408980A0F1BAF0400117337 /* ustring.cpp in Sources */, - F40898C20F1BB10600117337 /* ausdk.mm in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - F4D484E2194AEE00003521D9 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = "base_libc++"; - targetProxy = F4D484E1194AEE00003521D9 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin XCBuildConfiguration section */ - 1DEB91EC08733DB70010E9CD /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = F49C1931156E2C9600AD946F /* auwrapper.xcconfig */; - buildSettings = { - GCC_ENABLE_FIX_AND_CONTINUE = YES; - }; - name = Debug; - }; - 1DEB91ED08733DB70010E9CD /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = F49C1931156E2C9600AD946F /* auwrapper.xcconfig */; - buildSettings = { - }; - name = Release; - }; - 1DEB91F008733DB70010E9CD /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = F49C192F156E2C9600AD946F /* auwrapper_debug.xcconfig */; - buildSettings = { - }; - name = Debug; - }; - 1DEB91F108733DB70010E9CD /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = F49C1930156E2C9600AD946F /* auwrapper_release.xcconfig */; - buildSettings = { - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 1DEB91EB08733DB70010E9CD /* Build configuration list for PBXNativeTarget "auwrapper" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1DEB91EC08733DB70010E9CD /* Debug */, - 1DEB91ED08733DB70010E9CD /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "auwrapper" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 1DEB91F008733DB70010E9CD /* Debug */, - 1DEB91F108733DB70010E9CD /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 08FB7793FE84155DC02AAC07 /* Project object */; -} diff --git a/vst/public.sdk/source/vst/auwrapper/auwrapper_prefix.pch b/vst/public.sdk/source/vst/auwrapper/auwrapper_prefix.pch deleted file mode 100644 index 5bda23ad..00000000 --- a/vst/public.sdk/source/vst/auwrapper/auwrapper_prefix.pch +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/auwrapper/auwrapper_prefix.pch -// Created by : Steinberg, 12/2007 -// Description : VST 3 -> AU Wrapper -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#include -#include diff --git a/vst/public.sdk/source/vst/auwrapper/config/ausdkpath.xcconfig b/vst/public.sdk/source/vst/auwrapper/config/ausdkpath.xcconfig deleted file mode 100644 index 72a01efa..00000000 --- a/vst/public.sdk/source/vst/auwrapper/config/ausdkpath.xcconfig +++ /dev/null @@ -1,36 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : ausdkpath.xcconfig -// Created by : Steinberg, 5/24/12 -// Description : Xcode configuration file to specify paths to the AU SDK files, VST 3 -> AU Wrapper -// -//------------------------------------------------------------------------ -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -// If you are building with Xcode >= 4.x please add the path to your downloaded Audio Tools for Xcode -CUSTOM_AU_SDK_PATH=/Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/ // AUWRAPPER_CHANGE diff --git a/vst/public.sdk/source/vst/auwrapper/config/auwrapper.xcconfig b/vst/public.sdk/source/vst/auwrapper/config/auwrapper.xcconfig deleted file mode 100644 index 09c0d8a0..00000000 --- a/vst/public.sdk/source/vst/auwrapper/config/auwrapper.xcconfig +++ /dev/null @@ -1,42 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : auwrapper.xcconfig -// Created by : Steinberg, 5/24/12 -// Description : Xcode configuration file to specify paths to the AU SDK files, VST 3 -> AU Wrapper -// -//------------------------------------------------------------------------ -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#include "../../../../../base/mac/config/libc++base" -#include "ausdkpath" - -PRODUCT_NAME = auwrapper - -HEADER_SEARCH_PATHS = ../../../../ $(CUSTOM_AU_SDK_PATH)/** $(DEVELOPER_DIR)/Examples/CoreAudio/** $(DEVELOPER_DIR)/Extras/CoreAudio/** $(DEVELOPER_DIR)/Extras/CoreAudio/AudioUnits/AUPublic/AUViewBase/** ../../../../libraries/source/CoreAudio/** -GCC_PREFIX_HEADER = auwrapper_prefix.pch -GCC_PRECOMPILE_PREFIX_HEADER = YES diff --git a/vst/public.sdk/source/vst/auwrapper/config/auwrapper_debug.xcconfig b/vst/public.sdk/source/vst/auwrapper/config/auwrapper_debug.xcconfig deleted file mode 100644 index 12400453..00000000 --- a/vst/public.sdk/source/vst/auwrapper/config/auwrapper_debug.xcconfig +++ /dev/null @@ -1,38 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : ausdkpath_debug.xcconfig -// Created by : Steinberg, 5/24/12 -// Description : Xcode configuration file to specify paths to the AU SDK files, VST 3 -> AU Wrapper -// -//------------------------------------------------------------------------ -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#include "../../../../../base/mac/config/debug" - -GCC_OPTIMIZATION_LEVEL = 0 -DEPLOYMENT_POSTPROCESSING = NO diff --git a/vst/public.sdk/source/vst/auwrapper/config/auwrapper_release.xcconfig b/vst/public.sdk/source/vst/auwrapper/config/auwrapper_release.xcconfig deleted file mode 100644 index 1af85e03..00000000 --- a/vst/public.sdk/source/vst/auwrapper/config/auwrapper_release.xcconfig +++ /dev/null @@ -1,38 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : auwrapper_release.xcconfig -// Created by : Steinberg, 5/24/12 -// Description : Xcode configuration file to specify paths to the AU SDK files, VST 3 -> AU Wrapper -// -//------------------------------------------------------------------------ -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#include "../../../../../base/mac/config/release" - -GCC_OPTIMIZATION_LEVEL = 3 -DEPLOYMENT_POSTPROCESSING = NO diff --git a/vst/public.sdk/source/vst/auwrapper/generateCocoaClassNamePrefix.rb b/vst/public.sdk/source/vst/auwrapper/generateCocoaClassNamePrefix.rb deleted file mode 100644 index dd9b1a69..00000000 --- a/vst/public.sdk/source/vst/auwrapper/generateCocoaClassNamePrefix.rb +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/ruby - -require 'time' - -$stdout << "Generating new class prefix for Objective-C classes\n" -File.open("#{ENV['PROJECT_DIR']}/aucocoaclassprefix.h", "w+") do |stream| - - t = Time.now.to_i - t.round - id = t.to_s - stream << "#define SMTG_AU_NAMESPACE\t" - stream << "SMTGAUCocoa#{id}_\n" - -end \ No newline at end of file diff --git a/vst/public.sdk/source/vst/hosting/eventlist.cpp b/vst/public.sdk/source/vst/hosting/eventlist.cpp deleted file mode 100644 index 053d0981..00000000 --- a/vst/public.sdk/source/vst/hosting/eventlist.cpp +++ /dev/null @@ -1,106 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/hosting/eventlist.cpp -// Created by : Steinberg, 03/05/2008. -// Description : VST 3 event list implementation -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#include "eventlist.h" - -namespace Steinberg { -namespace Vst { - -//-------------------------------------------------------------------------------------------------------------- -IMPLEMENT_FUNKNOWN_METHODS (EventList, IEventList, IEventList::iid) - -//-------------------------------------------------------------------------------------------------------------- -EventList::EventList (int32 maxSize) -: maxSize (maxSize) -, fillCount (0) -, events (0) -{ - FUNKNOWN_CTOR - setMaxSize (maxSize); -} - -//-------------------------------------------------------------------------------------------------------------- -EventList::~EventList () -{ - setMaxSize (0); - FUNKNOWN_DTOR -} - -//-------------------------------------------------------------------------------------------------------------- -void EventList::setMaxSize (int32 _maxSize) -{ - if (events) - { - delete [] events; - events = 0; - } - if (_maxSize > 0) - events = new Event[_maxSize]; - maxSize = _maxSize; -} - -//-------------------------------------------------------------------------------------------------------------- -tresult PLUGIN_API EventList::getEvent (int32 index, Event& e) -{ - if (fillCount > index) - { - memcpy (&e, &events[index], sizeof (Event)); - return kResultTrue; - } - return kResultFalse; -} - -//-------------------------------------------------------------------------------------------------------------- -tresult PLUGIN_API EventList::addEvent (Event& e) -{ - if (maxSize > fillCount) - { - memcpy (&events[fillCount], &e, sizeof (Event)); - fillCount++; - return kResultTrue; - } - return kResultFalse; -} - -//-------------------------------------------------------------------------------------------------------------- -Event* EventList::getEventByIndex (int32 index) -{ - if (index < fillCount) - return &events [index]; - return 0; -} - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg diff --git a/vst/public.sdk/source/vst/hosting/eventlist.h b/vst/public.sdk/source/vst/hosting/eventlist.h deleted file mode 100644 index d2539014..00000000 --- a/vst/public.sdk/source/vst/hosting/eventlist.h +++ /dev/null @@ -1,71 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/hosting/eventlist.h -// Created by : Steinberg, 03/05/2008. -// Description : VST 3 event list implementation -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#pragma once - -#include "pluginterfaces/vst/ivstevents.h" - -namespace Steinberg { -namespace Vst { - -//------------------------------------------------------------------------ -/** Implementation's example of IEventList. -\ingroup sdkBase -*/ -class EventList : public IEventList -{ -public: - EventList (int32 maxSize = 50); - virtual ~EventList (); - - void clear () { fillCount = 0; } - - int32 PLUGIN_API getEventCount () { return fillCount; } - tresult PLUGIN_API getEvent (int32 index, Event& e); - tresult PLUGIN_API addEvent (Event& e); - - Event* getEventByIndex (int32 index); - void setMaxSize (int32 maxSize); - -//------------------------------------------------------------------------ - DECLARE_FUNKNOWN_METHODS -protected: - Event* events; - int32 maxSize; - int32 fillCount; -}; - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg diff --git a/vst/public.sdk/source/vst/hosting/hostclasses.cpp b/vst/public.sdk/source/vst/hosting/hostclasses.cpp deleted file mode 100644 index b1fe032e..00000000 --- a/vst/public.sdk/source/vst/hosting/hostclasses.cpp +++ /dev/null @@ -1,294 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/hosting/hostclasses.cpp -// Created by : Steinberg, 03/05/2008. -// Description : VST 3 hostclasses, example implementations for IHostApplication, IAttributeList and IMessage -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#include "hostclasses.h" - -#include - -namespace Steinberg { -namespace Vst { - -//-------------------------------------------------------------------------------------------------------------- -tresult PLUGIN_API HostApplication::getName (String128 name) -{ - String str ("My VST3 HostApplication"); - str.copyTo16 (name, 0, 127); - return kResultTrue; -} - -//-------------------------------------------------------------------------------------------------------------- -tresult PLUGIN_API HostApplication::createInstance (TUID cid, TUID _iid, void** obj) -{ - FUID classID (cid); - FUID interfaceID (_iid); - if (classID == IMessage::iid && interfaceID == IMessage::iid) - { - *obj = new HostMessage; - return kResultTrue; - } - else if (classID == IAttributeList::iid && interfaceID == IAttributeList::iid) - { - *obj = new HostAttributeList; - return kResultTrue; - } - *obj = 0; - return kResultFalse; -} - -//-------------------------------------------------------------------------------------------------------------- -tresult PLUGIN_API HostApplication::queryInterface (const char* _iid, void** obj) -{ - QUERY_INTERFACE (_iid, obj, FUnknown::iid, IHostApplication) - QUERY_INTERFACE (_iid, obj, IHostApplication::iid, IHostApplication) - *obj = 0; - return kResultFalse; -} - -//-------------------------------------------------------------------------------------------------------------- -uint32 PLUGIN_API HostApplication::addRef () -{ - return 1; -} - -//-------------------------------------------------------------------------------------------------------------- -uint32 PLUGIN_API HostApplication::release () -{ - return 1; -} - -//-------------------------------------------------------------------------------------------------------------- -//-------------------------------------------------------------------------------------------------------------- -//-------------------------------------------------------------------------------------------------------------- -IMPLEMENT_FUNKNOWN_METHODS(HostMessage, IMessage, IMessage::iid) -//-------------------------------------------------------------------------------------------------------------- -HostMessage::HostMessage () -: messageId (0) -, attributeList (0) -{ - FUNKNOWN_CTOR -} - -//-------------------------------------------------------------------------------------------------------------- -HostMessage::~HostMessage () -{ - setMessageID (0); - if (attributeList) - attributeList->release (); - FUNKNOWN_DTOR -} - -//-------------------------------------------------------------------------------------------------------------- -const char* PLUGIN_API HostMessage::getMessageID () -{ - return messageId; -} - -//-------------------------------------------------------------------------------------------------------------- -void PLUGIN_API HostMessage::setMessageID (const char* mid) -{ - if (messageId) - delete [] messageId; - messageId = 0; - if (mid) - { - size_t len = strlen (mid)+1; - messageId = new char[len]; - strcpy (messageId, mid); - } -} - -//-------------------------------------------------------------------------------------------------------------- -IAttributeList* PLUGIN_API HostMessage::getAttributes () -{ - if (!attributeList) - attributeList = new HostAttributeList; - return attributeList; -} - -//-------------------------------------------------------------------------------------------------------------- -//-------------------------------------------------------------------------------------------------------------- -//-------------------------------------------------------------------------------------------------------------- -class HostAttribute -{ -public: - enum Type { - kInteger, - kFloat, - kString, - kBinary - }; - - HostAttribute (int64 value) : type (kInteger), size (0) { v.intValue = value; } - HostAttribute (double value) : type (kFloat), size (0) { v.floatValue = value; } - HostAttribute (const TChar* value, uint32 size) : type (kString), size (size) { v.stringValue = new TChar [size]; memcpy (v.stringValue, value, size * sizeof (TChar)); } - HostAttribute (const void* value, uint32 size) : type (kBinary), size (size) { v.binaryValue = new char [size]; memcpy (v.binaryValue, value, size); } - ~HostAttribute () { if (size) delete [] v.binaryValue; } - - int64 intValue () const { return v.intValue; } - double floatValue () const { return v.floatValue; } - const TChar* stringValue (uint32& stringSize) { stringSize = size; return v.stringValue; } - const void* binaryValue (uint32& binarySize) { binarySize = size; return v.binaryValue; } - - Type getType () const { return type; } - -protected: - union v { - int64 intValue; - double floatValue; - TChar* stringValue; - char* binaryValue; - } v; - uint32 size; - Type type; -}; - -typedef std::map::iterator mapIterator; - -//-------------------------------------------------------------------------------------------------------------- -//-------------------------------------------------------------------------------------------------------------- -//-------------------------------------------------------------------------------------------------------------- -IMPLEMENT_FUNKNOWN_METHODS(HostAttributeList, IAttributeList, IAttributeList::iid) -//-------------------------------------------------------------------------------------------------------------- -HostAttributeList::HostAttributeList () -{ - FUNKNOWN_CTOR -} - -//-------------------------------------------------------------------------------------------------------------- -HostAttributeList::~HostAttributeList () -{ - std::map::reverse_iterator it = list.rbegin (); - while (it != list.rend ()) - { - delete it->second; - it++; - } - FUNKNOWN_DTOR -} - -//-------------------------------------------------------------------------------------------------------------- -void HostAttributeList::removeAttrID (AttrID aid) -{ - mapIterator it = list.find (aid); - if (it != list.end ()) - { - delete it->second; - list.erase (it); - } -} - -//-------------------------------------------------------------------------------------------------------------- -tresult PLUGIN_API HostAttributeList::setInt (AttrID aid, int64 value) -{ - removeAttrID (aid); - list[aid] = new HostAttribute (value); - return kResultTrue; -} - -//-------------------------------------------------------------------------------------------------------------- -tresult PLUGIN_API HostAttributeList::getInt (AttrID aid, int64& value) -{ - mapIterator it = list.find (aid); - if (it != list.end () && it->second) - { - value = it->second->intValue (); - return kResultTrue; - } - return kResultFalse; -} - -//-------------------------------------------------------------------------------------------------------------- -tresult PLUGIN_API HostAttributeList::setFloat (AttrID aid, double value) -{ - removeAttrID (aid); - list[aid] = new HostAttribute (value); - return kResultTrue; -} - -//-------------------------------------------------------------------------------------------------------------- -tresult PLUGIN_API HostAttributeList::getFloat (AttrID aid, double& value) -{ - mapIterator it = list.find (aid); - if (it != list.end () && it->second) - { - value = it->second->floatValue (); - return kResultTrue; - } - return kResultFalse; -} - -//-------------------------------------------------------------------------------------------------------------- -tresult PLUGIN_API HostAttributeList::setString (AttrID aid, const TChar* string) -{ - removeAttrID (aid); - list[aid] = new HostAttribute (string, String (const_cast(string)).length ()); - return kResultTrue; -} - -//-------------------------------------------------------------------------------------------------------------- -tresult PLUGIN_API HostAttributeList::getString (AttrID aid, TChar* string, uint32 size) -{ - mapIterator 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 (stringSize, size) * sizeof (TChar)); - return kResultTrue; - } - return kResultFalse; -} - -//-------------------------------------------------------------------------------------------------------------- -tresult PLUGIN_API HostAttributeList::setBinary (AttrID aid, const void* data, uint32 size) -{ - removeAttrID (aid); - list[aid] = new HostAttribute (data, size); - return kResultTrue; -} - -//-------------------------------------------------------------------------------------------------------------- -tresult PLUGIN_API HostAttributeList::getBinary (AttrID aid, const void*& data, uint32& size) -{ - mapIterator it = list.find (aid); - if (it != list.end () && it->second) - { - data = it->second->binaryValue (size); - return kResultTrue; - } - size = 0; - return kResultFalse; -} - -} } // namespace diff --git a/vst/public.sdk/source/vst/hosting/hostclasses.h b/vst/public.sdk/source/vst/hosting/hostclasses.h deleted file mode 100644 index 85b6ea64..00000000 --- a/vst/public.sdk/source/vst/hosting/hostclasses.h +++ /dev/null @@ -1,110 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/hosting/hostclasses.h -// Created by : Steinberg, 03/05/2008. -// Description : VST 3 hostclasses, example implementations for IHostApplication, IAttributeList and IMessage -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#pragma once - -#include "pluginterfaces/vst/ivsthostapplication.h" - -#include "base/source/fstring.h" - -#include - -namespace Steinberg { -namespace Vst { - -//------------------------------------------------------------------------ -/** Implementation's example of IHostApplication. -\ingroup hostingBase -*/ -class HostApplication : public IHostApplication -{ -public: - HostApplication () { FUNKNOWN_CTOR } - virtual ~HostApplication () { FUNKNOWN_DTOR } - - tresult PLUGIN_API getName (String128 name); - tresult PLUGIN_API createInstance (TUID cid, TUID _iid, void** obj); - - DECLARE_FUNKNOWN_METHODS -}; - -class HostAttribute; -//------------------------------------------------------------------------ -/** Implementation's example of IAttributeList. -\ingroup hostingBase -*/ -class HostAttributeList : public IAttributeList -{ -public: - HostAttributeList (); - virtual ~HostAttributeList (); - - tresult PLUGIN_API setInt (AttrID aid, int64 value); - tresult PLUGIN_API getInt (AttrID aid, int64& value); - tresult PLUGIN_API setFloat (AttrID aid, double value); - tresult PLUGIN_API getFloat (AttrID aid, double& value); - tresult PLUGIN_API setString (AttrID aid, const TChar* string); - tresult PLUGIN_API getString (AttrID aid, TChar* string, uint32 size); - tresult PLUGIN_API setBinary (AttrID aid, const void* data, uint32 size); - tresult PLUGIN_API getBinary (AttrID aid, const void*& data, uint32& size); - - DECLARE_FUNKNOWN_METHODS -protected: - void removeAttrID (AttrID aid); - std::map list; -}; - -//------------------------------------------------------------------------ -/** Implementation's example of IMessage. -\ingroup hostingBase -*/ -class HostMessage : public IMessage -{ -public: - HostMessage (); - virtual ~HostMessage (); - - const char* PLUGIN_API getMessageID (); - void PLUGIN_API setMessageID (const char* messageID); - IAttributeList* PLUGIN_API getAttributes (); - - DECLARE_FUNKNOWN_METHODS -protected: - char* messageId; - HostAttributeList* attributeList; -}; - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg diff --git a/vst/public.sdk/source/vst/hosting/parameterchanges.cpp b/vst/public.sdk/source/vst/hosting/parameterchanges.cpp deleted file mode 100644 index ac914c91..00000000 --- a/vst/public.sdk/source/vst/hosting/parameterchanges.cpp +++ /dev/null @@ -1,322 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/hosting/parameterchanges.cpp -// Created by : Steinberg, 03/05/2008. -// Description : VST 3 parameter changes implementation -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#include "parameterchanges.h" - -namespace Steinberg { -namespace Vst { - -//-------------------------------------------------------------------------------------------------------------- -IMPLEMENT_FUNKNOWN_METHODS (ParameterChanges, IParameterChanges, IParameterChanges::iid) -IMPLEMENT_FUNKNOWN_METHODS (ParameterValueQueue, IParamValueQueue, IParamValueQueue::iid) - - -const int32 kQueueReservedPoints = 5; - -//-------------------------------------------------------------------------------------------------------------- -ParameterValueQueue::ParameterValueQueue (ParamID paramID) -: paramID (paramID) -{ - values.reserve (kQueueReservedPoints); - FUNKNOWN_CTOR -} - -//-------------------------------------------------------------------------------------------------------------- -ParameterValueQueue::~ParameterValueQueue () -{ - FUNKNOWN_DTOR -} - -//-------------------------------------------------------------------------------------------------------------- -void ParameterValueQueue::clear () -{ - values.clear (); -} - -//-------------------------------------------------------------------------------------------------------------- -int32 PLUGIN_API ParameterValueQueue::getPointCount () -{ - return (int32)values.size (); -} - -//-------------------------------------------------------------------------------------------------------------- -tresult PLUGIN_API ParameterValueQueue::getPoint (int32 index, int32& sampleOffset, ParamValue& value) -{ - if (index < (int32)values.size ()) - { - const ParameterQueueValue& queueValue = values[index]; - sampleOffset = queueValue.sampleOffset; - value = queueValue.value; - return kResultTrue; - } - return kResultFalse; -} - -//-------------------------------------------------------------------------------------------------------------- -tresult PLUGIN_API ParameterValueQueue::addPoint (int32 sampleOffset, ParamValue value, int32& index) -{ - int32 destIndex = (int32)values.size (); - for (uint32 i = 0; i < values.size (); i++) - { - if (values[i].sampleOffset == sampleOffset) - { - values[i].value = value; - index = i; - return kResultTrue; - } - else if (values[i].sampleOffset > sampleOffset) - { - destIndex = i; - break; - } - } - - // need new point - ParameterQueueValue queueValue (value, sampleOffset); - if (destIndex == (int32)values.size ()) - values.push_back (queueValue); - else - values.insert (values.begin () + destIndex, queueValue); - - index = destIndex; - - return kResultTrue; -} - -//-------------------------------------------------------------------------------------------------------------- -// ParameterChanges -//-------------------------------------------------------------------------------------------------------------- -ParameterChanges::ParameterChanges (int32 maxParameters) -: usedQueueCount (0) -{ - FUNKNOWN_CTOR - setMaxParameters (maxParameters); -} - -//-------------------------------------------------------------------------------------------------------------- -ParameterChanges::~ParameterChanges () -{ - setMaxParameters (0); - - FUNKNOWN_DTOR -} - -//-------------------------------------------------------------------------------------------------------------- -void ParameterChanges::setMaxParameters (int32 maxParameters) -{ - if (maxParameters < 0) - return; - - while ((int32)queues.size () < maxParameters) - { - ParameterValueQueue* valueQueue = new ParameterValueQueue (0xffffffff); - queues.push_back (valueQueue); - } - - while ((int32)queues.size () > maxParameters) - { - queues.back ()->release (); - queues.pop_back (); - } - if (usedQueueCount > maxParameters) - usedQueueCount = maxParameters; -} - -//-------------------------------------------------------------------------------------------------------------- -void ParameterChanges::clearQueue () -{ - usedQueueCount = 0; -} - -//-------------------------------------------------------------------------------------------------------------- -int32 PLUGIN_API ParameterChanges::getParameterCount () -{ - return usedQueueCount; -} - -//-------------------------------------------------------------------------------------------------------------- -IParamValueQueue* PLUGIN_API ParameterChanges::getParameterData (int32 index) -{ - if (index < usedQueueCount) - return queues[index]; - return 0; -} - -//-------------------------------------------------------------------------------------------------------------- -IParamValueQueue* PLUGIN_API ParameterChanges::addParameterData (const ParamID& pid, int32& index) -{ - for (int32 i = 0; i < usedQueueCount; i++) - { - if (queues[i]->getParameterId () == pid) - { - index = i; - return queues[i]; - } - } - - ParameterValueQueue* valueQueue = 0; - if (usedQueueCount < (int32)queues.size ()) - { - valueQueue = queues[usedQueueCount]; - valueQueue->setParamID (pid); - valueQueue->clear (); - } - else - { - valueQueue = new ParameterValueQueue (pid); - queues.push_back (valueQueue); - } - - index = usedQueueCount; - usedQueueCount++; - return valueQueue; -} - - -//-------------------------------------------------------------------------------------------------------------- -// ParameterChangeTransfer -//-------------------------------------------------------------------------------------------------------------- -ParameterChangeTransfer::ParameterChangeTransfer (int32 maxParameters) -: changes (0) -, size (0) -, readIndex (0) -, writeIndex (0) -{ - setMaxParameters (maxParameters); -} - -//-------------------------------------------------------------------------------------------------------------- -ParameterChangeTransfer::~ParameterChangeTransfer () -{ - setMaxParameters (0); -} - -//-------------------------------------------------------------------------------------------------------------- -void ParameterChangeTransfer::setMaxParameters (int32 maxParameters) -{ - // reserve memory for twice the amount of all parameters - int32 newSize = maxParameters * 2; - if (size != newSize) - { - if (changes) - delete [] changes; - changes = 0; - size = newSize; - if (size > 0) - changes = new ParameterChange [size]; - } -} - -//-------------------------------------------------------------------------------------------------------------- -void ParameterChangeTransfer::addChange (ParamID pid, ParamValue value, int32 sampleOffset) -{ - if (changes) - { - changes [writeIndex].id = pid; - changes [writeIndex].value = value; - changes [writeIndex].sampleOffset = sampleOffset; - - int32 newWriteIndex = writeIndex + 1; - if (newWriteIndex >= size) - newWriteIndex = 0; - if (readIndex != newWriteIndex) - writeIndex = newWriteIndex; - } -} - -//-------------------------------------------------------------------------------------------------------------- -bool ParameterChangeTransfer::getNextChange (ParamID& pid, ParamValue& value, int32& sampleOffset) -{ - if (changes) - { - int32 currentWriteIndex = writeIndex; - if (readIndex != currentWriteIndex) - { - pid = changes [readIndex].id; - value = changes [readIndex].value; - sampleOffset = changes [readIndex].sampleOffset; - - int32 newReadIndex = readIndex + 1; - if (newReadIndex >= size) - newReadIndex = 0; - readIndex = newReadIndex; - return true; - } - } - return false; -} - - -//-------------------------------------------------------------------------------------------------------------- -void ParameterChangeTransfer::transferChangesTo (ParameterChanges& dest) -{ - ParamID pid; - ParamValue value; - int32 sampleOffset; - int32 index; - - while (getNextChange (pid, value, sampleOffset)) - { - IParamValueQueue* queue = dest.addParameterData (pid, index); - if (queue) - { - queue->addPoint (sampleOffset, value, index); - } - } -} - -//-------------------------------------------------------------------------------------------------------------- -void ParameterChangeTransfer::transferChangesFrom (ParameterChanges& source) -{ - ParamValue value; - int32 sampleOffset; - for (int32 i = 0; i < source.getParameterCount (); i++) - { - IParamValueQueue* queue = source.getParameterData (i); - if (queue) - { - for (int32 j = 0; j < queue->getPointCount (); j++) - { - if (queue->getPoint (j, sampleOffset, value) == kResultTrue) - { - addChange (queue->getParameterId (), value, sampleOffset); - } - } - } - } -} - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg diff --git a/vst/public.sdk/source/vst/hosting/parameterchanges.h b/vst/public.sdk/source/vst/hosting/parameterchanges.h deleted file mode 100644 index a30b51c8..00000000 --- a/vst/public.sdk/source/vst/hosting/parameterchanges.h +++ /dev/null @@ -1,138 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/hosting/parameterchanges.h -// Created by : Steinberg, 03/05/2008. -// Description : VST 3 parameter changes implementation -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#pragma once - -#include "pluginterfaces/vst/ivstparameterchanges.h" -#include - -namespace Steinberg { -namespace Vst { - -//------------------------------------------------------------------------ -/** Implementation's example of IParamValueQueue - not threadsave!. -\ingroup hostingBase -*/ -class ParameterValueQueue : public IParamValueQueue -{ -public: - //------------------------------------------------------------------------ - ParameterValueQueue (ParamID paramID); - virtual ~ParameterValueQueue (); - - ParamID PLUGIN_API getParameterId () { return paramID; } - int32 PLUGIN_API getPointCount (); - tresult PLUGIN_API getPoint (int32 index, int32& sampleOffset, ParamValue& value); - tresult PLUGIN_API addPoint (int32 sampleOffset, ParamValue value, int32& index); - - void setParamID (ParamID pID) {paramID = pID;} - void clear (); - //------------------------------------------------------------------------ - DECLARE_FUNKNOWN_METHODS -protected: - ParamID paramID; - - struct ParameterQueueValue - { - ParameterQueueValue (ParamValue value, int32 sampleOffset) : value (value), sampleOffset (sampleOffset) {} - ParamValue value; - int32 sampleOffset; - }; - std::vector values; -}; - -//------------------------------------------------------------------------ -/** Implementation's example of IParameterChanges - not threadsave!. -\ingroup hostingBase -*/ -class ParameterChanges : public IParameterChanges -{ -public: - //------------------------------------------------------------------------ - ParameterChanges (int32 maxParameters = 0); - virtual ~ParameterChanges (); - - void clearQueue (); - void setMaxParameters (int32 maxParameters); - - //---IParameterChanges----------------------------- - int32 PLUGIN_API getParameterCount (); - IParamValueQueue* PLUGIN_API getParameterData (int32 index); - IParamValueQueue* PLUGIN_API addParameterData (const ParamID& pid, int32& index); - - //------------------------------------------------------------------------ - DECLARE_FUNKNOWN_METHODS -protected: - std::vector queues; - int32 usedQueueCount; -}; - - -//------------------------------------------------------------------------ -/** Ring buffer for transferring parameter changes from a writer to a read thread . -\ingroup hostingBase -*/ -class ParameterChangeTransfer -{ -public: - //------------------------------------------------------------------------ - ParameterChangeTransfer (int32 maxParameters = 0); - virtual ~ParameterChangeTransfer (); - - void setMaxParameters (int32 maxParameters); - - void addChange (ParamID pid, ParamValue value, int32 sampleOffset); - bool getNextChange (ParamID& pid, ParamValue& value, int32& sampleOffset); - - void transferChangesTo (ParameterChanges& dest); - void transferChangesFrom (ParameterChanges& source); - - //------------------------------------------------------------------------ -protected: - struct ParameterChange - { - ParamID id; - ParamValue value; - int32 sampleOffset; - }; - int32 size; - ParameterChange* changes; - - volatile int32 readIndex; - volatile int32 writeIndex; -}; - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg diff --git a/vst/public.sdk/source/vst/hosting/processdata.cpp b/vst/public.sdk/source/vst/hosting/processdata.cpp deleted file mode 100644 index 4554af32..00000000 --- a/vst/public.sdk/source/vst/hosting/processdata.cpp +++ /dev/null @@ -1,219 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/hosting/processdata.cpp -// Created by : Steinberg, 10/2005 -// Description : VST Hosting Utilities -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#include "processdata.h" - -//------------------------------------------------------------------------ -namespace Steinberg { -namespace Vst { - -//------------------------------------------------------------------------ -// HostProcessData -//------------------------------------------------------------------------ -HostProcessData::~HostProcessData () -{ - unprepare (); -} - -//------------------------------------------------------------------------ -bool HostProcessData::prepare (IComponent& component, int32 bufferSamples, int32 _symbolicSampleSize) -{ - if (checkIfReallocationNeeded (component, bufferSamples, _symbolicSampleSize)) - { - unprepare (); - - symbolicSampleSize = _symbolicSampleSize; - channelBufferOwner = bufferSamples > 0; - - numInputs = createBuffers (component, inputs, kInput, bufferSamples); - numOutputs = createBuffers (component, outputs, kOutput, bufferSamples); - } - else - { - // reset silence flags - for (int32 i = 0; i < numInputs; i++) - { - inputs[i].silenceFlags = 0; - } - for (int32 i = 0; i < numOutputs; i++) - { - outputs[i].silenceFlags = 0; - } - } - - return true; -} - -//------------------------------------------------------------------------ -void HostProcessData::unprepare () -{ - destroyBuffers (inputs, numInputs); - destroyBuffers (outputs, numOutputs); - - channelBufferOwner = false; -} - -//------------------------------------------------------------------------ -bool HostProcessData::checkIfReallocationNeeded (IComponent& component, int32 bufferSamples, int32 _symbolicSampleSize) -{ - if (channelBufferOwner != (bufferSamples > 0)) - return true; - if (symbolicSampleSize != _symbolicSampleSize) - return true; - - int32 inBusCount = component.getBusCount (kAudio, kInput); - if (inBusCount != numInputs) - return true; - - int32 outBusCount = component.getBusCount (kAudio, kOutput); - if (outBusCount != numOutputs) - return true; - - for (int32 i = 0; i < inBusCount; i++) - { - BusInfo busInfo = {0}; - - if (component.getBusInfo (kAudio, kInput, i, busInfo) == kResultTrue) - { - if (inputs[i].numChannels != busInfo.channelCount) - return true; - } - } - for (int32 i = 0; i < outBusCount; i++) - { - BusInfo busInfo = {0}; - - if (component.getBusInfo (kAudio, kOutput, i, busInfo) == kResultTrue) - { - if (outputs[i].numChannels != busInfo.channelCount) - return true; - } - } - return false; -} - -//-------------------------------------------------------------------------------------------------------------- -int32 HostProcessData::createBuffers (IComponent& component, AudioBusBuffers*& buffers, BusDirection dir, - int32 bufferSamples) -{ - int32 busCount = component.getBusCount (kAudio, dir); - if (busCount > 0) - { - buffers = new AudioBusBuffers[busCount]; - - for (int32 i = 0; i < busCount; i++) - { - BusInfo busInfo = {0}; - - if (component.getBusInfo (kAudio, dir, i, busInfo) == kResultTrue) - { - buffers[i].numChannels = busInfo.channelCount; - - // allocate for each channel - if (busInfo.channelCount > 0) - { - if (symbolicSampleSize == kSample64) - buffers[i].channelBuffers64 = new Sample64* [busInfo.channelCount]; - else - buffers[i].channelBuffers32 = new Sample32* [busInfo.channelCount]; - - for (int32 j = 0; j < busInfo.channelCount; j++) - { - if (symbolicSampleSize == kSample64) - { - if (bufferSamples > 0) - buffers[i].channelBuffers64[j] = new Sample64 [bufferSamples]; - else - buffers[i].channelBuffers64[j] = 0; - } - else - { - if (bufferSamples > 0) - buffers[i].channelBuffers32[j] = new Sample32 [bufferSamples]; - else - buffers[i].channelBuffers32[j] = 0; - } - } - } - } - } - } - return busCount; -} - -//-------------------------------------------------------------------------------------------------------------- -void HostProcessData::destroyBuffers (AudioBusBuffers*& buffers, int32& busCount) -{ - if (buffers) - { - for (int32 i = 0; i < busCount; i++) - { - if (channelBufferOwner) - { - for (int32 j = 0; j < buffers[i].numChannels; j++) - { - if (symbolicSampleSize == kSample64) - { - if (buffers[i].channelBuffers64[j]) - delete[] buffers[i].channelBuffers64[j]; - } - else - { - if (buffers[i].channelBuffers32[j]) - delete[] buffers[i].channelBuffers32[j]; - } - } - } - - if (symbolicSampleSize == kSample64) - { - if (buffers[i].channelBuffers64) - delete[] buffers[i].channelBuffers64; - } - else - { - if (buffers[i].channelBuffers32) - delete[] buffers[i].channelBuffers32; - } - } - - delete[] buffers; - buffers = 0; - } - busCount = 0; -} - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg diff --git a/vst/public.sdk/source/vst/hosting/processdata.h b/vst/public.sdk/source/vst/hosting/processdata.h deleted file mode 100644 index 95c5ab26..00000000 --- a/vst/public.sdk/source/vst/hosting/processdata.h +++ /dev/null @@ -1,185 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/hosting/processdata.h -// Created by : Steinberg, 10/2005 -// Description : VST Hosting Utilities -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#pragma once - -#include "pluginterfaces/vst/ivstcomponent.h" -#include "pluginterfaces/vst/ivstaudioprocessor.h" - -//------------------------------------------------------------------------ -namespace Steinberg { -namespace Vst { - -//------------------------------------------------------------------------ -/** Implementation's example of ProcessData. -\ingroup hostingBase -*/ -class HostProcessData: public ProcessData -{ -public: -//------------------------------------------------------------------------ - HostProcessData () : channelBufferOwner (false) {} - virtual ~HostProcessData (); - - /** Prepare buffer containers for all buses. If bufferSamples is not null buffers will be created. */ - bool prepare (IComponent& component, int32 bufferSamples = 0, - int32 _symbolicSampleSize = kSample32); - - /** Remove bus buffers. */ - void unprepare (); - - /** Sets one sample buffer for all channels inside a bus. */ - void setChannelBuffers (BusDirection dir, int32 busIndex, Sample32* sampleBuffer); - void setChannelBuffers64 (BusDirection dir, int32 busIndex, Sample64* sampleBuffer); - - /** Sets individual sample buffers per channel inside a bus. */ - void setChannelBuffers (BusDirection dir, int32 busIndex, Sample32* sampleBuffers[], int32 bufferCount); - void setChannelBuffers64 (BusDirection dir, int32 busIndex, Sample64* sampleBuffers[], int32 bufferCount); - - /** Sets one sample buffer for a given channel inside a bus. */ - void setChannelBuffer (BusDirection dir, int32 busIndex, int32 channelIndex, Sample32* sampleBuffer); - void setChannelBuffer64 (BusDirection dir, int32 busIndex, int32 channelIndex, Sample64* sampleBuffer); - - static const uint64 kAllChannelsSilent = -#if MAC - 0xffffffffffffffffULL; -#else - 0xffffffffffffffffUL; -#endif - -//------------------------------------------------------------------------ -protected: - int32 createBuffers (IComponent& component, AudioBusBuffers*& buffers, BusDirection dir, - int32 bufferSamples); - void destroyBuffers (AudioBusBuffers*& buffers, int32& busCount); - bool checkIfReallocationNeeded (IComponent& component, int32 bufferSamples, int32 _symbolicSampleSize); - - bool channelBufferOwner; -}; - -//------------------------------------------------------------------------ -// inline -//------------------------------------------------------------------------ -inline void HostProcessData::setChannelBuffers (BusDirection dir, int32 busIndex, Sample32* sampleBuffer) -{ - if (channelBufferOwner) - return; - if (dir == kInput && (!inputs || busIndex >= numInputs)) - return; - if (dir == kOutput && (!outputs || busIndex >= numOutputs)) - return; - - AudioBusBuffers& busBuffers = dir == kInput ? inputs[busIndex] : outputs[busIndex]; - for (int32 i = 0; i < busBuffers.numChannels; i++) - busBuffers.channelBuffers32[i] = sampleBuffer; -} - -//------------------------------------------------------------------------ -inline void HostProcessData::setChannelBuffers64 (BusDirection dir, int32 busIndex, Sample64* sampleBuffer) -{ - if (channelBufferOwner) - return; - if (dir == kInput && (!inputs || busIndex >= numInputs)) - return; - if (dir == kOutput && (!outputs || busIndex >= numOutputs)) - return; - - AudioBusBuffers& busBuffers = dir == kInput ? inputs[busIndex] : outputs[busIndex]; - for (int32 i = 0; i < busBuffers.numChannels; i++) - busBuffers.channelBuffers64[i] = sampleBuffer; -} - -//------------------------------------------------------------------------ -inline void HostProcessData::setChannelBuffers (BusDirection dir, int32 busIndex, Sample32* sampleBuffers[], int32 bufferCount) -{ - if (channelBufferOwner) - return; - if (dir == kInput && (!inputs || busIndex >= numInputs)) - return; - if (dir == kOutput && (!outputs || busIndex >= numOutputs)) - return; - - AudioBusBuffers& busBuffers = dir == kInput ? inputs[busIndex] : outputs[busIndex]; - int32 count = bufferCount < busBuffers.numChannels ? bufferCount : busBuffers.numChannels; - for (int32 i = 0; i < count; i++) - busBuffers.channelBuffers32[i] = sampleBuffers ? sampleBuffers[i] : 0; -} - -//------------------------------------------------------------------------ -inline void HostProcessData::setChannelBuffers64 (BusDirection dir, int32 busIndex, Sample64* sampleBuffers[], int32 bufferCount) -{ - if (channelBufferOwner) - return; - if (dir == kInput && (!inputs || busIndex >= numInputs)) - return; - if (dir == kOutput && (!outputs || busIndex >= numOutputs)) - return; - - AudioBusBuffers& busBuffers = dir == kInput ? inputs[busIndex] : outputs[busIndex]; - int32 count = bufferCount < busBuffers.numChannels ? bufferCount : busBuffers.numChannels; - for (int32 i = 0; i < count; i++) - busBuffers.channelBuffers64[i] = sampleBuffers ? sampleBuffers[i] : 0; -} - -//------------------------------------------------------------------------ -inline void HostProcessData::setChannelBuffer (BusDirection dir, int32 busIndex, int32 channelIndex, Sample32* sampleBuffer) -{ - if (dir == kInput && (!inputs || busIndex >= numInputs)) - return; - if (dir == kOutput && (!outputs || busIndex >= numOutputs)) - return; - - AudioBusBuffers& busBuffers = dir == kInput ? inputs[busIndex] : outputs[busIndex]; - if (channelIndex >= busBuffers.numChannels) - return; - busBuffers.channelBuffers32[channelIndex] = sampleBuffer; -} - -//------------------------------------------------------------------------ -inline void HostProcessData::setChannelBuffer64 (BusDirection dir, int32 busIndex, int32 channelIndex, Sample64* sampleBuffer) -{ - if (dir == kInput && (!inputs || busIndex >= numInputs)) - return; - if (dir == kOutput && (!outputs || busIndex >= numOutputs)) - return; - - AudioBusBuffers& busBuffers = dir == kInput ? inputs[busIndex] : outputs[busIndex]; - if (channelIndex >= busBuffers.numChannels) - return; - busBuffers.channelBuffers64[channelIndex] = sampleBuffer; -} - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg diff --git a/vst/public.sdk/source/vst/interappaudio/AudioIO.h b/vst/public.sdk/source/vst/interappaudio/AudioIO.h deleted file mode 100644 index f64f83a7..00000000 --- a/vst/public.sdk/source/vst/interappaudio/AudioIO.h +++ /dev/null @@ -1,149 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/interappaudio/AudioIO.h -// Created by : Steinberg, 08/2013. -// Description : VST 3 InterAppAudio -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#pragma once - -/// \cond ignore - -#include -#include -#include "pluginterfaces/base/funknown.h" -#include "pluginterfaces/vst/vsttypes.h" -#include - -#ifndef __OBJC__ -struct UIImage; -struct NSString; -#endif - -namespace Steinberg { -namespace Vst { -namespace InterAppAudio { - -class AudioIO; - -//------------------------------------------------------------------------ -class IMidiProcessor -{ -public: - virtual void onMIDIEvent (UInt32 status, UInt32 data1, UInt32 data2, UInt32 sampleOffset, bool withinRealtimeThread) = 0; -}; - -//------------------------------------------------------------------------ -class IAudioIOProcessor : public IMidiProcessor -{ -public: - virtual void willStartAudio (AudioIO* audioIO) = 0; - virtual void didStopAudio (AudioIO* audioIO) = 0; - - virtual void process (const AudioTimeStamp* timeStamp, UInt32 busNumber, UInt32 numFrames, AudioBufferList* ioData, bool& outputIsSilence, AudioIO* audioIO) = 0; -}; - -//------------------------------------------------------------------------ -class AudioIO -{ -public: - static AudioIO* instance (); - - tresult init (OSType type, OSType subType, OSType manufacturer, CFStringRef name); - - bool switchToHost (); - bool sendRemoteControlEvent (AudioUnitRemoteControlEvent event); - UIImage* getHostIcon (); - - tresult start (); - tresult stop (); - - tresult addProcessor (IAudioIOProcessor* processor); - tresult removeProcessor (IAudioIOProcessor* processor); - - // accessors - AudioUnit getRemoteIO () const { return remoteIO; } - SampleRate getSampleRate () const { return sampleRate; } - bool getInterAppAudioConnected () const { return interAppAudioConnected; } - - // host context information - bool getBeatAndTempo (Float64& beat, Float64& tempo); - bool getMusicalTimeLocation (UInt32& deltaSampleOffset, Float32& timeSigNumerator, UInt32& timeSigDenominator, Float64& downBeat); - bool getTransportState (Boolean& isPlaying, Boolean& isRecording, Boolean& transportStateChanged, Float64& sampleInTimeLine, Boolean& isCycling, Float64& cycleStartBeat, Float64& cycleEndBeat); - - void setStaticFallbackTempo (Float64 tempo) {staticTempo = tempo; } - Float64 getStaticFallbackTempo () const { return staticTempo; } - - static NSString* kConnectionStateChange; -//------------------------------------------------------------------------ -protected: - AudioIO (); - ~AudioIO (); - - static OSStatus inputCallbackStatic (void *inRefCon, AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList *ioData); - static OSStatus renderCallbackStatic (void *inRefCon, AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList *ioData); - static void propertyChangeStatic (void *inRefCon, AudioUnit inUnit, AudioUnitPropertyID inID, AudioUnitScope inScope, AudioUnitElement inElement); - static void midiEventCallbackStatic (void *inRefCon, UInt32 inStatus, UInt32 inData1, UInt32 inData2, UInt32 inOffsetSampleFrame); - - OSStatus inputCallback (AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList *ioData); - OSStatus renderCallback (AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList *ioData); - void midiEventCallback (UInt32 inStatus, UInt32 inData1, UInt32 inData2, UInt32 inOffsetSampleFrame); - - void remoteIOPropertyChanged (AudioUnitPropertyID inID, AudioUnitScope inScope, AudioUnitElement inElement); - - void setAudioSessionActive (bool state); - tresult setupRemoteIO (OSType type); - tresult setupAUGraph (OSType type); - void updateInterAppAudioConnectionState (); - - AudioUnit remoteIO; - AUGraph graph; - AudioBufferList* ioBufferList; - HostCallbackInfo hostCallback; - UInt32 maxFrames; - Float64 staticTempo; - SampleRate sampleRate; - bool interAppAudioConnected; - std::vector audioProcessors; - - enum InternalState { - kUninitialized, - kInitialized, - kStarted, - }; - InternalState internalState; -}; - -//------------------------------------------------------------------------ -} // namespace InterAppAudio -} // namespace Vst -} // namespace Steinberg - -/// \endcond diff --git a/vst/public.sdk/source/vst/interappaudio/AudioIO.mm b/vst/public.sdk/source/vst/interappaudio/AudioIO.mm deleted file mode 100644 index ce543076..00000000 --- a/vst/public.sdk/source/vst/interappaudio/AudioIO.mm +++ /dev/null @@ -1,558 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/interappaudio/AudioIO.mm -// Created by : Steinberg, 08/2013. -// Description : VST 3 InterAppAudio -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#include "AudioIO.h" -#include "MidiIO.h" -#include "pluginterfaces/base/fstrdefs.h" -#include -#include - -#define FORCE_INLINE __attribute__((always_inline)) - -namespace Steinberg { -namespace Vst { -namespace InterAppAudio { - -//------------------------------------------------------------------------ -static AudioBufferList* createBuffers (uint32 numChannels, uint32 maxFrames, uint32 frameSize) -{ - AudioBufferList* result = (AudioBufferList*) malloc (sizeof (AudioBufferList) + sizeof (AudioBuffer) * numChannels); - result->mNumberBuffers = numChannels; - for (int32 i = 0; i < numChannels; i++) - { - result->mBuffers[i].mDataByteSize = maxFrames * sizeof (float); - result->mBuffers[i].mData = calloc (1, result->mBuffers[i].mDataByteSize); - result->mBuffers[i].mNumberChannels = 1; - } - return result; -} - -//------------------------------------------------------------------------ -static void freeAudioBufferList (AudioBufferList* audioBufferList) -{ - for (uint32 i = 0; i < audioBufferList->mNumberBuffers; i++) - { - free (audioBufferList->mBuffers[i].mData); - } - free (audioBufferList); -} - -//------------------------------------------------------------------------ -NSString* AudioIO::kConnectionStateChange = @"AudioIO::kConnectionStateChange"; - -//------------------------------------------------------------------------ -AudioIO::AudioIO () -: remoteIO (0) -, graph (0) -, maxFrames (4096) -, ioBufferList (0) -, interAppAudioConnected (false) -, internalState (kUninitialized) -, staticTempo (120.) -{ - sampleRate = [[AVAudioSession sharedInstance] sampleRate]; - memset (&hostCallback, 0, sizeof (HostCallbackInfo)); - - MidiIO::instance (); -} - -//------------------------------------------------------------------------ -AudioIO::~AudioIO () -{ - if (ioBufferList) - freeAudioBufferList (ioBufferList); -} - -//------------------------------------------------------------------------ -AudioIO* AudioIO::instance () -{ - static AudioIO gInstance; - return &gInstance; -} - -//------------------------------------------------------------------------ -tresult AudioIO::setupRemoteIO (OSType type) -{ - if (remoteIO != 0) - { - AudioStreamBasicDescription streamFormat = {}; - streamFormat.mChannelsPerFrame = 2; - streamFormat.mSampleRate = sampleRate; - streamFormat.mFormatID = kAudioFormatLinearPCM; - streamFormat.mFormatFlags = kAudioFormatFlagsNativeFloatPacked | kAudioFormatFlagIsNonInterleaved; - streamFormat.mBytesPerFrame = streamFormat.mBytesPerPacket = sizeof(Float32); - streamFormat.mBitsPerChannel = 32; - streamFormat.mFramesPerPacket = 1; - - OSStatus status = AudioUnitSetProperty (remoteIO, - kAudioUnitProperty_StreamFormat, - kAudioUnitScope_Output, - 1, - &streamFormat, - sizeof(streamFormat)); - if (status != noErr) - return kInternalError; - - status = AudioUnitSetProperty ( remoteIO, - kAudioUnitProperty_StreamFormat, - kAudioUnitScope_Input, - 0, - &streamFormat, - sizeof(streamFormat)); - if (status != noErr) - return kInternalError; - - status = AudioUnitSetProperty ( remoteIO, - kAudioUnitProperty_MaximumFramesPerSlice, - kAudioUnitScope_Global, - 1, - &maxFrames, - sizeof(maxFrames)); - - if (status != noErr) - return kInternalError; - - status = AudioUnitSetProperty ( remoteIO, - kAudioUnitProperty_MaximumFramesPerSlice, - kAudioUnitScope_Global, - 0, - &maxFrames, - sizeof(maxFrames)); - - if (status != noErr) - return kInternalError; - - bool needInput = (type == kAudioUnitType_RemoteGenerator || type == kAudioUnitType_RemoteInstrument) == false; - UInt32 flag = 1; - if (needInput) - { - // enable IO Input - status = AudioUnitSetProperty (remoteIO, - kAudioOutputUnitProperty_EnableIO, - kAudioUnitScope_Input, - 1, - &flag, - sizeof(flag)); - if (status != noErr) - return kInternalError; - } - - // enable IO Output - status = AudioUnitSetProperty (remoteIO, - kAudioOutputUnitProperty_EnableIO, - kAudioUnitScope_Output, - 0, - &flag, - sizeof(flag)); - if (status != noErr) - return kInternalError; - - AURenderCallbackStruct renderCallback = {}; - if (needInput) - { - renderCallback.inputProc = inputCallbackStatic; - renderCallback.inputProcRefCon = this; - status = AudioUnitSetProperty (remoteIO, kAudioOutputUnitProperty_SetInputCallback, kAudioUnitScope_Global, 1, &renderCallback, sizeof (renderCallback)); - if (status != noErr) - return kInternalError; - } - - renderCallback.inputProc = renderCallbackStatic; - renderCallback.inputProcRefCon = this; - status = AudioUnitSetProperty (remoteIO, kAudioUnitProperty_SetRenderCallback, kAudioUnitScope_Global, 0, &renderCallback, sizeof (renderCallback)); - if (status != noErr) - return kInternalError; - - if (type == kAudioUnitType_RemoteInstrument || type == kAudioUnitType_RemoteMusicEffect) - { - AudioOutputUnitMIDICallbacks callBackStruct = {}; - callBackStruct.userData = this; - callBackStruct.MIDIEventProc = midiEventCallbackStatic; - status = AudioUnitSetProperty (remoteIO, kAudioOutputUnitProperty_MIDICallbacks, kAudioUnitScope_Global, 0, &callBackStruct, sizeof (callBackStruct)); - if (status != noErr) - { - NSLog (@"Setting MIDICallback on OutputUnit failed"); - } - } - - if (ioBufferList) - freeAudioBufferList (ioBufferList); - ioBufferList = createBuffers (streamFormat.mChannelsPerFrame, maxFrames, streamFormat.mBytesPerFrame); - if (ioBufferList == 0) - return kOutOfMemory; - - status = AudioUnitAddPropertyListener (remoteIO, kAudioUnitProperty_IsInterAppConnected, propertyChangeStatic, this); - status = AudioUnitAddPropertyListener (remoteIO, kAudioOutputUnitProperty_HostTransportState, propertyChangeStatic, this); - - return kResultTrue; - } - return kResultFalse; -} - -//------------------------------------------------------------------------ -tresult AudioIO::setupAUGraph (OSType type) -{ - if (graph == 0) - { - OSStatus status = NewAUGraph (&graph); - if (status != noErr) - return kInternalError; - - AudioComponentDescription iOUnitDescription; - iOUnitDescription.componentManufacturer = kAudioUnitManufacturer_Apple; - iOUnitDescription.componentFlags = 0; - iOUnitDescription.componentFlagsMask = 0; - iOUnitDescription.componentType = kAudioUnitType_Output; - iOUnitDescription.componentSubType = kAudioUnitSubType_RemoteIO; - - AUNode remoteIONode; - status = AUGraphAddNode (graph, &iOUnitDescription, &remoteIONode); - if (status != noErr) - return kInternalError; - status = AUGraphOpen(graph); - if (status != noErr) - return kInternalError; - status = AUGraphNodeInfo (graph, remoteIONode, 0, &remoteIO); - if (status != noErr) - return kInternalError; - return setupRemoteIO (type); - } - return kResultFalse; -} - -//------------------------------------------------------------------------ -void AudioIO::updateInterAppAudioConnectionState () -{ - if (remoteIO) - { - UInt32 connected; - UInt32 dataSize = sizeof (connected); - OSStatus status = AudioUnitGetProperty(remoteIO, kAudioUnitProperty_IsInterAppConnected, kAudioUnitScope_Global, 0, &connected, &dataSize); - if (status == noErr) - { - if (interAppAudioConnected != connected) - { - if (connected) - { - UInt32 size = sizeof (HostCallbackInfo); - status = AudioUnitGetProperty (remoteIO, kAudioUnitProperty_HostCallbacks, kAudioUnitScope_Global, 0, &hostCallback, &size); - } - else - { - memset (&hostCallback, 0, sizeof (HostCallbackInfo)); - } - interAppAudioConnected = connected > 0 ? true : false; - [[NSNotificationCenter defaultCenter] postNotificationName:kConnectionStateChange object:nil]; - } - } - } -} - -//------------------------------------------------------------------------ -tresult AudioIO::init (OSType type, OSType subType, OSType manufacturer, CFStringRef name) -{ - tresult result = setupAUGraph (type); - if (result != kResultTrue) - return result; - - AudioComponentDescription desc = { type, subType, manufacturer, 0, 0 }; - OSStatus status = AudioOutputUnitPublish (&desc, name, 0, remoteIO); - if (status != noErr) - { - NSLog (@"AudioOutputUnitPublish failed with status:%d", (int)status); - } - internalState = kInitialized; - - return result; -} - -//------------------------------------------------------------------------ -void AudioIO::setAudioSessionActive (bool state) -{ - NSError* error; - - AVAudioSession *session = [AVAudioSession sharedInstance]; - [session setPreferredSampleRate: sampleRate error:&error]; - [session setCategory: AVAudioSessionCategoryPlayback withOptions: AVAudioSessionCategoryOptionMixWithOthers error:&error]; - [session setActive:(state ? YES : NO) error:&error]; -} - -//------------------------------------------------------------------------ -tresult AudioIO::start () -{ - if (internalState == kInitialized) - { - bool appIsActive = [UIApplication sharedApplication].applicationState == UIApplicationStateActive; - if (!(appIsActive || interAppAudioConnected)) - { - return kResultFalse; - } - setAudioSessionActive (true); - - Boolean graphInitialized = true; - OSStatus status = AUGraphIsInitialized (graph, &graphInitialized); - if (status != noErr) - return kInternalError; - - if (graphInitialized == false) - { - status = AUGraphInitialize (graph); - if (status != noErr) - return kInternalError; - updateInterAppAudioConnectionState (); - } - - for (auto processor : audioProcessors) - { - processor->willStartAudio (this); - } - status = AUGraphStart (graph); - if (status == noErr) - { - internalState = kStarted; - updateInterAppAudioConnectionState (); - return kResultTrue; - } - return kInternalError; - } - - return kResultFalse; -} - -//------------------------------------------------------------------------ -tresult AudioIO::stop () -{ - if (internalState == kStarted) - { - if (AUGraphStop (graph) == noErr) - { - for (auto processor : audioProcessors) - { - processor->didStopAudio (this); - } - internalState = kInitialized; - if (interAppAudioConnected == false) - setAudioSessionActive (false); - return kResultTrue; - } - } - return kResultFalse; -} - -//------------------------------------------------------------------------ -tresult AudioIO::addProcessor (IAudioIOProcessor* processor) -{ - if (internalState == kInitialized) - { - audioProcessors.push_back (processor); - MidiIO::instance ().addProcessor (processor); - return kResultTrue; - } - return kResultFalse; -} - -//------------------------------------------------------------------------ -tresult AudioIO::removeProcessor (IAudioIOProcessor* processor) -{ - if (internalState == kInitialized) - { - auto it = std::find (audioProcessors.begin (), audioProcessors.end (), processor); - if (it != audioProcessors.end ()) - { - audioProcessors.erase (it); - MidiIO::instance ().removeProcessor (processor); - return kResultTrue; - } - } - return kResultFalse; -} - -//------------------------------------------------------------------------ -bool AudioIO::switchToHost () -{ - if (remoteIO && interAppAudioConnected) - { - CFURLRef instrumentUrl; - UInt32 dataSize = sizeof(instrumentUrl); - OSStatus result = AudioUnitGetProperty (remoteIO, kAudioUnitProperty_PeerURL, kAudioUnitScope_Global, 0, &instrumentUrl, &dataSize); - if (result == noErr) - { - [[UIApplication sharedApplication] openURL:(__bridge NSURL*)instrumentUrl]; - return true; - } - } - return false; -} - -//------------------------------------------------------------------------ -bool AudioIO::sendRemoteControlEvent (AudioUnitRemoteControlEvent event) -{ - if (remoteIO && interAppAudioConnected) - { - UInt32 controlEvent = event; - UInt32 dataSize = sizeof (controlEvent); - OSStatus status = AudioUnitSetProperty (remoteIO, kAudioOutputUnitProperty_RemoteControlToHost, kAudioUnitScope_Global, 0, &controlEvent, dataSize); - return status == noErr; - } - return false; -} - -//------------------------------------------------------------------------ -UIImage* AudioIO::getHostIcon () -{ - if (remoteIO && interAppAudioConnected) - { - return AudioOutputUnitGetHostIcon (remoteIO, 128); - } - return nil; -} - -//------------------------------------------------------------------------ -bool AudioIO::getBeatAndTempo (Float64& beat, Float64& tempo) -{ - if (hostCallback.beatAndTempoProc) - { - if (hostCallback.beatAndTempoProc (hostCallback.hostUserData, &beat, &tempo) == noErr) - return true; - } - tempo = staticTempo; - beat = 0; - return true; -} - -//------------------------------------------------------------------------ -bool AudioIO::getMusicalTimeLocation (UInt32& deltaSampleOffset, Float32& timeSigNumerator, UInt32& timeSigDenominator, Float64& downBeat) -{ - if (hostCallback.musicalTimeLocationProc) - { - if (hostCallback.musicalTimeLocationProc (hostCallback.hostUserData, &deltaSampleOffset, &timeSigNumerator, &timeSigDenominator, &downBeat) == noErr) - return true; - } - return false; -} - -//------------------------------------------------------------------------ -bool AudioIO::getTransportState (Boolean& isPlaying, Boolean& isRecording, Boolean& transportStateChanged, Float64& sampleInTimeLine, Boolean& isCycling, Float64& cycleStartBeat, Float64& cycleEndBeat) -{ - if (hostCallback.transportStateProc2) - { - if (hostCallback.transportStateProc2 (hostCallback.hostUserData, &isPlaying, &isRecording, &transportStateChanged, &sampleInTimeLine, &isCycling, &cycleStartBeat, &cycleEndBeat) == noErr) - return true; - } - return false; -} - -//------------------------------------------------------------------------ -FORCE_INLINE void AudioIO::remoteIOPropertyChanged (AudioUnitPropertyID inID, AudioUnitScope inScope, AudioUnitElement inElement) -{ - if (inID == kAudioUnitProperty_IsInterAppConnected) - { - bool wasConnected = interAppAudioConnected; - updateInterAppAudioConnectionState (); - if (wasConnected != interAppAudioConnected) - { - stop (); - start (); - } - } -} - -//------------------------------------------------------------------------ -FORCE_INLINE OSStatus AudioIO::renderCallback (AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList *ioData) -{ - if (ioData->mNumberBuffers == ioBufferList->mNumberBuffers) - { - for (uint32 i = 0; i < ioData->mNumberBuffers; i++) - { - memcpy (ioData->mBuffers[i].mData, ioBufferList->mBuffers[i].mData, ioData->mBuffers[i].mDataByteSize); - } - bool outputIsSilence = ioActionFlags ? *ioActionFlags & kAudioUnitRenderAction_OutputIsSilence : false; - for (auto processor : audioProcessors) - { - outputIsSilence = false; - processor->process (inTimeStamp, inBusNumber, inNumberFrames, ioData, outputIsSilence, this); - } - if (ioActionFlags) - { - *ioActionFlags = outputIsSilence ? kAudioUnitRenderAction_OutputIsSilence : 0; - } - } - return noErr; -} - -//------------------------------------------------------------------------ -FORCE_INLINE OSStatus AudioIO::inputCallback (AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList *ioData) -{ - OSStatus status = AudioUnitRender (remoteIO, ioActionFlags, inTimeStamp, inBusNumber, inNumberFrames, ioBufferList); - return status; -} - -//------------------------------------------------------------------------ -FORCE_INLINE void AudioIO::midiEventCallback (UInt32 inStatus, UInt32 inData1, UInt32 inData2, UInt32 inOffsetSampleFrame) -{ - for (auto processor : audioProcessors) - { - processor->onMIDIEvent (inStatus, inData1, inData2, inOffsetSampleFrame, true); - } -} - -//------------------------------------------------------------------------ -OSStatus AudioIO::inputCallbackStatic (void *inRefCon, AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList *ioData) -{ - AudioIO* io = (AudioIO*)inRefCon; - return io->inputCallback (ioActionFlags, inTimeStamp, inBusNumber, inNumberFrames, ioData); -} - -//------------------------------------------------------------------------ -OSStatus AudioIO::renderCallbackStatic (void *inRefCon, AudioUnitRenderActionFlags *ioActionFlags, const AudioTimeStamp *inTimeStamp, UInt32 inBusNumber, UInt32 inNumberFrames, AudioBufferList *ioData) -{ - AudioIO* io = (AudioIO*)inRefCon; - return io->renderCallback (ioActionFlags, inTimeStamp, inBusNumber, inNumberFrames, ioData); -} - -//------------------------------------------------------------------------ -void AudioIO::propertyChangeStatic (void *inRefCon, AudioUnit inUnit, AudioUnitPropertyID inID, AudioUnitScope inScope, AudioUnitElement inElement) -{ - AudioIO* audioIO = (AudioIO*)inRefCon; - audioIO->remoteIOPropertyChanged(inID, inScope, inElement); -} - -//------------------------------------------------------------------------ -void AudioIO::midiEventCallbackStatic (void *inRefCon, UInt32 inStatus, UInt32 inData1, UInt32 inData2, UInt32 inOffsetSampleFrame) -{ - AudioIO* audioIO = (AudioIO*)inRefCon; - audioIO->midiEventCallback(inStatus, inData1, inData2, inOffsetSampleFrame); -} - -}}} diff --git a/vst/public.sdk/source/vst/interappaudio/HostApp.h b/vst/public.sdk/source/vst/interappaudio/HostApp.h deleted file mode 100644 index 78381ad0..00000000 --- a/vst/public.sdk/source/vst/interappaudio/HostApp.h +++ /dev/null @@ -1,91 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/interappaudio/HostApp.h -// Created by : Steinberg, 08/2013. -// Description : VST 3 InterAppAudio -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#pragma once - -/// \cond ignore - -#import "base/source/fobject.h" -#import "public.sdk/source/vst/hosting/hostclasses.h" -#import "pluginterfaces/vst/ivstinterappaudio.h" - -namespace Steinberg { -namespace Vst { -namespace InterAppAudio { - -class VST3Plugin; - -//----------------------------------------------------------------------------- -class InterAppAudioHostApp : public FObject, public HostApplication, public IInterAppAudioHost -{ -public: -//----------------------------------------------------------------------------- - static InterAppAudioHostApp* instance (); - - void setPlugin (VST3Plugin* plugin); - VST3Plugin* getPlugin () const { return plugin; } - -//----------------------------------------------------------------------------- -// IInterAppAudioHost - tresult PLUGIN_API getScreenSize (ViewRect* size, float* scale) override; - tresult PLUGIN_API connectedToHost () override; - tresult PLUGIN_API switchToHost () override; - tresult PLUGIN_API sendRemoteControlEvent (uint32 event) override; - tresult PLUGIN_API getHostIcon (void** icon) override; - tresult PLUGIN_API scheduleEventFromUI (Event& event) override; - IInterAppAudioPresetManager* PLUGIN_API createPresetManager (const TUID& cid) override; - tresult PLUGIN_API showSettingsView () override; - -//----------------------------------------------------------------------------- -// HostApplication - tresult PLUGIN_API getName (String128 name) override; - - OBJ_METHODS(InterAppAudioHostApp, FObject) - REFCOUNT_METHODS(FObject) - DEFINE_INTERFACES - DEF_INTERFACE(IHostApplication) - DEF_INTERFACE(IInterAppAudioHost) - END_DEFINE_INTERFACES(FObject) -protected: - InterAppAudioHostApp (); - - VST3Plugin* plugin; -}; - -//------------------------------------------------------------------------ -} // namespace InterAppAudio -} // namespace Vst -} // namespace Steinberg - -/// \endcond diff --git a/vst/public.sdk/source/vst/interappaudio/HostApp.mm b/vst/public.sdk/source/vst/interappaudio/HostApp.mm deleted file mode 100644 index 2ac94a28..00000000 --- a/vst/public.sdk/source/vst/interappaudio/HostApp.mm +++ /dev/null @@ -1,164 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/interappaudio/HostApp.mm -// Created by : Steinberg, 08/2013. -// Description : VST 3 InterAppAudio -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#import "HostApp.h" -#import "AudioIO.h" -#import "VST3Plugin.h" -#import "PresetManager.h" -#import "SettingsViewController.h" -#import "base/source/updatehandler.h" -#import "pluginterfaces/gui/iplugview.h" - -namespace Steinberg { -namespace Vst { -namespace InterAppAudio { - -//------------------------------------------------------------------------ -InterAppAudioHostApp* InterAppAudioHostApp::instance () -{ - static InterAppAudioHostApp gInstance; - return &gInstance; -} - -//----------------------------------------------------------------------------- -InterAppAudioHostApp::InterAppAudioHostApp () -: plugin (0) -{ -} - -//----------------------------------------------------------------------------- -void InterAppAudioHostApp::setPlugin (VST3Plugin* plugin) -{ - this->plugin = plugin; -} - -//----------------------------------------------------------------------------- -tresult PLUGIN_API InterAppAudioHostApp::getName (String128 name) -{ - String str ("InterAppAudioHost"); - str.copyTo (name, 0, 127); - return kResultTrue; -} - -//----------------------------------------------------------------------------- -tresult PLUGIN_API InterAppAudioHostApp::getScreenSize (ViewRect* size, float* scale) -{ - if (size) - { - UIScreen* screen = [UIScreen mainScreen]; - CGSize s = [screen currentMode].size; - UIWindow* window = [[[UIApplication sharedApplication] windows] objectAtIndex:0]; - if (window) - { - NSArray* subViews = [window subviews]; - if ([subViews count] == 1) - { - s = [[[window subviews] objectAtIndex:0] bounds].size; - } - } - size->left = 0; - size->top = 0; - size->right = s.width; - size->bottom = s.height; - if (scale) - { - *scale = screen.scale; - } - return kResultTrue; - } - return kInvalidArgument; -} - -//----------------------------------------------------------------------------- -tresult PLUGIN_API InterAppAudioHostApp::connectedToHost () -{ - return AudioIO::instance ()->getInterAppAudioConnected () ? kResultTrue : kResultFalse; -} - -//----------------------------------------------------------------------------- -tresult PLUGIN_API InterAppAudioHostApp::switchToHost () -{ - return AudioIO::instance ()->switchToHost () ? kResultTrue : kResultFalse; -} - -//----------------------------------------------------------------------------- -tresult PLUGIN_API InterAppAudioHostApp::sendRemoteControlEvent (uint32 event) -{ - return AudioIO::instance ()->sendRemoteControlEvent (event) ? kResultTrue : kResultFalse; -} - -//----------------------------------------------------------------------------- -tresult PLUGIN_API InterAppAudioHostApp::getHostIcon (void** icon) -{ - if (icon) - { - UIImage* hostIcon = AudioIO::instance ()->getHostIcon (); - if (hostIcon) - { - CGImageRef cgImage = [hostIcon CGImage]; - if (cgImage) - { - *icon = cgImage; - return kResultTrue; - } - } - return kNotImplemented; - } - return kInvalidArgument; -} - -//----------------------------------------------------------------------------- -tresult PLUGIN_API InterAppAudioHostApp::scheduleEventFromUI (Event& event) -{ - if (plugin) - { - return plugin->scheduleEventFromUI (event); - } - return kNotInitialized; -} - -//----------------------------------------------------------------------------- -IInterAppAudioPresetManager* PLUGIN_API InterAppAudioHostApp::createPresetManager (const TUID& cid) -{ - return plugin ? new PresetManager (plugin, cid) : nullptr; -} - -//----------------------------------------------------------------------------- -tresult PLUGIN_API InterAppAudioHostApp::showSettingsView () -{ - showIOSettings (); - return kResultTrue; -} - -}}} diff --git a/vst/public.sdk/source/vst/interappaudio/MidiIO.h b/vst/public.sdk/source/vst/interappaudio/MidiIO.h deleted file mode 100644 index 68e03b22..00000000 --- a/vst/public.sdk/source/vst/interappaudio/MidiIO.h +++ /dev/null @@ -1,90 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/interappaudio/MidiIO.h -// Created by : Steinberg, 09/2013. -// Description : VST 3 InterAppAudio -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#pragma once - -#include -#include "AudioIO.h" -#include - -namespace Steinberg { -namespace Vst { -namespace InterAppAudio { - -//----------------------------------------------------------------------------- -class MidiIO -{ -public: - static MidiIO& instance (); - - bool setEnabled (bool state); - bool isEnabled () const; - - // MIDI Network is experimental, don't use yet - void setMidiNetworkEnabled (bool state); - bool isMidiNetworkEnabled () const; - void setMidiNetworkPolicy (NSUInteger policy); - NSUInteger getMidiNetworkPolicy () const; - - void addProcessor (IMidiProcessor* processor); - void removeProcessor (IMidiProcessor* processor); - -//----------------------------------------------------------------------------- -private: - MidiIO (); - ~MidiIO (); - - void onInput (const MIDIPacketList *pktlist); - void onSourceAdded (MIDIObjectRef source); - void onSetupChanged (); - void disconnectSources (); - - MIDIClientRef client; - MIDIPortRef inputPort; - MIDIEndpointRef destPort; - - typedef std::vector MidiProcessors; - MidiProcessors midiProcessors; - - typedef std::vector ConnectionList; - ConnectionList connectedSources; - - static void readProc (const MIDIPacketList *pktlist, void *readProcRefCon, void *srcConnRefCon); - static void notifyProc (const MIDINotification *message, void *refCon); -}; - -//------------------------------------------------------------------------ -} // namespace InterAppAudio -} // namespace Vst -} // namespace Steinberg diff --git a/vst/public.sdk/source/vst/interappaudio/MidiIO.mm b/vst/public.sdk/source/vst/interappaudio/MidiIO.mm deleted file mode 100644 index 9c2e07c0..00000000 --- a/vst/public.sdk/source/vst/interappaudio/MidiIO.mm +++ /dev/null @@ -1,221 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/interappaudio/MidiIO.mm -// Created by : Steinberg, 09/2013. -// Description : VST 3 InterAppAudio -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#import "MidiIO.h" -#import - -namespace Steinberg { -namespace Vst { -namespace InterAppAudio { - -//----------------------------------------------------------------------------- -MidiIO& MidiIO::instance () -{ - static MidiIO gInstance; - return gInstance; -} - -//----------------------------------------------------------------------------- -MidiIO::MidiIO () -: client (0) -, inputPort (0) -, destPort (0) -{ -} - -//----------------------------------------------------------------------------- -MidiIO::~MidiIO () -{ - setEnabled (false); -} - -//----------------------------------------------------------------------------- -void MidiIO::addProcessor (IMidiProcessor* processor) -{ - midiProcessors.push_back (processor); -} - -//----------------------------------------------------------------------------- -void MidiIO::removeProcessor (IMidiProcessor* processor) -{ - auto it = std::find (midiProcessors.begin (), midiProcessors.end (), processor); - if (it != midiProcessors.end ()) - { - midiProcessors.erase (it); - } -} - -//----------------------------------------------------------------------------- -bool MidiIO::isEnabled () const -{ - return client != 0; -} - -//----------------------------------------------------------------------------- -bool MidiIO::setEnabled (bool state) -{ - if (state) - { - if (client) - return true; - - OSStatus err; - NSString* name = [[NSBundle mainBundle] bundleIdentifier]; - if (err = MIDIClientCreate ((__bridge CFStringRef)name, notifyProc, this, &client) != noErr) - return false; - - if (err = MIDIInputPortCreate (client, CFSTR("Input"), readProc, this, &inputPort) != noErr) - { - MIDIClientDispose (client); - client = 0; - return false; - } - name = [[[NSBundle mainBundle] infoDictionary] valueForKey:@"CFBundleDisplayName"]; - if (err = MIDIDestinationCreate (client, (__bridge CFStringRef)name, readProc, this, &destPort) != noErr) - { - MIDIPortDispose (inputPort); - inputPort = 0; - MIDIClientDispose (client); - client = 0; - return false; - } - } - else - { - if (client == 0) - return true; - disconnectSources (); - MIDIEndpointDispose (destPort); - destPort = 0; - MIDIPortDispose (inputPort); - inputPort = 0; - MIDIClientDispose (client); - client = 0; - } - return true; -} - -//----------------------------------------------------------------------------- -void MidiIO::setMidiNetworkEnabled (bool state) -{ - if (inputPort && isMidiNetworkEnabled() != state) - { - if (!state) - { - MIDIPortDisconnectSource (inputPort, [MIDINetworkSession defaultSession].sourceEndpoint); - } - [MIDINetworkSession defaultSession].enabled = state; - if (state) - { - MIDIPortConnectSource (inputPort, [MIDINetworkSession defaultSession].sourceEndpoint, 0); - } - } -} - -//----------------------------------------------------------------------------- -bool MidiIO::isMidiNetworkEnabled () const -{ - return [MIDINetworkSession defaultSession].isEnabled; -} - -//----------------------------------------------------------------------------- -void MidiIO::setMidiNetworkPolicy (NSUInteger policy) -{ - [MIDINetworkSession defaultSession].connectionPolicy = policy; -} - -//----------------------------------------------------------------------------- -NSUInteger MidiIO::getMidiNetworkPolicy () const -{ - return [MIDINetworkSession defaultSession].connectionPolicy; -} - -//----------------------------------------------------------------------------- -void MidiIO::onInput (const MIDIPacketList *pktlist) -{ - const MIDIPacket* packet = &pktlist->packet[0]; - for (UInt32 i = 0; i < pktlist->numPackets; i++) - { - for (auto processor : midiProcessors) - { - processor->onMIDIEvent (packet->data[0], packet->data[1], packet->data[2], 0, false); - } - packet = MIDIPacketNext (packet); - } -} - -//----------------------------------------------------------------------------- -void MidiIO::onSourceAdded (MIDIObjectRef source) -{ - connectedSources.push_back ((MIDIEndpointRef)source); - MIDIPortConnectSource (inputPort, (MIDIEndpointRef)source, NULL); -} - -//----------------------------------------------------------------------------- -void MidiIO::disconnectSources () -{ - for (auto source : connectedSources) - MIDIPortDisconnectSource (inputPort, source); - connectedSources.clear (); -} - -//----------------------------------------------------------------------------- -void MidiIO::onSetupChanged () -{ - disconnectSources (); - ItemCount numSources = MIDIGetNumberOfSources (); - for (ItemCount i = 0; i < numSources; i++) - { - onSourceAdded (MIDIGetSource (i)); - } -} - -//----------------------------------------------------------------------------- -void MidiIO::readProc (const MIDIPacketList *pktlist, void *readProcRefCon, void *srcConnRefCon) -{ - MidiIO* io = static_cast(readProcRefCon); - io->onInput (pktlist); -} - -//----------------------------------------------------------------------------- -void MidiIO::notifyProc (const MIDINotification *message, void *refCon) -{ - if (message->messageID == kMIDIMsgSetupChanged) - { - MidiIO* mio = (MidiIO*)refCon; - mio->onSetupChanged (); - } -} - -}}} // namespaces diff --git a/vst/public.sdk/source/vst/interappaudio/PresetBrowserView.xib b/vst/public.sdk/source/vst/interappaudio/PresetBrowserView.xib deleted file mode 100644 index d9b13034..00000000 --- a/vst/public.sdk/source/vst/interappaudio/PresetBrowserView.xib +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/vst/public.sdk/source/vst/interappaudio/PresetBrowserViewController.h b/vst/public.sdk/source/vst/interappaudio/PresetBrowserViewController.h deleted file mode 100644 index c4074074..00000000 --- a/vst/public.sdk/source/vst/interappaudio/PresetBrowserViewController.h +++ /dev/null @@ -1,57 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/interappaudio/PresetBrowserViewController.h -// Created by : Steinberg, 09/2013 -// Description : VST 3 InterAppAudio -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#pragma once - -/// \cond ignore - -#ifdef __OBJC__ - -#import -#import - -//----------------------------------------------------------------------------- -@interface PresetBrowserViewController : UIViewController -//----------------------------------------------------------------------------- - -- (id)initWithCallback:(std::function)callback; - -- (void)setFactoryPresets:(NSArray*)factoryPresets userPresets:(NSArray*)userPresets; - -@end - -#endif // __OBJC__ - -/// \endcond - diff --git a/vst/public.sdk/source/vst/interappaudio/PresetBrowserViewController.mm b/vst/public.sdk/source/vst/interappaudio/PresetBrowserViewController.mm deleted file mode 100644 index fdbd40aa..00000000 --- a/vst/public.sdk/source/vst/interappaudio/PresetBrowserViewController.mm +++ /dev/null @@ -1,270 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/interappaudio/PresetBrowserViewController.mm -// Created by : Steinberg, 09/2013 -// Description : VST 3 InterAppAudio -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - - -#import "PresetBrowserViewController.h" -#import "pluginterfaces/base/funknown.h" - -static NSTimeInterval kAnimationTime = 0.2; - -//------------------------------------------------------------------------ -@interface PresetBrowserViewController () -//------------------------------------------------------------------------ -{ - IBOutlet UITableView* presetTableView; - IBOutlet UIView* containerView; - - std::function callback; - Steinberg::FUID uid; -} - -@property (strong) NSArray* factoryPresets; -@property (strong) NSArray* userPresets; -@property (strong) NSArray* displayPresets; -@property (assign) BOOL editMode; - -@end - -//------------------------------------------------------------------------ -@implementation PresetBrowserViewController -//------------------------------------------------------------------------ - -//------------------------------------------------------------------------ -- (id)initWithCallback:(std::function)_callback -{ - self = [super initWithNibName:@"PresetBrowserView" bundle:nil]; - if (self) - { - callback = _callback; - - self.view.alpha = 0.; - - UIViewController* rootViewController = [[UIApplication sharedApplication].windows[0] rootViewController]; - [rootViewController addChildViewController:self]; - [rootViewController.view addSubview:self.view]; - - [UIView animateWithDuration:kAnimationTime animations:^{ - self.view.alpha = 1.; - }]; - } - return self; -} - -//------------------------------------------------------------------------ -- (void)setFactoryPresets:(NSArray*)factoryPresets userPresets:(NSArray*)userPresets -{ - self.factoryPresets = factoryPresets; - self.userPresets = userPresets; - [self updatePresetArray]; - dispatch_async (dispatch_get_main_queue (), ^{ - [presetTableView reloadData]; - }); -} - -//------------------------------------------------------------------------ -- (void)viewDidLoad -{ - [super viewDidLoad]; - - containerView.layer.shadowOpacity = 0.5; - containerView.layer.shadowOffset = CGSizeMake (5, 5); - containerView.layer.shadowRadius = 5; -} - -//------------------------------------------------------------------------ -- (void)didReceiveMemoryWarning -{ - [super didReceiveMemoryWarning]; -} - -//------------------------------------------------------------------------ -- (void)updatePresetArray -{ - if (self.userPresets) - { - self.displayPresets = [[self.factoryPresets arrayByAddingObjectsFromArray:self.userPresets] sortedArrayUsingComparator:^NSComparisonResult (NSURL* obj1, NSURL* obj2) { - return [[obj1 lastPathComponent] caseInsensitiveCompare:[obj2 lastPathComponent]]; - }]; - } - else - { - self.displayPresets = self.factoryPresets; - } -} - -//------------------------------------------------------------------------ -- (void)removeSelf -{ - [UIView animateWithDuration:kAnimationTime animations:^{ - self.view.alpha = 0.; - } completion:^(BOOL finished) { - [self.view removeFromSuperview]; - [self removeFromParentViewController]; - }]; -} - -//------------------------------------------------------------------------ -- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath -{ - NSURL* url = [self.displayPresets objectAtIndex:indexPath.row]; - if (url) - { - callback ([[url path] UTF8String]); - } - [self removeSelf]; -} - -//------------------------------------------------------------------------ -- (IBAction)toggleEditMode:(id)sender -{ - self.editMode = !self.editMode; - if (self.editMode) - { - NSMutableArray* indexPaths = [NSMutableArray new]; - for (NSURL* url in self.factoryPresets) - { - NSUInteger index = [self.displayPresets indexOfObjectIdenticalTo:url]; - [indexPaths addObject:[NSIndexPath indexPathForRow:index inSection:0]]; - } - [presetTableView deleteRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationFade]; - } - else - { - [self updatePresetArray]; - NSMutableArray* indexPaths = [NSMutableArray new]; - for (NSURL* url in self.factoryPresets) - { - NSUInteger index = [self.displayPresets indexOfObjectIdenticalTo:url]; - [indexPaths addObject:[NSIndexPath indexPathForRow:index inSection:0]]; - } - [presetTableView insertRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationFade]; - } - [presetTableView setEditing:self.editMode animated:YES]; -} - -//------------------------------------------------------------------------ -- (IBAction)cancel:(id)sender -{ - if (callback) - { - callback (0); - } - [self removeSelf]; -} - -//------------------------------------------------------------------------ -- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section -{ - if (self.editMode) - { - return [self.userPresets count]; - } - return [self.displayPresets count]; -} - -//------------------------------------------------------------------------ -- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath -{ - UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"PresetBrowserCell"]; - if (cell == nil) - { - cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"PresetBrowserCell"]; - } - - cell.backgroundColor = [UIColor clearColor]; - - NSURL* presetUrl = nil; - if (self.editMode) - { - presetUrl = [self.userPresets objectAtIndex:indexPath.row]; - cell.detailTextLabel.text = @"User"; - } - else - { - presetUrl = [self.displayPresets objectAtIndex:indexPath.row]; - if ([self.factoryPresets indexOfObject:presetUrl] == NSNotFound) - { - cell.detailTextLabel.text = @"User"; - } - else - { - cell.detailTextLabel.text = @"Factory"; - } - } - - cell.textLabel.text = [[presetUrl lastPathComponent] stringByDeletingPathExtension]; - - return cell; -} - -//------------------------------------------------------------------------ -- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath -{ - if (self.editMode) - { - return YES; - } - return NO; -} - -//------------------------------------------------------------------------ -- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath -{ - NSURL* presetUrl = [self.userPresets objectAtIndex:indexPath.row]; - if (presetUrl) - { - NSFileManager* fs = [NSFileManager defaultManager]; - NSError* error = nil; - if ([fs removeItemAtURL:presetUrl error:&error] == NO) - { - UIAlertView *alert = [[UIAlertView alloc] - initWithTitle:[error localizedDescription] - message:[error localizedRecoverySuggestion] - delegate:nil - cancelButtonTitle:NSLocalizedString(@"Dismiss", @"") - otherButtonTitles:nil]; - - [alert show]; - } - else - { - NSMutableArray* newArray = [NSMutableArray arrayWithArray:self.userPresets]; - [newArray removeObject:presetUrl]; - self.userPresets = newArray; - [presetTableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic]; - } - } -} - -@end diff --git a/vst/public.sdk/source/vst/interappaudio/PresetManager.h b/vst/public.sdk/source/vst/interappaudio/PresetManager.h deleted file mode 100644 index 12f45113..00000000 --- a/vst/public.sdk/source/vst/interappaudio/PresetManager.h +++ /dev/null @@ -1,90 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/interappaudio/PresetManager.h -// Created by : Steinberg, 10/2013 -// Description : VST 3 InterAppAudio -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#pragma once - -#include "VST3Plugin.h" -#include "pluginterfaces/vst/ivstinterappaudio.h" -#include "base/source/fstring.h" - -#if __OBJC__ -@class NSArray, PresetBrowserViewController, PresetSaveViewController; -#else -struct NSArray; -struct PresetBrowserViewController; -struct PresetSaveViewController; -#endif - -namespace Steinberg { -namespace Vst { -namespace InterAppAudio { - -class PresetManager : public FObject, public IInterAppAudioPresetManager -{ -public: - PresetManager (VST3Plugin* plugin, const TUID& cid); - - tresult PLUGIN_API runLoadPresetBrowser () override; - tresult PLUGIN_API runSavePresetBrowser () override; - tresult PLUGIN_API loadNextPreset () override; - tresult PLUGIN_API loadPreviousPreset () override; - - DEFINE_INTERFACES - DEF_INTERFACE(IInterAppAudioPresetManager) - END_DEFINE_INTERFACES(FObject) - REFCOUNT_METHODS(FObject) - -private: - enum PresetPathType { - kFactory, - kUser - }; - NSArray* getPresetPaths (PresetPathType type); - - tresult loadPreset (bool next); - tresult loadPreset (const char* path); - void savePreset (const char* path); - - VST3Plugin* plugin; - PresetBrowserViewController* visiblePresetBrowserViewController; - PresetSaveViewController* visibleSavePresetViewController; - FUID cid; - String lastPreset; -}; - -//------------------------------------------------------------------------ -} // namespace InterAppAudio -} // namespace Vst -} // namespace Steinberg - diff --git a/vst/public.sdk/source/vst/interappaudio/PresetManager.mm b/vst/public.sdk/source/vst/interappaudio/PresetManager.mm deleted file mode 100644 index 542813c4..00000000 --- a/vst/public.sdk/source/vst/interappaudio/PresetManager.mm +++ /dev/null @@ -1,279 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/interappaudio/PresetManager.mm -// Created by : Steinberg, 10/2013 -// Description : VST 3 InterAppAudio -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#import "PresetManager.h" -#import "public.sdk/source/vst/vstpresetfile.h" -#import "pluginterfaces/vst/ivstattributes.h" -#import "PresetBrowserViewController.h" -#import "PresetSaveViewController.h" - -namespace Steinberg { -namespace Vst { -namespace InterAppAudio { - -//----------------------------------------------------------------------------- -class PresetStream : public ReadOnlyBStream, public IStreamAttributes -{ -public: - PresetStream (IBStream* sourceStream, TSize sourceOffset, TSize sectionSize, const char* utf8Path) - : ReadOnlyBStream (sourceStream, sourceOffset, sectionSize) - , fileName (utf8Path) - { - fileName.toWideString (kCP_Utf8); - } - - virtual tresult PLUGIN_API getFileName (String128 name) - { - if (fileName.length () > 0) - { - fileName.copyTo (name, 0, 128); - return kResultTrue; - } - return kResultFalse; - } - virtual IAttributeList* PLUGIN_API getAttributes () { return 0; } - - DEF_INTERFACES_1(IStreamAttributes, ReadOnlyBStream) - REFCOUNT_METHODS(ReadOnlyBStream) -protected: - String fileName; -}; - -//----------------------------------------------------------------------------- -PresetManager::PresetManager (VST3Plugin* plugin, const TUID& cid) -: plugin (plugin) -, visiblePresetBrowserViewController (nil) -, visibleSavePresetViewController (nil) -, cid (cid) -{ - id obj = [[NSUserDefaults standardUserDefaults] objectForKey:@"PresetManager|lastPreset"]; - if (obj && [obj isKindOfClass:[NSString class]]) - { - lastPreset = [obj UTF8String]; - } -} - -//----------------------------------------------------------------------------- -NSArray* PresetManager::getPresetPaths (PresetPathType type) -{ - if (type == kFactory) - { - return [[NSBundle mainBundle] URLsForResourcesWithExtension:@"vstpreset" subdirectory:@"Presets"]; - } - NSFileManager* fs = [NSFileManager defaultManager]; - NSURL* documentsUrl = [fs URLForDirectory:NSDocumentDirectory inDomain:NSUserDomainMask appropriateForURL:Nil create:YES error:NULL]; - if (documentsUrl) - { - NSMutableArray* userUrls = [NSMutableArray new]; - NSDirectoryEnumerator* enumerator = [fs enumeratorAtURL:documentsUrl includingPropertiesForKeys:nil options:NSDirectoryEnumerationSkipsSubdirectoryDescendants errorHandler:nil]; - for (NSURL* url in enumerator.allObjects) - { - if ([[url pathExtension] isEqualToString:@"vstpreset"]) - { - [userUrls addObject:url]; - } - } - return [userUrls sortedArrayUsingComparator:^NSComparisonResult (NSURL* obj1, NSURL* obj2) { - return [[obj1 lastPathComponent] caseInsensitiveCompare:[obj2 lastPathComponent]]; - }]; - } - return nil; -} - -//----------------------------------------------------------------------------- -tresult PLUGIN_API PresetManager::runLoadPresetBrowser () -{ - if (visiblePresetBrowserViewController != nil) - return kResultFalse; - - addRef (); - visiblePresetBrowserViewController = [[PresetBrowserViewController alloc] initWithCallback:[this](const char* path) { - loadPreset (path); - visiblePresetBrowserViewController = nil; - release (); - }]; - addRef (); - dispatch_async (dispatch_get_global_queue (DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - if (visiblePresetBrowserViewController) - { - [visiblePresetBrowserViewController setFactoryPresets:getPresetPaths (kFactory) userPresets:getPresetPaths (kUser)]; - } - release (); - }); - return kResultTrue; -} - -//----------------------------------------------------------------------------- -tresult PLUGIN_API PresetManager::runSavePresetBrowser () -{ - if (visibleSavePresetViewController != nil) - return kResultFalse; - - addRef (); - visibleSavePresetViewController = [[PresetSaveViewController alloc] initWithCallback:[this](const char* path) { - savePreset (path); - visibleSavePresetViewController = nil; - release (); - }]; - return kResultTrue; -} - -//----------------------------------------------------------------------------- -tresult PLUGIN_API PresetManager::loadNextPreset () -{ - return loadPreset (true); -} - -//----------------------------------------------------------------------------- -tresult PLUGIN_API PresetManager::loadPreviousPreset () -{ - return loadPreset (false); -} - -//----------------------------------------------------------------------------- -tresult PresetManager::loadPreset (bool next) -{ - NSArray* presets = [[getPresetPaths (kFactory) arrayByAddingObjectsFromArray:getPresetPaths (kUser)] sortedArrayUsingComparator:^NSComparisonResult (NSURL* obj1, NSURL* obj2) { - return [[obj1 lastPathComponent] caseInsensitiveCompare:[obj2 lastPathComponent]]; - }]; - - __block NSUInteger index = NSNotFound; - if (lastPreset.isEmpty() == false) - { - NSURL* lastUrl = [[NSURL fileURLWithPath:[NSString stringWithUTF8String:lastPreset]] fileReferenceURL]; - if (lastUrl) - { - [presets enumerateObjectsUsingBlock:^(NSURL* obj, NSUInteger idx, BOOL *stop) { - if ([[obj fileReferenceURL] isEqual:lastUrl]) - { - index = idx; - *stop = YES; - } - }]; - } - } - if (index == NSNotFound) - { - if (next) - index = [presets count] - 1; - else - index = 1; - } - if (index != NSNotFound) - { - if (next) - { - if (index >= [presets count] - 1) - index = 0; - else - index++; - } - else - { - if (index == 0) - index = [presets count] - 1; - else - index--; - } - return loadPreset ([[[presets objectAtIndex:index] path] UTF8String]); - } - return kResultFalse; -} - -//----------------------------------------------------------------------------- -tresult PresetManager::loadPreset (const char* path) -{ - if (path) - { - IPtr stream = owned (FileStream::open (path, "r")); - if (stream) - { - [[NSUserDefaults standardUserDefaults] setObject:[NSString stringWithUTF8String:path] forKey:@"PresetManager|lastPreset"]; - lastPreset = path; - FUnknownPtr component (plugin->getAudioProcessor ()); - IEditController* controller = plugin->getEditController (); - if (component) - { - PresetFile pf (stream); - if (!pf.readChunkList ()) - return kResultFalse; - if (pf.getClassID () != cid) - return kResultFalse; - const PresetFile::Entry* e = pf.getEntry (kComponentState); - if (e == 0) - return kResultFalse; - char* filename = strrchr (path, '/'); - if (filename) - filename++; - IPtr readOnlyBStream = owned (new PresetStream (stream, e->offset, e->size, filename)); - tresult result = component->setState (readOnlyBStream); - if ((result == kResultTrue || result == kNotImplemented) && controller) - { - readOnlyBStream->seek (0, IBStream::kIBSeekSet); - controller->setComponentState (readOnlyBStream); - if (pf.contains (kControllerState)) - { - e = pf.getEntry (kControllerState); - if (e) - { - readOnlyBStream = owned (new PresetStream (stream, e->offset, e->size, filename)); - controller->setState (readOnlyBStream); - } - } - } - return result; - } - } - } - return kResultFalse; -} - -//----------------------------------------------------------------------------- -void PresetManager::savePreset (const char* path) -{ - IBStream* stream = FileStream::open (path, "w"); - if (stream) - { - FUnknownPtr component (plugin->getAudioProcessor ()); - IEditController* controller = plugin->getEditController (); - if (component) - { - PresetFile::savePreset (stream, cid, component, controller); - } - stream->release (); - loadPreset (path); - } -} - -}}} // namespaces diff --git a/vst/public.sdk/source/vst/interappaudio/PresetSaveView.xib b/vst/public.sdk/source/vst/interappaudio/PresetSaveView.xib deleted file mode 100644 index d845fdfb..00000000 --- a/vst/public.sdk/source/vst/interappaudio/PresetSaveView.xib +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/vst/public.sdk/source/vst/interappaudio/PresetSaveViewController.h b/vst/public.sdk/source/vst/interappaudio/PresetSaveViewController.h deleted file mode 100644 index 9956fbaa..00000000 --- a/vst/public.sdk/source/vst/interappaudio/PresetSaveViewController.h +++ /dev/null @@ -1,52 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/interappaudio/PresetSaveViewController.h -// Created by : Steinberg, 09/2013 -// Description : VST 3 InterAppAudio -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#pragma once - -/// \cond ignore - -#ifdef __OBJC__ - -#import -#import - -@interface PresetSaveViewController : UIViewController - -- (id)initWithCallback:(std::function)callback; - -@end - -#endif //__OBJC__ - -/// \endcond diff --git a/vst/public.sdk/source/vst/interappaudio/PresetSaveViewController.mm b/vst/public.sdk/source/vst/interappaudio/PresetSaveViewController.mm deleted file mode 100644 index ee22863b..00000000 --- a/vst/public.sdk/source/vst/interappaudio/PresetSaveViewController.mm +++ /dev/null @@ -1,169 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/interappaudio/PresetSaveViewController.mm -// Created by : Steinberg, 09/2013 -// Description : VST 3 InterAppAudio -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#import "PresetSaveViewController.h" -#import "pluginterfaces/base/funknown.h" - -static NSTimeInterval kAnimationTime = 0.2; - -//------------------------------------------------------------------------ -@interface PresetSaveViewController () -//------------------------------------------------------------------------ -{ - IBOutlet UIView* containerView; - IBOutlet UITextField* presetName; - - std::function callback; - Steinberg::FUID uid; -} -@end - -//------------------------------------------------------------------------ -@implementation PresetSaveViewController -//------------------------------------------------------------------------ - -//------------------------------------------------------------------------ -- (id)initWithCallback:(std::function)_callback -{ - self = [super initWithNibName:@"PresetSaveView" bundle:nil]; - if (self) - { - callback = _callback; - - self.view.alpha = 0.; - - UIViewController* rootViewController = [[UIApplication sharedApplication].windows[0] rootViewController]; - [rootViewController addChildViewController:self]; - [rootViewController.view addSubview:self.view]; - - [UIView animateWithDuration:kAnimationTime animations:^{ - self.view.alpha = 1.; - } completion:^(BOOL finished) { - [self showKeyboard]; - }]; - } - return self; -} - -//------------------------------------------------------------------------ -- (void)viewDidLoad -{ - [super viewDidLoad]; - - containerView.layer.shadowOpacity = 0.5; - containerView.layer.shadowOffset = CGSizeMake (5, 5); - containerView.layer.shadowRadius = 5; -} - -//------------------------------------------------------------------------ -- (void)showKeyboard -{ - [presetName becomeFirstResponder]; -} - -//------------------------------------------------------------------------ -- (void)removeSelf -{ - [UIView animateWithDuration:kAnimationTime animations:^{ - self.view.alpha = 0.; - } completion:^(BOOL finished) { - [self.view removeFromSuperview]; - [self removeFromParentViewController]; - }]; -} - -//------------------------------------------------------------------------ -- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex -{ - if (buttonIndex != alertView.cancelButtonIndex) - { - callback ([[[self presetURL] path] UTF8String]); - [self removeSelf]; - } -} - -//------------------------------------------------------------------------ -- (NSURL*)presetURL -{ - NSFileManager* fs = [NSFileManager defaultManager]; - NSURL* documentsUrl = [fs URLForDirectory:NSDocumentDirectory inDomain:NSUserDomainMask appropriateForURL:Nil create:YES error:NULL]; - if (documentsUrl) - { - NSURL* presetPath = [[documentsUrl URLByAppendingPathComponent:presetName.text] URLByAppendingPathExtension:@"vstpreset"]; - return presetPath; - } - return nil; -} - -//------------------------------------------------------------------------ -- (BOOL)textFieldShouldReturn:(UITextField *)textField -{ - if ([textField.text length] > 0) - { - [self save:textField]; - return YES; - } - return NO; -} - -//------------------------------------------------------------------------ -- (IBAction)save:(id)sender -{ - if (callback) - { - NSURL* presetPath = [self presetURL]; - NSFileManager* fs = [NSFileManager defaultManager]; - if ([fs fileExistsAtPath:[presetPath path]]) - { - // alert for overwrite - UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"A Preset with this name already exists" message:@"Save it anyway ?" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Save", nil]; - [alert show]; - return; - } - callback ([[presetPath path] UTF8String]); - } - [self removeSelf]; -} - -//------------------------------------------------------------------------ -- (IBAction)cancel:(id)sender -{ - if (callback) - { - callback (0); - } - [self removeSelf]; -} - -@end diff --git a/vst/public.sdk/source/vst/interappaudio/SettingsView.xib b/vst/public.sdk/source/vst/interappaudio/SettingsView.xib deleted file mode 100644 index 6dda37f9..00000000 --- a/vst/public.sdk/source/vst/interappaudio/SettingsView.xib +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/vst/public.sdk/source/vst/interappaudio/SettingsViewController.h b/vst/public.sdk/source/vst/interappaudio/SettingsViewController.h deleted file mode 100644 index e26be5aa..00000000 --- a/vst/public.sdk/source/vst/interappaudio/SettingsViewController.h +++ /dev/null @@ -1,47 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/interappaudio/SettingsViewController.h -// Created by : Steinberg, 09/2013 -// Description : VST 3 InterAppAudio -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#pragma once - -#ifdef __OBJC__ - -#import - -@interface SettingsViewController : UIViewController - -@end - -#endif // __OBJC__ - -extern void showIOSettings (); diff --git a/vst/public.sdk/source/vst/interappaudio/SettingsViewController.mm b/vst/public.sdk/source/vst/interappaudio/SettingsViewController.mm deleted file mode 100644 index a17a2dde..00000000 --- a/vst/public.sdk/source/vst/interappaudio/SettingsViewController.mm +++ /dev/null @@ -1,142 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/interappaudio/SettingsViewController.mm -// Created by : Steinberg, 09/2013 -// Description : VST 3 InterAppAudio -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#import "SettingsViewController.h" -#import "MidiIO.h" -#import "AudioIO.h" -#import - -using namespace Steinberg::Vst::InterAppAudio; - -static const NSTimeInterval kAnimationTime = 0.2; -static const NSUInteger kMinTempo = 30; - -//------------------------------------------------------------------------ -@interface SettingsViewController () -//------------------------------------------------------------------------ -{ - IBOutlet UIView* containerView; - IBOutlet UISwitch* midiOnSwitch; - IBOutlet UIPickerView* tempoView; -} -@end - -//------------------------------------------------------------------------ -@implementation SettingsViewController -//------------------------------------------------------------------------ - -//------------------------------------------------------------------------ -- (id)init -{ - self = [super initWithNibName:@"SettingsView" bundle:nil]; - if (self) - { - // Custom initialization - } - return self; -} - -//------------------------------------------------------------------------ -- (void)viewDidLoad -{ - [super viewDidLoad]; - - containerView.layer.shadowOpacity = 0.5; - containerView.layer.shadowOffset = CGSizeMake (5, 5); - containerView.layer.shadowRadius = 5; - - midiOnSwitch.on = MidiIO::instance ().isEnabled (); - - Float64 tempo = AudioIO::instance()->getStaticFallbackTempo (); - [tempoView selectRow:tempo - kMinTempo inComponent:0 animated:YES]; -} - -//------------------------------------------------------------------------ -- (IBAction)enableMidi:(id)sender -{ - BOOL state = midiOnSwitch.on; - MidiIO::instance().setEnabled (state); -} - -//------------------------------------------------------------------------ -- (IBAction)close:(id)sender -{ - [UIView animateWithDuration:kAnimationTime animations:^{ - self.view.alpha = 0.; - } completion:^(BOOL finished) { - [self.view removeFromSuperview]; - [self removeFromParentViewController]; - }]; -} - -//------------------------------------------------------------------------ -- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component -{ - AudioIO::instance()->setStaticFallbackTempo (row + kMinTempo); -} - -//------------------------------------------------------------------------ -- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView -{ - return 1; -} - -//------------------------------------------------------------------------ -- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component -{ - return 301 - kMinTempo; -} - -//------------------------------------------------------------------------ -- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component -{ - return [@(row + kMinTempo) stringValue]; -} - -@end - -//------------------------------------------------------------------------ -void showIOSettings () -{ - SettingsViewController* controller = [[SettingsViewController alloc] init]; - controller.view.alpha = 0.; - - UIViewController* rootViewController = [[UIApplication sharedApplication].windows[0] rootViewController]; - [rootViewController addChildViewController:controller]; - [rootViewController.view addSubview:controller.view]; - - [UIView animateWithDuration:kAnimationTime animations:^{ - controller.view.alpha = 1.; - }]; -} diff --git a/vst/public.sdk/source/vst/interappaudio/VST3Editor.h b/vst/public.sdk/source/vst/interappaudio/VST3Editor.h deleted file mode 100644 index 91bf40ec..00000000 --- a/vst/public.sdk/source/vst/interappaudio/VST3Editor.h +++ /dev/null @@ -1,80 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/interappaudio/VST3Editor.h -// Created by : Steinberg, 08/2013. -// Description : VST 3 InterAppAudio -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#pragma once - -/// \cond ignore - -#import "base/source/fobject.h" -#import "pluginterfaces/gui/iplugview.h" - -namespace Steinberg { -namespace Vst { -class IEditController; - -namespace InterAppAudio { - -//------------------------------------------------------------------------ -class VST3Editor : public FObject, public IPlugFrame -{ -public: -//------------------------------------------------------------------------ - VST3Editor (); - virtual ~VST3Editor (); - - bool init (const CGRect& frame); - bool attach (IEditController* editController); - - UIViewController* getViewController () const { return viewController; } - - OBJ_METHODS(VST3Editor, FObject) - REFCOUNT_METHODS(FObject) - DEFINE_INTERFACES - DEF_INTERFACE(IPlugFrame) - END_DEFINE_INTERFACES(FObject) -protected: - - // IPlugFrame - tresult PLUGIN_API resizeView (IPlugView* view, ViewRect* newSize) override; - - IPlugView* plugView; - UIViewController* viewController; -}; - -//------------------------------------------------------------------------ -} // namespace InterAppAudio -} // namespace Vst -} // namespace Steinberg - -/// \endcond diff --git a/vst/public.sdk/source/vst/interappaudio/VST3Editor.mm b/vst/public.sdk/source/vst/interappaudio/VST3Editor.mm deleted file mode 100644 index 7fe6f969..00000000 --- a/vst/public.sdk/source/vst/interappaudio/VST3Editor.mm +++ /dev/null @@ -1,118 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/interappaudio/VST3Editor.mm -// Created by : Steinberg, 08/2013. -// Description : VST 3 InterAppAudio -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#import "VST3Editor.h" -#import "pluginterfaces/vst/ivsteditcontroller.h" - -//------------------------------------------------------------------------ -@interface VST3EditorViewController : UIViewController -//------------------------------------------------------------------------ - -@end - -//------------------------------------------------------------------------ -@implementation VST3EditorViewController -//------------------------------------------------------------------------ - -- (BOOL)prefersStatusBarHidden { return YES; } -- (BOOL)shouldAutorotate { return YES; } -- (NSUInteger)supportedInterfaceOrientations -{ - return UIInterfaceOrientationMaskLandscapeLeft|UIInterfaceOrientationMaskLandscapeRight; -} - -@end - -namespace Steinberg { -namespace Vst { -namespace InterAppAudio { - -//------------------------------------------------------------------------ -VST3Editor::VST3Editor () -: plugView (0) -, viewController (0) -{ - -} - -//------------------------------------------------------------------------ -VST3Editor::~VST3Editor () -{ - if (plugView) - { - plugView->release (); - } -} - -//------------------------------------------------------------------------ -bool VST3Editor::init (const CGRect& frame) -{ - viewController = [VST3EditorViewController new]; - viewController.view = [[UIView alloc] initWithFrame:frame]; - return true; -} - -//------------------------------------------------------------------------ -bool VST3Editor::attach (IEditController* editController) -{ - FUnknownPtr ec2 (editController); - if (ec2) - { - ec2->setKnobMode (kLinearMode); - } - plugView = editController->createView (ViewType::kEditor); - if (plugView) - { - if (plugView->isPlatformTypeSupported (kPlatformTypeUIView) == kResultTrue) - { - plugView->setFrame (this); - if (plugView->attached ((__bridge void*)viewController.view, kPlatformTypeUIView) == kResultTrue) - { - return true; - } - } - plugView->release (); - plugView = 0; - } - - return false; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API VST3Editor::resizeView (IPlugView* view, ViewRect* newSize) -{ - return kNotImplemented; -} - -}}} diff --git a/vst/public.sdk/source/vst/interappaudio/VST3Plugin.h b/vst/public.sdk/source/vst/interappaudio/VST3Plugin.h deleted file mode 100644 index 06b63797..00000000 --- a/vst/public.sdk/source/vst/interappaudio/VST3Plugin.h +++ /dev/null @@ -1,141 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/interappaudio/VST3Plugin.h -// Created by : Steinberg, 08/2013. -// Description : VST 3 InterAppAudio -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#pragma once - -/// \cond ignore - -#import "AudioIO.h" -#import "base/source/fobject.h" -#import "base/source/timer.h" -#import "base/source/tringbuffer.h" -#import "pluginterfaces/vst/ivstaudioprocessor.h" -#import "pluginterfaces/vst/ivsteditcontroller.h" -#import "pluginterfaces/vst/ivstprocesscontext.h" -#import "public.sdk/source/vst/hosting/processdata.h" -#import "public.sdk/source/vst/hosting/parameterchanges.h" -#import "public.sdk/source/vst/hosting/eventlist.h" -#import - -#ifndef __OBJC__ -struct NSData; -#endif - -namespace Steinberg { -namespace Vst { -namespace InterAppAudio { - -static const int32 kMaxUIEvents = 100; - -//------------------------------------------------------------------------ -class VST3Plugin : public FObject, public IComponentHandler, public IAudioIOProcessor, public ITimerCallback -{ -public: -//------------------------------------------------------------------------ - VST3Plugin (); - virtual ~VST3Plugin (); - - bool init (); - - IEditController* getEditController () const { return editController; } - IAudioProcessor* getAudioProcessor () const { return processor; } - - tresult scheduleEventFromUI (Event& event); - - NSData* getProcessorState (); - bool setProcessorState (NSData* data); - - NSData* getControllerState (); - bool setControllerState (NSData* data); - - OBJ_METHODS(VST3Plugin, FObject) - REFCOUNT_METHODS(FObject) - DEFINE_INTERFACES - DEF_INTERFACE(IComponentHandler) - END_DEFINE_INTERFACES(FObject) -protected: - typedef std::map NoteIDPitchMap; - typedef uint32 ChannelAndCtrlNumber; - typedef std::map MIDIControllerToParamIDMap; - - void createProcessorAndController (); - - void updateProcessContext (AudioIO* audioIO); - MIDIControllerToParamIDMap createMIDIControllerToParamIDMap (); - - // IComponentHandler - tresult PLUGIN_API beginEdit (ParamID id) override; - tresult PLUGIN_API performEdit (ParamID id, ParamValue valueNormalized) override; - tresult PLUGIN_API endEdit (ParamID id) override; - tresult PLUGIN_API restartComponent (int32 flags) override; - - // IAudioIOProcessor - void willStartAudio (AudioIO* audioIO) override; - void didStopAudio (AudioIO* audioIO) override; - void onMIDIEvent (UInt32 status, UInt32 data1, UInt32 data2, UInt32 sampleOffset, bool withinRealtimeThread) override; - void process (const AudioTimeStamp* timeStamp, UInt32 busNumber, UInt32 numFrames, AudioBufferList* ioData, bool& outputIsSilence, AudioIO* audioIO) override; - - // ITimerCallback - void onTimer (Timer* timer) override; - - IAudioProcessor* processor; - IEditController* editController; - Timer* timer; - - HostProcessData processData; - ProcessContext processContext; - ParameterChangeTransfer inputParamChangeTransfer; - ParameterChangeTransfer outputParamChangeTransfer; - ParameterChanges inputParamChanges; - ParameterChanges outputParamChanges; - EventList inputEvents; - - NoteIDPitchMap noteIDPitchMap; - volatile int32 lastNodeID; - - bool processing; - - MIDIControllerToParamIDMap midiControllerToParamIDMap; - - TRingBuffer uiScheduledEvents; - - static ChannelAndCtrlNumber channelAndCtrlNumber (uint16 channel, CtrlNumber ctrler) { return (channel << 16) + ctrler; } -}; - -//------------------------------------------------------------------------ -} // namespace InterAppAudio -} // namespace Vst -} // namespace Steinberg - -/// \endcond diff --git a/vst/public.sdk/source/vst/interappaudio/VST3Plugin.mm b/vst/public.sdk/source/vst/interappaudio/VST3Plugin.mm deleted file mode 100644 index 3f7a765c..00000000 --- a/vst/public.sdk/source/vst/interappaudio/VST3Plugin.mm +++ /dev/null @@ -1,606 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/interappaudio/VST3Plugin.mm -// Created by : Steinberg, 08/2013. -// Description : VST 3 InterAppAudio -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#import "VST3Plugin.h" -#import "HostApp.h" -#import "pluginterfaces/base/ipluginbase.h" -#import "pluginterfaces/vst/ivstmessage.h" -#import "pluginterfaces/vst/ivstmidicontrollers.h" -#import "pluginterfaces/vst/ivstinterappaudio.h" -#import "public.sdk/source/vst/auwrapper/NSDataIBStream.h" -#import "public.sdk/source/vst/hosting/hostclasses.h" -#import "base/source/updatehandler.h" -#import - -//------------------------------------------------------------------------ -extern "C" -{ - bool bundleEntry (CFBundleRef); - bool bundleExit (void); -} - -namespace Steinberg { -namespace Vst { -namespace InterAppAudio { - -//------------------------------------------------------------------------ -__attribute__((constructor)) -static void InitUpdateHandler () -{ - UpdateHandler::instance (); -} - -//------------------------------------------------------------------------ -VST3Plugin::VST3Plugin () -: processor (0) -, editController (0) -, timer (0) -, lastNodeID (0) -, processing (false) -{ - processData.processContext = &processContext; - processData.inputParameterChanges = &inputParamChanges; - processData.outputParameterChanges = &outputParamChanges; - processData.inputEvents = &inputEvents; - -} - -//------------------------------------------------------------------------ -VST3Plugin::~VST3Plugin () -{ -} - -//------------------------------------------------------------------------ -bool VST3Plugin::init () -{ - if (processor == 0 && editController == 0) - { - ::bundleEntry (CFBundleGetMainBundle ()); - createProcessorAndController (); - } - return processor && editController; -} - -//------------------------------------------------------------------------ -void VST3Plugin::createProcessorAndController () -{ - Steinberg::IPluginFactory* factory = GetPluginFactory (); - if (factory == 0) - return; - IComponent* component = 0; - PClassInfo classInfo; - int32 classCount = factory->countClasses (); - for (int32 i = 0; i < classCount; i++) - { - if (factory->getClassInfo (i, &classInfo) != kResultTrue) - return; - if (strcmp (classInfo.category, kVstAudioEffectClass) == 0) - { - if (factory->createInstance (classInfo.cid, IComponent::iid, (void **)&component) != kResultTrue) - { - return; - } - break; - } - } - if (component) - { - if (component->initialize (InterAppAudioHostApp::instance ()->unknownCast ()) != kResultTrue) - { - component->release (); - return; - } - if (component->queryInterface (IEditController::iid, (void**)&editController) != kResultTrue) - { - FUID controllerCID; - if (component->getControllerClassId (controllerCID) == kResultTrue && controllerCID.isValid ()) - { - if (factory->createInstance (controllerCID, IEditController::iid, (void**)&editController) != kResultTrue) - return; - editController->setComponentHandler (this); - if (editController->initialize (InterAppAudioHostApp::instance ()->unknownCast ()) != kResultTrue) - { - component->release (); - editController->release (); - editController = 0; - return; - } - FUnknownPtr compConnection (component); - FUnknownPtr ctrlerConnection (editController); - if (compConnection && ctrlerConnection) - { - compConnection->connect (ctrlerConnection); - ctrlerConnection->connect (compConnection); - } - } - else - { - component->release (); - return; - } - } - component->queryInterface (IAudioProcessor::iid, (void**)&processor); - if (processor == 0) - { - if (editController) - { - editController->release (); - editController = 0; - } - } - else - { - NSMutableData* data = [NSMutableData new]; - NSMutableDataIBStream state (data); - if (component->getState (&state) == kResultTrue) - { - state.seek (0, IBStream::kIBSeekSet); - editController->setComponentState (&state); - } - int32 paramCount = editController->getParameterCount (); - inputParamChanges.setMaxParameters (paramCount); - inputParamChangeTransfer.setMaxParameters (paramCount); - outputParamChanges.setMaxParameters (paramCount); - outputParamChangeTransfer.setMaxParameters (paramCount); - midiControllerToParamIDMap = createMIDIControllerToParamIDMap (); - uiScheduledEvents.resize (kMaxUIEvents); - } - component->release (); - } -} - -//------------------------------------------------------------------------ -VST3Plugin::MIDIControllerToParamIDMap VST3Plugin::createMIDIControllerToParamIDMap () -{ - MIDIControllerToParamIDMap newMap; - - FUnknownPtr midiMapping (editController); - if (midiMapping) - { - uint16 channelCount = 0; - FUnknownPtr component (processor); - if (component) - { - int32 busCount = component->getBusCount (kEvent, kInput); - if (busCount > 0) - { - BusInfo busInfo; - if (component->getBusInfo (kEvent, kInput, 0, busInfo) == kResultTrue) - { - channelCount = busInfo.channelCount; - } - } - } - - ParamID paramID; - for (int32 channel = 0; channel < channelCount; channel++) - { - for (CtrlNumber ctrler = 0; ctrler < kCountCtrlNumber; ctrler++) - { - if (midiMapping->getMidiControllerAssignment (0, channel, ctrler, paramID) == kResultTrue) - { - newMap.insert (std::make_pair (channelAndCtrlNumber (channel, ctrler), paramID)); - } - } - } - } - return newMap; -} - -//------------------------------------------------------------------------ -tresult VST3Plugin::scheduleEventFromUI (Event& event) -{ - if (event.type == Event::kNoteOnEvent) - event.noteOn.noteId = FAtomicIncrement (lastNodeID); - return uiScheduledEvents.write (event) ? kResultTrue : kResultFalse; -} - -//------------------------------------------------------------------------ -NSData* VST3Plugin::getProcessorState () -{ - if (processor) - { - NSMutableData* data = [NSMutableData new]; - NSMutableDataIBStream state (data); - FUnknownPtr comp (processor); - if (comp->getState (&state) == kResultTrue) - { - return data; - } - } - return nil; -} - -//------------------------------------------------------------------------ -bool VST3Plugin::setProcessorState (NSData* data) -{ - if (editController && processor) - { - NSDataIBStream stream (data); - FUnknownPtr comp (processor); - if (comp->setState (&stream) == kResultTrue) - { - stream.seek (0, IBStream::kIBSeekSet); - editController->setComponentState (&stream); - return true; - } - } - - return false; -} - -//------------------------------------------------------------------------ -NSData* VST3Plugin::getControllerState () -{ - if (editController) - { - NSMutableData* data = [NSMutableData new]; - NSMutableDataIBStream state (data); - if (editController->getState (&state) == kResultTrue) - { - return data; - } - } - return nil; -} - -//------------------------------------------------------------------------ -bool VST3Plugin::setControllerState (NSData* data) -{ - if (editController) - { - NSDataIBStream stream (data); - if (editController->setState (&stream) == kResultTrue) - { - return true; - } - } - return false; -} - -//------------------------------------------------------------------------ -void VST3Plugin::willStartAudio (AudioIO* audioIO) -{ - noteIDPitchMap.clear (); - lastNodeID = 0; - - ProcessSetup setup; - setup.processMode = kRealtime; - setup.symbolicSampleSize = kSample32; - setup.maxSamplesPerBlock = 4096;// TODO: - setup.sampleRate = audioIO->getSampleRate (); - processor->setupProcessing (setup); - SpeakerArrangement inputs[1]; - SpeakerArrangement outputs[1]; - inputs[0] = SpeakerArr::kStereo; - outputs[0] = SpeakerArr::kStereo; - processor->setBusArrangements (inputs, 1, outputs, 1); - - FUnknownPtr comp (processor); - comp->setActive (true); - - processData.prepare (*comp); - - FUnknownPtr iaaConnectionNotification (editController); - if (iaaConnectionNotification) - { - iaaConnectionNotification->onInterAppAudioConnectionStateChange (audioIO->getInterAppAudioConnected () ? true : false); - } - - timer = Timer::create (this, 16); -} - -//------------------------------------------------------------------------ -void VST3Plugin::didStopAudio (AudioIO* audioIO) -{ - processor->setProcessing (false); // TODO: currently not called in Audio Thread as it should according to the VST3 spec - processing = false; - - FUnknownPtr comp (processor); - comp->setActive (false); - timer->release (); - timer = 0; -} - -//------------------------------------------------------------------------ -void VST3Plugin::onMIDIEvent (UInt32 inStatus, UInt32 data1, UInt32 data2, UInt32 sampleOffset, bool withinRealtimeThread) -{ - Event e = {}; - e.flags = Event::kIsLive; - - uint16 status = inStatus & 0xF0; - uint16 channel = inStatus & 0x0F; - if (status == 0x90 && data2 != 0) // note on - { - auto noteID = noteIDPitchMap.find ((channel << 8) + data1); - if (noteID != noteIDPitchMap.end ()) - { - // for now, we just turn off the old note on - Event e2 = {}; - e2.type = Event::kNoteOffEvent; - e2.noteOff.noteId = noteID->second; - e2.noteOff.channel = channel; - e2.noteOff.pitch = data1; - e2.noteOff.velocity = (float)data2 / 128.f; - e2.sampleOffset = 0; - inputEvents.addEvent (e2); - noteIDPitchMap.erase (noteID); - } - e.type = Event::kNoteOnEvent; - e.noteOn.channel = channel; - e.noteOn.pitch = data1; - e.noteOn.velocity = (float)data2 / 128.f; - e.noteOn.length = -1; - e.sampleOffset = sampleOffset; - if (withinRealtimeThread) - { - e.noteOn.noteId = FAtomicIncrement (lastNodeID); - inputEvents.addEvent (e); - noteIDPitchMap.insert (std::make_pair ((channel << 8) + data1, e.noteOn.noteId)); - } - else - { - scheduleEventFromUI (e); - } - } - else if (status == 0x80 || (status == 0x90 && data2 == 0)) // note off - { - auto noteID = noteIDPitchMap.find ((channel << 8) + data1); - if (noteID != noteIDPitchMap.end()) - { - e.type = Event::kNoteOffEvent; - e.noteOff.noteId = noteID->second; - e.noteOff.channel = channel; - e.noteOff.pitch = data1; - e.noteOff.velocity = (float)data2 / 128.f; - e.sampleOffset = sampleOffset; - if (withinRealtimeThread) - { - inputEvents.addEvent (e); - noteIDPitchMap.erase (noteID); - } - else - { - scheduleEventFromUI (e); - } - } - else - { - NSLog (@"NoteID not found:%d", (unsigned int)data1); - } - } - else if (status == 0xb0 && data1 < kAfterTouch) // controller - { - auto it = midiControllerToParamIDMap.find (channelAndCtrlNumber (channel, data1)); - if (it != midiControllerToParamIDMap.end ()) - { - ParamValue value = (ParamValue)data2 / 128.; - if (withinRealtimeThread) - { - int32 index; - IParamValueQueue* queue = inputParamChanges.addParameterData (it->second, index); - if (queue) - { - queue->addPoint (sampleOffset, value, index); - } - } - else - { - inputParamChangeTransfer.addChange (it->second, value, sampleOffset); - } - } - } - else if (status == 0xe0) // pitch bend - { - auto it = midiControllerToParamIDMap.find (channelAndCtrlNumber (channel, kPitchBend)); - if (it != midiControllerToParamIDMap.end ()) - { - uint16 _14bit; - _14bit = (uint16)data2; - _14bit <<= 7; - _14bit |= (uint16)data1; - ParamValue value = (double)_14bit / (double)0x3fff; - - if (withinRealtimeThread) - { - int32 index; - IParamValueQueue* queue = inputParamChanges.addParameterData (it->second, index); - if (queue) - { - queue->addPoint (sampleOffset, value, index); - } - } - else - { - inputParamChangeTransfer.addChange (it->second, value, sampleOffset); - } - } - } - else if (status == 0xd0) // aftertouch - { - auto it = midiControllerToParamIDMap.find (channelAndCtrlNumber (channel, kAfterTouch)); - if (it != midiControllerToParamIDMap.end ()) - { - ParamValue value = (ParamValue)data1 / 128.; - if (withinRealtimeThread) - { - int32 index; - IParamValueQueue* queue = inputParamChanges.addParameterData (it->second, index); - if (queue) - { - queue->addPoint (sampleOffset, value, index); - } - } - else - { - inputParamChangeTransfer.addChange (it->second, value, sampleOffset); - } - } - } -} - -//------------------------------------------------------------------------ -void VST3Plugin::process (const AudioTimeStamp* timeStamp, UInt32 busNumber, UInt32 numFrames, AudioBufferList* ioData, bool& outputIsSilence, AudioIO* audioIO) -{ - if (processing == false) - { - processor->setProcessing (true); - processing = true; - } - updateProcessContext (audioIO); - if (timeStamp) - processContext.systemTime = timeStamp->mHostTime; - - // TODO: silence state update - for (UInt32 i = 0; i < ioData->mNumberBuffers; i++) - { - processData.setChannelBuffer (kInput, 0, i, (float*)ioData->mBuffers[i].mData); - processData.setChannelBuffer (kOutput, 0, i, (float*)ioData->mBuffers[i].mData); - } - - Event e; - while (uiScheduledEvents.read (e)) - { - inputEvents.addEvent (e); - if (e.type == Event::kNoteOnEvent) - { - auto noteID = noteIDPitchMap.find ((e.noteOn.channel << 8) + e.noteOn.pitch); - if (noteID == noteIDPitchMap.end ()) - noteIDPitchMap.insert (std::make_pair ((e.noteOn.channel << 8) + e.noteOn.pitch, e.noteOn.noteId)); - } - } - - processData.numSamples = numFrames; - inputParamChangeTransfer.transferChangesTo (inputParamChanges); - if (processor->process (processData) == kResultTrue) - { - inputParamChanges.clearQueue (); - outputParamChangeTransfer.transferChangesFrom (outputParamChanges); - outputParamChanges.clearQueue (); - inputEvents.clear (); - } -} - -//------------------------------------------------------------------------ -void VST3Plugin::updateProcessContext (AudioIO* audioIO) -{ - memset (&processContext, 0, sizeof (ProcessContext)); - processContext.sampleRate = audioIO->getSampleRate (); - Float64 beat = 0., tempo = 0.; - if (audioIO->getBeatAndTempo (beat, tempo)) - { - processContext.state |= ProcessContext::kTempoValid | ProcessContext::kProjectTimeMusicValid; - processContext.tempo = tempo; - processContext.projectTimeMusic = beat; - } - else - { - processContext.state |= ProcessContext::kTempoValid; - processContext.tempo = 120.; - } - UInt32 deltaSampleOffsetToNextBeat = 0; - Float32 timeSigNumerator = 0; - UInt32 timeSigDenominator = 0; - Float64 currentMeasureDownBeat = 0; - if (audioIO->getMusicalTimeLocation (deltaSampleOffsetToNextBeat, timeSigNumerator, timeSigDenominator, currentMeasureDownBeat)) - { - processContext.state |= ProcessContext::kTimeSigValid | ProcessContext::kBarPositionValid | ProcessContext::kClockValid; - processContext.timeSigNumerator = timeSigNumerator; - processContext.timeSigDenominator = timeSigDenominator; - processContext.samplesToNextClock = deltaSampleOffsetToNextBeat; - processContext.barPositionMusic = currentMeasureDownBeat; - } - Boolean isPlaying; - Boolean isRecording; - Boolean transportStateChanged; - Float64 currentSampleInTimeLine; - Boolean isCycling; - Float64 cycleStartBeat; - Float64 cycleEndBeat; - if (audioIO->getTransportState (isPlaying, isRecording, transportStateChanged, currentSampleInTimeLine, isCycling, cycleStartBeat, cycleEndBeat)) - { - processContext.state |= ProcessContext::kCycleValid; - processContext.cycleStartMusic = cycleStartBeat; - processContext.cycleEndMusic = cycleEndBeat; - processContext.projectTimeSamples = currentSampleInTimeLine; - if (isPlaying) - processContext.state |= ProcessContext::kPlaying; - if (isCycling) - processContext.state |= ProcessContext::kCycleActive; - if (isRecording) - processContext.state |= ProcessContext::kRecording; - } -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API VST3Plugin::beginEdit (ParamID id) -{ - return kResultTrue; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API VST3Plugin::performEdit (ParamID id, ParamValue valueNormalized) -{ - inputParamChangeTransfer.addChange (id, valueNormalized, 0); - return kResultTrue; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API VST3Plugin::endEdit (ParamID id) -{ - return kResultTrue; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API VST3Plugin::restartComponent (int32 flags) -{ - tresult result = kNotImplemented; - - return result; -} - -//------------------------------------------------------------------------ -void VST3Plugin::onTimer (Timer* timer) -{ - ParamID paramID; - ParamValue paramValue; - int32 sampleOffset; - while (outputParamChangeTransfer.getNextChange (paramID, paramValue, sampleOffset)) - { - editController->setParamNormalized (paramID, paramValue); - } - UpdateHandler::instance ()->triggerDeferedUpdates (); -} - -}}} diff --git a/vst/public.sdk/source/vst/interappaudio/VSTInterAppAudioAppDelegateBase.h b/vst/public.sdk/source/vst/interappaudio/VSTInterAppAudioAppDelegateBase.h deleted file mode 100644 index 911cdf1d..00000000 --- a/vst/public.sdk/source/vst/interappaudio/VSTInterAppAudioAppDelegateBase.h +++ /dev/null @@ -1,55 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/interappaudio/VSTInterAppAudioAppDelegateBase.h -// Created by : Steinberg, 08/2013. -// Description : VST 3 InterAppAudio -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#import - -//------------------------------------------------------------------------ -/** Base UIApplicationDelegate class. - * This class provides the base handling of the audio engine, plug-in and plug-in editor\n - * You should subclass it for customization\n - * Make sure to call the methods of this class if you override one in your subclass ! - */ -//------------------------------------------------------------------------ -@interface VSTInterAppAudioAppDelegateBase : UIResponder -//------------------------------------------------------------------------ -@property (strong, nonatomic) UIWindow *window; - -- (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary *)launchOptions; -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions; -- (BOOL)application:(UIApplication *)application shouldSaveApplicationState:(NSCoder *)coder; -- (BOOL)application:(UIApplication *)application shouldRestoreApplicationState:(NSCoder *)coder; -- (void)applicationDidBecomeActive:(UIApplication *)application; -- (void)applicationWillResignActive:(UIApplication *)application; - -@end diff --git a/vst/public.sdk/source/vst/interappaudio/VSTInterAppAudioAppDelegateBase.mm b/vst/public.sdk/source/vst/interappaudio/VSTInterAppAudioAppDelegateBase.mm deleted file mode 100644 index ddfed53e..00000000 --- a/vst/public.sdk/source/vst/interappaudio/VSTInterAppAudioAppDelegateBase.mm +++ /dev/null @@ -1,209 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/interappaudio/VSTInterAppAudioAppDelegateBase.mm -// Created by : Steinberg, 08/2013. -// Description : VST 3 InterAppAudio -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#import "VSTInterAppAudioAppDelegateBase.h" - -#import "public.sdk/source/vst/interappaudio/AudioIO.h" -#import "public.sdk/source/vst/interappaudio/MidiIO.h" -#import "public.sdk/source/vst/interappaudio/VST3Plugin.h" -#import "public.sdk/source/vst/interappaudio/VST3Editor.h" -#import "public.sdk/source/vst/interappaudio/HostApp.h" - -using namespace Steinberg::Vst::InterAppAudio; - -//------------------------------------------------------------------------ -static OSType fourCharCodeToOSType (NSString* inCode) -{ - OSType rval = 0; - NSData* data = [inCode dataUsingEncoding: NSMacOSRomanStringEncoding]; - [data getBytes:&rval length:sizeof(rval)]; - HTONL(rval); - return rval; -} - -//------------------------------------------------------------------------ -@interface VSTInterAppAudioAppDelegateBase () -//------------------------------------------------------------------------ -{ - VST3Plugin plugin; - VST3Editor editor; - - BOOL audioIOInitialized; -} -@end - -//------------------------------------------------------------------------ -@implementation VSTInterAppAudioAppDelegateBase -//------------------------------------------------------------------------ - -//------------------------------------------------------------------------ -- (BOOL)initAudioIO -{ - id auArray = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"AudioComponents"]; - if (auArray) - { - id desc = [auArray objectAtIndex:0]; - if (desc) - { - NSString* typeStr = [desc objectForKey:@"type"]; - NSString* subtypeStr = [desc objectForKey:@"subtype"]; - NSString* manufacturerStr = [desc objectForKey:@"manufacturer"]; - NSString* nameStr = [desc objectForKey:@"name"]; - if (typeStr && subtypeStr && manufacturerStr && nameStr) - { - OSType type = fourCharCodeToOSType (typeStr); - OSType subtype = fourCharCodeToOSType (subtypeStr); - OSType manufacturer = fourCharCodeToOSType (manufacturerStr); - AudioIO* audioIO = AudioIO::instance (); - if (audioIO->init (type, subtype, manufacturer, (__bridge CFStringRef)nameStr) == Steinberg::kResultTrue) - { - if (plugin.init ()) - { - InterAppAudioHostApp::instance ()->setPlugin (&plugin); - audioIO->addProcessor (&plugin); - audioIOInitialized = YES; - return YES; - } - } - } - } - } - return NO; -} - -//------------------------------------------------------------------------ -- (BOOL)createUI -{ - if (audioIOInitialized) - { - CGRect screenSize = {}; - screenSize.size = [[UIScreen mainScreen] currentMode].size; - [UIApplication sharedApplication].statusBarHidden = YES; - self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; - self.window.backgroundColor = [UIColor whiteColor]; - - if (editor.init (screenSize)) - { - self.window.rootViewController = editor.getViewController (); - [self.window makeKeyAndVisible]; - if (editor.attach (plugin.getEditController ()) == false) - { - return NO; - } - } - return YES; - } - return NO; -} - -//------------------------------------------------------------------------ -- (void)savePluginState:(NSCoder*)coder -{ - NSData* processorState = plugin.getProcessorState (); - NSData* controllerState = plugin.getControllerState (); - if (processorState) - [coder encodeObject:processorState forKey:@"VST3ProcessorState"]; - if (controllerState) - [coder encodeObject:controllerState forKey:@"VST3ControllerState"]; -} - -//------------------------------------------------------------------------ -- (void)restorePluginState:(NSCoder*)coder -{ - NSData* processorState = [coder decodeObjectForKey:@"VST3ProcessorState"]; - if (processorState) - { - plugin.setProcessorState (processorState); - } - NSData* controllerState = [coder decodeObjectForKey:@"VST3ControllerState"]; - if (controllerState) - { - plugin.setControllerState (controllerState); - } -} - -//------------------------------------------------------------------------ -// UIApplicationDelegate methods -//------------------------------------------------------------------------ -- (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary *)launchOptions -{ - return [self initAudioIO]; -} - -//------------------------------------------------------------------------ -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions -{ - BOOL result = [self createUI]; - if (result) - { - AudioIO::instance ()->start (); - } - return result; -} - -//------------------------------------------------------------------------ -- (BOOL)application:(UIApplication *)application shouldSaveApplicationState:(NSCoder *)coder -{ - [self savePluginState:coder]; - [coder encodeBool:MidiIO::instance ().isEnabled () forKey:@"MIDI Enabled"]; - return YES; -} - -//------------------------------------------------------------------------ -- (BOOL)application:(UIApplication *)application shouldRestoreApplicationState:(NSCoder *)coder -{ - [self restorePluginState:coder]; - BOOL midiEnabled = [coder decodeBoolForKey:@"MIDI Enabled"]; - MidiIO::instance ().setEnabled (midiEnabled); - return YES; -} - -//------------------------------------------------------------------------ -- (void)applicationDidBecomeActive:(UIApplication *)application -{ - AudioIO* audioIO = AudioIO::instance (); - audioIO->start (); -} - -//------------------------------------------------------------------------ -- (void)applicationWillResignActive:(UIApplication *)application -{ - AudioIO* audioIO = AudioIO::instance (); - if (audioIO->getInterAppAudioConnected () == false && MidiIO::instance().isEnabled () == false) - { - audioIO->stop (); - } -} - -@end diff --git a/vst/public.sdk/source/vst/testsuite/vsttestsuite.cpp b/vst/public.sdk/source/vst/testsuite/vsttestsuite.cpp deleted file mode 100644 index 12d302f9..00000000 --- a/vst/public.sdk/source/vst/testsuite/vsttestsuite.cpp +++ /dev/null @@ -1,2803 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Validator -// Filename : public.sdk/source/vst/vsttestsuite.cpp -// Created by : Steinberg, 10/2005 -// Description : VST Hosting Utilities -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#include "vsttestsuite.h" - -#include "pluginterfaces/vst/ivstcomponent.h" -#include "pluginterfaces/vst/ivstaudioprocessor.h" -#include "pluginterfaces/vst/ivsteditcontroller.h" -#include "pluginterfaces/vst/ivstprocesscontext.h" -#include "pluginterfaces/vst/ivstmessage.h" -#include "pluginterfaces/vst/ivstunits.h" -#include "pluginterfaces/vst/ivstmidicontrollers.h" -#include "pluginterfaces/vst/ivstnoteexpression.h" -#include "pluginterfaces/vst/vstpresetkeys.h" - -#include "base/source/fstring.h" - -#include -#include -#include - -namespace Steinberg { -namespace Vst { - -#define NUM_ITERATIONS 20 -#define DEFAULT_SAMPLE_RATE 44100 -#define DEFAULT_BLOCK_SIZE 64 -#define MAX_BLOCK_SIZE 8192 -#define BUFFERS_ARE_EQUAL 0 -#define NUM_AUDIO_BLOCKS_TO_PROCESS 3 -#define CHANNEL_IS_SILENT 1 - -#define TOUGHTESTS 0 - -DEF_CLASS_IID (IPlugProvider) - -FUnknown* gStandardPluginContext = 0; -void setStandardPluginContext (FUnknown* context) { gStandardPluginContext = context; }; - -//------------------------------------------------------------------------ -template struct ArrayDeleter -{ - ArrayDeleter (T* array): array (array) {} - ~ArrayDeleter () { if (array) delete[] array; } - - T* array; -}; - - -//------------------------------------------------------------------------ -// VstTestBase -//------------------------------------------------------------------------ -VstTestBase::VstTestBase (IPlugProvider* plugProvider) -: plugProvider (plugProvider) -, controller (0) -, vstPlug (0) -{ - FUNKNOWN_CTOR - - if (plugProvider) - plugProvider->addRef (); -} - -//------------------------------------------------------------------------ -VstTestBase::VstTestBase () -: plugProvider (0) -, controller (0) -, vstPlug (0) -{ - FUNKNOWN_CTOR -} - -//------------------------------------------------------------------------ -VstTestBase::~VstTestBase () -{ - FUNKNOWN_DTOR - - if (plugProvider) - plugProvider->release (); -} - -//------------------------------------------------------------------------ -IMPLEMENT_FUNKNOWN_METHODS (VstTestBase, ITest, ITest::iid) - -//------------------------------------------------------------------------ -bool VstTestBase::setup () -{ - if (plugProvider) - { - vstPlug = plugProvider->getComponent (); - controller = plugProvider->getController (); - - if (vstPlug) - { - vstPlug->activateBus (kAudio, kInput, 0, true); - vstPlug->activateBus (kAudio, kOutput, 0, true); - - return true; - } - } - return false; -} - -//------------------------------------------------------------------------ -bool VstTestBase::teardown () -{ - if (vstPlug) - { - if (vstPlug) - { - vstPlug->activateBus (kAudio, kInput, 0, false); - vstPlug->activateBus (kAudio, kOutput, 0, false); - } - plugProvider->releasePlugIn (vstPlug, controller); - } - return true; -} - -//------------------------------------------------------------------------ -// Component Initialize / Terminate -//------------------------------------------------------------------------ - - -//------------------------------------------------------------------------ -// VstTestEnh -//------------------------------------------------------------------------ -VstTestEnh::VstTestEnh (IPlugProvider* plugProvider, ProcessSampleSize sampl) -: VstTestBase (plugProvider) -, audioEffect (0) -{ - // process setup defaults - memset (&processSetup, 0, sizeof (ProcessSetup)); - - processSetup.processMode = kRealtime; - processSetup.symbolicSampleSize = sampl; - processSetup.maxSamplesPerBlock = kMaxSamplesPerBlock; - processSetup.sampleRate = kSampleRate; -} - -//------------------------------------------------------------------------ -VstTestEnh::~VstTestEnh () -{ -} - -//------------------------------------------------------------------------ -bool VstTestEnh::setup () -{ - bool res = VstTestBase::setup (); - - if (vstPlug) - { - tresult check = vstPlug->queryInterface (IAudioProcessor::iid, (void**)&audioEffect); - if (check != kResultTrue) - return false; - } - - return (res && audioEffect); -} - -//------------------------------------------------------------------------ -bool VstTestEnh::teardown () -{ - if (audioEffect) - audioEffect->release (); - - bool res = VstTestBase::teardown (); - - return res && audioEffect; -} - - -//------------------------------------------------------------------------ -// VstSuspendResumeTest -//------------------------------------------------------------------------ -VstSuspendResumeTest::VstSuspendResumeTest (IPlugProvider* plugProvider, ProcessSampleSize sampl) -: VstTestEnh (plugProvider, sampl) -{} - -//------------------------------------------------------------------------ -bool PLUGIN_API VstSuspendResumeTest::run (ITestResult* testResult) -{ - if (!vstPlug || !testResult) - return false; - - String text; - text.printf (STR ("===%s ===================================="), getName ()); - testResult->addMessage (text); - - for (int32 i = 0; i < 3; ++i) - { - if (audioEffect) - { - if (audioEffect->canProcessSampleSize (kSample32) == kResultOk) - processSetup.symbolicSampleSize = kSample32; - else if (audioEffect->canProcessSampleSize (kSample64) == kResultOk) - processSetup.symbolicSampleSize = kSample64; - else - { - testResult->addErrorMessage (STR ("No appropriate symbolic sample size supported!")); - return false; - } - - if (audioEffect->setupProcessing (processSetup) != kResultOk) - { - testResult->addErrorMessage (STR ("Process setup failed!")); - return false; - } - - } - tresult result = vstPlug->setActive (true); - if (result != kResultOk) - return false; - - result = vstPlug->setActive (false); - if (result != kResultOk) - return false; - } - return true; -} - - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ -// VstTerminateInitializeTest -//------------------------------------------------------------------------ -VstTerminateInitializeTest::VstTerminateInitializeTest (IPlugProvider* plugProvider) -: VstTestBase (plugProvider) -{} - -//------------------------------------------------------------------------ -bool VstTerminateInitializeTest::run (ITestResult* testResult) -{ - if (!vstPlug || !testResult) - return false; - - String text; - text.printf (STR ("===%s ===================================="), getName ()); - testResult->addMessage (text); - - bool result = true; - if (vstPlug->terminate () != kResultTrue) - { - testResult->addErrorMessage (STR ("IPluginBase::terminate () failed.")); - result = false; - } - if (vstPlug->initialize (gStandardPluginContext) != kResultTrue) - { - testResult->addErrorMessage (STR ("IPluginBase::initialize (..) failed.")); - result = false; - } - return result; -} - -//------------------------------------------------------------------------ -// VstScanBussesTest -//------------------------------------------------------------------------ -VstScanBussesTest::VstScanBussesTest (IPlugProvider* plugProvider) -: VstTestBase (plugProvider) -{} - -//------------------------------------------------------------------------ -bool PLUGIN_API VstScanBussesTest::run (ITestResult* testResult) -{ - if (!vstPlug || !testResult) - return false; - - String text; - text.printf (STR ("===%s ===================================="), getName ()); - testResult->addMessage (text); - - int32 numBusses = 0; - - for (MediaType mediaType = kAudio; mediaType < kNumMediaTypes; mediaType++) - { - int32 numInputs = vstPlug->getBusCount (mediaType, kInput); - int32 numOutputs = vstPlug->getBusCount (mediaType, kOutput); - - numBusses += (numInputs + numOutputs); - - if ((mediaType == (kNumMediaTypes - 1)) && (numBusses == 0)) - { - testResult->addErrorMessage (STR ("This component does not export any buses!!!")); - return false; - } - - text.printf (STR ("=> %s Buses: [%d In(s) => %d Out(s)]"), mediaType == kAudio ? STR ("Audio") : STR ("Event"), numInputs, numOutputs); - testResult->addMessage (text); - - for (int32 i = 0; i < numInputs + numOutputs; ++i) - { - BusDirection busDirection = i < numInputs ? kInput : kOutput; - int32 busIndex = busDirection == kInput ? i : i - numInputs; - - BusInfo busInfo = {0}; - if (vstPlug->getBusInfo (mediaType, busDirection, busIndex, busInfo) == kResultTrue) - { - String busName (busInfo.name);; - - if (busName.isEmpty ()) - { - text.printf (STR ("Bus %d has no name!!!"), busIndex); - testResult->addErrorMessage (text); - return false; - } - - text.printf (STR (" %s[%d]: \"%s\" (%s-%s) "), - busDirection == kInput ? STR ("In ") : STR ("Out"), - busIndex, - busName.text (), - busInfo.busType == kMain ? STR ("Main") : STR ("Aux"), - busInfo.kDefaultActive ? STR ("Default Active") : STR ("Default Inactive")); - - testResult->addMessage (text); - } - else - return false; - } - } - return true; -} - -//------------------------------------------------------------------------ -// VstScanParametersTest -//------------------------------------------------------------------------ -VstScanParametersTest::VstScanParametersTest (IPlugProvider* plugProvider) -: VstTestBase (plugProvider) -{} - -//------------------------------------------------------------------------ -bool PLUGIN_API VstScanParametersTest::run (ITestResult* testResult) -{ - if (!testResult || !vstPlug) - return false; - - String text; - text.printf (STR ("===%s ===================================="), getName ()); - testResult->addMessage (text); - - if (!controller) - { - testResult->addMessage (STR ("No Edit Controller supplied!")); - return true; - } - - int32 numParameters = controller->getParameterCount (); - if (numParameters <= 0) - { - testResult->addMessage (STR ("This component does not export any parameters!")); - return true; - } - - text.printf (STR ("This component exports %d parameter(s)"), numParameters); - testResult->addMessage (text); - - FUnknownPtr iUnitInfo2 (controller); - if (!iUnitInfo2 && numParameters > 20) - { - testResult->addMessage (STR ("Note: it could be better to use UnitInfo in order to sort Parameters (>20).")); - } - - // used for ID check - int32* paramIds = new int32[numParameters]; - - bool foundBypass = false; - for (int32 i = 0; i < numParameters; ++i) - { - ParameterInfo paramInfo = {0}; - - tresult result = controller->getParameterInfo (i, paramInfo); - if (result != kResultOk) - { - text.printf (STR ("Param %03d: is missing!!!"), i); - testResult->addErrorMessage (text); - return false; - } - - int32 paramId = paramInfo.id; - paramIds[i] = paramId; - if (paramId < 0) - { - text.printf (STR ("Param %03d: Invalid Id!!!"), i); - testResult->addErrorMessage (text); - return false; - } - - // check if ID is already used by another parameter - for (int32 idIndex = 0; idIndex < i; idIndex++) - { - if (paramIds[idIndex] == paramIds[i]) - { - text.printf (STR ("Param %03d: ID already used (by %03d)!!!"), i, idIndex); - testResult->addErrorMessage (text); - return false; - } - } - - const tchar* paramType = kEmptyString; - if (paramInfo.stepCount < 0) - { - text.printf (STR ("Param %03d: invalid stepcount!!!"), i); - testResult->addErrorMessage (text); - return false; - } - if (paramInfo.stepCount == 0) - paramType = STR ("Float"); - else if (paramInfo.stepCount == 1) - paramType = STR ("Toggle"); - else - paramType = STR ("Discrete"); - - - String paramTitle (paramInfo.title); - String paramUnits (paramInfo.units); - - if (paramTitle.isEmpty ()) - { - text.printf (STR ("Param %03d: has no title!!!"), i); - testResult->addErrorMessage (text); - return false; - } - - if (paramInfo.defaultNormalizedValue != -1.f && (paramInfo.defaultNormalizedValue < 0. || paramInfo.defaultNormalizedValue > 1.)) - { - text.printf (STR ("Param %03d: defaultValue is not normalized!!!"), i); - testResult->addErrorMessage (text); - return false; - } - - int32 unitId = paramInfo.unitId; - if (unitId < -1) - { - text.printf (STR ("Param %03d: No appropriate unit ID!!!"), i); - testResult->addErrorMessage (text); - return false; - } - if (unitId >= -1) - { - FUnknownPtr iUnitInfo (controller); - if (!iUnitInfo && unitId != 0) - { - text.printf (STR ("IUnitInfo interface is missing, but ParameterInfo::unitID is not %03d (kRootUnitId)."), kRootUnitId); - testResult->addErrorMessage (text); - return false; - } - else if (iUnitInfo) - { - bool found = false; - int32 uc = iUnitInfo->getUnitCount (); - for (int32 ui = 0; ui < uc; ++ui) - { - UnitInfo uinfo = {0}; - if (iUnitInfo->getUnitInfo (ui, uinfo) != kResultTrue) - { - testResult->addErrorMessage (STR ("IUnitInfo::getUnitInfo (..) failed.")); - return false; - } - if (uinfo.id == unitId) - found = true; - } - if (!found && unitId != kRootUnitId) - { - testResult->addErrorMessage (STR ("Parameter has a UnitID, which isn't defined in IUnitInfo.")); - return false; - } - } - } - if (((paramInfo.flags & ParameterInfo::kCanAutomate) != 0) && ((paramInfo.flags & ParameterInfo::kIsReadOnly) != 0)) - { - testResult->addErrorMessage (STR ("Parameter must not be kCanAutomate and kReadOnly at the same time.")); - return false; - } - - if ((paramInfo.flags & ParameterInfo::kIsBypass) != 0) - { - if (!foundBypass) - foundBypass = true; - else - { - testResult->addErrorMessage (STR ("There can only be one bypass (kIsBypass).")); - return false; - } - } - - text.printf (STR (" Param %03d (ID = %d): [title=\"%s\"] [unit=\"%s\"] [type = %s, default = %lf, unit = %d]"), - i, paramId, paramTitle.text (), paramUnits.text (), paramType, paramInfo.defaultNormalizedValue, unitId); - - testResult->addMessage (text); - } - - if (foundBypass == false) - { - testResult->addMessage (STR ("Warning: No bypass parameter found. Is this intended ?")); - } - - if (paramIds) - delete [] paramIds; - - return true; -} - -//------------------------------------------------------------------------ -// VstMidiMappingTest -//------------------------------------------------------------------------ -VstMidiMappingTest::VstMidiMappingTest (IPlugProvider* plugProvider) -: VstTestBase (plugProvider) -{} - -//------------------------------------------------------------------------ -bool PLUGIN_API VstMidiMappingTest::run (ITestResult* testResult) -{ - if (!testResult || !vstPlug) - return false; - - String text; - text.printf (STR ("===%s ===================================="), getName ()); - testResult->addMessage (text); - - if (!controller) - { - testResult->addMessage (STR ("No Edit Controller supplied!")); - return true; - } - - FUnknownPtr midiMapping (controller); - if (!midiMapping) - { - testResult->addMessage (STR ("No MIDI Mapping interface supplied!")); - return true; - } - - int32 numParameters = controller->getParameterCount (); - int32 eventBusCount = vstPlug->getBusCount (kEvent, kInput); - bool interruptProcess = false; - - for (int32 bus = 0; bus < eventBusCount + 1; bus++) - { - if (interruptProcess) - break; - - BusInfo info; - vstPlug->getBusInfo (kEvent, kInput, bus, info); - - for (int16 channel = 0; channel < info.channelCount; channel++) - { - if (interruptProcess) - break; - - int32 foundCount = 0; - for (CtrlNumber cc = 0; cc < kCountCtrlNumber + 1; cc++) - { - ParamID tag; - if (midiMapping->getMidiControllerAssignment (bus, channel, cc, tag) == kResultTrue) - { - if (bus >= eventBusCount) - { - testResult->addMessage (STR ("MIDI Mapping supplied for an unknown event bus")); - interruptProcess = true; - break; - } - if (cc >= kCountCtrlNumber) - { - testResult->addMessage (STR ("MIDI Mapping supplied for an wrong ControllerNumbers value (bigger than the max)")); - break; - } - - bool foundParameter = false; - for (int32 i = 0; i < numParameters; ++i) - { - ParameterInfo info; - if (controller->getParameterInfo (i, info) == kResultTrue) - { - if (info.id == tag) - { - foundParameter = true; - break; - } - } - } - if (!foundParameter) - { - String str; - str.printf ("Unknown ParamID [%d] returned for MIDI Mapping", tag); - testResult->addErrorMessage (str); - return false; - } - foundCount++; - } - else - { - if (bus >= eventBusCount) - interruptProcess = true; - } - } - if (foundCount == 0 && (bus < eventBusCount)) - { - String str; - str.printf (STR ("MIDI Mapping getMidiControllerAssignment (%d, %d) : no assignment available!"), bus, channel); - testResult->addMessage (str); - } - } - } - - return true; -} - -//------------------------------------------------------------------------ -// VstNoteExpressionTest -//------------------------------------------------------------------------ -VstNoteExpressionTest::VstNoteExpressionTest (IPlugProvider* plugProvider) -: VstTestBase (plugProvider) -{} - -//------------------------------------------------------------------------ -bool PLUGIN_API VstNoteExpressionTest::run (ITestResult* testResult) -{ - if (!testResult || !vstPlug) - return false; - - String text; - text.printf (STR ("===%s ===================================="), getName ()); - testResult->addMessage (text); - - if (!controller) - { - testResult->addMessage (STR ("No Edit Controller supplied!")); - return true; - } - - FUnknownPtr noteExpression (controller); - if (!noteExpression) - { - testResult->addMessage (STR ("No Note Expression interface supplied!")); - return true; - } - - int32 eventBusCount = vstPlug->getBusCount (kEvent, kInput); - - for (int32 bus = 0; bus < eventBusCount; bus++) - { - BusInfo busInfo; - vstPlug->getBusInfo (kEvent, kInput, bus, busInfo); - - for (int16 channel = 0; channel < busInfo.channelCount; channel++) - { - int32 count = noteExpression->getNoteExpressionCount (bus, channel); - if (count > 0) - { - String str; - str.printf (STR ("Note Expression count bus[%d], channel[%d]: %d"), bus, channel, count); - testResult->addMessage (str); - } - - for (int32 i = 0; i < count; ++i) - { - NoteExpressionTypeInfo info; - if (noteExpression->getNoteExpressionInfo (bus, channel, i, info) == kResultTrue) - { - String msg; - msg.printf (STR("Note Expression TypeID: %d [%s]"), info.typeId, info.title); - testResult->addMessage (msg); - NoteExpressionTypeID id = info.typeId; - NoteExpressionValue valueNormalized = info.valueDesc.defaultValue; - String128 string; - if (noteExpression->getNoteExpressionStringByValue (bus, channel, id, valueNormalized, string) != kResultTrue) - { - String str; - str.printf (STR ("Note Expression getNoteExpressionStringByValue (%d, %d, %d) return kResultFalse!"), bus, channel, id); - testResult->addMessage (str); - } - - if (noteExpression->getNoteExpressionValueByString (bus, channel, id, string, valueNormalized) != kResultTrue) - { - String str; - str.printf (STR ("Note Expression getNoteExpressionValueByString (%d, %d, %d) return kResultFalse!"), bus, channel, id); - testResult->addMessage (str); - } - } - else - { - String str; - str.printf (STR ("Note Expression getNoteExpressionInfo (%d, %d, %d) return kResultFalse!"), bus, channel, i); - testResult->addErrorMessage (str); - return false; - } - } - } - } - - return true; -} - - - -//------------------------------------------------------------------------ -// VstKeyswitchTest -//------------------------------------------------------------------------ -VstKeyswitchTest::VstKeyswitchTest (IPlugProvider* plugProvider) -: VstTestBase (plugProvider) -{} - -//------------------------------------------------------------------------ -bool PLUGIN_API VstKeyswitchTest::run (ITestResult* testResult) -{ - if (!testResult || !vstPlug) - return false; - - String text; - text.printf (STR ("===%s ===================================="), getName ()); - testResult->addMessage (text); - - if (!controller) - { - testResult->addMessage (STR ("No Edit Controller supplied!")); - return true; - } - - FUnknownPtr keyswitch (controller); - if (!keyswitch) - { - testResult->addMessage (STR ("No Keyswitch interface supplied!")); - return true; - } - - int32 eventBusCount = vstPlug->getBusCount (kEvent, kInput); - - for (int32 bus = 0; bus < eventBusCount; bus++) - { - BusInfo busInfo; - vstPlug->getBusInfo (kEvent, kInput, bus, busInfo); - - for (int16 channel = 0; channel < busInfo.channelCount; channel++) - { - int32 count = keyswitch->getKeyswitchCount (bus, channel); - - if (count > 0) - { - String str; - str.printf (STR ("Keyswitch support bus[%d], channel[%d]: %d"), bus, channel, count); - testResult->addMessage (str); - } - - for (int32 i = 0; i < count; ++i) - { - KeyswitchInfo info; - if (keyswitch->getKeyswitchInfo (bus, channel, i, info) == kResultTrue) - { - } - else - { - String str; - str.printf (STR ("Keyswitch getKeyswitchInfo (%d, %d, %d) return kResultFalse!"), bus, channel, i); - testResult->addErrorMessage (str); - return false; - } - } - } - } - - return true; -} - -//------------------------------------------------------------------------ -// VstEditorClassesTest -//------------------------------------------------------------------------ -VstEditorClassesTest::VstEditorClassesTest (IPlugProvider* plugProvider) -: VstTestBase (plugProvider) -{} - -//------------------------------------------------------------------------ -bool PLUGIN_API VstEditorClassesTest::run (ITestResult* testResult) -{ - if (!vstPlug || !testResult) - return false; - - String text; - text.printf (STR ("===%s ===================================="), getName ()); - testResult->addMessage (text); - - // no controller is allowed... - if (FUnknownPtr (vstPlug).getInterface ()) - { - testResult->addMessage (STR ("Processor and edit controller united.")); - return true; - } - - FUID controllerClassUID; - if (vstPlug->getControllerClassId (controllerClassUID) != kResultOk) - { - testResult->addMessage (STR ("This component does not export an edit controller class ID!!!")); - return true; - } - if (controllerClassUID.isValid () == false) - { - testResult->addErrorMessage (STR ("The edit controller class has no valid UID!!!")); - return false; - } - - testResult->addMessage (STR ("This component has an edit controller class")); - - char8 cidString[50]; - - controllerClassUID.toRegistryString (cidString); - String cidStr (cidString); - text.printf (" Controller CID: %s", cidStr.text8 ()); - testResult->addMessage (text); - - return true; -} - - -//------------------------------------------------------------------------ -// VstUnitInfoTest -//------------------------------------------------------------------------ -VstUnitInfoTest::VstUnitInfoTest (IPlugProvider* plugProvider) -: VstTestBase (plugProvider) -{ -} - -//------------------------------------------------------------------------ -bool VstUnitInfoTest::run (ITestResult* testResult) -{ - if (!vstPlug || !testResult) - return false; - - String text; - text.printf (STR ("===%s ===================================="), getName ()); - testResult->addMessage (text); - - FUnknownPtr iUnitInfo (controller); - if (iUnitInfo) - { - int32 unitCount = iUnitInfo->getUnitCount (); - if (unitCount <= 0) - { - testResult->addMessage (STR ("No units found, while controller implements IUnitInfo !!!")); - } - else - { - text.printf (STR ("This component has %d unit(s)."), unitCount); - testResult->addMessage (text); - } - - int32* unitIds = new int32[unitCount]; - ArrayDeleter unitIdDeleter (unitIds); - - for (int32 unitIndex = 0; unitIndex < unitCount; unitIndex++) - { - UnitInfo unitInfo = {0}; - - if (iUnitInfo->getUnitInfo (unitIndex, unitInfo) == kResultOk) - { - int32 unitId = unitInfo.id; - unitIds[unitIndex] = unitId; - if (unitId < 0) - { - text.printf (STR ("Unit %03d: Invalid ID!"), unitIndex); - testResult->addErrorMessage (text); - return false; - } - - // check if ID is already used by another unit - for (int32 idIndex = 0; idIndex < unitIndex; idIndex++) - { - if (unitIds[idIndex] == unitIds[unitIndex]) - { - text.printf (STR ("Unit %03d: ID already used!!!"), unitIndex); - testResult->addErrorMessage (text); - return false; - } - } - - String unitName (unitInfo.name); - if (unitName.isEmpty ()) - { - text.printf (STR ("Unit %03d: No name!"), unitIndex); - testResult->addErrorMessage (text); - return false; - } - - int32 parentUnitId = unitInfo.parentUnitId; - if (parentUnitId < -1) - { - text.printf (STR ("Unit %03d: Invalid parent ID!"), unitIndex); - testResult->addErrorMessage (text); - return false; - } - else if (parentUnitId == unitId) - { - text.printf (STR ("Unit %03d: Parent ID is equal to Unit ID!"), unitIndex); - testResult->addErrorMessage (text); - return false; - } - - int32 unitProgramListId = unitInfo.programListId; - if (unitProgramListId < -1) - { - text.printf (STR ("Unit %03d: Invalid programlist ID!"), unitIndex); - testResult->addErrorMessage (text); - return false; - } - - text.printf (STR (" Unit%03d (ID = %d): \"%s\" (parent ID = %d, programlist ID = %d)"), - unitIndex, unitId, unitName.text (), parentUnitId, unitProgramListId); - - testResult->addMessage (text); - - // test select Unit - if (iUnitInfo->selectUnit (unitIndex) == kResultTrue) - { - UnitID newSelected = iUnitInfo->getSelectedUnit (); - if (newSelected != unitIndex) - { - text.printf (STR ("The host has selected Unit ID = %d but getSelectedUnit returns ID = %d!!!"), - unitIndex, newSelected); - testResult->addMessage (text); - } - } - } - else - { - text.printf (STR ("Unit%03d: No unit info!"), unitIndex); - } - } - } - else - { - testResult->addMessage (STR ("This component has no units.")); - } - - return true; -} - - -//------------------------------------------------------------------------ -// VstUnitStructureTest -//------------------------------------------------------------------------ -VstUnitStructureTest::VstUnitStructureTest (IPlugProvider* plugProvider) -: VstTestBase (plugProvider) -{ -} - -//------------------------------------------------------------------------ -bool VstUnitStructureTest::run (ITestResult* testResult) -{ - if (!vstPlug || !testResult) - return false; - - String text; - text.printf (STR ("===%s ===================================="), getName ()); - testResult->addMessage (text); - - FUnknownPtr iUnitInfo (controller); - if (iUnitInfo) - { - int32 unitCount = iUnitInfo->getUnitCount (); - if (unitCount <= 0) - { - testResult->addMessage (STR ("No units found, while controller implements IUnitInfo !!!")); - } - - UnitInfo unitInfo = {0}; - UnitInfo tmpInfo = {0}; - bool rootFound = false; - for (int32 unitIndex = 0; unitIndex < unitCount; unitIndex++) - { - if (iUnitInfo->getUnitInfo (unitIndex, unitInfo) == kResultOk) - { - // check parent Id - if (unitInfo.parentUnitId != kNoParentUnitId) //-1: connected to root - { - bool noParent = true; - for (int32 i = 0; i < unitCount; ++i) - { - if (iUnitInfo->getUnitInfo (i, tmpInfo) == kResultOk) - { - if (unitInfo.parentUnitId == tmpInfo.id) - { - noParent = false; - break; - } - } - } - if (noParent && unitInfo.parentUnitId != kRootUnitId) - { - text.printf (STR ("Unit %03d: Parent does not exist!!"), unitInfo.id); - testResult->addErrorMessage (text); - return false; - } - } - else if (!rootFound) - { - // root Unit have always the rootID - if (unitInfo.id != kRootUnitId) - { - // we should have a root unit id - text.printf (STR ("Unit %03d: Should be the Root Unit => id should be %03d!!"), unitInfo.id, kRootUnitId); - testResult->addErrorMessage (text); - return false; - } - rootFound = true; - } - else - { - text.printf (STR ("Unit %03d: Has no parent, but there is a root already."), unitInfo.id); - testResult->addErrorMessage (text); - return false; - } - } - else - { - text.printf (STR ("Unit %03d: No unit info."), unitInfo.id); - testResult->addErrorMessage (text); - return false; - } - } - testResult->addMessage (STR ("All units have valid parent IDs.")); - } - else - { - testResult->addMessage (STR ("This component does not support IUnitInfo!")); - } - return true; -} - - -//------------------------------------------------------------------------ -// VstProgramInfoTest -//------------------------------------------------------------------------ -VstProgramInfoTest::VstProgramInfoTest (IPlugProvider* plugProvider) -: VstTestBase (plugProvider) -{ -} - -//------------------------------------------------------------------------ -bool VstProgramInfoTest::run (ITestResult* testResult) -{ - if (!vstPlug || !testResult) - return false; - - String text; - text.printf (STR ("===%s ===================================="), getName ()); - testResult->addMessage (text); - - FUnknownPtr iUnitInfo (controller); - if (iUnitInfo) - { - int32 programListCount = iUnitInfo->getProgramListCount (); - if (programListCount == 0) - { - testResult->addMessage (STR ("This component does not export any programs.")); - return true; - } - else if (programListCount < 0) - { - testResult->addErrorMessage (STR ("IUnitInfo::getProgramListCount () returned a negative number.")); - return false; - } - - // used to check double IDs - int32* programListIds = new int32 [programListCount]; - ArrayDeleter idDeleter (programListIds); - - for (int32 programListIndex = 0; programListIndex < programListCount; programListIndex++) - { - // get programm list info - ProgramListInfo programListInfo; - if (iUnitInfo->getProgramListInfo (programListIndex, programListInfo) == kResultOk) - { - int32 programListId = programListInfo.id; - programListIds [programListIndex] = programListId; - if (programListId < 0) - { - text.printf (STR ("Programlist%03d: Invalid ID!!!"), programListIndex); - testResult->addErrorMessage (text); - return false; - } - - // check if ID is already used by another parameter - for (int32 idIndex = 0; idIndex < programListIndex; idIndex++) - { - if (programListIds[idIndex] == programListIds[programListIndex]) - { - text.printf (STR ("Programlist%03d: ID already used!!!"), programListIndex); - testResult->addErrorMessage (text); - return false; - } - } - - String programListName (programListInfo.name); - if (programListName.isEmpty ()) - { - text.printf (STR ("Programlist%03d (ID = %d): No name!!!"), programListIndex, programListId); - testResult->addErrorMessage (text); - return false; - } - - int32 programCount = programListInfo.programCount; - if (programCount <= 0) - { - text.printf (STR ("Programlist%03d (ID = %d): \"%s\" No programs!!! (programCount is null!)"), programListIndex, programListId, programListName.text ()); - testResult->addMessage (text); - //return false; - } - - text.printf (STR ("Programlist%03d (ID = %d): \"%s\" (%d programs)."), programListIndex, programListId, programListName.text (), programCount); - testResult->addMessage (text); - - for (int32 programIndex = 0; programIndex < programCount; programIndex++) - { - TChar programName[256]; - if (iUnitInfo->getProgramName (programListId, programIndex, programName) == kResultOk) - { - if (programName[0] == 0) - { - text.printf (STR ("Programlist%03d-Program%03d: has no name!!!"), programListIndex, programIndex); - testResult->addErrorMessage (text); - return false; - } - - String tmp (programName); - text.printf (STR ("Programlist%03d-Program%03d: \"%s\""), programListIndex, programIndex, tmp.text ()); - - String128 programInfo = {0}; - if (iUnitInfo->getProgramInfo (programListId, programIndex, PresetAttributes::kInstrument, programInfo) == kResultOk) - { - tmp = programInfo; - text.append (STR (" (instrument = \"")); - text.append (tmp); - text.append (STR ("\")")); - } - - testResult->addMessage (text); - - if (iUnitInfo->hasProgramPitchNames (programListId, programIndex) == kResultOk) - { - tmp = programName; - text.printf (STR (" => \"%s\": supports PitchNames"), tmp.text ()); - testResult->addMessage (text); - - String128 pitchName = {0}; - for (int16 midiPitch = 0; midiPitch < 128; midiPitch++) - { - if (iUnitInfo->getProgramPitchName (programListId, programIndex, midiPitch, pitchName) == kResultOk) - { - tmp = pitchName; - text.printf (STR (" => MIDI Pitch %d => \""), midiPitch); - text.append (tmp); - text.append (STR ("\"")); - testResult->addMessage (text); - } - } - } - } - } - } - } - } - else - testResult->addMessage (STR ("This component does not export any programs.")); - - return true; -} - -//------------------------------------------------------------------------ -// VstValidStateTransitionTest -//------------------------------------------------------------------------ -VstValidStateTransitionTest::VstValidStateTransitionTest (IPlugProvider* plugProvider) -: VstTestBase (plugProvider) -{} - -//------------------------------------------------------------------------ -bool PLUGIN_API VstValidStateTransitionTest::run (ITestResult* testResult) -{ - if (!vstPlug || !testResult) - return false; - - String text; - text.printf (STR ("===%s ===================================="), getName ()); - testResult->addMessage (text); - - for (int32 i = 0; i < 3; ++i) - { - tresult result = vstPlug->setActive (true); - if (result != kResultTrue) - return false; - - result = vstPlug->setActive (false); - if (result != kResultTrue) - return false; - - result = vstPlug->terminate (); - if (result != kResultTrue) - return false; - - result = vstPlug->initialize (gStandardPluginContext); - if (result != kResultTrue) - return false; - } - return true; -} - -//------------------------------------------------------------------------ -// VstInvalidStateTransitionTest -//------------------------------------------------------------------------ -VstInvalidStateTransitionTest::VstInvalidStateTransitionTest (IPlugProvider* plugProvider) -: VstTestBase (plugProvider) -{} - -//------------------------------------------------------------------------ -bool PLUGIN_API VstInvalidStateTransitionTest::run (ITestResult* testResult) -{ - if (!vstPlug || !testResult) - return false; - - String text; - text.printf (STR ("===%s ===================================="), getName ()); - testResult->addMessage (text); - - // created - tresult result = vstPlug->initialize (gStandardPluginContext); - if (result == kResultFalse) - return false; - - // initialized - result = vstPlug->setActive (false); - if (result == kResultOk) - return false; - - result = vstPlug->setActive (true); - if (result == kResultFalse) - return false; - - // allocated - result = vstPlug->initialize (gStandardPluginContext); - if (result == kResultOk) - return false; - - result = vstPlug->setActive (false); - if (result == kResultFalse) - return false; - - // deallocated (initialized) - result = vstPlug->initialize (gStandardPluginContext); - if (result == kResultOk) - return false; - - result = vstPlug->terminate (); - if (result == kResultFalse) - return false; - - // terminated (created) - result = vstPlug->setActive (false); - if (result == kResultOk) - return false; - - result = vstPlug->terminate (); - if (result == kResultOk) - return false; - - return true; -} - -//------------------------------------------------------------------------ -// VstRepeatIdenticalStateTransitionTest -//------------------------------------------------------------------------ -VstRepeatIdenticalStateTransitionTest::VstRepeatIdenticalStateTransitionTest (IPlugProvider* plugProvider) -: VstTestBase (plugProvider) -{} - -//------------------------------------------------------------------------ -bool VstRepeatIdenticalStateTransitionTest::run (ITestResult* testResult) -{ - if (!vstPlug || !testResult) - return false; - - String text; - text.printf (STR ("===%s ===================================="), getName ()); - testResult->addMessage (text); - - tresult result = vstPlug->initialize (gStandardPluginContext); - if (result != kResultFalse) - return false; - - result = vstPlug->setActive (true); - if (result != kResultOk) - return false; - - result = vstPlug->setActive (true); - if (result != kResultFalse) - return false; - - result = vstPlug->setActive (false); - if (result != kResultOk) - return false; - - result = vstPlug->setActive (false); - if (result == kResultOk) - return false; - - result = vstPlug->terminate (); - if (result != kResultOk) - return false; - - result = vstPlug->terminate (); - if (result == kResultOk) - return false; - - result = vstPlug->initialize (gStandardPluginContext); - if (result != kResultOk) - return false; - - return true; -} - -//------------------------------------------------------------------------ -// VstBusConsistencyTest -//------------------------------------------------------------------------ -VstBusConsistencyTest::VstBusConsistencyTest (IPlugProvider* plugProvider) -: VstTestBase (plugProvider) -{ -} - -//------------------------------------------------------------------------ -bool PLUGIN_API VstBusConsistencyTest::run (ITestResult* testResult) -{ - if (!vstPlug || !testResult) - return false; - - String text; - text.printf (STR ("===%s ===================================="), getName ()); - testResult->addMessage (text); - - bool failed = false; - int32 numFalseDescQueries = 0; - - for (MediaType mediaType = kAudio; mediaType < kNumMediaTypes; mediaType++) - { - for (BusDirection dir = kInput; dir <= kOutput; dir++) - { - int32 numBusses = vstPlug->getBusCount (mediaType, dir); - if (numBusses > 0) - { - BusInfo* busArray = new BusInfo[numBusses]; - if (busArray) - { - // get all bus descriptions and save them in an array - int32 busIndex; - for (busIndex = 0; busIndex < numBusses; busIndex++) - { - memset (&busArray[busIndex], 0, sizeof (BusInfo)); - vstPlug->getBusInfo (mediaType, dir, busIndex, busArray[busIndex]); - } - - // test by getting descriptions randomly and comparing with saved ones - int32 randIndex = 0; - BusInfo info = {0}; - - for (busIndex = 0; busIndex <= numBusses * NUM_ITERATIONS; busIndex++) - { - randIndex = rand () % (numBusses); - - memset (&info, 0, sizeof (BusInfo)); - - /*tresult result =*/ vstPlug->getBusInfo (mediaType, dir, randIndex, info); - if (memcmp ((void*)&busArray[randIndex], (void*)&info, sizeof (BusInfo)) != BUFFERS_ARE_EQUAL) - { - failed |= true; - numFalseDescQueries++; - } - } - delete [] busArray; - } - } - } - } - - if (numFalseDescQueries > 0) - { - text.printf (STR ("The component returned %i inconsistent buses! (getBusInfo () returns sometime different info for the same bus!"), numFalseDescQueries); - testResult->addErrorMessage (text); - } - - return failed == false; -} - -//------------------------------------------------------------------------ -// VstBusInvalidIndexTest -//------------------------------------------------------------------------ -VstBusInvalidIndexTest::VstBusInvalidIndexTest (IPlugProvider* plugProvider) -: VstTestBase (plugProvider) -{ -} - -//------------------------------------------------------------------------ -bool PLUGIN_API VstBusInvalidIndexTest::run (ITestResult* testResult) -{ - if (!vstPlug || !testResult) - return false; - - String text; - text.printf (STR ("===%s ===================================="), getName ()); - testResult->addMessage (text); - - bool failed = false; - int32 numInvalidDesc = 0; - - for (MediaType mediaType = kAudio; mediaType < kNumMediaTypes; mediaType++) - { - int32 numBusses = vstPlug->getBusCount (mediaType, kInput) + vstPlug->getBusCount (mediaType, kOutput); - for (BusDirection dir = kInput; dir <= kOutput; dir++) - { - BusInfo descBefore = {0}; - BusInfo descAfter = {0}; - - int32 randIndex = 0; - - // todo: rand with negative numbers - for (int32 i = 0; i <= numBusses * NUM_ITERATIONS; ++i) - { - randIndex = rand (); - if (0 > randIndex || randIndex > numBusses) - { - /*tresult result =*/ vstPlug->getBusInfo (mediaType, dir, randIndex, descAfter); - - if (memcmp ((void*)&descBefore, (void*)&descAfter, sizeof (BusInfo)) != 0) - { - failed |= true; - numInvalidDesc++; - } - } - } - } - } - - if (numInvalidDesc > 0) - { - text.printf (STR ("The component returned %i buses queried with an invalid index!"), numInvalidDesc); - testResult->addErrorMessage (text); - } - - return failed == false; -} - -//------------------------------------------------------------------------ -// VstProcessTest -//------------------------------------------------------------------------ -VstProcessTest::VstProcessTest (IPlugProvider* plugProvider, ProcessSampleSize sampl) -: VstTestEnh (plugProvider, sampl) -{ - processData.numSamples = DEFAULT_BLOCK_SIZE; - processData.symbolicSampleSize = sampl; - - processSetup.processMode = kRealtime; - processSetup.symbolicSampleSize = sampl; - processSetup.maxSamplesPerBlock = MAX_BLOCK_SIZE; - processSetup.sampleRate = DEFAULT_SAMPLE_RATE; -} - -//------------------------------------------------------------------------ -bool PLUGIN_API VstProcessTest::setup () -{ - if (!VstTestEnh::setup ()) - return false; - if (!vstPlug || !audioEffect) - return false; - if (processSetup.symbolicSampleSize != processData.symbolicSampleSize) - return false; - if (audioEffect->canProcessSampleSize (processSetup.symbolicSampleSize) != kResultOk) - return true; // this fails in run (..) - - prepareProcessing (); - - if (vstPlug->setActive (true) != kResultTrue) - return false; - return true; -} - -//------------------------------------------------------------------------ -bool PLUGIN_API VstProcessTest::run (ITestResult* testResult) -{ - if (!testResult || !audioEffect) - return false; - if (processSetup.symbolicSampleSize != processData.symbolicSampleSize) - return false; - if (!canProcessSampleSize (testResult)) - return true; - - audioEffect->setProcessing (true); - - for (int32 i = 0; i < NUM_AUDIO_BLOCKS_TO_PROCESS; ++i) - { - if (!preProcess (testResult)) - return false; - tresult result = audioEffect->process (processData); - if (result != kResultOk) - { - testResult->addErrorMessage (STR ("IAudioProcessor::process (..) failed.")); - - audioEffect->setProcessing (false); - return false; - } - if (!postProcess (testResult)) - { - audioEffect->setProcessing (false); - return false; - } - } - - audioEffect->setProcessing (false); - return true; -} - -//------------------------------------------------------------------------ -bool VstProcessTest::preProcess (ITestResult* testResult) -{ - return true; -} - -//------------------------------------------------------------------------ -bool VstProcessTest::postProcess (ITestResult* testResult) -{ - return true; -} - -//------------------------------------------------------------------------ -bool VstProcessTest::canProcessSampleSize (ITestResult* testResult) -{ - if (!testResult || !audioEffect) - return false; - if (processSetup.symbolicSampleSize != processData.symbolicSampleSize) - return false; - if (audioEffect->canProcessSampleSize (processSetup.symbolicSampleSize) != kResultOk) - { - if (processSetup.symbolicSampleSize == kSample32) - testResult->addMessage (STR ("32bit Audio Processing not supported.")); - else - testResult->addMessage (STR ("64bit Audio Processing not supported.")); - return false; - } - return true; -} - -//------------------------------------------------------------------------ -bool PLUGIN_API VstProcessTest::teardown () -{ - unprepareProcessing (); - if (!vstPlug || (vstPlug->setActive (false) != kResultOk)) - return false; - return VstTestEnh::teardown (); -} - -//------------------------------------------------------------------------ -bool VstProcessTest::prepareProcessing () -{ - if (!vstPlug || !audioEffect) - return false; - - if (audioEffect->setupProcessing (processSetup) == kResultOk) - { - processData.prepare (*vstPlug, 0, processSetup.symbolicSampleSize); - - for (BusDirection dir = kInput; dir <= kOutput; dir++) - { - int32 numBusses = vstPlug->getBusCount (kAudio, dir); - AudioBusBuffers* audioBuffers = dir == kInput ? processData.inputs : processData.outputs; //new AudioBusBuffers [numBusses]; - if (!setupBuffers (numBusses, audioBuffers, dir)) - return false; - - if (dir == kInput) - { - processData.numInputs = numBusses; - processData.inputs = audioBuffers; - } - else - { - processData.numOutputs = numBusses; - processData.outputs = audioBuffers; - } - } - return true; - } - return false; -} - -//------------------------------------------------------------------------ -bool VstProcessTest::setupBuffers (int32 numBusses, AudioBusBuffers* audioBuffers, BusDirection dir) -{ - if (((numBusses > 0) && !audioBuffers) || !vstPlug) - return false; - for (int32 busIndex = 0; busIndex < numBusses; busIndex++) // buses - { - BusInfo busInfo; - if (vstPlug->getBusInfo (kAudio, dir, busIndex, busInfo) == kResultTrue) - { - if (!setupBuffers (audioBuffers[busIndex])) - return false; - - if ((busInfo.flags & BusInfo::kDefaultActive) != 0) - { - for (int32 channelIndex = 0; channelIndex < busInfo.channelCount; channelIndex++) // channels per bus - audioBuffers[busIndex].silenceFlags |= (uint64)CHANNEL_IS_SILENT << channelIndex; - } - } - else - return false; - } - return true; -} - -//------------------------------------------------------------------------ -bool VstProcessTest::setupBuffers (AudioBusBuffers& audioBuffers) -{ - if (processSetup.symbolicSampleSize != processData.symbolicSampleSize) - return false; - audioBuffers.silenceFlags = 0; - for (int32 channelIndex = 0; channelIndex < audioBuffers.numChannels; channelIndex++) - { - if (processSetup.symbolicSampleSize == kSample32) - { - if (audioBuffers.channelBuffers32) - { - audioBuffers.channelBuffers32[channelIndex] = new Sample32[processSetup.maxSamplesPerBlock]; - if (audioBuffers.channelBuffers32[channelIndex]) - memset (audioBuffers.channelBuffers32[channelIndex], 0, processSetup.maxSamplesPerBlock * sizeof (Sample32)); - else - return false; - } - else - return false; - } - else if (processSetup.symbolicSampleSize == kSample64) - { - if (audioBuffers.channelBuffers64) - { - audioBuffers.channelBuffers64[channelIndex] = new Sample64[processSetup.maxSamplesPerBlock]; - if (audioBuffers.channelBuffers64[channelIndex]) - memset (audioBuffers.channelBuffers64[channelIndex], 0, processSetup.maxSamplesPerBlock * sizeof (Sample64)); - else - return false; - } - else - return false; - } - else - return false; - } - return true; -} - -//------------------------------------------------------------------------ -bool VstProcessTest::unprepareProcessing () -{ - bool ret = true; - ret &= freeBuffers (processData.numInputs, processData.inputs); - ret &= freeBuffers (processData.numOutputs, processData.outputs); - processData.unprepare (); - return ret; -} - -//------------------------------------------------------------------------ -bool VstProcessTest::freeBuffers (int32 numBuses, AudioBusBuffers* buses) -{ - if (processSetup.symbolicSampleSize != processData.symbolicSampleSize) - return false; - for (int32 busIndex = 0; busIndex < numBuses; busIndex++) - { - for (int32 channelIndex = 0; channelIndex < buses[busIndex].numChannels; channelIndex++) - { - if (processSetup.symbolicSampleSize == kSample32) - delete [] buses[busIndex].channelBuffers32[channelIndex]; - else if (processSetup.symbolicSampleSize == kSample64) - delete [] buses[busIndex].channelBuffers64[channelIndex]; - else - return false; - } - } - return true; -} - - -//------------------------------------------------------------------------ -// VstSpeakerArrangementTest -//------------------------------------------------------------------------ -VstSpeakerArrangementTest::VstSpeakerArrangementTest (IPlugProvider* plugProvider, ProcessSampleSize sampl, - SpeakerArrangement inSpArr, SpeakerArrangement outSpArr) -: VstProcessTest (plugProvider, sampl) -, inSpArr (inSpArr) -, outSpArr (outSpArr) -{ -} - -//------------------------------------------------------------------------ -const tchar* VstSpeakerArrangementTest::getSpeakerArrangementName (SpeakerArrangement spArr) -{ - const tchar* saName = 0; - switch (spArr) - { - case SpeakerArr::kMono: saName = STR ("Mono"); break; - case SpeakerArr::kStereo: saName = STR ("Stereo"); break; - case SpeakerArr::kStereoSurround: saName = STR ("StereoSurround"); break; - case SpeakerArr::kStereoCenter: saName = STR ("StereoCenter"); break; - case SpeakerArr::kStereoSide: saName = STR ("StereoSide"); break; - case SpeakerArr::kStereoCLfe: saName = STR ("StereoCLfe"); break; - case SpeakerArr::k30Cine: saName = STR ("30Cine"); break; - case SpeakerArr::k30Music: saName = STR ("30Music"); break; - case SpeakerArr::k31Cine: saName = STR ("31Cine"); break; - case SpeakerArr::k31Music: saName = STR ("31Music"); break; - case SpeakerArr::k40Cine: saName = STR ("40Cine"); break; - case SpeakerArr::k40Music: saName = STR ("40Music"); break; - case SpeakerArr::k41Cine: saName = STR ("41Cine"); break; - case SpeakerArr::k41Music: saName = STR ("41Music"); break; - case SpeakerArr::k50: saName = STR ("50"); break; - case SpeakerArr::k51: saName = STR ("51"); break; - case SpeakerArr::k60Cine: saName = STR ("60Cine"); break; - case SpeakerArr::k60Music: saName = STR ("60Music"); break; - case SpeakerArr::k61Cine: saName = STR ("61Cine"); break; - case SpeakerArr::k61Music: saName = STR ("61Music"); break; - case SpeakerArr::k70Cine: saName = STR ("70Cine"); break; - case SpeakerArr::k70Music: saName = STR ("70Music"); break; - case SpeakerArr::k71Cine: saName = STR ("71Cine"); break; - case SpeakerArr::k71Music: saName = STR ("71Music"); break; - case SpeakerArr::k80Cine: saName = STR ("80Cine"); break; - case SpeakerArr::k80Music: saName = STR ("80Music"); break; - case SpeakerArr::k81Cine: saName = STR ("81Cine"); break; - case SpeakerArr::k81Music: saName = STR ("81Music"); break; - case SpeakerArr::k102: saName = STR ("102"); break; - case SpeakerArr::k122: saName = STR ("122"); break; - case SpeakerArr::k80Cube: saName = STR ("80Cube"); break; - case SpeakerArr::kBFormat: saName = STR ("BFormat"); break; - case SpeakerArr::k90: saName = STR ("9.0"); break; - case SpeakerArr::k91: saName = STR ("9.1"); break; - case SpeakerArr::k100: saName = STR ("10.0"); break; - case SpeakerArr::k101: saName = STR ("10.1"); break; - case SpeakerArr::k110: saName = STR ("11.0"); break; - case SpeakerArr::k111: saName = STR ("11.1"); break; - case SpeakerArr::k130: saName = STR ("13.0"); break; - case SpeakerArr::k131: saName = STR ("13.1"); break; - case SpeakerArr::kEmpty: saName = STR ("Empty"); break; - default: saName = STR ("Unknown"); break; - } - return saName; -} - -//------------------------------------------------------------------------ -const tchar* VstSpeakerArrangementTest::getName () const -{ - const tchar* inSaName = getSpeakerArrangementName (inSpArr); - const tchar* outSaName = getSpeakerArrangementName (outSpArr); - if (inSaName && outSaName) - { - static String text; - text.printf (STR ("In: %s: %d Channels, Out: %s: %d Channels"), inSaName, SpeakerArr::getChannelCount (inSpArr), outSaName, SpeakerArr::getChannelCount (outSpArr)); - return text; - } - return STR ("error"); -} - -//------------------------------------------------------------------------ -bool VstSpeakerArrangementTest::prepareProcessing () -{ - if (!vstPlug || !audioEffect) - return false; - - bool ret = true; - int32 is = vstPlug->getBusCount (kAudio, kInput); - SpeakerArrangement* inSpArrs = new SpeakerArrangement[is]; - for (int32 i = 0; i < is; ++i) - inSpArrs[i] = inSpArr; - - int32 os = vstPlug->getBusCount (kAudio, kOutput); - SpeakerArrangement* outSpArrs = new SpeakerArrangement[os]; - for (int32 o = 0; o < os; o++) - outSpArrs[o] = outSpArr; - - if (audioEffect->setBusArrangements (inSpArrs, is, outSpArrs, os) != kResultTrue) - ret = false; - - ret &= VstProcessTest::prepareProcessing (); - - delete [] inSpArrs; - delete [] outSpArrs; - - return ret; -} - -//------------------------------------------------------------------------ -bool VstSpeakerArrangementTest::run (ITestResult* testResult) -{ - if (!testResult || !audioEffect || !vstPlug) - return false; - - String text; - text.printf (STR ("===%s ===================================="), getName ()); - testResult->addMessage (text); - - SpeakerArrangement spArr = SpeakerArr::kEmpty; - SpeakerArrangement compareSpArr = SpeakerArr::kEmpty; - BusDirections bd = kInput; - BusInfo busInfo = {0}; - int32 count = 0; - do - { - count++; - int32 numBusses = 0; - if (bd == kInput) - { - numBusses = processData.numInputs; - compareSpArr = inSpArr; - } - else - { - numBusses = processData.numOutputs; - compareSpArr = outSpArr; - } - for (int32 i = 0; i < numBusses; ++i) - { - if (audioEffect->getBusArrangement (bd, i, spArr) != kResultTrue) - { - testResult->addErrorMessage (STR ("IAudioProcessor::getBusArrangement (..) failed.")); - return false; - } - if (spArr != compareSpArr) - { - String msg; - msg.printf (STR (" %s %sSpeakerArrangement is not supported. Plug-in suggests: %s."), - getSpeakerArrangementName (compareSpArr), - bd == kInput ? STR ("Input-") : STR ("Output-"), - getSpeakerArrangementName (spArr)); - testResult->addMessage (msg); - } - if (vstPlug->getBusInfo (kAudio, bd, i, busInfo) != kResultTrue) - { - testResult->addErrorMessage (STR ("IComponent::getBusInfo (..) failed.")); - return false; - } - if (spArr == compareSpArr && SpeakerArr::getChannelCount (spArr) != busInfo.channelCount) - { - testResult->addErrorMessage (STR ("SpeakerArrangement mismatch (BusInfo::channelCount inconsistency).")); - return false; - } - } - bd = kOutput; - } while (count < 2); - - bool ret = true; - - // not a Pb ret &= verifySA (processData.numInputs, processData.inputs, inSpArr, testResult); - // not a Pb ret &= verifySA (processData.numOutputs, processData.outputs, outSpArr, testResult); - ret &= VstProcessTest::run (testResult); - - return ret; -} - -//------------------------------------------------------------------------ -bool VstSpeakerArrangementTest::verifySA (int32 numBusses, AudioBusBuffers* buses, SpeakerArrangement spArr, ITestResult* testResult) -{ - if (!testResult || !buses) - return false; - for (int32 i = 0; i < numBusses; ++i) - { - if (buses[i].numChannels != SpeakerArr::getChannelCount (spArr)) - { - testResult->addErrorMessage (STR ("ChannelCount is not matching SpeakerArrangement.")); - return false; - } - } - return true; -} - -IMPLEMENT_FUNKNOWN_METHODS (ParamChanges, IParamValueQueue, IParamValueQueue::iid) - -//------------------------------------------------------------------------ -// VstAutomationTest -//------------------------------------------------------------------------ -IMPLEMENT_FUNKNOWN_METHODS (VstAutomationTest, IParameterChanges, IParameterChanges::iid) - -//------------------------------------------------------------------------ -VstAutomationTest::VstAutomationTest (IPlugProvider* plugProvider, ProcessSampleSize sampl, - int32 everyNSamples, int32 numParams, bool sampleAccuracy) -: VstProcessTest (plugProvider, sampl) -, paramChanges (0) -, countParamChanges (0) -, numParams (numParams) -, everyNSamples (everyNSamples) -, sampleAccuracy (sampleAccuracy) -, bypassId (-1) -, onceExecuted (false) -{ - FUNKNOWN_CTOR -} - -//------------------------------------------------------------------------ -VstAutomationTest::~VstAutomationTest () -{ - FUNKNOWN_DTOR -} - -//------------------------------------------------------------------------ -const tchar* VstAutomationTest::getName () const -{ - static String text; - const tchar* accTxt = STR ("Sample"); - if (!sampleAccuracy) - accTxt = STR ("Block"); - if (numParams < 1) - text.printf (STR ("Accuracy: %s, All Parameters, Change every %d Samples"), accTxt, everyNSamples); - else - text.printf (STR ("Accuracy: %s, %d Parameters, Change every %d Samples"), accTxt, numParams, everyNSamples); - return text; -} - -//------------------------------------------------------------------------ -bool VstAutomationTest::setup () -{ - onceExecuted = false; - if (!VstProcessTest::setup ()) - return false; - - if (!controller) - return false; - if ((numParams < 1) || (numParams > controller->getParameterCount ())) - numParams = controller->getParameterCount (); - if (audioEffect && (numParams > 0)) - { - paramChanges = new ParamChanges [numParams]; - ParameterInfo inf = {0}; - for (int32 i = 0; i < numParams; ++i) - { - tresult r = controller->getParameterInfo (i, inf); - if (r != kResultTrue) - return false; - if ((inf.flags & inf.kCanAutomate) != 0) - paramChanges[i].init (inf.id, processSetup.maxSamplesPerBlock); - } - - for (int32 i = 0; i < controller->getParameterCount (); ++i) - { - tresult r = controller->getParameterInfo (i, inf); - if (r != kResultTrue) - return false; - if ((inf.flags & inf.kIsBypass) != 0) - { - bypassId = inf.id; - break; - } - } - return true; - } - return numParams == 0; -} - -//------------------------------------------------------------------------ -bool VstAutomationTest::run (ITestResult* testResult) -{ - String text; - text.printf (STR ("===%s ===================================="), getName ()); - testResult->addMessage (text); - - if (!testResult) - return false; - if (numParams == 0) - testResult->addMessage (STR ("No Parameters present.")); - bool ret = VstProcessTest::run (testResult); - return ret; -} - -//------------------------------------------------------------------------ -bool VstAutomationTest::teardown () -{ - if (paramChanges) - { - delete [] paramChanges; - paramChanges = 0; - } - return VstProcessTest::teardown (); -} - -//------------------------------------------------------------------------ -bool VstAutomationTest::preProcess (ITestResult* testResult) -{ - if (!testResult) - return false; - if (!paramChanges) - return numParams == 0; - bool check = true; - for (int32 i = 0; i < numParams; ++i) - { - paramChanges[i].resetPoints (); - int32 point = 0; - for (int32 pos = 0; pos < processData.numSamples; pos++) - { - bool add = (rand () % everyNSamples) == 0; - if (!onceExecuted) - { - if (pos == 0) - { - add = true; - if (!sampleAccuracy) - onceExecuted = true; - } - else if ((pos == 1) && sampleAccuracy) - { - add = true; - onceExecuted = true; - } - } - if (add) - check &= paramChanges[i].setPoint (point++, pos, ((float)(rand () % 1000000000)) / 1000000000.0); - } - if (check) - processData.inputParameterChanges = this; - } - return check; -} - -//------------------------------------------------------------------------ -bool VstAutomationTest::postProcess (ITestResult* testResult) -{ - if (!testResult) - return false; - if (!paramChanges) - return numParams == 0; - - for (int32 i = 0; i < numParams; ++i) - { - if ((paramChanges[i].getPointCount () > 0) && !paramChanges[i].havePointsBeenRead (!sampleAccuracy)) - { - if (sampleAccuracy) - testResult->addMessage (STR (" Not all points have been read via IParameterChanges")); - else - testResult->addMessage (STR (" No point at all has been read via IParameterChanges")); - - return true;// should not be a problem - } - } - return true; -} - -//------------------------------------------------------------------------ -int32 VstAutomationTest::getParameterCount () -{ - if (paramChanges) - return numParams; - return 0; -} - -//------------------------------------------------------------------------ -IParamValueQueue* VstAutomationTest::getParameterData (int32 index) -{ - if (paramChanges && (index >= 0) && (index < getParameterCount ())) - return ¶mChanges[index]; - return 0; -} - -//------------------------------------------------------------------------ -IParamValueQueue* VstAutomationTest::addParameterData (const ParamID& id, int32& index) -{ - return 0; -} - -//------------------------------------------------------------------------ -// VstFlushParamTest -//------------------------------------------------------------------------ -VstFlushParamTest::VstFlushParamTest (IPlugProvider* plugProvider, ProcessSampleSize sampl) -: VstAutomationTest (plugProvider, sampl, 100, 1, false) -{ -} - -//------------------------------------------------------------------------ -bool PLUGIN_API VstFlushParamTest::run (ITestResult* testResult) -{ - if (!vstPlug || !testResult || !audioEffect) - return false; - if (!canProcessSampleSize (testResult)) - return true; - - String text; - text.printf (STR ("===%s ===================================="), getName ()); - testResult->addMessage (text); - - unprepareProcessing (); - - processData.numSamples = 0; - processData.numInputs = 0; - processData.numOutputs = 0; - processData.inputs = 0; - processData.outputs = 0; - - audioEffect->setProcessing (true); - - preProcess (testResult); - - tresult result = audioEffect->process (processData); - if (result != kResultOk) - { - testResult->addErrorMessage (STR ("The component failed to process without audio buffers!")); - - audioEffect->setProcessing (false); - return false; - } - - postProcess (testResult); - - audioEffect->setProcessing (false); - return true; -} - - -//------------------------------------------------------------------------ -// VstSilenceFlagsTest -//------------------------------------------------------------------------ -VstSilenceFlagsTest::VstSilenceFlagsTest (IPlugProvider* plugProvider, ProcessSampleSize sampl) -: VstProcessTest (plugProvider, sampl) -{ -} - -//------------------------------------------------------------------------ -bool PLUGIN_API VstSilenceFlagsTest::run (ITestResult* testResult) -{ - if (!vstPlug || !testResult || !audioEffect) - return false; - if (!canProcessSampleSize (testResult)) - return true; - - String text; - text.printf (STR ("===%s ===================================="), getName ()); - testResult->addMessage (text); - - if (processData.inputs != 0) - { - audioEffect->setProcessing (true); - - for (int32 inputsIndex = 0; inputsIndex < processData.numInputs; inputsIndex++) - { - int32 numSilenceFlagsCombinations = (1 << processData.inputs[inputsIndex].numChannels) - 1; - for (int32 flagCombination = 0; flagCombination <= numSilenceFlagsCombinations; flagCombination++) - { - processData.inputs[inputsIndex].silenceFlags = flagCombination; - tresult result = audioEffect->process (processData); - if (result != kResultOk) - { - String text; - text.printf (STR ("The component failed to process bus %i with silence flag combination %x!"), inputsIndex, flagCombination); - testResult->addErrorMessage (text); - - audioEffect->setProcessing (false); - return false; - } - } - } - } - else if (processData.numInputs > 0) - { - testResult->addErrorMessage (STR ("ProcessData::inputs are 0 but ProcessData::numInputs are nonzero.")); - return false; - } - - audioEffect->setProcessing (false); - return true; -} - -//------------------------------------------------------------------------ -// VstSilenceProcessingTest -//------------------------------------------------------------------------ -VstSilenceProcessingTest::VstSilenceProcessingTest (IPlugProvider* plugProvider, ProcessSampleSize sampl) -: VstProcessTest (plugProvider, sampl) -{ -} - -//------------------------------------------------------------------------ -bool VstSilenceProcessingTest::isBufferSilent (void* buffer, int32 numSamples, ProcessSampleSize sampl) -{ - if (sampl == kSample32) - { - const float kSilenceThreshold = 0.000132184039f; - - float* floatBuffer = (float*)buffer; - while (numSamples--) - { - if (fabsf (*floatBuffer) > kSilenceThreshold) - return false; - floatBuffer++; - } - } - else if (sampl == kSample64) - { - const double kSilenceThreshold = 0.000132184039; - - double* floatBuffer = (double*)buffer; - while (numSamples--) - { - if (fabs (*floatBuffer) > kSilenceThreshold) - return false; - floatBuffer++; - } - } - return true; -} - -//------------------------------------------------------------------------ -bool PLUGIN_API VstSilenceProcessingTest::run (ITestResult* testResult) -{ - if (!vstPlug || !testResult || !audioEffect) - return false; - if (!canProcessSampleSize (testResult)) - return true; - - String text; - text.printf (STR ("===%s ===================================="), getName ()); - testResult->addMessage (text); - - if (processData.inputs != 0) - { - audioEffect->setProcessing (true); - - for (int32 busIndex = 0; busIndex < processData.numInputs; busIndex++) - { - processData.inputs[busIndex].silenceFlags = 0; - for (int32 channelIndex = 0; channelIndex < processData.inputs[busIndex].numChannels; channelIndex++) - { - processData.inputs[busIndex].silenceFlags |= (uint64)1 << (uint64)channelIndex; - if (processData.symbolicSampleSize == kSample32) - memset (processData.inputs[busIndex].channelBuffers32[channelIndex], 0, sizeof (float) * processData.numSamples); - else if (processData.symbolicSampleSize == kSample64) - memset (processData.inputs[busIndex].channelBuffers32[channelIndex], 0, sizeof (double) * processData.numSamples); - } - } - - for (int32 busIndex = 0; busIndex < processData.numOutputs; busIndex++) - { - if (processData.numInputs > busIndex) - processData.outputs[busIndex].silenceFlags = processData.inputs[busIndex].silenceFlags; - else - { - processData.outputs[busIndex].silenceFlags = 0; - for (int32 channelIndex = 0; channelIndex < processData.inputs[busIndex].numChannels; channelIndex++) - processData.outputs[busIndex].silenceFlags |= (uint64)1 << (uint64)channelIndex; - } - } - - tresult result = audioEffect->process (processData); - if (result != kResultOk) - { - String text; - text.printf (STR ("The component failed to process!")); - testResult->addErrorMessage (text); - - audioEffect->setProcessing (false); - return false; - } - - for (int32 busIndex = 0; busIndex < processData.numOutputs; busIndex++) - { - for (int32 channelIndex = 0; channelIndex < processData.outputs[busIndex].numChannels; channelIndex++) - { - bool channelShouldBeSilent = (processData.outputs[busIndex].silenceFlags & (uint64)1 << (uint64)channelIndex) != 0; - bool channelIsSilent = isBufferSilent (processData.outputs[busIndex].channelBuffers32[channelIndex], processData.numSamples, processData.symbolicSampleSize); - if (channelShouldBeSilent != channelIsSilent) - { - String text; - if (channelIsSilent) - text.printf (STR ("The component reported a wrong silent flag for its output buffer! : output is silent but silenceFlags not set !")); - else - text.printf (STR ("The component reported a wrong silent flag for its output buffer! : silenceFlags is set to silence but output is not silent")); - testResult->addMessage (text); - break; - } - } - } - - } - else if (processData.numInputs > 0) - { - testResult->addErrorMessage (STR ("ProcessData::inputs are 0 but ProcessData::numInputs are nonzero.")); - return false; - } - - audioEffect->setProcessing (false); - return true; -} - -//------------------------------------------------------------------------ -// VstVariableBlockSizeTest -//------------------------------------------------------------------------ -VstVariableBlockSizeTest::VstVariableBlockSizeTest (IPlugProvider* plugProvider, - ProcessSampleSize sampl) -: VstProcessTest (plugProvider, sampl) -{ -} - -//------------------------------------------------------------------------ -bool PLUGIN_API VstVariableBlockSizeTest::run (ITestResult* testResult) -{ - if (!vstPlug || !testResult || !audioEffect) - return false; - if (!canProcessSampleSize (testResult)) - return true; - - String text; - text.printf (STR ("===%s ===================================="), getName ()); - testResult->addMessage (text); - - audioEffect->setProcessing (true); - - for (int32 i = 0; i <= NUM_ITERATIONS; ++i) - { - int32 sampleFrames = rand () % processSetup.maxSamplesPerBlock; - processData.numSamples = sampleFrames; - if (i == 0) - processData.numSamples = 0; - #if TOUGHTESTS - else if (i == 1) - processData.numSamples = -50000; - else if (i == 2) - processData.numSamples = processSetup.maxSamplesPerBlock * 2; - #endif - tresult result = audioEffect->process (processData); - if ((result != kResultOk) - #if TOUGHTESTS - && (i > 1) - #else - && (i > 0) - #endif - ) - { - String text; - text.printf (STR ("The component failed to process an audioblock of size %i"), sampleFrames); - testResult->addErrorMessage (text); - - audioEffect->setProcessing (false); - return false; - } - } - - audioEffect->setProcessing (false); - return true; -} - - -//------------------------------------------------------------------------ -// VstProcessFormatTest -//------------------------------------------------------------------------ -VstProcessFormatTest::VstProcessFormatTest (IPlugProvider* plugProvider, ProcessSampleSize sampl) -: VstProcessTest (plugProvider, sampl) -{} - -//------------------------------------------------------------------------ -bool PLUGIN_API VstProcessFormatTest::run (ITestResult* testResult) -{ - if (!vstPlug || !testResult || !audioEffect) - return false; - if (!canProcessSampleSize (testResult)) - return true; - - String text; - text.printf (STR ("===%s ===================================="), getName ()); - testResult->addMessage (text); - - int32 numFails = 0; - const int32 numRates = 11; - SampleRate sampleRateFormats [numRates] = {22050., 32000., 44100., 48000., 88200., 96000., 192000., - 1234.5678, 12345.678, 123456.78, 1234567.8}; - - tresult result = vstPlug->setActive (false); - if (result != kResultOk) - { - testResult->addErrorMessage (STR ("IComponent::setActive (false) failed.")); - return false; - } - - testResult->addMessage (STR ("***Tested Sample Rates***")); - - for (int32 i = 0; i < numRates; ++i) - { - processSetup.sampleRate = sampleRateFormats [i]; - result = audioEffect->setupProcessing (processSetup); - if (result == kResultOk) - { - result = vstPlug->setActive (true); - if (result != kResultOk) - { - testResult->addErrorMessage (STR ("IComponent::setActive (true) failed.")); - return false; - } - - audioEffect->setProcessing (true); - result = audioEffect->process (processData); - audioEffect->setProcessing (false); - - if (result == kResultOk) - { - text.printf (STR (" %10.10G Hz - processed successfully!"), sampleRateFormats [i]); - testResult->addMessage (text); - } - else - { - text.printf (STR (" %10.10G Hz - failed to process!"), sampleRateFormats [i]); - numFails++; - testResult->addErrorMessage (text); - } - - result = vstPlug->setActive (false); - if (result != kResultOk) - { - testResult->addErrorMessage (STR ("IComponent::setActive (false) failed.")); - return false; - } - } - else if (sampleRateFormats[i] > 0.) - { - String text; - text.printf (STR ("IAudioProcessor::setupProcessing (..) failed for samplerate %.3f Hz! "), sampleRateFormats [i]); - - testResult->addErrorMessage (text); - //return false; - } - } - - result = vstPlug->setActive (true); - if (result != kResultOk) - return false; - - return true; -} - -//------------------------------------------------------------------------ -// VstBusActivationTest -//------------------------------------------------------------------------ -VstBusActivationTest::VstBusActivationTest (IPlugProvider* plugProvider) -: VstTestBase (plugProvider) -{} - -//------------------------------------------------------------------------ -bool PLUGIN_API VstBusActivationTest::run (ITestResult* testResult) -{ - if (!vstPlug || !testResult) - return false; - String text; - text.printf (STR ("===%s ===================================="), getName ()); - testResult->addMessage (text); - - int32 numTotalBusses = 0; - int32 numFailedActivations = 0; - - for (MediaType type = kAudio; type < kNumMediaTypes; type++) - { - int32 numInputs = vstPlug->getBusCount (type, kInput); - int32 numOutputs = vstPlug->getBusCount (type, kOutput); - - numTotalBusses += (numInputs + numOutputs); - - for (int32 i = 0; i < numInputs + numOutputs; ++i) - { - BusDirection busDirection = i < numInputs ? kInput : kOutput; - int32 busIndex = busDirection == kInput ? i : i - numInputs; - - BusInfo busInfo = {0}; - if (vstPlug->getBusInfo (type, busDirection, busIndex, busInfo) != kResultTrue) - { - testResult->addErrorMessage (STR ("IComponent::getBusInfo (..) failed.")); - return false; - } - - text.printf (STR (" Bus Activation: %s %s Bus (%d) (%s)"), - busDirection == kInput ? STR ("Input") : STR ("Output"), - type == kAudio ? STR ("Audio") : STR ("Event"), busIndex, - busInfo.busType == kMain ? STR ("kMain") : STR ("kAux")); - testResult->addMessage (text); - - if ((busInfo.flags & BusInfo::kDefaultActive) == false) - { - if (vstPlug->activateBus (type, busDirection, busIndex, true) != kResultOk) - numFailedActivations++; - if (vstPlug->activateBus (type, busDirection, busIndex, false) != kResultOk) - numFailedActivations++; - } - else if ((busInfo.flags & BusInfo::kDefaultActive) == true) - { - if (vstPlug->activateBus (type, busDirection, busIndex, false) != kResultOk) - numFailedActivations++; - if (vstPlug->activateBus (type, busDirection, busIndex, true) != kResultOk) - numFailedActivations++; - } - } - } - - if (numFailedActivations > 0) - testResult->addErrorMessage (STR ("Bus activation failed.")); - - return (numFailedActivations == 0); -} - - -//------------------------------------------------------------------------ -// VstCheckAudioBusArrangementTest -//------------------------------------------------------------------------ -VstCheckAudioBusArrangementTest::VstCheckAudioBusArrangementTest (IPlugProvider* plugProvider) -: VstTestBase (plugProvider) -{ -} - -//------------------------------------------------------------------------ -bool VstCheckAudioBusArrangementTest::run (ITestResult* testResult) -{ - if (!vstPlug || !testResult) - return false; - - String text; - text.printf (STR ("===%s ===================================="), getName ()); - testResult->addMessage (text); - - int32 numInputs = vstPlug->getBusCount (kAudio, kInput); - int32 numOutputs = vstPlug->getBusCount (kAudio, kOutput); - int32 arrangementMismatchs = 0; - - FUnknownPtr audioEffect (vstPlug); - if (audioEffect) - { - for (int32 i = 0; i < numInputs + numOutputs; ++i) - { - BusDirection dir = i < numInputs ? kInput : kOutput; - int32 busIndex = dir == kInput ? i : i - numInputs; - - text.printf (STR (" Check %s Audio Bus Arrangement (%d)"), dir == kInput ? STR("Input") : STR ("Output"), busIndex); - testResult->addMessage (text); - - BusInfo busInfo = {0}; - if (vstPlug->getBusInfo (kAudio, dir, busIndex, busInfo) == kResultTrue) - { - SpeakerArrangement arrangement; - if (audioEffect->getBusArrangement (dir, busIndex, arrangement) == kResultTrue) - { - if (busInfo.channelCount != SpeakerArr::getChannelCount (arrangement)) - { - arrangementMismatchs++; - testResult->addErrorMessage (STR ("channelCount is inconsistent!")); - } - } - else - { - testResult->addErrorMessage (STR ("IAudioProcessor::getBusArrangement (..) failed!")); - return false; - } - } - else - { - testResult->addErrorMessage (STR ("IComponent::getBusInfo (..) failed!")); - return false; - } - } - } - return (arrangementMismatchs == 0); -} - -//------------------------------------------------------------------------ -// VstProcessTailTest -//------------------------------------------------------------------------ -VstProcessTailTest::VstProcessTailTest (IPlugProvider* plugProvider, ProcessSampleSize sampl) -: VstProcessTest (plugProvider, sampl) -, mTailSamples (0) -, mInTail (0) -, mInSilenceInput (false) -, mDontTest (false) -, dataPtrFloat (0) -, dataPtrDouble (0) -{ - FUNKNOWN_CTOR -} - -//------------------------------------------------------------------------ -VstProcessTailTest::~VstProcessTailTest () -{ - if (dataPtrFloat) - { - delete []dataPtrFloat; - dataPtrFloat = 0; - } - if (dataPtrDouble) - { - delete []dataPtrDouble; - dataPtrDouble = 0; - } -} - -//------------------------------------------------------------------------ -bool PLUGIN_API VstProcessTailTest::setup () -{ - bool result = VstProcessTest::setup (); - if (result) - { - mTailSamples = audioEffect->getTailSamples (); - - String subCat (plugProvider->getSubCategories ()); - if (subCat.findFirst ("Generator") >= 0 || subCat.findFirst ("Instrument") >= 0) - { - mDontTest = true; - } - } - - return result; -} - -//------------------------------------------------------------------------ -bool VstProcessTailTest::preProcess (ITestResult* testResult) -{ - if (!mInSilenceInput) - { - if (processSetup.symbolicSampleSize == kSample32) - { - if (!dataPtrFloat) - dataPtrFloat = NEWVEC float[processData.numSamples]; - float* ptr = dataPtrFloat; - for (int32 i = 0; i < processData.numSamples ; ++i) - ptr[i] = (float)(2 * rand () / 32767.0 - 1); - } - else - { - if (!dataPtrDouble) - dataPtrDouble = NEWVEC double[processData.numSamples]; - double* ptr = (double*)dataPtrDouble; - for (int32 i = 0; i < processData.numSamples ; ++i) - ptr[i] = (double)(2 * rand () / 32767.0 - 1); - } - for (int32 i = 0; i < processData.numOutputs; ++i) - { - for (int32 c = 0; c < processData.outputs->numChannels; ++c) - { - if (processSetup.symbolicSampleSize == kSample32) - memset (processData.outputs->channelBuffers32[c], 0, processData.numSamples * sizeof (float)); - else - memset (processData.outputs->channelBuffers64[c], 0, processData.numSamples * sizeof (double)); - } - } - for (int32 i = 0; i < processData.numInputs ; ++i) - { - for (int32 c = 0; c < processData.inputs->numChannels; ++c) - { - if (processSetup.symbolicSampleSize == kSample32) - memcpy (processData.inputs->channelBuffers32[c], dataPtrFloat, processData.numSamples * sizeof (float)); - else - memcpy (processData.inputs->channelBuffers64[c], dataPtrDouble, processData.numSamples * sizeof (double)); - } - } - } - else - { - // process with silent buffers - for (int32 i = 0; i < processData.numOutputs; ++i) - { - for (int32 c = 0; c < processData.outputs->numChannels; ++c) - { - if (processSetup.symbolicSampleSize == kSample32) - memset (processData.outputs->channelBuffers32[c], 0, processData.numSamples * sizeof (float)); - else - memset (processData.outputs->channelBuffers64[c], 0, processData.numSamples * sizeof (double)); - } - } - for (int32 i = 0; i < processData.numInputs; ++i) - { - for (int32 c = 0; c < processData.inputs->numChannels; ++c) - { - if (processSetup.symbolicSampleSize == kSample32) - memset (processData.inputs->channelBuffers32[c], 0, processData.numSamples * sizeof (float)); - else - memset (processData.inputs->channelBuffers64[c], 0, processData.numSamples * sizeof (double)); - } - } - } - - return true; -} - -//------------------------------------------------------------------------ -bool VstProcessTailTest::postProcess (ITestResult* testResult) -{ - if (mInSilenceInput) - { - // should be silence - if (mTailSamples < mInTail + processData.numSamples) - { - int32 start = mTailSamples > mInTail ? mTailSamples - mInTail : 0; - int32 end = processData.numSamples; - - for (int32 i = 0; i < processData.numOutputs; ++i) - { - for (int32 c = 0; c < processData.outputs->numChannels; ++c) - { - if (processSetup.symbolicSampleSize == kSample32) - { - for (int32 s = start; s < end; ++s) - { - if (fabsf (processData.outputs->channelBuffers32[c][s]) >= 1e-7) - { - String text; - text.printf (STR ("IAudioProcessor::process (..) generates non silent output for silent input for tail above %d samples."), mTailSamples); - - testResult->addErrorMessage (text); - return false; - } - } - } - else - { - for (int32 s = start; s < end; ++s) - { - if (fabs (processData.outputs->channelBuffers64[c][s]) >= 1e-7) - { - String text; - text.printf (STR ("IAudioProcessor::process (..) generates non silent output for silent input for tail above %d samples."), mTailSamples); - - testResult->addErrorMessage (text); - return false; - } - } - } - - } - } - } - mInTail += processData.numSamples; - } - return true; -} - -//------------------------------------------------------------------------ -bool PLUGIN_API VstProcessTailTest::run (ITestResult* testResult) -{ - if (!testResult || !audioEffect) - return false; - if (processSetup.symbolicSampleSize != processData.symbolicSampleSize) - return false; - if (!canProcessSampleSize (testResult)) - return true; - - if (mDontTest) - return true; - - String text; - text.printf (STR ("===%s == Tail=%d ======================"), getName (), mTailSamples); - testResult->addMessage (text); - - audioEffect->setProcessing (true); - - // process with signal (noise) and silence - for (int32 i = 0; i < 20 * NUM_AUDIO_BLOCKS_TO_PROCESS; ++i) - { - mInSilenceInput = i > 10; - - if (!preProcess (testResult)) - return false; - tresult result = audioEffect->process (processData); - if (result != kResultOk) - { - testResult->addErrorMessage (STR ("IAudioProcessor::process (..) failed.")); - - audioEffect->setProcessing (false); - return false; - } - if (!postProcess (testResult)) - { - audioEffect->setProcessing (false); - return false; - } - } - - audioEffect->setProcessing (false); - return true; -} - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg diff --git a/vst/public.sdk/source/vst/testsuite/vsttestsuite.h b/vst/public.sdk/source/vst/testsuite/vsttestsuite.h deleted file mode 100644 index 0cddc443..00000000 --- a/vst/public.sdk/source/vst/testsuite/vsttestsuite.h +++ /dev/null @@ -1,718 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Validator -// Filename : public.sdk/source/vst/vsttestsuite.h -// Created by : Steinberg, 04/2005 -// Description : VST Test Suite -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#pragma once - -#include "pluginterfaces/test/itest.h" -#include "public.sdk/source/vst/hosting/processdata.h" - -// VST 3 interfaces -#include "pluginterfaces/base/ipluginbase.h" -#include "pluginterfaces/vst/ivstcomponent.h" -#include "pluginterfaces/vst/ivstaudioprocessor.h" -#include "pluginterfaces/vst/ivsteditcontroller.h" -#include "pluginterfaces/vst/ivstparameterchanges.h" - -namespace Steinberg { -namespace Vst { - -typedef int32 ProcessSampleSize; - -//------------------------------------------------------------------------ -#define DECLARE_VSTTEST(name) \ -virtual const tchar* getName () const { return name; } - -/** Set from outside the plug-in context (simulating a host context) */ -extern void setStandardPluginContext (FUnknown* context); - -//------------------------------------------------------------------------ -/** Test Helper. -\ingroup TestClass */ -//------------------------------------------------------------------------ -class IPlugProvider : public FUnknown -{ -public: -//------------------------------------------------------------------------ - virtual IComponent* getComponent () = 0; - virtual IEditController* getController () = 0; - virtual tresult releasePlugIn (IComponent* component, IEditController* controller) = 0; - virtual const char8* getSubCategories () const = 0; - virtual tresult getPluginUID (FUID& uid) const = 0; - -//------------------------------------------------------------------------ - static const FUID iid; -}; - -DECLARE_CLASS_IID (IPlugProvider, 0xDB014121, 0x09144BAA, 0x87627896, 0xBE41AF5D) - -//------------------------------------------------------------------------ -/** VstAutomationTest helper classes. -\ingroup TestClass */ -class ParamPoint -{ -public: - ParamPoint () : offsetSamples (-1), value (0.), read (false) {} - void set (int32 offsetSamples, double value) - { - this->offsetSamples = offsetSamples; - this->value = value; - } - void get (int32& offsetSamples, double& value) - { - offsetSamples = this->offsetSamples; - value = this->value; - read = true; - } - bool wasRead () const { return read; } - -private: - int32 offsetSamples; - double value; - bool read; -}; - -//------------------------------------------------------------------------ -/** VstAutomationTest helper classes: implementation of IParamValueQueue. -\ingroup TestClass */ -class ParamChanges : public IParamValueQueue -{ -public: - ParamChanges () : id (-1), numPoints (0), points (0), numUsedPoints (0), processedFrames (0) - { - FUNKNOWN_CTOR - } - ~ParamChanges () - { - if (points) - delete[] points; - FUNKNOWN_DTOR - } - - DECLARE_FUNKNOWN_METHODS - - void init (ParamID id, int32 numPoints) - { - this->id = id; - this->numPoints = numPoints; - numUsedPoints = 0; - if (points) - delete[] points; - points = new ParamPoint[numPoints]; - processedFrames = 0; - } - bool setPoint (int32 index, int32 offsetSamples, double value) - { - if (points && (index >= 0) && (index == numUsedPoints) && (index < numPoints)) - { - points[index].set (offsetSamples, value); - numUsedPoints++; - return true; - } - if (!points) - return true; - return false; - } - void resetPoints () - { - numUsedPoints = 0; - processedFrames = 0; - } - int32 getProcessedFrames () const { return processedFrames; } - void setProcessedFrames (int32 amount) { processedFrames = amount; } - bool havePointsBeenRead (bool atAll) - { - for (int32 i = 0; i < getPointCount (); ++i) - { - if (points[i].wasRead ()) - { - if (atAll) - return true; - } - else if (!atAll) - return false; - } - return !atAll; - } - - //---for IParamValueQueue------------------------- - ParamID PLUGIN_API getParameterId () { return id; } - int32 PLUGIN_API getPointCount () { return numUsedPoints; } - tresult PLUGIN_API getPoint (int32 index, int32& offsetSamples, double& value) - { - if (points && (index < numUsedPoints) && (index >= 0)) - { - points[index].get (offsetSamples, value); - return kResultTrue; - } - return kResultFalse; - } - tresult PLUGIN_API addPoint (int32 offsetSamples, double value, int32& index) - { - return kResultFalse; - } -//--------------------------------------------------------- - -private: - ParamID id; - int32 numPoints; - int32 numUsedPoints; - ParamPoint* points; - int32 processedFrames; -}; - -//------------------------------------------------------------------------ -/** Test Helper. -\ingroup TestClass */ -//------------------------------------------------------------------------ -class VstTestBase: public ITest -{ -public: -//------------------------------------------------------------------------ - VstTestBase (IPlugProvider* plugProvider); - virtual ~VstTestBase (); - - DECLARE_VSTTEST (STR ("VST Test Base")) - DECLARE_FUNKNOWN_METHODS - - bool PLUGIN_API setup (); - bool PLUGIN_API run (ITestResult* testResult) {return false;} // implement me - bool PLUGIN_API teardown (); -//------------------------------------------------------------------------ -protected: - IPlugProvider* plugProvider; - IComponent* vstPlug; - IEditController* controller; - -private: - VstTestBase (); -}; - -//------------------------------------------------------------------------ -/** Test Helper. -\ingroup TestClass */ -//------------------------------------------------------------------------ -class VstTestEnh : public VstTestBase -{ -public: -//------------------------------------------------------------------------ - VstTestEnh (IPlugProvider* plugProvider, ProcessSampleSize sampl); - virtual ~VstTestEnh (); - - enum AudioDefaults - { - kBlockSize = 64, - kMaxSamplesPerBlock = 8192, - kSampleRate = 44100, - }; - - bool PLUGIN_API setup (); - bool PLUGIN_API teardown (); -//------------------------------------------------------------------------ -protected: - // interfaces - IAudioProcessor* audioEffect; - - ProcessSetup processSetup; -}; - -//------------------------------------------------------------------------ -/** Test Suspend/Resume. -\ingroup TestClass */ -//------------------------------------------------------------------------ -class VstSuspendResumeTest: public VstTestEnh -{ -public: -//------------------------------------------------------------------------ - VstSuspendResumeTest (IPlugProvider* plugProvider, ProcessSampleSize sampl); - - DECLARE_VSTTEST (STR ("Suspend/Resume")) - - bool PLUGIN_API run (ITestResult* testResult); -//------------------------------------------------------------------------ -}; - - -//------------------------------------------------------------------------ -/** Test Terminate/Initialize. -\ingroup TestClass */ -//------------------------------------------------------------------------ -class VstTerminateInitializeTest: public VstTestBase -{ -public: -//------------------------------------------------------------------------ - VstTerminateInitializeTest (IPlugProvider* plugProvider); - - DECLARE_VSTTEST (STR ("Terminate/Initialize")) - - bool PLUGIN_API run (ITestResult* testResult); -//------------------------------------------------------------------------ -}; - -//------------------------------------------------------------------------ -/** Test Scan Buses. -\ingroup TestClass */ -//------------------------------------------------------------------------ -class VstScanBussesTest: public VstTestBase -{ -public: -//------------------------------------------------------------------------ - VstScanBussesTest (IPlugProvider* plugProvider); - - DECLARE_VSTTEST (STR ("Scan Buses")) - - bool PLUGIN_API run (ITestResult* testResult); -//------------------------------------------------------------------------ -}; - -//------------------------------------------------------------------------ -/** Test Scan Parameters. -\ingroup TestClass */ -//------------------------------------------------------------------------ -class VstScanParametersTest: public VstTestBase -{ -public: -//------------------------------------------------------------------------ - VstScanParametersTest (IPlugProvider* plugProvider); - - DECLARE_VSTTEST (STR ("Scan Parameters")) - - bool PLUGIN_API run (ITestResult* testResult); -//------------------------------------------------------------------------ -}; - -//------------------------------------------------------------------------ -/** Test MIDI Mapping. -\ingroup TestClass */ -//------------------------------------------------------------------------ -class VstMidiMappingTest: public VstTestBase -{ -public: -//------------------------------------------------------------------------ - VstMidiMappingTest (IPlugProvider* plugProvider); - - DECLARE_VSTTEST (STR ("MIDI Mapping")) - - bool PLUGIN_API run (ITestResult* testResult); -//------------------------------------------------------------------------ -}; - - - -//------------------------------------------------------------------------ -/** Test Note Expression. -\ingroup TestClass */ -//------------------------------------------------------------------------ -class VstNoteExpressionTest: public VstTestBase -{ -public: - //------------------------------------------------------------------------ - VstNoteExpressionTest (IPlugProvider* plugProvider); - - DECLARE_VSTTEST (STR ("Note Expression")) - - bool PLUGIN_API run (ITestResult* testResult); - //------------------------------------------------------------------------ -}; - -//------------------------------------------------------------------------ -/** Test Keyswitch. -\ingroup TestClass */ -//------------------------------------------------------------------------ -class VstKeyswitchTest: public VstTestBase -{ -public: - //------------------------------------------------------------------------ - VstKeyswitchTest (IPlugProvider* plugProvider); - - DECLARE_VSTTEST (STR ("Keyswitch")) - - bool PLUGIN_API run (ITestResult* testResult); - //------------------------------------------------------------------------ -}; - -//------------------------------------------------------------------------ -/** Test Scan Editor Classes. -\ingroup TestClass */ -//------------------------------------------------------------------------ -class VstEditorClassesTest: public VstTestBase -{ -public: -//------------------------------------------------------------------------ - VstEditorClassesTest (IPlugProvider* plugProvider); - - DECLARE_VSTTEST (STR ("Scan Editor Classes")) - - bool PLUGIN_API run (ITestResult* testResult); -//------------------------------------------------------------------------ -}; - -//------------------------------------------------------------------------ -/** Test Scan Units. -\ingroup TestClass */ -//------------------------------------------------------------------------ -class VstUnitInfoTest: public VstTestBase -{ -public: -//------------------------------------------------------------------------ - VstUnitInfoTest (IPlugProvider* plugProvider); - - DECLARE_VSTTEST (STR ("Scan Units")) - - bool PLUGIN_API run (ITestResult* testResult); -//------------------------------------------------------------------------ -}; - -//------------------------------------------------------------------------ -/** Test Scan Programs. -\ingroup TestClass */ -//------------------------------------------------------------------------ -class VstProgramInfoTest: public VstTestBase -{ -public: -//------------------------------------------------------------------------ - VstProgramInfoTest (IPlugProvider* plugProvider); - - DECLARE_VSTTEST (STR ("Scan Programs")) - - bool PLUGIN_API run (ITestResult* testResult); -//------------------------------------------------------------------------ -}; - -//------------------------------------------------------------------------ -/** Test Check Unit Structure. -\ingroup TestClass */ -//------------------------------------------------------------------------ -class VstUnitStructureTest: public VstTestBase -{ -public: -//------------------------------------------------------------------------ - VstUnitStructureTest (IPlugProvider* plugProvider); - - DECLARE_VSTTEST (STR ("Check Unit Structure")) - - bool PLUGIN_API run (ITestResult* testResult); -//------------------------------------------------------------------------ -}; - -//------------------------------------------------------------------------ -/** Test Process Test. -\ingroup TestClass */ -//------------------------------------------------------------------------ -class VstProcessTest : public VstTestEnh -{ -public: -//------------------------------------------------------------------------ - VstProcessTest (IPlugProvider* plugProvider, ProcessSampleSize sampl); - - DECLARE_VSTTEST (STR ("Process Test")) - - // ITest - bool PLUGIN_API setup (); - bool PLUGIN_API run (ITestResult* testResult); - bool PLUGIN_API teardown (); - -//------------------------------------------------------------------------ -protected: - virtual bool prepareProcessing (); ///< setup ProcessData and allocate buffers - virtual bool unprepareProcessing (); ///< free dynamic memory of ProcessData - virtual bool preProcess (ITestResult* testResult); ///< is called just before the process call - virtual bool postProcess (ITestResult* testResult); ///< is called right after the process call - - bool setupBuffers (int32 numBusses, AudioBusBuffers* audioBuffers, BusDirection dir); - bool setupBuffers (AudioBusBuffers& audioBuffers); - bool freeBuffers (int32 numBuses, AudioBusBuffers* buses); - bool canProcessSampleSize (ITestResult* testResult); ///< audioEffect has to be available - - HostProcessData processData; -}; - -//------------------------------------------------------------------------ -/** Test Speaker Arrangement. -\ingroup TestClass */ -//------------------------------------------------------------------------ -class VstSpeakerArrangementTest : public VstProcessTest -{ -public: -//------------------------------------------------------------------------ - VstSpeakerArrangementTest (IPlugProvider* plugProvider, ProcessSampleSize sampl, SpeakerArrangement inSpArr, SpeakerArrangement outSpArr); - - const tchar* getName () const; - static const tchar* getSpeakerArrangementName (SpeakerArrangement spArr); - - // ITest - bool PLUGIN_API run (ITestResult* testResult); - -//------------------------------------------------------------------------ -protected: - bool prepareProcessing (); - bool verifySA (int32 numBusses, AudioBusBuffers* buses, SpeakerArrangement spArr, ITestResult* testResult); -private: - SpeakerArrangement inSpArr; - SpeakerArrangement outSpArr; -}; - - -class ParamChanges; -//------------------------------------------------------------------------ -/** Test Automation. -\ingroup TestClass */ -//------------------------------------------------------------------------ -class VstAutomationTest : public VstProcessTest, public IParameterChanges -{ -public: -//------------------------------------------------------------------------ - VstAutomationTest (IPlugProvider* plugProvider, ProcessSampleSize sampl, int32 everyNSamples, int32 numParams, bool sampleAccuracy); - virtual ~VstAutomationTest (); - - DECLARE_FUNKNOWN_METHODS - const tchar* getName () const; - // ITest - bool PLUGIN_API setup (); - bool PLUGIN_API run (ITestResult* testResult); - bool PLUGIN_API teardown (); - - // IParameterChanges - int32 PLUGIN_API getParameterCount (); - IParamValueQueue* PLUGIN_API getParameterData (int32 index); - IParamValueQueue* PLUGIN_API addParameterData (const ParamID& id, int32& index); - -//------------------------------------------------------------------------ -protected: - bool preProcess (ITestResult* testResult); - bool postProcess (ITestResult* testResult); - ParamID bypassId; - - ParamChanges* paramChanges; - int32 countParamChanges; - int32 everyNSamples; - int32 numParams; - bool sampleAccuracy; - bool onceExecuted; -}; - -//------------------------------------------------------------------------ -/** Test Valid State Transition. -\ingroup TestClass */ -//------------------------------------------------------------------------ -class VstValidStateTransitionTest : public VstTestBase -{ -public: - VstValidStateTransitionTest (IPlugProvider* plugProvider); - bool PLUGIN_API run (ITestResult* testResult); - - DECLARE_VSTTEST (STR ("Valid State Transition")) -}; - -//------------------------------------------------------------------------ -/** Test Invalid State Transition. -\ingroup TestClass */ -//------------------------------------------------------------------------ -class VstInvalidStateTransitionTest : public VstTestBase -{ -public: - VstInvalidStateTransitionTest (IPlugProvider* plugProvider); - bool PLUGIN_API run (ITestResult* testResult); - - DECLARE_VSTTEST (STR ("Invalid State Transition")) -}; - -//------------------------------------------------------------------------ -/** Test Repeat Identical State Transition. -\ingroup TestClass */ -//------------------------------------------------------------------------ -class VstRepeatIdenticalStateTransitionTest : public VstTestBase -{ -public: - VstRepeatIdenticalStateTransitionTest (IPlugProvider* plugProvider); - bool PLUGIN_API run (ITestResult* testResult); - - DECLARE_VSTTEST (STR ("Repeat Identical State Transition")) -}; - -//------------------------------------------------------------------------ -/** Test Bus Consistency. -\ingroup TestClass */ -//------------------------------------------------------------------------ -class VstBusConsistencyTest : public VstTestBase -{ -public: - VstBusConsistencyTest (IPlugProvider* plugProvider); - bool PLUGIN_API run (ITestResult* testResult); - - DECLARE_VSTTEST (STR ("Bus Consistency")) -}; - -//------------------------------------------------------------------------ -/** Test Bus Invalid Index. -\ingroup TestClass */ -//------------------------------------------------------------------------ -class VstBusInvalidIndexTest : public VstTestBase -{ -public: - VstBusInvalidIndexTest (IPlugProvider* plugProvider); - bool PLUGIN_API run (ITestResult* testResult); - - DECLARE_VSTTEST (STR ("Bus Invalid Index")) -}; - -//------------------------------------------------------------------------ -/** Test Silence Flags. -\ingroup TestClass */ -//------------------------------------------------------------------------ -class VstSilenceFlagsTest : public VstProcessTest -{ -public: - VstSilenceFlagsTest (IPlugProvider* plugProvider, ProcessSampleSize sampl); - bool PLUGIN_API run (ITestResult* testResult); - - DECLARE_VSTTEST (STR ("Silence Flags")) -}; - -//------------------------------------------------------------------------ -/** Test Silence Processing. -\ingroup TestClass */ -//------------------------------------------------------------------------ -class VstSilenceProcessingTest : public VstProcessTest -{ -public: - VstSilenceProcessingTest (IPlugProvider* plugProvider, ProcessSampleSize sampl); - bool PLUGIN_API run (ITestResult* testResult); - - DECLARE_VSTTEST (STR ("Silence Processing")) -protected: - bool isBufferSilent (void* buffer, int32 numSamples, ProcessSampleSize sampl); -}; - -//------------------------------------------------------------------------ -/** Test Parameters Flush (no Buffer). -\ingroup TestClass */ -//------------------------------------------------------------------------ -class VstFlushParamTest : public VstAutomationTest -{ -public: - VstFlushParamTest (IPlugProvider* plugProvider, ProcessSampleSize sampl); - bool PLUGIN_API run (ITestResult* testResult); - - DECLARE_VSTTEST (STR ("Parameters Flush (no Buffer)")) -}; - -//------------------------------------------------------------------------ -/** Test Bus Activation. -\ingroup TestClass */ -//------------------------------------------------------------------------ -class VstBusActivationTest : public VstTestBase -{ -public: - VstBusActivationTest (IPlugProvider* plugProvider); - bool PLUGIN_API run (ITestResult* testResult); - - DECLARE_VSTTEST (STR ("Bus Activation")) -}; - -//------------------------------------------------------------------------ -/** Test Variable Block Size. -\ingroup TestClass */ -//------------------------------------------------------------------------ -class VstVariableBlockSizeTest : public VstProcessTest -{ -public: - VstVariableBlockSizeTest (IPlugProvider* plugProvider, ProcessSampleSize sampl); - bool PLUGIN_API run (ITestResult* testResult); - - DECLARE_VSTTEST (STR ("Variable Block Size")) -}; - -//------------------------------------------------------------------------ -/** Test Process Format. -\ingroup TestClass */ -//------------------------------------------------------------------------ -class VstProcessFormatTest : public VstProcessTest -{ -public: - VstProcessFormatTest (IPlugProvider* plugProvider, ProcessSampleSize sampl); - bool PLUGIN_API run (ITestResult* testResult); - - DECLARE_VSTTEST (STR ("Process Format")) -}; - -//------------------------------------------------------------------------ -/** Test Check Audio Bus Arrangement. -\ingroup TestClass */ -//------------------------------------------------------------------------ -class VstCheckAudioBusArrangementTest : public VstTestBase -{ -public: - VstCheckAudioBusArrangementTest (IPlugProvider* plugProvider); - bool PLUGIN_API run (ITestResult* testResult); - - DECLARE_VSTTEST (STR ("Check Audio Bus Arrangement")) -}; - - -//------------------------------------------------------------------------ -/** Test ProcesTail. -\ingroup TestClass */ -//------------------------------------------------------------------------ -class VstProcessTailTest : public VstProcessTest -{ -public: - //------------------------------------------------------------------------ - VstProcessTailTest (IPlugProvider* plugProvider, ProcessSampleSize sampl); - virtual ~VstProcessTailTest (); - - DECLARE_VSTTEST (STR ("Check Tail processing")) - - // ITest - bool PLUGIN_API setup (); - bool PLUGIN_API run (ITestResult* testResult); - bool preProcess (ITestResult* testResult); - bool postProcess (ITestResult* testResult); - - //------------------------------------------------------------------------ -protected: - -private: - uint32 mTailSamples; - uint32 mInTail; - - float* dataPtrFloat; - double* dataPtrDouble; - bool mInSilenceInput; - bool mDontTest; -}; - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg - diff --git a/vst/public.sdk/source/vst/vst2wrapper/vst2wrapper.cpp b/vst/public.sdk/source/vst/vst2wrapper/vst2wrapper.cpp deleted file mode 100644 index 5890f310..00000000 --- a/vst/public.sdk/source/vst/vst2wrapper/vst2wrapper.cpp +++ /dev/null @@ -1,3084 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/vst2wrapper/vst2wrapper.cpp -// Created by : Steinberg, 01/2009 -// Description : VST 3 -> VST 2 Wrapper -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -/// \cond ignore - -#include "public.sdk/source/vst/vst2wrapper/vst2wrapper.h" - -#include "public.sdk/source/vst/hosting/hostclasses.h" -#include "public.sdk/source/vst2.x/aeffeditor.h" - -#include "pluginterfaces/gui/iplugview.h" -#include "pluginterfaces/vst/ivstmidicontrollers.h" -#include "pluginterfaces/vst/ivstmessage.h" -#include "pluginterfaces/vst/vstpresetkeys.h" -#include "pluginterfaces/base/futils.h" -#include "pluginterfaces/base/keycodes.h" - -#include "base/source/fstreamer.h" - -#include -#include -#include - -extern bool DeinitModule (); //! Called in Vst2Wrapper destructor - -//------------------------------------------------------------------------------------------------------- -// some Defines -//------------------------------------------------------------------------------------------------------- -// should be kVstMaxParamStrLen if we want to respect the VST 2 specification!!! -#define kVstExtMaxParamStrLen 32 - -//------------------------------------------------------------------------------------------------------- -namespace Steinberg { -namespace Vst { - -//! The parameter's name contains the unit path (e.g. "Modulators.LFO 1.frequency") -bool vst2WrapperFullParameterPath = true; - -//------------------------------------------------------------------------------------------------------- -// some Globals -//------------------------------------------------------------------------------------------------------- -// In order to speed up hasEditor function gPluginHasEditor can be set in EditController::initialize -enum -{ - kDontKnow = -1, - kNoEditor = 0, - kEditor, -}; -typedef int32 EditorAvailability; -EditorAvailability gPluginHasEditor = kDontKnow; // default: kDontKnow which uses createView to find out - -// Set to 'true' in EditController::initialize -bool gExportProgramChangeParameters = false; // default: VST 3 kIsProgramChange parameter will not be - // exported in VST 2 - -//------------------------------------------------------------------------------------------------------- -// Vst2EditorWrapper Declaration -//------------------------------------------------------------------------------------------------------- -class Vst2EditorWrapper : public AEffEditor, public IPlugFrame -{ -public: -//------------------------------------------------------------------------------------------------------- - Vst2EditorWrapper (AudioEffect* effect, IEditController* controller); - ~Vst2EditorWrapper (); - - static bool hasEditor (IEditController* controller); - - virtual bool getRect (ERect** rect); - virtual bool open (void* ptr); - virtual void close (); - virtual bool setKnobMode (VstInt32 val); - - ///< Receives key down event. Return true only if key was really used! - virtual bool onKeyDown (VstKeyCode& keyCode); - ///< Receives key up event. Return true only if key was really used! - virtual bool onKeyUp (VstKeyCode& keyCode); - ///< Handles mouse wheel event, distance is positive or negative to indicate wheel direction. - virtual bool onWheel (float distance); - - // IPlugFrame - virtual tresult PLUGIN_API resizeView (IPlugView* view, ViewRect* newSize); - virtual tresult PLUGIN_API queryInterface (const char* _iid, void** obj); - virtual uint32 PLUGIN_API addRef () { return 1; } - virtual uint32 PLUGIN_API release () { return 1; } -//------------------------------------------------------------------------------------------------------- -protected: - void createView (); - - IEditController* mController; - IPlugView* mView; - - ERect mERect; -}; - -//------------------------------------------------------------------------------------------------------- -// Vst2EditorWrapper Implementation -//------------------------------------------------------------------------------------------------------- -Vst2EditorWrapper::Vst2EditorWrapper (AudioEffect* effect, IEditController* controller) -: AEffEditor (effect), mController (controller), mView (0) -{ - if (mController) - mController->addRef (); -} - -//------------------------------------------------------------------------------------------------------- -Vst2EditorWrapper::~Vst2EditorWrapper () -{ - if (mView) - close (); - - if (mController) - mController->release (); -} - -//------------------------------------------------------------------------------------------------------- -tresult PLUGIN_API Vst2EditorWrapper::queryInterface (const char* _iid, void** obj) -{ - QUERY_INTERFACE (_iid, obj, FUnknown::iid, FUnknown) - QUERY_INTERFACE (_iid, obj, IPlugFrame::iid, IPlugFrame) - - *obj = 0; - return kNoInterface; -} - -//------------------------------------------------------------------------------------------------------- -tresult PLUGIN_API Vst2EditorWrapper::resizeView (IPlugView* view, ViewRect* newSize) -{ - tresult result = kResultFalse; - if (view && newSize) - { - if (effect) - { - AudioEffectX* effectx = dynamic_cast (effect); - if (effectx && effectx->sizeWindow (newSize->getWidth (), newSize->getHeight ())) - { - result = view->onSize (newSize); - } - } - } - - return result; -} - -//------------------------------------------------------------------------------------------------------- -bool Vst2EditorWrapper::hasEditor (IEditController* controller) -{ - /* Some Plug-ins might have large GUIs. In order to speed up hasEditor function while - * initializing the Plug-in gPluginHasEditor can be set in EditController::initialize - * beforehand. */ - bool result = false; - if (gPluginHasEditor == kEditor) - { - result = true; - } - else if (gPluginHasEditor == kNoEditor) - { - result = false; - } - else - { - IPlugView* view = controller ? controller->createView (ViewType::kEditor) : 0; - FReleaser viewRel (view); - result = (view != 0); - } - - return result; -} - -//------------------------------------------------------------------------------------------------------- -void Vst2EditorWrapper::createView () -{ - if (mView == 0 && mController != 0) - { - mView = mController->createView (ViewType::kEditor); - mView->setFrame (this); - -#if MAC -#if PLATFORM_64 - if (mView && mView->isPlatformTypeSupported (kPlatformTypeNSView) != kResultTrue) -#else - if (mView && mView->isPlatformTypeSupported (kPlatformTypeHIView) != kResultTrue) -#endif - { - mView->release (); - mView = 0; - mController->release (); // do not try again - mController = 0; - } -#endif - } -} - -//------------------------------------------------------------------------------------------------------- -bool Vst2EditorWrapper::getRect (ERect** rect) -{ - createView (); - if (mView) - { - ViewRect size; - if (mView->getSize (&size) == kResultTrue) - { - mERect.left = (VstInt16)size.left; - mERect.top = (VstInt16)size.top; - mERect.right = (VstInt16)size.right; - mERect.bottom = (VstInt16)size.bottom; - - if ((mERect.bottom - mERect.top) > 0 && (mERect.right - mERect.left) > 0) - { - *rect = &mERect; - return true; - } - } - } - - *rect = 0; - return false; -} - -//------------------------------------------------------------------------------------------------------- -bool Vst2EditorWrapper::open (void* ptr) -{ - AEffEditor::open (ptr); - createView (); - - if (mView) - { -#if WINDOWS - FIDString type = kPlatformTypeHWND; -#elif MAC && PLATFORM_64 - FIDString type = kPlatformTypeNSView; -#elif MAC - FIDString type = kPlatformTypeHIView; -#endif - return mView->attached (ptr, type) == kResultTrue; - } - return false; -} - -//------------------------------------------------------------------------------------------------------- -void Vst2EditorWrapper::close () -{ - if (mView) - { - mView->setFrame (0); - mView->removed (); - mView->release (); - mView = 0; - } - - AEffEditor::close (); -} - -//------------------------------------------------------------------------------------------------------- -bool Vst2EditorWrapper::setKnobMode (VstInt32 val) -{ - bool result = false; - IEditController2* editController2; - if (mController && - mController->queryInterface (IEditController2::iid, (void**)&editController2) == - kResultTrue) - { - switch (val) - { - // Circular - case 0: - result = editController2->setKnobMode (Vst::kCircularMode) == kResultTrue; - break; - - // Relative Circular - case 1: - result = editController2->setKnobMode (kRelativCircularMode) == kResultTrue; - break; - - // Linear - case 2: - result = editController2->setKnobMode (kLinearMode) == kResultTrue; - break; - } - editController2->release (); - } - return result; -} - -//------------------------------------------------------------------------------------------------------- -bool Vst2EditorWrapper::onKeyDown (VstKeyCode& keyCode) -{ - if (mView) - return mView->onKeyDown (VirtualKeyCodeToChar (keyCode.virt), keyCode.virt, - keyCode.modifier) == kResultTrue; - return false; -} - -//------------------------------------------------------------------------------------------------------- -bool Vst2EditorWrapper::onKeyUp (VstKeyCode& keyCode) -{ - if (mView) - return mView->onKeyUp (VirtualKeyCodeToChar (keyCode.virt), keyCode.virt, - keyCode.modifier) == kResultTrue; - return false; -} - -//------------------------------------------------------------------------------------------------------- -bool Vst2EditorWrapper::onWheel (float distance) -{ - if (mView) - return mView->onWheel (distance) == kResultTrue; - return false; -} - -//------------------------------------------------------------------------------------------------------- -// Vst2MidiEventQueue Declaration -//------------------------------------------------------------------------------------------------------- -class Vst2MidiEventQueue -{ -public: -//------------------------------------------------------------------------ - Vst2MidiEventQueue (int32 maxEventCount); - ~Vst2MidiEventQueue (); - - bool isEmpty () const { return eventList->numEvents == 0; } - bool add (const VstMidiEvent& e); - bool add (const VstMidiSysexEvent& e); - void flush (); - - operator VstEvents* () { return eventList; } -//------------------------------------------------------------------------ -protected: - VstEvents* eventList; - int32 maxEventCount; -}; - -//------------------------------------------------------------------------ -// Vst2MidiEventQueue Implementation -//------------------------------------------------------------------------ -Vst2MidiEventQueue::Vst2MidiEventQueue (int32 maxEventCount) -: maxEventCount (maxEventCount) -{ - eventList = (VstEvents*)new char[sizeof (VstEvents) + (maxEventCount - 2) * sizeof (VstEvent*)]; - eventList->numEvents = 0; - eventList->reserved = 0; - - int32 eventSize = sizeof (VstMidiSysexEvent) > sizeof (VstMidiEvent) ? - sizeof (VstMidiSysexEvent) : - sizeof (VstMidiEvent); - - for (int32 i = 0; i < maxEventCount; i++) - { - char* eventBuffer = new char[eventSize]; - memset (eventBuffer, 0, eventSize); - eventList->events[i] = (VstEvent*)eventBuffer; - } -} - -//------------------------------------------------------------------------ -Vst2MidiEventQueue::~Vst2MidiEventQueue () -{ - for (int32 i = 0; i < maxEventCount; i++) - delete[] (char*)eventList -> events[i]; - - delete[] (char*)eventList; -} - -//------------------------------------------------------------------------ -bool Vst2MidiEventQueue::add (const VstMidiEvent& e) -{ - if (eventList->numEvents >= maxEventCount) - return false; - - VstMidiEvent* dst = (VstMidiEvent*)eventList->events[eventList->numEvents++]; - memcpy (dst, &e, sizeof (VstMidiEvent)); - dst->type = kVstMidiType; - dst->byteSize = sizeof (VstMidiEvent); - return true; -} - -//------------------------------------------------------------------------ -bool Vst2MidiEventQueue::add (const VstMidiSysexEvent& e) -{ - if (eventList->numEvents >= maxEventCount) - return false; - - VstMidiSysexEvent* dst = (VstMidiSysexEvent*)eventList->events[eventList->numEvents++]; - memcpy (dst, &e, sizeof (VstMidiSysexEvent)); - dst->type = kVstSysExType; - dst->byteSize = sizeof (VstMidiSysexEvent); - return true; -} - -//------------------------------------------------------------------------ -void Vst2MidiEventQueue::flush () -{ - eventList->numEvents = 0; -} - -// Define the numeric max as "No ParamID" -const ParamID kNoParamId = std::numeric_limits::max (); -const int32 kMaxEvents = 2048; - -//------------------------------------------------------------------------------------------------------- -// Vst2Wrapper -//------------------------------------------------------------------------------------------------------- -Vst2Wrapper::Vst2Wrapper (IAudioProcessor* processor, IEditController* controller, - audioMasterCallback audioMaster, const TUID vst3ComponentID, - VstInt32 vst2ID, IPluginFactory* factory) -: AudioEffectX (audioMaster, 0, 0) -, mProcessor (processor) -, mController (controller) -, mComponent (0) -, mUnitInfo (0) -, mMidiMapping (0) -, componentInitialized (false) -, controllerInitialized (false) -, componentsConnected (false) -, processing (false) -, hasEventInputBuses (false) -, hasEventOutputBuses (false) -, mBypassParameterID (kNoParamId) -, mProgramParameterID (kNoParamId) -, mProgramParameterIdx (-1) -, mVst3SampleSize (kSample32) -, mVst3processMode (kRealtime) -, mInputEvents (0) -, mOutputEvents (0) -, mVst2OutputEvents (0) -, mVst2InputArrangement (0) -, mVst2OutputArrangement (0) -, mMainAudioInputBuses (0) -, mMainAudioOutputBuses (0) -, mTimer (0) -, mFactory (factory) -{ - memset (mName, 0, sizeof (mName)); - memset (mVendor, 0, sizeof (mVendor)); - memset (mSubCategories, 0, sizeof (mSubCategories)); - memset (&mProcessContext, 0, sizeof (ProcessContext)); - - for (int32 i = 0; i < 16; i++) - mMidiCCMapping[i] = 0; - - // VST 2 stuff ----------------------------------------------- - setUniqueID (vst2ID); // identify - mVst3EffectClassID = vst3ComponentID; - canProcessReplacing (true); // supports replacing output - programsAreChunks (true); - - for (int32 i = 0; i < kMaxProgramChangeParameters; i++) - { - mProgramChangeParameterIDs[i] = kNoParamId; - mProgramChangeParameterIdxs[i] = -1; - } - if (factory) - factory->addRef (); -} - -//------------------------------------------------------------------------------------------------------- -bool Vst2Wrapper::init () -{ - // VST 3 stuff ----------------------------------------------- - if (mProcessor) - mProcessor->queryInterface (IComponent::iid, (void**)&mComponent); - if (mController) - { - mController->queryInterface (IUnitInfo::iid, (void**)&mUnitInfo); - mController->queryInterface (IMidiMapping::iid, (void**)&mMidiMapping); - } - - //---init the processor component - componentInitialized = true; - if (mComponent->initialize ((IHostApplication*)this) != kResultTrue) - return false; - - //---init the controller component - if (mController) - { - // do not initialize 2 times the component if it is singleComponent - if (FUnknownPtr (mComponent).getInterface () != mController) - { - controllerInitialized = true; - if (mController->initialize ((IHostApplication*)this) != kResultTrue) - return false; - } - - //---set this class as Component Handler - mController->setComponentHandler (this); - - //---connect the 2 components - FUnknownPtr cp1 (mProcessor); - FUnknownPtr cp2 (mController); - if (cp1 && cp2) - { - cp1->connect (cp2); - cp2->connect (cp1); - - componentsConnected = true; - } - - //---inform the component "controller" with the component "processor" state - MemoryStream stream; - if (mComponent->getState (&stream) == kResultTrue) - { - stream.seek (0, IBStream::kIBSeekSet, 0); - mController->setComponentState (&stream); - } - } - - // VST 2 stuff ----------------------------------------------- - if (mProcessor) - { - if (mProcessor->canProcessSampleSize (kSample64) == kResultTrue) - { - canDoubleReplacing (); // supports double precision processing - - // we use the 64 as default only if 32 bit not supported - if (mProcessor->canProcessSampleSize (kSample32) != kResultTrue) - mVst3SampleSize = kSample64; - else - mVst3SampleSize = kSample32; - } - - // latency ------------------------------- - setInitialDelay (mProcessor->getLatencySamples ()); - - if (mProcessor->getTailSamples () == kNoTail) - noTail (true); - - setupProcessing (); // initialize vst3 component processing parameters - } - - // parameters - setupParameters (); - - // setup inputs and outputs - setupBuses (); - - if (mController) - { - if (Vst2EditorWrapper::hasEditor (mController)) - setEditor (new Vst2EditorWrapper (this, mController)); - } - - // find out programs of root unit -------------------------- - numPrograms = cEffect.numPrograms = 0; - if (mUnitInfo) - { - int32 programListCount = mUnitInfo->getProgramListCount (); - if (programListCount > 0) - { - ProgramListID rootUnitProgramListId = kNoProgramListId; - for (int32 i = 0; i < mUnitInfo->getUnitCount (); i++) - { - UnitInfo unit = {0}; - if (mUnitInfo->getUnitInfo (i, unit) == kResultTrue) - { - if (unit.id == kRootUnitId) - { - rootUnitProgramListId = unit.programListId; - break; - } - } - } - - if (rootUnitProgramListId != kNoProgramListId) - { - for (int32 i = 0; i < programListCount; i++) - { - ProgramListInfo progList = {0}; - if (mUnitInfo->getProgramListInfo (i, progList) == kResultTrue) - { - if (progList.id == rootUnitProgramListId) - { - numPrograms = cEffect.numPrograms = progList.programCount; - break; - } - } - } - } - } - } - - if (mTimer == 0) - { - mTimer = Timer::create (this, 50); - } - - initMidiCtrlerAssignment (); - - return true; -} - -//------------------------------------------------------------------------------------------------------- -Vst2Wrapper::~Vst2Wrapper () -{ - if (mTimer) - { - mTimer->release (); - mTimer = 0; - } - - mProcessData.unprepare (); - - if (mVst2InputArrangement) - free (mVst2InputArrangement); - if (mVst2OutputArrangement) - free (mVst2OutputArrangement); - - //---Disconnect components - if (componentsConnected) - { - FUnknownPtr cp1 (mProcessor); - FUnknownPtr cp2 (mController); - if (cp1 && cp2) - { - cp1->disconnect (cp2); - cp2->disconnect (cp1); - } - } - - //---Terminate Controller Component - if (mController) - { - mController->setComponentHandler (0); - if (controllerInitialized) - mController->terminate (); - controllerInitialized = false; - } - - //---Terminate Processor Component - if (mComponent && componentInitialized) - { - mComponent->terminate (); - componentInitialized = false; - } - - if (mUnitInfo) - mUnitInfo->release (); - - if (mMidiMapping) - mMidiMapping->release (); - if (mMidiCCMapping[0]) - for (int32 i = 0; i < 16; i++) - delete mMidiCCMapping[i]; - - if (mController) - mController->release (); - - //! editor needs to be destroyed BEFORE DeinitModule. Therefore destroy it here already - // instead of AudioEffect destructor - delete editor; - editor = 0; - - if (mComponent) - mComponent->release (); - - if (mProcessor) - mProcessor->release (); - - delete mInputEvents; - delete mOutputEvents; - delete mVst2OutputEvents; - - if (mFactory) - mFactory->release (); - - DeinitModule (); -} - -// VST 2 -//------------------------------------------------------------------------------------------------------- -void Vst2Wrapper::suspend () -{ - stopProcess (); - - if (mComponent) - mComponent->setActive (false); -} - -//------------------------------------------------------------------------------------------------------- -void Vst2Wrapper::resume () -{ - AudioEffectX::resume (); - mChunk.setSize (0); - - if (mComponent) - mComponent->setActive (true); -} - -//------------------------------------------------------------------------------------------------------- -VstInt32 Vst2Wrapper::startProcess () -{ - if (mProcessor && processing == false) - { - processing = true; - mProcessor->setProcessing (true); - } - return 0; -} - -//------------------------------------------------------------------------------------------------------- -VstInt32 Vst2Wrapper::stopProcess () -{ - if (mProcessor && processing) - { - mProcessor->setProcessing (false); - processing = false; - } - return 0; -} - -//------------------------------------------------------------------------------------------------------- -bool Vst2Wrapper::setupProcessing (int32 processModeOverwrite) -{ - if (!mProcessor) - return false; - - ProcessSetup setup; - if (processModeOverwrite >= 0) - setup.processMode = processModeOverwrite; - else - setup.processMode = mVst3processMode; - setup.maxSamplesPerBlock = blockSize; - setup.sampleRate = sampleRate; - setup.symbolicSampleSize = mVst3SampleSize; - - return mProcessor->setupProcessing (setup) == kResultTrue; -} - -//------------------------------------------------------------------------------------------------------- -void Vst2Wrapper::setSampleRate (float newSamplerate) -{ - if (processing) - return; - - if (newSamplerate != sampleRate) - { - AudioEffectX::setSampleRate (newSamplerate); - setupProcessing (); - } -} - -//------------------------------------------------------------------------------------------------------- -void Vst2Wrapper::setBlockSize (VstInt32 newBlockSize) -{ - if (processing) - return; - - if (blockSize != newBlockSize) - { - AudioEffectX::setBlockSize (newBlockSize); - setupProcessing (); - } -} - -//------------------------------------------------------------------------------------------------------- -float Vst2Wrapper::getParameter (VstInt32 index) -{ - if (!mController) - return 0.f; - - if (index < (int32)mParameterMap.size ()) - { - ParamID id = mParameterMap.at (index).vst3ID; - return (float)mController->getParamNormalized (id); - } - - return 0.f; -} - -//------------------------------------------------------------------------------------------------------- -void Vst2Wrapper::setParameter (VstInt32 index, float value) -{ - if (!mController) - return; - - if (index < (int32)mParameterMap.size ()) - { - ParamID id = mParameterMap.at (index).vst3ID; - addParameterChange (id, (ParamValue)value, 0); - } -} - -//------------------------------------------------------------------------------------------------------- -void Vst2Wrapper::addParameterChange (ParamID id, ParamValue value, int32 sampleOffset) -{ - mGuiTransfer.addChange (id, value, sampleOffset); - mInputTransfer.addChange (id, value, sampleOffset); -} - -//------------------------------------------------------------------------------------------------------- -void Vst2Wrapper::setProgram (VstInt32 program) -{ - if (mProgramParameterID != kNoParamId && mController != 0 && mProgramParameterIdx != -1) - { - AudioEffectX::setProgram (program); - - ParameterInfo paramInfo = {0}; - if (mController->getParameterInfo (mProgramParameterIdx, paramInfo) == kResultTrue) - { - if (paramInfo.stepCount > 0 && program <= paramInfo.stepCount) - { - ParamValue normalized = (ParamValue)program / (ParamValue)paramInfo.stepCount; - addParameterChange (mProgramParameterID, normalized, 0); - } - } - } -} - -//------------------------------------------------------------------------------------------------------- -void Vst2Wrapper::setProgramName (char* name) -{ - // not supported in VST 3 -} - -//------------------------------------------------------------------------------------------------------- -void Vst2Wrapper::getProgramName (char* name) -{ - // name of the current program. Limited to #kVstMaxProgNameLen. - *name = 0; - if (mUnitInfo) - { - ProgramListInfo listInfo = {0}; - if (mUnitInfo->getProgramListInfo (0, listInfo) == kResultTrue) - { - String128 tmp = {0}; - if (mUnitInfo->getProgramName (listInfo.id, curProgram, tmp) == kResultTrue) - { - String str (tmp); - str.copyTo8 (name, 0, kVstMaxProgNameLen); - } - } - } -} - -//------------------------------------------------------------------------------------------------------- -bool Vst2Wrapper::getProgramNameIndexed (VstInt32, VstInt32 index, char* name) -{ - *name = 0; - if (mUnitInfo) - { - ProgramListInfo listInfo = {0}; - if (mUnitInfo->getProgramListInfo (0, listInfo) == kResultTrue) - { - String128 tmp = {0}; - if (mUnitInfo->getProgramName (listInfo.id, index, tmp) == kResultTrue) - { - String str (tmp); - str.copyTo8 (name, 0, kVstMaxProgNameLen); - return true; - } - } - } - - return false; -} - -//------------------------------------------------------------------------------------------------------- -void Vst2Wrapper::getParameterLabel (VstInt32 index, char* label) -{ - // units in which parameter \e index is displayed (i.e. "sec", "dB", "type", etc...). Limited to - // #kVstMaxParamStrLen. - *label = 0; - if (mController) - { - int32 vst3Index = mParameterMap.at (index).vst3Index; - - ParameterInfo paramInfo = {0}; - if (mController->getParameterInfo (vst3Index, paramInfo) == kResultTrue) - { - String str (paramInfo.units); - str.copyTo8 (label, 0, kVstMaxParamStrLen); - } - } -} - -//------------------------------------------------------------------------------------------------------- -/*! Usually VST 2 hosts call setParameter (...) and getParameterDisplay (...) synchronously. - In setParameter (...) param changes get queued (guiTransfer) and transfered in idle (::onTimer). - The ::onTimer call almost always comes AFTER getParameterDisplay (...) and therefore returns an - old - value. To avoid sending back old values, getLastParamChange (...) returns the latest value - from the guiTransfer queue. */ -//------------------------------------------------------------------------------------------------------- -bool Vst2Wrapper::getLastParamChange (ParamID id, ParamValue& value) -{ - ParameterChanges changes; - mGuiTransfer.transferChangesTo (changes); - for (int32 i = 0; i < changes.getParameterCount (); ++i) - { - IParamValueQueue* queue = changes.getParameterData (i); - if (queue) - { - if (queue->getParameterId () == id) - { - int32 points = queue->getPointCount (); - if (points > 0) - { - mGuiTransfer.transferChangesFrom (changes); - int32 sampleOffset = 0; - return queue->getPoint (points - 1, sampleOffset, value) == kResultTrue; - } - } - } - } - - mGuiTransfer.transferChangesFrom (changes); - return false; -} - -//------------------------------------------------------------------------------------------------------- -void Vst2Wrapper::getParameterDisplay (VstInt32 index, char* text) -{ - // string representation ("0.5", "-3", "PLATE", etc...) of the value of parameter \e index. - // Limited to #kVstMaxParamStrLen. - *text = 0; - if (mController) - { - int32 vst3Index = mParameterMap.at (index).vst3Index; - - ParameterInfo paramInfo = {0}; - if (mController->getParameterInfo (vst3Index, paramInfo) == kResultTrue) - { - String128 tmp = {0}; - ParamValue value = 0; - if (!getLastParamChange (paramInfo.id, value)) - value = mController->getParamNormalized (paramInfo.id); - - if (mController->getParamStringByValue (paramInfo.id, value, tmp) == kResultTrue) - { - String str (tmp); - str.copyTo8 (text, 0, kVstMaxParamStrLen); - } - } - } -} - -//------------------------------------------------------------------------------------------------------- -void Vst2Wrapper::getUnitPath (UnitID unitID, String& path) -{ - //! Build the unit path up to the root unit (e.g. "Modulators.LFO 1.". Separator is a ".") - for (int32 unitIndex = 0; unitIndex < mUnitInfo->getUnitCount (); ++unitIndex) - { - UnitInfo info = {0}; - mUnitInfo->getUnitInfo (unitIndex, info); - if (info.id == unitID) - { - String unitName (info.name); - unitName.append ("."); - path.insertAt (0, unitName); - if (info.parentUnitId != kRootUnitId) - getUnitPath (info.parentUnitId, path); - - break; - } - } -} -//------------------------------------------------------------------------------------------------------- -void Vst2Wrapper::getParameterName (VstInt32 index, char* text) -{ - // name ("Time", "Gain", "RoomType", etc...) of parameter \e index. Limited to - // #kVstExtMaxParamStrLen. - *text = 0; - if (mController && index < (int32)mParameterMap.size ()) - { - int32 vst3Index = mParameterMap.at (index).vst3Index; - - ParameterInfo paramInfo = {0}; - if (mController->getParameterInfo (vst3Index, paramInfo) == kResultTrue) - { - String str; - if (vst2WrapperFullParameterPath) - { - //! The parameter's name contains the unit path (e.g. "LFO 1.freq") as well - if (mUnitInfo) - { - getUnitPath (paramInfo.unitId, str); - } - } - str.append (paramInfo.title); - - if (str.length () > kVstExtMaxParamStrLen) - { - //! In case the string's length exceeds the limit, try parameter's title without - // unit path. - str = paramInfo.title; - } - if (str.length () > kVstExtMaxParamStrLen) - { - str = paramInfo.shortTitle; - } - str.copyTo8 (text, 0, kVstExtMaxParamStrLen); - } - } -} - -//------------------------------------------------------------------------------------------------------- -bool Vst2Wrapper::canParameterBeAutomated (VstInt32 index) -{ - if (mController && index < (int32)mParameterMap.size ()) - { - int32 vst3Index = mParameterMap.at (index).vst3Index; - - ParameterInfo paramInfo = {0}; - if (mController->getParameterInfo (vst3Index, paramInfo) == kResultTrue) - return (paramInfo.flags & ParameterInfo::kCanAutomate) != 0; - } - return false; -} - -//------------------------------------------------------------------------------------------------------- -bool Vst2Wrapper::string2parameter (VstInt32 index, char* text) -{ - if (mController && index < (int32)mParameterMap.size ()) - { - int32 vst3Index = mParameterMap.at (index).vst3Index; - - ParameterInfo paramInfo = {0}; - if (mController->getParameterInfo (vst3Index, paramInfo) == kResultTrue) - { - TChar tString[1024] = {0}; - String tmp (text); - tmp.copyTo16 (tString, 0, 1023); - - ParamValue valueNormalized = 0.0; - - if (mController->getParamValueByString (paramInfo.id, tString, valueNormalized)) - { - setParameterAutomated (index, (float)valueNormalized); - // TODO: check if setParameterAutomated is correct - } - } - } - return false; -} - -//------------------------------------------------------------------------------------------------------- -bool Vst2Wrapper::getParameterProperties (VstInt32 index, VstParameterProperties* p) -{ - if (mController && index < (int32)mParameterMap.size ()) - { - p->label[0] = 0; - p->shortLabel[0] = 0; - - int32 vst3Index = mParameterMap.at (index).vst3Index; - - ParameterInfo paramInfo = {0}; - if (mController->getParameterInfo (vst3Index, paramInfo) == kResultTrue) - { - String str (paramInfo.title); - str.copyTo8 (p->label, 0, kVstMaxLabelLen); - - String str2 (paramInfo.shortTitle); - str.copyTo8 (p->shortLabel, 0, kVstMaxShortLabelLen); - - if (paramInfo.stepCount == 0) // continuous - { - p->flags |= kVstParameterCanRamp; - } - else if (paramInfo.stepCount == 1) // on / off - { - p->flags |= kVstParameterIsSwitch; - } - else - { - p->minInteger = 0; - p->maxInteger = paramInfo.stepCount; - p->flags |= kVstParameterUsesIntegerMinMax; - } - - return true; - } - } - return false; -} - -//------------------------------------------------------------------------------------------------------- -VstInt32 Vst2Wrapper::getChunk (void** data, bool isPreset) -{ - // Host stores Plug-in state. Returns the size in bytes of the chunk (Plug-in allocates the data - // array) - MemoryStream componentStream; - if (mComponent && mComponent->getState (&componentStream) != kResultTrue) - componentStream.setSize (0); - - MemoryStream controllerStream; - if (mController && mController->getState (&controllerStream) != kResultTrue) - controllerStream.setSize (0); - - if (componentStream.getSize () + controllerStream.getSize () == 0) - return 0; - - mChunk.setSize (0); - IBStreamer acc (&mChunk, kLittleEndian); - - acc.writeInt64 (componentStream.getSize ()); - acc.writeInt64 (controllerStream.getSize ()); - - acc.writeRaw (componentStream.getData (), (int32)componentStream.getSize ()); - acc.writeRaw (controllerStream.getData (), (int32)controllerStream.getSize ()); - - int32 chunkSize = (int32)mChunk.getSize (); - *data = mChunk.getData (); - return chunkSize; -} - -//------------------------------------------------------------------------------------------------------- -VstInt32 Vst2Wrapper::setChunk (void* data, VstInt32 byteSize, bool isPreset) -{ - if (!mComponent) - return 0; - - MemoryStream chunk (data, byteSize); - IBStreamer acc (&chunk, kLittleEndian); - - int64 componentDataSize = 0; - int64 controllerDataSize = 0; - - acc.readInt64 (componentDataSize); - acc.readInt64 (controllerDataSize); - - MemoryStream componentStream (((char*)data) + acc.tell (), componentDataSize); - MemoryStream controllerStream (((char*)data) + acc.tell () + componentDataSize, - controllerDataSize); - - mComponent->setState (&componentStream); - componentStream.seek (0, IBStream::kIBSeekSet, 0); - - if (mController) - { - mController->setComponentState (&componentStream); - mController->setState (&controllerStream); - } - - return 0; -} - -//------------------------------------------------------------------------------------------------------- -VstInt32 Vst2Wrapper::vst3ToVst2SpeakerArr (SpeakerArrangement vst3Arr) -{ - switch (vst3Arr) - { - case SpeakerArr::kMono: - return kSpeakerArrMono; - case SpeakerArr::kStereo: - return kSpeakerArrStereo; - case SpeakerArr::kStereoSurround: - return kSpeakerArrStereoSurround; - case SpeakerArr::kStereoCenter: - return kSpeakerArrStereoCenter; - case SpeakerArr::kStereoSide: - return kSpeakerArrStereoSide; - case SpeakerArr::kStereoCLfe: - return kSpeakerArrStereoCLfe; - case SpeakerArr::k30Cine: - return kSpeakerArr30Cine; - case SpeakerArr::k30Music: - return kSpeakerArr30Music; - case SpeakerArr::k31Cine: - return kSpeakerArr31Cine; - case SpeakerArr::k31Music: - return kSpeakerArr31Music; - case SpeakerArr::k40Cine: - return kSpeakerArr40Cine; - case SpeakerArr::k40Music: - return kSpeakerArr40Music; - case SpeakerArr::k41Cine: - return kSpeakerArr41Cine; - case SpeakerArr::k41Music: - return kSpeakerArr41Music; - case SpeakerArr::k50: - return kSpeakerArr50; - case SpeakerArr::k51: - return kSpeakerArr51; - case SpeakerArr::k60Cine: - return kSpeakerArr60Cine; - case SpeakerArr::k60Music: - return kSpeakerArr60Music; - case SpeakerArr::k61Cine: - return kSpeakerArr61Cine; - case SpeakerArr::k61Music: - return kSpeakerArr61Music; - case SpeakerArr::k70Cine: - return kSpeakerArr70Cine; - case SpeakerArr::k70Music: - return kSpeakerArr70Music; - case SpeakerArr::k71Cine: - return kSpeakerArr71Cine; - case SpeakerArr::k71Music: - return kSpeakerArr71Music; - case SpeakerArr::k80Cine: - return kSpeakerArr80Cine; - case SpeakerArr::k80Music: - return kSpeakerArr80Music; - case SpeakerArr::k81Cine: - return kSpeakerArr81Cine; - case SpeakerArr::k81Music: - return kSpeakerArr81Music; - case SpeakerArr::k102: - return kSpeakerArr102; - } - - return kSpeakerArrUserDefined; -} - -//------------------------------------------------------------------------------------------------------- -SpeakerArrangement Vst2Wrapper::vst2ToVst3SpeakerArr (VstInt32 vst2Arr) -{ - switch (vst2Arr) - { - case kSpeakerArrMono: - return SpeakerArr::kMono; - case kSpeakerArrStereo: - return SpeakerArr::kStereo; - case kSpeakerArrStereoSurround: - return SpeakerArr::kStereoSurround; - case kSpeakerArrStereoCenter: - return SpeakerArr::kStereoCenter; - case kSpeakerArrStereoSide: - return SpeakerArr::kStereoSide; - case kSpeakerArrStereoCLfe: - return SpeakerArr::kStereoCLfe; - case kSpeakerArr30Cine: - return SpeakerArr::k30Cine; - case kSpeakerArr30Music: - return SpeakerArr::k30Music; - case kSpeakerArr31Cine: - return SpeakerArr::k31Cine; - case kSpeakerArr31Music: - return SpeakerArr::k31Music; - case kSpeakerArr40Cine: - return SpeakerArr::k40Cine; - case kSpeakerArr40Music: - return SpeakerArr::k40Music; - case kSpeakerArr41Cine: - return SpeakerArr::k41Cine; - case kSpeakerArr41Music: - return SpeakerArr::k41Music; - case kSpeakerArr50: - return SpeakerArr::k50; - case kSpeakerArr51: - return SpeakerArr::k51; - case kSpeakerArr60Cine: - return SpeakerArr::k60Cine; - case kSpeakerArr60Music: - return SpeakerArr::k60Music; - case kSpeakerArr61Cine: - return SpeakerArr::k61Cine; - case kSpeakerArr61Music: - return SpeakerArr::k61Music; - case kSpeakerArr70Cine: - return SpeakerArr::k70Cine; - case kSpeakerArr70Music: - return SpeakerArr::k70Music; - case kSpeakerArr71Cine: - return SpeakerArr::k71Cine; - case kSpeakerArr71Music: - return SpeakerArr::k71Music; - case kSpeakerArr80Cine: - return SpeakerArr::k80Cine; - case kSpeakerArr80Music: - return SpeakerArr::k80Music; - case kSpeakerArr81Cine: - return SpeakerArr::k81Cine; - case kSpeakerArr81Music: - return SpeakerArr::k81Music; - case kSpeakerArr102: - return SpeakerArr::k102; - } - - return 0; -} - -//------------------------------------------------------------------------------------------------------- -VstInt32 Vst2Wrapper::vst3ToVst2Speaker (Vst::Speaker vst3Speaker) -{ - switch (vst3Speaker) - { - case Vst::kSpeakerM: - return ::kSpeakerM; - case Vst::kSpeakerL: - return ::kSpeakerL; - case Vst::kSpeakerR: - return ::kSpeakerR; - case Vst::kSpeakerC: - return ::kSpeakerC; - case Vst::kSpeakerLfe: - return ::kSpeakerLfe; - case Vst::kSpeakerLs: - return ::kSpeakerLs; - case Vst::kSpeakerRs: - return ::kSpeakerRs; - case Vst::kSpeakerLc: - return ::kSpeakerLc; - case Vst::kSpeakerRc: - return ::kSpeakerRc; - case Vst::kSpeakerS: - return ::kSpeakerS; - case Vst::kSpeakerSl: - return ::kSpeakerSl; - case Vst::kSpeakerSr: - return ::kSpeakerSr; - case Vst::kSpeakerTm: - return ::kSpeakerTm; - case Vst::kSpeakerTfl: - return ::kSpeakerTfl; - case Vst::kSpeakerTfc: - return ::kSpeakerTfc; - case Vst::kSpeakerTfr: - return ::kSpeakerTfr; - case Vst::kSpeakerTrl: - return ::kSpeakerTrl; - case Vst::kSpeakerTrc: - return ::kSpeakerTrc; - case Vst::kSpeakerTrr: - return ::kSpeakerTrr; - case Vst::kSpeakerLfe2: - return ::kSpeakerLfe2; - } - return ::kSpeakerUndefined; -} - -//------------------------------------------------------------------------------------------------------- -static const char* gSpeakerNames[] = { - "M", ///< Mono (M) - "L", ///< Left (L) - "R", ///< Right (R) - "C", ///< Center (C) - "Lfe", ///< Subbass (Lfe) - "Ls", ///< Left Surround (Ls) - "Rs", ///< Right Surround (Rs) - "Lc", ///< Left of Center (Lc) - "Rc", ///< Right of Center (Rc) - "Cs", ///< Center of Surround (Cs) = Surround (S) - "Sl", ///< Side Left (Sl) - "Sr", ///< Side Right (Sr) - "Tm", ///< Top Middle (Tm) - "Tfl", ///< Top Front Left (Tfl) - "Tfc", ///< Top Front Center (Tfc) - "Tfr", ///< Top Front Right (Tfr) - "Trl", ///< Top Rear Left (Trl) - "Trc", ///< Top Rear Center (Trc) - "Trr", ///< Top Rear Right (Trr) - "Lfe2" ///< Subbass 2 (Lfe2) -}; -static const int32 kNumSpeakerNames = sizeof (gSpeakerNames) / sizeof (char*); - -//------------------------------------------------------------------------------------------------------- -bool Vst2Wrapper::pinIndexToBusChannel (BusDirection dir, VstInt32 pinIndex, int32& busIndex, - int32& busChannel) -{ - AudioBusBuffers* busBuffers = dir == kInput ? mProcessData.inputs : mProcessData.outputs; - int32 busCount = dir == kInput ? mProcessData.numInputs : mProcessData.numOutputs; - uint64 mainBusFlags = dir == kInput ? mMainAudioInputBuses : mMainAudioOutputBuses; - - int32 sourceIndex = 0; - for (busIndex = 0; busIndex < busCount; busIndex++) - { - AudioBusBuffers& buffers = busBuffers[busIndex]; - if (mainBusFlags & (uint64 (1) << busIndex)) - { - for (busChannel = 0; busChannel < buffers.numChannels; busChannel++) - { - if (pinIndex == sourceIndex) - { - return true; - } - sourceIndex++; - } - } - } - return false; -} - -//------------------------------------------------------------------------------------------------------- -bool Vst2Wrapper::getPinProperties (BusDirection dir, VstInt32 pinIndex, - VstPinProperties* properties) -{ - int32 busIndex = -1; - int32 busChannelIndex = -1; - - if (pinIndexToBusChannel (dir, pinIndex, busIndex, busChannelIndex)) - { - BusInfo busInfo = {0}; - if (mComponent && mComponent->getBusInfo (kAudio, dir, busIndex, busInfo) == kResultTrue) - { - properties->flags = kVstPinIsActive; // ???? - - String name (busInfo.name); - name.copyTo8 (properties->label, 0, kVstMaxLabelLen); - - if (busInfo.channelCount == 1) - { - properties->flags |= kVstPinUseSpeaker; - properties->arrangementType = kSpeakerArrMono; - } - if (busInfo.channelCount == 2) - { - properties->flags |= kVstPinUseSpeaker; - properties->flags |= kVstPinIsStereo; - properties->arrangementType = kSpeakerArrStereo; - } - else if (busInfo.channelCount > 2) - { - Vst::SpeakerArrangement arr = 0; - if (mProcessor && mProcessor->getBusArrangement (dir, busIndex, arr) == kResultTrue) - { - properties->flags |= kVstPinUseSpeaker; - properties->arrangementType = vst3ToVst2SpeakerArr (arr); - } - else - { - return false; - } - } - - return true; - } - } - - return false; -} - -//------------------------------------------------------------------------------------------------------- -bool Vst2Wrapper::getInputProperties (VstInt32 index, VstPinProperties* properties) -{ - return getPinProperties (kInput, index, properties); -} - -//------------------------------------------------------------------------------------------------------- -bool Vst2Wrapper::getOutputProperties (VstInt32 index, VstPinProperties* properties) -{ - return getPinProperties (kOutput, index, properties); -} - -//------------------------------------------------------------------------------------------------------- -bool Vst2Wrapper::setSpeakerArrangement (VstSpeakerArrangement* pluginInput, - VstSpeakerArrangement* pluginOutput) -{ - if (!mProcessor || !mComponent) - return false; - - Vst::SpeakerArrangement newInputArr = 0; - Vst::SpeakerArrangement newOutputArr = 0; - Vst::SpeakerArrangement outputArr = 0; - Vst::SpeakerArrangement inputArr = 0; - - int32 inputBusCount = mComponent->getBusCount (kAudio, kInput); - int32 outputBusCount = mComponent->getBusCount (kAudio, kOutput); - - if (inputBusCount > 0) - if (mProcessor->getBusArrangement (kInput, 0, inputArr) != kResultTrue) - return false; - if (outputBusCount > 0) - if (mProcessor->getBusArrangement (kOutput, 0, outputArr) != kResultTrue) - return false; - - if (pluginInput) - { - newInputArr = vst2ToVst3SpeakerArr (pluginInput->type); - if (newInputArr == 0) - return false; - } - if (pluginOutput) - { - newOutputArr = vst2ToVst3SpeakerArr (pluginOutput->type); - if (newOutputArr == 0) - return false; - } - - if (newInputArr == 0) - newInputArr = inputArr; - if (newOutputArr == 0) - newOutputArr = outputArr; - - if (newInputArr != inputArr || newOutputArr != outputArr) - { - if (mProcessor->setBusArrangements ( - &newInputArr, (newInputArr > 0 && inputBusCount > 0) ? 1 : 0, &newOutputArr, - (newOutputArr > 0 && outputBusCount > 0) ? 1 : 0) != kResultTrue) - return false; - - restartComponent (kIoChanged); - } - - return true; -} - -//------------------------------------------------------------------------------------------------------- -void Vst2Wrapper::setupVst2Arrangement (VstSpeakerArrangement*& vst2arr, - Vst::SpeakerArrangement vst3Arrangement) -{ - int32 numChannels = Vst::SpeakerArr::getChannelCount (vst3Arrangement); - - if (vst2arr && (numChannels == 0 || (numChannels > vst2arr->numChannels && numChannels > 8))) - { - free (vst2arr); - vst2arr = 0; - if (numChannels == 0) - return; - } - - if (vst2arr == 0) - { - int32 channelOverhead = numChannels > 8 ? numChannels - 8 : 0; - uint32 structSize = - sizeof (VstSpeakerArrangement) + channelOverhead * sizeof (VstSpeakerProperties); - vst2arr = (VstSpeakerArrangement*)malloc (structSize); - memset (vst2arr, 0, structSize); - } - - if (vst2arr) - { - vst2arr->type = vst3ToVst2SpeakerArr (vst3Arrangement); - vst2arr->numChannels = numChannels; - - Speaker vst3TestSpeaker = 1; - - for (int32 i = 0; i < numChannels; i++) - { - VstSpeakerProperties& props = vst2arr->speakers[i]; - - // find nextSpeaker in vst3 arrangement - Speaker vst3Speaker = 0; - while (vst3Speaker == 0 && vst3TestSpeaker != 0) - { - if (vst3Arrangement & vst3TestSpeaker) - vst3Speaker = vst3TestSpeaker; - - vst3TestSpeaker <<= 1; - } - - if (vst3Speaker) - { - props.type = vst3ToVst2Speaker (vst3Speaker); - if (props.type >= 0 && props.type < kNumSpeakerNames) - strncpy (props.name, gSpeakerNames[props.type], kVstMaxNameLen); - else - sprintf (props.name, "%d", i + 1); - } - } - } -} - -//------------------------------------------------------------------------------------------------------- -bool Vst2Wrapper::getSpeakerArrangement (VstSpeakerArrangement** pluginInput, - VstSpeakerArrangement** pluginOutput) -{ - if (!mProcessor) - return false; - - Vst::SpeakerArrangement inputArr = 0; - Vst::SpeakerArrangement outputArr = 0; - - if (mProcessor->getBusArrangement (kInput, 0, inputArr) != kResultTrue) - inputArr = 0; - - if (mProcessor->getBusArrangement (kOutput, 0, outputArr) != kResultTrue) - outputArr = 0; - - setupVst2Arrangement (mVst2InputArrangement, inputArr); - setupVst2Arrangement (mVst2OutputArrangement, outputArr); - - *pluginInput = mVst2InputArrangement; - *pluginOutput = mVst2OutputArrangement; - - return mVst2InputArrangement != 0 && mVst2OutputArrangement != 0; -} - -//------------------------------------------------------------------------------------------------------- -bool Vst2Wrapper::setBypass (bool onOff) -{ - if (mBypassParameterID != kNoParamId) - { - addParameterChange (mBypassParameterID, onOff ? 1.0 : 0.0, 0); - return true; - } - return false; -} - -//-------------------------------------------------------------------------------------------------------------- -bool Vst2Wrapper::setProcessPrecision (VstInt32 precision) -{ - int32 newVst3SampleSize = -1; - - if (precision == kVstProcessPrecision32) - newVst3SampleSize = kSample32; - else if (precision == kVstProcessPrecision64) - newVst3SampleSize = kSample64; - - if (newVst3SampleSize != mVst3SampleSize) - { - if (mProcessor && mProcessor->canProcessSampleSize (newVst3SampleSize) == kResultTrue) - { - mVst3SampleSize = newVst3SampleSize; - setupProcessing (); - - setupBuses (); - - return true; - } - return false; - } - return true; -} - -//-------------------------------------------------------------------------------------------------------------- -VstInt32 Vst2Wrapper::getNumMidiInputChannels () -{ - if (!mComponent) - return 0; - - int32 busCount = mComponent->getBusCount (kEvent, kInput); - if (busCount > 0) - { - BusInfo busInfo = {0}; - if (mComponent->getBusInfo (kEvent, kInput, 0, busInfo) == kResultTrue) - { - return busInfo.channelCount; - } - } - return 0; -} - -//-------------------------------------------------------------------------------------------------------------- -VstInt32 Vst2Wrapper::getNumMidiOutputChannels () -{ - if (!mComponent) - return 0; - - int32 busCount = mComponent->getBusCount (kEvent, kOutput); - if (busCount > 0) - { - BusInfo busInfo = {0}; - if (mComponent->getBusInfo (kEvent, kOutput, 0, busInfo) == kResultTrue) - { - return busInfo.channelCount; - } - } - return 0; -} - -//-------------------------------------------------------------------------------------------------------------- -VstInt32 Vst2Wrapper::getGetTailSize () -{ - if (mProcessor) - return mProcessor->getTailSamples (); - - return 0; -} - -//-------------------------------------------------------------------------------------------------------------- -bool Vst2Wrapper::getEffectName (char* effectName) -{ - if (mName[0]) - { - strncpy (effectName, mName, kVstMaxEffectNameLen); - return true; - } - return false; -} - -//-------------------------------------------------------------------------------------------------------------- -bool Vst2Wrapper::getVendorString (char* text) -{ - if (mVendor[0]) - { - strncpy (text, mVendor, kVstMaxVendorStrLen); - return true; - } - return false; -} - -//-------------------------------------------------------------------------------------------------------------- -VstIntPtr Vst2Wrapper::vendorSpecific (VstInt32 lArg, VstIntPtr lArg2, void* ptrArg, float floatArg) -{ - switch (lArg) - { - case 'stCA': - case 'stCa': - switch (lArg2) - { - //---------- - case 'FUID': - if (ptrArg && mVst3EffectClassID.isValid ()) - { - memcpy ((char*)ptrArg, mVst3EffectClassID, 16); - return 1; - } - break; - //---------- - case 'Whee': - if (editor) - editor->onWheel (floatArg); - return 1; - break; - } - } - - return AudioEffectX::vendorSpecific (lArg, lArg2, ptrArg, floatArg); -} - -//-------------------------------------------------------------------------------------------------------------- -VstPlugCategory Vst2Wrapper::getPlugCategory () -{ - if (mSubCategories[0]) - { - if (strstr (mSubCategories, "Analyzer")) - return kPlugCategAnalysis; - - else if (strstr (mSubCategories, "Delay") || strstr (mSubCategories, "Reverb")) - return kPlugCategRoomFx; - - else if (strstr (mSubCategories, "Dynamics") || strstr (mSubCategories, "Mastering")) - return kPlugCategMastering; - - else if (strstr (mSubCategories, "Restoration")) - return kPlugCategRestoration; - - else if (strstr (mSubCategories, "Generator")) - return kPlugCategGenerator; - - else if (strstr (mSubCategories, "Spatial")) - return kPlugCategSpacializer; - - else if (strstr (mSubCategories, "Fx")) - return kPlugCategEffect; - - else if (strstr (mSubCategories, "Instrument")) - return kPlugCategSynth; - } - return kPlugCategUnknown; -} - -//-------------------------------------------------------------------------------------------------------------- -VstInt32 Vst2Wrapper::canDo (char* text) -{ - if (stricmp (text, "sendVstEvents") == 0) - { - return -1; - } - else if (stricmp (text, "sendVstMidiEvent") == 0) - { - return hasEventOutputBuses ? 1 : -1; - } - else if (stricmp (text, "receiveVstEvents") == 0) - { - return -1; - } - else if (stricmp (text, "receiveVstMidiEvent") == 0) - { - return hasEventInputBuses ? 1 : -1; - } - else if (stricmp (text, "receiveVstTimeInfo") == 0) - { - return 1; - } - else if (stricmp (text, "offline") == 0) - { - if (processing) - return 0; - if (mVst3processMode == kOffline) - return 1; - - bool canOffline = setupProcessing (kOffline); - setupProcessing (); - return canOffline ? 1 : -1; - } - else if (stricmp (text, "midiProgramNames") == 0) - { - if (mUnitInfo) - { - UnitID unitId = -1; - if (mUnitInfo->getUnitByBus (kEvent, kInput, 0, 0, unitId) == kResultTrue && unitId >= 0) - return 1; - } - return -1; - } - else if (stricmp (text, "bypass") == 0) - { - return mBypassParameterID != kNoParamId ? 1 : -1; - } - return 0; // do not know -} - -//-------------------------------------------------------------------------------------------------------------- -bool Vst2Wrapper::setupMidiProgram (int32 midiChannel, ProgramListID programListId, - MidiProgramName& midiProgramName) -{ - if (mUnitInfo) - { - String128 string128 = {0}; - - if (mUnitInfo->getProgramName (programListId, midiProgramName.thisProgramIndex, string128) == - kResultTrue) - { - String str (string128); - str.copyTo8 (midiProgramName.name, 0, kVstMaxNameLen); - - midiProgramName.midiProgram = midiProgramName.thisProgramIndex; - midiProgramName.midiBankMsb = -1; - midiProgramName.midiBankLsb = -1; - midiProgramName.parentCategoryIndex = -1; - midiProgramName.flags = 0; - - if (mUnitInfo->getProgramInfo (programListId, midiProgramName.thisProgramIndex, - PresetAttributes::kInstrument, string128) == kResultTrue) - { - midiProgramName.parentCategoryIndex = - lookupProgramCategory (midiChannel, string128); - } - return true; - } - } - return false; -} - -//-------------------------------------------------------------------------------------------------------------- -VstInt32 Vst2Wrapper::getMidiProgramName (VstInt32 channel, MidiProgramName* midiProgramName) -{ - UnitID unitId; - ProgramListID programListId; - if (mUnitInfo && getProgramListAndUnit (channel, unitId, programListId)) - { - if (midiProgramName) - setupMidiProgram (channel, programListId, *midiProgramName); - - ProgramListInfo programListInfo; - if (getProgramListInfoByProgramListID (programListId, programListInfo)) - return programListInfo.programCount; - } - return 0; -} - -//-------------------------------------------------------------------------------------------------------------- -VstInt32 Vst2Wrapper::getCurrentMidiProgram (VstInt32 channel, MidiProgramName* currentProgram) -{ - if (mUnitInfo && mController) - { - UnitID unitId; - ProgramListID programListId; - if (getProgramListAndUnit (channel, unitId, programListId)) - { - // find program selector parameter - int32 parameterCount = mController->getParameterCount (); - for (int32 i = 0; i < parameterCount; i++) - { - ParameterInfo parameterInfo = {0}; - if (mController->getParameterInfo (i, parameterInfo) == kResultTrue) - { - if ((parameterInfo.flags & ParameterInfo::kIsProgramChange) != 0 && - parameterInfo.unitId == unitId) - { - ParamValue normalized = mController->getParamNormalized (parameterInfo.id); - int32 discreteValue = - Min ((int32) (normalized * (parameterInfo.stepCount + 1)), - parameterInfo.stepCount); - - if (currentProgram) - { - currentProgram->thisProgramIndex = discreteValue; - setupMidiProgram (channel, programListId, *currentProgram); - } - - return discreteValue; - } - } - } - } - } - - return 0; -} - -//-------------------------------------------------------------------------------------------------------------- -VstInt32 Vst2Wrapper::getMidiProgramCategory (VstInt32 channel, MidiProgramCategory* category) -{ - // try to rebuild it each time - setupProgramCategories (); - - if (channel >= (VstInt32)mProgramCategories.size ()) - return 0; - - std::vector& channelCategories = mProgramCategories[channel]; - if (category && category->thisCategoryIndex < (VstInt32)channelCategories.size ()) - { - ProgramCategory& cat = channelCategories[category->thisCategoryIndex]; - if (cat.vst2Category.thisCategoryIndex == category->thisCategoryIndex) - memcpy (category, &cat.vst2Category, sizeof (MidiProgramCategory)); - } - return (VstInt32)channelCategories.size (); -} - -//-------------------------------------------------------------------------------------------------------------- -bool Vst2Wrapper::hasMidiProgramsChanged (VstInt32 channel) -{ - // names of programs or program categories have changed - return false; -} - -//-------------------------------------------------------------------------------------------------------------- -bool Vst2Wrapper::getMidiKeyName (VstInt32 channel, MidiKeyName* keyName) -{ - UnitID unitId; - ProgramListID programListId; - if (mUnitInfo && getProgramListAndUnit (channel, unitId, programListId)) - { - String128 string128 = {0}; - if (mUnitInfo->getProgramPitchName (programListId, keyName->thisProgramIndex, - keyName->thisKeyNumber, string128)) - { - String str (string128); - str.copyTo8 (keyName->keyName, 0, kVstMaxNameLen); - return true; - } - } - return false; -} - -//-------------------------------------------------------------------------------------------------------------- -bool Vst2Wrapper::getProgramListAndUnit (int32 midiChannel, UnitID& unitId, - ProgramListID& programListId) -{ - programListId = kNoProgramListId; - unitId = -1; - - // use the first input event bus (VST2 has only 1 bus for event) - if (mUnitInfo && mUnitInfo->getUnitByBus (kEvent, kInput, 0, midiChannel, unitId) == kResultTrue) - { - for (int32 i = 0, unitCount = mUnitInfo->getUnitCount (); i < unitCount; i++) - { - UnitInfo unitInfoStruct = {0}; - if (mUnitInfo->getUnitInfo (i, unitInfoStruct) == kResultTrue) - { - if (unitId == unitInfoStruct.id) - { - programListId = unitInfoStruct.programListId; - return programListId != kNoProgramListId; - } - } - } - } - - return false; -} - -//-------------------------------------------------------------------------------------------------------------- -bool Vst2Wrapper::getProgramListInfoByProgramListID (ProgramListID programListId, - ProgramListInfo& info) -{ - if (mUnitInfo) - { - int32 programListCount = mUnitInfo->getProgramListCount (); - for (int32 i = 0; i < programListCount; i++) - { - memset (&info, 0, sizeof (ProgramListInfo)); - if (mUnitInfo->getProgramListInfo (i, info) == kResultTrue) - { - if (info.id == programListId) - { - return true; - } - } - } - } - return false; -} - -//-------------------------------------------------------------------------------------------------------------- -int32 Vst2Wrapper::lookupProgramCategory (int32 midiChannel, String128 instrumentAttribute) -{ - std::vector& channelCategories = mProgramCategories[midiChannel]; - - for (uint32 categoryIndex = 0; categoryIndex < channelCategories.size (); categoryIndex++) - { - ProgramCategory& cat = channelCategories[categoryIndex]; - if (memcmp (instrumentAttribute, cat.vst3InstrumentAttribute, sizeof (String128)) == 0) - return categoryIndex; - } - - return -1; -} - -//-------------------------------------------------------------------------------------------------------------- -uint32 Vst2Wrapper::makeCategoriesRecursive (std::vector& channelCategories, - String128 vst3Category) -{ - for (uint32 categoryIndex = 0; categoryIndex < channelCategories.size (); categoryIndex++) - { - ProgramCategory& cat = channelCategories[categoryIndex]; - if (memcmp (vst3Category, cat.vst3InstrumentAttribute, sizeof (String128)) == 0) - { - return categoryIndex; - } - } - - int32 parentCategorIndex = -1; - - String128 str; - String strAcc (str); - strAcc.copyTo16 (vst3Category, 0, 127); - int32 len = strAcc.length (); - String singleName; - - char16 divider = '|'; - for (int32 strIndex = len - 1; strIndex >= 0; strIndex--) - { - bool isDivider = str[strIndex] == divider; - str[strIndex] = 0; // zero out rest - if (isDivider) - { - singleName.assign (vst3Category + strIndex + 1); - parentCategorIndex = makeCategoriesRecursive (channelCategories, str); - break; - } - } - - // make new - ProgramCategory cat = {0}; - memcpy (cat.vst3InstrumentAttribute, vst3Category, sizeof (String128)); - singleName.copyTo8 (cat.vst2Category.name, 0, kVstMaxNameLen); - cat.vst2Category.parentCategoryIndex = parentCategorIndex; - cat.vst2Category.thisCategoryIndex = (int32)channelCategories.size (); - - channelCategories.push_back (cat); - - return cat.vst2Category.thisCategoryIndex; -} - -//-------------------------------------------------------------------------------------------------------------- -void Vst2Wrapper::setupProgramCategories () -{ - mProgramCategories.clear (); - if (mUnitInfo && mComponent) - { - if (mComponent->getBusCount (kEvent, kInput) > 0) - { - for (int32 channel = 0; channel < 16; channel++) // the 16 channels - { - // make vector for channel - mProgramCategories.push_back (std::vector ()); - std::vector& channelCategories = mProgramCategories[channel]; - - // scan program list of channel and find categories - UnitID unitId; - ProgramListID programListId; - if (getProgramListAndUnit (channel, unitId, programListId)) - { - ProgramListInfo programListInfo; - if (getProgramListInfoByProgramListID (programListId, programListInfo)) - { - for (int32 programIndex = 0; programIndex < programListInfo.programCount; - programIndex++) - { - String128 string128 = {0}; - if (mUnitInfo->getProgramInfo (programListId, programIndex, - PresetAttributes::kInstrument, - string128) == kResultTrue) - { - makeCategoriesRecursive (channelCategories, string128); - } - } - } - } - } - } - } -} - -//-------------------------------------------------------------------------------------------------------------- -void Vst2Wrapper::setEffectName (char* effectName) { memcpy (mName, effectName, sizeof (mName)); } - -//-------------------------------------------------------------------------------------------------------------- -void Vst2Wrapper::setVendorName (char* name) { memcpy (mVendor, name, sizeof (mVendor)); } - -//-------------------------------------------------------------------------------------------------------------- -void Vst2Wrapper::setSubCategories (char* string) -{ - memcpy (mSubCategories, string, sizeof (mSubCategories)); - - if (strstr (mSubCategories, "Instrument")) - isSynth (true); -} - -//-------------------------------------------------------------------------------------------------------------- -void Vst2Wrapper::setupBuses () -{ - if (!mComponent) - return; - - mProcessData.prepare (*mComponent, 0, mVst3SampleSize); - - setNumInputs (countMainBusChannels (kInput, mMainAudioInputBuses)); - setNumOutputs (countMainBusChannels (kOutput, mMainAudioOutputBuses)); - - hasEventInputBuses = mComponent->getBusCount (kEvent, kInput) > 0; - hasEventOutputBuses = mComponent->getBusCount (kEvent, kOutput) > 0; - - if (hasEventInputBuses) - { - if (mInputEvents == 0) - mInputEvents = new EventList (kMaxEvents); - } - else - { - if (mInputEvents) - { - delete mInputEvents; - mInputEvents = 0; - } - } - - if (hasEventOutputBuses) - { - if (mOutputEvents == 0) - mOutputEvents = new EventList (kMaxEvents); - if (mVst2OutputEvents == 0) - mVst2OutputEvents = new Vst2MidiEventQueue (kMaxEvents); - } - else - { - if (mOutputEvents) - { - delete mOutputEvents; - mOutputEvents = 0; - } - if (mVst2OutputEvents) - { - delete mVst2OutputEvents; - mVst2OutputEvents = 0; - } - } -} - -//-------------------------------------------------------------------------------------------------------------- -void Vst2Wrapper::setupParameters () -{ - mParameterMap.clear (); - mParamIndexMap.clear (); - mBypassParameterID = mProgramParameterID = kNoParamId; - mProgramParameterIdx = -1; - - std::vector programParameterInfos; - std::vector programParameterIdxs; - - int32 paramCount = mController ? mController->getParameterCount () : 0; - for (int32 i = 0; i < paramCount; i++) - { - ParameterInfo paramInfo = {0}; - if (mController->getParameterInfo (i, paramInfo) == kResultTrue) - { - //--------------------------------------------- - if ((paramInfo.flags & ParameterInfo::kIsBypass) != 0) - { - if (mBypassParameterID == kNoParamId) - mBypassParameterID = paramInfo.id; - } - //--------------------------------------------- - else if ((paramInfo.flags & ParameterInfo::kIsProgramChange) != 0) - { - programParameterInfos.push_back (paramInfo); - programParameterIdxs.push_back (i); - if (paramInfo.unitId == kRootUnitId) - { - if (mProgramParameterID == kNoParamId) - { - mProgramParameterID = paramInfo.id; - mProgramParameterIdx = i; - } - } - - if (gExportProgramChangeParameters == true) - { - ParamMapEntry entry = {paramInfo.id, i}; - mParameterMap.push_back (entry); - mParamIndexMap[paramInfo.id] = i; - } - } - //--------------------------------------------- - // do not export read only parameters to VST2 - else if ((paramInfo.flags & ParameterInfo::kIsReadOnly) == 0) - { - ParamMapEntry entry = {paramInfo.id, i}; - mParameterMap.push_back (entry); - mParamIndexMap[paramInfo.id] = i; - } - } - } - - numParams = cEffect.numParams = (int32)mParameterMap.size (); - - mInputTransfer.setMaxParameters (paramCount); - mOutputTransfer.setMaxParameters (paramCount); - mGuiTransfer.setMaxParameters (paramCount); - mInputChanges.setMaxParameters (paramCount); - mOutputChanges.setMaxParameters (paramCount); - - for (int32 midiChannel = 0; midiChannel < kMaxProgramChangeParameters; midiChannel++) - { - mProgramChangeParameterIDs[midiChannel] = kNoParamId; - mProgramChangeParameterIdxs[midiChannel] = -1; - - UnitID unitId; - ProgramListID programListId; - if (getProgramListAndUnit (midiChannel, unitId, programListId)) - { - for (int32 i = 0; i < (int32)programParameterInfos.size (); i++) - { - const ParameterInfo& paramInfo = programParameterInfos.at (i); - if (paramInfo.unitId == unitId) - { - mProgramChangeParameterIDs[midiChannel] = paramInfo.id; - mProgramChangeParameterIdxs[midiChannel] = programParameterIdxs.at (i); - break; - } - } - } - } -} - -//-------------------------------------------------------------------------------------------------------------- -void Vst2Wrapper::initMidiCtrlerAssignment () -{ - if (!mMidiMapping) - return; - - if (!mMidiCCMapping[0]) - { - for (int32 i = 0; i < 16; i++) - mMidiCCMapping[i] = NEW int32[Vst::kCountCtrlNumber]; - } - - ParamID paramID; - for (int16 ch = 0; ch < 16; ch++) - { - for (int32 i = 0; i < Vst::kCountCtrlNumber; i++) - { - paramID = kNoParamId; - if (mMidiMapping->getMidiControllerAssignment (0, ch, (CtrlNumber)i, paramID) == - kResultTrue) - { - // TODO check if tag is associated to a parameter - mMidiCCMapping[ch][i] = paramID; - } - else - mMidiCCMapping[ch][i] = kNoParamId; - } - } -} - -//-------------------------------------------------------------------------------------------------------------- -int32 Vst2Wrapper::countMainBusChannels (BusDirection dir, uint64& mainBusBitset) -{ - int32 result = 0; - mainBusBitset = 0; - - int32 busCount = mComponent->getBusCount (kAudio, dir); - for (int32 i = 0; i < busCount; i++) - { - BusInfo busInfo = {0}; - if (mComponent->getBusInfo (kAudio, dir, i, busInfo) == kResultTrue) - { - if (busInfo.busType == kMain) - { - result += busInfo.channelCount; - mainBusBitset |= (uint64 (1) << i); - - mComponent->activateBus (kAudio, dir, i, true); - } - else if (busInfo.flags & BusInfo::kDefaultActive) - { - mComponent->activateBus (kAudio, dir, i, false); - } - } - } - return result; -} - -//------------------------------------------------------------------------ -const uint8 kNoteOff = 0x80; ///< note, off velocity -const uint8 kNoteOn = 0x90; ///< note, on velocity -const uint8 kPolyPressure = 0xA0; ///< note, pressure -const uint8 kController = 0xB0; ///< controller, value -const uint8 kProgramChangeStatus = 0xC0; ///< program change -const uint8 kAfterTouchStatus = 0xD0; ///< channel pressure -const uint8 kPitchBendStatus = 0xE0; ///< lsb, msb - -const float kMidiScaler = 1.f / 127.f; -static const uint8 kChannelMask = 0x0F; -static const uint8 kStatusMask = 0xF0; -static const uint32 kDataMask = 0x7F; - -//-------------------------------------------------------------------------------------------------------------- -void Vst2Wrapper::processMidiEvent (VstMidiEvent* midiEvent, int32 bus) -{ - Event toAdd = {bus, 0}; - uint8 status = midiEvent->midiData[0] & kStatusMask; - uint8 channel = midiEvent->midiData[0] & kChannelMask; - if (channel < 16) - { - //--- ----------------------------- - if (status == kNoteOn || status == kNoteOff) - { - toAdd.sampleOffset = midiEvent->deltaFrames; - if (midiEvent->flags & kVstMidiEventIsRealtime) - toAdd.flags |= Event::kIsLive; - - toAdd.ppqPosition = 0; - - if (status == kNoteOff) // note off - { - toAdd.type = Event::kNoteOffEvent; - toAdd.noteOff.channel = channel; - toAdd.noteOff.pitch = midiEvent->midiData[1]; - toAdd.noteOff.velocity = (float)midiEvent->noteOffVelocity * kMidiScaler; - toAdd.noteOff.noteId = -1; // TODO ? - } - else if (status == kNoteOn) // note on - { - toAdd.type = Event::kNoteOnEvent; - toAdd.noteOn.channel = channel; - toAdd.noteOn.pitch = midiEvent->midiData[1]; - toAdd.noteOn.tuning = midiEvent->detune; - toAdd.noteOn.velocity = (float)midiEvent->midiData[2] * kMidiScaler; - toAdd.noteOn.length = midiEvent->noteLength; - toAdd.noteOn.noteId = -1; // TODO ? - } - mInputEvents->addEvent (toAdd); - } - //--- ----------------------------- - else if (status == kPolyPressure) - { - toAdd.type = Vst::Event::kPolyPressureEvent; - - toAdd.sampleOffset = midiEvent->deltaFrames; - if (midiEvent->flags & kVstMidiEventIsRealtime) - toAdd.flags |= Event::kIsLive; - - toAdd.ppqPosition = 0; - toAdd.polyPressure.channel = channel; - toAdd.polyPressure.pitch = midiEvent->midiData[1] & kDataMask; - toAdd.polyPressure.pressure = (midiEvent->midiData[2] & kDataMask) * kMidiScaler; - toAdd.polyPressure.noteId = -1; // TODO ? - - mInputEvents->addEvent (toAdd); - } - //--- ----------------------------- - else if (status == kController) // controller - { - if (mMidiCCMapping[channel]) - { - ParamID paramID = mMidiCCMapping[channel][midiEvent->midiData[1]]; - if (paramID != kNoParamId) - { - ParamValue value = (double)midiEvent->midiData[2] * kMidiScaler; - - int32 index = 0; - IParamValueQueue* queue = mInputChanges.addParameterData (paramID, index); - if (queue) - { - queue->addPoint (midiEvent->deltaFrames, value, index); - } - mGuiTransfer.addChange (paramID, value, midiEvent->deltaFrames); - } - } - } - //--- ----------------------------- - else if (status == kPitchBendStatus) - { - if (mMidiCCMapping[channel]) - { - ParamID paramID = mMidiCCMapping[channel][Vst::kPitchBend]; - if (paramID != kNoParamId) - { - const double kPitchWheelScaler = 1. / (double)0x3FFF; - - const int32 ctrl = (midiEvent->midiData[1] & kDataMask) | - (midiEvent->midiData[2] & kDataMask) << 7; - ParamValue value = kPitchWheelScaler * (double)ctrl; - - int32 index = 0; - IParamValueQueue* queue = mInputChanges.addParameterData (paramID, index); - if (queue) - { - queue->addPoint (midiEvent->deltaFrames, value, index); - } - mGuiTransfer.addChange (paramID, value, midiEvent->deltaFrames); - } - } - } - //--- ----------------------------- - else if (status == kAfterTouchStatus) - { - if (mMidiCCMapping[channel]) - { - ParamID paramID = mMidiCCMapping[channel][Vst::kAfterTouch]; - if (paramID != kNoParamId) - { - ParamValue value = (ParamValue)(midiEvent->midiData[1] & kDataMask) * kMidiScaler; - - int32 index = 0; - IParamValueQueue* queue = mInputChanges.addParameterData (paramID, index); - if (queue) - { - queue->addPoint (midiEvent->deltaFrames, value, index); - } - mGuiTransfer.addChange (paramID, value, midiEvent->deltaFrames); - } - } - } - //--- ----------------------------- - else if (status == kProgramChangeStatus) - { - if (mProgramChangeParameterIDs[channel] != kNoParamId && - mProgramChangeParameterIdxs[channel] != -1) - { - ParameterInfo paramInfo = {0}; - if (mController->getParameterInfo (mProgramChangeParameterIdxs[channel], - paramInfo) == kResultTrue) - { - int32 program = midiEvent->midiData[1]; - if (paramInfo.stepCount > 0 && program <= paramInfo.stepCount) - { - ParamValue normalized = (ParamValue)program / (ParamValue)paramInfo.stepCount; - addParameterChange (mProgramChangeParameterIDs[channel], normalized, - midiEvent->deltaFrames); - } - } - } - } - } -} - -//------------------------------------------------------------------------ -VstInt32 Vst2Wrapper::processEvents (VstEvents* events) -{ - if (mInputEvents == 0) - return 0; - mInputEvents->clear (); - - for (int32 i = 0; i < events->numEvents; i++) - { - VstEvent* e = events->events[i]; - if (e->type == kVstMidiType) - { - VstMidiEvent* midiEvent = (VstMidiEvent*)e; - processMidiEvent (midiEvent, 0); - } - //--- ----------------------------- - else if (e->type == kVstSysExType) - { - Event toAdd = {0}; - VstMidiSysexEvent& src = *(VstMidiSysexEvent*)e; - toAdd.type = Event::kDataEvent; - toAdd.sampleOffset = e->deltaFrames; - toAdd.data.type = DataEvent::kMidiSysEx; - toAdd.data.size = src.dumpBytes; - toAdd.data.bytes = (uint8*)src.sysexDump; - mInputEvents->addEvent (toAdd); - } - } - - return 0; -} - -//------------------------------------------------------------------------------------------------------- -inline void Vst2Wrapper::processOutputEvents () -{ - if (mVst2OutputEvents && mOutputEvents && mOutputEvents->getEventCount () > 0) - { - mVst2OutputEvents->flush (); - - Event e = {0}; - for (int32 i = 0, total = mOutputEvents->getEventCount (); i < total; i++) - { - if (mOutputEvents->getEvent (i, e) != kResultOk) - break; - - //---SysExclusif---------------- - if (e.type == Event::kDataEvent && e.data.type == DataEvent::kMidiSysEx) - { - VstMidiSysexEvent sysexEvent = {0}; - sysexEvent.deltaFrames = e.sampleOffset; - sysexEvent.dumpBytes = e.data.size; - sysexEvent.sysexDump = (char*)e.data.bytes; - - if (!mVst2OutputEvents->add (sysexEvent)) - break; - } - else - { - VstMidiEvent midiEvent = {0}; - midiEvent.deltaFrames = e.sampleOffset; - if (e.flags & Event::kIsLive) - midiEvent.flags = kVstMidiEventIsRealtime; - char* midiData = midiEvent.midiData; - - switch (e.type) - { - //--- --------------------- - case Event::kNoteOnEvent: - midiData[0] = (char)(kNoteOn | (e.noteOn.channel & kChannelMask)); - midiData[1] = (char)(e.noteOn.pitch & kDataMask); - midiData[2] = - (char)((int32) (e.noteOn.velocity * 127.f + 0.4999999f) & kDataMask); - if (midiData[2] == 0) // zero velocity => note off - midiData[0] = (char)(kNoteOff | (e.noteOn.channel & kChannelMask)); - midiEvent.detune = (char)e.noteOn.tuning; - midiEvent.noteLength = e.noteOn.length; - break; - - //--- --------------------- - case Event::kNoteOffEvent: - midiData[0] = (char)(kNoteOff | (e.noteOff.channel & kChannelMask)); - midiData[1] = (char)(e.noteOff.pitch & kDataMask); - midiData[2] = midiEvent.noteOffVelocity = - (char)((int32) (e.noteOff.velocity * 127.f + 0.4999999f) & kDataMask); - break; - - break; - } - - if (!mVst2OutputEvents->add (midiEvent)) - break; - } - } - - mOutputEvents->clear (); - - sendVstEventsToHost (*mVst2OutputEvents); - } -} - -//------------------------------------------------------------------------------------------------------- -inline void Vst2Wrapper::setupProcessTimeInfo () -{ - VstTimeInfo* vst2timeInfo = getTimeInfo (0xffffffff); - if (vst2timeInfo) - { - const uint32 portableFlags = - ProcessContext::kPlaying | ProcessContext::kCycleActive | ProcessContext::kRecording | - ProcessContext::kSystemTimeValid | ProcessContext::kProjectTimeMusicValid | - ProcessContext::kBarPositionValid | ProcessContext::kCycleValid | - ProcessContext::kTempoValid | ProcessContext::kTimeSigValid | - ProcessContext::kSmpteValid | ProcessContext::kClockValid; - - mProcessContext.state = ((uint32)vst2timeInfo->flags) & portableFlags; - mProcessContext.sampleRate = vst2timeInfo->sampleRate; - mProcessContext.projectTimeSamples = (TSamples)vst2timeInfo->samplePos; - - if (mProcessContext.state & ProcessContext::kSystemTimeValid) - mProcessContext.systemTime = (TSamples)vst2timeInfo->nanoSeconds; - else - mProcessContext.systemTime = 0; - - if (mProcessContext.state & ProcessContext::kProjectTimeMusicValid) - mProcessContext.projectTimeMusic = vst2timeInfo->ppqPos; - else - mProcessContext.projectTimeMusic = 0; - - if (mProcessContext.state & ProcessContext::kBarPositionValid) - mProcessContext.barPositionMusic = vst2timeInfo->barStartPos; - else - mProcessContext.barPositionMusic = 0; - - if (mProcessContext.state & ProcessContext::kCycleValid) - { - mProcessContext.cycleStartMusic = vst2timeInfo->cycleStartPos; - mProcessContext.cycleEndMusic = vst2timeInfo->cycleEndPos; - } - else - mProcessContext.cycleStartMusic = mProcessContext.cycleEndMusic = 0.0; - - if (mProcessContext.state & ProcessContext::kTempoValid) - mProcessContext.tempo = vst2timeInfo->tempo; - else - mProcessContext.tempo = 120.0; - - if (mProcessContext.state & ProcessContext::kTimeSigValid) - { - mProcessContext.timeSigNumerator = vst2timeInfo->timeSigNumerator; - mProcessContext.timeSigDenominator = vst2timeInfo->timeSigDenominator; - } - else - mProcessContext.timeSigNumerator = mProcessContext.timeSigDenominator = 4; - - mProcessContext.frameRate.flags = 0; - if (mProcessContext.state & ProcessContext::kSmpteValid) - { - mProcessContext.smpteOffsetSubframes = vst2timeInfo->smpteOffset; - switch (vst2timeInfo->smpteFrameRate) - { - case kVstSmpte24fps: ///< 24 fps - mProcessContext.frameRate.framesPerSecond = 24; - break; - case kVstSmpte25fps: ///< 25 fps - mProcessContext.frameRate.framesPerSecond = 25; - break; - case kVstSmpte2997fps: ///< 29.97 fps - mProcessContext.frameRate.framesPerSecond = 30; - mProcessContext.frameRate.flags = FrameRate::kPullDownRate; - break; - case kVstSmpte30fps: ///< 30 fps - mProcessContext.frameRate.framesPerSecond = 30; - break; - case kVstSmpte2997dfps: ///< 29.97 drop - mProcessContext.frameRate.framesPerSecond = 30; - mProcessContext.frameRate.flags = - FrameRate::kPullDownRate | FrameRate::kDropRate; - break; - case kVstSmpte30dfps: ///< 30 drop - mProcessContext.frameRate.framesPerSecond = 30; - mProcessContext.frameRate.flags = FrameRate::kDropRate; - break; - case kVstSmpteFilm16mm: // not a smpte rate - case kVstSmpteFilm35mm: - mProcessContext.state &= ~ProcessContext::kSmpteValid; - break; - case kVstSmpte239fps: ///< 23.9 fps - mProcessContext.frameRate.framesPerSecond = 24; - mProcessContext.frameRate.flags = FrameRate::kPullDownRate; - break; - case kVstSmpte249fps: ///< 24.9 fps - mProcessContext.frameRate.framesPerSecond = 25; - mProcessContext.frameRate.flags = FrameRate::kPullDownRate; - break; - case kVstSmpte599fps: ///< 59.9 fps - mProcessContext.frameRate.framesPerSecond = 60; - mProcessContext.frameRate.flags = FrameRate::kPullDownRate; - break; - case kVstSmpte60fps: ///< 60 fps - mProcessContext.frameRate.framesPerSecond = 60; - break; - default: - mProcessContext.state &= ~ProcessContext::kSmpteValid; - break; - } - } - else - { - mProcessContext.smpteOffsetSubframes = 0; - mProcessContext.frameRate.framesPerSecond = 0; - } - - ///< MIDI Clock Resolution (24 Per Quarter Note), can be negative (nearest) - if (mProcessContext.state & ProcessContext::kClockValid) - mProcessContext.samplesToNextClock = vst2timeInfo->samplesToNextClock; - else - mProcessContext.samplesToNextClock = 0; - - mProcessData.processContext = &mProcessContext; - } - else - mProcessData.processContext = 0; -} - -//------------------------------------------------------------------------------------------------------- -template -inline void Vst2Wrapper::setProcessingBuffers (T** inputs, T** outputs) -{ - // set processing buffers - int32 sourceIndex = 0; - for (int32 i = 0; i < mProcessData.numInputs; i++) - { - AudioBusBuffers& buffers = mProcessData.inputs[i]; - if (mMainAudioInputBuses & (uint64 (1) << i)) - { - for (int32 j = 0; j < buffers.numChannels; j++) - { - buffers.channelBuffers32[j] = (Sample32*)inputs[sourceIndex++]; - } - } - else - buffers.silenceFlags = HostProcessData::kAllChannelsSilent; - } - - sourceIndex = 0; - for (int32 i = 0; i < mProcessData.numOutputs; i++) - { - AudioBusBuffers& buffers = mProcessData.outputs[i]; - buffers.silenceFlags = 0; - if (mMainAudioOutputBuses & (uint64 (1) << i)) - { - for (int32 j = 0; j < buffers.numChannels; j++) - { - buffers.channelBuffers32[j] = (Sample32*)outputs[sourceIndex++]; - } - } - } -} - -//------------------------------------------------------------------------------------------------------- -inline void Vst2Wrapper::setEventPPQPositions () -{ - if (!mInputEvents) - return; - - int32 eventCount = mInputEvents->getEventCount (); - if (eventCount > 0 && (mProcessContext.state & ProcessContext::kTempoValid) && - (mProcessContext.state & ProcessContext::kProjectTimeMusicValid)) - { - TQuarterNotes projectTimeMusic = mProcessContext.projectTimeMusic; - double secondsToQuarterNoteScaler = mProcessContext.tempo / 60.0; - double multiplicator = secondsToQuarterNoteScaler / this->sampleRate; - - for (int32 i = 0; i < eventCount; i++) - { - Event* e = mInputEvents->getEventByIndex (i); - if (e) - { - TQuarterNotes localTimeMusic = e->sampleOffset * multiplicator; - e->ppqPosition = projectTimeMusic + localTimeMusic; - } - } - } -} - -//-------------------------------------------------------------------------------------------------------------- -inline void Vst2Wrapper::doProcess (VstInt32 sampleFrames) -{ - if (!mProcessor) - return; - - mProcessData.numSamples = sampleFrames; - - if (processing == false) - startProcess (); - - mProcessData.inputEvents = mInputEvents; - mProcessData.outputEvents = mOutputEvents; - - setupProcessTimeInfo (); - setEventPPQPositions (); - - mInputTransfer.transferChangesTo (mInputChanges); - - mProcessData.inputParameterChanges = &mInputChanges; - mProcessData.outputParameterChanges = &mOutputChanges; - mOutputChanges.clearQueue (); - - // VST 3 process call - mProcessor->process (mProcessData); - - mOutputTransfer.transferChangesFrom (mOutputChanges); - processOutputEvents (); - - // clear input parameters and events - mInputChanges.clearQueue (); - if (mInputEvents) - mInputEvents->clear (); -} - -//-------------------------------------------------------------------------------------------------------------- -void Vst2Wrapper::processReplacing (float** inputs, float** outputs, VstInt32 sampleFrames) -{ - if (mProcessData.symbolicSampleSize != kSample32) - return; - - setProcessingBuffers (inputs, outputs); - doProcess (sampleFrames); -} - -//------------------------------------------------------------------------------------------------------- -void Vst2Wrapper::processDoubleReplacing (double** inputs, double** outputs, VstInt32 sampleFrames) -{ - if (mProcessData.symbolicSampleSize != kSample64) - return; - - setProcessingBuffers (inputs, outputs); - doProcess (sampleFrames); -} - -//------------------------------------------------------------------------------------------------------- -void Vst2Wrapper::onTimer (Timer*) -{ - if (!mController) - return; - - ParamID id; - ParamValue value; - int32 sampleOffset; - - while (mOutputTransfer.getNextChange (id, value, sampleOffset)) - { - mController->setParamNormalized (id, value); - } - while (mGuiTransfer.getNextChange (id, value, sampleOffset)) - { - mController->setParamNormalized (id, value); - } -} - -//------------------------------------------------------------------------------------------------------- -// static -//------------------------------------------------------------------------------------------------------- -AudioEffect* Vst2Wrapper::create (IPluginFactory* factory, const TUID vst3ComponentID, - VstInt32 vst2ID, audioMasterCallback audioMaster) -{ - if (!factory) - return 0; - - IAudioProcessor* processor = 0; - FReleaser factoryReleaser (factory); - - factory->createInstance (vst3ComponentID, IAudioProcessor::iid, (void**)&processor); - if (processor) - { - IEditController* controller = 0; - if (processor->queryInterface (IEditController::iid, (void**)&controller) != kResultTrue) - { - FUnknownPtr component (processor); - if (component) - { - FUID editorCID; - if (component->getControllerClassId (editorCID) == kResultTrue) - { - factory->createInstance (editorCID, IEditController::iid, (void**)&controller); - } - } - } - - Vst2Wrapper* wrapper = - new Vst2Wrapper (processor, controller, audioMaster, vst3ComponentID, vst2ID, factory); - if (wrapper->init () == false) - { - delete wrapper; - return 0; - } - - FUnknownPtr factory2 (factory); - if (factory2) - { - PFactoryInfo factoryInfo; - if (factory2->getFactoryInfo (&factoryInfo) == kResultTrue) - wrapper->setVendorName (factoryInfo.vendor); - - for (int32 i = 0; i < factory2->countClasses (); i++) - { - Steinberg::PClassInfo2 classInfo2; - if (factory2->getClassInfo2 (i, &classInfo2) == Steinberg::kResultTrue) - { - if (memcmp (classInfo2.cid, vst3ComponentID, sizeof (TUID)) == 0) - { - wrapper->setSubCategories (classInfo2.subCategories); - wrapper->setEffectName (classInfo2.name); - - if (classInfo2.vendor[0] != 0) - wrapper->setVendorName (classInfo2.vendor); - - break; - } - } - } - } - - return wrapper; - } - - return 0; -} - -// FUnknown -//------------------------------------------------------------------------------------------------------- -tresult PLUGIN_API Vst2Wrapper::queryInterface (const char* iid, void** obj) -{ - QUERY_INTERFACE (iid, obj, FUnknown::iid, Vst::IHostApplication) - QUERY_INTERFACE (iid, obj, Vst::IHostApplication::iid, Vst::IHostApplication) - QUERY_INTERFACE (iid, obj, Vst::IComponentHandler::iid, Vst::IComponentHandler) - QUERY_INTERFACE (iid, obj, Vst::IUnitHandler::iid, Vst::IUnitHandler) - - // we are a VST 3 to VST 2 Wrapper - QUERY_INTERFACE (iid, obj, Vst::IVst3ToVst2Wrapper::iid, Vst::IVst3ToVst2Wrapper) - - *obj = 0; - return kNoInterface; -} - -//------------------------------------------------------------------------------------------------------- -// IHostApplication -//------------------------------------------------------------------------------------------------------- -tresult PLUGIN_API Vst2Wrapper::createInstance (TUID cid, TUID iid, void** obj) -{ - FUID classID (cid); - FUID interfaceID (iid); - if (classID == IMessage::iid && interfaceID == IMessage::iid) - { - *obj = new HostMessage; - return kResultTrue; - } - else if (classID == IAttributeList::iid && interfaceID == IAttributeList::iid) - { - *obj = new HostAttributeList; - return kResultTrue; - } - *obj = 0; - return kResultFalse; -} - -//-------------------------------------------------------------------------------------------------------------- -tresult PLUGIN_API Vst2Wrapper::getName (String128 name) -{ - char8 productString[128]; - if (getHostProductString (productString)) - { - String str (productString); - str.copyTo16 (name, 0, 127); - - return kResultTrue; - } - return kResultFalse; -} - -//------------------------------------------------------------------------------------------------------- -// IComponentHandler -//------------------------------------------------------------------------------------------------------- -tresult PLUGIN_API Vst2Wrapper::beginEdit (ParamID tag) -{ - std::map::iterator iter = mParamIndexMap.find (tag); - if (iter != mParamIndexMap.end ()) - AudioEffectX::beginEdit ((*iter).second); - return kResultTrue; -} - -//------------------------------------------------------------------------------------------------------- -tresult PLUGIN_API Vst2Wrapper::performEdit (ParamID tag, ParamValue valueNormalized) -{ - std::map::iterator iter = mParamIndexMap.find (tag); - if (iter != mParamIndexMap.end () && audioMaster) - audioMaster (&cEffect, audioMasterAutomate, (*iter).second, 0, 0, - (float)valueNormalized); // value is in opt - - mInputTransfer.addChange (tag, valueNormalized, 0); - - return kResultTrue; -} - -//------------------------------------------------------------------------------------------------------- -tresult PLUGIN_API Vst2Wrapper::endEdit (ParamID tag) -{ - std::map::iterator iter = mParamIndexMap.find (tag); - if (iter != mParamIndexMap.end ()) - AudioEffectX::endEdit ((*iter).second); - return kResultTrue; -} - -//------------------------------------------------------------------------------------------------------- -tresult PLUGIN_API Vst2Wrapper::restartComponent (int32 flags) -{ - tresult result = kResultFalse; - - //--- ---------------------- - if (flags & kIoChanged) - { - setupBuses (); - ioChanged (); - result = kResultTrue; - } - - //--- ---------------------- - if ((flags & kParamValuesChanged) || (flags & kParamTitlesChanged)) - { - updateDisplay (); - result = kResultTrue; - } - - //--- ---------------------- - if (flags & kLatencyChanged) - { - if (mProcessor) - setInitialDelay (mProcessor->getLatencySamples ()); - - ioChanged (); - result = kResultTrue; - } - - //--- ---------------------- - if (flags & kMidiCCAssignmentChanged) - { - initMidiCtrlerAssignment (); - result = kResultTrue; - } - - // kReloadComponent is Not supported in VST 2 - - return result; -} - -//------------------------------------------------------------------------------------------------------- -// IUnitHandler -//------------------------------------------------------------------------------------------------------- -tresult PLUGIN_API Vst2Wrapper::notifyUnitSelection (UnitID unitId) -{ - return kResultTrue; -} - -//------------------------------------------------------------------------------------------------------- -tresult PLUGIN_API Vst2Wrapper::notifyProgramListChange (ProgramListID listId, int32 programIndex) -{ - // TODO -> redirect to hasMidiProgramsChanged somehow... - return kResultTrue; -} - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg - -extern bool InitModule (); - -//------------------------------------------------------------------------ -extern "C" { - -#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) -#define VST_EXPORT __attribute__ ((visibility ("default"))) -#else -#define VST_EXPORT -#endif - -//------------------------------------------------------------------------ -/** Prototype of the export function main */ -//------------------------------------------------------------------------ -VST_EXPORT AEffect* VSTPluginMain (audioMasterCallback audioMaster) -{ - // Get VST Version of the Host - if (!audioMaster (0, audioMasterVersion, 0, 0, 0, 0)) - return 0; // old version - - if (InitModule () == false) - return 0; - - // Create the AudioEffect - AudioEffect* effect = createEffectInstance (audioMaster); - if (!effect) - return 0; - - // Return the VST AEffect structure - return effect->getAeffect (); -} - -// support for old hosts not looking for VSTPluginMain -#if (TARGET_API_MAC_CARBON && __ppc__) -VST_EXPORT AEffect* main_macho (audioMasterCallback audioMaster) -{ - return VSTPluginMain (audioMaster); -} -#elif WIN32 -VST_EXPORT AEffect* MAIN (audioMasterCallback audioMaster) { return VSTPluginMain (audioMaster); } -#elif BEOS -VST_EXPORT AEffect* main_plugin (audioMasterCallback audioMaster) -{ - return VSTPluginMain (audioMaster); -} -#endif - -} // extern "C" - -/// \endcond diff --git a/vst/public.sdk/source/vst/vst2wrapper/vst2wrapper.h b/vst/public.sdk/source/vst/vst2wrapper/vst2wrapper.h deleted file mode 100644 index a8e2335b..00000000 --- a/vst/public.sdk/source/vst/vst2wrapper/vst2wrapper.h +++ /dev/null @@ -1,310 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/vst2wrapper/vst2wrapper.h -// Created by : Steinberg, 01/2009 -// Description : VST 3 -> VST 2 Wrapper -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -/** -************************************** -\page vst2xwrapper VST 2.x Wrapper -*************************** -\section VST2Introduction Introduction -*************************** -The VST 3 SDK comes with a helper class which wraps one VST 3 Audio Processor and Edit Controller to -a VST 2.x Plug-in. -\n\n -*************************** -\section VST2howdoesitwork How does it work ? -*************************** -You just need to add public.sdk/source/vst/vst2wrapper/vst2wrapper.sdk.cpp to your project and add -the following code somewhere in your sources: -\code - -#include "public.sdk/source/vst/vst2wrapper/vst2wrapper.h" - -//------------------------------------------------------------------------ -::AudioEffect* createEffectInstance (audioMasterCallback audioMaster) -{ - return Steinberg::Vst::Vst2Wrapper::create (GetPluginFactory (), kAudioProcessorCID, kVst2UniqueID, audioMaster); -} - -\endcode - */ -/// \cond ignore - -#pragma once - -#include "pluginterfaces/base/ftypes.h" -#include "public.sdk/source/vst2.x/audioeffectx.h" -#include "pluginterfaces/vst/ivstaudioprocessor.h" -#include "pluginterfaces/vst/ivsteditcontroller.h" -#include "pluginterfaces/vst/ivstunits.h" -#include "pluginterfaces/vst/ivsthostapplication.h" -#include "pluginterfaces/vst/ivstprocesscontext.h" - -#include "public.sdk/source/common/memorystream.h" -#include "public.sdk/source/vst/hosting/processdata.h" -#include "public.sdk/source/vst/hosting/parameterchanges.h" -#include "public.sdk/source/vst/hosting/eventlist.h" - -#include "base/source/fstring.h" -#include "base/source/timer.h" - -#include -#include - -//------------------------------------------------------------------------ -namespace Steinberg { -namespace Vst { - -class Vst2MidiEventQueue; - -//------------------------------------------------------------------------------------------------------- -class Vst2Wrapper : public ::AudioEffectX, - public IHostApplication, - public IComponentHandler, - public IUnitHandler, - public ITimerCallback, - public IVst3ToVst2Wrapper -{ -public: - //--- - //---------------------------------------------------------------------------------------------------- - // static creation method - static AudioEffect* create (IPluginFactory* factory, const TUID vst3ComponentID, - VstInt32 vst2ID, audioMasterCallback audioMaster); - - Vst2Wrapper (IAudioProcessor* processor, IEditController* controller, - audioMasterCallback audioMaster, const TUID vst3ComponentID, VstInt32 vst2ID, - IPluginFactory* factory = 0); - ~Vst2Wrapper (); - - bool init (); - - // AudioEffectX overrides ----------------------------------------------- - virtual void suspend (); // Called when Plug-in is switched to off - virtual void resume (); // Called when Plug-in is switched to on - virtual VstInt32 startProcess (); - virtual VstInt32 stopProcess (); - - virtual void setSampleRate (float newSamplerate); // Called when the sample rate changes (always in a suspend state) - virtual void setBlockSize (VstInt32 newBlockSize); // Called when the maximum block size changes - // (always in a suspend state). Note that the - // sampleFrames in Process Calls could be - // smaller than this block size, but NOT bigger. - - virtual float getParameter (VstInt32 index); - virtual void setParameter (VstInt32 index, float value); - - virtual void setProgram (VstInt32 program); - virtual void setProgramName (char* name); - virtual void getProgramName (char* name); - virtual bool getProgramNameIndexed (VstInt32 category, VstInt32 index, char* text); - - virtual void getParameterLabel (VstInt32 index, char* label); - virtual void getParameterDisplay (VstInt32 index, char* text); - virtual void getParameterName (VstInt32 index, char* text); - virtual bool canParameterBeAutomated (VstInt32 index); - virtual bool string2parameter (VstInt32 index, char* text); - virtual bool getParameterProperties (VstInt32 index, VstParameterProperties* p); - - virtual VstInt32 getChunk (void** data, bool isPreset = false); - virtual VstInt32 setChunk (void* data, VstInt32 byteSize, bool isPreset = false); - - virtual bool getInputProperties (VstInt32 index, VstPinProperties* properties); - virtual bool getOutputProperties (VstInt32 index, VstPinProperties* properties); - virtual bool setSpeakerArrangement (VstSpeakerArrangement* pluginInput, VstSpeakerArrangement* pluginOutput); - virtual bool getSpeakerArrangement (VstSpeakerArrangement** pluginInput, VstSpeakerArrangement** pluginOutput); - virtual bool setBypass (bool onOff); - - virtual bool setProcessPrecision (VstInt32 precision); - virtual VstInt32 getNumMidiInputChannels (); - virtual VstInt32 getNumMidiOutputChannels (); - virtual VstInt32 getGetTailSize (); - virtual bool getEffectName (char* name); - virtual bool getVendorString (char* text); - virtual VstIntPtr vendorSpecific (VstInt32 lArg, VstIntPtr lArg2, void* ptrArg, float floatArg); - virtual VstPlugCategory getPlugCategory (); - virtual VstInt32 canDo (char* text); - - virtual VstInt32 getMidiProgramName (VstInt32 channel, MidiProgramName* midiProgramName); - virtual VstInt32 getCurrentMidiProgram (VstInt32 channel, MidiProgramName* currentProgram); - virtual VstInt32 getMidiProgramCategory (VstInt32 channel, MidiProgramCategory* category); - virtual bool hasMidiProgramsChanged (VstInt32 channel); - virtual bool getMidiKeyName (VstInt32 channel, MidiKeyName* keyName); - - // finally process... - virtual void processReplacing (float** inputs, float** outputs, VstInt32 sampleFrames); - virtual void processDoubleReplacing (double** inputs, double** outputs, VstInt32 sampleFrames); - virtual VstInt32 processEvents (VstEvents* events); - - // VST 3 Interfaces ------------------------------------------------------ - // FUnknown - virtual tresult PLUGIN_API queryInterface (const char* iid, void** obj); - virtual uint32 PLUGIN_API addRef () { return 1; } - virtual uint32 PLUGIN_API release () { return 1; } - - // IHostApplication - virtual tresult PLUGIN_API getName (String128 name); - virtual tresult PLUGIN_API createInstance (TUID cid, TUID iid, void** obj); - - // IComponentHandler - virtual tresult PLUGIN_API beginEdit (ParamID tag); - virtual tresult PLUGIN_API performEdit (ParamID tag, ParamValue valueNormalized); - virtual tresult PLUGIN_API endEdit (ParamID tag); - virtual tresult PLUGIN_API restartComponent (int32 flags); - - // IUnitHandler - virtual tresult PLUGIN_API notifyUnitSelection (UnitID unitId); - virtual tresult PLUGIN_API notifyProgramListChange (ProgramListID listId, int32 programIndex); - - void setEffectName (char* name); - void setVendorName (char* name); - void setSubCategories (char* string); - - // ITimer - virtual void onTimer (Timer* timer); - -//------------------------------------------------------------------------------------------------------- -protected: - void setupBuses (); - void setupParameters (); - void initMidiCtrlerAssignment (); - void getUnitPath (UnitID unitID, String& path); - - int32 countMainBusChannels (BusDirection dir, uint64& mainBusBitset); - - template void setProcessingBuffers (T** inputs, T** outputs); - void setupProcessTimeInfo (); - void doProcess (VstInt32 sampleFrames); - void setEventPPQPositions (); - void processOutputEvents (); - void processMidiEvent (VstMidiEvent* midiEvent, int32 bus); - - /** Returns the last param change from guiTransfer queue. */ - bool getLastParamChange (ParamID id, ParamValue& value); - - bool setupProcessing (int32 processModeOverwrite = -1); - void addParameterChange (ParamID id, ParamValue value, int32 sampleOffset); - - bool getProgramListAndUnit (int32 midiChannel, UnitID& unitId, ProgramListID& programListId); - bool getProgramListInfoByProgramListID (ProgramListID programListId, ProgramListInfo& info); - int32 lookupProgramCategory (int32 midiChannel, String128 instrumentAttribute); - bool setupMidiProgram (int32 midiChannel, ProgramListID programListId, MidiProgramName& midiProgramName); - - bool getPinProperties (BusDirection dir, VstInt32 pinIndex, VstPinProperties* properties); - bool pinIndexToBusChannel (BusDirection dir, VstInt32 pinIndex, int32& busIndex, int32& busChannel); - static VstInt32 vst3ToVst2SpeakerArr (SpeakerArrangement vst3Arr); - static SpeakerArrangement vst2ToVst3SpeakerArr (VstInt32 vst2Arr); - static VstInt32 vst3ToVst2Speaker (Speaker vst3Speaker); - static void setupVst2Arrangement (VstSpeakerArrangement*& vst2arr, Vst::SpeakerArrangement vst3Arrangement); - - struct ProgramCategory - { - MidiProgramCategory vst2Category; - String128 vst3InstrumentAttribute; - }; - std::vector< std::vector > mProgramCategories; - void setupProgramCategories (); - static uint32 makeCategoriesRecursive (std::vector& channelCategories, String128 vst3Category); - - static const int32 kMaxProgramChangeParameters = 16; - ParamID mProgramChangeParameterIDs[kMaxProgramChangeParameters]; // for each midi channel - int32 mProgramChangeParameterIdxs[kMaxProgramChangeParameters]; // for each midi channel - - VstSpeakerArrangement* mVst2InputArrangement; - VstSpeakerArrangement* mVst2OutputArrangement; - - FUID mVst3EffectClassID; - - // vst3 data - IAudioProcessor* mProcessor; - IComponent* mComponent; - IEditController* mController; - IUnitInfo* mUnitInfo; - IMidiMapping* mMidiMapping; - - bool componentInitialized; - bool controllerInitialized; - bool componentsConnected; - bool processing; - bool hasEventInputBuses; - bool hasEventOutputBuses; - - int32 mVst3SampleSize; - int32 mVst3processMode; - - char mName[PClassInfo::kNameSize]; - char mVendor[PFactoryInfo::kNameSize]; - char mSubCategories[PClassInfo2::kSubCategoriesSize]; - - struct ParamMapEntry - { - ParamID vst3ID; - int32 vst3Index; - }; - - std::vector mParameterMap; - std::map mParamIndexMap; - ParamID mBypassParameterID; - ParamID mProgramParameterID; - int32 mProgramParameterIdx; - - HostProcessData mProcessData; - ProcessContext mProcessContext; - ParameterChanges mInputChanges; - ParameterChanges mOutputChanges; - EventList* mInputEvents; - EventList* mOutputEvents; - Vst2MidiEventQueue* mVst2OutputEvents; - uint64 mMainAudioInputBuses; - uint64 mMainAudioOutputBuses; - - ParameterChangeTransfer mInputTransfer; - ParameterChangeTransfer mOutputTransfer; - ParameterChangeTransfer mGuiTransfer; - - MemoryStream mChunk; - - Timer* mTimer; - IPluginFactory* mFactory; - - int32* mMidiCCMapping[16]; -}; - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg - -/** Must be implemented externally. */ -extern ::AudioEffect* createEffectInstance (audioMasterCallback audioMaster); - -/// \endcond diff --git a/vst/public.sdk/source/vst/vst2wrapper/vst2wrapper.sdk.cpp b/vst/public.sdk/source/vst/vst2wrapper/vst2wrapper.sdk.cpp deleted file mode 100644 index a101d2f9..00000000 --- a/vst/public.sdk/source/vst/vst2wrapper/vst2wrapper.sdk.cpp +++ /dev/null @@ -1,45 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/vst2wrapper/vst2wrapper.sdk.cpp -// Created by : Steinberg, 01/2009 -// Description : VST 3 -> VST 2 Wrapper -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#include "public.sdk/source/vst/vst2wrapper/vst2wrapper.cpp" - -#include "public.sdk/source/vst/hosting/processdata.cpp" -#include "public.sdk/source/vst/hosting/eventlist.cpp" -#include "public.sdk/source/vst/hosting/hostclasses.cpp" -#include "public.sdk/source/vst/hosting/parameterchanges.cpp" - -#include "public.sdk/source/common/memorystream.cpp" - -#include "public.sdk/source/vst2.x/audioeffectx.cpp" -#include "public.sdk/source/vst2.x/audioeffect.cpp" diff --git a/vst/public.sdk/source/vst/vst2wrapper/win/vst2wrapper.vcxproj b/vst/public.sdk/source/vst/vst2wrapper/win/vst2wrapper.vcxproj deleted file mode 100644 index a0f9e379..00000000 --- a/vst/public.sdk/source/vst/vst2wrapper/win/vst2wrapper.vcxproj +++ /dev/null @@ -1,171 +0,0 @@ -ïŧŋ - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - vst2wrapper - {1C43CEEE-6B1C-42D3-9BCB-389991B71767} - vst2wrapper - Win32Proj - - - - StaticLibrary - MultiByte - true - v120 - - - StaticLibrary - MultiByte - v120 - - - StaticLibrary - MultiByte - true - v120 - - - StaticLibrary - MultiByte - v120 - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - - - - Disabled - ../../../../..;%(AdditionalIncludeDirectories) - WINDOWS=1;DEVELOPMENT=1;_CRT_SECURE_NO_DEPRECATE=1;%(PreprocessorDefinitions) - false - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - false - - - - - ../../../../..;%(AdditionalIncludeDirectories) - WINDOWS=1;RELEASE=1;_CRT_SECURE_NO_DEPRECATE=1;%(PreprocessorDefinitions) - MultiThreaded - - - Level3 - ProgramDatabase - - - - - X64 - - - Disabled - ../../../../..;%(AdditionalIncludeDirectories) - WINDOWS=1;DEVELOPMENT=1;_CRT_SECURE_NO_DEPRECATE=1;%(PreprocessorDefinitions) - false - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - false - - - - - X64 - - - ../../../../..;%(AdditionalIncludeDirectories) - WINDOWS=1;RELEASE=1;_CRT_SECURE_NO_DEPRECATE=1;%(PreprocessorDefinitions) - MultiThreaded - - - Level3 - ProgramDatabase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {6f060ef8-07be-4944-a28b-9a9d8ae7af0e} - - - - - - \ No newline at end of file diff --git a/vst/public.sdk/source/vst/vst2wrapper/win/vst2wrapper_vc10.vcxproj b/vst/public.sdk/source/vst/vst2wrapper/win/vst2wrapper_vc10.vcxproj deleted file mode 100644 index 62704bf5..00000000 --- a/vst/public.sdk/source/vst/vst2wrapper/win/vst2wrapper_vc10.vcxproj +++ /dev/null @@ -1,168 +0,0 @@ -ïŧŋ - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - vst2wrapper - {1C43CEEE-6B1C-42D3-9BCB-389991B71767} - vst2wrapper - Win32Proj - - - - StaticLibrary - MultiByte - true - - - StaticLibrary - MultiByte - - - StaticLibrary - MultiByte - true - - - StaticLibrary - MultiByte - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - $(Platform)\$(Configuration)\ - - - - Disabled - ../../../../..;%(AdditionalIncludeDirectories) - WINDOWS=1;DEVELOPMENT=1;_CRT_SECURE_NO_DEPRECATE=1;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - Level3 - EditAndContinue - - - false - - - - - ../../../../..;%(AdditionalIncludeDirectories) - WINDOWS=1;RELEASE=1;_CRT_SECURE_NO_DEPRECATE=1;%(PreprocessorDefinitions) - MultiThreaded - - - Level3 - ProgramDatabase - - - - - X64 - - - Disabled - ../../../../..;%(AdditionalIncludeDirectories) - WINDOWS=1;DEVELOPMENT=1;_CRT_SECURE_NO_DEPRECATE=1;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - - - Level3 - ProgramDatabase - - - false - - - - - X64 - - - ../../../../..;%(AdditionalIncludeDirectories) - WINDOWS=1;RELEASE=1;_CRT_SECURE_NO_DEPRECATE=1;%(PreprocessorDefinitions) - MultiThreaded - - - Level3 - ProgramDatabase - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5755cc40-c699-491b-bd7c-5d841c26c28d} - false - - - - - - \ No newline at end of file diff --git a/vst/public.sdk/source/vst/vst2wrapper/win/vst2wrapper_vc8.vcproj b/vst/public.sdk/source/vst/vst2wrapper/win/vst2wrapper_vc8.vcproj deleted file mode 100644 index 46fdd955..00000000 --- a/vst/public.sdk/source/vst/vst2wrapper/win/vst2wrapper_vc8.vcproj +++ /dev/null @@ -1,382 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vst/public.sdk/source/vst/vst2wrapper/win/vst2wrapper_vc9.vcproj b/vst/public.sdk/source/vst/vst2wrapper/win/vst2wrapper_vc9.vcproj deleted file mode 100644 index 3c057fc4..00000000 --- a/vst/public.sdk/source/vst/vst2wrapper/win/vst2wrapper_vc9.vcproj +++ /dev/null @@ -1,385 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vst/public.sdk/source/vst/vstaudioeffect.cpp b/vst/public.sdk/source/vst/vstaudioeffect.cpp deleted file mode 100644 index ce43f252..00000000 --- a/vst/public.sdk/source/vst/vstaudioeffect.cpp +++ /dev/null @@ -1,180 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/vstaudioeffect.cpp -// Created by : Steinberg, 04/2005 -// Description : Basic Audio Effect Implementation -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#include "vstaudioeffect.h" - -namespace Steinberg { -namespace Vst { - - -//------------------------------------------------------------------------ -// AudioEffect -//------------------------------------------------------------------------ -AudioEffect::AudioEffect () -{ - processSetup.maxSamplesPerBlock = 1024; - processSetup.processMode = Vst::kRealtime; - processSetup.sampleRate = 44100.0; - processSetup.symbolicSampleSize = Vst::kSample32; -} - -//------------------------------------------------------------------------ -AudioBus* AudioEffect::addAudioInput (const TChar* name, SpeakerArrangement arr, - BusType busType, int32 flags) -{ - AudioBus* newBus = new AudioBus (name, busType, flags, arr); - audioInputs.append (IPtr (newBus, false)); - return newBus; -} - -//------------------------------------------------------------------------ -AudioBus* AudioEffect::addAudioOutput (const TChar* name, SpeakerArrangement arr, - BusType busType, int32 flags) -{ - AudioBus* newBus = new AudioBus (name, busType, flags, arr); - audioOutputs.append (IPtr (newBus, false)); - return newBus; -} - -//------------------------------------------------------------------------ -AudioBus* AudioEffect::getAudioInput (int32 index) -{ - AudioBus* bus = FCast (audioInputs.at (index)); - return bus; -} - -//------------------------------------------------------------------------ -AudioBus* AudioEffect::getAudioOutput (int32 index) -{ - AudioBus* bus = FCast (audioOutputs.at (index)); - return bus; -} - -//------------------------------------------------------------------------ -EventBus* AudioEffect::addEventInput (const TChar* name, int32 channels, - BusType busType, int32 flags) -{ - EventBus* newBus = new EventBus (name, busType, flags, channels); - eventInputs.append (IPtr (newBus, false)); - return newBus; -} - -//------------------------------------------------------------------------ -EventBus* AudioEffect::addEventOutput (const TChar* name, int32 channels, - BusType busType, int32 flags) -{ - EventBus* newBus = new EventBus (name, busType, flags, channels); - eventOutputs.append (IPtr (newBus, false)); - return newBus; -} - -//------------------------------------------------------------------------ -EventBus* AudioEffect::getEventInput (int32 index) -{ - EventBus* bus = FCast (eventInputs.at (index)); - return bus; -} - -//------------------------------------------------------------------------ -EventBus* AudioEffect::getEventOutput (int32 index) -{ - EventBus* bus = FCast (eventOutputs.at (index)); - return bus; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API AudioEffect::setBusArrangements (SpeakerArrangement* inputs, int32 numIns, - SpeakerArrangement* outputs, int32 numOuts) -{ - int32 counter = 0; - FOREACH_CAST (IPtr, Vst::AudioBus, bus, audioInputs) - if (counter < numIns) - bus->setArrangement (inputs[counter]); - counter++; - ENDFOR - - counter = 0; - FOREACH_CAST (IPtr, Vst::AudioBus, bus, audioOutputs) - if (counter < numOuts) - bus->setArrangement (outputs[counter]); - counter++; - ENDFOR - - return kResultTrue; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API AudioEffect::getBusArrangement (BusDirection dir, int32 busIndex, SpeakerArrangement& arr) -{ - BusList* busList = getBusList (kAudio, dir); - AudioBus* audioBus = busList ? FCast (busList->at (busIndex)) : 0; - if (audioBus) - { - arr = audioBus->getArrangement (); - return kResultTrue; - } - return kResultFalse; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API AudioEffect::setupProcessing (ProcessSetup& newSetup) -{ - if (canProcessSampleSize (newSetup.symbolicSampleSize) != kResultTrue) - return kResultFalse; - - processSetup = newSetup; - return kResultOk; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API AudioEffect::setProcessing (TBool /*state*/) -{ - return kNotImplemented; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API AudioEffect::canProcessSampleSize (int32 symbolicSampleSize) -{ - return symbolicSampleSize == kSample32 ? kResultTrue : kResultFalse; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API AudioEffect::process (ProcessData& /*data*/) -{ - return kNotImplemented; -} - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg diff --git a/vst/public.sdk/source/vst/vstaudioeffect.h b/vst/public.sdk/source/vst/vstaudioeffect.h deleted file mode 100644 index 0cd4042a..00000000 --- a/vst/public.sdk/source/vst/vstaudioeffect.h +++ /dev/null @@ -1,112 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/vstaudioeffect.h -// Created by : Steinberg, 04/2005 -// Description : Basic Audio Effect Implementation -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#pragma once - -#include "public.sdk/source/vst/vstcomponent.h" -#include "public.sdk/source/vst/vstbus.h" -#include "pluginterfaces/vst/ivstaudioprocessor.h" - -//------------------------------------------------------------------------ -namespace Steinberg { -namespace Vst { - - -//------------------------------------------------------------------------ -/** Default implementation for a VST 3 audio effect. -\ingroup vstClasses -Can be used as base class for a VST 3 effect implementation. */ -//------------------------------------------------------------------------ -class AudioEffect: public Component, - public IAudioProcessor -{ -public: -//------------------------------------------------------------------------ - /** Constructor */ - AudioEffect (); - - //---Internal Methods----------- - /** Creates and adds a new Audio input bus with a given speaker arrangement, busType (kMain or kAux). */ - AudioBus* addAudioInput (const TChar* name, SpeakerArrangement arr, - BusType busType = kMain, int32 flags = BusInfo::kDefaultActive); - - /** Creates and adds a new Audio output bus with a given speaker arrangement, busType (kMain or kAux). */ - AudioBus* addAudioOutput (const TChar* name, SpeakerArrangement arr, - BusType busType = kMain, int32 flags = BusInfo::kDefaultActive); - - /** Retrieves an Audio Input Bus by index. */ - AudioBus* getAudioInput (int32 index); - - /** Retrieves an Audio Output Bus by index. */ - AudioBus* getAudioOutput (int32 index); - - /** Creates and adds a new Event input bus with a given speaker arrangement, busType (kMain or kAux). */ - EventBus* addEventInput (const TChar* name, int32 channels = 16, - BusType busType = kMain, int32 flags = BusInfo::kDefaultActive); - - /** Creates and adds a new Event output bus with a given speaker arrangement, busType (kMain or kAux). */ - EventBus* addEventOutput (const TChar* name, int32 channels = 16, - BusType busType = kMain, int32 flags = BusInfo::kDefaultActive); - - /** Retrieves an Event Input Bus by index. */ - EventBus* getEventInput (int32 index); - - /** Retrieves an Event Output Bus by index. */ - EventBus* getEventOutput (int32 index); - - //---from IAudioProcessor------- - tresult PLUGIN_API setBusArrangements (SpeakerArrangement* inputs, int32 numIns, SpeakerArrangement* outputs, int32 numOuts); - tresult PLUGIN_API getBusArrangement (BusDirection dir, int32 busIndex, SpeakerArrangement& arr); - tresult PLUGIN_API canProcessSampleSize (int32 symbolicSampleSize); - uint32 PLUGIN_API getLatencySamples () { return 0; } - tresult PLUGIN_API setupProcessing (ProcessSetup& setup); - tresult PLUGIN_API setProcessing (TBool state); - tresult PLUGIN_API process (ProcessData& data); - uint32 PLUGIN_API getTailSamples () { return kNoTail; } - - //---Interface--------- - OBJ_METHODS (AudioEffect, Component) - DEFINE_INTERFACES - DEF_INTERFACE (IAudioProcessor) - END_DEFINE_INTERFACES (Component) - REFCOUNT_METHODS(Component) - -//------------------------------------------------------------------------ -protected: - ProcessSetup processSetup; -}; - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg diff --git a/vst/public.sdk/source/vst/vstbus.cpp b/vst/public.sdk/source/vst/vstbus.cpp deleted file mode 100644 index 299cce55..00000000 --- a/vst/public.sdk/source/vst/vstbus.cpp +++ /dev/null @@ -1,102 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/vstbus.cpp -// Created by : Steinberg, 03/2008 -// Description : VST Bus Implementation -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#include "vstbus.h" - -namespace Steinberg { -namespace Vst { - -//------------------------------------------------------------------------ -// Bus Implementation -//------------------------------------------------------------------------ -Bus::Bus (const TChar* _name, BusType _busType, int32 _flags) -: busType (_busType) -, name (_name) -, flags (_flags) -, active (false) -{} - -//------------------------------------------------------------------------ -bool Bus::getInfo (BusInfo& info) -{ - name.copyTo16 (info.name, 0, str16BufferSize (info.name) - 1); - info.busType = busType; - info.flags = flags; - return true; -} - - -//------------------------------------------------------------------------ -// EventBus Implementation -//------------------------------------------------------------------------ -EventBus::EventBus (const TChar* name, BusType busType, int32 flags, int32 channelCount) -: Bus (name, busType, flags) -, channelCount (channelCount) -{} - -//------------------------------------------------------------------------ -bool EventBus::getInfo (BusInfo& info) -{ - info.channelCount = channelCount; - return Bus::getInfo (info); -} - - -//------------------------------------------------------------------------ -// AudioBus Implementation -//------------------------------------------------------------------------ -AudioBus::AudioBus (const TChar* name, BusType busType, int32 flags, SpeakerArrangement arr) -: Bus (name, busType, flags) -, speakerArr (arr) -{} - -//------------------------------------------------------------------------ -bool AudioBus::getInfo (BusInfo& info) -{ - info.channelCount = SpeakerArr::getChannelCount (speakerArr); - return Bus::getInfo (info); -} - - -//------------------------------------------------------------------------ -// BusList Implementation -//------------------------------------------------------------------------ -BusList::BusList (MediaType type, BusDirection dir) -: type (type) -, direction (dir) -{} - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg diff --git a/vst/public.sdk/source/vst/vstbus.h b/vst/public.sdk/source/vst/vstbus.h deleted file mode 100644 index 681e496e..00000000 --- a/vst/public.sdk/source/vst/vstbus.h +++ /dev/null @@ -1,161 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/vstbus.h -// Created by : Steinberg, 03/2008 -// Description : VST Bus Implementation -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#pragma once - -#include "base/source/fobject.h" -#include "base/source/fcontainer.h" -#include "base/source/fstring.h" -#include "pluginterfaces/vst/ivstcomponent.h" -#include "pluginterfaces/vst/ivstaudioprocessor.h" - -//------------------------------------------------------------------------ -namespace Steinberg { -namespace Vst { - -//------------------------------------------------------------------------ -/** Basic Bus object. -\ingroup vstClasses */ -//------------------------------------------------------------------------ -class Bus: public FObject -{ -public: -//------------------------------------------------------------------------ - /** Constructor. */ - Bus (const TChar* name, BusType busType, int32 flags); - - /** Returns true if the bus is active. */ - TBool isActive () const { return active; } - - /** Activates the bus. */ - void setActive (TBool state) { active = state; } - - /** Sets a new name for this bus. */ - void setName (String newName) { name = newName; } - - /** Sets a new busType for this bus. */ - void setBusType (BusType newBusType) { busType = newBusType; } - - /** Sets a new flags for this bus. */ - void setFlags (uint32 newFlags) { flags = newFlags; } - - /** Gets the BusInfo of this bus. */ - virtual bool getInfo (BusInfo&); - - OBJ_METHODS (Vst::Bus, FObject) -//------------------------------------------------------------------------ -protected: - String name; ///< name - BusType busType; ///< kMain or kAux, see \ref BusTypes - int32 flags; ///< flags, see \ref BusFlags - TBool active; ///< activation state -}; - -//------------------------------------------------------------------------ -/** Description of an Event Bus. -\ingroup vstClasses */ -//------------------------------------------------------------------------ -class EventBus: public Bus -{ -public: -//------------------------------------------------------------------------ - /** Constructor of an EventBus. */ - EventBus (const TChar* name, BusType busType, int32 flags, int32 channelCount); - - //---from Bus------- - /** Gets the BusInfo associated to this Event bus. */ - virtual bool getInfo (BusInfo& info); - - OBJ_METHODS (Vst::EventBus, Vst::Bus); - -//------------------------------------------------------------------------ -protected: - int32 channelCount; -}; - -//------------------------------------------------------------------------ -/** Description of an Audio Bus. -\ingroup vstClasses */ -//------------------------------------------------------------------------ -class AudioBus: public Bus -{ -public: -//------------------------------------------------------------------------ - AudioBus (const TChar* name, BusType busType, int32 flags, SpeakerArrangement arr); - - /** Gets the speaker arrangement defining this Audio bus. */ - SpeakerArrangement getArrangement () const { return speakerArr; } - - /** Sets the speaker arrangement defining this Audio bus. */ - void setArrangement (const SpeakerArrangement& arr) { speakerArr = arr; } - - //---from Bus--------------------- - /** Gets the BusInfo associated to this Audio bus. */ - virtual bool getInfo (BusInfo& info); - - OBJ_METHODS (Vst::AudioBus, Vst::Bus) - -//------------------------------------------------------------------------ -protected: - SpeakerArrangement speakerArr; -}; - -//------------------------------------------------------------------------ -/** List of Buses. -\ingroup vstClasses */ -//------------------------------------------------------------------------ -class BusList: public FObject, public TLinkedList > -{ -public: -//------------------------------------------------------------------------ - /** Constructor. */ - BusList (MediaType type, BusDirection dir); - - /** Returns the BusList Type. See \ref MediaType */ - MediaType getType () const { return type; } - - /** Returns the BusList direction. See \ref BusDirection */ - BusDirection getDirection () const { return direction; } - - OBJ_METHODS (Vst::BusList, FObject); - -//------------------------------------------------------------------------ -protected: - MediaType type; - BusDirection direction; -}; - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg diff --git a/vst/public.sdk/source/vst/vstcomponent.cpp b/vst/public.sdk/source/vst/vstcomponent.cpp deleted file mode 100644 index 1a016330..00000000 --- a/vst/public.sdk/source/vst/vstcomponent.cpp +++ /dev/null @@ -1,202 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/vstcomponent.cpp -// Created by : Steinberg, 04/2005 -// Description : Basic VST Plug-in Implementation -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#include "vstcomponent.h" - -namespace Steinberg { -namespace Vst { - - -//------------------------------------------------------------------------ -// Component Implementation -//------------------------------------------------------------------------ -Component::Component () -: audioInputs (kAudio, kInput) -, audioOutputs (kAudio, kOutput) -, eventInputs (kEvent, kInput) -, eventOutputs (kEvent, kOutput) -{} - -//------------------------------------------------------------------------ -tresult PLUGIN_API Component::initialize (FUnknown* context) -{ - return ComponentBase::initialize (context); -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API Component::terminate () -{ - // remove all buses - removeAllBusses (); - - return ComponentBase::terminate (); -} - -//------------------------------------------------------------------------ -BusList* Component::getBusList (MediaType type, BusDirection dir) -{ - if (type == kAudio) - return dir == kInput ? &audioInputs : &audioOutputs; - else if (type == kEvent) - return dir == kInput ? &eventInputs : &eventOutputs; - return 0; -} - -//------------------------------------------------------------------------ -tresult Component::removeAudioBusses () -{ - audioInputs.removeAll (); - audioOutputs.removeAll (); - - return kResultOk; -} - -//------------------------------------------------------------------------ -tresult Component::removeEventBusses () -{ - eventInputs.removeAll (); - eventOutputs.removeAll (); - - return kResultOk; -} - -//------------------------------------------------------------------------ -tresult Component::removeAllBusses () -{ - removeAudioBusses (); - removeEventBusses (); - - return kResultOk; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API Component::getControllerClassId (TUID classID) -{ - if (controllerClass.isValid ()) - { - controllerClass.toTUID (classID); - return kResultTrue; - } - return kResultFalse; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API Component::setIoMode (IoMode /*mode*/) -{ - return kNotImplemented; -} - -//------------------------------------------------------------------------ -int32 PLUGIN_API Component::getBusCount (MediaType type, BusDirection dir) -{ - BusList* busList = getBusList (type, dir); - return busList ? busList->total () : 0; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API Component::getBusInfo (MediaType type, BusDirection dir, int32 index, BusInfo& info) -{ - BusList* busList = getBusList (type, dir); - Bus* bus = busList ? busList->at (index) : 0; - if (bus) - { - info.mediaType = type; - info.direction = dir; - if (bus->getInfo (info)) - return kResultTrue; - } - return kResultFalse; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API Component::getRoutingInfo (RoutingInfo& /*inInfo*/, RoutingInfo& /*outInfo*/) -{ - return kNotImplemented; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API Component::activateBus (MediaType type, BusDirection dir, int32 index, TBool state) -{ - BusList* busList = getBusList (type, dir); - Bus* bus = busList ? busList->at (index) : 0; - if (bus) - { - bus->setActive (state); - return kResultTrue; - } - return kResultFalse; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API Component::setActive (TBool /*state*/) -{ - return kResultOk; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API Component::setState (IBStream* /*state*/) -{ - return kNotImplemented; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API Component::getState (IBStream* /*state*/) -{ - return kNotImplemented; -} - -//------------------------------------------------------------------------ -tresult Component::renameBus (MediaType type, BusDirection dir, int32 index, const String128 newName) -{ - BusList* busList = getBusList (type, dir); - Bus* bus = busList ? busList->at (index) : 0; - if (bus) - { - bus->setName (newName); - return kResultTrue; - } - return kResultFalse; -} - - -//------------------------------------------------------------------------ -// Helpers Implementation -//------------------------------------------------------------------------ -tresult getSpeakerChannelIndex (SpeakerArrangement arrangement, uint64 speaker, int32& channel) -{ - channel = SpeakerArr::getSpeakerIndex (speaker, arrangement); - return channel < 0 ? kResultFalse : kResultTrue; -} -} // namespace Vst -} // namespace Steinberg diff --git a/vst/public.sdk/source/vst/vstcomponent.h b/vst/public.sdk/source/vst/vstcomponent.h deleted file mode 100644 index 4dc27d86..00000000 --- a/vst/public.sdk/source/vst/vstcomponent.h +++ /dev/null @@ -1,116 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/vstcomponent.h -// Created by : Steinberg, 04/2005 -// Description : Basic VST Plug-in Implementation -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#pragma once - -#include "public.sdk/source/vst/vstcomponentbase.h" -#include "public.sdk/source/vst/vstbus.h" -#include "pluginterfaces/vst/ivstcomponent.h" - -//------------------------------------------------------------------------ -namespace Steinberg { -namespace Vst { - - -//------------------------------------------------------------------------ -/** Default implementation for a VST 3 Component. -\ingroup vstClasses -Can be used as base class for a VST 3 component implementation. */ -//------------------------------------------------------------------------ -class Component: public ComponentBase, - public IComponent -{ -public: -//------------------------------------------------------------------------ - /** Constructor */ - Component (); - - //---Internal Methods------- - /** Sets the controller Class ID associated to its component. */ - void setControllerClass (const FUID& cid) { controllerClass = cid; } - - /** Removes all Audio Buses. */ - tresult removeAudioBusses (); - - /** Removes all Event Buses. */ - tresult removeEventBusses (); - - /** Renames a specific bus. Do not forget to inform the host about this (see \ref IComponentHandler::restartComponent (kIoTitlesChanged)). */ - tresult renameBus (MediaType type, BusDirection dir, int32 index, const String128 newName); - - //---from IComponent-------- - tresult PLUGIN_API getControllerClassId (TUID classID); - tresult PLUGIN_API setIoMode (IoMode mode); - int32 PLUGIN_API getBusCount (MediaType type, BusDirection dir); - tresult PLUGIN_API getBusInfo (MediaType type, BusDirection dir, int32 index, BusInfo& info); - tresult PLUGIN_API getRoutingInfo (RoutingInfo& inInfo, RoutingInfo& outInfo); - tresult PLUGIN_API activateBus (MediaType type, BusDirection dir, int32 index, TBool state); - tresult PLUGIN_API setActive (TBool state); - tresult PLUGIN_API setState (IBStream* state); - tresult PLUGIN_API getState (IBStream* state); - - //---from ComponentBase------ - tresult PLUGIN_API initialize (FUnknown* context); - tresult PLUGIN_API terminate (); - - //---Interface--------- - OBJ_METHODS (Component, ComponentBase) - DEFINE_INTERFACES - DEF_INTERFACE (IComponent) - END_DEFINE_INTERFACES (ComponentBase) - REFCOUNT_METHODS(ComponentBase) - -//------------------------------------------------------------------------ -protected: - FUID controllerClass; - BusList audioInputs; - BusList audioOutputs; - BusList eventInputs; - BusList eventOutputs; - - BusList* getBusList (MediaType type, BusDirection dir); - tresult removeAllBusses (); -}; - - -//------------------------------------------------------------------------ -// some Helper functions.... -//------------------------------------------------------------------------ - -/** Gets the channel index of a given speaker in a arrangement, returns kResultFalse if speaker not part of the arrangement else returns kResultTrue. */ -tresult getSpeakerChannelIndex (SpeakerArrangement arrangement, uint64 speaker, int32& channel); - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg diff --git a/vst/public.sdk/source/vst/vstcomponentbase.cpp b/vst/public.sdk/source/vst/vstcomponentbase.cpp deleted file mode 100644 index 53cf4299..00000000 --- a/vst/public.sdk/source/vst/vstcomponentbase.cpp +++ /dev/null @@ -1,176 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/vstcomponentbase.cpp -// Created by : Steinberg, 05/2005 -// Description : Base class for VST Component and Edit Controller -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#include "vstcomponentbase.h" -#include "base/source/fstring.h" - -namespace Steinberg { -namespace Vst { - -//------------------------------------------------------------------------ -// ComponentBase Implementation -//------------------------------------------------------------------------ -ComponentBase::ComponentBase () -: hostContext (0) -, peerConnection (0) -{} - -//------------------------------------------------------------------------ -ComponentBase::~ComponentBase () -{} - -//------------------------------------------------------------------------ -tresult PLUGIN_API ComponentBase::initialize (FUnknown* context) -{ - // check if already initialized - if (hostContext) - return kResultFalse; - - hostContext = context; - if (hostContext) - hostContext->addRef (); - - return kResultOk; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API ComponentBase::terminate () -{ - // release host interfaces - if (hostContext) - { - hostContext->release (); - hostContext = 0; - } - - // in case host did not disconnect us, - // release peer now - if (peerConnection) - { - peerConnection->disconnect (this); - peerConnection->release (); - peerConnection = 0; - } - - return kResultOk; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API ComponentBase::connect (IConnectionPoint* other) -{ - if (!other) - return kInvalidArgument; - - // check if already connected - if (peerConnection) - return kResultFalse; - - peerConnection = other; - peerConnection->addRef (); - return kResultOk; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API ComponentBase::disconnect (IConnectionPoint* other) -{ - if (peerConnection && other == peerConnection) - { - peerConnection->release (), - peerConnection = 0; - return kResultOk; - } - return kResultFalse; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API ComponentBase::notify (IMessage* message) -{ - if (!message) - return kInvalidArgument; - - if (!strcmp (message->getMessageID (), "TextMessage")) - { - TChar string[256] = {0}; - if (message->getAttributes ()->getString ("Text", string, sizeof (string) / sizeof (char16)) == kResultOk) - { - char8 cstr[256]; - String tmp (string); - tmp.toMultiByte (kCP_US_ASCII); - tmp.copyTo8 (cstr, 0, 255); - return receiveText (cstr); - } - } - - return kResultFalse; -} - -//------------------------------------------------------------------------ -IMessage* ComponentBase::allocateMessage () -{ - FUnknownPtr hostApp (hostContext); - if (hostApp) - return Vst::allocateMessage (hostApp); - return 0; -} - -//------------------------------------------------------------------------ -tresult ComponentBase::sendMessage (IMessage* message) -{ - if (message != 0 && getPeer () != 0) - return getPeer ()->notify (message); - return kResultFalse; -} - -//------------------------------------------------------------------------ -tresult ComponentBase::sendTextMessage (const char8* text) -{ - IMessage* message = allocateMessage (); - if (!message) - return kResultFalse; - - FReleaser msgReleaser (message); - message->setMessageID ("TextMessage"); - message->getAttributes ()->setString ("Text", String (text, kCP_US_ASCII)); - return sendMessage (message); -} - -//------------------------------------------------------------------------ -tresult ComponentBase::receiveText (const char8* /*text*/) -{ - return kResultOk; -} - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg diff --git a/vst/public.sdk/source/vst/vstcomponentbase.h b/vst/public.sdk/source/vst/vstcomponentbase.h deleted file mode 100644 index be2c7986..00000000 --- a/vst/public.sdk/source/vst/vstcomponentbase.h +++ /dev/null @@ -1,103 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/vstcomponentbase.h -// Created by : Steinberg, 05/2005 -// Description : Base class for Component and Edit Controller -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#pragma once - -#include "pluginterfaces/base/ipluginbase.h" -#include "pluginterfaces/vst/ivstmessage.h" -#include "pluginterfaces/vst/ivsthostapplication.h" -#include "base/source/fobject.h" - -//------------------------------------------------------------------------ -namespace Steinberg { -namespace Vst { - -//------------------------------------------------------------------------ -/** Base class for VST 3 Component and Edit Controller. -\ingroup vstClasses */ -//------------------------------------------------------------------------ -class ComponentBase: public FObject, - public IPluginBase, - public IConnectionPoint -{ -public: -//------------------------------------------------------------------------ - ComponentBase (); - virtual ~ComponentBase (); - - //--- Internal Methods------ - /** Returns the hostContext (set by the host during initialize call). */ - FUnknown* getHostContext () { return hostContext; } - - /** Returns the peer for the messaging communication (you can only use IConnectionPoint::notify for communicate between peers, do not try to cast peerConnection. */ - IConnectionPoint* getPeer () { return peerConnection; } - - /** Allocates a message instance (don't forget to release it). */ - IMessage* allocateMessage (); - - /** Sends the given message to the peer. */ - tresult sendMessage (IMessage* message); - - /** Sends a simple text message to the peer (max 255 characters). */ - tresult sendTextMessage (const char8* text); - - /** Receives a simple text message from the peer (max 255 characters). */ - virtual tresult receiveText (const char8* text); - - //---from IPluginBase------ - virtual tresult PLUGIN_API initialize (FUnknown* context); - virtual tresult PLUGIN_API terminate (); - - //---from IConnectionPoint----------- - tresult PLUGIN_API connect (IConnectionPoint* other); - tresult PLUGIN_API disconnect (IConnectionPoint* other); - tresult PLUGIN_API notify (IMessage* message); - - //---Interface------ - OBJ_METHODS (ComponentBase, FObject) - DEFINE_INTERFACES - DEF_INTERFACE (IPluginBase) - DEF_INTERFACE (IConnectionPoint) - END_DEFINE_INTERFACES (FObject) - REFCOUNT_METHODS(FObject) - -//------------------------------------------------------------------------ -protected: - FUnknown* hostContext; - IConnectionPoint* peerConnection; -}; - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg diff --git a/vst/public.sdk/source/vst/vsteditcontroller.cpp b/vst/public.sdk/source/vst/vsteditcontroller.cpp deleted file mode 100644 index 381af426..00000000 --- a/vst/public.sdk/source/vst/vsteditcontroller.cpp +++ /dev/null @@ -1,702 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/vsteditcontroller.cpp -// Created by : Steinberg, 04/2005 -// Description : VST Edit Controller Implementation -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#include "public.sdk/source/vst/vsteditcontroller.h" -#include "pluginterfaces/base/ustring.h" -#include "base/source/updatehandler.h" - -#include - -namespace Steinberg { -namespace Vst { - -KnobMode EditController::hostKnobMode = kCircularMode; - -//------------------------------------------------------------------------ -// EditController Implementation -//------------------------------------------------------------------------ -EditController::EditController () -: componentHandler (0) -, componentHandler2 (0) -{} - -//------------------------------------------------------------------------ -tresult PLUGIN_API EditController::initialize (FUnknown* context) -{ - return ComponentBase::initialize (context); -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API EditController::terminate () -{ - parameters.removeAll (); - - if (componentHandler) - { - componentHandler->release (); - componentHandler = 0; - } - - if (componentHandler2) - { - componentHandler2->release (); - componentHandler2 = 0; - } - - return ComponentBase::terminate (); -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API EditController::setComponentState (IBStream* /*state*/) -{ - return kNotImplemented; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API EditController::setState (IBStream* /*state*/) -{ - return kNotImplemented; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API EditController::getState (IBStream* /*state*/) -{ - return kNotImplemented; -} - -//------------------------------------------------------------------------ -int32 PLUGIN_API EditController::getParameterCount () -{ - return parameters.getParameterCount (); -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API EditController::getParameterInfo (int32 paramIndex, ParameterInfo& info) -{ - Parameter* parameter = parameters.getParameterByIndex (paramIndex); - if (parameter) - { - info = parameter->getInfo (); - return kResultTrue; - } - return kResultFalse; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API EditController::getParamStringByValue (ParamID tag, ParamValue valueNormalized, String128 string) -{ - Parameter* parameter = getParameterObject (tag); - if (parameter) - { - parameter->toString (valueNormalized, string); - return kResultTrue; - } - return kResultFalse; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API EditController::getParamValueByString (ParamID tag, TChar* string, ParamValue& valueNormalized) -{ - Parameter* parameter = getParameterObject (tag); - if (parameter) - { - if (parameter->fromString (string, valueNormalized)) - { - return kResultTrue; - } - } - return kResultFalse; -} - -//------------------------------------------------------------------------ -ParamValue PLUGIN_API EditController::normalizedParamToPlain (ParamID tag, ParamValue valueNormalized) -{ - Parameter* parameter = getParameterObject (tag); - if (parameter) - { - return parameter->toPlain (valueNormalized); - } - return valueNormalized; -} - -//------------------------------------------------------------------------ -ParamValue PLUGIN_API EditController::plainParamToNormalized (ParamID tag, ParamValue plainValue) -{ - Parameter* parameter = getParameterObject (tag); - if (parameter) - { - return parameter->toNormalized (plainValue); - } - return plainValue; -} - -//------------------------------------------------------------------------ -ParamValue PLUGIN_API EditController::getParamNormalized (ParamID tag) -{ - Parameter* parameter = getParameterObject (tag); - if (parameter) - { - return parameter->getNormalized (); - } - return 0.0; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API EditController::setParamNormalized (ParamID tag, ParamValue value) -{ - Parameter* parameter = getParameterObject (tag); - if (parameter) - { - parameter->setNormalized (value); - return kResultTrue; - } - return kResultFalse; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API EditController::setComponentHandler (IComponentHandler* newHandler) -{ - if (componentHandler == newHandler) - { - return kResultTrue; - } - - if (componentHandler) - { - componentHandler->release (); - } - - componentHandler = newHandler; - if (componentHandler) - { - componentHandler->addRef (); - } - - // try to get the extended version - if (componentHandler2) - { - componentHandler2->release (); - componentHandler2 = 0; - } - - if (newHandler) - { - newHandler->queryInterface (IComponentHandler2::iid, (void**)&componentHandler2); - } - return kResultTrue; -} - -//------------------------------------------------------------------------ -tresult EditController::beginEdit (ParamID tag) -{ - if (componentHandler) - { - return componentHandler->beginEdit (tag); - } - return kResultFalse; -} - -//------------------------------------------------------------------------ -tresult EditController::performEdit (ParamID tag, ParamValue valueNormalized) -{ - if (componentHandler) - { - return componentHandler->performEdit (tag, valueNormalized); - } - return kResultFalse; -} - -//------------------------------------------------------------------------ -tresult EditController::endEdit (ParamID tag) -{ - if (componentHandler) - { - return componentHandler->endEdit (tag); - } - return kResultFalse; -} - -//------------------------------------------------------------------------ -tresult EditController::startGroupEdit () -{ - if (componentHandler2) - { - return componentHandler2->startGroupEdit (); - } - return kNotImplemented; -} - -//------------------------------------------------------------------------ -tresult EditController::finishGroupEdit () -{ - if (componentHandler2) - { - return componentHandler2->finishGroupEdit (); - } - return kNotImplemented; -} - -//------------------------------------------------------------------------ -tresult EditController::getParameterInfoByTag (ParamID tag, ParameterInfo& info) -{ - Parameter* parameter = getParameterObject (tag); - if (parameter) - { - info = parameter->getInfo (); - return kResultTrue; - } - return kResultFalse; -} - -//------------------------------------------------------------------------ -tresult EditController::setDirty (TBool state) -{ - if (componentHandler2) - { - return componentHandler2->setDirty (state); - } - return kNotImplemented; -} - -//------------------------------------------------------------------------ -tresult EditController::requestOpenEditor (FIDString name) -{ - if (componentHandler2) - { - return componentHandler2->requestOpenEditor (name); - } - return kNotImplemented; -} - -//------------------------------------------------------------------------ -// EditorView Implementation -//------------------------------------------------------------------------ -EditorView::EditorView (EditController* controller, ViewRect* size) -: CPluginView (size) -, controller (controller) -{ - if (controller) - { - controller->addRef (); - } -} - -//------------------------------------------------------------------------ -EditorView::~EditorView () -{ - if (controller) - { - controller->editorDestroyed (this); - controller->release (); - } -} - -//------------------------------------------------------------------------ -void EditorView::attachedToParent () -{ - if (controller) - { - controller->editorAttached (this); - } -} - -//------------------------------------------------------------------------ -void EditorView::removedFromParent () -{ - if (controller) - { - controller->editorRemoved (this); - } -} - -//------------------------------------------------------------------------ -// EditControllerEx1 implementation -//------------------------------------------------------------------------ -EditControllerEx1::EditControllerEx1 () -: selectedUnit (kRootUnitId) -{ - UpdateHandler::instance (); -} - -//------------------------------------------------------------------------ -EditControllerEx1::~EditControllerEx1 () -{ - for (int32 i = 0; i < programLists.total (); i++) - { - ProgramList* programList = programLists.at (i).object (); - if (programList) - programList->removeDependent (this); - } -} - -//------------------------------------------------------------------------ -bool EditControllerEx1::addUnit (Unit* unit) -{ - return units.add (IPtr (unit, false)); -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API EditControllerEx1::getUnitInfo (int32 unitIndex, UnitInfo& info /*out*/) -{ - Unit* unit = units.at (unitIndex); - if (unit) - { - info = unit->getInfo (); - return kResultTrue; - } - return kResultFalse; -} - -//------------------------------------------------------------------------ -tresult EditControllerEx1::notifyUnitSelection () -{ - tresult result = kResultFalse; - FUnknownPtr unitHandler (componentHandler); - if (unitHandler) - result = unitHandler->notifyUnitSelection (selectedUnit); - return result; -} - -//------------------------------------------------------------------------ -bool EditControllerEx1::addProgramList (ProgramList* list) -{ - if (programLists.addKeyAndObject (list->getID (), IPtr (list, false))) - { - list->addDependent (this); - return true; - } - return false; -} - -//------------------------------------------------------------------------ -ProgramList* EditControllerEx1::getProgramList (ProgramListID listId) const -{ - return programLists.lookupObject (listId); -} - -//------------------------------------------------------------------------ -tresult EditControllerEx1::notifyPogramListChange (ProgramListID listId, int32 programIndex) -{ - tresult result = kResultFalse; - FUnknownPtr unitHandler (componentHandler); - if (unitHandler) - result = unitHandler->notifyProgramListChange (listId, programIndex); - return result; -} - -//------------------------------------------------------------------------ -int32 PLUGIN_API EditControllerEx1::getProgramListCount () -{ - return programLists.total (); -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API EditControllerEx1::getProgramListInfo (int32 listIndex, ProgramListInfo& info /*out*/) -{ - TAssociation > assoc = programLists.at (listIndex); - if (assoc.object ()) - { - info = assoc.object ()->getInfo (); - return kResultTrue; - } - return kResultFalse; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API EditControllerEx1::getProgramName (ProgramListID listId, int32 programIndex, String128 name /*out*/) -{ - ProgramList* list = programLists.lookupObject (listId); - if (list) - { - return list->getProgramName (programIndex, name); - } - return kResultFalse; -} - -//------------------------------------------------------------------------ -tresult EditControllerEx1::setProgramName (ProgramListID listId, int32 programIndex, const String128 name /*in*/) -{ - ProgramList* list = programLists.lookupObject (listId); - if (list) - { - return list->setProgramName (programIndex, name); - } - return kResultFalse; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API EditControllerEx1::getProgramInfo (ProgramListID listId, int32 programIndex, CString attributeId /*in*/, String128 attributeValue /*out*/) -{ - ProgramList* list = programLists.lookupObject (listId); - if (list) - { - return list->getProgramInfo (programIndex, attributeId, attributeValue); - } - return kResultFalse; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API EditControllerEx1::hasProgramPitchNames (ProgramListID listId, int32 programIndex) -{ - ProgramList* list = programLists.lookupObject (listId); - if (list) - { - return list->hasPitchNames (programIndex); - } - return kResultFalse; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API EditControllerEx1::getProgramPitchName (ProgramListID listId, int32 programIndex, int16 midiPitch, String128 name /*out*/) -{ - ProgramList* list = programLists.lookupObject (listId); - if (list) - { - return list->getPitchName (programIndex, midiPitch, name); - } - return kResultFalse; -} - -//------------------------------------------------------------------------ -void PLUGIN_API EditControllerEx1::update (FUnknown* changedUnknown, int32 message) -{ - ProgramList* programList = FCast (changedUnknown); - if (programList) - { - FUnknownPtr unitHandler (componentHandler); - if (unitHandler) - unitHandler->notifyProgramListChange (programList->getID (), kAllProgramInvalid); - } -} - -//------------------------------------------------------------------------ -// Unit implementation -//------------------------------------------------------------------------ -Unit::Unit () -{ - memset (&info, 0, sizeof (UnitInfo)); -} - -//------------------------------------------------------------------------ -Unit::Unit (const String128 name, UnitID unitId, UnitID parentUnitId, ProgramListID programListId) -{ - setName (name); - info.id = unitId; - info.parentUnitId = parentUnitId; - info.programListId = programListId; -} - -//------------------------------------------------------------------------ -Unit::Unit (const UnitInfo& info) -: info (info) -{ -} - -//------------------------------------------------------------------------ -void Unit::setName (const String128 newName) -{ - UString128 (newName).copyTo (info.name, 128); -} - -//------------------------------------------------------------------------ -// ProgramList implementation -//------------------------------------------------------------------------ -ProgramList::ProgramList (const String128 name, ProgramListID listId, UnitID unitId) -: unitId (unitId) -, parameter (0) -{ - UString128 (name).copyTo (info.name, 128); - info.id = listId; - info.programCount = 0; -} - -//------------------------------------------------------------------------ -ProgramList::ProgramList (const ProgramList& programList) -: info (programList.info) -, unitId (programList.unitId) -, programNames (programList.programNames) -, parameter (0) -{ -} - -//------------------------------------------------------------------------ -int32 ProgramList::addProgram (const String128 name) -{ - info.programCount++; - if (programNames.add (name)) - { - programInfos.add (TDictionary ()); - return programNames.total () - 1; - } - return -1; -} - -//------------------------------------------------------------------------ -bool ProgramList::setProgramInfo (int32 programIndex, CString attributeId, const String128 value) -{ - if (programIndex < programNames.total ()) - { - programInfos.at (programIndex).addKeyAndObject (attributeId, value); - return true; - } - return false; -} - -//------------------------------------------------------------------------ -tresult ProgramList::getProgramInfo (int32 programIndex, CString attributeId, String128 value /*out*/) -{ - if (programIndex < programNames.total ()) - { - const String& attValue = programInfos.at (programIndex).lookupObject (attributeId); - if (!attValue.isEmpty ()) - { - attValue.copyTo16 (value, 0, 128); - return kResultTrue; - } - } - return kResultFalse; -} - -//------------------------------------------------------------------------ -tresult ProgramList::getProgramName (int32 programIndex, String128 name /*out*/) -{ - if (programIndex < programNames.total ()) - { - programNames.at (programIndex).copyTo16 (name, 0, 128); - return kResultTrue; - } - return kResultFalse; -} - -//------------------------------------------------------------------------ -tresult ProgramList::setProgramName (int32 programIndex, const String128 name /*in*/) -{ - if (programIndex < programNames.total ()) - { - programNames.at (programIndex) = name; - if (parameter) - { - static_cast (parameter)->replaceString (programIndex, name); - } - return kResultTrue; - } - return kResultFalse; -} - -//------------------------------------------------------------------------ -Parameter* ProgramList::getParameter () -{ - if (parameter == 0) - { - StringListParameter* listParameter = new StringListParameter (info.name, info.id, 0, ParameterInfo::kCanAutomate | ParameterInfo::kIsList | ParameterInfo::kIsProgramChange, unitId); - FOREACH_T(String, name, programNames) - listParameter->appendString (name); - ENDFOR - parameter = listParameter; - } - return parameter; -} - -//------------------------------------------------------------------------ -// ProgramListWithPitchNames implementation -//----------------------------------------------------------------------------- -ProgramListWithPitchNames::ProgramListWithPitchNames (const String128 name, ProgramListID listId, UnitID unitId) -: ProgramList (name, listId, unitId) -{ -} - -//----------------------------------------------------------------------------- -int32 ProgramListWithPitchNames::addProgram (const String128 name) -{ - int32 index = ProgramList::addProgram (name); - if (index >= 0) - pitchNames.add (TDictionary ()); - return index; -} - -//----------------------------------------------------------------------------- -bool ProgramListWithPitchNames::setPitchName (int32 programIndex, int16 pitch, const String128 pitchName) -{ - bool result = false; - if (programIndex < getCount ()) - { - if (pitchNames.at (programIndex).containsKey (pitch)) - result = pitchNames.at (programIndex).replace (pitch, pitchName); - else - result = pitchNames.at (programIndex).addKeyAndObject (pitch, pitchName); - } - if (result) - changed (); - return result; -} - -//----------------------------------------------------------------------------- -bool ProgramListWithPitchNames::removePitchName (int32 programIndex, int16 pitch) -{ - bool result = false; - if (programIndex < getCount ()) - { - result = pitchNames.at (programIndex).removeKey (pitch); - } - if (result) - changed (); - return result; -} - -//----------------------------------------------------------------------------- -tresult ProgramListWithPitchNames::hasPitchNames (int32 programIndex) -{ - if (programIndex < getCount ()) - return pitchNames.at (programIndex).total () > 0 ? kResultTrue : kResultFalse; - return kResultFalse; -} - -//----------------------------------------------------------------------------- -tresult ProgramListWithPitchNames::getPitchName (int32 programIndex, int16 midiPitch, String128 name /*out*/) -{ - if (programIndex < getCount ()) - { - const String& str = pitchNames.at (programIndex).lookupObject (midiPitch); - if (!str.isEmpty ()) - { - str.copyTo16 (name, 0, 128); - return kResultTrue; - } - } - return kResultFalse; -} - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg diff --git a/vst/public.sdk/source/vst/vsteditcontroller.h b/vst/public.sdk/source/vst/vsteditcontroller.h deleted file mode 100644 index e5f1811a..00000000 --- a/vst/public.sdk/source/vst/vsteditcontroller.h +++ /dev/null @@ -1,333 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/vsteditcontroller.h -// Created by : Steinberg, 04/2005 -// Description : VST Edit Controller Implementation -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#pragma once - -#include "public.sdk/source/vst/vstcomponentbase.h" -#include "public.sdk/source/vst/vstparameters.h" -#include "public.sdk/source/common/pluginview.h" -#include "base/source/fcontainer.h" -#include "base/source/tdictionary.h" -#include "base/source/fstring.h" - -#include "pluginterfaces/vst/ivsteditcontroller.h" -#include "pluginterfaces/vst/ivstunits.h" - -//------------------------------------------------------------------------ -namespace Steinberg { -namespace Vst { - -class EditorView; - -//------------------------------------------------------------------------ -/** Default implementation for a VST 3 edit controller. -\ingroup vstClasses -Can be used as base class for a specific controller implementation */ -//------------------------------------------------------------------------ -class EditController: public ComponentBase, - public IEditController, - public IEditController2 -{ -public: -//------------------------------------------------------------------------ - EditController (); - - //---from IEditController------- - virtual tresult PLUGIN_API setComponentState (IBStream* state); - virtual tresult PLUGIN_API setState (IBStream* state); - virtual tresult PLUGIN_API getState (IBStream* state); - virtual int32 PLUGIN_API getParameterCount (); - virtual tresult PLUGIN_API getParameterInfo (int32 paramIndex, ParameterInfo& info); - virtual tresult PLUGIN_API getParamStringByValue (ParamID tag, ParamValue valueNormalized, String128 string); - virtual tresult PLUGIN_API getParamValueByString (ParamID tag, TChar* string, ParamValue& valueNormalized); - virtual ParamValue PLUGIN_API normalizedParamToPlain (ParamID tag, ParamValue valueNormalized); - virtual ParamValue PLUGIN_API plainParamToNormalized (ParamID tag, ParamValue plainValue); - virtual ParamValue PLUGIN_API getParamNormalized (ParamID tag); - virtual tresult PLUGIN_API setParamNormalized (ParamID tag, ParamValue value); - virtual tresult PLUGIN_API setComponentHandler (IComponentHandler* handler); - virtual IPlugView* PLUGIN_API createView (FIDString /*name*/) {return 0;} - - //---from IEditController2------- - virtual tresult PLUGIN_API setKnobMode (KnobMode mode) { hostKnobMode = mode; return kResultTrue; } - virtual tresult PLUGIN_API openHelp (TBool /*onlyCheck*/) {return kResultFalse;} - virtual tresult PLUGIN_API openAboutBox (TBool /*onlyCheck*/) {return kResultFalse;} - - //---from ComponentBase--------- - virtual tresult PLUGIN_API initialize (FUnknown* context); - virtual tresult PLUGIN_API terminate (); - - //---Internal Methods------- - virtual tresult beginEdit (ParamID tag); ///< to be called before a serie of performEdit - virtual tresult performEdit (ParamID tag, ParamValue valueNormalized); ///< will inform the host about the value change - virtual tresult endEdit (ParamID tag); ///< to be called after a serie of performEdit - virtual tresult startGroupEdit (); ///< calls IComponentHandler2::startGroupEdit() if host supports it - virtual tresult finishGroupEdit (); ///< calls IComponentHandler2::finishGroupEdit() if host supports it - - virtual void editorDestroyed (EditorView* /*editor*/) {} ///< called from EditorView if it was destroyed - virtual void editorAttached (EditorView* /*editor*/) {} ///< called from EditorView if it was attached to a parent - virtual void editorRemoved (EditorView* /*editor*/) {} ///< called from EditorView if it was removed from a parent - - static KnobMode getHostKnobMode () { return hostKnobMode; } ///< return host knob mode - - /** Gets for a given tag the parameter object. */ - virtual Parameter* getParameterObject (ParamID tag) { return parameters.getParameter (tag); } - - /** Gets for a given tag the parameter information. */ - virtual tresult getParameterInfoByTag (ParamID tag, ParameterInfo& info); - - /** Calls IComponentHandler2::setDirty (state) if host supports it. */ - virtual tresult setDirty (TBool state); - - /** Calls IComponentHandler2::requestOpenEditor (name) if host supports it. */ - virtual tresult requestOpenEditor (FIDString name = ViewType::kEditor); - - //---Accessor Methods------- - IComponentHandler* getComponentHandler () const { return componentHandler; } - - //---Interface--------- - OBJ_METHODS (EditController, ComponentBase) - DEFINE_INTERFACES - DEF_INTERFACE (IEditController) - DEF_INTERFACE (IEditController2) - END_DEFINE_INTERFACES (ComponentBase) - REFCOUNT_METHODS(ComponentBase) -//------------------------------------------------------------------------ -protected: - IComponentHandler* componentHandler; - IComponentHandler2* componentHandler2; - - ParameterContainer parameters; - - static KnobMode hostKnobMode; -}; - - -//------------------------------------------------------------------------ -/** View related to an edit controller. -\ingroup vstClasses */ -//------------------------------------------------------------------------ -class EditorView: public CPluginView -{ -public: -//------------------------------------------------------------------------ - EditorView (EditController* controller, ViewRect* size = 0); - virtual ~EditorView (); - - /** Gets its controller part. */ - EditController* getController () { return controller; } - - //---from CPluginView------------- - virtual void attachedToParent (); - virtual void removedFromParent (); - -//------------------------------------------------------------------------ -protected: - EditController* controller; -}; - - -//------------------------------------------------------------------------ -/** Unit element. -\ingroup vstClasses */ -//------------------------------------------------------------------------ -class Unit: public FObject -{ -public: -//------------------------------------------------------------------------ - Unit (const String128 name, UnitID unitId, UnitID parentUnitId = kRootUnitId, ProgramListID programListId = kNoProgramListId); - Unit (const UnitInfo& unit); - - /** Returns its info. */ - const UnitInfo& getInfo () const {return info;} - - /** Returns its Unit ID. */ - UnitID getID () const {return info.id;} - - /** Sets a new Unit ID. */ - void setID (UnitID newID) {info.id = newID;} - - /** Returns its Unit Name. */ - const TChar* getName () const {return info.name;} - - /** Sets a new Unit Name. */ - void setName (const String128 newName); - - /** Returns its ProgramList ID. */ - ProgramListID getProgramListID () const {return info.programListId;} - - /** Sets a new ProgramList ID. */ - void setProgramListID (ProgramListID newID) {info.programListId = newID;} - - OBJ_METHODS (Unit, FObject) -//------------------------------------------------------------------------ -protected: - Unit (); - UnitInfo info; -}; - -//------------------------------------------------------------------------ -/** ProgramList element. -\ingroup vstClasses */ -//------------------------------------------------------------------------ -class ProgramList: public FObject -{ -public: -//------------------------------------------------------------------------ - ProgramList (const String128 name, ProgramListID listId, UnitID unitId); - ProgramList (const ProgramList& programList); - - const ProgramListInfo& getInfo () const { return info; } - ProgramListID getID () const { return info.id; } - const TChar* getName () const { return info.name; } - int32 getCount () const { return info.programCount; } - - virtual tresult getProgramName (int32 programIndex, String128 name /*out*/); - virtual tresult setProgramName (int32 programIndex, const String128 name /*in*/); - virtual tresult getProgramInfo (int32 programIndex, CString attributeId, String128 value /*out*/); - virtual tresult hasPitchNames (int32 programIndex) { return kResultFalse; } - virtual tresult getPitchName (int32 programIndex, int16 midiPitch, String128 name /*out*/) { return kResultFalse; } - - /** Adds a program to the end of the list. returns the index of the program. */ - virtual int32 addProgram (const String128 name); - - /** Sets a program attribute value. */ - virtual bool setProgramInfo (int32 programIndex, CString attributeId, const String128 value); - - /** Creates and returns the program parameter. */ - virtual Parameter* getParameter (); - - OBJ_METHODS (ProgramList, FObject) -//------------------------------------------------------------------------ -protected: - ProgramListInfo info; - UnitID unitId; - TArray programNames; - TArray > programInfos; - Parameter* parameter; -}; - -//------------------------------------------------------------------------ -/** ProgramListWithPitchNames element. -\ingroup vstClasses */ -//----------------------------------------------------------------------------- -class ProgramListWithPitchNames: public ProgramList -{ -public: - ProgramListWithPitchNames (const String128 name, ProgramListID listId, UnitID unitId); - - /** Sets a name for the given program index and a given pitch. */ - bool setPitchName (int32 programIndex, int16 pitch, const String128 pitchName); - - /** Removes the PitchName entry for the given program index and a given pitch. Returns true if it was found and removed. */ - bool removePitchName (int32 programIndex, int16 pitch); - - //---from ProgramList--------- - int32 addProgram (const String128 name); - tresult hasPitchNames (int32 programIndex); - tresult getPitchName (int32 programIndex, int16 midiPitch, String128 name /*out*/); - - OBJ_METHODS (ProgramListWithPitchNames, ProgramList) -protected: - TArray > pitchNames; -}; - - -//------------------------------------------------------------------------ -/** Advanced implementation (support IUnitInfo) for a VST 3 edit controller. -\ingroup vstClasses -- [extends EditController] -*/ -//------------------------------------------------------------------------ -class EditControllerEx1: public EditController, public IUnitInfo -{ -public: - EditControllerEx1 (); - virtual ~EditControllerEx1 (); - - /** Adds a given unit. */ - bool addUnit (Unit* unit); - - /** Adds a given program list. */ - bool addProgramList (ProgramList* list); - - /** Returns the ProgramList associated to a given listId. */ - ProgramList* getProgramList (ProgramListID listId) const; - - /** Notifies the host about program list changes. */ - tresult notifyPogramListChange (ProgramListID listId, int32 programIndex = kAllProgramInvalid); - - //---from IUnitInfo------------------ - virtual int32 PLUGIN_API getUnitCount () { return units.total (); } - virtual tresult PLUGIN_API getUnitInfo (int32 unitIndex, UnitInfo& info /*out*/); - - virtual int32 PLUGIN_API getProgramListCount (); - virtual tresult PLUGIN_API getProgramListInfo (int32 listIndex, ProgramListInfo& info /*out*/); - virtual tresult PLUGIN_API getProgramName (ProgramListID listId, int32 programIndex, String128 name /*out*/); - virtual tresult PLUGIN_API getProgramInfo (ProgramListID listId, int32 programIndex, CString attributeId /*in*/, String128 attributeValue /*out*/); - - virtual tresult PLUGIN_API hasProgramPitchNames (ProgramListID listId, int32 programIndex); - virtual tresult PLUGIN_API getProgramPitchName (ProgramListID listId, int32 programIndex, int16 midiPitch, String128 name /*out*/); - - virtual tresult setProgramName (ProgramListID listId, int32 programIndex, const String128 name /*in*/); - - // units selection -------------------- - virtual UnitID PLUGIN_API getSelectedUnit () {return selectedUnit;} - virtual tresult PLUGIN_API selectUnit (UnitID unitId) {selectedUnit = unitId; return kResultTrue;} - - virtual tresult PLUGIN_API getUnitByBus (MediaType /*type*/, BusDirection /*dir*/, int32 /*busIndex*/, - int32 /*channel*/, UnitID& /*unitId*/ /*out*/) {return kResultFalse;} - virtual tresult PLUGIN_API setUnitProgramData (int32 /*listOrUnitId*/, int32 /*programIndex*/, IBStream* /*data*/) {return kResultFalse;} - - /** Notifies the host about the selected Unit. */ - virtual tresult notifyUnitSelection (); - - //---from IDependent------------------ - virtual void PLUGIN_API update (FUnknown* changedUnknown, int32 message); - - //---Interface--------- - OBJ_METHODS (EditControllerEx1, EditController) - DEFINE_INTERFACES - DEF_INTERFACE (IUnitInfo) - END_DEFINE_INTERFACES (EditController) - REFCOUNT_METHODS(EditController) - -protected: - TArray > units; - TDictionary > programLists; - UnitID selectedUnit; -}; - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg diff --git a/vst/public.sdk/source/vst/vstguieditor.cpp b/vst/public.sdk/source/vst/vstguieditor.cpp deleted file mode 100644 index 26fced85..00000000 --- a/vst/public.sdk/source/vst/vstguieditor.cpp +++ /dev/null @@ -1,358 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/vstguieditor.cpp -// Created by : Steinberg, 04/2005 -// Description : VSTGUI Editor -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#include "vstguieditor.h" -#include "pluginterfaces/base/keycodes.h" - -#if VSTGUI_VERSION_MAJOR < 4 -#include "vstgui/vstkeycode.h" -#endif - -#include "base/source/fstring.h" - -#if MAC -#include -#include -namespace VSTGUI { - static void CreateVSTGUIBundleRef (); - static void ReleaseVSTGUIBundleRef (); -} -#elif WINDOWS -void* hInstance = 0; // VSTGUI hInstance -extern void* moduleHandle; - -#endif // MAC - -namespace Steinberg { -namespace Vst { - -//------------------------------------------------------------------------ -VSTGUIEditor::VSTGUIEditor (void* controller, ViewRect* size) -: EditorView (static_cast(controller), size) -{ - #if MAC - CreateVSTGUIBundleRef (); - #elif WINDOWS - hInstance = moduleHandle; - #endif - // create a timer used for idle update: will call notify method - timer = new CVSTGUITimer (dynamic_cast(this)); -} - -//------------------------------------------------------------------------ -VSTGUIEditor::~VSTGUIEditor () -{ - if (timer) - timer->forget (); - #if MAC - ReleaseVSTGUIBundleRef (); - #endif -} - -//------------------------------------------------------------------------ -void VSTGUIEditor::setIdleRate (int32 millisec) -{ - if (timer) - timer->setFireTime (millisec); -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API VSTGUIEditor::isPlatformTypeSupported (FIDString type) -{ -#if WINDOWS - if (strcmp (type, kPlatformTypeHWND) == 0) - return kResultTrue; - -#elif MAC - #if TARGET_OS_IPHONE - if (strcmp (type, kPlatformTypeUIView) == 0) - return kResultTrue; - #else - #if MAC_CARBON - if (strcmp (type, kPlatformTypeHIView) == 0) - return kResultTrue; - #endif - - #if MAC_COCOA - if (strcmp (type, kPlatformTypeNSView) == 0) - return kResultTrue; - #endif - #endif -#endif - - return kInvalidArgument; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API VSTGUIEditor::attached (void* parent, FIDString type) -{ -#if MAC - if (isPlatformTypeSupported (type) != kResultTrue) - return kResultFalse; - - #if MAC_COCOA && MAC_CARBON && !(VSTGUI_VERSION_MAJOR >= 4 && VSTGUI_VERSION_MINOR >= 1) - CFrame::setCocoaMode (strcmp (type, kPlatformTypeNSView) == 0); - #endif -#endif - - if (timer) - timer->start (); - -#if VSTGUI_VERSION_MAJOR >= 4 && VSTGUI_VERSION_MINOR >= 1 - PlatformType platformType = kDefaultNative; -#if MAC - #if TARGET_OS_IPHONE - if (strcmp (type, kPlatformTypeUIView) == 0) - platformType = kUIView; - #else - #if MAC_CARBON - if (strcmp (type, kPlatformTypeHIView) == 0) - platformType = kWindowRef; - #endif - - #if MAC_COCOA - if (strcmp (type, kPlatformTypeNSView) == 0) - platformType = kNSView; - #endif - #endif -#endif - if (open (parent, platformType) == true) -#else - if (open (parent) == true) -#endif - { - ViewRect vr (0, 0, (int32)frame->getWidth (), (int32)frame->getHeight ()); - setRect (vr); - if (plugFrame) - plugFrame->resizeView (this, &vr); - } - return EditorView::attached (parent, type); -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API VSTGUIEditor::removed () -{ - if (timer) - timer->stop (); - - close (); - return EditorView::removed (); -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API VSTGUIEditor::onSize (ViewRect* newSize) -{ - if (frame) - frame->setSize (newSize->right - newSize->left, newSize->bottom - newSize->top); - - return EditorView::onSize (newSize); -} - -//------------------------------------------------------------------------ -void VSTGUIEditor::beginEdit (VSTGUI_INT32 index) -{ - if (controller) - controller->beginEdit (index); -} - -//------------------------------------------------------------------------ -void VSTGUIEditor::endEdit (VSTGUI_INT32 index) -{ - if (controller) - controller->endEdit (index); -} - -//------------------------------------------------------------------------ -VSTGUI_INT32 VSTGUIEditor::getKnobMode () const -{ - switch (EditController::getHostKnobMode ()) - { - case kRelativCircularMode: return VSTGUI::kRelativCircularMode; - case kLinearMode: return VSTGUI::kLinearMode; - } - return VSTGUI::kCircularMode; -} - -//------------------------------------------------------------------------ -CMessageResult VSTGUIEditor::notify (CBaseObject* /*sender*/, const char* message) -{ - if (message == CVSTGUITimer::kMsgTimer) - { - if (frame) - frame->idle (); - - return kMessageNotified; - } - - return kMessageUnknown; -} - -//------------------------------------------------------------------------ -static bool translateKeyMessage (VstKeyCode& keyCode, char16 key, int16 keyMsg, int16 modifiers) -{ - keyCode.character = 0; - keyCode.virt = (unsigned char)keyMsg; - keyCode.modifier = 0; - if (key == 0) - key = VirtualKeyCodeToChar ((uint8)keyMsg); - if (key) - { - String keyStr (STR(" ")); - keyStr.setChar16 (0, key); - keyStr.toMultiByte (kCP_Utf8); - if (keyStr.length () == 1) - keyCode.character = keyStr.getChar8 (0); - } - if (modifiers) - { - if (modifiers & kShiftKey) - keyCode.modifier |= MODIFIER_SHIFT; - if (modifiers & kAlternateKey) - keyCode.modifier |= MODIFIER_ALTERNATE; - if (modifiers & kCommandKey) - keyCode.modifier |= MODIFIER_CONTROL; - if (modifiers & kControlKey) - keyCode.modifier |= MODIFIER_COMMAND; - } - return true; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API VSTGUIEditor::onKeyDown (char16 key, int16 keyMsg, int16 modifiers) -{ - if (frame) - { - VstKeyCode keyCode = {0}; - if (translateKeyMessage (keyCode, key, keyMsg, modifiers)) - { - VSTGUI_INT32 result = frame->onKeyDown (keyCode); - if (result == 1) - return kResultTrue; - } - } - return kResultFalse; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API VSTGUIEditor::onKeyUp (char16 key, int16 keyMsg, int16 modifiers) -{ - if (frame) - { - VstKeyCode keyCode = {0}; - if (translateKeyMessage (keyCode, key, keyMsg, modifiers)) - { - VSTGUI_INT32 result = frame->onKeyUp (keyCode); - if (result == 1) - return kResultTrue; - } - } - return kResultFalse; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API VSTGUIEditor::onWheel (float distance) -{ - if (frame) - { - CPoint where; - frame->getCurrentMouseLocation (where); - if (frame->onWheel (where, distance, frame->getCurrentMouseButtons ())) - return kResultTrue; - } - return kResultFalse; -} - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg - -#if MAC -namespace VSTGUI { -void* gBundleRef = 0; -static int openCount = 0; -//------------------------------------------------------------------------ -void CreateVSTGUIBundleRef () -{ - openCount++; - if (gBundleRef) - { - CFRetain (gBundleRef); - return; - } -#if TARGET_OS_IPHONE - gBundleRef = CFBundleGetMainBundle (); - CFRetain (gBundleRef); -#else - Dl_info info; - if (dladdr ((const void*)CreateVSTGUIBundleRef, &info)) - { - if (info.dli_fname) - { - Steinberg::String name; - name.assign (info.dli_fname); - for (int i = 0; i < 3; i++) - { - int delPos = name.findLast ('/'); - if (delPos == -1) - { - fprintf (stdout, "Could not determine bundle location.\n"); - return; // unexpected - } - name.remove (delPos, name.length () - delPos); - } - CFURLRef bundleUrl = CFURLCreateFromFileSystemRepresentation (0, (const UInt8*)name.text8 (), name.length (), true); - if (bundleUrl) - { - gBundleRef = CFBundleCreate (0, bundleUrl); - CFRelease (bundleUrl); - } - } - } -#endif -} - -//------------------------------------------------------------------------ -void ReleaseVSTGUIBundleRef () -{ - openCount--; - if (gBundleRef) - CFRelease (gBundleRef); - if (openCount == 0) - gBundleRef = 0; -} - -//------------------------------------------------------------------------ -} // namespace VSTGUI - -#endif // MAC diff --git a/vst/public.sdk/source/vst/vstguieditor.h b/vst/public.sdk/source/vst/vstguieditor.h deleted file mode 100644 index c77ed2db..00000000 --- a/vst/public.sdk/source/vst/vstguieditor.h +++ /dev/null @@ -1,108 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/vstguieditor.h -// Created by : Steinberg, 04/2005 -// Description : VSTGUI Editor -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#pragma once - -#include "vsteditcontroller.h" -#include "vstgui/vstgui.h" - -#if VSTGUI_VERSION_MAJOR < 4 -#include "vstgui/cvstguitimer.h" -#define VSTGUI_INT32 long -#else -#define VSTGUI_INT32 int32_t -#endif - -namespace Steinberg { -namespace Vst { - -//------------------------------------------------------------------------ -/** Base class for an edit view using VSTGUI. -\ingroup vstClasses */ -//------------------------------------------------------------------------ -class VSTGUIEditor : public EditorView, public VSTGUIEditorInterface, public CBaseObject -{ -public: - /** Constructor. */ - VSTGUIEditor (void* controller, ViewRect* size = 0); - - /** Destructor. */ - virtual ~VSTGUIEditor (); - - //---Internal function----- - /** Called when the editor will be opened. */ -#if VSTGUI_VERSION_MAJOR >= 4 && VSTGUI_VERSION_MINOR >= 1 - virtual bool PLUGIN_API open (void* parent, const PlatformType& platformType = kDefaultNative) = 0; -#else - virtual bool PLUGIN_API open (void* parent) = 0; -#endif - /** Called when the editor will be closed. */ - virtual void PLUGIN_API close () = 0; - - /** Sets the idle rate controlling the parameter update rate. */ - void setIdleRate (int32 millisec); - - //---from CBaseObject--------------- - CMessageResult notify (CBaseObject* sender, const char* message); - void forget () { EditorView::release (); } - void remember () { EditorView::addRef (); } - VSTGUI_INT32 getNbReference () const { return refCount; } - - //---from IPlugView------- - tresult PLUGIN_API isPlatformTypeSupported (FIDString type); - tresult PLUGIN_API onSize (ViewRect* newSize); - - //---from VSTGUIEditorInterface------- - /** Called from VSTGUI when a user begins editing. - The default implementation calls performEdit of the EditController. */ - void beginEdit (VSTGUI_INT32 index); - /** Called from VSTGUI when a user ends editing. - The default implementation calls endEdit of the EditController. */ - void endEdit (VSTGUI_INT32 index); - - VSTGUI_INT32 getKnobMode () const; -private: - //---from IPlugView------- - tresult PLUGIN_API attached (void* parent, FIDString type); - tresult PLUGIN_API removed (); - tresult PLUGIN_API onKeyDown (char16 key, int16 keyMsg, int16 modifiers); - tresult PLUGIN_API onKeyUp (char16 key, int16 keyMsg, int16 modifiers); - tresult PLUGIN_API onWheel (float distance); - - CVSTGUITimer* timer; -}; - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg diff --git a/vst/public.sdk/source/vst/vstinitiids.cpp b/vst/public.sdk/source/vst/vstinitiids.cpp deleted file mode 100644 index aa77e6da..00000000 --- a/vst/public.sdk/source/vst/vstinitiids.cpp +++ /dev/null @@ -1,114 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/vstinitiids.cpp -// Created by : Steinberg, 10/2009 -// Description : Interface symbols file -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#include "pluginterfaces/base/funknown.h" - -#include "pluginterfaces/vst/ivsteditcontroller.h" -#include "pluginterfaces/vst/ivstmessage.h" -#include "pluginterfaces/vst/ivstunits.h" -#include "pluginterfaces/vst/ivstaudioprocessor.h" -#include "pluginterfaces/vst/ivstparameterchanges.h" -#include "pluginterfaces/vst/ivstevents.h" -#include "pluginterfaces/vst/ivsthostapplication.h" -#include "pluginterfaces/vst/ivstplugview.h" -#include "pluginterfaces/vst/ivstcontextmenu.h" -#include "pluginterfaces/vst/ivstrepresentation.h" -#include "pluginterfaces/vst/ivstinterappaudio.h" -#include "pluginterfaces/vst/ivstchannelcontextinfo.h" -#include "pluginterfaces/vst/ivstprefetchablesupport.h" -#include "pluginterfaces/vst/ivstautomationstate.h" - -namespace Steinberg { -namespace Vst { - - //----VST 3.0-------------------------------- - DEF_CLASS_IID (IComponent) - DEF_CLASS_IID (IAudioProcessor) - DEF_CLASS_IID (IUnitData) - DEF_CLASS_IID (IProgramListData) - - DEF_CLASS_IID (IEditController) - DEF_CLASS_IID (IUnitInfo) - - DEF_CLASS_IID (IConnectionPoint) - - DEF_CLASS_IID (IComponentHandler) - DEF_CLASS_IID (IUnitHandler) - - DEF_CLASS_IID (IParamValueQueue) - DEF_CLASS_IID (IParameterChanges) - - DEF_CLASS_IID (IEventList) - DEF_CLASS_IID (IMessage) - - DEF_CLASS_IID (IHostApplication) - DEF_CLASS_IID (IAttributeList) - - //----VST 3.0.1-------------------------------- - DEF_CLASS_IID (IMidiMapping) - - //----VST 3.0.2-------------------------------- - DEF_CLASS_IID (IParameterFinder) - - //----VST 3.1---------------------------------- - DEF_CLASS_IID (IComponentHandler2) - DEF_CLASS_IID (IEditController2) - DEF_CLASS_IID (IAudioPresentationLatency) - - //---VST 3.1 for AU and VST 2 Wrapper----------- - DEF_CLASS_IID (IVst3ToVst2Wrapper) - DEF_CLASS_IID (IVst3ToAUWrapper) - - //----VST 3.5---------------------------------- - DEF_CLASS_IID (INoteExpressionController) - DEF_CLASS_IID (IKeyswitchController) - DEF_CLASS_IID (IContextMenuTarget) - DEF_CLASS_IID (IContextMenu) - DEF_CLASS_IID (IComponentHandler3) - DEF_CLASS_IID (IEditControllerHostEditing) - DEF_CLASS_IID (IXmlRepresentationController) - - //----VST 3.6---------------------------------- - DEF_CLASS_IID (IInterAppAudioHost) - DEF_CLASS_IID (IInterAppAudioConnectionNotification) - DEF_CLASS_IID (IInterAppAudioPresetManager) - DEF_CLASS_IID (IStreamAttributes) - - //----VST 3.6.5-------------------------------- - DEF_CLASS_IID (ChannelContext::IInfoListener) - DEF_CLASS_IID (IPrefetchableSupport) - DEF_CLASS_IID (IUnitHandler2) - DEF_CLASS_IID (IAutomationState) -} -} diff --git a/vst/public.sdk/source/vst/vstnoteexpressiontypes.cpp b/vst/public.sdk/source/vst/vstnoteexpressiontypes.cpp deleted file mode 100644 index 72ec747d..00000000 --- a/vst/public.sdk/source/vst/vstnoteexpressiontypes.cpp +++ /dev/null @@ -1,267 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/vstnoteexpressiontypes.cpp -// Created by : Steinberg, 12/2010 -// Description : VST Note Expression Type Info Implementation -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#include "vstnoteexpressiontypes.h" -#include "vstparameters.h" -#include "pluginterfaces/base/ustring.h" -#include "pluginterfaces/base/futils.h" -#include "base/source/fstring.h" - -namespace Steinberg { -namespace Vst { - -//----------------------------------------------------------------------------- -NoteExpressionType::NoteExpressionType () -: precision (4) -{ - memset (&info, 0, sizeof (info)); -} - -//----------------------------------------------------------------------------- -NoteExpressionType::NoteExpressionType (const NoteExpressionTypeInfo& _info) -: precision (4) -{ - memcpy (&info, &_info, sizeof (info)); -} - -//----------------------------------------------------------------------------- -NoteExpressionType::NoteExpressionType (NoteExpressionTypeID _typeId, const TChar* _title, const TChar* _shortTitle, const TChar* _units, - int32 _unitId, NoteExpressionValue _defaultValue, NoteExpressionValue _minimum, NoteExpressionValue _maximum, - int32 _stepCount, int32 _flags, int32 _precision) -: precision (_precision) -{ - memset (&info, 0, sizeof (info)); - info.typeId = _typeId; - if (_title) - UString (info.title, str16BufferSize (String128)).assign (_title); - if (_shortTitle) - UString (info.shortTitle, str16BufferSize (String128)).assign (_shortTitle); - if (_units) - UString (info.shortTitle, str16BufferSize (String128)).assign (_units); - info.unitId = _unitId; - info.valueDesc.defaultValue = _defaultValue; - info.valueDesc.minimum = _minimum; - info.valueDesc.maximum = _maximum; - info.valueDesc.stepCount = _stepCount; - info.flags = _flags; -} - -//----------------------------------------------------------------------------- -NoteExpressionType::NoteExpressionType (NoteExpressionTypeID _typeId, const TChar* _title, const TChar* _shortTitle, const TChar* _units, - int32 _unitId, Parameter* _associatedParameter, int32 _flags) -: associatedParameter (_associatedParameter) -, precision (4) -{ - memset (&info, 0, sizeof (info)); - info.typeId = _typeId; - if (_title) - UString (info.title, str16BufferSize (String128)).assign (_title); - if (_shortTitle) - UString (info.shortTitle, str16BufferSize (String128)).assign (_shortTitle); - if (_units) - UString (info.shortTitle, str16BufferSize (String128)).assign (_units); - info.unitId = _unitId; - info.valueDesc.defaultValue = 0.5; - info.valueDesc.minimum = 0.; - info.valueDesc.maximum = 1.; - info.flags = _flags; - if (_associatedParameter) - { - info.valueDesc.stepCount = _associatedParameter->getInfo ().stepCount; - info.valueDesc.defaultValue = _associatedParameter->getInfo ().defaultNormalizedValue; - info.associatedParameterId = associatedParameter->getInfo ().id; - info.flags |= NoteExpressionTypeInfo::kAssociatedParameterIDValid; - } -} - -//----------------------------------------------------------------------------- -tresult NoteExpressionType::getStringByValue (NoteExpressionValue valueNormalized /*in*/, String128 string /*out*/) -{ - if (associatedParameter) - { - associatedParameter->toString (valueNormalized, string); - return kResultTrue; - } - UString128 wrapper; - if (info.valueDesc.stepCount > 0) - { - int32 value = Min (info.valueDesc.stepCount, (int32)(valueNormalized * (info.valueDesc.stepCount + 1))); - wrapper.printInt (value); - } - else - { - wrapper.printFloat (valueNormalized, precision); - } - wrapper.copyTo (string, 128); - return kResultTrue; -} - -//----------------------------------------------------------------------------- -tresult NoteExpressionType::getValueByString (const TChar* string /*in*/, NoteExpressionValue& valueNormalized /*out*/) -{ - if (associatedParameter) - { - return associatedParameter->fromString (string, valueNormalized) ? kResultTrue : kResultFalse; - } - String wrapper (string); - if (info.valueDesc.stepCount > 0) - { - int32 value; - if (wrapper.scanInt32 (value) && value <= info.valueDesc.stepCount) - { - valueNormalized = (NoteExpressionValue)value / (NoteExpressionValue)info.valueDesc.stepCount; - return kResultTrue; - } - return kResultFalse; - } - double value; - wrapper.scanFloat (value); - if (value < info.valueDesc.minimum) - return kResultFalse; - if (value > info.valueDesc.maximum) - return kResultFalse; - valueNormalized = value; - return kResultTrue; -} - -//----------------------------------------------------------------------------- -RangeNoteExpressionType::RangeNoteExpressionType (NoteExpressionTypeID _typeId, const TChar* _title, const TChar* _shortTitle, const TChar* _units, - int32 _unitId, NoteExpressionValue _defaultPlainValue, NoteExpressionValue _plainMin, NoteExpressionValue _plainMax, - int32 _flags, int32 _precision) -: NoteExpressionType (_typeId, _title, _shortTitle, _units, _unitId, 0, 0, 1, 0, _flags, _precision) -, plainMin (_plainMin) -, plainMax (_plainMax) -{ - info.valueDesc.defaultValue = (_defaultPlainValue - getMin ()) / (getMax () - getMin ()); -} - -//----------------------------------------------------------------------------- -tresult RangeNoteExpressionType::getStringByValue (NoteExpressionValue valueNormalized /*in*/, String128 string /*out*/) -{ - NoteExpressionValue plain = valueNormalized * (getMax () - getMin ()) + getMin (); - UString128 wrapper; - wrapper.printFloat (plain, precision); - wrapper.copyTo (string, 128); - return kResultTrue; -} - -//----------------------------------------------------------------------------- -tresult RangeNoteExpressionType::getValueByString (const TChar* string /*in*/, NoteExpressionValue& valueNormalized /*out*/) -{ - String wrapper (string); - double value = 0; - if (wrapper.scanFloat (value)) - { - value = (value - getMin ()) / (getMax () - getMin ()); - if (value >= 0. && value <= 1.) - { - valueNormalized = value; - return kResultTrue; - } - } - return kResultFalse; -} - -//----------------------------------------------------------------------------- -NoteExpressionTypeContainer::NoteExpressionTypeContainer () -{ -} - -//----------------------------------------------------------------------------- -bool NoteExpressionTypeContainer::addNoteExpressionType (NoteExpressionType* noteExpType) -{ - return noteExps.addKeyAndObject (noteExpType->getInfo ().typeId, IPtr (noteExpType, false)); -} - -//----------------------------------------------------------------------------- -bool NoteExpressionTypeContainer::removeNoteExpressionType (NoteExpressionTypeID typeId) -{ - return noteExps.removeKey (typeId); -} - -//----------------------------------------------------------------------------- -void NoteExpressionTypeContainer::removeAll () -{ - noteExps.removeAll (); -} - -//----------------------------------------------------------------------------- -NoteExpressionType* NoteExpressionTypeContainer::getNoteExpressionType (NoteExpressionTypeID typeId) -{ - return noteExps.lookupObject (typeId); -} - -//----------------------------------------------------------------------------- -int32 NoteExpressionTypeContainer::getNoteExpressionCount () -{ - return noteExps.total (); -} - -//----------------------------------------------------------------------------- -tresult NoteExpressionTypeContainer::getNoteExpressionInfo (int32 noteExpressionIndex, NoteExpressionTypeInfo& info /*out*/) -{ - TAssociation > assoc = noteExps.at (noteExpressionIndex); - if (assoc.object ()) - { - memcpy (&info, &assoc.object ()->getInfo (), sizeof (info)); - return kResultTrue; - } - return kResultFalse; -} - -//----------------------------------------------------------------------------- -tresult NoteExpressionTypeContainer::getNoteExpressionStringByValue (NoteExpressionTypeID id, NoteExpressionValue valueNormalized /*in*/, String128 string /*out*/) -{ - NoteExpressionType* noteExpType = getNoteExpressionType (id); - if (noteExpType) - { - return noteExpType->getStringByValue (valueNormalized, string); - } - return kResultFalse; -} - -//----------------------------------------------------------------------------- -tresult NoteExpressionTypeContainer::getNoteExpressionValueByString (NoteExpressionTypeID id, const TChar* string /*in*/, NoteExpressionValue& valueNormalized /*out*/) -{ - NoteExpressionType* noteExpType = getNoteExpressionType (id); - if (noteExpType) - { - return noteExpType->getValueByString (string, valueNormalized); - } - return kResultFalse; -} - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg diff --git a/vst/public.sdk/source/vst/vstnoteexpressiontypes.h b/vst/public.sdk/source/vst/vstnoteexpressiontypes.h deleted file mode 100644 index 85b8f2bb..00000000 --- a/vst/public.sdk/source/vst/vstnoteexpressiontypes.h +++ /dev/null @@ -1,146 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/vstnoteexpressiontypes.h -// Created by : Steinberg, 12/2010 -// Description : VST Note Expression Type Info Implementation -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#pragma once - -#include "pluginterfaces/vst/ivstnoteexpression.h" -#include "base/source/fobject.h" -#include "base/source/tdictionary.h" - -namespace Steinberg { -namespace Vst { -class Parameter; - -//------------------------------------------------------------------------ -/** Note expression type object. -\ingroup vstClasses */ -//----------------------------------------------------------------------------- -class NoteExpressionType : public FObject -{ -public: - NoteExpressionType (); - NoteExpressionType (const NoteExpressionTypeInfo& info); - NoteExpressionType (NoteExpressionTypeID typeId, const TChar* title, const TChar* shortTitle, const TChar* units, - int32 unitId, NoteExpressionValue defaultValue, NoteExpressionValue minimum, NoteExpressionValue maximum, - int32 stepCount, int32 flags = 0, int32 precision = 4); - NoteExpressionType (NoteExpressionTypeID typeId, const TChar* title, const TChar* shortTitle, const TChar* units, - int32 unitId, Parameter* associatedParameter, int32 flags = 0); - - /** get the underlying NoteExpressionTypeInfo struct */ - NoteExpressionTypeInfo& getInfo () { return info; } - - /** convert a note expression value to a readable string */ - virtual tresult getStringByValue (NoteExpressionValue valueNormalized /*in*/, String128 string /*out*/); - /** convert a readable string to a note expression value */ - virtual tresult getValueByString (const TChar* string /*in*/, NoteExpressionValue& valueNormalized /*out*/); - - /** gets the current precision (used for string representation of float) */ - int32 getPrecision () const { return precision;} - /** Sets the precision for string representation of float value (for example 4.34 with 2 as precision) */ - void setPrecision (int32 val) { precision = val;} -//----------------------------------------------------------------------------- - OBJ_METHODS(NoteExpressionType, FObject) -protected: - NoteExpressionTypeInfo info; - IPtr associatedParameter; - int32 precision; -}; - -//------------------------------------------------------------------------ -/** Note expression type object representing a custom range. -\ingroup vstClasses */ -//----------------------------------------------------------------------------- -class RangeNoteExpressionType : public NoteExpressionType -{ -public: - RangeNoteExpressionType (NoteExpressionTypeID typeId, const TChar* title, const TChar* shortTitle, const TChar* units, - int32 unitId, NoteExpressionValue defaultPlainValue, NoteExpressionValue plainMin, NoteExpressionValue plainMax, - int32 flags = 0, int32 precision = 4); - - /** Gets the minimum plain value */ - virtual ParamValue getMin () const {return plainMin;} - /** Sets the minimum plain value */ - virtual void setMin (ParamValue value) {plainMin = value;} - /** Gets the maximum plain value */ - virtual ParamValue getMax () const {return plainMax;} - /** Sets the maximum plain value */ - virtual void setMax (ParamValue value) {plainMax = value;} - - virtual tresult getStringByValue (NoteExpressionValue valueNormalized /*in*/, String128 string /*out*/); - virtual tresult getValueByString (const TChar* string /*in*/, NoteExpressionValue& valueNormalized /*out*/); -//----------------------------------------------------------------------------- - OBJ_METHODS(RangeNoteExpressionType, NoteExpressionType) -protected: - NoteExpressionValue plainMin; - NoteExpressionValue plainMax; -}; - -//------------------------------------------------------------------------ -/** Collection of note expression types. -\ingroup vstClasses */ -//------------------------------------------------------------------------ -class NoteExpressionTypeContainer : public FObject -{ -public: - /** default constructor */ - NoteExpressionTypeContainer (); - - /** add a note expression type. The container owns the type. No need to release it afterwards. */ - bool addNoteExpressionType (NoteExpressionType* noteExpType); - /** remove a note expression type */ - bool removeNoteExpressionType (NoteExpressionTypeID typeId); - /** remove all note expression types */ - void removeAll (); - - /** get a note expression type object by ID */ - NoteExpressionType* getNoteExpressionType (NoteExpressionTypeID typeId); - - /** get the number of note expression types */ - int32 getNoteExpressionCount (); - - /** get note expression info */ - tresult getNoteExpressionInfo (int32 noteExpressionIndex, NoteExpressionTypeInfo& info /*out*/); - /** convert a note expression value to a readable string */ - tresult getNoteExpressionStringByValue (NoteExpressionTypeID id, NoteExpressionValue valueNormalized /*in*/, String128 string /*out*/); - /** convert a string to a note expression value */ - tresult getNoteExpressionValueByString (NoteExpressionTypeID id, const TChar* string /*in*/, NoteExpressionValue& valueNormalized /*out*/); -//----------------------------------------------------------------------------- - OBJ_METHODS(NoteExpressionTypeContainer, FObject) -protected: - TDictionary > noteExps; -}; - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg diff --git a/vst/public.sdk/source/vst/vstparameters.cpp b/vst/public.sdk/source/vst/vstparameters.cpp deleted file mode 100644 index 76db8f3f..00000000 --- a/vst/public.sdk/source/vst/vstparameters.cpp +++ /dev/null @@ -1,451 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/vstparameters.cpp -// Created by : Steinberg, 03/2008 -// Description : VST Parameter Implementation -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#include "vstparameters.h" -#include "pluginterfaces/base/futils.h" -#include "pluginterfaces/base/ustring.h" -#include "base/source/fstring.h" - -namespace Steinberg { -namespace Vst { - -//------------------------------------------------------------------------ -// Parameter Implementation -//------------------------------------------------------------------------ -Parameter::Parameter () -: valueNormalized (0.) -, precision (4) -{ - memset (&info, 0, sizeof (ParameterInfo)); -} - -//------------------------------------------------------------------------ -Parameter::Parameter (const ParameterInfo& info) -: info (info) -, valueNormalized (info.defaultNormalizedValue) -, precision (4) -{} - -//------------------------------------------------------------------------ -Parameter::Parameter (const TChar* title, ParamID tag, const TChar* units, ParamValue defaultValueNormalized, int32 stepCount, int32 flags, UnitID unitID) -: precision (4) -{ - memset (&info, 0, sizeof (ParameterInfo)); - - UString (info.title, str16BufferSize (String128)).assign (title); - if (units) - UString (info.units, str16BufferSize (String128)).assign (units); - - info.stepCount = stepCount; - info.defaultNormalizedValue = valueNormalized = defaultValueNormalized; - info.flags = flags; - info.id = tag; - info.unitId = unitID; -} - -//------------------------------------------------------------------------ -Parameter::~Parameter () -{} - -//------------------------------------------------------------------------ -bool Parameter::setNormalized (ParamValue normValue) -{ - if (normValue > 1.0) - { - normValue = 1.0; - } - else if (normValue < 0.) - { - normValue = 0.; - } - - if (normValue != valueNormalized) - { - valueNormalized = normValue; - changed (); - return true; - } - return false; -} - -//------------------------------------------------------------------------ -void Parameter::toString (ParamValue normValue, String128 string) const -{ - UString128 wrapper; - if (info.stepCount == 1) - { - if (normValue > 0.5) - { - wrapper.assign (STR16 ("On")); - } - else - { - wrapper.assign (STR16 ("Off")); - } - } - else - { - wrapper.printFloat (normValue, precision); - } - wrapper.copyTo (string, 128); -} - -//------------------------------------------------------------------------ -bool Parameter::fromString (const TChar* string, ParamValue& normValue) const -{ - String wrapper ((TChar*)string); - return wrapper.scanFloat (normValue); -} - -//------------------------------------------------------------------------ -ParamValue Parameter::toPlain (ParamValue normValue) const -{ - return normValue; -} - -//------------------------------------------------------------------------ -ParamValue Parameter::toNormalized (ParamValue plainValue) const -{ - return plainValue; -} - - -//------------------------------------------------------------------------ -// RangeParameter Implementation -//------------------------------------------------------------------------ -RangeParameter::RangeParameter () -: minPlain (0) -, maxPlain (1) -{ -} - -//------------------------------------------------------------------------ -RangeParameter::RangeParameter (const ParameterInfo& paramInfo, ParamValue min, ParamValue max) -: Parameter (paramInfo) -, minPlain (min) -, maxPlain (max) -{ -} - -//------------------------------------------------------------------------ -RangeParameter::RangeParameter (const TChar* title, ParamID tag, const TChar* units, - ParamValue minPlain, ParamValue maxPlain, ParamValue defaultValuePlain, - int32 stepCount, int32 flags, UnitID unitID) -: minPlain (minPlain) -, maxPlain (maxPlain) -{ - UString (info.title, str16BufferSize (String128)).assign (title); - - UString uUnits (info.units, str16BufferSize (String128)); - if (units) - { - uUnits.assign (units); - } - - info.stepCount = stepCount; - info.defaultNormalizedValue = valueNormalized = toNormalized (defaultValuePlain); - info.flags = flags; - info.id = tag; - info.unitId = unitID; -} - -//------------------------------------------------------------------------ -void RangeParameter::toString (ParamValue _valueNormalized, String128 string) const -{ - if (info.stepCount > 1) - { - String wrapper; - wrapper.printf (STR("%d"), (int32)toPlain (_valueNormalized)); - wrapper.copyTo16 (string, 0, str16BufferSize (String128) - 1); - } - else - { - Parameter::toString (toPlain (_valueNormalized), string); - } -} - -//------------------------------------------------------------------------ -bool RangeParameter::fromString (const TChar* string, ParamValue& _valueNormalized) const -{ - String wrapper ((TChar*)string); - if (info.stepCount > 1) - { - int64 plainValue; - if (wrapper.scanInt64 (plainValue)) - { - _valueNormalized = toNormalized ((ParamValue)plainValue); - return true; - } - return false; - } - if (wrapper.scanFloat (_valueNormalized)) - { - if (_valueNormalized < getMin ()) - _valueNormalized = getMin (); - else if (_valueNormalized > getMax ()) - _valueNormalized = getMax (); - _valueNormalized = toNormalized (_valueNormalized); - return true; - } - return false; -} - -//------------------------------------------------------------------------ -ParamValue RangeParameter::toPlain (ParamValue _valueNormalized) const -{ - if (info.stepCount > 1) - return Min (info.stepCount, (int32)(_valueNormalized * (info.stepCount + 1))) + getMin (); - return _valueNormalized * (getMax () - getMin ()) + getMin (); -} - -//------------------------------------------------------------------------ -ParamValue RangeParameter::toNormalized (ParamValue plainValue) const -{ - if (info.stepCount > 1) - return (plainValue - getMin ()) / info.stepCount; - return (plainValue - getMin ()) / (getMax () - getMin ()); -} - - -//------------------------------------------------------------------------ -// StringListParameter Implementation -//------------------------------------------------------------------------ -StringListParameter::StringListParameter (const ParameterInfo& paramInfo) -: Parameter (paramInfo) -{ - strings.error () = 0; -} - -//------------------------------------------------------------------------ -StringListParameter::StringListParameter (const TChar* title, ParamID tag, const TChar* units, - int32 flags, UnitID unitID) -{ - strings.error () = 0; - - UString (info.title, str16BufferSize (String128)).assign (title); - - UString uUnits (info.units, str16BufferSize (String128)); - if (units) - { - uUnits.assign (units); - } - - info.stepCount = -1; - info.defaultNormalizedValue = 0; - info.flags = flags; - info.id = tag; - info.unitId = unitID; -} - -//------------------------------------------------------------------------ -StringListParameter::~StringListParameter () -{ - FOREACH_T(TChar*, str, strings) - free (str); - ENDFOR -} - -//------------------------------------------------------------------------ -void StringListParameter::appendString (const String128 string) -{ - int32 length = strlen16 (string); - TChar* buffer = (TChar*)malloc ((length + 1) * sizeof (TChar)); - if (!buffer) - return; - memcpy (buffer, string, length * sizeof (TChar)); - buffer[length] = 0; - strings.add (buffer); - info.stepCount++; -} - -//------------------------------------------------------------------------ -bool StringListParameter::replaceString (int32 index, const String128 string) -{ - TChar* str = strings.at (index); - if (!str) - return false; - - int32 length = strlen16 (string); - TChar* buffer = (TChar*)malloc ((length + 1) * sizeof (TChar)); - if (!buffer) - return false; - - memcpy (buffer, string, length * sizeof (TChar)); - buffer[length] = 0; - strings.replaceAt (index, buffer); - free (str); - return true; -} - -//------------------------------------------------------------------------ -void StringListParameter::toString (ParamValue _valueNormalized, String128 string) const -{ - int32 index = (int32)toPlain (_valueNormalized); - const TChar* valueString = strings.at (index); - if (valueString) - { - UString (string, str16BufferSize (String128)).assign (valueString); - } - else - string[0] = 0; -} - -//------------------------------------------------------------------------ -bool StringListParameter::fromString (const TChar* string, ParamValue& _valueNormalized) const -{ - int32 index = 0; - FOREACH_T(TChar*, str, strings) - if (strcmp16 (str, string) == 0) - { - _valueNormalized = toNormalized ((ParamValue)index); - return true; - } - index++; - ENDFOR - return false; -} - -//------------------------------------------------------------------------ -ParamValue StringListParameter::toPlain (ParamValue _valueNormalized) const -{ - if (info.stepCount <= 0) - return 0; - return Min (info.stepCount, (int32)(_valueNormalized * (info.stepCount + 1))); -} - -//------------------------------------------------------------------------ -ParamValue StringListParameter::toNormalized (ParamValue plainValue) const -{ - if (info.stepCount <= 0) - return 0; - return plainValue / (ParamValue)info.stepCount; -} - -//------------------------------------------------------------------------ -static uint32 HashFunc (const TAssociation& a, uint32 size) -{ - return a.key () % size; -} - -//------------------------------------------------------------------------ -// ParameterContainer Implementation -//------------------------------------------------------------------------ -ParameterContainer::ParameterContainer () -: params (0) -, id2index (THashDictionary(HashFunc)) -{ - id2index.error () = TAssociation (0, -1); -} - -//------------------------------------------------------------------------ -ParameterContainer::~ParameterContainer () -{ - if (params) - delete params; -} - -//------------------------------------------------------------------------ -void ParameterContainer::init (int32 initialSize, int32 resizeDelta) -{ - if (!params) - params = new TArray > (initialSize, resizeDelta); -} - -//------------------------------------------------------------------------ -Parameter* ParameterContainer::addParameter (Parameter* p) -{ - if (!params) - init (); - id2index.addKeyAndObject (p->getInfo ().id, params->total ()); - if (params->add (IPtr (p, false))) - return p; - return 0; -} - -//------------------------------------------------------------------------ -Parameter* ParameterContainer::addParameter (const ParameterInfo& info) -{ - if (!params) - init (); - Parameter* p = new Parameter (info); - if (addParameter (p)) - return p; - p->release (); - return 0; -} - -//------------------------------------------------------------------------ -Parameter* ParameterContainer::getParameter (ParamID tag) -{ - if (params) - { - int32 index = id2index.lookupObject (tag); - if (index != id2index.error ().object ()) - return params->at (index); - } - return 0; -} - -//------------------------------------------------------------------------ -Parameter* ParameterContainer::addParameter (const TChar* title, const TChar* units, - int32 stepCount, ParamValue defaultNormalizedValue, - int32 flags, int32 tag, UnitID unitID) -{ - if (!title) - { - return 0; - } - - ParameterInfo info = {0}; - - UString (info.title, str16BufferSize (String128)).assign (title); - - UString uUnits (info.units, str16BufferSize (String128)); - if (units) - { - uUnits.assign (units); - } - - info.stepCount = stepCount; - info.defaultNormalizedValue = defaultNormalizedValue; - info.flags = flags; - info.id = (tag >= 0) ? tag : getParameterCount (); - info.unitId = unitID; - - return addParameter (info); -} - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg diff --git a/vst/public.sdk/source/vst/vstparameters.h b/vst/public.sdk/source/vst/vstparameters.h deleted file mode 100644 index 3c1b30d9..00000000 --- a/vst/public.sdk/source/vst/vstparameters.h +++ /dev/null @@ -1,226 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/vstparameters.h -// Created by : Steinberg, 03/2008 -// Description : VST Parameter Implementation -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#pragma once - -#include "base/source/tarray.h" -#include "base/source/tdictionary.h" -#include "base/source/fobject.h" -#include "base/source/fcontainer.h" -#include "pluginterfaces/vst/ivsteditcontroller.h" -#include "pluginterfaces/vst/ivstunits.h" - -//------------------------------------------------------------------------ -namespace Steinberg { -namespace Vst { - - -//------------------------------------------------------------------------ -/** Description of a Parameter. -\ingroup vstClasses */ -//------------------------------------------------------------------------ -class Parameter: public FObject -{ -public: -//------------------------------------------------------------------------ - Parameter (); - Parameter (const ParameterInfo&); - Parameter (const TChar* title, ParamID tag, const TChar* units = 0, - ParamValue defaultValueNormalized = 0., int32 stepCount = 0, - int32 flags = ParameterInfo::kCanAutomate, UnitID unitID = kRootUnitId); - virtual ~Parameter (); - - /** Returns its readonly info. */ - const ParameterInfo& getInfo () const {return info;} - - /** Returns its writeable info. */ - ParameterInfo& getInfo () {return info;} - - /** Sets its associated UnitId. */ - void setUnitID (UnitID id) {info.unitId = id;} - /** Gets its associated UnitId. */ - UnitID getUnitID () {return info.unitId;} - - /** Gets its normalized value [0.0, 1.0]. */ - ParamValue getNormalized () const { return valueNormalized; } - /** Sets its normalized value [0.0, 1.0]. */ - virtual bool setNormalized (ParamValue v); - - /** Converts a normalized value to a string. */ - virtual void toString (ParamValue valueNormalized, String128 string) const; - /** Converts a string to a normalized value. */ - virtual bool fromString (const TChar* string, ParamValue& valueNormalized) const; - - /** Converts a normalized value to plain value (e.g. 0.5 to 10000.0Hz). */ - virtual ParamValue toPlain (ParamValue valueNormalized) const; - /** Converts a plain value to a normalized value (e.g. 10000 to 0.5). */ - virtual ParamValue toNormalized (ParamValue plainValue) const; - - /** Gets the current precision (used for string representation of float). */ - int32 getPrecision () const { return precision;} - /** Sets the precision for string representation of float value (for example 4.34 with 2 as precision). */ - void setPrecision (int32 val) { precision = val;} - - OBJ_METHODS (Parameter, FObject) -//------------------------------------------------------------------------ -protected: - ParameterInfo info; - ParamValue valueNormalized; - int32 precision; -}; - -//------------------------------------------------------------------------ -/** Description of a RangeParameter. -\ingroup vstClasses */ -//------------------------------------------------------------------------ -class RangeParameter : public Parameter -{ -public: -//------------------------------------------------------------------------ - RangeParameter (const ParameterInfo& paramInfo, ParamValue min, ParamValue max); - RangeParameter (const TChar* title, ParamID tag, const TChar* units = 0, - ParamValue minPlain = 0., ParamValue maxPlain = 1., ParamValue defaultValuePlain = 0., - int32 stepCount = 0, int32 flags = ParameterInfo::kCanAutomate, UnitID unitID = kRootUnitId); - - /** Gets the minimum plain value, same as toPlain (0). */ - virtual ParamValue getMin () const {return minPlain;} - /** Sets the minimum plain value. */ - virtual void setMin (ParamValue value) {minPlain = value;} - /** Gets the maximum plain value, same as toPlain (1). */ - virtual ParamValue getMax () const {return maxPlain;} - /** Sets the maximum plain value. */ - virtual void setMax (ParamValue value) {maxPlain = value;} - - /** Converts a normalized value to a string. */ - virtual void toString (ParamValue _valueNormalized, String128 string) const; - /** Converts a string to a normalized value. */ - virtual bool fromString (const TChar* string, ParamValue& _valueNormalized) const; - - /** Converts a normalized value to plain value (e.g. 0.5 to 10000.0Hz). */ - virtual ParamValue toPlain (ParamValue _valueNormalized) const; - /** Converts a plain value to a normalized value (e.g. 10000 to 0.5). */ - virtual ParamValue toNormalized (ParamValue plainValue) const; - - OBJ_METHODS (RangeParameter, Parameter) -//------------------------------------------------------------------------ -protected: - RangeParameter (); - - ParamValue minPlain; - ParamValue maxPlain; -}; - -//------------------------------------------------------------------------ -/** Description of a StringListParameter. -\ingroup vstClasses */ -//------------------------------------------------------------------------ -class StringListParameter : public Parameter -{ -public: -//------------------------------------------------------------------------ - StringListParameter (const ParameterInfo& paramInfo); - StringListParameter (const TChar* title, ParamID tag, const TChar* units = 0, - int32 flags = ParameterInfo::kCanAutomate | ParameterInfo::kIsList, UnitID unitID = kRootUnitId); - virtual ~StringListParameter (); - - /** Appends a string and increases the stepCount. */ - virtual void appendString (const String128 string); - /** Replaces the string at index. Index must be between 0 and stepCount+1 */ - virtual bool replaceString (int32 index, const String128 string); - - /** Converts a normalized value to a string. */ - virtual void toString (ParamValue _valueNormalized, String128 string) const; - /** Converts a string to a normalized value. */ - virtual bool fromString (const TChar* string, ParamValue& _valueNormalized) const; - - /** Converts a normalized value to plain value (e.g. 0.5 to 10000.0Hz). */ - virtual ParamValue toPlain (ParamValue _valueNormalized) const; - /** Converts a plain value to a normalized value (e.g. 10000 to 0.5). */ - virtual ParamValue toNormalized (ParamValue plainValue) const; - - OBJ_METHODS (StringListParameter, Parameter) -//------------------------------------------------------------------------ -protected: - TArray strings; -}; - -//------------------------------------------------------------------------ -/** Collection of parameters. -\ingroup vstClasses */ -//------------------------------------------------------------------------ -class ParameterContainer -{ -public: -//------------------------------------------------------------------------ - ParameterContainer (); - ~ParameterContainer (); - - /** Init param array. */ - void init (int32 initialSize = 10, int32 resizeDelta = 100); - - /** Creates and adds a new parameter from a ParameterInfo. */ - Parameter* addParameter (const ParameterInfo& info); - - /** Creates and adds a new parameter with given properties. */ - Parameter* addParameter (const TChar* title, const TChar* units = 0, - int32 stepCount = 0, - ParamValue defaultValueNormalized = 0., - int32 flags = ParameterInfo::kCanAutomate, - int32 tag = -1, - UnitID unitID = kRootUnitId); - - /** Adds a given parameter. */ - Parameter* addParameter (Parameter* p); - - /** Returns the count of parameters. */ - int32 getParameterCount () const { return params ? params->total () : 0; } - - /** Gets parameter by index. */ - Parameter* getParameterByIndex (int32 index) { return params ? params->at (index) : 0; } - - /** Removes all parameters. */ - void removeAll () { if (params) params->removeAll (); id2index.removeAll (); } - - /** Gets parameter by ID. */ - Parameter* getParameter (ParamID tag); - -//------------------------------------------------------------------------ -protected: - TArray >* params; - THashDictionary id2index; -}; - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg diff --git a/vst/public.sdk/source/vst/vstpresetfile.cpp b/vst/public.sdk/source/vst/vstpresetfile.cpp deleted file mode 100644 index 94067bf5..00000000 --- a/vst/public.sdk/source/vst/vstpresetfile.cpp +++ /dev/null @@ -1,887 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/vstpresetfile.cpp -// Created by : Steinberg, 03/2006 -// Description : VST 3 Preset File Format -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#include "vstpresetfile.h" - - -namespace Steinberg { -namespace Vst { - -//------------------------------------------------------------------------ -// Preset Chunk IDs -//------------------------------------------------------------------------ -static const ChunkID commonChunks[kNumPresetChunks] = -{ - {'V', 'S', 'T', '3'}, // kHeader - {'C', 'o', 'm', 'p'}, // kComponentState - {'C', 'o', 'n', 't'}, // kControllerState - {'P', 'r', 'o', 'g'}, // kProgramData - {'I', 'n', 'f', 'o'}, // kMetaInfo - {'L', 'i', 's', 't'} // kChunkList -}; - -//------------------------------------------------------------------------ -// Preset Header: header id + version + class id + list offset -static const int32 kFormatVersion = 1; -static const int32 kClassIDSize = 32; // ASCII-encoded FUID -static const int32 kHeaderSize = sizeof (ChunkID) + sizeof (int32) + kClassIDSize + sizeof (TSize); -static const int32 kListOffsetPos = kHeaderSize - sizeof (TSize); - -//------------------------------------------------------------------------ -const ChunkID& getChunkID (ChunkType type) -{ - return commonChunks[type]; -} - -#ifdef verify -#undef verify -#endif - -//------------------------------------------------------------------------ -inline bool verify (tresult result) -{ - return result == kResultOk || result == kNotImplemented; -} - -//------------------------------------------------------------------------ -// PresetFile -//------------------------------------------------------------------------ -bool PresetFile::savePreset (IBStream* stream, const FUID& classID, - IComponent* component, IEditController* editController, - const char* xmlBuffer, int32 xmlSize) -{ - PresetFile pf (stream); - pf.setClassID (classID); - if (!pf.writeHeader ()) - return false; - - if (!pf.storeComponentState (component)) - return false; - - if (editController && !pf.storeControllerState (editController)) - return false; - - if (xmlBuffer && !pf.writeMetaInfo (xmlBuffer, xmlSize)) - return false; - - return pf.writeChunkList (); -} - -//------------------------------------------------------------------------ -bool PresetFile::loadPreset (IBStream* stream, const FUID& classID, IComponent* component, - IEditController* editController, TArray* otherClassIDArray) -{ - PresetFile pf (stream); - if (!pf.readChunkList ()) - return false; - - if (pf.getClassID () != classID) - { - if (otherClassIDArray) - { - if (!otherClassIDArray->contains (pf.getClassID ())) - return false; - } - else - return false; - } - - if (!pf.restoreComponentState (component)) - return false; - - if (editController) - { - // assign component state to controller - if (!pf.restoreComponentState (editController)) - return false; - - // restore controller-only state (if present) - if (pf.contains (kControllerState) && !pf.restoreControllerState (editController)) - return false; - } - return true; -} - -//------------------------------------------------------------------------ -PresetFile::PresetFile (IBStream* stream) -: stream (stream) -, entryCount (0) -{ - memset (entries, 0, sizeof (entries)); - - if (stream) - stream->addRef (); -} - -//------------------------------------------------------------------------ -PresetFile::~PresetFile () -{ - if (stream) - stream->release (); -} - -//------------------------------------------------------------------------ -const PresetFile::Entry* PresetFile::getEntry (ChunkType which) const -{ - const ChunkID& id = getChunkID (which); - for (int32 i = 0; i < entryCount; i++) - if (isEqualID (entries[i].id, id)) - return &entries[i]; - return 0; -} - -//------------------------------------------------------------------------ -const PresetFile::Entry* PresetFile::getLastEntry () const -{ - return entryCount > 0 ? &entries[entryCount - 1] : 0; -} - -//------------------------------------------------------------------------ -bool PresetFile::readID (ChunkID id) -{ - int32 numBytesRead = 0; - stream->read (id, sizeof (ChunkID), &numBytesRead); - return numBytesRead == sizeof (ChunkID); -} - -//------------------------------------------------------------------------ -bool PresetFile::writeID (const ChunkID id) -{ - int32 numBytesWritten = 0; - stream->write ((void*)id, sizeof (ChunkID), &numBytesWritten); - return numBytesWritten == sizeof (ChunkID); -} - -//------------------------------------------------------------------------ -bool PresetFile::readEqualID (const ChunkID id) -{ - ChunkID temp = {0}; - return readID (temp) && isEqualID (temp, id); -} - -//------------------------------------------------------------------------ -bool PresetFile::readSize (TSize& size) -{ - int32 numBytesRead = 0; - stream->read (&size, sizeof (TSize), &numBytesRead); -#if BYTEORDER == kBigEndian - SWAP_64 (size) -#endif - return numBytesRead == sizeof (TSize); -} - -//------------------------------------------------------------------------ -bool PresetFile::writeSize (TSize size) -{ -#if BYTEORDER == kBigEndian - SWAP_64 (size) -#endif - int32 numBytesWritten = 0; - stream->write (&size, sizeof (TSize), &numBytesWritten); - return numBytesWritten == sizeof (TSize); -} - -//------------------------------------------------------------------------ -bool PresetFile::readInt32 (int32& value) -{ - int32 numBytesRead = 0; - stream->read (&value, sizeof (int32), &numBytesRead); -#if BYTEORDER == kBigEndian - SWAP_32 (value) -#endif - return numBytesRead == sizeof (int32); -} - -//------------------------------------------------------------------------ -bool PresetFile::writeInt32 (int32 value) -{ -#if BYTEORDER == kBigEndian - SWAP_32 (value) -#endif - int32 numBytesWritten = 0; - stream->write (&value, sizeof (int32), &numBytesWritten); - return numBytesWritten == sizeof (int32); -} - -//------------------------------------------------------------------------ -bool PresetFile::seekTo (TSize offset) -{ - int64 result = -1; - stream->seek (offset, IBStream::kIBSeekSet, &result); - return result == offset; -} - -//------------------------------------------------------------------------ -bool PresetFile::readChunkList () -{ - seekTo (0); - entryCount = 0; - - char8 classString[kClassIDSize + 1] = {0}; - - // Read header - int32 version = 0; - TSize listOffset = 0; - if (!(readEqualID (getChunkID (kHeader)) && - readInt32 (version) && - verify (stream->read (classString, kClassIDSize)) && - readSize (listOffset) && - listOffset > 0 && - seekTo (listOffset))) - return false; - - classID.fromString (classString); - - // Read list - int32 count = 0; - if (!readEqualID (getChunkID (kChunkList))) - return false; - if (!readInt32 (count)) - return false; - - if (count > kMaxEntries) - count = kMaxEntries; - - for (int32 i = 0; i < count; i++) - { - Entry& e = entries[i]; - if (!(readID (e.id) && - readSize (e.offset) && - readSize (e.size))) - break; - - entryCount++; - } - - return entryCount > 0; -} - -//------------------------------------------------------------------------ -bool PresetFile::writeHeader () -{ - // header id + version + class id + list offset (unknown yet) - - char8 classString[kClassIDSize + 1] = {0}; - classID.toString (classString); - - return seekTo (0) && - writeID (getChunkID (kHeader)) && - writeInt32 (kFormatVersion) && - verify (stream->write (classString, kClassIDSize)) && - writeSize (0); -} - -//------------------------------------------------------------------------ -bool PresetFile::writeChunkList () -{ - // Update list offset - TSize pos = 0; - stream->tell (&pos); - if (!(seekTo (kListOffsetPos) && - writeSize (pos) && - seekTo (pos))) - return false; - - // Write list - if (!writeID (getChunkID (kChunkList))) - return false; - if (!writeInt32 (entryCount)) - return false; - - for (int32 i = 0; i < entryCount; i++) - { - Entry& e = entries[i]; - if (!(writeID (e.id) && - writeSize (e.offset) && - writeSize (e.size))) - return false; - } - return true; -} - -//------------------------------------------------------------------------ -bool PresetFile::beginChunk (Entry& e, ChunkType which) -{ - if (entryCount >= kMaxEntries) - return false; - - const ChunkID& id = getChunkID (which); - memcpy (e.id, &id, sizeof (ChunkID)); - stream->tell (&e.offset); - e.size = 0; - return true; -} - -//------------------------------------------------------------------------ -bool PresetFile::endChunk (Entry& e) -{ - if (entryCount >= kMaxEntries) - return false; - - TSize pos = 0; - stream->tell (&pos); - e.size = pos - e.offset; - entries[entryCount++] = e; - return true; -} - -//------------------------------------------------------------------------ -bool PresetFile::readMetaInfo (char* xmlBuffer, int32& size) -{ - bool result = false; - const Entry* e = getEntry (kMetaInfo); - if (e) - { - if (xmlBuffer) - { - result = seekTo (e->offset) && - verify (stream->read (xmlBuffer, size, &size)); - } - else - { - size = (int32)e->size; - result = size > 0; - } - } - return result; -} - -//------------------------------------------------------------------------ -bool PresetFile::writeMetaInfo (const char* xmlBuffer, int32 size, bool forceWriting) -{ - if (contains (kMetaInfo)) // already exists! - { - if (!forceWriting) - return false; - } - if (!prepareMetaInfoUpdate ()) - return false; - - if (size == -1) - size = (int32)strlen (xmlBuffer); - - Entry e = {0}; - return beginChunk (e, kMetaInfo) && - verify (stream->write ((void*)xmlBuffer, size)) && - endChunk (e); -} - -//------------------------------------------------------------------------ -bool PresetFile::prepareMetaInfoUpdate () -{ - TSize writePos = 0; - const Entry* e = getEntry (kMetaInfo); - if (e) - { - // meta info must be the last entry! - if (e != getLastEntry ()) - return false; - - writePos = e->offset; - entryCount--; - } - else - { - // entries must be sorted ascending by offset! - e = getLastEntry (); - writePos = e ? e->offset + e->size : kHeaderSize; - } - - return seekTo (writePos); -} - -//------------------------------------------------------------------------ -bool PresetFile::writeChunk (const void* data, int32 size, ChunkType which) -{ - if (contains (which)) // already exists! - return false; - - Entry e = {0}; - return beginChunk (e, which) && - verify (stream->write ((void*)data, size)) && - endChunk (e); -} - -//------------------------------------------------------------------------ -bool PresetFile::seekToComponentState () -{ - const Entry* e = getEntry (kComponentState); - return e && seekTo (e->offset); -} - -//------------------------------------------------------------------------ -bool PresetFile::storeComponentState (IComponent* component) -{ - if (contains (kComponentState)) // already exists! - return false; - - Entry e = {0}; - return beginChunk (e, kComponentState) && - verify (component->getState (stream)) && - endChunk (e); -} - -//------------------------------------------------------------------------ -bool PresetFile::restoreComponentState (IComponent* component) -{ - const Entry* e = getEntry (kComponentState); - if (e) - { - ReadOnlyBStream* readOnlyBStream = new ReadOnlyBStream (stream, e->offset, e->size); - FReleaser readOnlyBStreamReleaser (readOnlyBStream); - return verify (component->setState (readOnlyBStream)); - } - return false; -} - -//------------------------------------------------------------------------ -bool PresetFile::restoreComponentState (IEditController* editController) -{ - const Entry* e = getEntry (kComponentState); - if (e) - { - ReadOnlyBStream* readOnlyBStream = new ReadOnlyBStream (stream, e->offset, e->size); - FReleaser readOnlyBStreamReleaser (readOnlyBStream); - return verify (editController->setComponentState (readOnlyBStream)); - } - return false; -} - -//------------------------------------------------------------------------ -bool PresetFile::seekToControllerState () -{ - const Entry* e = getEntry (kControllerState); - return e && seekTo (e->offset); -} - -//------------------------------------------------------------------------ -bool PresetFile::storeControllerState (IEditController* editController) -{ - if (contains (kControllerState)) // already exists! - return false; - - Entry e = {0}; - return beginChunk (e, kControllerState) && - verify (editController->getState (stream)) && - endChunk (e); -} - -//------------------------------------------------------------------------ -bool PresetFile::restoreControllerState (IEditController* editController) -{ - const Entry* e = getEntry (kControllerState); - if (e) - { - ReadOnlyBStream* readOnlyBStream = new ReadOnlyBStream (stream, e->offset, e->size); - FReleaser readOnlyBStreamReleaser (readOnlyBStream); - return verify (editController->setState (readOnlyBStream)); - } - return false; -} - -//------------------------------------------------------------------------ -bool PresetFile::storeProgramData (IBStream* inStream, ProgramListID listID) -{ - if (contains (kProgramData)) // already exists! - return false; - - writeHeader (); - - Entry e = {0}; - if (beginChunk (e, kProgramData)) - { - if (writeInt32 (listID)) - { - int8 buffer[8192]; - int32 read = 0; - int32 written = 0; - while (inStream->read (buffer, 8192, &read) == kResultTrue && read > 0) - { - if (stream->write (buffer, read, &written) != kResultTrue) - { - return false; - } - } - return endChunk (e); - } - } - return false; -} - -//------------------------------------------------------------------------ -bool PresetFile::storeProgramData (IProgramListData* programListData, ProgramListID listID, int32 programIndex) -{ - if (contains (kProgramData)) // already exists! - return false; - - writeHeader (); - - Entry e = {0}; - return beginChunk (e, kProgramData) && - writeInt32 (listID) && - verify (programListData->getProgramData (listID, programIndex, stream)) && - endChunk (e); -} - -//------------------------------------------------------------------------ -bool PresetFile::restoreProgramData (IProgramListData* programListData, ProgramListID* programListID, int32 programIndex) -{ - const Entry* e = getEntry (kProgramData); - ProgramListID savedProgramListID = -1; - if (e && seekTo (e->offset)) - { - if (readInt32 (savedProgramListID)) - { - if (programListID && *programListID != savedProgramListID) - return false; - - int32 alreadyRead = sizeof (int32); - ReadOnlyBStream* readOnlyBStream = new ReadOnlyBStream (stream, e->offset + alreadyRead, e->size - alreadyRead); - FReleaser readOnlyBStreamReleaser (readOnlyBStream); - return programListData && verify (programListData->setProgramData (savedProgramListID, programIndex, readOnlyBStream)); - } - } - return false; -} - -//------------------------------------------------------------------------ -bool PresetFile::storeProgramData (IUnitData* unitData, UnitID unitID) -{ - if (contains (kProgramData)) // already exists! - return false; - - writeHeader (); - - Entry e = {0}; - return beginChunk (e, kProgramData) && - writeInt32 (unitID) && - verify (unitData->getUnitData (unitID, stream)) && - endChunk (e); -} - -//------------------------------------------------------------------------ -bool PresetFile::restoreProgramData (IUnitData* unitData, UnitID* unitId) -{ - const Entry* e = getEntry (kProgramData); - UnitID savedUnitID = -1; - if (e && seekTo (e->offset)) - { - if (readInt32 (savedUnitID)) - { - if (unitId && *unitId != savedUnitID) - return false; - - int32 alreadyRead = sizeof (int32); - ReadOnlyBStream* readOnlyBStream = new ReadOnlyBStream (stream, e->offset + alreadyRead, e->size - alreadyRead); - FReleaser readOnlyStreamReleaser (readOnlyBStream); - return (unitData && verify (unitData->setUnitData (savedUnitID, readOnlyBStream))); - } - } - return false; -} - -//------------------------------------------------------------------------ -bool PresetFile::restoreProgramData (IUnitInfo* unitInfo, int32 unitProgramListID, int32 programIndex) -{ - const Entry* e = getEntry (kProgramData); - int32 savedProgramListID = -1; - if (e && seekTo (e->offset)) - { - if (readInt32 (savedProgramListID)) - { - if (unitProgramListID != savedProgramListID) - return false; - - int32 alreadyRead = sizeof (int32); - ReadOnlyBStream* readOnlyBStream = new ReadOnlyBStream (stream, e->offset + alreadyRead, e->size - alreadyRead); - FReleaser readOnlyStreamReleaser (readOnlyBStream); - return (unitInfo && unitInfo->setUnitProgramData (unitProgramListID, programIndex, readOnlyBStream)); - } - } - return false; -} - -//------------------------------------------------------------------------ -bool PresetFile::getUnitProgramListID (int32& unitProgramListID) -{ - const Entry* e = getEntry (kProgramData); - if (e && seekTo (e->offset)) - { - if (readInt32 (unitProgramListID)) - { - return true; - } - } - return false; -} - - -//------------------------------------------------------------------------ -// FileStream implementation -//------------------------------------------------------------------------ -IBStream* FileStream::open (const char* filename, const char* mode) -{ - FILE* file = fopen (filename, mode); - return file ? new FileStream (file) : 0; -} - -//------------------------------------------------------------------------ -FileStream::FileStream (FILE* file) -: file (file) -{ - FUNKNOWN_CTOR -} - -//------------------------------------------------------------------------ -FileStream::~FileStream () -{ - fclose (file); - FUNKNOWN_DTOR -} - -//------------------------------------------------------------------------ -IMPLEMENT_FUNKNOWN_METHODS (FileStream, IBStream, IBStream::iid) - -//------------------------------------------------------------------------ -tresult PLUGIN_API FileStream::read (void* buffer, int32 numBytes, int32* numBytesRead) -{ - size_t result = fread (buffer, 1, numBytes, file); - if (numBytesRead) - *numBytesRead = (int32)result; - return result == numBytes ? kResultOk : kResultFalse; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API FileStream::write (void* buffer, int32 numBytes, int32* numBytesWritten) -{ - size_t result = fwrite (buffer, 1, numBytes, file); - if (numBytesWritten) - *numBytesWritten = (int32)result; - return result == numBytes ? kResultOk : kResultFalse; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API FileStream::seek (int64 pos, int32 mode, int64* result) -{ - if (fseek (file, (int32)pos, mode) == 0) - { - if (result) - *result = ftell (file); - return kResultOk; - } - return kResultFalse; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API FileStream::tell (int64* pos) -{ - if (pos) - *pos = ftell (file); - return kResultOk; -} - - -//------------------------------------------------------------------------ -// ReadOnlyBStream implementation -//------------------------------------------------------------------------ - -IMPLEMENT_REFCOUNT (ReadOnlyBStream) - -//------------------------------------------------------------------------ -ReadOnlyBStream::ReadOnlyBStream (IBStream* sourceStream, TSize sourceOffset, TSize sectionSize) -: sourceStream (sourceStream) -, sourceOffset (sourceOffset) -, sectionSize (sectionSize) -, seekPosition (0) -{ - FUNKNOWN_CTOR - if (sourceStream) - sourceStream->addRef (); -} - -//------------------------------------------------------------------------ -ReadOnlyBStream::~ReadOnlyBStream () -{ - if (sourceStream) - sourceStream->release (); - - FUNKNOWN_DTOR -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API ReadOnlyBStream::queryInterface (const TUID iid, void** obj) -{ - return sourceStream ? sourceStream->queryInterface (iid, obj) : kResultFalse; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API ReadOnlyBStream::read (void* buffer, int32 numBytes, int32* numBytesRead) -{ - if (numBytesRead) - *numBytesRead = 0; - - if (!sourceStream) - return kNotInitialized; - - int32 maxBytesToRead = (int32)(sectionSize - seekPosition); - if (numBytes > maxBytesToRead) - numBytes = maxBytesToRead; - if (numBytes <= 0) - return kResultOk; - - tresult result = sourceStream->seek (sourceOffset + seekPosition, kIBSeekSet); - if (result != kResultOk) - return result; - - int32 numRead = 0; - result = sourceStream->read (buffer, numBytes, &numRead); - - if (numRead > 0) - seekPosition += numRead; - if (numBytesRead) - *numBytesRead = numRead; - - return result; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API ReadOnlyBStream::write (void* /*buffer*/, int32 /*numBytes*/, int32* numBytesWritten) -{ - if (numBytesWritten) - *numBytesWritten = 0; - - return kNotImplemented; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API ReadOnlyBStream::seek (int64 pos, int32 mode, int64* result) -{ - switch (mode) - { - case kIBSeekSet : - seekPosition = pos; - break; - - case kIBSeekCur : - seekPosition += pos; - break; - - case kIBSeekEnd : - seekPosition = sectionSize + pos; - break; - } - - if (seekPosition < 0) - seekPosition = 0; - if (seekPosition > sectionSize) - seekPosition = sectionSize; - - if (result) - *result = seekPosition; - return kResultOk; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API ReadOnlyBStream::tell (int64* pos) -{ - if (pos) - *pos = seekPosition; - return kResultOk; -} - - -//------------------------------------------------------------------------ -// BufferStream implementation -//------------------------------------------------------------------------ -IMPLEMENT_FUNKNOWN_METHODS (BufferStream, IBStream, IBStream::iid) - -//------------------------------------------------------------------------ -BufferStream::BufferStream () -{ - FUNKNOWN_CTOR -} - -//------------------------------------------------------------------------ -BufferStream::~BufferStream () -{ - FUNKNOWN_DTOR -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API BufferStream::read (void* buffer, int32 numBytes, int32* numBytesRead) -{ - uint32 size = mBuffer.get (buffer, numBytes); - if (numBytesRead) - *numBytesRead = size; - - return kResultTrue; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API BufferStream::write (void* buffer, int32 numBytes, int32* numBytesWritten) -{ - bool res = mBuffer.put (buffer, numBytes); - if (numBytesWritten) - *numBytesWritten = res ? numBytes : 0; - - return res ? kResultTrue : kResultFalse; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API BufferStream::seek (int64 pos, int32 mode, int64* result) -{ - bool res = false; - switch (mode) - { - case IBStream::kIBSeekSet: res = mBuffer.setFillSize (pos); break; - case IBStream::kIBSeekCur: res = mBuffer.setFillSize (mBuffer.getFillSize () + pos); break; - case IBStream::kIBSeekEnd: res = mBuffer.setFillSize (mBuffer.getSize () - pos); break; - } - if (res && result) - *result = mBuffer.getFillSize (); - - return res ? kResultTrue : kResultFalse; -} - -//------------------------------------------------------------------------ -tresult PLUGIN_API BufferStream::tell (int64* pos) -{ - if (pos) - *pos = mBuffer.getFillSize (); - return pos ? kResultTrue : kResultFalse; -} - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg diff --git a/vst/public.sdk/source/vst/vstpresetfile.h b/vst/public.sdk/source/vst/vstpresetfile.h deleted file mode 100644 index 72cbceba..00000000 --- a/vst/public.sdk/source/vst/vstpresetfile.h +++ /dev/null @@ -1,303 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/vstpresetfile.h -// Created by : Steinberg, 03/2006 -// Description : VST 3 Preset File Format -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#pragma once - -#include "pluginterfaces/vst/ivstcomponent.h" -#include "pluginterfaces/vst/ivsteditcontroller.h" -#include "pluginterfaces/vst/ivstunits.h" - -#include "pluginterfaces/base/ibstream.h" -#include "base/source/tarray.h" -#include "base/source/fbuffer.h" - -#include -//------------------------------------------------------------------------ -/** \page vst3presetFileFormat VST 3 Preset File Format Definition -\code - - VST 3 Preset File Format Definition - =================================== - -0 +---------------------------+ - | HEADER | - | header id ('VST3') | 4 Bytes - | version | 4 Bytes (int32) - | ASCII-encoded class id | 32 Bytes - +--| offset to chunk list | 8 Bytes (int64) - | +---------------------------+ - | | DATA AREA |<-+ - | | data of chunks 1..n | | - | ... ... | - | | | | - +->+---------------------------+ | - | CHUNK LIST | | - | list id ('List') | | 4 Bytes - | entry count | | 4 Bytes (int32) - +---------------------------+ | - | 1..n | | - | +----------------------+ | | - | | chunk id | | | 4 Bytes - | | offset to chunk data |----+ 8 Bytes (int64) - | | size of chunk data | | 8 Bytes (int64) - | +----------------------+ | -EOF +---------------------------+ - -\endcode -\see \ref Steinberg::Vst::PresetFile -*/ -//------------------------------------------------------------------------ - -//------------------------------------------------------------------------ -namespace Steinberg { -namespace Vst { - -//------------------------------------------------------------------------ -typedef char ChunkID[4]; - -//------------------------------------------------------------------------ -enum ChunkType -{ - kHeader, - kComponentState, - kControllerState, - kProgramData, - kMetaInfo, - kChunkList, - kNumPresetChunks -}; - -//------------------------------------------------------------------------ -extern const ChunkID& getChunkID (ChunkType type); - -//------------------------------------------------------------------------ -inline bool isEqualID (const ChunkID id1, const ChunkID id2) -{ - return memcmp (id1, id2, sizeof (ChunkID)) == 0; -} - -//------------------------------------------------------------------------ -/** Handler for a VST 3 Preset File. -\ingroup vstClasses -\see \ref vst3presetFileFormat */ -//------------------------------------------------------------------------ -class PresetFile -{ -public: -//------------------------------------------------------------------------ - PresetFile (IBStream* stream); ///< Constructor of Preset file based on a stream - virtual ~PresetFile (); - - /** Internal structure used for chunk handling */ - struct Entry - { - ChunkID id; - TSize offset; - TSize size; - }; - - IBStream* getStream () { return stream; } ///< Returns the associated stream. - - const FUID& getClassID () const { return classID; } ///< Returns the associated classID (component ID: Processor part (not the controller!)). - void setClassID (const FUID& uid) { classID = uid; } ///< Sets the associated classID (component ID: Processor part (not the controller!)). - - const Entry* getEntry (ChunkType which) const; ///< Returns an entry for a given chunk type. - const Entry* getLastEntry () const; ///< Returns the last available entry. - int32 getEntryCount () const { return entryCount; } ///< Returns the number of total entries in the current stream. - const Entry& at (int32 index) const { return entries[index]; } ///< Returns the entry at a given position. - bool contains (ChunkType which) const { return getEntry (which) != 0; } ///< Checks if a given chunk type exist in the stream. - - bool readChunkList (); ///< Reads and build the chunk list (including the header chunk). - bool writeHeader (); ///< Writes into the stream the main header. - bool writeChunkList (); ///< Writes into the stream the chunk list (should be at the end). - - /** Reads the meta XML info and its size, the size could be retrieved by passing zero as xmlBuffer. */ - bool readMetaInfo (char* xmlBuffer, int32& size); - - /** Writes the meta XML info, -1 means null-terminated, forceWriting to true will force to rewrite the XML Info when the chunk already exists. */ - bool writeMetaInfo (const char* xmlBuffer, int32 size = -1, bool forceWriting = false); - bool prepareMetaInfoUpdate (); ///< checks if meta info chunk is the last one and jump to correct position. - - /** Writes a given data of a given size as "which" chunk type. */ - bool writeChunk (const void* data, int32 size, ChunkType which = kComponentState); - - //------------------------------------------------------------- - // for storing and restoring the whole Plug-in state (component and controller states) - bool seekToComponentState (); ///< Seeks to the begin of the Component State. - bool storeComponentState (IComponent* component); ///< Stores the component state (only one time). - bool restoreComponentState (IComponent* component); ///< Restores the component state. - - bool seekToControllerState (); ///< Seeks to the begin of the Controller State. - bool storeControllerState (IEditController* editController); ///< Stores the controller state (only one time). - bool restoreControllerState (IEditController* editController); ///< Restores the controller state. - - bool restoreComponentState (IEditController* editController); ///< Restores the component state and apply it to the controller. - - //------------------------------------------------------------- - /** Store program data or unit data from stream (including the header chunk). - \param listID could be ProgramListID or UnitID. */ - bool storeProgramData (IBStream* inStream, ProgramListID listID); - - //----when Plug-in uses IProgramListData----------------------- - /** Stores a IProgramListData with a given identifier and index (including the header chunk). */ - bool storeProgramData (IProgramListData* programListData, ProgramListID programListID, int32 programIndex); - /** Restores a IProgramListData with a given identifier and index. */ - bool restoreProgramData (IProgramListData* programListData, ProgramListID* programListID = 0, int32 programIndex = 0); - - //----when Plug-in uses IUnitData------------------------------ - /** Stores a IUnitData with a given unitID (including the header chunk). */ - bool storeProgramData (IUnitData* unitData, UnitID unitID); - /** Restores a IUnitData with a given unitID (optional). */ - bool restoreProgramData (IUnitData* unitData, UnitID* unitID = 0); - - //------------------------------------------------------------- - /** for keeping the Controller part in sync concerning preset data stream, unitProgramListID could be ProgramListID or UnitID. */ - bool restoreProgramData (IUnitInfo* unitInfo, int32 unitProgramListID, int32 programIndex = -1); - - /** Gets the unitProgramListID saved in the kProgramData chunk (if available). */ - bool getUnitProgramListID (int32& unitProgramListID); - - //------------------------------------------------------------------------ - /** Shortcut helper to create preset from component/controller state. classID is the FUID of the component (processor) part. */ - static bool savePreset (IBStream* stream, - const FUID& classID, - IComponent* component, - IEditController* editController = 0, - const char* xmlBuffer = 0, - int32 xmlSize = -1); - - /** Shortcut helper to load preset with component/controller state. classID is the FUID of the component (processor) part. */ - static bool loadPreset (IBStream* stream, - const FUID& classID, - IComponent* component, - IEditController* editController = 0, - TArray* otherClassIDArray = 0); -//------------------------------------------------------------------------ -protected: - bool readID (ChunkID id); - bool writeID (const ChunkID id); - bool readEqualID (const ChunkID id); - bool readSize (TSize& size); - bool writeSize (TSize size); - bool readInt32 (int32& value); - bool writeInt32 (int32 value); - bool seekTo (TSize offset); - bool beginChunk (Entry& e, ChunkType which); - bool endChunk (Entry& e); - - IBStream* stream; - FUID classID; ///< classID is the FUID of the component (processor) part - enum { kMaxEntries = 128 }; - Entry entries[kMaxEntries]; - int32 entryCount; -}; - -//------------------------------------------------------------------------ -/** Stream implementation for a file using stdio. */ -//------------------------------------------------------------------------ -class FileStream: public IBStream -{ -public: -//------------------------------------------------------------------------ - static IBStream* open (const char* filename, const char* mode); ///< open a stream using stdio function - - //---from FUnknown------------------ - DECLARE_FUNKNOWN_METHODS - - //---from IBStream------------------ - tresult PLUGIN_API read (void* buffer, int32 numBytes, int32* numBytesRead = 0); - tresult PLUGIN_API write (void* buffer, int32 numBytes, int32* numBytesWritten = 0); - tresult PLUGIN_API seek (int64 pos, int32 mode, int64* result = 0); - tresult PLUGIN_API tell (int64* pos); - -//------------------------------------------------------------------------ -protected: - FileStream (FILE* file); - virtual ~FileStream (); - - FILE* file; -}; - -//------------------------------------------------------------------------ -/** Stream representing a Read-Only subsection of its source stream. */ -//------------------------------------------------------------------------ -class ReadOnlyBStream: public IBStream -{ -public: -//------------------------------------------------------------------------ - ReadOnlyBStream (IBStream* sourceStream, TSize sourceOffset, TSize sectionSize); - ~ReadOnlyBStream (); - - //---from FUnknown------------------ - DECLARE_FUNKNOWN_METHODS - - //---from IBStream------------------ - tresult PLUGIN_API read (void* buffer, int32 numBytes, int32* numBytesRead = 0); - tresult PLUGIN_API write (void* buffer, int32 numBytes, int32* numBytesWritten = 0); - tresult PLUGIN_API seek (int64 pos, int32 mode, int64* result = 0); - tresult PLUGIN_API tell (int64* pos); - -//------------------------------------------------------------------------ -protected: - IBStream* sourceStream; - TSize sourceOffset; - TSize sectionSize; - TSize seekPosition; -}; - -//------------------------------------------------------------------------ -/** Stream implementation for a memory buffer. */ -//------------------------------------------------------------------------ -class BufferStream : public IBStream -{ -public: - BufferStream (); - ~BufferStream (); - - //---from FUnknown------------------ - DECLARE_FUNKNOWN_METHODS - - //---from IBStream------------------ - tresult PLUGIN_API read (void* buffer, int32 numBytes, int32* numBytesRead = 0); - tresult PLUGIN_API write (void* buffer, int32 numBytes, int32* numBytesWritten = 0); - tresult PLUGIN_API seek (int64 pos, int32 mode, int64* result = 0); - tresult PLUGIN_API tell (int64* pos); - -protected: - Buffer mBuffer; -}; - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg diff --git a/vst/public.sdk/source/vst/vstrepresentation.cpp b/vst/public.sdk/source/vst/vstrepresentation.cpp deleted file mode 100644 index 2590761f..00000000 --- a/vst/public.sdk/source/vst/vstrepresentation.cpp +++ /dev/null @@ -1,410 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/vstrepresentation.cpp -// Created by : Steinberg, 08/2010 -// Description : VST Representation Helper -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#include "vstrepresentation.h" - -#include "base/source/fstring.h" -#include "base/source/fstreamer.h" - -namespace Steinberg { -namespace Vst { - -#define START_TAG_STRING(string) "<" string">" -#define END_TAG_STRING(string) "" -#define MEDIUM_TITLE_LIMIT 8 -#define SHORT_TITLE_LIMIT 4 - -//------------------------------------------------------------------------ -// XmlRepresentationHelper Implementation -//------------------------------------------------------------------------ -XmlRepresentationHelper::XmlRepresentationHelper (const Vst::RepresentationInfo& info, const FIDString companyName, - const FIDString pluginName, const TUID& pluginUID, IBStream* stream) -{ - streamer = NEW IBStreamer (stream, kLittleEndian); - - String string; - streamer->writeString8 (""); - streamer->writeString8 (ENDLINE_A); - string.printf ("", ROOTXML_TAG); - streamer->writeString8 (string.text8 ()); - streamer->writeString8 (ENDLINE_A); - - string.printf ("<%s %s=\"1.0\">", ROOTXML_TAG, ATTR_VERSION); - streamer->writeString8 (string.text8 ()); - streamer->writeString8 (ENDLINE_A); - - //---Plug-in Tag---------------- - FUID uid (pluginUID); - char uidText[33]; - uid.toString (uidText); - - string.printf ("<%s %s=\"%s\" %s=\"%s\" %s=\"%s\"/>", PLUGIN_TAG, ATTR_CLASSID, uidText, ATTR_NAME, pluginName, ATTR_VENDOR, companyName); - streamer->writeString8 (string.text8 ()); - streamer->writeString8 (ENDLINE_A); - - //---Representation Tag---------------- - string.printf ("\t<%s", REPRESENTATION_TAG); - streamer->writeString8 (string.text8 ()); - string.printf (" %s=\"%s\"", ATTR_NAME, info.name); - streamer->writeString8 (string.text8 ()); - string.printf (" %s=\"%s\"", ATTR_VENDOR, info.vendor); - streamer->writeString8 (string.text8 ()); - string.printf (" %s=\"%s\"", ATTR_VERSION, info.version); - streamer->writeString8 (string.text8 ()); - if (strcmp ((char*)info.host, "")) - { - string.printf (" %s=\"%s\"", ATTR_HOST, info.host); - streamer->writeString8 (string.text8 ()); - } - streamer->writeString8 (">"); - streamer->writeString8 (ENDLINE_A); - - state = kInRepresentation; -} - -//------------------------------------------------------------------------ -XmlRepresentationHelper::~XmlRepresentationHelper () -{ - if (state == kInLayer) - endLayer (); - if (state == kInCell) - endCell (); - if (state == kInPage) - endPage (); - - String string; - - // end representation - string.printf ("\t%s", END_TAG_STRING(REPRESENTATION_TAG)); - streamer->writeString8 (string.text8 ()); - streamer->writeString8 (ENDLINE_A); - - // end piper - streamer->writeString8 (END_TAG_STRING(ROOTXML_TAG)); - streamer->writeString8 (ENDLINE_A); - - delete streamer; -} - -//------------------------------------------------------------------------ -bool XmlRepresentationHelper::checkState (int32 newState) -{ - if (newState - state == 1 || state - newState == 1) // we go down or up - { - state = newState; - return true; - } - return false; -} - -//------------------------------------------------------------------------ -bool XmlRepresentationHelper::startPage (FIDString name, int32 unitID) -{ - if (!checkState (kInPage)) - return false; - - String string; - if (unitID != -1) - string.printf ("<%s %s=\"%s\" %s=\"%d\">", PAGE_TAG, ATTR_NAME, name, ATTR_UNITID, unitID); - else - string.printf ("<%s %s=\"%s\">", PAGE_TAG, ATTR_NAME, name); - streamer->writeString8 (string.text8 ()); - streamer->writeString8 (ENDLINE_A); - - return true; -} - -//------------------------------------------------------------------------ -bool XmlRepresentationHelper::endPage () -{ - if (!checkState (kInRepresentation)) - return false; - - String string; - string.printf ("%s", END_TAG_STRING(PAGE_TAG)); - streamer->writeString8 (string.text8 ()); - streamer->writeString8 (ENDLINE_A); - - return true; -} - -//------------------------------------------------------------------------ -bool XmlRepresentationHelper::startCell () -{ - if (!checkState (kInCell)) - return false; - - String string; - string.printf ("%s", START_TAG_STRING(CELL_TAG)); - streamer->writeString8 (string.text8 ()); - streamer->writeString8 (ENDLINE_A); - - return true; -} - -//------------------------------------------------------------------------ -bool XmlRepresentationHelper::endCell () -{ - if (!checkState (kInPage)) - return false; - - String string; - string.printf ("%s", END_TAG_STRING(CELL_TAG)); - streamer->writeString8 (string.text8 ()); - streamer->writeString8 (ENDLINE_A); - - return true; -} - -//------------------------------------------------------------------------ -bool XmlRepresentationHelper::startEndCell () -{ - if (!checkState (kInCell)) - return false; - - String string; - string.printf ("<%s/>", CELL_TAG); - streamer->writeString8 (string.text8 ()); - streamer->writeString8 (ENDLINE_A); - - if (!checkState (kInPage)) - return false; - return true; -} - -//------------------------------------------------------------------------ -bool XmlRepresentationHelper::startLayer (int32 type, int32 id, FIDString _function, FIDString style) -{ - return startLayer (type, id, _function, style, false); -} - -//------------------------------------------------------------------------ -bool XmlRepresentationHelper::endLayer () -{ - if (!checkState (kInCell)) - return false; - - String string; - string.printf ("%s", END_TAG_STRING(LAYER_TAG)); - streamer->writeString8 (string.text8 ()); - streamer->writeString8 (ENDLINE_A); - - return true; -} - -//------------------------------------------------------------------------ -bool XmlRepresentationHelper::startEndLayer (int32 type, int32 id, FIDString _function, FIDString style) -{ - return startLayer (type, id, _function, style, true); -} - -//------------------------------------------------------------------------ -bool XmlRepresentationHelper::startLayer (int32 type, int32 id, FIDString _function, FIDString style, bool ended) -{ - if (!checkState (kInLayer)) - return false; - - String string; - - string.printf ("<%s %s=\"%s\" %s=\"%d\"", LAYER_TAG, ATTR_TYPE, Vst::LayerType::layerTypeFIDString[type], ATTR_PARAMID, id); - streamer->writeString8 (string.text8 ()); - - if (_function) - { - string.printf (" %s=\"%s\"", Vst::Attributes::kFunction, _function); - streamer->writeString8 (string.text8 ()); - } - if (style) - { - string = Vst::LayerType::layerTypeFIDString[type]; - if (type == Vst::LayerType::kSwitch) - string.printf (" %s=\"%s\"", Vst::Attributes::kSwitchStyle, style); - else if (type == Vst::LayerType::kLED) - string.printf (" %s=\"%s\"", Vst::Attributes::kLEDStyle, style); - else - string.printf (" %s=\"%s\"", Vst::Attributes::kStyle, style); - streamer->writeString8 (string.text8 ()); - } - - if (ended) - { - streamer->writeString8 ("/>"); - if (!checkState (kInCell)) - return false; - } - else - streamer->writeString8 (">"); - streamer->writeString8 (ENDLINE_A); - - return true; -} - -//------------------------------------------------------------------------ -bool XmlRepresentationHelper::startEndCellOneLayer (int32 type, int32 id, FIDString _function, FIDString style) -{ - if (!startCell ()) - return false; - startEndLayer (type, id, _function, style); - endCell (); - - return true; -} - -//------------------------------------------------------------------------ -bool XmlRepresentationHelper::startLayer (Vst::ParameterInfo& info, FIDString _function) -{ - return startLayer (info, _function, false); -} - -//------------------------------------------------------------------------ -bool XmlRepresentationHelper::startLayer (Vst::ParameterInfo& info, FIDString _function, bool ended) -{ - FIDString style = 0; - int32 type = Vst::LayerType::kKnob; - if (info.flags & Vst::ParameterInfo::kIsReadOnly) - type = Vst::LayerType::kLED; - else if (info.stepCount == 1) - { - type = Vst::LayerType::kSwitch; - style = Vst::AttributesStyle::kSwitchPushIncLoopedStyle; - } - - return startLayer (type, info.id, _function, style, ended); -} - -//------------------------------------------------------------------------ -bool XmlRepresentationHelper::startEndLayer (Vst::ParameterInfo& info, FIDString _function) -{ - return startLayer (info, _function, true); -} - -//------------------------------------------------------------------------ -bool XmlRepresentationHelper::startEndCellOneLayer (Vst::ParameterInfo& info, FIDString _function) -{ - if (!startCell ()) - return false; - startEndLayer (info, _function); - endCell (); - - return true; -} - -//------------------------------------------------------------------------ -bool XmlRepresentationHelper::startEndCellOneLayerWithParamName (Vst::ParameterInfo& info, FIDString _function /*= 0*/) -{ - if (!startCell ()) - return false; - startLayer (info, _function, false); - startEndTitleDisplay (info); - endLayer (); - endCell (); - - return true; -} - -//------------------------------------------------------------------------ -bool XmlRepresentationHelper::startEndTitleDisplay (Vst::ParameterInfo& info) -{ - String nameString (info.title); - - if (nameString.isEmpty ()) - return false; - - if (!checkState (kInTitleDisplay)) - return false; - - String string; - - string.printf ("<%s>", TITLEDISPLAY_TAG); - streamer->writeString8 (string.text8 ()); - streamer->writeString8 (ENDLINE_A); - - // start of name scope - - if (!checkState (kInName)) - { - string.printf ("%s", END_TAG_STRING (TITLEDISPLAY_TAG)); - streamer->writeString8 (string.text8 ()); - streamer->writeString8 (ENDLINE_A); - return false; - } - - string.printf ("<%s>%s", NAME_TAG, nameString.text8 (), NAME_TAG); - streamer->writeString8 (string.text8 ()); - streamer->writeString8 (ENDLINE_A); - - if (nameString.length () > MEDIUM_TITLE_LIMIT) - { - nameString.assign (info.shortTitle); - - if (! nameString.isEmpty ()) - { - nameString.removeChars (); // remove space - - if (nameString.length () > MEDIUM_TITLE_LIMIT) - nameString.remove (MEDIUM_TITLE_LIMIT); // Trimming the rest to get a short string - - string.printf ("<%s>%s", NAME_TAG, nameString.text8 (), NAME_TAG); - streamer->writeString8 (string.text8 ()); - streamer->writeString8 (ENDLINE_A); - } - } - - if (nameString.length () > SHORT_TITLE_LIMIT) - { - nameString.remove (SHORT_TITLE_LIMIT); // Trimming the rest to get a short string - - string.printf ("<%s>%s", NAME_TAG, nameString.text8 (), NAME_TAG); - streamer->writeString8 (string.text8 ()); - streamer->writeString8 (ENDLINE_A); - } - - if (!checkState (kInTitleDisplay)) - return false; - - // end of name scope - - string.printf ("%s", END_TAG_STRING (TITLEDISPLAY_TAG)); - streamer->writeString8 (string.text8 ()); - streamer->writeString8 (ENDLINE_A); - - if (!checkState (kInLayer)) - return false; - - return true; -} - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg diff --git a/vst/public.sdk/source/vst/vstrepresentation.h b/vst/public.sdk/source/vst/vstrepresentation.h deleted file mode 100644 index 118931b3..00000000 --- a/vst/public.sdk/source/vst/vstrepresentation.h +++ /dev/null @@ -1,166 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/vstrepresentation.h -// Created by : Steinberg, 08/2010 -// Description : VST Representation Helper -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#pragma once - -#include "pluginterfaces/vst/ivstrepresentation.h" -#include "pluginterfaces/vst/ivsteditcontroller.h" - -//------------------------------------------------------------------------ -namespace Steinberg { -class IBStreamer; - -namespace Vst { - -//------------------------------------------------------------------------ -/** Helper for XML Representation creation. -\ingroup vstClasses - -Here an example of how to use this helper: -\n -\code - -// here the parameter ids used by this example -enum { - kGain = 129, - kSize, - kCutoff, - kResonance, - kMaster, - kEnable1, - kEnable2, - kFrequency1, - kFrequency2, - kGain1, - kGain2, -}; - -//------------------------------------------------------------------------ -tresult PLUGIN_API MyPlugInController::getXmlRepresentationStream (Vst::RepresentationInfo& info, IBStream* stream) -{ - String name (info.name); - if (name == GENERIC_8_CELLS) - { - Vst::XmlRepresentationHelper helper (info, "My Company Name", "My Product Name", gPlugProcessorClassID, stream); - - helper.startPage ("Main Page"); - helper.startEndCellOneLayer (Vst::LayerType::kKnob, kGain); - helper.startEndCellOneLayer (Vst::LayerType::kKnob, kSize); - helper.startEndCellOneLayer (Vst::LayerType::kKnob, kMaster); - helper.startEndCell (); // empty cell - helper.startEndCellOneLayer (Vst::LayerType::kKnob, kCutoff); - helper.startEndCellOneLayer (Vst::LayerType::kKnob, kResonance); - helper.startEndCell (); // empty cell - helper.startEndCell (); // empty cell - helper.endPage (); - - helper.startPage ("Page 2"); - helper.startEndCellOneLayer (Vst::LayerType::kSwitch, kEnable1); - helper.startEndCellOneLayer (Vst::LayerType::kKnob, kFrequency1); - helper.startEndCellOneLayer (Vst::LayerType::kKnob, kGain1); - helper.startEndCell (); // empty - helper.startEndCellOneLayer (Vst::LayerType::kSwitch, kEnable2); - helper.startEndCellOneLayer (Vst::LayerType::kKnob, kFrequency2); - helper.startEndCellOneLayer (Vst::LayerType::kKnob, kGain2); - helper.startEndCell (); // empty - helper.endPage (); - - return kResultTrue; - } - return kResultFalse; -} -\endcode -*/ -//------------------------------------------------------------------------ -class XmlRepresentationHelper -{ -public: - XmlRepresentationHelper (const RepresentationInfo& info, const FIDString companyName, const FIDString pluginName, const TUID& pluginUID, IBStream* stream); - virtual ~XmlRepresentationHelper (); - - bool startPage (FIDString name, int32 unitID = -1); ///< Starts a Page before adding a Cell. - bool endPage (); ///< Ends a Page before opening a new one. - bool startCell (); ///< Starts a Cell before adding a Layer. - bool endCell (); ///< Ends a Cell when no more layer needed. - bool startEndCell (); ///< Creates an empty cell (alignment for example). - - /** Starts a layer for a given type (Vst::LayerType), a parameter id, optionally a function (Vst::AttributesFunction) - and a style (Vst::AttributesStyle). */ - bool startLayer (int32 type, int32 id, FIDString _function = 0, FIDString style = 0); - - /** Ends a layer before adding new one */ - bool endLayer (); - - /** Same than startLayer except that the layer will be ended automatically (no need to call endLayer). */ - bool startEndLayer (int32 type, int32 id, FIDString _function = 0, FIDString style = 0); - - /** Creates a Cell with 1 Layer and end it, could be only call after a call to startPage */ - bool startEndCellOneLayer (int32 type, int32 id, FIDString _function = 0, FIDString style = 0); - - /** Starts a layer for a given parameter info and an optional function (Vst::AttributesFunction). */ - bool startLayer (Vst::ParameterInfo& info, FIDString _function = 0); - - /** Same than startLayer with end created automatically. */ - bool startEndLayer (Vst::ParameterInfo& info, FIDString _function = 0); - - /** Creates a Cell with 1 Layer and end it, could be only call after a call to startPage. */ - bool startEndCellOneLayer (Vst::ParameterInfo& info, FIDString _function = 0); - - /** Creates a Cell with 1 Layer (with name) and end it, could be only call after a call to startPage. */ - bool startEndCellOneLayerWithParamName (Vst::ParameterInfo& info, FIDString _function = 0); - -protected: - enum { - kInRepresentation = 0, - kInPage, - kInCell, - kInLayer, - kInTitleDisplay, - kInName - }; - - bool startLayer (int32 type, int32 id, FIDString _function, FIDString style, bool ended); - bool startLayer (Vst::ParameterInfo& info, FIDString _function, bool ended); - - bool startEndTitleDisplay (Vst::ParameterInfo& info); - - bool checkState (int32 newState); - - IBStreamer* streamer; - int32 state; -}; - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg diff --git a/vst/public.sdk/source/vst/vstsinglecomponenteffect.cpp b/vst/public.sdk/source/vst/vstsinglecomponenteffect.cpp deleted file mode 100644 index f32cdc10..00000000 --- a/vst/public.sdk/source/vst/vstsinglecomponenteffect.cpp +++ /dev/null @@ -1,260 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst/vstsinglecomponenteffect.cpp -// Created by : Steinberg, 03/2008 -// Description : Basic Audio Effect Implementation in one component -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//----------------------------------------------------------------------------- - -#include "vstsinglecomponenteffect.h" - -//----------------------------------------------------------------------------- -namespace Steinberg { -namespace Vst { - - -//----------------------------------------------------------------------------- -// SingleComponentEffect Implementation -//----------------------------------------------------------------------------- -SingleComponentEffect::SingleComponentEffect () -: audioInputs (kAudio, kInput) -, audioOutputs (kAudio, kOutput) -, eventInputs (kEvent, kInput) -, eventOutputs (kEvent, kOutput) -{ - processSetup.maxSamplesPerBlock = 1024; - processSetup.processMode = Vst::kRealtime; - processSetup.sampleRate = 44100.0; - processSetup.symbolicSampleSize = Vst::kSample32; -} - -//----------------------------------------------------------------------------- -SingleComponentEffect::~SingleComponentEffect () -{ -} - -//----------------------------------------------------------------------------- -tresult PLUGIN_API SingleComponentEffect::initialize (FUnknown* context) -{ - return EditController::initialize (context); -} - -//----------------------------------------------------------------------------- -tresult PLUGIN_API SingleComponentEffect::terminate () -{ - parameters.removeAll (); - removeAllBusses (); - - return EditController::terminate (); -} - -//----------------------------------------------------------------------------- -int32 PLUGIN_API SingleComponentEffect::getBusCount (MediaType type, BusDirection dir) -{ - BusList* busList = getBusList (type, dir); - return busList ? busList->total () : 0; -} - -//----------------------------------------------------------------------------- -tresult PLUGIN_API SingleComponentEffect::getBusInfo (MediaType type, BusDirection dir, int32 index, BusInfo& info) -{ - BusList* busList = getBusList (type, dir); - Bus* bus = busList ? (Bus*)busList->at (index) : 0; - if (bus) - { - info.mediaType = type; - info.direction = dir; - if (bus->getInfo (info)) - return kResultTrue; - } - return kResultFalse; -} - -//----------------------------------------------------------------------------- -tresult PLUGIN_API SingleComponentEffect::activateBus (MediaType type, BusDirection dir, int32 index, TBool state) -{ - BusList* busList = getBusList (type, dir); - Bus* bus = busList ? (Bus*)busList->at (index) : 0; - if (bus) - { - bus->setActive (state); - return kResultTrue; - } - return kResultFalse; -} - -//----------------------------------------------------------------------------- -AudioBus* SingleComponentEffect::addAudioInput (const TChar* name, SpeakerArrangement arr, - BusType busType, int32 flags) -{ - AudioBus* newBus = new AudioBus (name, busType, flags, arr); - audioInputs.append (IPtr (newBus, false)); - return newBus; -} - -//----------------------------------------------------------------------------- -AudioBus* SingleComponentEffect::addAudioOutput (const TChar* name, SpeakerArrangement arr, - BusType busType, int32 flags) -{ - AudioBus* newBus = new AudioBus (name, busType, flags, arr); - audioOutputs.append (IPtr (newBus, false)); - return newBus; -} - -//----------------------------------------------------------------------------- -EventBus* SingleComponentEffect::addEventInput (const TChar* name, int32 channels, - BusType busType, int32 flags) -{ - EventBus* newBus = new EventBus (name, busType, flags, channels); - eventInputs.append (IPtr (newBus, false)); - return newBus; -} - -//----------------------------------------------------------------------------- -EventBus* SingleComponentEffect::addEventOutput (const TChar* name, int32 channels, - BusType busType, int32 flags) -{ - EventBus* newBus = new EventBus (name, busType, flags, channels); - eventOutputs.append (IPtr (newBus, false)); - return newBus; -} - -//----------------------------------------------------------------------------- -tresult SingleComponentEffect::removeAudioBusses () -{ - audioInputs.removeAll (); - audioOutputs.removeAll (); - - return kResultOk; -} - -//----------------------------------------------------------------------------- -tresult SingleComponentEffect::removeEventBusses () -{ - eventInputs.removeAll (); - eventOutputs.removeAll (); - - return kResultOk; -} - -//----------------------------------------------------------------------------- -tresult SingleComponentEffect::removeAllBusses () -{ - removeAudioBusses (); - removeEventBusses (); - - return kResultOk; -} - -//----------------------------------------------------------------------------- -// IAudioProcessor -//----------------------------------------------------------------------------- -tresult PLUGIN_API SingleComponentEffect::setBusArrangements (SpeakerArrangement* inputs, int32 numIns, - SpeakerArrangement* outputs, int32 numOuts) -{ - int32 counter = 0; - FOREACH_CAST (IPtr, Vst::AudioBus, bus, audioInputs) - if (counter < numIns) - bus->setArrangement (inputs[counter]); - counter++; - ENDFOR - - counter = 0; - FOREACH_CAST (IPtr, Vst::AudioBus, bus, audioOutputs) - if (counter < numOuts) - bus->setArrangement (outputs[counter]); - counter++; - ENDFOR - - return kResultTrue; -} - -//----------------------------------------------------------------------------- -tresult PLUGIN_API SingleComponentEffect::getBusArrangement (BusDirection dir, int32 busIndex, SpeakerArrangement& arr) -{ - BusList* busList = getBusList (kAudio, dir); - AudioBus* audioBus = busList ? FCast (busList->at (busIndex)) : 0; - if (audioBus) - { - arr = audioBus->getArrangement (); - return kResultTrue; - } - return kResultFalse; -} - -//----------------------------------------------------------------------------- -tresult PLUGIN_API SingleComponentEffect::setupProcessing (ProcessSetup& newSetup) -{ - if (canProcessSampleSize (newSetup.symbolicSampleSize) != kResultTrue) - return kResultFalse; - - processSetup = newSetup; - return kResultOk; -} - -//----------------------------------------------------------------------------- -tresult PLUGIN_API SingleComponentEffect::canProcessSampleSize (int32 symbolicSampleSize) -{ - return symbolicSampleSize == kSample32 ? kResultTrue : kResultFalse; -} - -//----------------------------------------------------------------------------- -BusList* SingleComponentEffect::getBusList (MediaType type, BusDirection dir) -{ - if (type == kAudio) - return dir == kInput ? &audioInputs : &audioOutputs; - else if (type == kEvent) - return dir == kInput ? &eventInputs : &eventOutputs; - return 0; -} - -//----------------------------------------------------------------------------- -tresult PLUGIN_API SingleComponentEffect::queryInterface (const TUID iid, void** obj) -{ - if (memcmp (iid, IConnectionPoint::iid, sizeof (::Steinberg::TUID)) == 0) - { - // no need to expose IConnectionPoint to the host - return kNoInterface; - } - DEF_INTERFACE (IComponent) - DEF_INTERFACE (IAudioProcessor) - return EditController::queryInterface (iid, obj); -} - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg - -// work around for the name clash of IComponent::setState and IEditController::setState -// make sure that vsteditcontroller.cpp is otherwise excluded from your project -#define setState setEditorState -#define getState getEditorState -#include "public.sdk/source/vst/vsteditcontroller.cpp" -#undef setState -#undef getState diff --git a/vst/public.sdk/source/vst/vstsinglecomponenteffect.h b/vst/public.sdk/source/vst/vstsinglecomponenteffect.h deleted file mode 100644 index 32c02a6d..00000000 --- a/vst/public.sdk/source/vst/vstsinglecomponenteffect.h +++ /dev/null @@ -1,141 +0,0 @@ -//----------------------------------------------------------------------------- -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : plublic.sdk/source/vst/vstsinglecomponenteffect.h -// Created by : Steinberg, 03/2008 -// Description : Recombination class of Audio Effect and Edit Controller -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#pragma once - -#include "pluginterfaces/vst/ivstaudioprocessor.h" - -// work around for the name clash of IComponent::setState and IEditController::setState -#define setState setEditorState -#define getState getEditorState -#include "pluginterfaces/vst/ivsteditcontroller.h" -#include "public.sdk/source/vst/vsteditcontroller.h" -#undef setState -#undef getState - -#include "public.sdk/source/vst/vstbus.h" -#include "public.sdk/source/vst/vstparameters.h" - -//------------------------------------------------------------------------ -namespace Steinberg { -namespace Vst { - -//------------------------------------------------------------------------ -/** Default implementation for a non-distributable Plug-in that combines -processor and edit controller in one component. -\ingroup vstClasses -- [released: 3.0.2] - -This can be used as base class for a VST 3 effect implementation in case that the standard way of -defining two separate components would cause too many implementation difficulties: -- Cubase 4.2 is the first host that supports combined VST 3 Plug-ins -- Use this class only after giving the standard way of defining two components -serious considerations! */ -//------------------------------------------------------------------------ -class SingleComponentEffect: public EditController, - public IComponent, - public IAudioProcessor -{ -public: -//------------------------------------------------------------------------ - SingleComponentEffect (); - virtual ~SingleComponentEffect (); - - //---from IPluginBase--------- - tresult PLUGIN_API initialize (FUnknown* context); - tresult PLUGIN_API terminate (); - - //---from IComponent----------------------- - virtual tresult PLUGIN_API getControllerClassId (TUID classId) {return kNotImplemented;} - virtual tresult PLUGIN_API setIoMode (IoMode mode) {return kNotImplemented;} - virtual int32 PLUGIN_API getBusCount (MediaType type, BusDirection dir); - virtual tresult PLUGIN_API getBusInfo (MediaType type, BusDirection dir, int32 index, BusInfo& bus /*out*/); - virtual tresult PLUGIN_API getRoutingInfo (RoutingInfo& inInfo, RoutingInfo& outInfo /*out*/) {return kNotImplemented;} - virtual tresult PLUGIN_API activateBus (MediaType type, BusDirection dir, - int32 index, TBool state); - virtual tresult PLUGIN_API setActive (TBool state) {return kResultOk;} - virtual tresult PLUGIN_API setState (IBStream* state) {return kNotImplemented;} - virtual tresult PLUGIN_API getState (IBStream* state) {return kNotImplemented;} - - // bus setup methods - AudioBus* addAudioInput (const TChar* name, SpeakerArrangement arr, - BusType busType = kMain, - int32 flags = BusInfo::kDefaultActive); - - AudioBus* addAudioOutput (const TChar* name, SpeakerArrangement arr, - BusType busType = kMain, - int32 flags = BusInfo::kDefaultActive); - - EventBus* addEventInput (const TChar* name, int32 channels = 16, - BusType busType = kMain, - int32 flags = BusInfo::kDefaultActive); - - EventBus* addEventOutput (const TChar* name, int32 channels = 16, - BusType busType = kMain, - int32 flags = BusInfo::kDefaultActive); - - tresult removeAudioBusses (); - tresult removeEventBusses (); - tresult removeAllBusses (); - - //---from IAudioProcessor ------------------- - virtual tresult PLUGIN_API setBusArrangements (SpeakerArrangement* inputs, int32 numIns, SpeakerArrangement* outputs, int32 numOuts); - virtual tresult PLUGIN_API getBusArrangement (BusDirection dir, int32 index, SpeakerArrangement& arr); - virtual tresult PLUGIN_API canProcessSampleSize (int32 symbolicSampleSize); - virtual uint32 PLUGIN_API getLatencySamples () {return 0; } - virtual tresult PLUGIN_API setupProcessing (ProcessSetup& setup); - virtual tresult PLUGIN_API setProcessing (TBool state) {return kNotImplemented;} - virtual tresult PLUGIN_API process (ProcessData& data) {return kNotImplemented;} - virtual uint32 PLUGIN_API getTailSamples () {return kNoTail;} - - //---Interface--------- - OBJ_METHODS (SingleComponentEffect, EditController) - tresult PLUGIN_API queryInterface (const TUID iid, void** obj); - REFCOUNT_METHODS(EditController) - -//------------------------------------------------------------------------ -protected: - BusList* getBusList (MediaType type, BusDirection dir); - - ProcessSetup processSetup; - - BusList audioInputs; - BusList audioOutputs; - BusList eventInputs; - BusList eventOutputs; -}; - -//------------------------------------------------------------------------ -} // namespace Vst -} // namespace Steinberg diff --git a/vst/public.sdk/source/vst2.x/aeffeditor.h b/vst/public.sdk/source/vst2.x/aeffeditor.h deleted file mode 100644 index ff19054c..00000000 --- a/vst/public.sdk/source/vst2.x/aeffeditor.h +++ /dev/null @@ -1,80 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 2.4 -// -// Category : VST 2.x Classes -// Filename : public.sdk/source/vst2.x/aeffeditor.h -// Created by : Steinberg, 01/2004 -// Description : Editor Class for VST Plug-Ins -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#pragma once - -#include "audioeffectx.h" - -//------------------------------------------------------------------------------------------------------- -/** VST Effect Editor class. */ -//------------------------------------------------------------------------------------------------------- -class AEffEditor -{ -public: -//------------------------------------------------------------------------------------------------------- - AEffEditor (AudioEffect* effect = 0) ///< Editor class constructor. Requires pointer to associated effect instance. - : effect (effect) - , systemWindow (0) - {} - - virtual ~AEffEditor () ///< Editor class destructor. - {} - - virtual AudioEffect* getEffect () { return effect; } ///< Returns associated effect instance - virtual bool getRect (ERect** rect) { *rect = 0; return false; } ///< Query editor size as #ERect - virtual bool open (void* ptr) { systemWindow = ptr; return 0; } ///< Open editor, pointer to parent windows is platform-dependent (HWND on Windows, WindowRef on Mac). - virtual void close () { systemWindow = 0; } ///< Close editor (detach from parent window) - virtual bool isOpen () { return systemWindow != 0; } ///< Returns true if editor is currently open - virtual void idle () {} ///< Idle call supplied by Host application - -#if TARGET_API_MAC_CARBON - virtual void DECLARE_VST_DEPRECATED (draw) (ERect* rect) {} - virtual VstInt32 DECLARE_VST_DEPRECATED (mouse) (VstInt32 x, VstInt32 y) { return 0; } - virtual VstInt32 DECLARE_VST_DEPRECATED (key) (VstInt32 keyCode) { return 0; } - virtual void DECLARE_VST_DEPRECATED (top) () {} - virtual void DECLARE_VST_DEPRECATED (sleep) () {} -#endif - -#if VST_2_1_EXTENSIONS - virtual bool onKeyDown (VstKeyCode& keyCode) { return false; } ///< Receive key down event. Return true only if key was really used! - virtual bool onKeyUp (VstKeyCode& keyCode) { return false; } ///< Receive key up event. Return true only if key was really used! - virtual bool onWheel (float distance) { return false; } ///< Handle mouse wheel event, distance is positive or negative to indicate wheel direction. - virtual bool setKnobMode (VstInt32 val) { return false; } ///< Set knob mode (if supported by Host). See CKnobMode in VSTGUI. -#endif - -//------------------------------------------------------------------------------------------------------- -protected: - AudioEffect* effect; ///< associated effect instance - void* systemWindow; ///< platform-dependent parent window (HWND or WindowRef) -}; diff --git a/vst/public.sdk/source/vst2.x/audioeffect.cpp b/vst/public.sdk/source/vst2.x/audioeffect.cpp deleted file mode 100644 index 7ffb22d5..00000000 --- a/vst/public.sdk/source/vst2.x/audioeffect.cpp +++ /dev/null @@ -1,725 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 2.4 -// -// Category : VST 2.x Classes -// Filename : public.sdk/source/vst2.x/audioeffect.cpp -// Created by : Steinberg, 01/2004 -// Description : Class AudioEffect (VST 1.0). -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#include "audioeffect.h" -#include "aeffeditor.h" - -#include -#include -#include - -//------------------------------------------------------------------------------------------------------- -VstIntPtr AudioEffect::dispatchEffectClass (AEffect* e, VstInt32 opCode, VstInt32 index, VstIntPtr value, void* ptr, float opt) -{ - AudioEffect* ae = (AudioEffect*)(e->object); - - if (opCode == effClose) - { - ae->dispatcher (opCode, index, value, ptr, opt); - delete ae; - return 1; - } - - return ae->dispatcher (opCode, index, value, ptr, opt); -} - -//------------------------------------------------------------------------------------------------------- -float AudioEffect::getParameterClass (AEffect* e, VstInt32 index) -{ - AudioEffect* ae = (AudioEffect*)(e->object); - return ae->getParameter (index); -} - -//------------------------------------------------------------------------------------------------------- -void AudioEffect::setParameterClass (AEffect* e, VstInt32 index, float value) -{ - AudioEffect* ae = (AudioEffect*)(e->object); - ae->setParameter (index, value); -} - -//------------------------------------------------------------------------------------------------------- -void AudioEffect::DECLARE_VST_DEPRECATED (processClass) (AEffect* e, float** inputs, float** outputs, VstInt32 sampleFrames) -{ - AudioEffect* ae = (AudioEffect*)(e->object); - ae->DECLARE_VST_DEPRECATED (process) (inputs, outputs, sampleFrames); -} - -//------------------------------------------------------------------------------------------------------- -void AudioEffect::processClassReplacing (AEffect* e, float** inputs, float** outputs, VstInt32 sampleFrames) -{ - AudioEffect* ae = (AudioEffect*)(e->object); - ae->processReplacing (inputs, outputs, sampleFrames); -} - -//------------------------------------------------------------------------------------------------------- -#if VST_2_4_EXTENSIONS -void AudioEffect::processClassDoubleReplacing (AEffect* e, double** inputs, double** outputs, VstInt32 sampleFrames) -{ - AudioEffect* ae = (AudioEffect*)(e->object); - ae->processDoubleReplacing (inputs, outputs, sampleFrames); -} -#endif - -//------------------------------------------------------------------------------------------------------- -// Class AudioEffect Implementation -//------------------------------------------------------------------------------------------------------- -/*! - The constructor of your class is passed a parameter of the type \e audioMasterCallback. The actual - mechanism in which your class gets constructed is not important right now. Effectively your class is - constructed by the hosting application, which passes an object of type \e audioMasterCallback that - handles the interaction with the plug-in. You pass this on to the base class' constructor and then - can forget about it. - - \param audioMaster Passed by the Host and handles interaction - \param numPrograms Pass the number of programs the plug-in provides - \param numParams Pass the number of parameters the plug-in provides - -\code -MyPlug::MyPlug (audioMasterCallback audioMaster) -: AudioEffectX (audioMaster, 1, 1) // 1 program, 1 parameter only -{ - setNumInputs (2); // stereo in - setNumOutputs (2); // stereo out - setUniqueID ('MyPl'); // you must change this for other plug-ins! - canProcessReplacing (); // supports replacing mode -} -\endcode - - \sa setNumInputs, setNumOutputs, setUniqueID, canProcessReplacing -*/ -AudioEffect::AudioEffect (audioMasterCallback audioMaster, VstInt32 numPrograms, VstInt32 numParams) -: audioMaster (audioMaster) -, editor (0) -, sampleRate (44100.f) -, blockSize (1024) -, numPrograms (numPrograms) -, numParams (numParams) -, curProgram (0) -{ - memset (&cEffect, 0, sizeof (cEffect)); - - cEffect.magic = kEffectMagic; - cEffect.dispatcher = dispatchEffectClass; - cEffect.DECLARE_VST_DEPRECATED (process) = DECLARE_VST_DEPRECATED (processClass); - cEffect.setParameter = setParameterClass; - cEffect.getParameter = getParameterClass; - cEffect.numPrograms = numPrograms; - cEffect.numParams = numParams; - cEffect.numInputs = 1; // mono input - cEffect.numOutputs = 2; // stereo output - cEffect.DECLARE_VST_DEPRECATED (ioRatio) = 1.f; - cEffect.object = this; - cEffect.uniqueID = CCONST ('N', 'o', 'E', 'f'); - cEffect.version = 1; - cEffect.processReplacing = processClassReplacing; - -#if VST_2_4_EXTENSIONS - canProcessReplacing (); // mandatory in VST 2.4! - cEffect.processDoubleReplacing = processClassDoubleReplacing; -#endif -} - -//------------------------------------------------------------------------------------------------------- -AudioEffect::~AudioEffect () -{ - if (editor) - delete editor; -} - -//------------------------------------------------------------------------------------------------------- -void AudioEffect::setEditor (AEffEditor* _editor) -{ - editor = _editor; - if (editor) - cEffect.flags |= effFlagsHasEditor; - else - cEffect.flags &= ~effFlagsHasEditor; -} - -//------------------------------------------------------------------------------------------------------- -VstIntPtr AudioEffect::dispatcher (VstInt32 opcode, VstInt32 index, VstIntPtr value, void* ptr, float opt) -{ - VstIntPtr v = 0; - - switch (opcode) - { - case effOpen: open (); break; - case effClose: close (); break; - case effSetProgram: if (value < numPrograms) setProgram ((VstInt32)value); break; - case effGetProgram: v = getProgram (); break; - case effSetProgramName: setProgramName ((char*)ptr); break; - case effGetProgramName: getProgramName ((char*)ptr); break; - case effGetParamLabel: getParameterLabel (index, (char*)ptr); break; - case effGetParamDisplay: getParameterDisplay (index, (char*)ptr); break; - case effGetParamName: getParameterName (index, (char*)ptr); break; - - case effSetSampleRate: setSampleRate (opt); break; - case effSetBlockSize: setBlockSize ((VstInt32)value); break; - case effMainsChanged: if (!value) suspend (); else resume (); break; - #if !VST_FORCE_DEPRECATED - case effGetVu: v = (VstIntPtr)(getVu () * 32767.); break; - #endif - - //---Editor------------ - case effEditGetRect: if (editor) v = editor->getRect ((ERect**)ptr) ? 1 : 0; break; - case effEditOpen: if (editor) v = editor->open (ptr) ? 1 : 0; break; - case effEditClose: if (editor) editor->close (); break; - case effEditIdle: if (editor) editor->idle (); break; - - #if (TARGET_API_MAC_CARBON && !VST_FORCE_DEPRECATED) - case effEditDraw: if (editor) editor->draw ((ERect*)ptr); break; - case effEditMouse: if (editor) v = editor->mouse (index, value); break; - case effEditKey: if (editor) v = editor->key (value); break; - case effEditTop: if (editor) editor->top (); break; - case effEditSleep: if (editor) editor->sleep (); break; - #endif - - case DECLARE_VST_DEPRECATED (effIdentify): v = CCONST ('N', 'v', 'E', 'f'); break; - - //---Persistence------- - case effGetChunk: v = getChunk ((void**)ptr, index ? true : false); break; - case effSetChunk: v = setChunk (ptr, (VstInt32)value, index ? true : false); break; - } - return v; -} - -//------------------------------------------------------------------------------------------------------- -/*! - Use to ask for the Host's version - \return The Host's version -*/ -VstInt32 AudioEffect::getMasterVersion () -{ - VstInt32 version = 1; - if (audioMaster) - { - version = (VstInt32)audioMaster (&cEffect, audioMasterVersion, 0, 0, 0, 0); - if (!version) // old - version = 1; - } - return version; -} - -//------------------------------------------------------------------------------------------------------- -/*! - \sa AudioEffectX::getNextShellPlugin -*/ -VstInt32 AudioEffect::getCurrentUniqueId () -{ - VstInt32 id = 0; - if (audioMaster) - id = (VstInt32)audioMaster (&cEffect, audioMasterCurrentId, 0, 0, 0, 0); - return id; -} - -//------------------------------------------------------------------------------------------------------- -/*! - Give idle time to Host application, e.g. if plug-in editor is doing mouse tracking in a modal loop. -*/ -void AudioEffect::masterIdle () -{ - if (audioMaster) - audioMaster (&cEffect, audioMasterIdle, 0, 0, 0, 0); -} - -//------------------------------------------------------------------------------------------------------- -bool AudioEffect::DECLARE_VST_DEPRECATED (isInputConnected) (VstInt32 input) -{ - VstInt32 ret = 0; - if (audioMaster) - ret = (VstInt32)audioMaster (&cEffect, DECLARE_VST_DEPRECATED (audioMasterPinConnected), input, 0, 0, 0); - return ret ? false : true; // return value is 0 for true -} - -//------------------------------------------------------------------------------------------------------- -bool AudioEffect::DECLARE_VST_DEPRECATED (isOutputConnected) (VstInt32 output) -{ - VstInt32 ret = 0; - if (audioMaster) - ret = (VstInt32)audioMaster (&cEffect, DECLARE_VST_DEPRECATED (audioMasterPinConnected), output, 1, 0, 0); - return ret ? false : true; // return value is 0 for true -} - -//------------------------------------------------------------------------------------------------------- -/*! - \param index parameter index - \param float parameter value - - \note An important thing to notice is that if the user changes a parameter in your editor, which is - out of the Host's control if you are not using the default string based interface, you should - call setParameterAutomated (). This ensures that the Host is notified of the parameter change, which - allows it to record these changes for automation. - - \sa setParameter -*/ -void AudioEffect::setParameterAutomated (VstInt32 index, float value) -{ - setParameter (index, value); - if (audioMaster) - audioMaster (&cEffect, audioMasterAutomate, index, 0, 0, value); // value is in opt -} - -//------------------------------------------------------------------------------------------------------- -// Flags -//------------------------------------------------------------------------------------------------------- -void AudioEffect::DECLARE_VST_DEPRECATED (hasVu) (bool state) -{ - if (state) - cEffect.flags |= DECLARE_VST_DEPRECATED (effFlagsHasVu); - else - cEffect.flags &= ~DECLARE_VST_DEPRECATED (effFlagsHasVu); -} - -//------------------------------------------------------------------------------------------------------- -void AudioEffect::DECLARE_VST_DEPRECATED (hasClip) (bool state) -{ - if (state) - cEffect.flags |= DECLARE_VST_DEPRECATED (effFlagsHasClip); - else - cEffect.flags &= ~DECLARE_VST_DEPRECATED (effFlagsHasClip); -} - -//------------------------------------------------------------------------------------------------------- -void AudioEffect::DECLARE_VST_DEPRECATED (canMono) (bool state) -{ - if (state) - cEffect.flags |= DECLARE_VST_DEPRECATED (effFlagsCanMono); - else - cEffect.flags &= ~DECLARE_VST_DEPRECATED (effFlagsCanMono); -} - -//------------------------------------------------------------------------------------------------------- -/*! - \param state Set to \e true if supported - - \note Needs to be called in the plug-in's constructor -*/ -void AudioEffect::canProcessReplacing (bool state) -{ - if (state) - cEffect.flags |= effFlagsCanReplacing; - else - cEffect.flags &= ~effFlagsCanReplacing; -} - -//----------------------------------------------------------------------------------------------------------------- -/*! - \param state Set to \e true if supported - - \note Needs to be called in the plug-in's constructor -*/ -#if VST_2_4_EXTENSIONS -void AudioEffect::canDoubleReplacing (bool state) -{ - if (state) - cEffect.flags |= effFlagsCanDoubleReplacing; - else - cEffect.flags &= ~effFlagsCanDoubleReplacing; -} -#endif - -//------------------------------------------------------------------------------------------------------- -/*! - \param state Set \e true if programs are chunks - - \note Needs to be called in the plug-in's constructor -*/ -void AudioEffect::programsAreChunks (bool state) -{ - if (state) - cEffect.flags |= effFlagsProgramChunks; - else - cEffect.flags &= ~effFlagsProgramChunks; -} - -//------------------------------------------------------------------------------------------------------- -void AudioEffect::DECLARE_VST_DEPRECATED (setRealtimeQualities) (VstInt32 qualities) -{ - cEffect.DECLARE_VST_DEPRECATED (realQualities) = qualities; -} - -//------------------------------------------------------------------------------------------------------- -void AudioEffect::DECLARE_VST_DEPRECATED (setOfflineQualities) (VstInt32 qualities) -{ - cEffect.DECLARE_VST_DEPRECATED (offQualities) = qualities; -} - -//------------------------------------------------------------------------------------------------------- -/*! - Use to report the Plug-in's latency (Group Delay) - - \param delay Plug-ins delay in samples -*/ -void AudioEffect::setInitialDelay (VstInt32 delay) -{ - cEffect.initialDelay = delay; -} - -//------------------------------------------------------------------------------------------------------- -// Strings Conversion -//------------------------------------------------------------------------------------------------------- -/*! - \param value Value to convert - \param text String up to length char - \param maxLen Maximal length of the string -*/ -void AudioEffect::dB2string (float value, char* text, VstInt32 maxLen) -{ - if (value <= 0) - vst_strncpy (text, "-oo", maxLen); - else - float2string ((float)(20. * log10 (value)), text, maxLen); -} - -//------------------------------------------------------------------------------------------------------- -/*! - \param samples Number of samples - \param text String up to length char - \param maxLen Maximal length of the string -*/ -void AudioEffect::Hz2string (float samples, char* text, VstInt32 maxLen) -{ - float _sampleRate = getSampleRate (); - if (!samples) - float2string (0, text, maxLen); - else - float2string (_sampleRate / samples, text, maxLen); -} - -//------------------------------------------------------------------------------------------------------- -/*! - \param samples Number of samples - \param text String up to length char - \param maxLen Maximal length of the string -*/ -void AudioEffect::ms2string (float samples, char* text, VstInt32 maxLen) -{ - float2string ((float)(samples * 1000. / getSampleRate ()), text, maxLen); -} - -//------------------------------------------------------------------------------------------------------- -/*! - \param value Value to convert - \param text String up to length char - \param maxLen Maximal length of the string -*/ -void AudioEffect::float2string (float value, char* text, VstInt32 maxLen) -{ - VstInt32 c = 0, neg = 0; - char string[32]; - char* s; - double v, integ, i10, mantissa, m10, ten = 10.; - - v = (double)value; - if (v < 0) - { - neg = 1; - value = -value; - v = -v; - c++; - if (v > 9999999.) - { - vst_strncpy (string, "Huge!", 31); - return; - } - } - else if (v > 99999999.) - { - vst_strncpy (string, "Huge!", 31); - return; - } - - s = string + 31; - *s-- = 0; - *s-- = '.'; - c++; - - integ = floor (v); - i10 = fmod (integ, ten); - *s-- = (char)((VstInt32)i10 + '0'); - integ /= ten; - c++; - while (integ >= 1. && c < 8) - { - i10 = fmod (integ, ten); - *s-- = (char)((VstInt32)i10 + '0'); - integ /= ten; - c++; - } - if (neg) - *s-- = '-'; - vst_strncpy (text, s + 1, maxLen); - if (c >= 8) - return; - - s = string + 31; - *s-- = 0; - mantissa = fmod (v, 1.); - mantissa *= pow (ten, (double)(8 - c)); - while (c < 8) - { - if (mantissa <= 0) - *s-- = '0'; - else - { - m10 = fmod (mantissa, ten); - *s-- = (char)((VstInt32)m10 + '0'); - mantissa /= 10.; - } - c++; - } - vst_strncat (text, s + 1, maxLen); -} - -//------------------------------------------------------------------------------------------------------- -/*! - \param value Value to convert - \param text String up to length char - \param maxLen Maximal length of the string -*/ -void AudioEffect::int2string (VstInt32 value, char* text, VstInt32 maxLen) -{ - if (value >= 100000000) - { - vst_strncpy (text, "Huge!", maxLen); - return; - } - - if (value < 0) - { - vst_strncpy (text, "-", maxLen); - value = -value; - } - else - vst_strncpy (text, "", maxLen); - - bool state = false; - for (VstInt32 div = 100000000; div >= 1; div /= 10) - { - VstInt32 digit = value / div; - value -= digit * div; - if (state || digit > 0) - { - char temp[2] = {static_cast('0' + (char)digit), '\0'}; - vst_strncat (text, temp, maxLen); - state = true; - } - } -} -//------------------------------------------------------------------------------------------------------- -//------------------------------------------------------------------------------------------------------- -/*! - \fn void AudioEffect::processReplacing (float** inputs, float** outputs, VstInt32 sampleFrames) - - This process method must be provided. It takes input data, applies its pocessing algorithm, and then puts the - result to the output by overwriting the output buffer. - - \param inputs An array of pointers to the data - \param outputs An array of pointers to where the data can be written to - \param sampleFrames Number of sample frames to process - - \warning Never call any Mac OS 9 functions (or other functions which call into the OS) inside your - audio process function! This will crash the system when your plug-in is run in MP (multiprocessor) mode. - If you must call into the OS, you must use MPRemoteCall () (see Apples' documentation), or - explicitly use functions which are documented by Apple to be MP safe. On Mac OS X read the system - header files to be sure that you only call thread safe functions. - -*/ - -//------------------------------------------------------------------------------------------------------- -/*! - \fn void AudioEffect::setBlockSize (VstInt32 blockSize) - - This is called by the Host, and tells the plug-in that the maximum block size passed to - processReplacing() will be \e blockSize. - - \param blockSize Maximum number of sample frames - - \warning You must process exactly \e sampleFrames number of samples in inside processReplacing, not more! -*/ - -//------------------------------------------------------------------------------------------------------- -/*! - \fn void AudioEffect::setParameter (VstInt32 index, float value) - - Parameters are the individual parameter settings the user can adjust. A VST Host can automate these - parameters. Set parameter \e index to \e value. - - \param index Index of the parameter to change - \param value A float value between 0.0 and 1.0 inclusive - - \note Parameter values, like all VST parameters, are declared as floats with an inclusive range of - 0.0 to 1.0. How data is presented to the user is merely in the user-interface handling. This is a - convention, but still worth regarding. Maybe the VST-Host's automation system depends on this range. -*/ - -//------------------------------------------------------------------------------------------------------- -/*! - \fn float AudioEffect::getParameter (VstInt32 index) - - Return the \e value of parameter \e index - - \param index Index of the parameter - \return A float value between 0.0 and 1.0 inclusive -*/ - -//------------------------------------------------------------------------------------------------------- -/*! - \fn void AudioEffect::getParameterLabel (VstInt32 index, char* label) - - \param index Index of the parameter - \param label A string up to 8 char -*/ - -//------------------------------------------------------------------------------------------------------- -/*! - \fn void AudioEffect::getParameterDisplay (VstInt32 index, char* text) - - \param index Index of the parameter - \param text A string up to 8 char -*/ - -//------------------------------------------------------------------------------------------------------- -/*! - \fn VstInt32 AudioEffect::getProgram () - - \return Index of the current program -*/ - -//------------------------------------------------------------------------------------------------------- -/*! - \fn void AudioEffect::setProgram (VstInt32 program) - - \param Program of the current program -*/ - -//------------------------------------------------------------------------------------------------------- -/*! - \fn void AudioEffect::getParameterName (VstInt32 index, char* text) - - \param index Index of the parameter - \param text A string up to 8 char -*/ - -//------------------------------------------------------------------------------------------------------- -/*! - \fn void AudioEffect::setProgramName (char* name) - - The program name is displayed in the rack, and can be edited by the user. - - \param name A string up to 24 char - - \warning Please be aware that the string lengths supported by the default VST interface are normally - limited to 24 characters. If you copy too much data into the buffers provided, you will break the - Host application. -*/ - -//------------------------------------------------------------------------------------------------------- -/*! - \fn void AudioEffect::getProgramName (char* name) - - The program name is displayed in the rack, and can be edited by the user. - - \param name A string up to 24 char - - \warning Please be aware that the string lengths supported by the default VST interface are normally - limited to 24 characters. If you copy too much data into the buffers provided, you will break the - Host application. -*/ - -//------------------------------------------------------------------------------------------------------- -/*! - \fn VstInt32 AudioEffect::getChunk (void** data, bool isPreset) - - \param data should point to the newly allocated memory block containg state data. You can savely release it in next suspend/resume call. - \param isPreset true when saving a single program, false for all programs - - \note - If your plug-in is configured to use chunks (see AudioEffect::programsAreChunks), the Host - will ask for a block of memory describing the current plug-in state for saving. - To restore the state at a later stage, the same data is passed back to AudioEffect::setChunk. - Alternatively, when not using chunk, the Host will simply save all parameter values. -*/ - -//------------------------------------------------------------------------------------------------------- -/*! - \fn VstInt32 AudioEffect::setChunk (void* data, VstInt32 byteSize, bool isPreset) - - \param data pointer to state data (owned by Host) - \param byteSize size of state data - \param isPreset true when restoring a single program, false for all programs - - \sa getChunk -*/ - -//------------------------------------------------------------------------------------------------------- -/*! - \fn void AudioEffect::setNumInputs (VstInt32 inputs) - - This number is fixed at construction time and can't change until the plug-in is destroyed. - - \param inputs The number of inputs - - \sa isInputConnected() - - \note Needs to be called in the plug-in's constructor -*/ - -//------------------------------------------------------------------------------------------------------- -/*! - \fn void AudioEffect::setNumOutputs (VstInt32 outputs) - - This number is fixed at construction time and can't change until the plug-in is destroyed. - - \param outputs The number of outputs - - \sa isOutputConnected() - - \note Needs to be called in the plug-in's constructor -*/ - -//------------------------------------------------------------------------------------------------------- -/*! - \fn void AudioEffect::setUniqueID (VstInt32 iD) - - Must call this! Set the plug-in's unique identifier. The Host uses this to identify the plug-in, for - instance when it is loading effect programs and banks. On Steinberg Web Page you can find an UniqueID - Database where you can record your UniqueID, it will check if the ID is already used by an another - vendor. You can use CCONST('a','b','c','d') (defined in VST 2.0) to be platform independent to - initialize an UniqueID. - - \param iD Plug-in's unique ID - - \note Needs to be called in the plug-in's constructor -*/ diff --git a/vst/public.sdk/source/vst2.x/audioeffect.h b/vst/public.sdk/source/vst2.x/audioeffect.h deleted file mode 100644 index 2da637fe..00000000 --- a/vst/public.sdk/source/vst2.x/audioeffect.h +++ /dev/null @@ -1,196 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 2.4 -// -// Category : VST 2.x Classes -// Filename : public.sdk/source/vst2.x/audioeffect.h -// Created by : Steinberg, 01/2004 -// Description : Class AudioEffect (VST 1.0). -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#pragma once - -#include "pluginterfaces/vst2.x/aeffect.h" // "c" interface - -class AEffEditor; - -//------------------------------------------------------------------------------------------------------- -/** VST Effect Base Class (VST 1.0). */ -//------------------------------------------------------------------------------------------------------- -class AudioEffect -{ -public: -//------------------------------------------------------------------------------------------------------- - AudioEffect (audioMasterCallback audioMaster, VstInt32 numPrograms, VstInt32 numParams); ///< Create an \e AudioEffect object - virtual ~AudioEffect (); ///< Destroy an \e AudioEffect object - - virtual VstIntPtr dispatcher (VstInt32 opcode, VstInt32 index, VstIntPtr value, void* ptr, float opt); ///< Opcodes dispatcher - -//------------------------------------------------------------------------------------------------------- -/// \name State Transitions -//------------------------------------------------------------------------------------------------------- -//@{ - virtual void open () {} ///< Called when plug-in is initialized - virtual void close () {} ///< Called when plug-in will be released - virtual void suspend () {} ///< Called when plug-in is switched to off - virtual void resume () {} ///< Called when plug-in is switched to on -//@} - -//------------------------------------------------------------------------------------------------------- -/// \name Processing -//------------------------------------------------------------------------------------------------------- -//@{ - virtual void setSampleRate (float sampleRate) { this->sampleRate = sampleRate; } ///< Called when the sample rate changes (always in a suspend state) - virtual void setBlockSize (VstInt32 blockSize) { this->blockSize = blockSize; } ///< Called when the Maximun block size changes (always in a suspend state). Note that the sampleFrames in Process Calls could be smaller than this block size, but NOT bigger. - - virtual void processReplacing (float** inputs, float** outputs, VstInt32 sampleFrames) = 0; ///< Process 32 bit (single precision) floats (always in a resume state) - -#if VST_2_4_EXTENSIONS - virtual void processDoubleReplacing (double** inputs, double** outputs, VstInt32 sampleFrames) {} ///< Process 64 bit (double precision) floats (always in a resume state) \sa processReplacing -#endif // VST_2_4_EXTENSIONS -//@} - -//------------------------------------------------------------------------------------------------------- -/// \name Parameters -//------------------------------------------------------------------------------------------------------- -//@{ - virtual void setParameter (VstInt32 index, float value) {} ///< Called when a parameter changed - virtual float getParameter (VstInt32 index) { return 0; } ///< Return the value of the parameter with \e index - virtual void setParameterAutomated (VstInt32 index, float value);///< Called after a control has changed in the editor and when the associated parameter should be automated -//@} - -//------------------------------------------------------------------------------------------------------- -/// \name Programs and Persistence -//------------------------------------------------------------------------------------------------------- -//@{ - virtual VstInt32 getProgram () { return curProgram; } ///< Return the index to the current program - virtual void setProgram (VstInt32 program) { curProgram = program; } ///< Set the current program to \e program - - virtual void setProgramName (char* name) {} ///< Stuff the name field of the current program with \e name. Limited to #kVstMaxProgNameLen. - virtual void getProgramName (char* name) { *name = 0; } ///< Stuff \e name with the name of the current program. Limited to #kVstMaxProgNameLen. - - virtual void getParameterLabel (VstInt32 index, char* label) { *label = 0; } ///< Stuff \e label with the units in which parameter \e index is displayed (i.e. "sec", "dB", "type", etc...). Limited to #kVstMaxParamStrLen. - virtual void getParameterDisplay (VstInt32 index, char* text) { *text = 0; } ///< Stuff \e text with a string representation ("0.5", "-3", "PLATE", etc...) of the value of parameter \e index. Limited to #kVstMaxParamStrLen. - virtual void getParameterName (VstInt32 index, char* text) { *text = 0; } ///< Stuff \e text with the name ("Time", "Gain", "RoomType", etc...) of parameter \e index. Limited to #kVstMaxParamStrLen. - - virtual VstInt32 getChunk (void** data, bool isPreset = false) { return 0; } ///< Host stores plug-in state. Returns the size in bytes of the chunk (plug-in allocates the data array) - virtual VstInt32 setChunk (void* data, VstInt32 byteSize, bool isPreset = false) { return 0; } ///< Host restores plug-in state -//@} - -//------------------------------------------------------------------------------------------------------- -/// \name Internal Setup -//------------------------------------------------------------------------------------------------------- -//@{ - virtual void setUniqueID (VstInt32 iD) { cEffect.uniqueID = iD; } ///< Must be called to set the plug-ins unique ID! - virtual void setNumInputs (VstInt32 inputs) { cEffect.numInputs = inputs; } ///< Set the number of inputs the plug-in will handle. For a plug-in which could change its IO configuration, this number is the maximun available inputs. - virtual void setNumOutputs (VstInt32 outputs) { cEffect.numOutputs = outputs; } ///< Set the number of outputs the plug-in will handle. For a plug-in which could change its IO configuration, this number is the maximun available ouputs. - - virtual void canProcessReplacing (bool state = true); ///< Tells that processReplacing() could be used. Mandatory in VST 2.4! - -#if VST_2_4_EXTENSIONS - virtual void canDoubleReplacing (bool state = true); ///< Tells that processDoubleReplacing() is implemented. -#endif // VST_2_4_EXTENSIONS - - virtual void programsAreChunks (bool state = true); ///< Program data is handled in formatless chunks (using getChunk-setChunks) - virtual void setInitialDelay (VstInt32 delay); ///< Use to report the plug-in's latency (Group Delay) -//@} - -//------------------------------------------------------------------------------------------------------- -/// \name Editor -//------------------------------------------------------------------------------------------------------- -//@{ - void setEditor (AEffEditor* editor); ///< Should be called if you want to define your own editor - virtual AEffEditor* getEditor () { return editor; } ///< Returns the attached editor -//@} - -//------------------------------------------------------------------------------------------------------- -/// \name Inquiry -//------------------------------------------------------------------------------------------------------- -//@{ - virtual AEffect* getAeffect () { return &cEffect; } ///< Returns the #AEffect structure - virtual float getSampleRate () { return sampleRate; } ///< Returns the current sample rate - virtual VstInt32 getBlockSize () { return blockSize; } ///< Returns the current Maximum block size -//@} - -//------------------------------------------------------------------------------------------------------- -/// \name Host Communication -//------------------------------------------------------------------------------------------------------- -//@{ - virtual VstInt32 getMasterVersion (); ///< Returns the Host's version (for example 2400 for VST 2.4) - virtual VstInt32 getCurrentUniqueId (); ///< Returns current unique identifier when loading shell plug-ins - virtual void masterIdle (); ///< Give idle time to Host application -//@} - -//------------------------------------------------------------------------------------------------------- -/// \name Tools (helpers) -//------------------------------------------------------------------------------------------------------- -//@{ - virtual void dB2string (float value, char* text, VstInt32 maxLen); ///< Stuffs \e text with an amplitude on the [0.0, 1.0] scale converted to its value in decibels. - virtual void Hz2string (float samples, char* text, VstInt32 maxLen); ///< Stuffs \e text with the frequency in Hertz that has a period of \e samples. - virtual void ms2string (float samples, char* text, VstInt32 maxLen); ///< Stuffs \e text with the duration in milliseconds of \e samples frames. - virtual void float2string (float value, char* text, VstInt32 maxLen); ///< Stuffs \e text with a string representation on the floating point \e value. - virtual void int2string (VstInt32 value, char* text, VstInt32 maxLen); ///< Stuffs \e text with a string representation on the integer \e value. -//@} - -//------------------------------------------------------------------------------------------------------- -// Deprecated methods -//------------------------------------------------------------------------------------------------------- -/// @cond ignore - virtual void DECLARE_VST_DEPRECATED (process) (float** inputs, float** outputs, VstInt32 sampleFrames) {} - virtual float DECLARE_VST_DEPRECATED (getVu) () { return 0; } - virtual void DECLARE_VST_DEPRECATED (hasVu) (bool state = true); - virtual void DECLARE_VST_DEPRECATED (hasClip) (bool state = true); - virtual void DECLARE_VST_DEPRECATED (canMono) (bool state = true); - virtual void DECLARE_VST_DEPRECATED (setRealtimeQualities) (VstInt32 qualities); - virtual void DECLARE_VST_DEPRECATED (setOfflineQualities) (VstInt32 qualities); - virtual bool DECLARE_VST_DEPRECATED (isInputConnected) (VstInt32 input); - virtual bool DECLARE_VST_DEPRECATED (isOutputConnected) (VstInt32 output); -/// @endcond - -//------------------------------------------------------------------------------------------------------- -protected: - audioMasterCallback audioMaster; ///< Host callback - AEffEditor* editor; ///< Pointer to the plug-in's editor - float sampleRate; ///< Current sample rate - VstInt32 blockSize; ///< Maximum block size - VstInt32 numPrograms; ///< Number of programs - VstInt32 numParams; ///< Number of parameters - VstInt32 curProgram; ///< Current program - AEffect cEffect; ///< #AEffect object - -/// @cond ignore - static VstIntPtr dispatchEffectClass (AEffect* e, VstInt32 opcode, VstInt32 index, VstIntPtr value, void* ptr, float opt); - static float getParameterClass (AEffect* e, VstInt32 index); - static void setParameterClass (AEffect* e, VstInt32 index, float value); - static void DECLARE_VST_DEPRECATED (processClass) (AEffect* e, float** inputs, float** outputs, VstInt32 sampleFrames); - static void processClassReplacing (AEffect* e, float** inputs, float** outputs, VstInt32 sampleFrames); - -#if VST_2_4_EXTENSIONS - static void processClassDoubleReplacing (AEffect* e, double** inputs, double** outputs, VstInt32 sampleFrames); -#endif // VST_2_4_EXTENSIONS -/// @endcond -}; diff --git a/vst/public.sdk/source/vst2.x/audioeffectx.cpp b/vst/public.sdk/source/vst2.x/audioeffectx.cpp deleted file mode 100644 index b9a1440a..00000000 --- a/vst/public.sdk/source/vst2.x/audioeffectx.cpp +++ /dev/null @@ -1,1567 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 2.4 -// -// Category : VST 2.x Classes -// Filename : public.sdk/source/vst2.x/audioeffectx.cpp -// Created by : Steinberg, 01/2004 -// Description : Class AudioEffectX extends AudioEffect with new features. You should derive your plug-in from AudioEffectX. -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#include "audioeffectx.h" -#include "aeffeditor.h" - -//------------------------------------------------------------------------------------------------------- -/*! hostCanDos strings Plug-in -> Host */ -namespace HostCanDos -{ - const char* canDoSendVstEvents = "sendVstEvents"; ///< Host supports send of Vst events to plug-in - const char* canDoSendVstMidiEvent = "sendVstMidiEvent"; ///< Host supports send of MIDI events to plug-in - const char* canDoSendVstTimeInfo = "sendVstTimeInfo"; ///< Host supports send of VstTimeInfo to plug-in - const char* canDoReceiveVstEvents = "receiveVstEvents"; ///< Host can receive Vst events from plug-in - const char* canDoReceiveVstMidiEvent = "receiveVstMidiEvent"; ///< Host can receive MIDI events from plug-in - const char* canDoReportConnectionChanges = "reportConnectionChanges"; ///< Host will indicates the plug-in when something change in plug-inīs routing/connections with #suspend/#resume/#setSpeakerArrangement - const char* canDoAcceptIOChanges = "acceptIOChanges"; ///< Host supports #ioChanged () - const char* canDoSizeWindow = "sizeWindow"; ///< used by VSTGUI - const char* canDoOffline = "offline"; ///< Host supports offline feature - const char* canDoOpenFileSelector = "openFileSelector"; ///< Host supports function #openFileSelector () - const char* canDoCloseFileSelector = "closeFileSelector"; ///< Host supports function #closeFileSelector () - const char* canDoStartStopProcess = "startStopProcess"; ///< Host supports functions #startProcess () and #stopProcess () - const char* canDoShellCategory = "shellCategory"; ///< 'shell' handling via uniqueID. If supported by the Host and the Plug-in has the category #kPlugCategShell - const char* canDoSendVstMidiEventFlagIsRealtime = "sendVstMidiEventFlagIsRealtime"; ///< Host supports flags for #VstMidiEvent -} - -//------------------------------------------------------------------------------------------------------- -/*! plugCanDos strings Host -> Plug-in */ -namespace PlugCanDos -{ - const char* canDoSendVstEvents = "sendVstEvents"; ///< plug-in will send Vst events to Host - const char* canDoSendVstMidiEvent = "sendVstMidiEvent"; ///< plug-in will send MIDI events to Host - const char* canDoReceiveVstEvents = "receiveVstEvents"; ///< plug-in can receive MIDI events from Host - const char* canDoReceiveVstMidiEvent = "receiveVstMidiEvent"; ///< plug-in can receive MIDI events from Host - const char* canDoReceiveVstTimeInfo = "receiveVstTimeInfo"; ///< plug-in can receive Time info from Host - const char* canDoOffline = "offline"; ///< plug-in supports offline functions (#offlineNotify, #offlinePrepare, #offlineRun) - const char* canDoMidiProgramNames = "midiProgramNames"; ///< plug-in supports function #getMidiProgramName () - const char* canDoBypass = "bypass"; ///< plug-in supports function #setBypass () -} - -//----------------------------------------------------------------------------------------------------------------- -// Class AudioEffectX Implementation -//----------------------------------------------------------------------------------------------------------------- -/*! - \sa AudioEffect() -*/ -AudioEffectX::AudioEffectX (audioMasterCallback audioMaster, VstInt32 numPrograms, VstInt32 numParams) -: AudioEffect (audioMaster, numPrograms, numParams) -{} - -//----------------------------------------------------------------------------------------------------------------- -VstIntPtr AudioEffectX::dispatcher (VstInt32 opcode, VstInt32 index, VstIntPtr value, void* ptr, float opt) -{ - VstIntPtr v = 0; - switch (opcode) - { - //---VstEvents---------------------- - case effProcessEvents: - v = processEvents ((VstEvents*)ptr); - break; - - //---Parameters and Programs---------------------- - case effCanBeAutomated: - v = canParameterBeAutomated (index) ? 1 : 0; - break; - case effString2Parameter: - v = string2parameter (index, (char*)ptr) ? 1 : 0; - break; - - case effGetProgramNameIndexed: - v = getProgramNameIndexed ((VstInt32)value, index, (char*)ptr) ? 1 : 0; - break; - #if !VST_FORCE_DEPRECATED - case effGetNumProgramCategories: - v = getNumCategories (); - break; - case effCopyProgram: - v = copyProgram (index) ? 1 : 0; - break; - - //---Connections, Configuration---------------------- - case effConnectInput: - inputConnected (index, value ? true : false); - v = 1; - break; - case effConnectOutput: - outputConnected (index, value ? true : false); - v = 1; - break; - #endif // !VST_FORCE_DEPRECATED - - case effGetInputProperties: - v = getInputProperties (index, (VstPinProperties*)ptr) ? 1 : 0; - break; - case effGetOutputProperties: - v = getOutputProperties (index, (VstPinProperties*)ptr) ? 1 : 0; - break; - case effGetPlugCategory: - v = (VstIntPtr)getPlugCategory (); - break; - - #if !VST_FORCE_DEPRECATED - //---Realtime---------------------- - case effGetCurrentPosition: - v = reportCurrentPosition (); - break; - - case effGetDestinationBuffer: - v = ToVstPtr (reportDestinationBuffer ()); - break; - #endif // !VST_FORCE_DEPRECATED - - //---Offline---------------------- - case effOfflineNotify: - v = offlineNotify ((VstAudioFile*)ptr, (VstInt32)value, index != 0); - break; - case effOfflinePrepare: - v = offlinePrepare ((VstOfflineTask*)ptr, (VstInt32)value); - break; - case effOfflineRun: - v = offlineRun ((VstOfflineTask*)ptr, (VstInt32)value); - break; - - //---Others---------------------- - case effSetSpeakerArrangement: - v = setSpeakerArrangement (FromVstPtr (value), (VstSpeakerArrangement*)ptr) ? 1 : 0; - break; - case effProcessVarIo: - v = processVariableIo ((VstVariableIo*)ptr) ? 1 : 0; - break; - #if !VST_FORCE_DEPRECATED - case effSetBlockSizeAndSampleRate: - setBlockSizeAndSampleRate ((VstInt32)value, opt); - v = 1; - break; - #endif // !VST_FORCE_DEPRECATED - case effSetBypass: - v = setBypass (value ? true : false) ? 1 : 0; - break; - case effGetEffectName: - v = getEffectName ((char*)ptr) ? 1 : 0; - break; - case effGetVendorString: - v = getVendorString ((char*)ptr) ? 1 : 0; - break; - case effGetProductString: - v = getProductString ((char*)ptr) ? 1 : 0; - break; - case effGetVendorVersion: - v = getVendorVersion (); - break; - case effVendorSpecific: - v = vendorSpecific (index, value, ptr, opt); - break; - case effCanDo: - v = canDo ((char*)ptr); - break; - - case effGetTailSize: - v = getGetTailSize (); - break; - - #if !VST_FORCE_DEPRECATED - case effGetErrorText: - v = getErrorText ((char*)ptr) ? 1 : 0; - break; - - case effGetIcon: - v = ToVstPtr (getIcon ()); - break; - - case effSetViewPosition: - v = setViewPosition (index, (VstInt32)value) ? 1 : 0; - break; - - case effIdle: - v = fxIdle (); - break; - - case effKeysRequired: - v = (keysRequired () ? 0 : 1); // reversed to keep v1 compatibility - break; - #endif // !VST_FORCE_DEPRECATED - - case effGetParameterProperties: - v = getParameterProperties (index, (VstParameterProperties*)ptr) ? 1 : 0; - break; - - case effGetVstVersion: - v = getVstVersion (); - break; - - //---Others---------------------- - #if VST_2_1_EXTENSIONS - case effEditKeyDown: - if (editor) - { - VstKeyCode keyCode = {index, (unsigned char)value, (unsigned char)opt}; - v = editor->onKeyDown (keyCode) ? 1 : 0; - } - break; - - case effEditKeyUp: - if (editor) - { - VstKeyCode keyCode = {index, (unsigned char)value, (unsigned char)opt}; - v = editor->onKeyUp (keyCode) ? 1 : 0; - } - break; - - case effSetEditKnobMode: - if (editor) - v = editor->setKnobMode ((VstInt32)value) ? 1 : 0; - break; - - case effGetMidiProgramName: - v = getMidiProgramName (index, (MidiProgramName*)ptr); - break; - case effGetCurrentMidiProgram: - v = getCurrentMidiProgram (index, (MidiProgramName*)ptr); - break; - case effGetMidiProgramCategory: - v = getMidiProgramCategory (index, (MidiProgramCategory*)ptr); - break; - case effHasMidiProgramsChanged: - v = hasMidiProgramsChanged (index) ? 1 : 0; - break; - case effGetMidiKeyName: - v = getMidiKeyName (index, (MidiKeyName*)ptr) ? 1 : 0; - break; - case effBeginSetProgram: - v = beginSetProgram () ? 1 : 0; - break; - case effEndSetProgram: - v = endSetProgram () ? 1 : 0; - break; - #endif // VST_2_1_EXTENSIONS - - #if VST_2_3_EXTENSIONS - case effGetSpeakerArrangement: - v = getSpeakerArrangement (FromVstPtr (value), (VstSpeakerArrangement**)ptr) ? 1 : 0; - break; - - case effSetTotalSampleToProcess: - v = setTotalSampleToProcess ((VstInt32)value); - break; - - case effShellGetNextPlugin: - v = getNextShellPlugin ((char*)ptr); - break; - - case effStartProcess: - v = startProcess (); - break; - case effStopProcess: - v = stopProcess (); - break; - - case effSetPanLaw: - v = setPanLaw ((VstInt32)value, opt) ? 1 : 0; - break; - - case effBeginLoadBank: - v = beginLoadBank ((VstPatchChunkInfo*)ptr); - break; - case effBeginLoadProgram: - v = beginLoadProgram ((VstPatchChunkInfo*)ptr); - break; - #endif // VST_2_3_EXTENSIONS - - #if VST_2_4_EXTENSIONS - case effSetProcessPrecision : - v = setProcessPrecision ((VstInt32)value) ? 1 : 0; - break; - - case effGetNumMidiInputChannels : - v = getNumMidiInputChannels (); - break; - - case effGetNumMidiOutputChannels : - v = getNumMidiOutputChannels (); - break; - #endif // VST_2_4_EXTENSIONS - - //---Version 1.0 or unknown----------------- - default: - v = AudioEffect::dispatcher (opcode, index, value, ptr, opt); - } - return v; -} - -//----------------------------------------------------------------------------------------------------------------- -/*! if this effect is a synth or can receive midi events, we call the deprecated wantEvents() as some host rely on it. -*/ -void AudioEffectX::resume () -{ - if (cEffect.flags & effFlagsIsSynth || canDo ((char*)PlugCanDos::canDoReceiveVstMidiEvent) == 1) - DECLARE_VST_DEPRECATED (wantEvents) (); -} - -//----------------------------------------------------------------------------------------------------------------- -void AudioEffectX::DECLARE_VST_DEPRECATED (wantEvents) (VstInt32 filter) -{ - if (audioMaster) - audioMaster (&cEffect, DECLARE_VST_DEPRECATED (audioMasterWantMidi), 0, filter, 0, 0); -} - -//----------------------------------------------------------------------------------------------------------------- -/*! - A plug-in will request time info by calling the function getTimeInfo() which returns a \e #VstTimeInfo - pointer (or NULL if not implemented by the Host). The mask parameter is composed of the same flags which - will be found in the flags field of \e #VstTimeInfo when returned, that is, if you need information about tempo. - The parameter passed to getTimeInfo() should have the \e #kVstTempoValid flag set. This request and delivery - system is important, as a request like this may cause significant calculations at the application's end, which - may take a lot of our precious time. This obviously means you should only set those flags that are required to - get the information you need. Also please be aware that requesting information does not necessarily mean that - that information is provided in return. Check the \e flags field in the \e #VstTimeInfo structure to see if your - request was actually met. - - \param filter A mask indicating which fields are requested, as some items may require extensive conversions. - See the \e flags in #VstTimeInfo - \return A pointer to a #VstTimeInfo structure or NULL if not implemented by the Host -*/ -VstTimeInfo* AudioEffectX::getTimeInfo (VstInt32 filter) -{ - if (audioMaster) - { - VstIntPtr ret = audioMaster (&cEffect, audioMasterGetTime, 0, filter, 0, 0); - return FromVstPtr (ret); - } - return 0; -} - -//----------------------------------------------------------------------------------------------------------------- -VstInt32 AudioEffectX::DECLARE_VST_DEPRECATED (tempoAt) (VstInt32 pos) -{ - if (audioMaster) - return (VstInt32)audioMaster (&cEffect, DECLARE_VST_DEPRECATED (audioMasterTempoAt), 0, pos, 0, 0); - return 0; -} - -//----------------------------------------------------------------------------------------------------------------- -bool AudioEffectX::sendVstEventsToHost (VstEvents* events) -/*! - Can be called inside processReplacing. - - \param events Fill with VST events - \return Returns \e true on success -*/ -{ - if (audioMaster) - return audioMaster (&cEffect, audioMasterProcessEvents, 0, 0, events, 0) == 1; - return 0; -} - -//----------------------------------------------------------------------------------------------------------------- -/*! - \fn VstInt32 AudioEffectX::processEvents (VstEvents* events) - - \return return value is ignored - - \remarks Events are always related to the current audio block. For each process cycle, processEvents() is called - once before a processReplacing() call (if new events are available). - - \sa VstEvents, VstMidiEvent -*/ - -//----------------------------------------------------------------------------------------------------------------- -// Parameters Functions -//----------------------------------------------------------------------------------------------------------------- -/*! - \fn bool AudioEffectX::canParameterBeAutomated (VstInt32 index) - - Obviously only useful when the application supports this. - - \param index Index of the parameter - \return \true if supported -*/ - -//----------------------------------------------------------------------------------------------------------------- -/*! - \fn bool AudioEffectX::string2parameter (VstInt32 index, char* text) - - Especially useful for plug-ins without user interface. The application can then implement a text edit field for - the user to set a parameter by entering text. - - \param index Index of the parameter - \param text A textual description of the parameter's value. A NULL pointer is used to check the capability - (return true). - \return \e true on success - - \note Implies setParameter (). text==0 is to be expected to check the capability (returns true) -*/ - -//----------------------------------------------------------------------------------------------------------------- -/*! - \fn bool AudioEffectX::getProgramNameIndexed (VstInt32 category, VstInt32 index, char* text) - - Allows a Host application to list the plug-in's programs (presets). - - \param category unused in VST 2.4 - \param index Index of the program in a given category, starting with 0. - \param text A string up to 24 chars. - \return \e true on success -*/ -//----------------------------------------------------------------------------------------------------------------- -VstInt32 AudioEffectX::DECLARE_VST_DEPRECATED (getNumAutomatableParameters) () -{ - if (audioMaster) - return (VstInt32)audioMaster (&cEffect, DECLARE_VST_DEPRECATED (audioMasterGetNumAutomatableParameters), 0, 0, 0, 0); - return 0; -} - -//----------------------------------------------------------------------------------------------------------------- -VstInt32 AudioEffectX::DECLARE_VST_DEPRECATED (getParameterQuantization) () -{ - if (audioMaster) - return (VstInt32)audioMaster (&cEffect, DECLARE_VST_DEPRECATED (audioMasterGetParameterQuantization), 0, 0, 0, 0); - return 0; -} - -//----------------------------------------------------------------------------------------------------------------- -// Configuration/Settings Functions -//----------------------------------------------------------------------------------------------------------------- - -//----------------------------------------------------------------------------------------------------------------- -/*! - The Host could call a suspend() (if the plug-in was enabled (in resume() state)) and then ask for - getSpeakerArrangement() and/or check the \e numInputs and \e numOutputs and \e initialDelay and then call a - resume(). - - \return \e true on success - - \sa setSpeakerArrangement(), getSpeakerArrangement() -*/ -bool AudioEffectX::ioChanged () -{ - if (audioMaster) - return (audioMaster (&cEffect, audioMasterIOChanged, 0, 0, 0, 0) != 0); - return false; -} - -//----------------------------------------------------------------------------------------------------------------- -bool AudioEffectX::DECLARE_VST_DEPRECATED (needIdle) () -{ - if (audioMaster) - return (audioMaster (&cEffect, DECLARE_VST_DEPRECATED (audioMasterNeedIdle), 0, 0, 0, 0) != 0); - return false; -} - -//----------------------------------------------------------------------------------------------------------------- -/*! - \param width The window's width in pixel - \param height The window's height in pixel - \return \e true on success -*/ -bool AudioEffectX::sizeWindow (VstInt32 width, VstInt32 height) -{ - if (audioMaster) - return (audioMaster (&cEffect, audioMasterSizeWindow, width, height, 0, 0) != 0); - return false; -} - -//----------------------------------------------------------------------------------------------------------------- -double AudioEffectX::updateSampleRate () -/*! - \return The Host's sample rate -*/ -{ - if (audioMaster) - { - VstIntPtr res = audioMaster (&cEffect, audioMasterGetSampleRate, 0, 0, 0, 0); - if (res > 0) - sampleRate = (float)res; - } - return sampleRate; -} - -//----------------------------------------------------------------------------------------------------------------- -VstInt32 AudioEffectX::updateBlockSize () -/*! - \return The Host's block size - - \note Will cause application to call AudioEffect's setSampleRate() to be called (when implemented). -*/ -{ - if (audioMaster) - { - VstInt32 res = (VstInt32)audioMaster (&cEffect, audioMasterGetBlockSize, 0, 0, 0, 0); - if (res > 0) - blockSize = res; - } - return blockSize; -} - -//----------------------------------------------------------------------------------------------------------------- -/*! - \return ASIO input latency - \sa getOutputLatency() -*/ -VstInt32 AudioEffectX::getInputLatency () -{ - if (audioMaster) - return (VstInt32)audioMaster (&cEffect, audioMasterGetInputLatency, 0, 0, 0, 0); - return 0; -} - -//----------------------------------------------------------------------------------------------------------------- -/*! - While inputLatency is probably not of concern, outputLatency may be used in conjunction with getTimeInfo(). - \e samplePos of VstTimeInfo is ahead of the 'visual' sequencer play time by the output latency, such that - when outputLatency samples have passed by, our processing result becomes audible. - - \return ASIO output latency - \sa getInputLatency() -*/ -VstInt32 AudioEffectX::getOutputLatency () -{ - if (audioMaster) - return (VstInt32)audioMaster (&cEffect, audioMasterGetOutputLatency, 0, 0, 0, 0); - return 0; -} - -//----------------------------------------------------------------------------------------------------------------- -/*! - \fn bool AudioEffectX::getInputProperties (VstInt32 index, VstPinProperties* properties) - - \param index The index to the input, starting with 0 - \param properties A pointer to a VstPinProperties structure - \return \e true on success - \sa getOutputProperties() - \note Example -
-	bool MyPlug::getInputProperties (VstInt32 index, VstPinProperties* properties)
-	{
-		bool returnCode = false;
-		if (index < kNumInputs)
-		{
-			sprintf (properties->label, "My %1d In", index + 1);
-			properties->flags = kVstPinIsStereo | kVstPinIsActive;
-			returnCode = true;
-		}
-		return returnCode;
-	}
-	
-*/ - -//----------------------------------------------------------------------------------------------------------------- -/*! - \fn bool AudioEffectX::getOutputProperties (VstInt32 index, VstPinProperties* properties) - - \param index The index to the output, starting with 0 - \param properties A pointer to a VstPinProperties structure - \return \e true on success - \sa getInputProperties() - \note Example 1 -
-	bool MyPlug::getOutputProperties (VstInt32 index, VstPinProperties* properties)
-	{
-		bool returnCode = false;
-		if (index < kNumOutputs)
-		{
-			sprintf (properties->label, "My %1d Out", index + 1);
-			properties->flags = kVstPinIsStereo | kVstPinIsActive;
-			returnCode = true;
-		}
-		return (returnCode);
-	}
-	
- - \note Example 2 : plug-in with 1 mono, 1 stereo and one 5.1 outputs (kNumOutputs = 9): -
-	bool MyPlug::getOutputProperties (VstInt32 index, VstPinProperties* properties)
-	{
-		bool returnCode = false;
-		if (index >= 0 && index < kNumOutputs)
-		{
-			properties->flags = kVstPinIsActive;
-			if (index == 0) // mono
-			{
-				strcpy (properties->label, "Mono Out");
-				properties->arrangementType = kSpeakerArrMono;
-			}
-			else if (index == 1) // stereo (1 -> 2)
-			{
-				strcpy (properties->label, "Stereo Out");
-				properties->flags |= kVstPinIsStereo;
-				properties->arrangementType = kSpeakerArrStereo;
-			}
-			else if (index >= 3) // 5.1 (3 -> 8)
-			{
-				strcpy (properties->label, "5.1 Out");
-				properties->flags |= kVstPinUseSpeaker;
-				properties->arrangementType = kSpeakerArr51;
-				// for old VST Host < 2.3, make 5.1 to stereo/mono/mono/stereo (L R C Lfe Ls Rs)
-				if (index == 3 || index == 7)
-					properties->flags |= kVstPinIsStereo;
-				if (index == 5)
-					strcpy (properties->label, "Center");	
-				else if (index == 6)
-					strcpy (properties->label, "Lfe");	
-				else if (index == 7) // (7 -> 8)
-					strcpy (properties->label, "Stereo Back");
-			}
-			returnCode = true;
-		}
-		return returnCode;
-	}
-	
-*/ - -//----------------------------------------------------------------------------------------------------------------- -AEffect* AudioEffectX::DECLARE_VST_DEPRECATED (getPreviousPlug) (VstInt32 input) -{ - if (audioMaster) - { - VstIntPtr ret = audioMaster (&cEffect, DECLARE_VST_DEPRECATED (audioMasterGetPreviousPlug), 0, 0, 0, 0); - return FromVstPtr (ret); - } - return 0; -} - -//----------------------------------------------------------------------------------------------------------------- -AEffect* AudioEffectX::DECLARE_VST_DEPRECATED (getNextPlug) (VstInt32 output) -{ - if (audioMaster) - { - VstIntPtr ret = audioMaster (&cEffect, DECLARE_VST_DEPRECATED (audioMasterGetNextPlug), 0, 0, 0, 0); - return FromVstPtr (ret); - } - return 0; -} - -//----------------------------------------------------------------------------------------------------------------- -/*! - \return Plug-in's category defined in VstPlugCategory -*/ -VstPlugCategory AudioEffectX::getPlugCategory () -{ - if (cEffect.flags & effFlagsIsSynth) - return kPlugCategSynth; - return kPlugCategUnknown; -} - -//----------------------------------------------------------------------------------------------------------------- -VstInt32 AudioEffectX::DECLARE_VST_DEPRECATED (willProcessReplacing) () -{ - if (audioMaster) - return (VstInt32)audioMaster (&cEffect, DECLARE_VST_DEPRECATED (audioMasterWillReplaceOrAccumulate), 0, 0, 0, 0); - return 0; -} - -//----------------------------------------------------------------------------------------------------------------- -/*! - A plug-in is like a black box processing some audio coming in on some inputs (if any) and going out of some - outputs (if any). This may be used to do offline or real-time processing, and sometimes it may be desirable to - know the current context. - - \return #VstProcessLevels in aeffectx.h - -*/ -VstInt32 AudioEffectX::getCurrentProcessLevel () -{ - if (audioMaster) - return (VstInt32)audioMaster (&cEffect, audioMasterGetCurrentProcessLevel, 0, 0, 0, 0); - return 0; -} - -//----------------------------------------------------------------------------------------------------------------- -/*! - \return #VstAutomationStates in aeffectx.h -*/ -VstInt32 AudioEffectX::getAutomationState () -{ - if (audioMaster) - return (VstInt32)audioMaster (&cEffect, audioMasterGetAutomationState, 0, 0, 0, 0); - return 0; -} - -//----------------------------------------------------------------------------------------------------------------- -void AudioEffectX::DECLARE_VST_DEPRECATED (wantAsyncOperation) (bool state) -{ - if (state) - cEffect.flags |= DECLARE_VST_DEPRECATED (effFlagsExtIsAsync); - else - cEffect.flags &= ~DECLARE_VST_DEPRECATED (effFlagsExtIsAsync); -} - -//----------------------------------------------------------------------------------------------------------------- -void AudioEffectX::DECLARE_VST_DEPRECATED (hasExternalBuffer) (bool state) -{ - if (state) - cEffect.flags |= DECLARE_VST_DEPRECATED (effFlagsExtHasBuffer); - else - cEffect.flags &= ~DECLARE_VST_DEPRECATED (effFlagsExtHasBuffer); -} - -//----------------------------------------------------------------------------------------------------------------- -// Offline Functions -//----------------------------------------------------------------------------------------------------------------- - -//----------------------------------------------------------------------------------------------------------------- -//----------------------------------------------------------------------------------------------------------------- -bool AudioEffectX::offlineRead (VstOfflineTask* offline, VstOfflineOption option, bool readSource) -{ - if (audioMaster) - return (audioMaster (&cEffect, audioMasterOfflineRead, readSource, option, offline, 0) != 0); - return false; -} - -//----------------------------------------------------------------------------------------------------------------- -bool AudioEffectX::offlineWrite (VstOfflineTask* offline, VstOfflineOption option) -{ - if (audioMaster) - return (audioMaster (&cEffect, audioMasterOfflineWrite, 0, option, offline, 0) != 0); - return false; -} - -//----------------------------------------------------------------------------------------------------------------- -bool AudioEffectX::offlineStart (VstAudioFile* audioFiles, VstInt32 numAudioFiles, VstInt32 numNewAudioFiles) -{ - if (audioMaster) - return (audioMaster (&cEffect, audioMasterOfflineStart, numNewAudioFiles, numAudioFiles, audioFiles, 0) != 0); - return false; -} - -//----------------------------------------------------------------------------------------------------------------- -VstInt32 AudioEffectX::offlineGetCurrentPass () -{ - if (audioMaster) - return (audioMaster (&cEffect, audioMasterOfflineGetCurrentPass, 0, 0, 0, 0) != 0); - return false; -} - -//----------------------------------------------------------------------------------------------------------------- -VstInt32 AudioEffectX::offlineGetCurrentMetaPass () -{ - if (audioMaster) - return (audioMaster (&cEffect, audioMasterOfflineGetCurrentMetaPass, 0, 0, 0, 0) != 0); - return false; -} - -//----------------------------------------------------------------------------------------------------------------- -// Other -//----------------------------------------------------------------------------------------------------------------- - -//----------------------------------------------------------------------------------------------------------------- -void AudioEffectX::DECLARE_VST_DEPRECATED (setOutputSamplerate) (float _sampleRate) -{ - if (audioMaster) - audioMaster (&cEffect, DECLARE_VST_DEPRECATED (audioMasterSetOutputSampleRate), 0, 0, 0, _sampleRate); -} - -//----------------------------------------------------------------------------------------------------------------- -VstSpeakerArrangement* AudioEffectX::DECLARE_VST_DEPRECATED (getInputSpeakerArrangement) () -{ - if (audioMaster) - { - VstIntPtr ret = audioMaster (&cEffect, DECLARE_VST_DEPRECATED (audioMasterGetInputSpeakerArrangement), 0, 0, 0, 0); - return FromVstPtr (ret); - } - return 0; -} - -//----------------------------------------------------------------------------------------------------------------- -VstSpeakerArrangement* AudioEffectX::DECLARE_VST_DEPRECATED (getOutputSpeakerArrangement) () -{ - if (audioMaster) - { - VstIntPtr ret = audioMaster (&cEffect, DECLARE_VST_DEPRECATED (audioMasterGetOutputSpeakerArrangement), 0, 0, 0, 0); - return FromVstPtr (ret); - } - return 0; -} - -//----------------------------------------------------------------------------------------------------------------- -/*! - \param text String of maximum 64 char - \return \e true if supported -*/ -bool AudioEffectX::getHostVendorString (char* text) -{ - if (audioMaster) - return (audioMaster (&cEffect, audioMasterGetVendorString, 0, 0, text, 0) != 0); - return false; -} - -//----------------------------------------------------------------------------------------------------------------- -/*! - \param text String of maximum 64 char - \return \e true if supported -*/ -bool AudioEffectX::getHostProductString (char* text) -{ - if (audioMaster) - return (audioMaster (&cEffect, audioMasterGetProductString, 0, 0, text, 0) != 0); - return false; -} - -//----------------------------------------------------------------------------------------------------------------- -/*! - \return Host vendor version -*/ -VstInt32 AudioEffectX::getHostVendorVersion () -{ - if (audioMaster) - return (VstInt32)audioMaster (&cEffect, audioMasterGetVendorVersion, 0, 0, 0, 0); - return 0; -} - -//----------------------------------------------------------------------------------------------------------------- -VstIntPtr AudioEffectX::hostVendorSpecific (VstInt32 lArg1, VstIntPtr lArg2, void* ptrArg, float floatArg) -{ - if (audioMaster) - return audioMaster (&cEffect, audioMasterVendorSpecific, lArg1, lArg2, ptrArg, floatArg); - return 0; -} - -//----------------------------------------------------------------------------------------------------------------- -/*! - Asks Host if it implements the feature text. A plug-in cannot assume a 2.x feature is available from the Host. - Use this method to ascertain the environment in which the plug-in finds itself. Ignoring this inquiry methods and - trying to access a 2.x feature in a 1.0 Host will mean your plug-in or Host application will break. It is not - the end-users job to pick and choose which plug-ins can be supported by which Host. - - \param text A string from #hostCanDos - \return - - 0 : don't know (default) - - 1 : yes - - -1: no -*/ -VstInt32 AudioEffectX::canHostDo (char* text) -{ - if (audioMaster) - return (audioMaster (&cEffect, audioMasterCanDo, 0, 0, text, 0) != 0); - return 0; -} - -//----------------------------------------------------------------------------------------------------------------- -/*! - Tells the Host that the plug-in is an instrument, i.e. that it will call wantEvents(). - - \param state - - true: is an instrument (default) - - false: is a simple audio effect -*/ -void AudioEffectX::isSynth (bool state) -{ - if (state) - cEffect.flags |= effFlagsIsSynth; - else - cEffect.flags &= ~effFlagsIsSynth; -} - -//----------------------------------------------------------------------------------------------------------------- -/*! - Enables Host to omit processReplacing() when no data is present on any input. -*/ -void AudioEffectX::noTail (bool state) -{ - if (state) - cEffect.flags |= effFlagsNoSoundInStop; - else - cEffect.flags &= ~effFlagsNoSoundInStop; -} - -//----------------------------------------------------------------------------------------------------------------- -/*! - \return #VstHostLanguage in aeffectx.h -*/ -VstInt32 AudioEffectX::getHostLanguage () -{ - if (audioMaster) - return (VstInt32)audioMaster (&cEffect, audioMasterGetLanguage, 0, 0, 0, 0); - return 0; -} - -//----------------------------------------------------------------------------------------------------------------- -void* AudioEffectX::DECLARE_VST_DEPRECATED (openWindow) (DECLARE_VST_DEPRECATED (VstWindow)* window) -{ - if (audioMaster) - { - VstIntPtr ret = audioMaster (&cEffect, DECLARE_VST_DEPRECATED (audioMasterOpenWindow), 0, 0, window, 0); - return FromVstPtr (ret); - } - return 0; -} - -//----------------------------------------------------------------------------------------------------------------- -bool AudioEffectX::DECLARE_VST_DEPRECATED (closeWindow) (DECLARE_VST_DEPRECATED (VstWindow)* window) -{ - if (audioMaster) - return (audioMaster (&cEffect, DECLARE_VST_DEPRECATED (audioMasterCloseWindow), 0, 0, window, 0) != 0); - return false; -} - -//----------------------------------------------------------------------------------------------------------------- -/*! - \return FSSpec on MAC, else char* -*/ -void* AudioEffectX::getDirectory () -{ - if (audioMaster) - { - VstIntPtr ret = (audioMaster (&cEffect, audioMasterGetDirectory, 0, 0, 0, 0)); - return FromVstPtr (ret); - } - return 0; -} - -//----------------------------------------------------------------------------------------------------------------- -/*! - \return \e true if supported -*/ -bool AudioEffectX::updateDisplay () -{ - if (audioMaster) - return (audioMaster (&cEffect, audioMasterUpdateDisplay, 0, 0, 0, 0)) ? true : false; - return 0; -} - -//----------------------------------------------------------------------------------------------------------------- -/*! - \fn bool AudioEffectX::processVariableIo (VstVariableIo* varIo) - - If called with \e varIo NULL, returning \e true indicates that this call is supported by the plug-in. - Host will use processReplacing otherwise. The Host should call setTotalSampleToProcess before starting the processIO - to inform the plug-in about how many samples will be processed in total. The Host should provide an output buffer at least 5 times bigger than input buffer. - - \param varIo - \return \true on success -*/ - -//----------------------------------------------------------------------------------------------------------------- -/*! - \fn bool AudioEffectX::setSpeakerArrangement (VstSpeakerArrangement* pluginInput, VstSpeakerArrangement* pluginOutput) - - Set the plug-in's speaker arrangements. If a (VST >= 2.3) plug-in returns \e true, it means that it accepts this IO - arrangement. The Host doesn't need to ask for getSpeakerArrangement(). If the plug-in returns \e false it means that it - doesn't accept this arrangement, the Host should then ask for getSpeakerArrangement() and then can (optional) - recall setSpeakerArrangement(). - - \param pluginInput A pointer to the input's #VstSpeakerArrangement structure. - \param pluginOutput A pointer to the output's #VstSpeakerArrangement structure. - \return \e true on success - - \note setSpeakerArrangement() and getSpeakerArrangement() are always called in suspended state. - (like setSampleRate() or setBlockSize()). - - \sa getSpeakerArrangement() -*/ - -//----------------------------------------------------------------------------------------------------------------- -/*! - \fn bool AudioEffectX::getSpeakerArrangement (VstSpeakerArrangement** pluginInput, VstSpeakerArrangement** pluginOutput) - - \param pluginInput A pointer to the input's #VstSpeakerArrangement structure. - \param pluginOutput A pointer to the output's #VstSpeakerArrangement structure. - \return \e true on success - - \note setSpeakerArrangement() and getSpeakerArrangement() are always called in suspended state. - (like setSampleRate() or setBlockSize()).\n -
Here an example code to show how the host uses getSpeakerArrangement()
-	VstSpeakerArrangement *plugInputVstArr = 0;
-	VstSpeakerArrangement *plugOutputVstArr = 0;
-	if (getFormatVersion () >= 2300 && #getSpeakerArrangement (&plugInputVstArr, &plugOutputVstArr))
-		....
-	
- - \sa setSpeakerArrangement() -*/ -//----------------------------------------------------------------------------------------------------------------- -/*! - \fn bool AudioEffectX::setBypass (bool onOff) - - process still called (if Supported) although the plug-in was bypassed. Some plugs need to stay 'alive' even - when bypassed. An example is a surround decoder which has more inputs than outputs and must maintain some - reasonable signal distribution even when being bypassed. A CanDo 'bypass' allows to ask the plug-in if it - supports soft bypass or not. - - \note This bypass feature could be automated by the Host (this means avoid to much CPU requirement in this call) - \note If the plug-in supports SoftBypass and it has a latency (initialDelay), in Bypassed state the plug-in has to used - the same latency value. - - \param onOff - \return - - true: supports SoftBypass, process will be called, the plug-in should compensate its latency, and copy inputs to outputs - - false: doesn't support SoftBypass, process will not be called, the Host should bypass the process call - - \sa processReplacing() -*/ - -//----------------------------------------------------------------------------------------------------------------- -/*! - \fn bool AudioEffectX::getEffectName (char* name) - - \param name A string up to 32 chars - \return \e true on success -*/ - -//----------------------------------------------------------------------------------------------------------------- -/*! - \fn bool AudioEffectX::getVendorString (char* text) - - \param text A string up to 64 chars - \return \e true on success -*/ - -//----------------------------------------------------------------------------------------------------------------- -/*! - \fn bool AudioEffectX::getProductString (char* text) - - \param text A string up to 64 chars - \return \e true on success -*/ - -//----------------------------------------------------------------------------------------------------------------- -/*! - \fn VstInt32 AudioEffectX::getVendorVersion () - - \return The version of the plug-in - - \note This should be upported -*/ - -//----------------------------------------------------------------------------------------------------------------- -/*! - \fn VstInt32 AudioEffectX::canDo (char* text) - - Report what the plug-in is able to do. In general you can but don't have to report whatever you support or not - support via canDo. Some application functionality may require some specific reply, but in that case you will - probably know. Best is to report whatever you know for sure. A Host application cannot make assumptions about - the presence of the new 2.x features of a plug-in. Ignoring this inquiry methods and trying to access a 2.x - feature from a 1.0 plug, or vice versa, will mean the plug-in or Host application will break. It is not the - end-users job to pick and choose which plug-ins can be supported by which Host. - - \param text A string from #plugCanDos - \return - - 0: don't know (default) - - 1: yes - - -1: no - - \note This should be supported. -*/ - -//---------------------------------------------------------------------------------------------------------------- -/*! - \fn VstInt32 AudioEffectX::canDo (char* text) - - \param text A string from #plugCanDos - \return - - 0: don't know (default). - - 1: yes. - - -1: no -*/ - -//---------------------------------------------------------------------------------------------------------------- -/*! - \fn bool AudioEffectX::getParameterProperties (VstInt32 index, VstParameterProperties* p) - - \param index Index of the parameter - \param p Pointer to #VstParameterProperties - \return Return \e true on success -*/ - -//---------------------------------------------------------------------------------------------------------------- -/*! - \fn VstInt32 AudioEffectX::getVstVersion () - \return - - 2xxx : the last VST 2.x plug-in version (by default) - - 0 : older versions - -*/ - -//----------------------------------------------------------------------------------------------------------------- -/*! - \fn VstInt32 AudioEffectX::getMidiProgramName (VstInt32 channel, MidiProgramName* midiProgramName) - Ask plug-in if MidiPrograms are used and if so, query for names, numbers - (ProgramChange-Number + BankSelect-Number), categories and keynames of each - MIDI Program, on each MIDI-channel. If this function is called, your plug-in has to read - MidiProgramName::thisProgramIndex, fill out the other fields with the information - assigned to a certain MIDI Program and return the number of available MIDI Programs on - that MIDI Channel. - - \note plug-in canDo "midiProgramNames". No effect, if 0 is returned. - - \warning don't mix concepts: the MIDI Programs are totally independent from all other - programs present in VST. The main difference is, that there are upto 16 simultaneous - active MIDI Programs (one per channel), while there can be only one active "VST"-Program. - (You should see the "VST"-Program as the one single main global program, which contains - the entire current state of the plug-in.) This function can be called in any sequence. - - \param channel MidiChannel: 0-15 - \param midiProgramName Points to \e #MidiProgramName struct - \return Number of available MIDI Programs on that \e channel - - number of used programIndexes - - 0 if no MidiProgramNames supported - - \note Example : plug-in has 3 MidiPrograms on MidiChannel 0. -
-	Host calls #getMidiProgramName with idx = 0 and MidiProgramName::thisProgramIndex = 0.
-	Plug fills out:
-	MidiProgramName::name[64] = "Program A"
-	MidiProgramName::midiProgram = 0
-	MidiProgramName::midiBankMsb = -1
-	MidiProgramName::midiBankLsb = -1
-	MidiProgramName::parentCategoryIndex = -1
-	MidiProgramName::flags = 0 (if plug isn't "Omni").
-	Plug returns 3.
-	Host calls #getMidiProgramName with idx = 0 and MidiProgramName::thisProgramIndex = 1.
-	Plug fills out:
-	MidiProgramName::name[64] = "Program B"
-	MidiProgramName::midiProgram = 1
-	MidiProgramName::midiBankMsb = -1
-	MidiProgramName::midiBankLsb = -1
-	MidiProgramName::parentCategoryIndex = -1
-	MidiProgramName::flags = 0 (if plug isn't "Omni").
-	Plug returns 3.
-	Host calls #getMidiProgramName with idx = 0 and MidiProgramName::thisProgramIndex = 2.
-	Plug fills out:
-	MidiProgramName::name[64] = "Program C"
-	MidiProgramName::midiProgram = 2
-	MidiProgramName::midiBankMsb = -1
-	MidiProgramName::midiBankLsb = -1
-	MidiProgramName::parentCategoryIndex = -1
-	MidiProgramName::flags = 0 (if plug isn't "Omni").
-	Plug returns 3.
-	
-*/ - -//----------------------------------------------------------------------------------------------------------------- -/*! - \fn VstInt32 AudioEffectX::getCurrentMidiProgram (VstInt32 channel, MidiProgramName* currentProgram) - - \param channel - \param currentProgram - \return - - programIndex of the current program - - -1 if not supported -*/ - -//----------------------------------------------------------------------------------------------------------------- -/*! - \fn VstInt32 AudioEffectX::getMidiProgramCategory (VstInt32 channel, MidiProgramCategory* category) - - \param channel - \param category - \return - - number of used categoryIndexes. - - 0 if no #MidiProgramCategory supported/used. -*/ - -//----------------------------------------------------------------------------------------------------------------- -/*! - \fn bool AudioEffectX::hasMidiProgramsChanged (VstInt32 channel) - - Ask plug-in for the currently active program on a certain MIDI Channel. Just like - getMidiProgramName(), but MidiProgramName::thisProgramIndex has to be filled out with - the currently active MIDI Program-index, which also has to be returned. - - \param channel - \return - - true: if the #MidiProgramNames, #MidiKeyNames or #MidiControllerNames had changed on - this channel -*/ - -//----------------------------------------------------------------------------------------------------------------- -/*! - \fn bool AudioEffectX::getMidiKeyName (VstInt32 channel, MidiKeyName* keyName) - - \param channel - \param keyName If keyName is "" the standard name of the key will be displayed - \return Return \e false if no #MidiKeyNames defined for 'thisProgramIndex' -*/ - -//----------------------------------------------------------------------------------------------------------------- -/*! - \fn bool AudioEffectX::beginSetProgram () - - \return - - true: the plug-in took the notification into account - - false: it did not... - - \sa endSetProgram() -*/ - -//----------------------------------------------------------------------------------------------------------------- -/*! - \fn bool AudioEffectX::endSetProgram () - - \return - - true: the plug-in took the notification into account - - false: it did not... - - \sa beginSetProgram() -*/ - -#if VST_2_1_EXTENSIONS -//----------------------------------------------------------------------------------------------------------------- -/*! - It tells the Host that if it needs to, it has to record automation data for this control. - - \param index Index of the parameter - \return Returns \e true on success - - \sa endEdit() -*/ -bool AudioEffectX::beginEdit (VstInt32 index) -{ - if (audioMaster) - return (audioMaster (&cEffect, audioMasterBeginEdit, index, 0, 0, 0)) ? true : false; - return 0; -} - -//----------------------------------------------------------------------------------------------------------------- -/*! - It notifies the Host that this control is no longer moved by the mouse. - - \param index Index of the parameter - \return Returns \e true on success - - \sa beginEdit() -*/ -bool AudioEffectX::endEdit (VstInt32 index) -{ - if (audioMaster) - return (audioMaster (&cEffect, audioMasterEndEdit, index, 0, 0, 0)) ? true : false; - return 0; -} - -//----------------------------------------------------------------------------------------------------------------- -/*! - \param ptr - \return Returns \e true on success - - \sa closeFileSelector() -*/ -bool AudioEffectX::openFileSelector (VstFileSelect* ptr) -{ - if (audioMaster && ptr) - return (audioMaster (&cEffect, audioMasterOpenFileSelector, 0, 0, ptr, 0)) ? true : false; - return 0; -} -#endif // VST_2_1_EXTENSIONS - -#if VST_2_2_EXTENSIONS -//----------------------------------------------------------------------------------------------------------------- -/*! - \param ptr - \return Returns \e true on success - - \sa openFileSelector() -*/ -bool AudioEffectX::closeFileSelector (VstFileSelect* ptr) -{ - if (audioMaster && ptr) - return (audioMaster (&cEffect, audioMasterCloseFileSelector, 0, 0, ptr, 0)) ? true : false; - return 0; -} - -//----------------------------------------------------------------------------------------------------------------- -/*! - It indicates how many samples will be processed. - - \param nativePath - \return Returns \e true on success - - \sa getChunk(), setChunk() -*/ -bool AudioEffectX::DECLARE_VST_DEPRECATED (getChunkFile) (void* nativePath) -{ - if (audioMaster && nativePath) - return (audioMaster (&cEffect, DECLARE_VST_DEPRECATED (audioMasterGetChunkFile), 0, 0, nativePath, 0)) ? true : false; - return 0; -} -#endif // VST_2_2_EXTENSIONS - -//----------------------------------------------------------------------------------------------------------------- -/*! - \fn VstInt32 AudioEffectX::setTotalSampleToProcess (VstInt32 value) - - It indicates how many samples will be processed in total. - - \param value Number of samples to process -*/ - -//----------------------------------------------------------------------------------------------------------------- -/*! - \fn VstInt32 AudioEffectX::getNextShellPlugin (char* name) { return 0; } - - \param name Points to a char buffer of size 64, which is to be filled with the name of the - plug-in including the terminating zero - \return Return the next plug-in's uniqueID - \note Example of Implementation -
-	//---From the Host side : if found plugin is a Shell category-----------
-	if (effect->getCategory () == kPlugCategShell)
-	{ 
-		// scan shell for subplugins
-		char tempName[64] = {0}; 
-		VstInt32 plugUniqueID = 0;
-		while ((plugUniqueID = effect->dispatchEffect (effShellGetNextPlugin, 0, 0, tempName)) != 0)
-		{ 
-			// subplug needs a name 
-			if (tempName[0] != 0)
-			{
-				...do what you want with this tempName and plugUniqueID
-			}
-		}
-	}
-	//---From the Host side : Intanciate a subplugin of a shell plugin---
-	// retreive the uniqueID of this subplugin the host wants to load
-	// set it to the host currentID
-	currentID = subplugInfo->uniqueID;
-	// call the its shell plugin (main function)
-	main ();
-	// the shell plugin will ask for the currentUniqueID
-	// and should return the chosen subplugin
-	...
-	//---From the plugin-Shell Side: for enumeration of subplugins---------
-	category = kPlugCategShell;
-	->can ask the host if "shellCategory" is supported
-	// at start (instanciation) reset the index for the getNextShellPlugin call.
-	myPluginShell::index = 0;
-	// implementation of getNextShellPlugin (char* name);
-	VstInt32 myPluginShell::getNextShellPlugin (char* name)
-	{
-		strcpy (name, MyNameTable[index]);
-		return MyUniqueIDTable[index++];
-	}
-	....
-	//---From the plugin-Shell Side: when instanciation-----
-	VstInt32 uniqueID = host->getCurrentUniqueID ();
-	if (uniqueID == 0) // the host instanciates the shell
-	{}
-	else // host try to instanciate one of my subplugin...identified by the uniqueID
-	{}
-
-*/ - -//----------------------------------------------------------------------------------------------------------------- -/*! - \fn bool AudioEffectX::setPanLaw (VstInt32 type, float val) - - \param type - \param val - - \return Returns \e true on success - - \note Gain: for Linear : [1.0 => 0dB PanLaw], [~0.58 => -4.5dB], [0.5 => -6.02dB] -*/ - -//----------------------------------------------------------------------------------------------------------------- -/*! - \fn VstInt32 AudioEffectX::beginLoadBank (VstPatchChunkInfo* ptr) - - \param ptr - \return - - -1: if the Bank cannot be loaded, - - 1: if it can be loaded - - 0: else (for compatibility) - - \sa beginLoadProgram() - -*/ - -//----------------------------------------------------------------------------------------------------------------- -/*! - \fn VstInt32 AudioEffectX::beginLoadProgram (VstPatchChunkInfo* ptr) - - \param ptr - \return - - -1: if the Program cannot be loaded, - - 1: it can be loaded else, - - 0: else (for compatibility) - - \sa beginLoadBank() -*/ - -//----------------------------------------------------------------------------------------------------------------- -// Speaker Arrangement Helpers -//----------------------------------------------------------------------------------------------------------------- - -#if VST_2_3_EXTENSIONS -//----------------------------------------------------------------------------------------------------------------- -/*! - \param arrangement Pointer to a \e #VstSpeakerArrangement structure - \param nbChannels Number of Channels - \return Returns \e true on success - - \sa deallocateArrangement(), copySpeaker(), matchArrangement() -*/ -bool AudioEffectX::allocateArrangement (VstSpeakerArrangement** arrangement, VstInt32 nbChannels) -{ - if (*arrangement) - { - char *ptr = (char*)(*arrangement); - delete [] ptr; - } - - VstInt32 size = 2 * sizeof (VstInt32) + nbChannels * sizeof (VstSpeakerProperties); - char* ptr = new char[size]; - if (!ptr) - return false; - - memset (ptr, 0, size); - *arrangement = (VstSpeakerArrangement*)ptr; - (*arrangement)->numChannels = nbChannels; - return true; -} - -//----------------------------------------------------------------------------------------------------------------- -/*! - \param arrangement Pointer to a \e #VstSpeakerArrangement structure - \return Returns \e true on success - - \sa allocateArrangement(), copySpeaker(), matchArrangement() -*/ -bool AudioEffectX::deallocateArrangement (VstSpeakerArrangement** arrangement) -{ - if (*arrangement) - { - char *ptr = (char*)(*arrangement); - delete [] ptr; - *arrangement = 0; - } - return true; -} - -//----------------------------------------------------------------------------------------------------------------- -/*! - Feed the \e to speaker properties with the same values than \e from 's ones. - It is assumed here that \e to exists yet, ie this function won't - allocate memory for the speaker (this will prevent from having - a difference between an Arrangement's number of channels and - its actual speakers...) - - \param to - \param from - \return Returns \e true on success - - \sa allocateArrangement(), deallocateArrangement(), matchArrangement() -*/ -bool AudioEffectX::copySpeaker (VstSpeakerProperties* to, VstSpeakerProperties* from) -{ - if ((from == NULL) || (to == NULL)) - return false; - - vst_strncpy (to->name, from->name, 63); - to->type = from->type; - to->azimuth = from->azimuth; - to->elevation = from->elevation; - to->radius = from->radius; - to->reserved = from->reserved; - memcpy (to->future, from->future, 28); - - return true; -} - -//----------------------------------------------------------------------------------------------------------------- -/*! - \e to is deleted, then created and initialized with the same values as \e from (must exist!). - It's notably useful when setSpeakerArrangement() is called by the Host. - - \param to - \param from - \return Returns \e true on success - - \sa allocateArrangement(), deallocateArrangement(), copySpeaker() -*/ - -bool AudioEffectX::matchArrangement (VstSpeakerArrangement** to, VstSpeakerArrangement* from) -{ - if (from == NULL) - return false; - - if ((!deallocateArrangement (to)) || (!allocateArrangement (to, from->numChannels))) - return false; - - (*to)->type = from->type; - for (VstInt32 i = 0; i < (*to)->numChannels; i++) - { - if (!copySpeaker (&((*to)->speakers[i]), &(from->speakers[i]))) - return false; - } - - return true; -} -#endif // VST_2_3_EXTENSIONS - -//----------------------------------------------------------------------------------------------------------------- -/*! - \fn bool AudioEffectX::setProcessPrecision (VstInt32 precision) - - Is called in suspended state, similar to #setBlockSize. Default (if not called) is single precision float. - - \param precision kVstProcessPrecision32 or kVstProcessPrecision64 - \return Returns \e true on success - \sa VstProcessPrecision -*/ - -//----------------------------------------------------------------------------------------------------------------- -/*! - \fn VstInt32 AudioEffectX::getNumMidiInputChannels () - - Called by the host application to determine how many MIDI input channels are actually used by a plugin - e.g. to hide unused channels from the user. - For compatibility with VST 2.3 and below, the default return value 0 means 'not implemented' - - in this case the host assumes 16 MIDI channels to be present (or none at all). - - \return Number of MIDI input channels: 1-15, otherwise: 16 or no MIDI channels at all (0) - - \note The VST 2.x protocol is limited to a maximum of 16 MIDI channels as defined by the MIDI Standard. This might change in future revisions of the API. - - \sa - getNumMidiOutputChannels() @n - PlugCanDos::canDoReceiveVstMidiEvent -*/ - -//----------------------------------------------------------------------------------------------------------------- -/*! - \fn VstInt32 AudioEffectX::getNumMidiOutputChannels () - - Called by the host application to determine how many MIDI output channels are actually used by a plugin - e.g. to hide unused channels from the user. - For compatibility with VST 2.3 and below, the default return value 0 means 'not implemented' - - in this case the host assumes 16 MIDI channels to be present (or none at all). - - \return Number of MIDI output channels: 1-15, otherwise: 16 or no MIDI channels at all (0) - - \note The VST 2.x protocol is limited to a maximum of 16 MIDI channels as defined by the MIDI Standard. This might change in future revisions of the API. - - \sa - getNumMidiInputChannels() @n - PlugCanDos::canDoSendVstMidiEvent -*/ diff --git a/vst/public.sdk/source/vst2.x/audioeffectx.h b/vst/public.sdk/source/vst2.x/audioeffectx.h deleted file mode 100644 index b907ecc8..00000000 --- a/vst/public.sdk/source/vst2.x/audioeffectx.h +++ /dev/null @@ -1,270 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 2.4 -// -// Category : VST 2.x Classes -// Filename : public.sdk/source/vst2.x/audioeffectx.h -// Created by : Steinberg, 01/2004 -// Description : Class AudioEffectX extends AudioEffect with new features. You should derive your plug-in from AudioEffectX. -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#pragma once - -#include "audioeffect.h" // Version 1.0 base class AudioEffect - -#include "pluginterfaces/vst2.x/aeffectx.h" // Version 2.x 'C' Extensions and Structures - -//------------------------------------------------------------------------------------------------------- -/** Extended VST Effect Class (VST 2.x). */ -//------------------------------------------------------------------------------------------------------- -class AudioEffectX : public AudioEffect -{ -public: - AudioEffectX (audioMasterCallback audioMaster, VstInt32 numPrograms, VstInt32 numParams); ///< Create an \e AudioEffectX object - -//------------------------------------------------------------------------------------------------------- -/// \name Parameters -//------------------------------------------------------------------------------------------------------- -//@{ - virtual bool canParameterBeAutomated (VstInt32 index) { return true; } ///< Indicates if a parameter can be automated - virtual bool string2parameter (VstInt32 index, char* text) { return false; } ///< Convert a string representation to a parameter value - virtual bool getParameterProperties (VstInt32 index, VstParameterProperties* p) { return false; } ///< Return parameter properties - -#if VST_2_1_EXTENSIONS - virtual bool beginEdit (VstInt32 index); ///< To be called before #setParameterAutomated (on Mouse Down). This will be used by the Host for specific Automation Recording. - virtual bool endEdit (VstInt32 index); ///< To be called after #setParameterAutomated (on Mouse Up) -#endif // VST_2_1_EXTENSIONS -//@} - -//------------------------------------------------------------------------------------------------------- -/// \name Programs and Persistence -//------------------------------------------------------------------------------------------------------- -//@{ - virtual bool getProgramNameIndexed (VstInt32 category, VstInt32 index, char* text) { return false; } ///< Fill \e text with name of program \e index (\e category deprecated in VST 2.4) - -#if VST_2_1_EXTENSIONS - virtual bool beginSetProgram () { return false; } ///< Called before a program is loaded - virtual bool endSetProgram () { return false; } ///< Called after a program was loaded -#endif // VST_2_1_EXTENSIONS - -#if VST_2_3_EXTENSIONS - virtual VstInt32 beginLoadBank (VstPatchChunkInfo* ptr) { return 0; } ///< Called before a Bank is loaded. - virtual VstInt32 beginLoadProgram (VstPatchChunkInfo* ptr) { return 0; } ///< Called before a Program is loaded. (called before #beginSetProgram). -#endif // VST_2_3_EXTENSIONS -//@} - -//------------------------------------------------------------------------------------------------------- -/// \name Connections and Configuration -//------------------------------------------------------------------------------------------------------- -//@{ - virtual bool ioChanged (); ///< Tell Host numInputs and/or numOutputs and/or initialDelay (and/or numParameters: to be avoid) have changed - - virtual double updateSampleRate (); ///< Returns sample rate from Host (may issue setSampleRate()) - virtual VstInt32 updateBlockSize (); ///< Returns block size from Host (may issue getBlockSize()) - virtual VstInt32 getInputLatency (); ///< Returns the Audio (maybe ASIO) input latency values - virtual VstInt32 getOutputLatency (); ///< Returns the Audio (maybe ASIO) output latency values - - virtual bool getInputProperties (VstInt32 index, VstPinProperties* properties) { return false; } ///< Return the \e properties of output \e index - virtual bool getOutputProperties (VstInt32 index, VstPinProperties* properties) { return false; }///< Return the \e properties of input \e index - - virtual bool setSpeakerArrangement (VstSpeakerArrangement* pluginInput, VstSpeakerArrangement* pluginOutput) { return false; } ///< Set the plug-in's speaker arrangements - virtual bool getSpeakerArrangement (VstSpeakerArrangement** pluginInput, VstSpeakerArrangement** pluginOutput) { *pluginInput = 0; *pluginOutput = 0; return false; } ///< Return the plug-in's speaker arrangements - virtual bool setBypass (bool onOff) { return false; } ///< For 'soft-bypass' (this could be automated (in Audio Thread) that why you could NOT call iochanged (if needed) in this function, do it in fxidle). - -#if VST_2_3_EXTENSIONS - virtual bool setPanLaw (VstInt32 type, float val) { return false; } ///< Set the Panning Law used by the Host @see VstPanLawType. -#endif // VST_2_3_EXTENSIONS - -#if VST_2_4_EXTENSIONS - virtual bool setProcessPrecision (VstInt32 precision) { return false; } ///< Set floating-point precision used for processing (32 or 64 bit) - - virtual VstInt32 getNumMidiInputChannels () { return 0; } ///< Returns number of MIDI input channels used [0, 16] - virtual VstInt32 getNumMidiOutputChannels () { return 0; } ///< Returns number of MIDI output channels used [0, 16] -#endif // VST_2_4_EXTENSIONS -//@} - -//------------------------------------------------------------------------------------------------------- -/// \name Realtime -//------------------------------------------------------------------------------------------------------- -//@{ - virtual VstTimeInfo* getTimeInfo (VstInt32 filter); ///< Get time information from Host - virtual VstInt32 getCurrentProcessLevel (); ///< Returns the Host's process level - virtual VstInt32 getAutomationState (); ///< Returns the Host's automation state - - virtual VstInt32 processEvents (VstEvents* events) { return 0; } ///< Called when new MIDI events come in - bool sendVstEventsToHost (VstEvents* events); ///< Send MIDI events back to Host application - -#if VST_2_3_EXTENSIONS - virtual VstInt32 startProcess () { return 0; } ///< Called one time before the start of process call. This indicates that the process call will be interrupted (due to Host reconfiguration or bypass state when the plug-in doesn't support softBypass) - virtual VstInt32 stopProcess () { return 0;} ///< Called after the stop of process call -#endif // VST_2_3_EXTENSIONS -//@} - -//------------------------------------------------------------------------------------------------------- -/// \name Variable I/O (Offline) -//------------------------------------------------------------------------------------------------------- -//@{ - virtual bool processVariableIo (VstVariableIo* varIo) { return false; } ///< Used for variable I/O processing (offline processing like timestreching) - -#if VST_2_3_EXTENSIONS - virtual VstInt32 setTotalSampleToProcess (VstInt32 value) { return value; } ///< Called in offline mode before process() or processVariableIo () -#endif // VST_2_3_EXTENSIONS - //@} - -//------------------------------------------------------------------------------------------------------- -/// \name Host Properties -//------------------------------------------------------------------------------------------------------- -//@{ - virtual bool getHostVendorString (char* text); ///< Fills \e text with a string identifying the vendor - virtual bool getHostProductString (char* text); ///< Fills \e text with a string with product name - virtual VstInt32 getHostVendorVersion (); ///< Returns vendor-specific version (for example 3200 for Nuendo 3.2) - virtual VstIntPtr hostVendorSpecific (VstInt32 lArg1, VstIntPtr lArg2, void* ptrArg, float floatArg); ///< No specific definition - virtual VstInt32 canHostDo (char* text); ///< Reports what the Host is able to do (#hostCanDos in audioeffectx.cpp) - virtual VstInt32 getHostLanguage (); ///< Returns the Host's language (#VstHostLanguage) -//@} - -//------------------------------------------------------------------------------------------------------- -/// \name Plug-in Properties -//------------------------------------------------------------------------------------------------------- -//@{ - virtual void isSynth (bool state = true); ///< Set if plug-in is a synth - virtual void noTail (bool state = true); ///< Plug-in won't produce output signals while there is no input - virtual VstInt32 getGetTailSize () { return 0; }///< Returns tail size; 0 is default (return 1 for 'no tail'), used in offline processing too - virtual void* getDirectory (); ///< Returns the plug-in's directory - virtual bool getEffectName (char* name) { return false; } ///< Fill \e text with a string identifying the effect - virtual bool getVendorString (char* text) { return false; } ///< Fill \e text with a string identifying the vendor - virtual bool getProductString (char* text) { return false; }///< Fill \e text with a string identifying the product name - virtual VstInt32 getVendorVersion () { return 0; } ///< Return vendor-specific version - virtual VstIntPtr vendorSpecific (VstInt32 lArg, VstIntPtr lArg2, void* ptrArg, float floatArg) { return 0; } ///< No definition, vendor specific handling - virtual VstInt32 canDo (char* text) { return 0; } ///< Reports what the plug-in is able to do (#plugCanDos in audioeffectx.cpp) - virtual VstInt32 getVstVersion () { return kVstVersion; } ///< Returns the current VST Version (#kVstVersion) - virtual VstPlugCategory getPlugCategory (); ///< Specify a category that fits the plug (#VstPlugCategory) -//@} - -//------------------------------------------------------------------------------------------------------- -/// \name MIDI Channel Programs -//------------------------------------------------------------------------------------------------------- -//@{ -#if VST_2_1_EXTENSIONS - virtual VstInt32 getMidiProgramName (VstInt32 channel, MidiProgramName* midiProgramName) { return 0; } ///< Fill \e midiProgramName with information for 'thisProgramIndex'. - virtual VstInt32 getCurrentMidiProgram (VstInt32 channel, MidiProgramName* currentProgram) { return -1; } ///< Fill \e currentProgram with information for the current MIDI program. - virtual VstInt32 getMidiProgramCategory (VstInt32 channel, MidiProgramCategory* category) { return 0; } ///< Fill \e category with information for 'thisCategoryIndex'. - virtual bool hasMidiProgramsChanged (VstInt32 channel) { return false; } ///< Return true if the #MidiProgramNames, #MidiKeyNames or #MidiControllerNames had changed on this MIDI channel. - virtual bool getMidiKeyName (VstInt32 channel, MidiKeyName* keyName) { return false; } ///< Fill \e keyName with information for 'thisProgramIndex' and 'thisKeyNumber' -#endif // VST_2_1_EXTENSIONS -//@} - -//------------------------------------------------------------------------------------------------------- -/// \name Others -//------------------------------------------------------------------------------------------------------- -//@{ - virtual bool updateDisplay (); ///< Something has changed in plug-in, request an update display like program (MIDI too) and parameters list in Host - virtual bool sizeWindow (VstInt32 width, VstInt32 height); ///< Requests to resize the editor window - -#if VST_2_1_EXTENSIONS - virtual bool openFileSelector (VstFileSelect* ptr); ///< Open a Host File selector (see aeffectx.h for #VstFileSelect definition) -#endif // VST_2_1_EXTENSIONS - -#if VST_2_2_EXTENSIONS - virtual bool closeFileSelector (VstFileSelect* ptr); ///< Close the Host File selector which was opened by #openFileSelector -#endif // VST_2_2_EXTENSIONS - -#if VST_2_3_EXTENSIONS - virtual VstInt32 getNextShellPlugin (char* name) { return 0; } ///< This opcode is only called, if the plug-in is of type #kPlugCategShell, in order to extract all included sub-pluginīs names. -#endif // VST_2_3_EXTENSIONS -//@} - -//------------------------------------------------------------------------------------------------------- -/// \name Tools -//------------------------------------------------------------------------------------------------------- -//@{ -#if VST_2_3_EXTENSIONS - virtual bool allocateArrangement (VstSpeakerArrangement** arrangement, VstInt32 nbChannels);///< Allocate memory for a #VstSpeakerArrangement - virtual bool deallocateArrangement (VstSpeakerArrangement** arrangement); ///< Delete/free memory for an allocated speaker arrangement - virtual bool copySpeaker (VstSpeakerProperties* to, VstSpeakerProperties* from); ///< Copy properties \e from to \e to - virtual bool matchArrangement (VstSpeakerArrangement** to, VstSpeakerArrangement* from); ///< "to" is deleted, then created and initialized with the same values as "from" ones ("from" must exist). -#endif // VST_2_3_EXTENSIONS -//@} - -//------------------------------------------------------------------------------------------------------- -// Offline -//------------------------------------------------------------------------------------------------------- -/// @cond ignore - virtual bool offlineRead (VstOfflineTask* offline, VstOfflineOption option, bool readSource = true); - virtual bool offlineWrite (VstOfflineTask* offline, VstOfflineOption option); - virtual bool offlineStart (VstAudioFile* ptr, VstInt32 numAudioFiles, VstInt32 numNewAudioFiles); - virtual VstInt32 offlineGetCurrentPass (); - virtual VstInt32 offlineGetCurrentMetaPass (); - virtual bool offlineNotify (VstAudioFile* ptr, VstInt32 numAudioFiles, bool start) { return false; } - virtual bool offlinePrepare (VstOfflineTask* offline, VstInt32 count) { return false; } - virtual bool offlineRun (VstOfflineTask* offline, VstInt32 count) { return false; } - virtual VstInt32 offlineGetNumPasses () { return 0; } - virtual VstInt32 offlineGetNumMetaPasses () { return 0; } - -//------------------------------------------------------------------------------------------------------- -// AudioEffect overrides -//------------------------------------------------------------------------------------------------------- - virtual VstIntPtr dispatcher (VstInt32 opcode, VstInt32 index, VstIntPtr value, void* ptr, float opt); - virtual void resume (); - -//------------------------------------------------------------------------------------------------------- -// Deprecated methods -//------------------------------------------------------------------------------------------------------- - virtual void DECLARE_VST_DEPRECATED (wantEvents) (VstInt32 filter = 1); - virtual VstInt32 DECLARE_VST_DEPRECATED (tempoAt) (VstInt32 pos); - virtual VstInt32 DECLARE_VST_DEPRECATED (getNumAutomatableParameters) (); - virtual VstInt32 DECLARE_VST_DEPRECATED (getParameterQuantization) (); - virtual VstInt32 DECLARE_VST_DEPRECATED (getNumCategories) () { return 1L; } - virtual bool DECLARE_VST_DEPRECATED (copyProgram) (VstInt32 destination) { return false; } - virtual bool DECLARE_VST_DEPRECATED (needIdle) (); - virtual AEffect* DECLARE_VST_DEPRECATED (getPreviousPlug) (VstInt32 input); - virtual AEffect* DECLARE_VST_DEPRECATED (getNextPlug) (VstInt32 output); - virtual void DECLARE_VST_DEPRECATED (inputConnected) (VstInt32 index, bool state) {} - virtual void DECLARE_VST_DEPRECATED (outputConnected) (VstInt32 index, bool state) {} - virtual VstInt32 DECLARE_VST_DEPRECATED (willProcessReplacing) (); - virtual void DECLARE_VST_DEPRECATED (wantAsyncOperation) (bool state = true); - virtual void DECLARE_VST_DEPRECATED (hasExternalBuffer) (bool state = true); - virtual VstInt32 DECLARE_VST_DEPRECATED (reportCurrentPosition) () { return 0; } - virtual float* DECLARE_VST_DEPRECATED (reportDestinationBuffer) () { return 0; } - virtual void DECLARE_VST_DEPRECATED (setOutputSamplerate) (float samplerate); - virtual VstSpeakerArrangement* DECLARE_VST_DEPRECATED (getInputSpeakerArrangement) (); - virtual VstSpeakerArrangement* DECLARE_VST_DEPRECATED (getOutputSpeakerArrangement) (); - virtual void* DECLARE_VST_DEPRECATED (openWindow) (DECLARE_VST_DEPRECATED (VstWindow)*); - virtual bool DECLARE_VST_DEPRECATED (closeWindow) (DECLARE_VST_DEPRECATED (VstWindow)*); - virtual void DECLARE_VST_DEPRECATED (setBlockSizeAndSampleRate) (VstInt32 _blockSize, float _sampleRate) { blockSize = _blockSize; sampleRate = _sampleRate; } - virtual bool DECLARE_VST_DEPRECATED (getErrorText) (char* text) { return false; } - virtual void* DECLARE_VST_DEPRECATED (getIcon) () { return 0; } - virtual bool DECLARE_VST_DEPRECATED (setViewPosition) (VstInt32 x, VstInt32 y) { return false; } - virtual VstInt32 DECLARE_VST_DEPRECATED (fxIdle) () { return 0; } - virtual bool DECLARE_VST_DEPRECATED (keysRequired) () { return false; } - -#if VST_2_2_EXTENSIONS - virtual bool DECLARE_VST_DEPRECATED (getChunkFile) (void* nativePath); ///< Returns in platform format the path of the current chunk (could be called in #setChunk ()) (FSSpec on MAC else char*) -#endif // VST_2_2_EXTENSIONS -/// @endcond -//------------------------------------------------------------------------------------------------------- -}; diff --git a/vst/public.sdk/source/vst2.x/vstplugmain.cpp b/vst/public.sdk/source/vst2.x/vstplugmain.cpp deleted file mode 100644 index 15282cbf..00000000 --- a/vst/public.sdk/source/vst2.x/vstplugmain.cpp +++ /dev/null @@ -1,90 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 2.4 -// -// Category : VST 2.x Classes -// Filename : public.sdk/source/vst2.x/vstplugmain.cpp -// Created by : Steinberg, 01/2004 -// Description : VST Plug-In Main Entry -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#include "audioeffect.h" - -//------------------------------------------------------------------------ -/** Must be implemented externally. */ -extern AudioEffect* createEffectInstance (audioMasterCallback audioMaster); - -extern "C" { - -#if defined (__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) - #define VST_EXPORT __attribute__ ((visibility ("default"))) -#else - #define VST_EXPORT -#endif - -//------------------------------------------------------------------------ -/** Prototype of the export function main */ -//------------------------------------------------------------------------ -VST_EXPORT AEffect* VSTPluginMain (audioMasterCallback audioMaster) -{ - // Get VST Version of the Host - if (!audioMaster (0, audioMasterVersion, 0, 0, 0, 0)) - return 0; // old version - - // Create the AudioEffect - AudioEffect* effect = createEffectInstance (audioMaster); - if (!effect) - return 0; - - // Return the VST AEffect structur - return effect->getAeffect (); -} - -// support for old hosts not looking for VSTPluginMain -#if (TARGET_API_MAC_CARBON && __ppc__) -VST_EXPORT AEffect* main_macho (audioMasterCallback audioMaster) { return VSTPluginMain (audioMaster); } -#elif WIN32 -VST_EXPORT AEffect* MAIN (audioMasterCallback audioMaster) { return VSTPluginMain (audioMaster); } -#elif BEOS -VST_EXPORT AEffect* main_plugin (audioMasterCallback audioMaster) { return VSTPluginMain (audioMaster); } -#endif - -} // extern "C" - -//------------------------------------------------------------------------ -#if WIN32 -#include -void* hInstance; - -extern "C" { -BOOL WINAPI DllMain (HINSTANCE hInst, DWORD dwReason, LPVOID lpvReserved) -{ - hInstance = hInst; - return 1; -} -} // extern "C" -#endif diff --git a/vst/public.sdk/source/vst3stdsdk.cpp b/vst/public.sdk/source/vst3stdsdk.cpp deleted file mode 100644 index 1daa1de9..00000000 --- a/vst/public.sdk/source/vst3stdsdk.cpp +++ /dev/null @@ -1,40 +0,0 @@ -//------------------------------------------------------------------------ -// Project : VST SDK -// Version : 3.6.5 -// -// Category : Helpers -// Filename : public.sdk/source/vst3stdsdk.cpp -// Created by : Steinberg, 09/2008 -// Description : include basic helpers cpp files -// -//----------------------------------------------------------------------------- -// LICENSE -// (c) 2015, Steinberg Media Technologies GmbH, All Rights Reserved -//----------------------------------------------------------------------------- -// This Software Development Kit may not be distributed in parts or its entirety -// without prior written agreement by Steinberg Media Technologies GmbH. -// This SDK must not be used to re-engineer or manipulate any technology used -// in any Steinberg or Third-party application or software module, -// unless permitted by law. -// Neither the name of the Steinberg Media Technologies nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SDK IS PROVIDED BY STEINBERG MEDIA TECHNOLOGIES GMBH "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL STEINBERG MEDIA TECHNOLOGIES GMBH BE LIABLE FOR ANY DIRECT, -// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -// OF THE POSSIBILITY OF SUCH DAMAGE. -//---------------------------------------------------------------------------------- - -#include "public.sdk/source/vst/vstaudioeffect.cpp" -#include "public.sdk/source/vst/vstcomponent.cpp" -#include "public.sdk/source/vst/vstcomponentbase.cpp" -#include "public.sdk/source/vst/vsteditcontroller.cpp" -#include "public.sdk/source/vst/vstbus.cpp" -#include "public.sdk/source/vst/vstparameters.cpp"