From 465c1334bdedebf164d246865d7c5edf2252e3e0 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Wed, 15 Dec 2021 22:43:37 +0100 Subject: [PATCH] [DEV] integrate GLD --- .gitignore | 5 + GLD_audio-orchestra.json | 174 ++++++++++++++++++++++ command_generateAddJavaSectionInClass.py | 63 ++++++++ lutin_audio-orchestra.py | 182 ----------------------- tools/GLD_orchestra-in.json | 20 +++ tools/GLD_orchestra-list.json | 20 +++ tools/GLD_orchestra-out.json | 20 +++ tools/lutin_orchestra-in.py | 37 ----- tools/lutin_orchestra-list.py | 37 ----- tools/lutin_orchestra-out.py | 37 ----- 10 files changed, 302 insertions(+), 293 deletions(-) create mode 100644 GLD_audio-orchestra.json create mode 100644 command_generateAddJavaSectionInClass.py delete mode 100644 lutin_audio-orchestra.py create mode 100644 tools/GLD_orchestra-in.json create mode 100644 tools/GLD_orchestra-list.json create mode 100644 tools/GLD_orchestra-out.json delete mode 100644 tools/lutin_orchestra-in.py delete mode 100644 tools/lutin_orchestra-list.py delete mode 100644 tools/lutin_orchestra-out.py diff --git a/.gitignore b/.gitignore index b08d134..a01c9de 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,8 @@ +__pycache__ +.bck +out +target +build ################################### # folders diff --git a/GLD_audio-orchestra.json b/GLD_audio-orchestra.json new file mode 100644 index 0000000..c36fc79 --- /dev/null +++ b/GLD_audio-orchestra.json @@ -0,0 +1,174 @@ +{ + "type":"LIBRARY", + "group-id":"com.atria-soft", + "description":"Generic wrapper on all audio interface", + "license":"MPL-2", + "license-file":"file://LICENSE", + "maintainer":"file://authors.txt", + "author":"file://authors.txt", + "version":"file://version.txt", + "code-quality":"MEDIUM", + + "source": [ + "audio/orchestra/debug.cpp", + "audio/orchestra/status.cpp", + "audio/orchestra/type.cpp", + "audio/orchestra/mode.cpp", + "audio/orchestra/state.cpp", + "audio/orchestra/error.cpp", + "audio/orchestra/base.cpp", + "audio/orchestra/Interface.cpp", + "audio/orchestra/Flags.cpp", + "audio/orchestra/Api.cpp", + "audio/orchestra/DeviceInfo.cpp", + "audio/orchestra/StreamOptions.cpp", + "audio/orchestra/api/Dummy.cpp" + ], + "header": [ + "audio/orchestra/debug.hpp", + "audio/orchestra/status.hpp", + "audio/orchestra/type.hpp", + "audio/orchestra/mode.hpp", + "audio/orchestra/state.hpp", + "audio/orchestra/error.hpp", + "audio/orchestra/base.hpp", + "audio/orchestra/Interface.hpp", + "audio/orchestra/Flags.hpp", + "audio/orchestra/Api.hpp", + "audio/orchestra/DeviceInfo.hpp", + "audio/orchestra/StreamOptions.hpp", + "audio/orchestra/CallbackInfo.hpp", + "audio/orchestra/StreamParameters.hpp" + ], + "path":[ + "." + ], + "flag": { + "c++": "-DORCHESTRA_BUILD_DUMMY" + }, + "compilation-version": { + "c++": 2017 + }, + "dependency": [ + "audio", + "etk" + ], + "target":{ + "Windows":{ + "dependency": [ + { + "name": "asio", + "optional": true, + "export": true, + "flag": { + "c++": "-DORCHESTRA_BUILD_ASIO" + }, + "source": "audio/orchestra/api/Asio.cpp" + },{ + "name": "ds", + "optional": true, + "export": true, + "flag": { + "c++": "-DORCHESTRA_BUILD_DS" + }, + "source": "audio/orchestra/api/Ds.cpp" + },{ + "name": "wasapi", + "optional": true, + "export": true, + "flag": { + "c++": "-DORCHESTRA_BUILD_WASAPI" + } + } + ] + }, + "Linux":{ + "dependency": [ + { + "name": "alsa", + "optional": true, + "export": true, + "flag": { + "c++": "-DORCHESTRA_BUILD_ALSA" + }, + "source": "audio/orchestra/api/Alsa.cpp" + },{ + "name": "jack", + "optional": true, + "export": true, + "flag": { + "c++": "-DORCHESTRA_BUILD_JACK" + }, + "source": "audio/orchestra/api/Jack.cpp" + },{ + "name": "pulse", + "optional": true, + "export": true, + "flag": { + "c++": "-DORCHESTRA_BUILD_PULSE" + }, + "source": [ + "audio/orchestra/api/Pulse.cpp", + "audio/orchestra/api/PulseDeviceList.cpp" + ] + } + ] + }, + "MacOs":{ + "source": [ + "audio/orchestra/api/Core.cpp" + ], + "flag": { + "c++": "-DORCHESTRA_BUILD_MACOSX_CORE" + }, + "dependency": [ + "CoreAudio" + ] + }, + "IOs":{ + "source": [ + "audio/orchestra/api/CoreIos.mm" + ], + "flag": { + "c++": "-DORCHESTRA_BUILD_IOS_CORE" + }, + "dependency": [ + "CoreAudio" + ] + }, + "Android":{ + "source": [ + "android/org/musicdsp/orchestra/OrchestraConstants.java", + "android/org/musicdsp/orchestra/OrchestraManagerCallback.java", + "android/org/musicdsp/orchestra/OrchestraNative.java", + "android/org/musicdsp/orchestra/OrchestraInterfaceInput.java", + "android/org/musicdsp/orchestra/OrchestraInterfaceOutput.java", + "android/org/musicdsp/orchestra/OrchestraManager.java", + "org.musicdsp.orchestra.OrchestraConstants.javah", + "audio/orchestra/api/Android.cpp", + "audio/orchestra/api/AndroidNativeInterface.cpp" + ], + "path":{ + "java": [ + "android" + ] + }, + "dependency": [ + "SDK", + "jvm-basics", + "ejson" + ], + "flag": { + "c++": "-DORCHESTRA_BUILD_JAVA" + }, + "LUTIN:actions": { + "state": "BINARY", + "level": 11, + "name": "audio-orchestra-out-wrapper", + "cmd": "command_generateAddJavaSectionInClass.py", + "data": {} + } + } + } +} + diff --git a/command_generateAddJavaSectionInClass.py b/command_generateAddJavaSectionInClass.py new file mode 100644 index 0000000..3fe84e1 --- /dev/null +++ b/command_generateAddJavaSectionInClass.py @@ -0,0 +1,63 @@ + + +################################################################## +## +## Android specific section +## +################################################################## +def generateAddJavaSectionInClass(target, module, package_name): + module.add_pkg("GENERATE_SECTION__IMPORT", [ + "import org.musicdsp.orchestra.OrchestraManager;" + ]) + module.add_pkg("GENERATE_SECTION__DECLARE", [ + "private OrchestraManager m_audioManagerHandle;" + ]) + module.add_pkg("GENERATE_SECTION__CONSTRUCTOR", [ + "// load audio maneger if it does not work, it is not critical ...", + "try {", + " m_audioManagerHandle = new OrchestraManager();", + "} catch (RuntimeException e) {", + " Log.e(\"" + package_name + "\", \"Can not load Audio interface (maybe not really needed) :\" + e);", + "}" + ]) + module.add_pkg("GENERATE_SECTION__ON_CREATE", [ + "if (m_audioManagerHandle != null) {", + " m_audioManagerHandle.onCreate();", + "}" + ]) + module.add_pkg("GENERATE_SECTION__ON_START", [ + "if (m_audioManagerHandle != null) {", + " m_audioManagerHandle.onStart();", + "}" + ]) + module.add_pkg("GENERATE_SECTION__ON_RESTART", [ + "if (m_audioManagerHandle != null) {", + " m_audioManagerHandle.onRestart();", + "}" + ]) + module.add_pkg("GENERATE_SECTION__ON_RESUME", [ + "if (m_audioManagerHandle != null) {", + " m_audioManagerHandle.onResume();", + "}" + ]) + module.add_pkg("GENERATE_SECTION__ON_PAUSE", [ + "if (m_audioManagerHandle != null) {", + " m_audioManagerHandle.onPause();", + "}" + ]) + module.add_pkg("GENERATE_SECTION__ON_STOP", [ + "if (m_audioManagerHandle != null) {", + " m_audioManagerHandle.onStop();", + "}" + ]) + module.add_pkg("GENERATE_SECTION__ON_DESTROY", [ + "// Destroy the AdView.", + "if (m_audioManagerHandle != null) {", + " m_audioManagerHandle.onDestroy();", + "}" + ]) + + + + + diff --git a/lutin_audio-orchestra.py b/lutin_audio-orchestra.py deleted file mode 100644 index af3623b..0000000 --- a/lutin_audio-orchestra.py +++ /dev/null @@ -1,182 +0,0 @@ -#!/usr/bin/python -import lutin.tools as tools -import realog.debug as debug - - -def get_type(): - return "LIBRARY" - -def get_desc(): - return "Generic wrapper on all audio interface" - -def get_licence(): - return "APACHE-2" - -def get_compagny_type(): - return "com" - -def get_compagny_name(): - return "atria-soft" - -def get_maintainer(): - return "authors.txt" - -def get_version(): - return "version.txt" - -def configure(target, my_module): - my_module.add_src_file([ - 'audio/orchestra/debug.cpp', - 'audio/orchestra/status.cpp', - 'audio/orchestra/type.cpp', - 'audio/orchestra/mode.cpp', - 'audio/orchestra/state.cpp', - 'audio/orchestra/error.cpp', - 'audio/orchestra/base.cpp', - 'audio/orchestra/Interface.cpp', - 'audio/orchestra/Flags.cpp', - 'audio/orchestra/Api.cpp', - 'audio/orchestra/DeviceInfo.cpp', - 'audio/orchestra/StreamOptions.cpp', - 'audio/orchestra/api/Dummy.cpp' - ]) - my_module.add_header_file([ - 'audio/orchestra/debug.hpp', - 'audio/orchestra/status.hpp', - 'audio/orchestra/type.hpp', - 'audio/orchestra/mode.hpp', - 'audio/orchestra/state.hpp', - 'audio/orchestra/error.hpp', - 'audio/orchestra/base.hpp', - 'audio/orchestra/Interface.hpp', - 'audio/orchestra/Flags.hpp', - 'audio/orchestra/Api.hpp', - 'audio/orchestra/DeviceInfo.hpp', - 'audio/orchestra/StreamOptions.hpp', - 'audio/orchestra/CallbackInfo.hpp', - 'audio/orchestra/StreamParameters.hpp' - ]) - my_module.add_depend([ - 'audio', - 'etk' - ]) - # add all the time the dummy interface - my_module.add_flag('c++', ['-DORCHESTRA_BUILD_DUMMY'], export=True) - # TODO : Add a FILE interface: - - if "Windows" in target.get_type(): - my_module.add_src_file([ - 'audio/orchestra/api/Asio.cpp', - 'audio/orchestra/api/Ds.cpp', - ]) - # load optionnal API: - my_module.add_optionnal_depend('asio', ["c++", "-DORCHESTRA_BUILD_ASIO"]) - my_module.add_optionnal_depend('ds', ["c++", "-DORCHESTRA_BUILD_DS"]) - my_module.add_optionnal_depend('wasapi', ["c++", "-DORCHESTRA_BUILD_WASAPI"]) - elif "Linux" in target.get_type(): - my_module.add_src_file([ - 'audio/orchestra/api/Alsa.cpp', - 'audio/orchestra/api/Jack.cpp', - 'audio/orchestra/api/Pulse.cpp', - 'audio/orchestra/api/PulseDeviceList.cpp' - ]) - my_module.add_optionnal_depend('alsa', ["c++", "-DORCHESTRA_BUILD_ALSA"]) - my_module.add_optionnal_depend('jack', ["c++", "-DORCHESTRA_BUILD_JACK"]) - my_module.add_optionnal_depend('pulse', ["c++", "-DORCHESTRA_BUILD_PULSE"]) - elif "MacOs" in target.get_type(): - my_module.add_src_file([ - 'audio/orchestra/api/Core.cpp' - ]) - # MacOsX core - my_module.add_optionnal_depend('CoreAudio', ["c++", "-DORCHESTRA_BUILD_MACOSX_CORE"]) - elif "IOs" in target.get_type(): - my_module.add_src_file('audio/orchestra/api/CoreIos.mm') - # IOsX core - my_module.add_optionnal_depend('CoreAudio', ["c++", "-DORCHESTRA_BUILD_IOS_CORE"]) - elif "Android" in target.get_type(): - my_module.add_src_file('android/org/musicdsp/orchestra/OrchestraConstants.java') - my_module.add_src_file('android/org/musicdsp/orchestra/OrchestraManagerCallback.java') - my_module.add_src_file('android/org/musicdsp/orchestra/OrchestraNative.java') - my_module.add_src_file('android/org/musicdsp/orchestra/OrchestraInterfaceInput.java') - my_module.add_src_file('android/org/musicdsp/orchestra/OrchestraInterfaceOutput.java') - my_module.add_src_file('android/org/musicdsp/orchestra/OrchestraManager.java') - # create inter language interfacef - my_module.add_src_file('org.musicdsp.orchestra.OrchestraConstants.javah') - my_module.add_path('android', type='java') - my_module.add_depend(['SDK', 'jvm-basics', 'ejson']) - my_module.add_flag('c++', ['-DORCHESTRA_BUILD_JAVA'], export=True) - - my_module.add_src_file('audio/orchestra/api/Android.cpp') - my_module.add_src_file('audio/orchestra/api/AndroidNativeInterface.cpp') - # add tre creator of the basic java class ... - target.add_action("BINARY", 11, "audio-orchestra-out-wrapper", tool_generate_add_java_section_in_class) - else: - debug.warning("unknow target for audio_orchestra : " + target.name); - - my_module.add_path(".") - - return True - - - -################################################################## -## -## Android specific section -## -################################################################## -def tool_generate_add_java_section_in_class(target, module, package_name): - module.add_pkg("GENERATE_SECTION__IMPORT", [ - "import org.musicdsp.orchestra.OrchestraManager;" - ]) - module.add_pkg("GENERATE_SECTION__DECLARE", [ - "private OrchestraManager m_audioManagerHandle;" - ]) - module.add_pkg("GENERATE_SECTION__CONSTRUCTOR", [ - "// load audio maneger if it does not work, it is not critical ...", - "try {", - " m_audioManagerHandle = new OrchestraManager();", - "} catch (RuntimeException e) {", - " Log.e(\"" + package_name + "\", \"Can not load Audio interface (maybe not really needed) :\" + e);", - "}" - ]) - module.add_pkg("GENERATE_SECTION__ON_CREATE", [ - "if (m_audioManagerHandle != null) {", - " m_audioManagerHandle.onCreate();", - "}" - ]) - module.add_pkg("GENERATE_SECTION__ON_START", [ - "if (m_audioManagerHandle != null) {", - " m_audioManagerHandle.onStart();", - "}" - ]) - module.add_pkg("GENERATE_SECTION__ON_RESTART", [ - "if (m_audioManagerHandle != null) {", - " m_audioManagerHandle.onRestart();", - "}" - ]) - module.add_pkg("GENERATE_SECTION__ON_RESUME", [ - "if (m_audioManagerHandle != null) {", - " m_audioManagerHandle.onResume();", - "}" - ]) - module.add_pkg("GENERATE_SECTION__ON_PAUSE", [ - "if (m_audioManagerHandle != null) {", - " m_audioManagerHandle.onPause();", - "}" - ]) - module.add_pkg("GENERATE_SECTION__ON_STOP", [ - "if (m_audioManagerHandle != null) {", - " m_audioManagerHandle.onStop();", - "}" - ]) - module.add_pkg("GENERATE_SECTION__ON_DESTROY", [ - "// Destroy the AdView.", - "if (m_audioManagerHandle != null) {", - " m_audioManagerHandle.onDestroy();", - "}" - ]) - - - - - diff --git a/tools/GLD_orchestra-in.json b/tools/GLD_orchestra-in.json new file mode 100644 index 0000000..e57204f --- /dev/null +++ b/tools/GLD_orchestra-in.json @@ -0,0 +1,20 @@ +{ + "type": "BINARY", + "sub-type": "TOOL", + "group-id": "com.atria-soft", + "description": "'in' tool for orchestra", + "license": "MPL-2", + "license-file": "file://../LICENSE", + "maintainer": "file://../authors.txt", + "author": "file://../authors.txt", + "version": "file://../version.txt", + "code-quality": "MEDIUM", + + "source": [ + "orchestra-in.cpp" + ], + "dependency": [ + "audio-orchestra", + "test-debug" + ] +} \ No newline at end of file diff --git a/tools/GLD_orchestra-list.json b/tools/GLD_orchestra-list.json new file mode 100644 index 0000000..3a72323 --- /dev/null +++ b/tools/GLD_orchestra-list.json @@ -0,0 +1,20 @@ +{ + "type": "BINARY", + "sub-type": "TOOL", + "group-id": "com.atria-soft", + "description": "'list' i/o tool for orchestra", + "license": "MPL-2", + "license-file": "file://../LICENSE", + "maintainer": "file://../authors.txt", + "author": "file://../authors.txt", + "version": "file://../version.txt", + "code-quality": "MEDIUM", + + "source": [ + "orchestra-list.cpp" + ], + "dependency": [ + "audio-orchestra", + "test-debug" + ] +} \ No newline at end of file diff --git a/tools/GLD_orchestra-out.json b/tools/GLD_orchestra-out.json new file mode 100644 index 0000000..2a30aa5 --- /dev/null +++ b/tools/GLD_orchestra-out.json @@ -0,0 +1,20 @@ +{ + "type": "BINARY", + "sub-type": "TOOL", + "group-id": "com.atria-soft", + "description": "'out' i/o tool for orchestra", + "license": "MPL-2", + "license-file": "file://../LICENSE", + "maintainer": "file://../authors.txt", + "author": "file://../authors.txt", + "version": "file://../version.txt", + "code-quality": "MEDIUM", + + "source": [ + "orchestra-out.cpp" + ], + "dependency": [ + "audio-orchestra", + "test-debug" + ] +} \ No newline at end of file diff --git a/tools/lutin_orchestra-in.py b/tools/lutin_orchestra-in.py deleted file mode 100644 index 3ae38f7..0000000 --- a/tools/lutin_orchestra-in.py +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/python -import realog.debug as debug -import lutin.tools as tools - - -def get_type(): - return "BINARY" - -def get_sub_type(): - return "TOOLS" - -def get_desc(): - return "'in' tool for orchestra" - -def get_licence(): - return "APACHE-2" - -def get_compagny_type(): - return "com" - -def get_compagny_name(): - return "atria-soft" - -def get_maintainer(): - return ["Mr DUPIN Edouard "] - -def configure(target, my_module): - my_module.add_src_file([ - 'orchestra-in.cpp' - ]) - my_module.add_depend([ - 'audio-orchestra', - 'test-debug' - ]) - return True - - diff --git a/tools/lutin_orchestra-list.py b/tools/lutin_orchestra-list.py deleted file mode 100644 index 4a04fc3..0000000 --- a/tools/lutin_orchestra-list.py +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/python -import realog.debug as debug -import lutin.tools as tools - - -def get_type(): - return "BINARY" - -def get_sub_type(): - return "TOOLS" - -def get_desc(): - return "'list' i/o tool for orchestra" - -def get_licence(): - return "APACHE-2" - -def get_compagny_type(): - return "com" - -def get_compagny_name(): - return "atria-soft" - -def get_maintainer(): - return ["Mr DUPIN Edouard "] - -def configure(target, my_module): - my_module.add_src_file([ - 'orchestra-list.cpp' - ]) - my_module.add_depend([ - 'audio-orchestra', - 'test-debug' - ]) - return True - - diff --git a/tools/lutin_orchestra-out.py b/tools/lutin_orchestra-out.py deleted file mode 100644 index 39b309b..0000000 --- a/tools/lutin_orchestra-out.py +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/python -import realog.debug as debug -import lutin.tools as tools - - -def get_type(): - return "BINARY" - -def get_sub_type(): - return "TOOLS" - -def get_desc(): - return "'out' tool for orchestra" - -def get_licence(): - return "APACHE-2" - -def get_compagny_type(): - return "com" - -def get_compagny_name(): - return "atria-soft" - -def get_maintainer(): - return ["Mr DUPIN Edouard "] - -def configure(target, my_module): - my_module.add_src_file([ - 'orchestra-out.cpp' - ]) - my_module.add_depend([ - 'audio-orchestra', - 'test-debug' - ]) - return True - -