Signed-off-by: falkTX <falktx@gmail.com>tags/v2.1-alpha1-winvst
@@ -1,32 +0,0 @@ | |||||
if(MAC) | |||||
if (XCODE AND SMTG_COREAUDIO_SDK_PATH) | |||||
set(target auwrapper) | |||||
set(${target}_sources | |||||
aucarbonview.mm | |||||
aucarbonview.h | |||||
aucocoaview.mm | |||||
aucocoaview.h | |||||
ausdk.mm | |||||
auwrapper.mm | |||||
auwrapper.h | |||||
NSDataIBStream.mm | |||||
NSDataIBStream.h | |||||
${SDK_ROOT}/pluginterfaces/base/funknown.cpp | |||||
${SDK_ROOT}/pluginterfaces/base/ustring.cpp | |||||
${SDK_ROOT}/public.sdk/source/vst/hosting/eventlist.cpp | |||||
${SDK_ROOT}/public.sdk/source/vst/hosting/eventlist.h | |||||
${SDK_ROOT}/public.sdk/source/vst/hosting/hostclasses.cpp | |||||
${SDK_ROOT}/public.sdk/source/vst/hosting/hostclasses.h | |||||
${SDK_ROOT}/public.sdk/source/vst/hosting/parameterchanges.cpp | |||||
${SDK_ROOT}/public.sdk/source/vst/hosting/parameterchanges.h | |||||
${SDK_ROOT}/public.sdk/source/vst/hosting/processdata.cpp | |||||
${SDK_ROOT}/public.sdk/source/vst/hosting/processdata.h | |||||
) | |||||
add_library(${target} STATIC ${${target}_sources}) | |||||
target_link_libraries(${target} PRIVATE base "-framework AudioUnit" "-framework CoreMIDI" "-framework AudioToolbox" "-framework CoreFoundation" "-framework Carbon" "-framework Cocoa" "-framework CoreAudio") | |||||
target_include_directories(${target} PRIVATE "${SMTG_COREAUDIO_SDK_PATH}/**") | |||||
add_custom_command(TARGET ${target} PRE_BUILD COMMAND /usr/bin/ruby "./generateCocoaClassNamePrefix.rb" "${CMAKE_CURRENT_LIST_DIR}" WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}") | |||||
else() | |||||
message("* To enable building the AudioUnit wrapper, you need to use the Xcode generator and set SMTG_COREAUDIO_SDK_PATH to the path of your installation of the CoreAudio SDK!") | |||||
endif() | |||||
endif() |
@@ -1,92 +0,0 @@ | |||||
//------------------------------------------------------------------------ | |||||
// Project : VST SDK | |||||
// | |||||
// Category : Helpers | |||||
// Filename : public.sdk/source/vst/auwrapper/NSDataIBStream.h | |||||
// Created by : Steinberg, 12/2007 | |||||
// Description : VST 3 -> AU Wrapper | |||||
// | |||||
//----------------------------------------------------------------------------- | |||||
// LICENSE | |||||
// (c) 2017, Steinberg Media Technologies GmbH, All Rights Reserved | |||||
//----------------------------------------------------------------------------- | |||||
// Redistribution and use in source and binary forms, with or without modification, | |||||
// are permitted provided that the following conditions are met: | |||||
// | |||||
// * Redistributions of source code must retain the above copyright notice, | |||||
// this list of conditions and the following disclaimer. | |||||
// * Redistributions in binary form must reproduce the above copyright notice, | |||||
// this list of conditions and the following disclaimer in the documentation | |||||
// and/or other materials provided with the distribution. | |||||
// * Neither the name of the Steinberg Media Technologies nor the names of its | |||||
// contributors may be used to endorse or promote products derived from this | |||||
// software without specific prior written permission. | |||||
// | |||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | |||||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |||||
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, | |||||
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | |||||
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | |||||
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE | |||||
// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | |||||
// OF THE POSSIBILITY OF SUCH DAMAGE. | |||||
//----------------------------------------------------------------------------- | |||||
/// \cond ignore | |||||
#pragma once | |||||
#import <Foundation/Foundation.h> | |||||
#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) SMTG_OVERRIDE; | |||||
tresult PLUGIN_API write (void* buffer, int32 numBytes, int32* numBytesWritten = 0) SMTG_OVERRIDE; | |||||
tresult PLUGIN_API seek (int64 pos, int32 mode, int64* result = 0) SMTG_OVERRIDE; | |||||
tresult PLUGIN_API tell (int64* pos) SMTG_OVERRIDE; | |||||
//---from Vst::IStreamAttributes----- | |||||
virtual tresult PLUGIN_API getFileName (String128 name) SMTG_OVERRIDE; | |||||
virtual IAttributeList* PLUGIN_API getAttributes () SMTG_OVERRIDE; | |||||
//------------------------------------------------------------------------ | |||||
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 |
@@ -1,206 +0,0 @@ | |||||
//------------------------------------------------------------------------ | |||||
// Project : VST SDK | |||||
// | |||||
// Category : Helpers | |||||
// Filename : public.sdk/source/vst/auwrapper/NSDataIBStream.mm | |||||
// Created by : Steinberg, 12/2007 | |||||
// Description : VST 3 -> AU Wrapper | |||||
// | |||||
//----------------------------------------------------------------------------- | |||||
// LICENSE | |||||
// (c) 2017, Steinberg Media Technologies GmbH, All Rights Reserved | |||||
//----------------------------------------------------------------------------- | |||||
// Redistribution and use in source and binary forms, with or without modification, | |||||
// are permitted provided that the following conditions are met: | |||||
// | |||||
// * Redistributions of source code must retain the above copyright notice, | |||||
// this list of conditions and the following disclaimer. | |||||
// * Redistributions in binary form must reproduce the above copyright notice, | |||||
// this list of conditions and the following disclaimer in the documentation | |||||
// and/or other materials provided with the distribution. | |||||
// * Neither the name of the Steinberg Media Technologies nor the names of its | |||||
// contributors may be used to endorse or promote products derived from this | |||||
// software without specific prior written permission. | |||||
// | |||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | |||||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |||||
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, | |||||
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | |||||
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | |||||
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE | |||||
// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | |||||
// OF THE POSSIBILITY OF SUCH DAMAGE. | |||||
//----------------------------------------------------------------------------- | |||||
/// \cond ignore | |||||
#include "NSDataIBStream.h" | |||||
#include "pluginterfaces/vst/ivstattributes.h" | |||||
#include <algorithm> | |||||
#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 |
@@ -1,41 +0,0 @@ | |||||
if(MAC AND XCODE AND SMTG_COREAUDIO_SDK_PATH) | |||||
set(target again_au) | |||||
set(${target}_sources | |||||
doc.cpp | |||||
audiounitconfig.h | |||||
Info.plist | |||||
) | |||||
add_library(${target} MODULE ${${target}_sources}) | |||||
set_target_properties(${target} PROPERTIES BUNDLE TRUE) | |||||
set_target_properties(${target} PROPERTIES XCODE_ATTRIBUTE_GENERATE_MASTER_OBJECT_FILE "YES") | |||||
set_target_properties(${target} PROPERTIES XCODE_ATTRIBUTE_OTHER_LDFLAGS "-all_load") | |||||
set_target_properties(${target} PROPERTIES XCODE_ATTRIBUTE_GENERATE_PKGINFO_FILE "YES") | |||||
set_target_properties(${target} PROPERTIES XCODE_ATTRIBUTE_WRAPPER_EXTENSION "component") | |||||
set_target_properties(${target} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${VST3_OUTPUT_DIR}) | |||||
target_link_libraries(${target} PRIVATE auwrapper) | |||||
smtg_set_bundle(${target} INFOPLIST "${CMAKE_CURRENT_LIST_DIR}/Info.plist" PREPROCESS) | |||||
set(outputdir ${VST3_OUTPUT_DIR}/$<CONFIG>) | |||||
add_dependencies(${target} again) | |||||
add_custom_command(TARGET ${target} POST_BUILD COMMAND /bin/mkdir "-p" ${outputdir}/${target}.component/Contents/Resources) | |||||
add_custom_command(TARGET ${target} POST_BUILD COMMAND /bin/ln "-sf" "${outputdir}/again.vst3" "${outputdir}/${target}.component/Contents/Resources/plugin.vst3") | |||||
add_custom_command(TARGET ${target} POST_BUILD COMMAND /bin/ln "-sf" "${outputdir}/${target}.component" "~/Library/Audio/Plug-Ins/Components/") | |||||
execute_process(COMMAND xcrun --find Rez OUTPUT_VARIABLE OSX_REZ_COMMAND OUTPUT_STRIP_TRAILING_WHITESPACE) | |||||
add_custom_command(TARGET ${target} POST_BUILD COMMAND "${OSX_REZ_COMMAND}" | |||||
"-d" "SystemSevenOrLater=1" | |||||
"-script" "Roman" | |||||
"-d" "i386_YES" | |||||
"-d" "x86_64_YES" | |||||
"-is" "${CMAKE_OSX_SYSROOT}" | |||||
"-I" "${CMAKE_OSX_SYSROOT}/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Versions/A/Headers" | |||||
"-I" "/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Versions/A/Headers" | |||||
"-I" "${SMTG_COREAUDIO_SDK_PATH}/AudioUnits/AUPublic/AUBase" | |||||
"-I" "${CMAKE_CURRENT_LIST_DIR}" | |||||
"-o" "${outputdir}/${target}.component/Contents/Resources/again_au.rsrc" | |||||
"-useDF" | |||||
"${CMAKE_CURRENT_LIST_DIR}/../auresource.r" | |||||
) | |||||
endif() |
@@ -1,117 +0,0 @@ | |||||
//------------------------------------------------------------------------ | |||||
// Project : VST SDK | |||||
// | |||||
// Category : Helpers | |||||
// Filename : public.sdk/source/vst/auwrapper/again/Info.plist | |||||
// Created by : Steinberg, 12/2007 | |||||
// Description : VST 3 -> AU Wrapper | |||||
// | |||||
//----------------------------------------------------------------------------- | |||||
// LICENSE | |||||
// (c) 2017, Steinberg Media Technologies GmbH, All Rights Reserved | |||||
//----------------------------------------------------------------------------- | |||||
// Redistribution and use in source and binary forms, with or without modification, | |||||
// are permitted provided that the following conditions are met: | |||||
// | |||||
// * Redistributions of source code must retain the above copyright notice, | |||||
// this list of conditions and the following disclaimer. | |||||
// * Redistributions in binary form must reproduce the above copyright notice, | |||||
// this list of conditions and the following disclaimer in the documentation | |||||
// and/or other materials provided with the distribution. | |||||
// * Neither the name of the Steinberg Media Technologies nor the names of its | |||||
// contributors may be used to endorse or promote products derived from this | |||||
// software without specific prior written permission. | |||||
// | |||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | |||||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |||||
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, | |||||
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | |||||
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | |||||
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE | |||||
// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | |||||
// OF THE POSSIBILITY OF SUCH DAMAGE. | |||||
//----------------------------------------------------------------------------- | |||||
#include "audiounitconfig.h" | |||||
<?xml version="1.0" encoding="UTF-8"?> | |||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |||||
<plist version="1.0"> | |||||
<dict> | |||||
<key>CFBundleDevelopmentRegion</key> | |||||
<string>English</string> | |||||
<key>CFBundleExecutable</key> | |||||
<string>$(EXECUTABLE_NAME)</string> | |||||
<key>CFBundleIdentifier</key> | |||||
<string>kAudioUnitBundleIdentifier</string> | |||||
<key>CFBundleName</key> | |||||
<string>$(PRODUCT_NAME)</string> | |||||
<key>CFBundleInfoDictionaryVersion</key> | |||||
<string>6.0</string> | |||||
<key>CFBundlePackageType</key> | |||||
<string>BNDL</string> | |||||
<key>CFBundleSignature</key> | |||||
<string>????</string> | |||||
<key>CFBundleVersion</key> | |||||
<string>1.0</string> | |||||
<key>CSResourcesFileMapped</key> | |||||
<string>yes</string> | |||||
/* | |||||
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. | |||||
*/ | |||||
<key>AudioUnit SupportedNumChannels</key> | |||||
<array> | |||||
<dict> | |||||
<key>Outputs</key> | |||||
<string>2</string> | |||||
<key>Inputs</key> | |||||
<string>2</string> | |||||
</dict> | |||||
<dict> | |||||
<key>Outputs</key> | |||||
<string>0</string> | |||||
<key>Inputs</key> | |||||
<string>1</string> | |||||
</dict> | |||||
<dict> | |||||
<key>Outputs</key> | |||||
<string>1</string> | |||||
<key>Inputs</key> | |||||
<string>1</string> | |||||
</dict> | |||||
</array> | |||||
<key>AudioUnit Version</key> | |||||
<string>kAudioUnitVersion</string> | |||||
/* | |||||
Support for the new AUPlugIn model in Mac OS X 10.7 | |||||
*/ | |||||
<key>AudioComponents</key> | |||||
<array> | |||||
<dict> | |||||
<key>description</key> | |||||
<string>kAUPluginDescription</string> | |||||
<key>factoryFunction</key> | |||||
<string>AUWrapperFactory</string> | |||||
<key>manufacturer</key> | |||||
<string>kAUPluginManufacturer</string> | |||||
<key>name</key> | |||||
<string>kAUPluginName</string> | |||||
<key>subtype</key> | |||||
<string>kAUPluginSubType</string> | |||||
<key>type</key> | |||||
<string>kAUPluginType</string> | |||||
<key>version</key> | |||||
<integer>kAudioUnitVersion</integer> | |||||
</dict> | |||||
</array> | |||||
</dict> | |||||
</plist> |
@@ -1,61 +0,0 @@ | |||||
//------------------------------------------------------------------------ | |||||
// Project : VST SDK | |||||
// | |||||
// Category : Helpers | |||||
// Filename : public.sdk/source/vst/auwrapper/again/audiounitconfig.h | |||||
// Created by : Steinberg, 12/2007 | |||||
// Description : VST 3 -> AU Wrapper | |||||
// | |||||
//----------------------------------------------------------------------------- | |||||
// LICENSE | |||||
// (c) 2017, Steinberg Media Technologies GmbH, All Rights Reserved | |||||
//----------------------------------------------------------------------------- | |||||
// Redistribution and use in source and binary forms, with or without modification, | |||||
// are permitted provided that the following conditions are met: | |||||
// | |||||
// * Redistributions of source code must retain the above copyright notice, | |||||
// this list of conditions and the following disclaimer. | |||||
// * Redistributions in binary form must reproduce the above copyright notice, | |||||
// this list of conditions and the following disclaimer in the documentation | |||||
// and/or other materials provided with the distribution. | |||||
// * Neither the name of the Steinberg Media Technologies nor the names of its | |||||
// contributors may be used to endorse or promote products derived from this | |||||
// software without specific prior written permission. | |||||
// | |||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | |||||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |||||
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, | |||||
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | |||||
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | |||||
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE | |||||
// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | |||||
// OF THE POSSIBILITY OF SUCH DAMAGE. | |||||
//----------------------------------------------------------------------------- | |||||
// 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' //kAudioUnitType_Effect // 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 |
@@ -1,51 +0,0 @@ | |||||
//------------------------------------------------------------------------ | |||||
// Project : VST SDK | |||||
// | |||||
// Category : Helpers | |||||
// Filename : again.xcconfig | |||||
// Created by : Steinberg, 5/24/12 | |||||
// Description : Xcode configuration file, VST 3 -> AU Wrapper | |||||
// | |||||
//----------------------------------------------------------------------------- | |||||
// LICENSE | |||||
// (c) 2017, Steinberg Media Technologies GmbH, All Rights Reserved | |||||
//----------------------------------------------------------------------------- | |||||
// Redistribution and use in source and binary forms, with or without modification, | |||||
// are permitted provided that the following conditions are met: | |||||
// | |||||
// * Redistributions of source code must retain the above copyright notice, | |||||
// this list of conditions and the following disclaimer. | |||||
// * Redistributions in binary form must reproduce the above copyright notice, | |||||
// this list of conditions and the following disclaimer in the documentation | |||||
// and/or other materials provided with the distribution. | |||||
// * Neither the name of the Steinberg Media Technologies nor the names of its | |||||
// contributors may be used to endorse or promote products derived from this | |||||
// software without specific prior written permission. | |||||
// | |||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | |||||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |||||
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, | |||||
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | |||||
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | |||||
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE | |||||
// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | |||||
// OF THE POSSIBILITY OF SUCH DAMAGE. | |||||
//----------------------------------------------------------------------------- | |||||
#include "../../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/ |
@@ -1,38 +0,0 @@ | |||||
//------------------------------------------------------------------------ | |||||
// Project : VST SDK | |||||
// | |||||
// Category : Helpers | |||||
// Filename : again_debug.xcconfig | |||||
// Created by : Steinberg, 5/24/12 | |||||
// Description : Xcode configuration file, VST 3 -> AU Wrapper | |||||
// | |||||
//----------------------------------------------------------------------------- | |||||
// LICENSE | |||||
// (c) 2017, Steinberg Media Technologies GmbH, All Rights Reserved | |||||
//----------------------------------------------------------------------------- | |||||
// Redistribution and use in source and binary forms, with or without modification, | |||||
// are permitted provided that the following conditions are met: | |||||
// | |||||
// * Redistributions of source code must retain the above copyright notice, | |||||
// this list of conditions and the following disclaimer. | |||||
// * Redistributions in binary form must reproduce the above copyright notice, | |||||
// this list of conditions and the following disclaimer in the documentation | |||||
// and/or other materials provided with the distribution. | |||||
// * Neither the name of the Steinberg Media Technologies nor the names of its | |||||
// contributors may be used to endorse or promote products derived from this | |||||
// software without specific prior written permission. | |||||
// | |||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | |||||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |||||
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, | |||||
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | |||||
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | |||||
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE | |||||
// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | |||||
// OF THE POSSIBILITY OF SUCH DAMAGE. | |||||
//----------------------------------------------------------------------------- | |||||
#include "../../../../../base/mac/config/debug" // AUWRAPPER_CHANGE | |||||
#include "again" |
@@ -1,38 +0,0 @@ | |||||
//------------------------------------------------------------------------ | |||||
// Project : VST SDK | |||||
// | |||||
// Category : Helpers | |||||
// Filename : again_release.xcconfig | |||||
// Created by : Steinberg, 5/24/12 | |||||
// Description : Xcode configuration file, VST 3 -> AU Wrapper | |||||
// | |||||
//----------------------------------------------------------------------------- | |||||
// LICENSE | |||||
// (c) 2017, Steinberg Media Technologies GmbH, All Rights Reserved | |||||
//----------------------------------------------------------------------------- | |||||
// Redistribution and use in source and binary forms, with or without modification, | |||||
// are permitted provided that the following conditions are met: | |||||
// | |||||
// * Redistributions of source code must retain the above copyright notice, | |||||
// this list of conditions and the following disclaimer. | |||||
// * Redistributions in binary form must reproduce the above copyright notice, | |||||
// this list of conditions and the following disclaimer in the documentation | |||||
// and/or other materials provided with the distribution. | |||||
// * Neither the name of the Steinberg Media Technologies nor the names of its | |||||
// contributors may be used to endorse or promote products derived from this | |||||
// software without specific prior written permission. | |||||
// | |||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | |||||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |||||
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, | |||||
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | |||||
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | |||||
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE | |||||
// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | |||||
// OF THE POSSIBILITY OF SUCH DAMAGE. | |||||
//----------------------------------------------------------------------------- | |||||
#include "../../../../../base/mac/config/release" // AUWRAPPER_CHANGE | |||||
#include "again" |
@@ -1,52 +0,0 @@ | |||||
//------------------------------------------------------------------------ | |||||
// Project : VST SDK | |||||
// | |||||
// Category : Helpers | |||||
// Filename : public.sdk/source/vst/auwrapper/again/doc.cpp | |||||
// Created by : Steinberg, 12/2007 | |||||
// Description : VST 3 -> AU Wrapper | |||||
// | |||||
//----------------------------------------------------------------------------- | |||||
// LICENSE | |||||
// (c) 2017, Steinberg Media Technologies GmbH, All Rights Reserved | |||||
//----------------------------------------------------------------------------- | |||||
// Redistribution and use in source and binary forms, with or without modification, | |||||
// are permitted provided that the following conditions are met: | |||||
// | |||||
// * Redistributions of source code must retain the above copyright notice, | |||||
// this list of conditions and the following disclaimer. | |||||
// * Redistributions in binary form must reproduce the above copyright notice, | |||||
// this list of conditions and the following disclaimer in the documentation | |||||
// and/or other materials provided with the distribution. | |||||
// * Neither the name of the Steinberg Media Technologies nor the names of its | |||||
// contributors may be used to endorse or promote products derived from this | |||||
// software without specific prior written permission. | |||||
// | |||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | |||||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |||||
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, | |||||
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | |||||
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | |||||
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE | |||||
// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | |||||
// OF THE POSSIBILITY OF SUCH DAMAGE. | |||||
//----------------------------------------------------------------------------- | |||||
/* | |||||
TODO: cmake adaption needed | |||||
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" | |||||
*/ |
@@ -1,83 +0,0 @@ | |||||
//------------------------------------------------------------------------ | |||||
// Project : VST SDK | |||||
// | |||||
// Category : Helpers | |||||
// Filename : public.sdk/source/vst/auwrapper/aucarbonview.h | |||||
// Created by : Steinberg, 12/2007 | |||||
// Description : VST 3 -> AU Wrapper | |||||
// | |||||
//----------------------------------------------------------------------------- | |||||
// LICENSE | |||||
// (c) 2017, Steinberg Media Technologies GmbH, All Rights Reserved | |||||
//----------------------------------------------------------------------------- | |||||
// Redistribution and use in source and binary forms, with or without modification, | |||||
// are permitted provided that the following conditions are met: | |||||
// | |||||
// * Redistributions of source code must retain the above copyright notice, | |||||
// this list of conditions and the following disclaimer. | |||||
// * Redistributions in binary form must reproduce the above copyright notice, | |||||
// this list of conditions and the following disclaimer in the documentation | |||||
// and/or other materials provided with the distribution. | |||||
// * Neither the name of the Steinberg Media Technologies nor the names of its | |||||
// contributors may be used to endorse or promote products derived from this | |||||
// software without specific prior written permission. | |||||
// | |||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | |||||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |||||
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, | |||||
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | |||||
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | |||||
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE | |||||
// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | |||||
// OF THE POSSIBILITY OF SUCH DAMAGE. | |||||
//----------------------------------------------------------------------------- | |||||
/// \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 |
@@ -1,167 +0,0 @@ | |||||
//------------------------------------------------------------------------ | |||||
// Project : VST SDK | |||||
// | |||||
// Category : Helpers | |||||
// Filename : public.sdk/source/vst/auwrapper/aucarbonview.mm | |||||
// Created by : Steinberg, 12/2007 | |||||
// Description : VST 3 -> AU Wrapper | |||||
// | |||||
//----------------------------------------------------------------------------- | |||||
// LICENSE | |||||
// (c) 2017, Steinberg Media Technologies GmbH, All Rights Reserved | |||||
//----------------------------------------------------------------------------- | |||||
// Redistribution and use in source and binary forms, with or without modification, | |||||
// are permitted provided that the following conditions are met: | |||||
// | |||||
// * Redistributions of source code must retain the above copyright notice, | |||||
// this list of conditions and the following disclaimer. | |||||
// * Redistributions in binary form must reproduce the above copyright notice, | |||||
// this list of conditions and the following disclaimer in the documentation | |||||
// and/or other materials provided with the distribution. | |||||
// * Neither the name of the Steinberg Media Technologies nor the names of its | |||||
// contributors may be used to endorse or promote products derived from this | |||||
// software without specific prior written permission. | |||||
// | |||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | |||||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |||||
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, | |||||
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | |||||
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | |||||
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE | |||||
// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | |||||
// OF THE POSSIBILITY OF SUCH DAMAGE. | |||||
//----------------------------------------------------------------------------- | |||||
/// \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<AUCarbonView>::Dispatch(params, obj); | |||||
} | |||||
} | |||||
//------------------------------------------------------------------------ | |||||
} // namespace Vst | |||||
} // namespace Steinberg | |||||
#endif | |||||
/// \endcond |
@@ -1,68 +0,0 @@ | |||||
//------------------------------------------------------------------------ | |||||
// Project : VST SDK | |||||
// | |||||
// Category : Helpers | |||||
// Filename : public.sdk/source/vst/auwrapper/aucocoaview.h | |||||
// Created by : Steinberg, 12/2007 | |||||
// Description : VST 3 -> AU Wrapper | |||||
// | |||||
//----------------------------------------------------------------------------- | |||||
// LICENSE | |||||
// (c) 2017, Steinberg Media Technologies GmbH, All Rights Reserved | |||||
//----------------------------------------------------------------------------- | |||||
// Redistribution and use in source and binary forms, with or without modification, | |||||
// are permitted provided that the following conditions are met: | |||||
// | |||||
// * Redistributions of source code must retain the above copyright notice, | |||||
// this list of conditions and the following disclaimer. | |||||
// * Redistributions in binary form must reproduce the above copyright notice, | |||||
// this list of conditions and the following disclaimer in the documentation | |||||
// and/or other materials provided with the distribution. | |||||
// * Neither the name of the Steinberg Media Technologies nor the names of its | |||||
// contributors may be used to endorse or promote products derived from this | |||||
// software without specific prior written permission. | |||||
// | |||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | |||||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |||||
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, | |||||
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | |||||
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | |||||
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE | |||||
// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | |||||
// OF THE POSSIBILITY OF SUCH DAMAGE. | |||||
//----------------------------------------------------------------------------- | |||||
/// \cond ignore | |||||
#pragma once | |||||
#import "aucocoaclassprefix.h" | |||||
#import <Cocoa/Cocoa.h> | |||||
#import <AudioUnit/AUCocoaUIView.h> | |||||
#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 <AUCocoaUIBase> | |||||
{ | |||||
} | |||||
//----------------------------------------------------------------------------- | |||||
@end | |||||
/// \endcond |
@@ -1,232 +0,0 @@ | |||||
//------------------------------------------------------------------------ | |||||
// Project : VST SDK | |||||
// | |||||
// Category : Helpers | |||||
// Filename : public.sdk/source/vst/auwrapper/aucocoaview.mm | |||||
// Created by : Steinberg, 12/2007 | |||||
// Description : VST 3 -> AU Wrapper | |||||
// | |||||
//----------------------------------------------------------------------------- | |||||
// LICENSE | |||||
// (c) 2017, Steinberg Media Technologies GmbH, All Rights Reserved | |||||
//----------------------------------------------------------------------------- | |||||
// Redistribution and use in source and binary forms, with or without modification, | |||||
// are permitted provided that the following conditions are met: | |||||
// | |||||
// * Redistributions of source code must retain the above copyright notice, | |||||
// this list of conditions and the following disclaimer. | |||||
// * Redistributions in binary form must reproduce the above copyright notice, | |||||
// this list of conditions and the following disclaimer in the documentation | |||||
// and/or other materials provided with the distribution. | |||||
// * Neither the name of the Steinberg Media Technologies nor the names of its | |||||
// contributors may be used to endorse or promote products derived from this | |||||
// software without specific prior written permission. | |||||
// | |||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | |||||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |||||
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, | |||||
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | |||||
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | |||||
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE | |||||
// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | |||||
// OF THE POSSIBILITY OF SUCH DAMAGE. | |||||
//----------------------------------------------------------------------------- | |||||
/// \cond ignore | |||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations" | |||||
#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) SMTG_OVERRIDE | |||||
{ | |||||
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 |
@@ -1,85 +0,0 @@ | |||||
//------------------------------------------------------------------------ | |||||
// Project : VST SDK | |||||
// | |||||
// Category : Helpers | |||||
// Filename : public.sdk/source/vst/auwrapper/auresource.r | |||||
// Created by : Steinberg, 12/2007 | |||||
// Description : VST 3 -> AU Wrapper | |||||
// | |||||
//----------------------------------------------------------------------------- | |||||
// LICENSE | |||||
// (c) 2017, Steinberg Media Technologies GmbH, All Rights Reserved | |||||
//----------------------------------------------------------------------------- | |||||
// Redistribution and use in source and binary forms, with or without modification, | |||||
// are permitted provided that the following conditions are met: | |||||
// | |||||
// * Redistributions of source code must retain the above copyright notice, | |||||
// this list of conditions and the following disclaimer. | |||||
// * Redistributions in binary form must reproduce the above copyright notice, | |||||
// this list of conditions and the following disclaimer in the documentation | |||||
// and/or other materials provided with the distribution. | |||||
// * Neither the name of the Steinberg Media Technologies nor the names of its | |||||
// contributors may be used to endorse or promote products derived from this | |||||
// software without specific prior written permission. | |||||
// | |||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | |||||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |||||
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, | |||||
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | |||||
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | |||||
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE | |||||
// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | |||||
// OF THE POSSIBILITY OF SUCH DAMAGE. | |||||
//----------------------------------------------------------------------------- | |||||
#include <AudioUnit/AudioUnit.r> | |||||
#include <AudioUnit/AudioUnitCarbonView.r> | |||||
#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 |
@@ -1,84 +0,0 @@ | |||||
//------------------------------------------------------------------------ | |||||
// Project : VST SDK | |||||
// | |||||
// Category : Helpers | |||||
// Filename : public.sdk/source/vst/auwrapper/ausdk.mm | |||||
// Created by : Steinberg, 12/2007 | |||||
// Description : VST 3 -> AU Wrapper | |||||
// | |||||
//----------------------------------------------------------------------------- | |||||
// LICENSE | |||||
// (c) 2017, Steinberg Media Technologies GmbH, All Rights Reserved | |||||
//----------------------------------------------------------------------------- | |||||
// Redistribution and use in source and binary forms, with or without modification, | |||||
// are permitted provided that the following conditions are met: | |||||
// | |||||
// * Redistributions of source code must retain the above copyright notice, | |||||
// this list of conditions and the following disclaimer. | |||||
// * Redistributions in binary form must reproduce the above copyright notice, | |||||
// this list of conditions and the following disclaimer in the documentation | |||||
// and/or other materials provided with the distribution. | |||||
// * Neither the name of the Steinberg Media Technologies nor the names of its | |||||
// contributors may be used to endorse or promote products derived from this | |||||
// software without specific prior written permission. | |||||
// | |||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | |||||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |||||
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, | |||||
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | |||||
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | |||||
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE | |||||
// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | |||||
// OF THE POSSIBILITY OF SUCH DAMAGE. | |||||
//----------------------------------------------------------------------------- | |||||
/// \cond ignore | |||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations" | |||||
#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 |
@@ -1,340 +0,0 @@ | |||||
//------------------------------------------------------------------------ | |||||
// Project : VST SDK | |||||
// | |||||
// Category : Helpers | |||||
// Filename : public.sdk/source/vst/auwrapper/auwrapper.h | |||||
// Created by : Steinberg, 12/2007 | |||||
// Description : VST 3 -> AU Wrapper | |||||
// | |||||
//----------------------------------------------------------------------------- | |||||
// LICENSE | |||||
// (c) 2017, Steinberg Media Technologies GmbH, All Rights Reserved | |||||
//----------------------------------------------------------------------------- | |||||
// Redistribution and use in source and binary forms, with or without modification, | |||||
// are permitted provided that the following conditions are met: | |||||
// | |||||
// * Redistributions of source code must retain the above copyright notice, | |||||
// this list of conditions and the following disclaimer. | |||||
// * Redistributions in binary form must reproduce the above copyright notice, | |||||
// this list of conditions and the following disclaimer in the documentation | |||||
// and/or other materials provided with the distribution. | |||||
// * Neither the name of the Steinberg Media Technologies nor the names of its | |||||
// contributors may be used to endorse or promote products derived from this | |||||
// software without specific prior written permission. | |||||
// | |||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | |||||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |||||
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, | |||||
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | |||||
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | |||||
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE | |||||
// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | |||||
// OF THE POSSIBILITY OF SUCH DAMAGE. | |||||
//----------------------------------------------------------------------------- | |||||
/** | |||||
*************************** | |||||
\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/fstring.h" | |||||
#include "base/source/flock.h" | |||||
#include <Cocoa/Cocoa.h> | |||||
#include <AudioToolbox/AudioToolbox.h> | |||||
#include <vector> | |||||
#include <map> | |||||
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<MIDIMessageInfoStruct>::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<Byte*>(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<MIDIMessageInfoStruct> 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 () SMTG_OVERRIDE; | |||||
void PostConstructor () SMTG_OVERRIDE; | |||||
//---AUBase----------------------------- | |||||
void Cleanup () SMTG_OVERRIDE; | |||||
ComponentResult Initialize () SMTG_OVERRIDE; | |||||
AUElement* CreateElement (AudioUnitScope scope, AudioUnitElement element) SMTG_OVERRIDE; | |||||
UInt32 SupportedNumChannels (const AUChannelInfo** outInfo) SMTG_OVERRIDE; | |||||
bool StreamFormatWritable (AudioUnitScope scope, AudioUnitElement element) SMTG_OVERRIDE; | |||||
ComponentResult ChangeStreamFormat (AudioUnitScope inScope, AudioUnitElement inElement, const CAStreamBasicDescription& inPrevFormat, const CAStreamBasicDescription& inNewFormat) SMTG_OVERRIDE; | |||||
ComponentResult SetConnection (const AudioUnitConnection& inConnection) SMTG_OVERRIDE; | |||||
ComponentResult GetParameterInfo (AudioUnitScope inScope, AudioUnitParameterID inParameterID, AudioUnitParameterInfo& outParameterInfo) SMTG_OVERRIDE; | |||||
ComponentResult SetParameter (AudioUnitParameterID inID, AudioUnitScope inScope, AudioUnitElement inElement, AudioUnitParameterValue inValue, UInt32 inBufferOffsetInFrames) SMTG_OVERRIDE; | |||||
ComponentResult SaveState (CFPropertyListRef* outData) SMTG_OVERRIDE; | |||||
ComponentResult RestoreState (CFPropertyListRef inData) SMTG_OVERRIDE; | |||||
ComponentResult Render (AudioUnitRenderActionFlags &ioActionFlags, const AudioTimeStamp &inTimeStamp, UInt32 inNumberFrames) SMTG_OVERRIDE; | |||||
void processOutputEvents (const AudioTimeStamp &inTimeStamp); | |||||
int GetNumCustomUIComponents () SMTG_OVERRIDE; | |||||
void GetUIComponentDescs (ComponentDescription* inDescArray) SMTG_OVERRIDE; | |||||
ComponentResult GetPropertyInfo (AudioUnitPropertyID inID, AudioUnitScope inScope, AudioUnitElement inElement, UInt32 &outDataSize, Boolean &outWritable) SMTG_OVERRIDE; | |||||
ComponentResult GetProperty (AudioUnitPropertyID inID, AudioUnitScope inScope, AudioUnitElement inElement, void* outData) SMTG_OVERRIDE; | |||||
ComponentResult SetProperty (AudioUnitPropertyID inID, AudioUnitScope inScope, AudioUnitElement inElement, const void* inData, UInt32 inDataSize) SMTG_OVERRIDE; | |||||
bool CanScheduleParameters() const; // Not in the base class anymore in newer CoreAudio SDKs | |||||
Float64 GetLatency () SMTG_OVERRIDE; | |||||
Float64 GetTailTime () SMTG_OVERRIDE; | |||||
//---Factory presets | |||||
OSStatus GetPresets (CFArrayRef* outData) const SMTG_OVERRIDE; | |||||
OSStatus NewFactoryPresetSet (const AUPreset& inNewFactoryPreset) SMTG_OVERRIDE; | |||||
//---MusicDeviceBase------------------------- | |||||
ComponentResult StartNote (MusicDeviceInstrumentID inInstrument, MusicDeviceGroupID inGroupID, NoteInstanceID* outNoteInstanceID, UInt32 inOffsetSampleFrame, const MusicDeviceNoteParams &inParams) SMTG_OVERRIDE; | |||||
ComponentResult StopNote (MusicDeviceGroupID inGroupID, NoteInstanceID inNoteInstanceID, UInt32 inOffsetSampleFrame) SMTG_OVERRIDE; | |||||
OSStatus GetInstrumentCount (UInt32 &outInstCount) const SMTG_OVERRIDE; | |||||
//---AUMIDIBase------------------------------ | |||||
OSStatus HandleNonNoteEvent (UInt8 status, UInt8 channel, UInt8 data1, UInt8 data2, UInt32 inStartFrame) SMTG_OVERRIDE; | |||||
//---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) SMTG_OVERRIDE; | |||||
tresult PLUGIN_API performEdit (ParamID tag, ParamValue valueNormalized) SMTG_OVERRIDE; | |||||
tresult PLUGIN_API endEdit (ParamID tag) SMTG_OVERRIDE; | |||||
tresult PLUGIN_API restartComponent (int32 flags) SMTG_OVERRIDE; | |||||
//---from ITimerCallback---------------------- | |||||
void onTimer (Timer* timer) SMTG_OVERRIDE; | |||||
// 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; | |||||
typedef std::map<uint32, AudioUnitParameterInfo> CachedParameterInfoMap; | |||||
typedef std::map<UnitID, UnitInfo> UnitInfoMap; | |||||
typedef std::vector<String> ClumpGroupVector; | |||||
UnitInfoMap unitInfos; | |||||
ClumpGroupVector clumpGroups; | |||||
CachedParameterInfoMap 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 | |||||
int32 midiOutCount; // currently only 0 or 1 supported | |||||
MIDIOutputCallbackHelper mCallbackHelper; | |||||
EventList outputEvents; | |||||
private: | |||||
void buildUnitInfos (IUnitInfo* unitInfoController, UnitInfoMap& units) const; | |||||
}; | |||||
//------------------------------------------------------------------------ | |||||
class AutoreleasePool | |||||
{ | |||||
public: | |||||
AutoreleasePool () { ap = [[NSAutoreleasePool alloc] init]; } | |||||
~AutoreleasePool () { [ap drain]; } | |||||
//------------------------------------------------------------------------ | |||||
protected: | |||||
NSAutoreleasePool* ap; | |||||
}; | |||||
//------------------------------------------------------------------------ | |||||
} // namespace Vst | |||||
} // namespace Steinberg | |||||
/// \endcond |
@@ -1,38 +0,0 @@ | |||||
//------------------------------------------------------------------------ | |||||
// Project : VST SDK | |||||
// | |||||
// Category : Helpers | |||||
// Filename : public.sdk/source/vst/auwrapper/auwrapper_prefix.pch | |||||
// Created by : Steinberg, 12/2007 | |||||
// Description : VST 3 -> AU Wrapper | |||||
// | |||||
//----------------------------------------------------------------------------- | |||||
// LICENSE | |||||
// (c) 2017, Steinberg Media Technologies GmbH, All Rights Reserved | |||||
//----------------------------------------------------------------------------- | |||||
// Redistribution and use in source and binary forms, with or without modification, | |||||
// are permitted provided that the following conditions are met: | |||||
// | |||||
// * Redistributions of source code must retain the above copyright notice, | |||||
// this list of conditions and the following disclaimer. | |||||
// * Redistributions in binary form must reproduce the above copyright notice, | |||||
// this list of conditions and the following disclaimer in the documentation | |||||
// and/or other materials provided with the distribution. | |||||
// * Neither the name of the Steinberg Media Technologies nor the names of its | |||||
// contributors may be used to endorse or promote products derived from this | |||||
// software without specific prior written permission. | |||||
// | |||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | |||||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |||||
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, | |||||
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | |||||
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | |||||
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE | |||||
// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | |||||
// OF THE POSSIBILITY OF SUCH DAMAGE. | |||||
//----------------------------------------------------------------------------- | |||||
#include <CoreFoundation/CoreFoundation.h> | |||||
#include <CoreAudio/CoreAudio.h> |
@@ -1,38 +0,0 @@ | |||||
//------------------------------------------------------------------------ | |||||
// Project : VST SDK | |||||
// | |||||
// 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) 2017, Steinberg Media Technologies GmbH, All Rights Reserved | |||||
//----------------------------------------------------------------------------- | |||||
// Redistribution and use in source and binary forms, with or without modification, | |||||
// are permitted provided that the following conditions are met: | |||||
// | |||||
// * Redistributions of source code must retain the above copyright notice, | |||||
// this list of conditions and the following disclaimer. | |||||
// * Redistributions in binary form must reproduce the above copyright notice, | |||||
// this list of conditions and the following disclaimer in the documentation | |||||
// and/or other materials provided with the distribution. | |||||
// * Neither the name of the Steinberg Media Technologies nor the names of its | |||||
// contributors may be used to endorse or promote products derived from this | |||||
// software without specific prior written permission. | |||||
// | |||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | |||||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |||||
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, | |||||
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | |||||
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | |||||
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE | |||||
// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | |||||
// OF THE POSSIBILITY OF SUCH DAMAGE. | |||||
//----------------------------------------------------------------------------- | |||||
// 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 |
@@ -1,44 +0,0 @@ | |||||
//------------------------------------------------------------------------ | |||||
// Project : VST SDK | |||||
// | |||||
// 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) 2017, Steinberg Media Technologies GmbH, All Rights Reserved | |||||
//----------------------------------------------------------------------------- | |||||
// Redistribution and use in source and binary forms, with or without modification, | |||||
// are permitted provided that the following conditions are met: | |||||
// | |||||
// * Redistributions of source code must retain the above copyright notice, | |||||
// this list of conditions and the following disclaimer. | |||||
// * Redistributions in binary form must reproduce the above copyright notice, | |||||
// this list of conditions and the following disclaimer in the documentation | |||||
// and/or other materials provided with the distribution. | |||||
// * Neither the name of the Steinberg Media Technologies nor the names of its | |||||
// contributors may be used to endorse or promote products derived from this | |||||
// software without specific prior written permission. | |||||
// | |||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | |||||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |||||
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, | |||||
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | |||||
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | |||||
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE | |||||
// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | |||||
// OF THE POSSIBILITY OF SUCH DAMAGE. | |||||
//----------------------------------------------------------------------------- | |||||
#include "../../../../../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 |
@@ -1,40 +0,0 @@ | |||||
//------------------------------------------------------------------------ | |||||
// Project : VST SDK | |||||
// | |||||
// 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) 2017, Steinberg Media Technologies GmbH, All Rights Reserved | |||||
//----------------------------------------------------------------------------- | |||||
// Redistribution and use in source and binary forms, with or without modification, | |||||
// are permitted provided that the following conditions are met: | |||||
// | |||||
// * Redistributions of source code must retain the above copyright notice, | |||||
// this list of conditions and the following disclaimer. | |||||
// * Redistributions in binary form must reproduce the above copyright notice, | |||||
// this list of conditions and the following disclaimer in the documentation | |||||
// and/or other materials provided with the distribution. | |||||
// * Neither the name of the Steinberg Media Technologies nor the names of its | |||||
// contributors may be used to endorse or promote products derived from this | |||||
// software without specific prior written permission. | |||||
// | |||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | |||||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |||||
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, | |||||
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | |||||
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | |||||
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE | |||||
// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | |||||
// OF THE POSSIBILITY OF SUCH DAMAGE. | |||||
//----------------------------------------------------------------------------- | |||||
#include "../../../../../base/mac/config/debug" | |||||
GCC_OPTIMIZATION_LEVEL = 0 | |||||
DEPLOYMENT_POSTPROCESSING = NO |
@@ -1,40 +0,0 @@ | |||||
//------------------------------------------------------------------------ | |||||
// Project : VST SDK | |||||
// | |||||
// 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) 2017, Steinberg Media Technologies GmbH, All Rights Reserved | |||||
//----------------------------------------------------------------------------- | |||||
// Redistribution and use in source and binary forms, with or without modification, | |||||
// are permitted provided that the following conditions are met: | |||||
// | |||||
// * Redistributions of source code must retain the above copyright notice, | |||||
// this list of conditions and the following disclaimer. | |||||
// * Redistributions in binary form must reproduce the above copyright notice, | |||||
// this list of conditions and the following disclaimer in the documentation | |||||
// and/or other materials provided with the distribution. | |||||
// * Neither the name of the Steinberg Media Technologies nor the names of its | |||||
// contributors may be used to endorse or promote products derived from this | |||||
// software without specific prior written permission. | |||||
// | |||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | |||||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |||||
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, | |||||
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | |||||
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | |||||
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE | |||||
// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | |||||
// OF THE POSSIBILITY OF SUCH DAMAGE. | |||||
//----------------------------------------------------------------------------- | |||||
#include "../../../../../base/mac/config/release" | |||||
GCC_OPTIMIZATION_LEVEL = 3 | |||||
DEPLOYMENT_POSTPROCESSING = NO |
@@ -1,23 +0,0 @@ | |||||
#!/usr/bin/ruby | |||||
require 'time' | |||||
cocoaClassPrefixDir=ARGV[0] | |||||
cocoaClassPrefixDir = ARGV[0] | |||||
if cocoaClassPrefixDir == nil | |||||
$stdout << "Cannot resolve output directory\n" | |||||
exit(-1) | |||||
end | |||||
$stdout << "Generating new class prefix for Objective-C classes in #{cocoaClassPrefixDir}\n" | |||||
File.open("#{cocoaClassPrefixDir}/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 | |||||
@@ -1,335 +0,0 @@ | |||||
//------------------------------------------------------------------------ | |||||
// Project : VST SDK | |||||
// | |||||
// Category : Helpers | |||||
// Filename : public.sdk/source/vst/vst2wrapper/vst2wrapper.h | |||||
// Created by : Steinberg, 01/2009 | |||||
// Description : VST 3 -> VST 2 Wrapper | |||||
// | |||||
//----------------------------------------------------------------------------- | |||||
// LICENSE | |||||
// (c) 2017, Steinberg Media Technologies GmbH, All Rights Reserved | |||||
//----------------------------------------------------------------------------- | |||||
// Redistribution and use in source and binary forms, with or without modification, | |||||
// are permitted provided that the following conditions are met: | |||||
// | |||||
// * Redistributions of source code must retain the above copyright notice, | |||||
// this list of conditions and the following disclaimer. | |||||
// * Redistributions in binary form must reproduce the above copyright notice, | |||||
// this list of conditions and the following disclaimer in the documentation | |||||
// and/or other materials provided with the distribution. | |||||
// * Neither the name of the Steinberg Media Technologies nor the names of its | |||||
// contributors may be used to endorse or promote products derived from this | |||||
// software without specific prior written permission. | |||||
// | |||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | |||||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |||||
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, | |||||
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | |||||
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | |||||
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE | |||||
// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | |||||
// OF THE POSSIBILITY OF SUCH DAMAGE. | |||||
//----------------------------------------------------------------------------- | |||||
/** | |||||
************************************** | |||||
\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 "pluginterfaces/vst/ivstaudioprocessor.h" | |||||
#include "pluginterfaces/vst/ivsteditcontroller.h" | |||||
#include "pluginterfaces/vst/ivsthostapplication.h" | |||||
#include "pluginterfaces/vst/ivstprocesscontext.h" | |||||
#include "pluginterfaces/vst/ivstunits.h" | |||||
#include "public.sdk/source/common/memorystream.h" | |||||
#include "public.sdk/source/vst/hosting/eventlist.h" | |||||
#include "public.sdk/source/vst/hosting/parameterchanges.h" | |||||
#include "public.sdk/source/vst/hosting/processdata.h" | |||||
#include "public.sdk/source/vst2.x/audioeffectx.h" | |||||
#include "base/source/fstring.h" | |||||
#include "base/source/timer.h" | |||||
#include <map> | |||||
#include <vector> | |||||
//------------------------------------------------------------------------ | |||||
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 () SMTG_OVERRIDE; // Called when Plug-in is switched to off | |||||
virtual void resume () SMTG_OVERRIDE; // Called when Plug-in is switched to on | |||||
virtual VstInt32 startProcess () SMTG_OVERRIDE; | |||||
virtual VstInt32 stopProcess () SMTG_OVERRIDE; | |||||
virtual void setSampleRate (float newSamplerate) | |||||
SMTG_OVERRIDE; // Called when the sample rate changes (always in a suspend state) | |||||
virtual void setBlockSize (VstInt32 newBlockSize) | |||||
SMTG_OVERRIDE; // 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) SMTG_OVERRIDE; | |||||
virtual void setParameter (VstInt32 index, float value) SMTG_OVERRIDE; | |||||
virtual void setProgram (VstInt32 program) SMTG_OVERRIDE; | |||||
virtual void setProgramName (char* name) SMTG_OVERRIDE; | |||||
virtual void getProgramName (char* name) SMTG_OVERRIDE; | |||||
virtual bool getProgramNameIndexed (VstInt32 category, VstInt32 index, | |||||
char* text) SMTG_OVERRIDE; | |||||
virtual void getParameterLabel (VstInt32 index, char* label) SMTG_OVERRIDE; | |||||
virtual void getParameterDisplay (VstInt32 index, char* text) SMTG_OVERRIDE; | |||||
virtual void getParameterName (VstInt32 index, char* text) SMTG_OVERRIDE; | |||||
virtual bool canParameterBeAutomated (VstInt32 index) SMTG_OVERRIDE; | |||||
virtual bool string2parameter (VstInt32 index, char* text) SMTG_OVERRIDE; | |||||
virtual bool getParameterProperties (VstInt32 index, VstParameterProperties* p) SMTG_OVERRIDE; | |||||
virtual VstInt32 getChunk (void** data, bool isPreset = false) SMTG_OVERRIDE; | |||||
virtual VstInt32 setChunk (void* data, VstInt32 byteSize, bool isPreset = false) SMTG_OVERRIDE; | |||||
virtual bool getInputProperties (VstInt32 index, VstPinProperties* properties) SMTG_OVERRIDE; | |||||
virtual bool getOutputProperties (VstInt32 index, VstPinProperties* properties) SMTG_OVERRIDE; | |||||
virtual bool setSpeakerArrangement (VstSpeakerArrangement* pluginInput, | |||||
VstSpeakerArrangement* pluginOutput) SMTG_OVERRIDE; | |||||
virtual bool getSpeakerArrangement (VstSpeakerArrangement** pluginInput, | |||||
VstSpeakerArrangement** pluginOutput) SMTG_OVERRIDE; | |||||
virtual bool setBypass (bool onOff) SMTG_OVERRIDE; | |||||
virtual bool setProcessPrecision (VstInt32 precision) SMTG_OVERRIDE; | |||||
virtual VstInt32 getNumMidiInputChannels () SMTG_OVERRIDE; | |||||
virtual VstInt32 getNumMidiOutputChannels () SMTG_OVERRIDE; | |||||
virtual VstInt32 getGetTailSize () SMTG_OVERRIDE; | |||||
virtual bool getEffectName (char* name) SMTG_OVERRIDE; | |||||
virtual bool getVendorString (char* text) SMTG_OVERRIDE; | |||||
virtual VstInt32 getVendorVersion () SMTG_OVERRIDE; | |||||
virtual VstIntPtr vendorSpecific (VstInt32 lArg, VstIntPtr lArg2, void* ptrArg, | |||||
float floatArg) SMTG_OVERRIDE; | |||||
virtual VstPlugCategory getPlugCategory () SMTG_OVERRIDE; | |||||
virtual VstInt32 canDo (char* text) SMTG_OVERRIDE; | |||||
virtual VstInt32 getMidiProgramName (VstInt32 channel, | |||||
MidiProgramName* midiProgramName) SMTG_OVERRIDE; | |||||
virtual VstInt32 getCurrentMidiProgram (VstInt32 channel, | |||||
MidiProgramName* currentProgram) SMTG_OVERRIDE; | |||||
virtual VstInt32 getMidiProgramCategory (VstInt32 channel, | |||||
MidiProgramCategory* category) SMTG_OVERRIDE; | |||||
virtual bool hasMidiProgramsChanged (VstInt32 channel) SMTG_OVERRIDE; | |||||
virtual bool getMidiKeyName (VstInt32 channel, MidiKeyName* keyName) SMTG_OVERRIDE; | |||||
// finally process... | |||||
virtual void processReplacing (float** inputs, float** outputs, | |||||
VstInt32 sampleFrames) SMTG_OVERRIDE; | |||||
virtual void processDoubleReplacing (double** inputs, double** outputs, | |||||
VstInt32 sampleFrames) SMTG_OVERRIDE; | |||||
virtual VstInt32 processEvents (VstEvents* events) SMTG_OVERRIDE; | |||||
// VST 3 Interfaces ------------------------------------------------------ | |||||
// FUnknown | |||||
virtual tresult PLUGIN_API queryInterface (const char* iid, void** obj) SMTG_OVERRIDE; | |||||
virtual uint32 PLUGIN_API addRef () SMTG_OVERRIDE { return 1; } | |||||
virtual uint32 PLUGIN_API release () SMTG_OVERRIDE { return 1; } | |||||
// IHostApplication | |||||
virtual tresult PLUGIN_API getName (String128 name) SMTG_OVERRIDE; | |||||
virtual tresult PLUGIN_API createInstance (TUID cid, TUID iid, void** obj) SMTG_OVERRIDE; | |||||
// IComponentHandler | |||||
virtual tresult PLUGIN_API beginEdit (ParamID tag) SMTG_OVERRIDE; | |||||
virtual tresult PLUGIN_API performEdit (ParamID tag, ParamValue valueNormalized) SMTG_OVERRIDE; | |||||
virtual tresult PLUGIN_API endEdit (ParamID tag) SMTG_OVERRIDE; | |||||
virtual tresult PLUGIN_API restartComponent (int32 flags) SMTG_OVERRIDE; | |||||
// IUnitHandler | |||||
virtual tresult PLUGIN_API notifyUnitSelection (UnitID unitId) SMTG_OVERRIDE; | |||||
virtual tresult PLUGIN_API notifyProgramListChange (ProgramListID listId, | |||||
int32 programIndex) SMTG_OVERRIDE; | |||||
void setVendorName (char* name); | |||||
void setEffectName (char* name); | |||||
void setEffectVersion (char* version); | |||||
void setSubCategories (char* string); | |||||
// ITimer | |||||
virtual void onTimer (Timer* timer) SMTG_OVERRIDE; | |||||
//------------------------------------------------------------------------------------------------------- | |||||
protected: | |||||
void setupBuses (); | |||||
void setupParameters (); | |||||
void initMidiCtrlerAssignment (); | |||||
void getUnitPath (UnitID unitID, String& path); | |||||
int32 countMainBusChannels (BusDirection dir, uint64& mainBusBitset); | |||||
template <class T> | |||||
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<ProgramCategory>> mProgramCategories; | |||||
void setupProgramCategories (); | |||||
static uint32 makeCategoriesRecursive (std::vector<ProgramCategory>& 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]; | |||||
int32 mVersion; | |||||
struct ParamMapEntry | |||||
{ | |||||
ParamID vst3ID; | |||||
int32 vst3Index; | |||||
}; | |||||
std::vector<ParamMapEntry> mParameterMap; | |||||
std::map<ParamID, int32> 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; | |||||
enum | |||||
{ | |||||
kMaxMidiMappingBusses = 4 | |||||
}; | |||||
int32* mMidiCCMapping[kMaxMidiMappingBusses][16]; | |||||
}; | |||||
//------------------------------------------------------------------------ | |||||
} // namespace Vst | |||||
} // namespace Steinberg | |||||
/** Must be implemented externally. */ | |||||
extern ::AudioEffect* createEffectInstance (audioMasterCallback audioMaster); | |||||
/// \endcond |
@@ -1,47 +0,0 @@ | |||||
//------------------------------------------------------------------------ | |||||
// Project : VST SDK | |||||
// | |||||
// Category : Helpers | |||||
// Filename : public.sdk/source/vst/vst2wrapper/vst2wrapper.sdk.cpp | |||||
// Created by : Steinberg, 01/2009 | |||||
// Description : VST 3 -> VST 2 Wrapper | |||||
// | |||||
//----------------------------------------------------------------------------- | |||||
// LICENSE | |||||
// (c) 2017, Steinberg Media Technologies GmbH, All Rights Reserved | |||||
//----------------------------------------------------------------------------- | |||||
// Redistribution and use in source and binary forms, with or without modification, | |||||
// are permitted provided that the following conditions are met: | |||||
// | |||||
// * Redistributions of source code must retain the above copyright notice, | |||||
// this list of conditions and the following disclaimer. | |||||
// * Redistributions in binary form must reproduce the above copyright notice, | |||||
// this list of conditions and the following disclaimer in the documentation | |||||
// and/or other materials provided with the distribution. | |||||
// * Neither the name of the Steinberg Media Technologies nor the names of its | |||||
// contributors may be used to endorse or promote products derived from this | |||||
// software without specific prior written permission. | |||||
// | |||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | |||||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | |||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | |||||
// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, | |||||
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | |||||
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | |||||
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE | |||||
// OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | |||||
// OF THE POSSIBILITY OF SUCH DAMAGE. | |||||
//----------------------------------------------------------------------------- | |||||
#include "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" |