2
0
Fork 0

Added Xcode exporter. Its only set to build for VSTi on Mac (32 or 64-bit work) at the moment as a tweak the AU build. Missing functions and types found on Windows are now supplemented with replacements. Other typedefs depending on compiler implementation were replaced with more predictable ones

This commit is contained in:
jefrus 2015-02-12 22:13:54 -05:00
parent 2482447f98
commit 637e49fc53
8 changed files with 422 additions and 219 deletions

View file

@ -1,105 +1,141 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<JUCERPROJECT id="wUKQiT" name="JuceOPLVSTi" projectType="audioplug" version="0.11.1" <JUCERPROJECT id="wUKQiT" name="JuceOPL" projectType="audioplug" version="0.11.1"
bundleIdentifier="com.plainweave.JuceOPLVSTi" buildVST="1" buildAU="1" bundleIdentifier="com.plainweave.JuceOPL" buildVST="1" buildAU="0"
pluginName="JuceOPLVSTi" pluginDesc="JuceOPLVSTi" pluginManufacturer="Plainweave Software" pluginName="JuceOPL" pluginDesc="JuceOPL 64-bit" pluginManufacturer="Plainweave Software"
pluginManufacturerCode="Pwve" pluginCode="JOPL" pluginChannelConfigs="{0, 1}" pluginManufacturerCode="Pwve" pluginCode="JOPL" pluginChannelConfigs="{0, 1}"
pluginIsSynth="1" pluginWantsMidiIn="1" pluginProducesMidiOut="0" pluginIsSynth="1" pluginWantsMidiIn="1" pluginProducesMidiOut="0"
pluginSilenceInIsSilenceOut="0" pluginEditorRequiresKeys="0" pluginSilenceInIsSilenceOut="0" pluginEditorRequiresKeys="0"
pluginAUExportPrefix="JuceOPLVSTiAU" pluginRTASCategory="" aaxIdentifier="com.plainweave.JuceOPLVSTi" pluginAUExportPrefix="JuceOPL-AU" pluginRTASCategory="" aaxIdentifier="com.plainweave.JuceOPLVSTi"
pluginAAXCategory="AAX_ePlugInCategory_Dynamics" jucerVersion="3.1.0" pluginAAXCategory="AAX_ePlugInCategory_Dynamics" jucerVersion="3.1.0"
buildVST3="0" buildRTAS="0" buildAAX="0" includeBinaryInAppConfig="1"> buildVST3="0" buildRTAS="0" buildAAX="0" includeBinaryInAppConfig="1">
<MAINGROUP id="TOefyq" name="JuceOPLVSTi"> <MAINGROUP id="TOefyq" name="JuceOPL">
<GROUP id="{DCA755EB-7953-0641-E719-95C7850E5B2B}" name="Source"> <GROUP id="{DCA755EB-7953-0641-E719-95C7850E5B2B}" name="Source">
<FILE id="o0sULY" name="DROMultiplexer.cpp" compile="1" resource="0" <FILE id="V4Xg2N" name="JuceOPL_README.txt" compile="0" resource="1"
file="Source/DROMultiplexer.cpp"/> file="JuceOPL_README.txt"/>
<FILE id="cULQN7" name="DROMultiplexer.h" compile="0" resource="0" <GROUP id="{0A7415DD-1C4B-6ECE-F8C8-1830F22F3693}" name="added">
file="Source/DROMultiplexer.h"/> <FILE id="b9ci03" name="itoa.h" compile="0" resource="0" file="Source/itoa.h"/>
<FILE id="KRj0DZ" name="tests.cpp" compile="1" resource="0" file="Source/tests.cpp"/> <FILE id="zqVgdd" name="windows.h" compile="0" resource="0" file="Source/windows.h"/>
<FILE id="hjHmNq" name="zdopl.cpp" compile="1" resource="0" file="Source/zdopl.cpp"/> </GROUP>
<FILE id="TQyCKv" name="zdopl.h" compile="0" resource="0" file="Source/zdopl.h"/> <GROUP id="{5B100E11-BFF8-326B-F805-37178229BDAA}" name="introjucer">
<FILE id="LVSdHL" name="InstrumentLoader.h" compile="0" resource="0" <FILE id="SyIvF1" name="PluginGui.cpp" compile="1" resource="0" file="Source/PluginGui.cpp"/>
file="Source/InstrumentLoader.h"/> <FILE id="Phxzxb" name="PluginProcessor.cpp" compile="1" resource="0"
<FILE id="SX7G0u" name="SbiLoader.cpp" compile="1" resource="0" file="Source/SbiLoader.cpp"/> file="Source/PluginProcessor.cpp"/>
<FILE id="g2OCfO" name="SbiLoader.h" compile="0" resource="0" file="Source/SbiLoader.h"/> <FILE id="IvGocs" name="PluginProcessor.h" compile="0" resource="0"
<FILE id="CGPOGV" name="IntFloatParameter.cpp" compile="1" resource="0" file="Source/PluginProcessor.h"/>
file="Source/IntFloatParameter.cpp"/> <FILE id="a2DQGI" name="PluginGui.h" compile="0" resource="0" file="Source/PluginGui.h"/>
<FILE id="uAEGVV" name="IntFloatParameter.h" compile="0" resource="0" </GROUP>
file="Source/IntFloatParameter.h"/> <GROUP id="{04EB9715-F5C8-AD8A-9B89-2832B524778C}" name="modified">
<FILE id="GnuXsD" name="EnumFloatParameter.cpp" compile="1" resource="0" <FILE id="o0sULY" name="DROMultiplexer.cpp" compile="1" resource="0"
file="Source/EnumFloatParameter.cpp"/> file="Source/DROMultiplexer.cpp"/>
<FILE id="GQm1JF" name="EnumFloatParameter.h" compile="0" resource="0" <FILE id="cULQN7" name="DROMultiplexer.h" compile="0" resource="0"
file="Source/EnumFloatParameter.h"/> file="Source/DROMultiplexer.h"/>
<FILE id="cyDyMZ" name="FloatParameter.cpp" compile="1" resource="0" <FILE id="c6G4EF" name="config.h" compile="0" resource="0" file="Source/config.h"/>
file="Source/FloatParameter.cpp"/> <FILE id="hjHmNq" name="zdopl.cpp" compile="1" resource="0" file="Source/zdopl.cpp"/>
<FILE id="RwbIyF" name="FloatParameter.h" compile="0" resource="0" </GROUP>
file="Source/FloatParameter.h"/> <GROUP id="{6B1E4F6E-4D95-CAB5-DAD3-E894F5CA0730}" name="DOSBox">
<FILE id="SyIvF1" name="PluginGui.cpp" compile="1" resource="0" file="Source/PluginGui.cpp"/> <FILE id="BZFxoj" name="adlib.h" compile="0" resource="0" file="Source/adlib.h"/>
<FILE id="a2DQGI" name="PluginGui.h" compile="0" resource="0" file="Source/PluginGui.h"/> <FILE id="TnpE3r" name="dbopl.cpp" compile="1" resource="0" file="Source/dbopl.cpp"/>
<FILE id="BZFxoj" name="adlib.h" compile="0" resource="0" file="Source/adlib.h"/> <FILE id="r3zBZz" name="dbopl.h" compile="0" resource="0" file="Source/dbopl.h"/>
<FILE id="c6G4EF" name="config.h" compile="0" resource="0" file="Source/config.h"/> <FILE id="pXX3j1" name="dosbox.h" compile="0" resource="0" file="Source/dosbox.h"/>
<FILE id="TnpE3r" name="dbopl.cpp" compile="1" resource="0" file="Source/dbopl.cpp"/> <FILE id="TLHYVa" name="hardware.h" compile="0" resource="0" file="Source/hardware.h"/>
<FILE id="r3zBZz" name="dbopl.h" compile="0" resource="0" file="Source/dbopl.h"/> <FILE id="mZbr8b" name="inout.h" compile="0" resource="0" file="Source/inout.h"/>
<FILE id="pXX3j1" name="dosbox.h" compile="0" resource="0" file="Source/dosbox.h"/> <FILE id="ZBjR5F" name="logging.h" compile="0" resource="0" file="Source/logging.h"/>
<FILE id="TLHYVa" name="hardware.h" compile="0" resource="0" file="Source/hardware.h"/> <FILE id="KCyK6B" name="opl.h" compile="0" resource="0" file="Source/opl.h"/>
<FILE id="fZWteg" name="hiopl.cpp" compile="1" resource="0" file="Source/hiopl.cpp"/> <FILE id="t6cmDm" name="pic.h" compile="0" resource="0" file="Source/pic.h"/>
<FILE id="OiMwKI" name="hiopl.h" compile="0" resource="0" file="Source/hiopl.h"/> <FILE id="ep2XEF" name="setup.h" compile="0" resource="0" file="Source/setup.h"/>
<FILE id="mZbr8b" name="inout.h" compile="0" resource="0" file="Source/inout.h"/> <FILE id="aR7Eu7" name="mixer.h" compile="0" resource="0" file="Source/mixer.h"/>
<FILE id="ZBjR5F" name="logging.h" compile="0" resource="0" file="Source/logging.h"/> </GROUP>
<FILE id="aR7Eu7" name="mixer.h" compile="0" resource="0" file="Source/mixer.h"/> <FILE id="KRj0DZ" name="tests.cpp" compile="1" resource="0" file="Source/tests.cpp"/>
<FILE id="KCyK6B" name="opl.h" compile="0" resource="0" file="Source/opl.h"/> <FILE id="TQyCKv" name="zdopl.h" compile="0" resource="0" file="Source/zdopl.h"/>
<FILE id="t6cmDm" name="pic.h" compile="0" resource="0" file="Source/pic.h"/> <FILE id="LVSdHL" name="InstrumentLoader.h" compile="0" resource="0"
<FILE id="Phxzxb" name="PluginProcessor.cpp" compile="1" resource="0" file="Source/InstrumentLoader.h"/>
file="Source/PluginProcessor.cpp"/> <FILE id="SX7G0u" name="SbiLoader.cpp" compile="1" resource="0" file="Source/SbiLoader.cpp"/>
<FILE id="IvGocs" name="PluginProcessor.h" compile="0" resource="0" <FILE id="g2OCfO" name="SbiLoader.h" compile="0" resource="0" file="Source/SbiLoader.h"/>
file="Source/PluginProcessor.h"/> <FILE id="CGPOGV" name="IntFloatParameter.cpp" compile="1" resource="0"
<FILE id="ep2XEF" name="setup.h" compile="0" resource="0" file="Source/setup.h"/> file="Source/IntFloatParameter.cpp"/>
</GROUP> <FILE id="uAEGVV" name="IntFloatParameter.h" compile="0" resource="0"
</MAINGROUP> file="Source/IntFloatParameter.h"/>
<MODULES> <FILE id="GnuXsD" name="EnumFloatParameter.cpp" compile="1" resource="0"
<MODULES id="juce_audio_basics" showAllCode="1" useLocalCopy="1"/> file="Source/EnumFloatParameter.cpp"/>
<MODULES id="juce_audio_devices" showAllCode="1" useLocalCopy="1"/> <FILE id="GQm1JF" name="EnumFloatParameter.h" compile="0" resource="0"
<MODULES id="juce_audio_formats" showAllCode="1" useLocalCopy="1"/> file="Source/EnumFloatParameter.h"/>
<MODULES id="juce_audio_plugin_client" showAllCode="1" useLocalCopy="1"/> <FILE id="cyDyMZ" name="FloatParameter.cpp" compile="1" resource="0"
<MODULES id="juce_audio_processors" showAllCode="1" useLocalCopy="1"/> file="Source/FloatParameter.cpp"/>
<MODULES id="juce_core" showAllCode="1" useLocalCopy="1"/> <FILE id="RwbIyF" name="FloatParameter.h" compile="0" resource="0"
<MODULES id="juce_cryptography" showAllCode="1" useLocalCopy="1"/> file="Source/FloatParameter.h"/>
<MODULES id="juce_data_structures" showAllCode="1" useLocalCopy="1"/> <FILE id="fZWteg" name="hiopl.cpp" compile="1" resource="0" file="Source/hiopl.cpp"/>
<MODULES id="juce_events" showAllCode="1" useLocalCopy="1"/> <FILE id="OiMwKI" name="hiopl.h" compile="0" resource="0" file="Source/hiopl.h"/>
<MODULES id="juce_graphics" showAllCode="1" useLocalCopy="1"/> </GROUP>
<MODULES id="juce_gui_basics" showAllCode="1" useLocalCopy="1"/> </MAINGROUP>
<MODULES id="juce_gui_extra" showAllCode="1" useLocalCopy="1"/> <MODULES>
<MODULES id="juce_opengl" showAllCode="1" useLocalCopy="1"/> <MODULES id="juce_audio_basics" showAllCode="1" useLocalCopy="1"/>
<MODULES id="juce_video" showAllCode="1" useLocalCopy="1"/> <MODULES id="juce_audio_devices" showAllCode="1" useLocalCopy="1"/>
</MODULES> <MODULES id="juce_audio_formats" showAllCode="1" useLocalCopy="1"/>
<JUCEOPTIONS JUCE_QUICKTIME="disabled"/> <MODULES id="juce_audio_plugin_client" showAllCode="1" useLocalCopy="1"/>
<EXPORTFORMATS> <MODULES id="juce_audio_processors" showAllCode="1" useLocalCopy="1"/>
<VS2013 targetFolder="Builds/VisualStudio2013" vstFolder="C:\code\audio\vstsdk2.4" <MODULES id="juce_core" showAllCode="1" useLocalCopy="1"/>
externalLibraries="" toolset="v120_xp"> <MODULES id="juce_cryptography" showAllCode="1" useLocalCopy="1"/>
<CONFIGURATIONS> <MODULES id="juce_data_structures" showAllCode="1" useLocalCopy="1"/>
<CONFIGURATION name="Debug" winWarningLevel="4" generateManifest="1" winArchitecture="32-bit" <MODULES id="juce_events" showAllCode="1" useLocalCopy="1"/>
isDebug="1" optimisation="1" targetName="JuceOPLVSTi"/> <MODULES id="juce_graphics" showAllCode="1" useLocalCopy="1"/>
<CONFIGURATION name="Release - 64-bit" winWarningLevel="4" generateManifest="1" <MODULES id="juce_gui_basics" showAllCode="1" useLocalCopy="1"/>
winArchitecture="x64" isDebug="0" optimisation="3" targetName="JuceOPLVSTi"/> <MODULES id="juce_gui_extra" showAllCode="1" useLocalCopy="1"/>
<CONFIGURATION name="Release - 32-bit" winWarningLevel="4" generateManifest="1" <MODULES id="juce_opengl" showAllCode="1" useLocalCopy="1"/>
winArchitecture="32-bit" isDebug="0" optimisation="3" targetName="JuceOPLVSTi"/> <MODULES id="juce_video" showAllCode="1" useLocalCopy="1"/>
</CONFIGURATIONS> </MODULES>
<MODULEPATHS> <JUCEOPTIONS JUCE_QUICKTIME="disabled"/>
<MODULEPATH id="juce_audio_basics" path="../Juce/modules"/> <EXPORTFORMATS>
<MODULEPATH id="juce_audio_devices" path="../Juce/modules"/> <VS2013 targetFolder="Builds/VisualStudio2013" vstFolder="C:\code\audio\vstsdk2.4"
<MODULEPATH id="juce_audio_formats" path="../Juce/modules"/> externalLibraries="" toolset="v120_xp">
<MODULEPATH id="juce_audio_plugin_client" path="../Juce/modules"/> <CONFIGURATIONS>
<MODULEPATH id="juce_audio_processors" path="../Juce/modules"/> <CONFIGURATION name="Debug" winWarningLevel="4" generateManifest="1" winArchitecture="32-bit"
<MODULEPATH id="juce_core" path="../Juce/modules"/> isDebug="1" optimisation="1" targetName="JuceOPLVSTi"/>
<MODULEPATH id="juce_cryptography" path="../Juce/modules"/> <CONFIGURATION name="Release - 64-bit" winWarningLevel="4" generateManifest="1"
<MODULEPATH id="juce_data_structures" path="../Juce/modules"/> winArchitecture="x64" isDebug="0" optimisation="3" targetName="JuceOPLVSTi"/>
<MODULEPATH id="juce_events" path="../Juce/modules"/> <CONFIGURATION name="Release - 32-bit" winWarningLevel="4" generateManifest="1"
<MODULEPATH id="juce_graphics" path="../Juce/modules"/> winArchitecture="32-bit" isDebug="0" optimisation="3" targetName="JuceOPLVSTi"/>
<MODULEPATH id="juce_gui_basics" path="../Juce/modules"/> </CONFIGURATIONS>
<MODULEPATH id="juce_gui_extra" path="../Juce/modules"/> <MODULEPATHS>
<MODULEPATH id="juce_opengl" path="../Juce/modules"/> <MODULEPATH id="juce_audio_basics" path="../Juce/modules"/>
<MODULEPATH id="juce_video" path="../Juce/modules"/> <MODULEPATH id="juce_audio_devices" path="../Juce/modules"/>
</MODULEPATHS> <MODULEPATH id="juce_audio_formats" path="../Juce/modules"/>
</VS2013> <MODULEPATH id="juce_audio_plugin_client" path="../Juce/modules"/>
</EXPORTFORMATS> <MODULEPATH id="juce_audio_processors" path="../Juce/modules"/>
</JUCERPROJECT> <MODULEPATH id="juce_core" path="../Juce/modules"/>
<MODULEPATH id="juce_cryptography" path="../Juce/modules"/>
<MODULEPATH id="juce_data_structures" path="../Juce/modules"/>
<MODULEPATH id="juce_events" path="../Juce/modules"/>
<MODULEPATH id="juce_graphics" path="../Juce/modules"/>
<MODULEPATH id="juce_gui_basics" path="../Juce/modules"/>
<MODULEPATH id="juce_gui_extra" path="../Juce/modules"/>
<MODULEPATH id="juce_opengl" path="../Juce/modules"/>
<MODULEPATH id="juce_video" path="../Juce/modules"/>
</MODULEPATHS>
</VS2013>
<XCODE_MAC targetFolder="Builds/MacOSX" vstFolder="~/SDKs/vstsdk2.4" postbuildCommand="&#13;&#10;# This script takes the build product and copies it to the AU, VST, VST3, RTAS and AAX folders, depending on &#13;&#10;# which plugin types you've built&#13;&#10;&#13;&#10;original=$CONFIGURATION_BUILD_DIR/$FULL_PRODUCT_NAME&#13;&#10;&#13;&#10;# this looks inside the binary to detect which platforms are needed.. &#13;&#10;copyAU=&#96;nm -g &quot;$CONFIGURATION_BUILD_DIR/$EXECUTABLE_PATH&quot; | grep -i 'AudioUnit' | wc -l&#96;&#13;&#10;copyVST=&#96;nm -g &quot;$CONFIGURATION_BUILD_DIR/$EXECUTABLE_PATH&quot; | grep -i 'VSTPlugin' | wc -l&#96;&#13;&#10;copyVST3=&#96;nm -g &quot;$CONFIGURATION_BUILD_DIR/$EXECUTABLE_PATH&quot; | grep -i 'GetPluginFactory' | wc -l&#96;&#13;&#10;copyRTAS=&#96;nm -g &quot;$CONFIGURATION_BUILD_DIR/$EXECUTABLE_PATH&quot; | grep -i 'CProcess' | wc -l&#96;&#13;&#10;copyAAX=&#96;nm -g &quot;$CONFIGURATION_BUILD_DIR/$EXECUTABLE_PATH&quot; | grep -i 'ACFStartup' | wc -l&#96;&#13;&#10;&#13;&#10;if [ $copyAU -gt 0 ]; then&#13;&#10; echo &quot;Copying to AudioUnit folder...&quot;&#13;&#10; AU=~/Library/Audio/Plug-Ins/Components/$PRODUCT_NAME.component&#13;&#10; if [ -d &quot;$AU&quot; ]; then &#13;&#10; rm -r &quot;$AU&quot;&#13;&#10; fi&#13;&#10;&#13;&#10; cp -r &quot;$original&quot; &quot;$AU&quot;&#13;&#10; sed -i &quot;&quot; -e 's/TDMwPTul/BNDLPTul/g' &quot;$AU/Contents/PkgInfo&quot;&#13;&#10; sed -i &quot;&quot; -e 's/TDMw/BNDL/g' &quot;$AU/Contents/$INFOPLIST_FILE&quot;&#13;&#10;&#13;&#10; # Fix info.plist for AUs built with Xcode 3&#13;&#10; if [ -f &quot;$DEVELOPER_DIR/Library/Developer/CoreAudio/AudioUnits/AUPublic/AUBase/AUPlugInDispatch.cpp&quot; ]; then&#13;&#10; echo&#13;&#10; else&#13;&#10; echo &quot;Removing AudioComponents entry from Info.plist because this is not a new-format AU&quot;&#13;&#10; /usr/libexec/PlistBuddy -c &quot;Delete AudioComponents&quot; &quot;$AU/Contents/Info.plist&quot;&#13;&#10; fi&#13;&#10;fi&#13;&#10;&#13;&#10;if [ $copyVST -gt 0 ]; then&#13;&#10; echo &quot;Copying to VST folder...&quot;&#13;&#10; VST=~/Library/Audio/Plug-Ins/VST/$PRODUCT_NAME.vst&#13;&#10; if [ -d &quot;$VST&quot; ]; then &#13;&#10; rm -r &quot;$VST&quot;&#13;&#10; fi&#13;&#10;&#13;&#10; cp -r &quot;$original&quot; &quot;$VST&quot;&#13;&#10; sed -i &quot;&quot; -e 's/TDMwPTul/BNDLPTul/g' &quot;$VST/Contents/PkgInfo&quot;&#13;&#10; sed -i &quot;&quot; -e 's/TDMw/BNDL/g' &quot;$VST/Contents/$INFOPLIST_FILE&quot;&#13;&#10;fi&#13;&#10;&#13;&#10;if [ $copyVST3 -gt 0 ]; then&#13;&#10; echo &quot;Copying to VST3 folder...&quot;&#13;&#10; VST3=~/Library/Audio/Plug-Ins/VST3/$PRODUCT_NAME.vst3&#13;&#10; if [ -d &quot;$VST3&quot; ]; then &#13;&#10; rm -r &quot;$VST3&quot;&#13;&#10; fi&#13;&#10;&#13;&#10; cp -r &quot;$original&quot; &quot;$VST3&quot;&#13;&#10; sed -i &quot;&quot; -e 's/TDMwPTul/BNDLPTul/g' &quot;$VST3/Contents/PkgInfo&quot;&#13;&#10; sed -i &quot;&quot; -e 's/TDMw/BNDL/g' &quot;$VST3/Contents/$INFOPLIST_FILE&quot;&#13;&#10;fi&#13;&#10;&#13;&#10;if [ $copyRTAS -gt 0 ]; then&#13;&#10; echo &quot;Copying to RTAS folder...&quot;&#13;&#10; RTAS=/Library/Application\ Support/Digidesign/Plug-Ins/$PRODUCT_NAME.dpm&#13;&#10; if [ -d &quot;$RTAS&quot; ]; then&#13;&#10; rm -r &quot;$RTAS&quot;&#13;&#10; fi&#13;&#10;&#13;&#10; cp -r &quot;$original&quot; &quot;$RTAS&quot;&#13;&#10;fi&#13;&#10;&#13;&#10;if [ $copyAAX -gt 0 ]; then&#13;&#10; echo &quot;Copying to AAX folder...&quot;&#13;&#10;&#13;&#10; if [ -d &quot;/Applications/ProTools_3PDev/Plug-Ins&quot; ]; then&#13;&#10; AAX1=&quot;/Applications/ProTools_3PDev/Plug-Ins/$PRODUCT_NAME.aaxplugin&quot;&#13;&#10;&#13;&#10; if [ -d &quot;$AAX1&quot; ]; then&#13;&#10; rm -r &quot;$AAX1&quot;&#13;&#10; fi&#13;&#10;&#13;&#10; cp -R -H &quot;$original&quot; &quot;$AAX1&quot;&#13;&#10; fi&#13;&#10;&#13;&#10; if [ -d &quot;/Library/Application Support/Avid/Audio/Plug-Ins&quot; ]; then&#13;&#10; AAX2=&quot;/Library/Application Support/Avid/Audio/Plug-Ins/$PRODUCT_NAME.aaxplugin&quot;&#13;&#10;&#13;&#10; if [ -d &quot;$AAX2&quot; ]; then&#13;&#10; rm -r &quot;$AAX2&quot;&#13;&#10; fi&#13;&#10;&#13;&#10; cp -R -H &quot;$original&quot; &quot;$AAX2&quot;&#13;&#10; fi&#13;&#10;fi&#13;&#10;">
<CONFIGURATIONS>
<CONFIGURATION name="Debug" osxSDK="default" osxCompatibility="default" osxArchitecture="default"
isDebug="1" optimisation="1" targetName="JuceOPL"/>
<CONFIGURATION name="Release" osxSDK="default" osxCompatibility="default" osxArchitecture="64BitIntel"
isDebug="0" optimisation="2" targetName="JuceOPL" cppLibType="libc++"/>
</CONFIGURATIONS>
<MODULEPATHS>
<MODULEPATH id="juce_video" path="../../juce"/>
<MODULEPATH id="juce_opengl" path="../../juce"/>
<MODULEPATH id="juce_gui_extra" path="../../juce"/>
<MODULEPATH id="juce_gui_basics" path="../../juce"/>
<MODULEPATH id="juce_graphics" path="../../juce"/>
<MODULEPATH id="juce_events" path="../../juce"/>
<MODULEPATH id="juce_data_structures" path="../../juce"/>
<MODULEPATH id="juce_cryptography" path="../../juce"/>
<MODULEPATH id="juce_core" path="../../juce"/>
<MODULEPATH id="juce_audio_processors" path="../../juce"/>
<MODULEPATH id="juce_audio_plugin_client" path="../../juce"/>
<MODULEPATH id="juce_audio_formats" path="../../juce"/>
<MODULEPATH id="juce_audio_devices" path="../../juce"/>
<MODULEPATH id="juce_audio_basics" path="../../juce"/>
</MODULEPATHS>
</XCODE_MAC>
</EXPORTFORMATS>
</JUCERPROJECT>

View file

@ -1,7 +1,17 @@
#include "DROMultiplexer.h" #include "DROMultiplexer.h"
#include "JuceHeader.h" #include "JuceHeader.h"
#include <Windows.h>
/// Jeff-Russ added guard against windows.h include if not windows:
#ifdef _WIN32 // covers both 32 and 64-bit
#include <Windows.h>
#else
#include "windows.h"
#endif
/// Jeff-Russ added to replace mising itoa for xcode:
#if __APPLE__
#include "itoa.h"
#endif
// Used by the first recording instance to claim master status // Used by the first recording instance to claim master status
DROMultiplexer* DROMultiplexer::master = NULL; DROMultiplexer* DROMultiplexer::master = NULL;
@ -186,7 +196,7 @@ void DROMultiplexer::TwoOpMelodicNoteOn(Hiopl* opl, int inCh) {
char addr[16]; char addr[16];
int outCh = _FindFreeChannel(opl, inCh); int outCh = _FindFreeChannel(opl, inCh);
_DebugOut(" <- "); _DebugOut(" <- ");
_DebugOut(itoa((int)opl, addr, 16)); /// _DebugOut(itoa((int)opl, addr, 16));
_DebugOut(" "); _DebugOut(" ");
for (int i = 0; i < MELODIC_CHANNELS; i++) { for (int i = 0; i < MELODIC_CHANNELS; i++) {
Hiopl* tmpOpl = channels[i].opl; Hiopl* tmpOpl = channels[i].opl;

View file

@ -45,7 +45,7 @@ public:
//============================================================================== //==============================================================================
const String getName() const; const String getName() const;
static const int JuceOplvstiAudioProcessor::MAX_INSTRUMENT_FILE_SIZE_BYTES = 1024; static const int MAX_INSTRUMENT_FILE_SIZE_BYTES = 1024;
int getNumParameters(); int getNumParameters();

View file

@ -63,20 +63,36 @@
#pragma warning(disable : 4996) #pragma warning(disable : 4996)
#endif #endif
#ifndef WIN32 /// Jeff-Russ modified to be uniform across C++ implementations:
typedef long long __int64; // The internal types:
#include <stdint.h>
typedef unsigned char BYTE;
typedef int64_t __int64;
typedef double Real64;
typedef unsigned char Bit8u;
typedef signed char Bit8s;
typedef uint16_t Bit16u;
typedef int16_t Bit16s;
typedef uint32_t Bit32u;
typedef int32_t Bit32s;
typedef int64_t Bit64u;
typedef uint64_t Bit64s;
typedef Bit32u Bitu;
typedef Bit32s Bits;
/// Jeff-Russ PUT PLATFORM SPECIFIC STUFF HERE:
#ifdef _WIN32 // covers both 32 and 64-bit
#define INLINE __forceinline
#elif __APPLE__
#include "TargetConditionals.h"
#define INLINE inline /// apple has no forceinline
#elif __linux
#define INLINE inline
#elif __unix
#define INLINE inline
#elif __posix
#define INLINE inline
#else
#error Unsupported Operating System
#endif #endif
typedef double Real64;
/* The internal types */
typedef unsigned char Bit8u;
typedef signed char Bit8s;
typedef unsigned short Bit16u;
typedef signed short Bit16s;
typedef unsigned long Bit32u;
typedef signed long Bit32s;
typedef unsigned __int64 Bit64u;
typedef signed __int64 Bit64s;
typedef unsigned int Bitu;
typedef signed int Bits;

View file

@ -1,92 +1,92 @@
#pragma once #pragma once
#include <map> #include <map>
#include "adlib.h" #include "adlib.h"
#include "dbopl.h" #include "dbopl.h"
#include "zdopl.h" #include "zdopl.h"
enum Waveform enum Waveform
{ {
SIN = 0, HALF_SIN = 1, ABS_SIN = 2, QUART_SIN = 3 SIN = 0, HALF_SIN = 1, ABS_SIN = 2, QUART_SIN = 3
}; };
enum FreqMultiple enum FreqMultiple
{ {
xHALF=0, x1=1, x2=2, x3=3, x4=4, x5=5, x6=6, x7=7, x8=8, x9=9, x10=10, x12=12, x15=15 xHALF=0, x1=1, x2=2, x3=3, x4=4, x5=5, x6=6, x7=7, x8=8, x9=9, x10=10, x12=12, x15=15
}; };
enum Emulator enum Emulator
{ {
DOSBOX=0, ZDOOM=1 DOSBOX=0, ZDOOM=1
}; };
enum Drum enum Drum
{ {
BDRUM=0x10, SNARE=0x8, TOM=0x4, CYMBAL=0x2, HIHAT=0x1 BDRUM=0x10, SNARE=0x8, TOM=0x4, CYMBAL=0x2, HIHAT=0x1
}; };
class Hiopl { class Hiopl {
public: public:
static const int CHANNELS = 9; static const int CHANNELS = 9;
static const int OSCILLATORS = 2; static const int OSCILLATORS = 2;
Hiopl(int buflen, Emulator emulator = ZDOOM); Hiopl(int buflen, Emulator emulator = ZDOOM);
void SetEmulator(Emulator emulator); void SetEmulator(Emulator emulator);
void SetPercussionMode(bool enable); void SetPercussionMode(bool enable);
void HitPercussion(Drum drum); void HitPercussion(Drum drum);
void ReleasePercussion(); void ReleasePercussion();
void Generate(int length, short* buffer); void Generate(int length, short* buffer);
void Generate(int length, float* buffer); void Generate(int length, float* buffer);
void SetSampleRate(int hz); void SetSampleRate(int hz);
void EnableWaveformControl(); void EnableWaveformControl();
void EnableOpl3Mode(); void EnableOpl3Mode();
void EnableTremolo(int ch, int osc, bool enable); void EnableTremolo(int ch, int osc, bool enable);
void EnableVibrato(int ch, int osc, bool enable); void EnableVibrato(int ch, int osc, bool enable);
void VibratoDepth(bool high); void VibratoDepth(bool high);
void TremoloDepth(bool high); void TremoloDepth(bool high);
void EnableSustain(int ch, int osc, bool enable); void EnableSustain(int ch, int osc, bool enable);
void EnableKsr(int ch, int osc, bool enable); void EnableKsr(int ch, int osc, bool enable);
// true = additive; false = frequency modulation // true = additive; false = frequency modulation
void EnableAdditiveSynthesis(int ch, bool enable); void EnableAdditiveSynthesis(int ch, bool enable);
void SetWaveform(int ch, int osc, Waveform wave); void SetWaveform(int ch, int osc, Waveform wave);
void SetAttenuation(int ch, int osc, int level); void SetAttenuation(int ch, int osc, int level);
void SetKsl(int ch, int osc, int level); void SetKsl(int ch, int osc, int level);
void SetFrequencyMultiple(int ch, int osc, FreqMultiple mult); void SetFrequencyMultiple(int ch, int osc, FreqMultiple mult);
void SetEnvelopeAttack(int ch, int osc, int t); void SetEnvelopeAttack(int ch, int osc, int t);
void SetEnvelopeDecay(int ch, int osc, int t); void SetEnvelopeDecay(int ch, int osc, int t);
void SetEnvelopeSustain(int ch, int osc, int level); void SetEnvelopeSustain(int ch, int osc, int level);
void SetEnvelopeRelease(int ch, int osc, int t); void SetEnvelopeRelease(int ch, int osc, int t);
// Get register address offset for operator settings for the specified channel and operator. // Get register address offset for operator settings for the specified channel and operator.
int _GetOffset(int ch, int osc); int _GetOffset(int ch, int osc);
// Get register address offset for channel-wide register settings for the specified channel. // Get register address offset for channel-wide register settings for the specified channel.
int _GetOffset(int ch); int _GetOffset(int ch);
void SetModulatorFeedback(int ch, int level); void SetModulatorFeedback(int ch, int level);
void KeyOn(int ch, float frqHz); void KeyOn(int ch, float frqHz);
void KeyOff(int ch); void KeyOff(int ch);
// Return false if no note is active on the channel (ie release is complete) // Return false if no note is active on the channel (ie release is complete)
bool IsActive(int ch); bool IsActive(int ch);
// Return a single character string representing the stage of the envelope for the carrier operator for the channel // Return a single character string representing the stage of the envelope for the carrier operator for the channel
const char* GetState(int ch) const; const char* GetState(int ch) const;
void SetFrequency(int ch, float frqHz, bool keyOn=false); void SetFrequency(int ch, float frqHz, bool keyOn=false);
void _WriteReg(Bit32u reg, Bit8u value, Bit8u mask=0x0); void _WriteReg(Bit32u reg, Bit8u value, Bit8u mask=0x0);
void _ClearRegBits(Bit32u reg, Bit8u mask); void _ClearRegBits(Bit32u reg, Bit8u mask);
// Read the last value written to the specified register address (cached) // Read the last value written to the specified register address (cached)
Bit8u _ReadReg(Bit32u reg); Bit8u _ReadReg(Bit32u reg);
~Hiopl(); ~Hiopl();
private: private:
Emulator emulator; Emulator emulator;
DBOPL::Handler *adlib; DBOPL::Handler *adlib;
OPLEmul *zdoom; OPLEmul *zdoom;
Bit8u regCache[256]; Bit8u regCache[256];
bool _CheckParams(int ch, int osc); bool _CheckParams(int ch, int osc);
void _milliHertzToFnum(unsigned int milliHertz, unsigned int *fnum, unsigned int *block, unsigned int conversionFactor=49716); void _milliHertzToFnum(unsigned int milliHertz, unsigned int *fnum, unsigned int *block, unsigned int conversionFactor=49716);
void _ClearRegisters(); void _ClearRegisters();
std::map<int, int> _op1offset; std::map<int, int> _op1offset;
std::map<int, int> _op2offset; std::map<int, int> _op2offset;
}; };

50
Source/itoa.h Normal file
View file

@ -0,0 +1,50 @@
///=============================================================================
/// itoa.h - A C++ header to implement itoa()
/// Created: 11 Feb 2015 5:08:51pm
/// Author: Jeff-Russ
///=============================================================================
#pragma once
#include <iostream>
using namespace std;
// A utility function to reverse a string:
void reverse(char str[], int length)
{
int start = 0;
int end = length -1;
while (start < end)
{ swap(*(str+start), *(str+end));
start++;
end--;
}
};
char* itoa(int num, char* str, int base)
{
int i = 0;
bool isNegative = false;
if (num == 0) // Handle 0 explicitly, otherwise
{ str[i++] = '0'; // empty string is printed for 0
str[i] = '\0';
return str;
}
// In standard itoa(), negative
if (num < 0 && base == 10) // numbers are handled only with
{ isNegative = true; // base 10. Otherwise numbers
num = -num; // are considered unsigned.
}
while (num != 0)
{ int rem = num % base; // Process individual digits
str[i++] = (rem > 9)? (rem-10) + 'a' : rem + '0';
num = num/base;
}
if (isNegative) // If number is negative, append '-'
str[i++] = '-';
str[i] = '\0'; // Append string terminator
reverse(str, i); // Reverse the string
return str;
};

85
Source/windows.h Normal file
View file

@ -0,0 +1,85 @@
///=============================================================================
/// windows.h - as needed re-definition of windows.h functions for non-win
/// Created: 11 Feb 2015 5:08:51pm
/// Author: Jeff-Russ
///=============================================================================
#pragma once
#include <stdint.h>
// PVOID - A pointer to any type.
// This type is declared in WinNT.h as follows:
typedef void* PVOID;
// DWORDLONG A 64-bit unsigned integer.
// This type is declared in IntSafe.h as follows:
typedef uint64_t DWORDLONG;
#define WINAPI
// DWORD - A 32-bit unsigned integer.
// This type is declared in IntSafe.h as follows:
typedef uint32_t DWORD;
// WCHAR - A 16-bit unicode character
// This type is declared in WinNT.h as follows:
typedef int16_t WCHAR;
// HANDLE - A handle to an object.
// This type is declared in WinDef.h as follows:
typedef PVOID HANDLE;
DWORD STD_INPUT_HANDLE = -10;
DWORD STD_OUTPUT_HANDLE = -11;
DWORD STD_ERROR_HANDLE = -12;
#define MAX_PATH PATH_MAX
// BYTE - A byte (8-bits)
// This type is declared in WinDef.h as follows:
typedef unsigned char BYTE;
// WORD - A 16-bit unsigned integer.
// This type is declared in WinDef.h as follows:
typedef uint16_t WORD;
// BOOL - A boolean variable
// This type is declared in WinDef.h as follows:
typedef BYTE BOOL;
DWORD GetStdHandle (DWORD handle) { return handle; }
void WriteConsole(DWORD conout,const char* strPtr,
DWORD count, DWORD* countAdr, int* nul)
{
std::string msgType = "NOTICE: ";
if (conout == -10)
msgType = "INPUT: ";
else if (conout == -11)
msgType = "OUTPUT: ";
else if (conout == -12)
msgType = "ERROR: ";
else
msgType = "NOTICE: ";
std::string message (const char* str, uint32_t count);
std::cout << std::endl << msgType << message;
}
void AllocConsole()
{
std::cout << std::endl << "=== Starting debug console....." << std::endl;
}
void FreeConsole()
{
std::cout << std::endl << "=== Exited debug console ===" << std::endl;
}

View file

@ -46,9 +46,15 @@
#include <math.h> #include <math.h>
#include <string.h> #include <string.h>
#include <limits> #include <limits>
#include <cstdlib> /// Jeff-Russ added to get rand() and RAND_MAX
/*typedef unsigned __int8 BYTE;*/ /// Jeff changed to char and put in config.h
#ifndef M_PI /// Jeff-Russ added condition to silence xcode warning
#define M_PI 3.141592654
#endif
typedef unsigned __int8 BYTE;
#define M_PI 3.141592654
#include "config.h" #include "config.h"
#include "zdopl.h" #include "zdopl.h"