diff --git a/tools/faust2appls/faust2dplug b/tools/faust2appls/faust2dplug index 8d9c014b22..1190a2b320 100644 --- a/tools/faust2appls/faust2dplug +++ b/tools/faust2appls/faust2dplug @@ -13,13 +13,13 @@ DEBUG=false -IS_SYNTH="0" +# MIDI not yet supported in this file. Needs to be connected in minimal-dplug.d architecture file IS_MIDI="0" -FAUSTFLOAT="float" VENDOR="Faust" VENDORID="FaUs" PLUGINID="PlUg" HOMEPAGE="https://faust.grame.fr/" +EFFECTTYPE="effectOther" while [ $1 ] do @@ -29,6 +29,12 @@ do usage faust2dplug "[options] [Faust options] " require Dplug echo "Compiles Faust programs to Dplug plugins." + option + options "-vendor " + options "-vendorid " + options "-pluginid " + options "-homepage " + options "-effectType " exit fi @@ -36,11 +42,21 @@ do DEBUG=true elif [ $p = "-midi" ]; then IS_MIDI="1" - elif [ ${p:0:1} = "-" ]; then - if [ $p = "-double" ]; then - FAUSTFLOAT="double" - fi - OPTIONS="$OPTIONS $p" + elif [ $p = "-vendor" ]; then + shift + VENDOR=$1 + elif [ $p = "-vendorid" ]; then + shift + VENDORID=$1 + elif [ $p = "-pluginid" ]; then + shift + PLUGINID=$1 + elif [ $p = "-homepage" ]; then + shift + HOMEPAGE=$1 + elif [ $p = "-effectType" ]; then + shift + EFFECTTYPE=$1 elif [[ -f "$p" ]]; then FILES="$FILES $p" else @@ -51,6 +67,11 @@ shift done +if [ $IS_MIDI -eq 1 ]; then + echo "MIDI not currently supported in Dplug architecture file." + exit +fi + DUBFILE="dub.json" PLUGFILE="plugin.json" @@ -67,111 +88,111 @@ for p in $FILES; do mkdir $SRCDIR/$dspName mkdir $SRCDIR/$dspName/source - sed -e"s?@vendor@?$VENDOR?g" -e"s?@vendorid@?$VENDORID?g" -e"s?@name@?$dspName?g" -e"s?@plugid@?$PLUGINID?g" -e"s?@homepage@?$HOMEPAGE?g" > $SRCDIR/$dspName/$PLUGFILE < $SRCDIR/$dspName/$PLUGFILE < $SRCDIR/$dspName/$DUBFILE <MAJOR.MINOR ", + " Example: ~>7.0 ", + " See also the DUB documentation: ", + " https://code.dlang.org/package-format?lang=json#version-specs "], + "dependencies": { - "\$schema": "https://raw.githubusercontent.com/Pure-D/code-d/master/json-validation/dub.schema.json", - - "name": "@name@", - - "license": "public domain", - "importPaths": [ "." ], - "sourcePaths": [ "." ], - "stringImportPaths": ["gfx", "fonts", "."], - - "copyright": "none", - - "dflags-linux-dmd": ["-defaultlib=libphobos2.a"], - "dflags-osx-ldc": ["-static"], - "dflags-linux-ldc": ["-link-defaultlib-shared=false"], - "dflags-linux-x86_64-ldc": ["-fvisibility=hidden"], - "dflags-windows-ldc": ["-mscrtlib=libcmt"], - - "comment-WARNING-READ-THIS-IS-IMPORTANT": [ - " When making your own plug-in you have to CHANGE THESE DEPENDENCY ", - " SPECIFICATIONS below from path-based to ~>MAJOR.MINOR ", - " Example: ~>7.0 ", - " See also the DUB documentation: ", - " https://code.dlang.org/package-format?lang=json#version-specs "], - "dependencies": + "dplug:dsp": "~>10", + "dplug:vst3": "~>10", + "dplug:vst": "~>10", + "dplug:au": "~>10", + "dplug:lv2": "~>10", + "dplug:gui": "~>10", + "dplug:pbr-widgets": "~>10" + }, + + "versions": ["futureMouseOver", "futurePBRNormals"], + + "configurations": [ { - "dplug:dsp": "~>10", - "dplug:vst3": "~>10", - "dplug:vst": "~>10", - "dplug:au": "~>10", - "dplug:lv2": "~>10", - "dplug:gui": "~>10", - "dplug:pbr-widgets": "~>10" + "name": "VST3", + "versions": ["VST3"], + "targetType": "dynamicLibrary", + "lflags-osx-ldc": [ "-exported_symbols_list", "module-vst3.lst", "-dead_strip" ] }, - - "versions": ["futureMouseOver", "futurePBRNormals"], - - "configurations": [ - { - "name": "VST3", - "versions": ["VST3"], - "targetType": "dynamicLibrary", - "lflags-osx-ldc": [ "-exported_symbols_list", "module-vst3.lst", "-dead_strip" ] - }, - { - "name": "VST", - "versions": ["VST"], - "targetType": "dynamicLibrary", - "lflags-osx-ldc": [ "-exported_symbols_list", "module-vst.lst", "-dead_strip" ] - }, - { - "name": "AU", - "versions": ["AU"], - "targetType": "dynamicLibrary", - "lflags-osx-ldc": [ "-exported_symbols_list", "module-au.lst", "-dead_strip" ] - }, - { - "name": "LV2", - "versions": ["LV2"], - "targetType": "dynamicLibrary", - "lflags-osx-ldc": [ "-exported_symbols_list", "module-lv2.lst", "-dead_strip" ] - } - ] - } + { + "name": "VST", + "versions": ["VST"], + "targetType": "dynamicLibrary", + "lflags-osx-ldc": [ "-exported_symbols_list", "module-vst.lst", "-dead_strip" ] + }, + { + "name": "AU", + "versions": ["AU"], + "targetType": "dynamicLibrary", + "lflags-osx-ldc": [ "-exported_symbols_list", "module-au.lst", "-dead_strip" ] + }, + { + "name": "LV2", + "versions": ["LV2"], + "targetType": "dynamicLibrary", + "lflags-osx-ldc": [ "-exported_symbols_list", "module-lv2.lst", "-dead_strip" ] + } + ] +} EOF cat > $SRCDIR/$dspName/module-au.lst << EndOfFile - _dplugAUEntryPoint - _dplugAUComponentFactoryFunction +_dplugAUEntryPoint +_dplugAUComponentFactoryFunction EndOfFile cat > $SRCDIR/$dspName/module-lv2.lst << EndOfFile - _GenerateManifestFromClient - _lv2_descriptor - _lv2ui_descriptor +_GenerateManifestFromClient +_lv2_descriptor +_lv2ui_descriptor EndOfFile cat > $SRCDIR/$dspName/module-vst3.lst << EndOfFile - _InitDll - _ExitDll - _GetPluginFactory - _bundleEntry - _bundleExit +_InitDll +_ExitDll +_GetPluginFactory +_bundleEntry +_bundleExit EndOfFile