From dc840d85358ba7df56d3daae7ca6239f3ae460c6 Mon Sep 17 00:00:00 2001 From: falkTX Date: Thu, 24 Jan 2019 13:15:02 +0000 Subject: Something that works.. --- Makefile.plugins.mk | 47 +++++++- .../AudioUnits/AUPublic/xAUResources.r | 134 +++++++++++++++++++++ distrho/src/CoreAudio106/Info.plist | 6 +- distrho/src/CoreAudio106/PkgInfo | 2 +- distrho/src/DistrhoPluginAU.cpp | 4 +- distrho/src/DistrhoPluginAU.exp | 1 + distrho/src/DistrhoPluginAU.r | 37 +++--- 7 files changed, 203 insertions(+), 28 deletions(-) create mode 100755 distrho/src/CoreAudio106/AudioUnits/AUPublic/xAUResources.r create mode 100644 distrho/src/DistrhoPluginAU.exp diff --git a/Makefile.plugins.mk b/Makefile.plugins.mk index 3ab599c1..056c96a1 100644 --- a/Makefile.plugins.mk +++ b/Makefile.plugins.mk @@ -57,7 +57,10 @@ lv2 = $(TARGET_DIR)/$(NAME).lv2/$(NAME)$(LIB_EXT) lv2_dsp = $(TARGET_DIR)/$(NAME).lv2/$(NAME)_dsp$(LIB_EXT) lv2_ui = $(TARGET_DIR)/$(NAME).lv2/$(NAME)_ui$(LIB_EXT) vst = $(TARGET_DIR)/$(NAME)-vst$(LIB_EXT) -au = $(TARGET_DIR)/$(NAME).component/Contents/MacOS/plugin +au_plugin = $(TARGET_DIR)/$(NAME).component/Contents/MacOS/dpfplugin +au_pkginfo = $(TARGET_DIR)/$(NAME).component/Contents/PkgInfo +au_plist = $(TARGET_DIR)/$(NAME).component/Contents/Info.plist +au_rsrc = $(TARGET_DIR)/$(NAME).component/Contents/Resources/dpfplugin.rsrc # --------------------------------------------------------------------------------------------------------------------- # Set stuff needed for AU @@ -72,10 +75,10 @@ AU_BUILD_FLAGS = \ -Wno-unused-parameter AU_LINK_FLAGS = \ - -bundle \ + -bundle -arch x86_64 -arch i386 \ -framework AudioToolbox \ -framework AudioUnit \ - -Wl,-exported_symbol,_PluginAUEntry + -exported_symbols_list $(DPF_PATH)/distrho/src/DistrhoPluginAU.exp # not needed yet # -I$(DPF_PATH)/distrho/src/CoreAudio106/AudioUnits/AUPublic/AUCarbonViewBase @@ -265,17 +268,49 @@ endif # --------------------------------------------------------------------------------------------------------------------- # AU -au: $(au) +au: $(au_plugin) $(au_pkginfo) $(au_plist) $(au_rsrc) ifeq ($(HAVE_DGL),true) -$(au): $(OBJS_DSP) $(OBJS_UI) $(BUILD_DIR)/DistrhoPluginMain_AU.cpp.o $(BUILD_DIR)/DistrhoUIMain_AU.cpp.o $(DGL_LIB) +$(au_plugin): $(OBJS_DSP) $(OBJS_UI) $(BUILD_DIR)/DistrhoPluginMain_AU.cpp.o $(BUILD_DIR)/DistrhoUIMain_AU.cpp.o $(DGL_LIB) else -$(au): $(OBJS_DSP) $(BUILD_DIR)/DistrhoPluginMain_AU.cpp.o +$(au_plugin): $(OBJS_DSP) $(BUILD_DIR)/DistrhoPluginMain_AU.cpp.o endif -@mkdir -p $(shell dirname $@) @echo "Creating AU plugin for $(NAME)" $(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(AU_LINK_FLAGS) $(DGL_LIBS) -o $@ +$(au_pkginfo): $(OBJS_DSP) + -@mkdir -p $(shell dirname $@) + @echo "Creating AU PkgInfo for $(NAME)" + cp $(DPF_PATH)/distrho/src/CoreAudio106/PkgInfo $@ + +$(au_plist): $(OBJS_DSP) + -@mkdir -p $(shell dirname $@) + @echo "Creating AU Info.plist for $(NAME)" + cp $(DPF_PATH)/distrho/src/CoreAudio106/Info.plist $@ + +$(au_rsrc): $(BUILD_DIR)/step2.rsrc + -@mkdir -p $(shell dirname $@) + @echo "Creating AU rsrc for $(NAME)" + ResMerger $< -dstIs DF -o $@ + +$(BUILD_DIR)/step2.rsrc: $(BUILD_DIR)/step1.rsrc + ResMerger -dstIs DF $< -o $@ + +$(BUILD_DIR)/step1.rsrc: $(DPF_PATH)/distrho/src/DistrhoPluginAU.r $(OBJS_DSP) $(au_pkginfo) $(au_plist) + Rez $< \ + -d SystemSevenOrLater=1 \ + -useDF -script Roman \ + -d x86_64_YES -d i386_YES -arch x86_64 -arch i386 \ + -i . \ + -i $(DPF_PATH)/distrho/src/CoreAudio106/AudioUnits/AUPublic \ + -i $(DPF_PATH)/distrho/src/CoreAudio106/AudioUnits/AUPublic/AUBase \ + -i $(DPF_PATH)/distrho/src/CoreAudio106/AudioUnits/AUPublic/OtherBases \ + -i $(DPF_PATH)/distrho/src/CoreAudio106/AudioUnits/AUPublic/Utility \ + -i $(DPF_PATH)/distrho/src/CoreAudio106/PublicUtility \ + -I /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Versions/A/Headers \ + -o $@ + # --------------------------------------------------------------------------------------------------------------------- -include $(OBJS_DSP:%.o=%.d) diff --git a/distrho/src/CoreAudio106/AudioUnits/AUPublic/xAUResources.r b/distrho/src/CoreAudio106/AudioUnits/AUPublic/xAUResources.r new file mode 100755 index 00000000..acef631a --- /dev/null +++ b/distrho/src/CoreAudio106/AudioUnits/AUPublic/xAUResources.r @@ -0,0 +1,134 @@ +/* Copyright © 2007 Apple Inc. All Rights Reserved. + + Disclaimer: IMPORTANT: This Apple software is supplied to you by + Apple Inc. ("Apple") in consideration of your agreement to the + following terms, and your use, installation, modification or + redistribution of this Apple software constitutes acceptance of these + terms. If you do not agree with these terms, please do not use, + install, modify or redistribute this Apple software. + + In consideration of your agreement to abide by the following terms, and + subject to these terms, Apple grants you a personal, non-exclusive + license, under Apple's copyrights in this original Apple software (the + "Apple Software"), to use, reproduce, modify and redistribute the Apple + Software, with or without modifications, in source and/or binary forms; + provided that if you redistribute the Apple Software in its entirety and + without modifications, you must retain this notice and the following + text and disclaimers in all such redistributions of the Apple Software. + Neither the name, trademarks, service marks or logos of Apple Inc. + may be used to endorse or promote products derived from the Apple + Software without specific prior written permission from Apple. Except + as expressly stated in this notice, no other rights or licenses, express + or implied, are granted by Apple herein, including but not limited to + any patent rights that may be infringed by your derivative works or by + other works in which the Apple Software may be incorporated. + + The Apple Software is provided by Apple on an "AS IS" basis. APPLE + MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION + THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND + OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. + + IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, + MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED + AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), + STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ +/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// AUResources.r +// +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ + +/* sample macro definitions -- all of these symbols must be defined +#define RES_ID kHALOutputResID +#define COMP_TYPE kAudioUnitComponentType +#define COMP_SUBTYPE kAudioUnitOutputSubType +#define COMP_MANUF kAudioUnitAudioHardwareOutputSubSubType +#define VERSION 0x00010000 +#define NAME "AudioHALOutput" +#define DESCRIPTION "Audio hardware output AudioUnit" +#define ENTRY_POINT "AUHALEntry" +*/ +#define UseExtendedThingResource 1 + +#include + +// this is a define used to indicate that a component has no static data that would mean +// that no more than one instance could be open at a time - never been true for AUs +#ifndef cmpThreadSafeOnMac +#define cmpThreadSafeOnMac 0x10000000 +#endif + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +resource 'STR ' (RES_ID, purgeable) { + NAME +}; + +resource 'STR ' (RES_ID + 1, purgeable) { + DESCRIPTION +}; + +resource 'dlle' (RES_ID) { + ENTRY_POINT +}; + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +resource 'thng' (RES_ID, NAME) { + COMP_TYPE, + COMP_SUBTYPE, + COMP_MANUF, + 0, 0, 0, 0, // no 68K + 'STR ', RES_ID, + 'STR ', RES_ID + 1, + 0, 0, /* icon */ + VERSION, + componentHasMultiplePlatforms | componentDoAutoVersion, + 0, + { + #if defined(ppc_YES) + cmpThreadSafeOnMac, + 'dlle', RES_ID, platformPowerPCNativeEntryPoint + #define NeedLeadingComma 1 + #endif + #if defined(ppc64_YES) + #if defined(NeedLeadingComma) + , + #endif + cmpThreadSafeOnMac, + 'dlle', RES_ID, platformPowerPC64NativeEntryPoint + #define NeedLeadingComma 1 + #endif + #if defined(i386_YES) + #if defined(NeedLeadingComma) + , + #endif + cmpThreadSafeOnMac, + 'dlle', RES_ID, platformIA32NativeEntryPoint + #define NeedLeadingComma 1 + #endif + #if defined(x86_64_YES) + #if defined(NeedLeadingComma) + , + #endif + cmpThreadSafeOnMac, + 'dlle', RES_ID, 8 + #define NeedLeadingComma 1 + #endif + } +}; + +#undef RES_ID +#undef COMP_TYPE +#undef COMP_SUBTYPE +#undef COMP_MANUF +#undef VERSION +#undef NAME +#undef DESCRIPTION +#undef ENTRY_POINT +#undef NeedLeadingComma diff --git a/distrho/src/CoreAudio106/Info.plist b/distrho/src/CoreAudio106/Info.plist index 4c20d3b4..bb48fd9d 100755 --- a/distrho/src/CoreAudio106/Info.plist +++ b/distrho/src/CoreAudio106/Info.plist @@ -5,13 +5,13 @@ CFBundleDevelopmentRegion English CFBundleExecutable - plugin + dpfplugin CFBundleIconFile CFBundleIdentifier com.yourcompany.dpfplugin CFBundleName - plugin + dpfplugin CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType @@ -19,7 +19,7 @@ CFBundleShortVersionString 1.1 CFBundleSignature - ???? + ShIt CFBundleVersion 1.1 CSResourcesFileMapped diff --git a/distrho/src/CoreAudio106/PkgInfo b/distrho/src/CoreAudio106/PkgInfo index 19a9cf67..568a0384 100755 --- a/distrho/src/CoreAudio106/PkgInfo +++ b/distrho/src/CoreAudio106/PkgInfo @@ -1 +1 @@ -BNDL???? \ No newline at end of file +BNDLShIt diff --git a/distrho/src/DistrhoPluginAU.cpp b/distrho/src/DistrhoPluginAU.cpp index 4050f3ac..7af4aa3f 100644 --- a/distrho/src/DistrhoPluginAU.cpp +++ b/distrho/src/DistrhoPluginAU.cpp @@ -213,8 +213,8 @@ END_NAMESPACE_DISTRHO // ----------------------------------------------------------------------- -using DISTRHO_NAMESPACE::PluginAU; -COMPONENT_ENTRY(PluginAU) +using dpfplug = DISTRHO_NAMESPACE::PluginAU; +COMPONENT_ENTRY(dpfplug) // ----------------------------------------------------------------------- diff --git a/distrho/src/DistrhoPluginAU.exp b/distrho/src/DistrhoPluginAU.exp new file mode 100644 index 00000000..5c157426 --- /dev/null +++ b/distrho/src/DistrhoPluginAU.exp @@ -0,0 +1 @@ +_dpfplugEntry diff --git a/distrho/src/DistrhoPluginAU.r b/distrho/src/DistrhoPluginAU.r index 4699e9a9..7e619fe1 100644 --- a/distrho/src/DistrhoPluginAU.r +++ b/distrho/src/DistrhoPluginAU.r @@ -1,26 +1,31 @@ #define UseExtendedThingResource 1 #include -#include "DistrhoPluginInfo.h" -// Note that resource IDs must be spaced 2 apart for the 'STR ' name and description -#define kAudioUnitResID_dpfplugin 1000 +#ifdef DEBUG + #define kdpfplugVersion 0xFFFFFFFF +#else + #define kdpfplugVersion 0x00010000 +#endif -#define RES_ID kAudioUnitResID_dpfplugin -#define COMP_TYPE kAudioUnitType_Effect -#define COMP_SUBTYPE "Damn" -#define COMP_MANUF "????" +//~~~~~~~~~~~~~~ Change!!! ~~~~~~~~~~~~~~~~~~~~~// +#define dpfplugin_COMP_SUBTYPE 'FuCk' +#define dpfplugin_COMP_MANF 'ShIt' +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// -#define VERSION 0x00010000 +// Note that resource IDs must be spaced 2 apart for the 'STR ' name and description +#define kAudioUnitResID_dpfplugin 1000 -#ifdef DISTRHO_PLUGIN_BRAND - #define NAME DISTRHO_PLUGIN_BRAND ": " DISTRHO_PLUGIN_NAME -#else - #define NAME "DPF: " DISTRHO_PLUGIN_NAME -#endif +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ dpfplugin~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -#define DESCRIPTION "TODO here" -#define ENTRY_POINT "PluginAUEntry" +#define RES_ID kAudioUnitResID_dpfplugin +#define COMP_TYPE kAudioUnitType_Effect +#define COMP_SUBTYPE dpfplugin_COMP_SUBTYPE +#define COMP_MANUF dpfplugin_COMP_MANF -#include "CoreAudio106/AudioUnits/AUPublic/AUBase/AUResources.r" +#define VERSION kdpfplugVersion +#define NAME "__MyCompanyName__: dpfplugin" +#define DESCRIPTION "dpfplugin AU" +#define ENTRY_POINT "dpfplugEntry" +#include "AUResources.r" -- cgit v1.2.3