From 7e104a1f7298bd8ce1c0d3e83d22b0ea2cf949d1 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Wed, 7 Sep 2016 22:05:42 +0200 Subject: [PATCH] [DEV] update to future lutin 2.0 and update to new ejson --- .../orchestra/api/AndroidNativeInterface.cpp | 30 +++++++++---------- lutin_audio-orchestra.py | 22 +++++++------- tools/lutin_orchestra-in.py | 2 +- tools/lutin_orchestra-list.py | 2 +- tools/lutin_orchestra-out.py | 2 +- 5 files changed, 29 insertions(+), 29 deletions(-) diff --git a/audio/orchestra/api/AndroidNativeInterface.cpp b/audio/orchestra/api/AndroidNativeInterface.cpp index d431f3a..dddc13a 100644 --- a/audio/orchestra/api/AndroidNativeInterface.cpp +++ b/audio/orchestra/api/AndroidNativeInterface.cpp @@ -247,31 +247,31 @@ class AndroidOrchestraContext { return info; } - info.name = doc.getStringValue("name", "no-name"); - if (doc.getStringValue("type", "output") == "output") { + info.name = doc["name"].toString().get("no-name"); + if (doc["type"].toString().get("output") == "output") { info.input = false; } else { info.input = true; } - ememory::SharedPtr list = doc.getArray("sample-rate"); - if (list != nullptr) { - for (size_t iii=0; iiisize(); ++iii) { - info.sampleRates.push_back(int32_t(list->getNumberValue(iii, 48000))); + ejson::Array list = doc["sample-rate"].toArray(); + if (list.exist() == true) { + for (auto it : list) { + info.sampleRates.push_back(int32_t(it.toNumber().get(48000))); } } - list = doc.getArray("channels"); - if (list != nullptr) { - for (size_t iii=0; iiisize(); ++iii) { - info.channels.push_back(audio::getChannelFromString(list->getStringValue(iii, "???"))); + list = doc["channels"].toArray(); + if (list.exist() == true) { + for (auto it : list) { + info.channels.push_back(audio::getChannelFromString(it.toString().get("???"))); } } - list = doc.getArray("format"); - if (list != nullptr) { - for (size_t iii=0; iiisize(); ++iii) { - info.nativeFormats.push_back(audio::getFormatFromString(list->getStringValue(iii, "???"))); + list = doc["format"].toArray(); + if (list.exist() == true) { + for (auto it : list) { + info.nativeFormats.push_back(audio::getFormatFromString(it.toString().get("???"))); } } - info.isDefault = doc.getBooleanValue("default", false); + info.isDefault = doc["default"].toBoolean().get(false); info.isCorrect = true; return info; } diff --git a/lutin_audio-orchestra.py b/lutin_audio-orchestra.py index 321432d..a75c179 100644 --- a/lutin_audio-orchestra.py +++ b/lutin_audio-orchestra.py @@ -58,9 +58,9 @@ def create(target, module_name): 'audio/orchestra/CallbackInfo.h', 'audio/orchestra/StreamParameters.h' ]) - my_module.add_module_depend(['audio', 'etk']) + my_module.add_depend(['audio', 'etk']) # add all the time the dummy interface - my_module.add_export_flag('c++', ['-DORCHESTRA_BUILD_DUMMY']) + my_module.add_flag('c++', ['-DORCHESTRA_BUILD_DUMMY'], export=True) # TODO : Add a FILE interface: if target.config_based_on=="Windows": @@ -69,9 +69,9 @@ def create(target, module_name): 'audio/orchestra/api/Ds.cpp', ]) # load optionnal API: - my_module.add_optionnal_module_depend('asio', ["c++", "-DORCHESTRA_BUILD_ASIO"]) - my_module.add_optionnal_module_depend('ds', ["c++", "-DORCHESTRA_BUILD_DS"]) - my_module.add_optionnal_module_depend('wasapi', ["c++", "-DORCHESTRA_BUILD_WASAPI"]) + 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 target.config_based_on=="Linux": my_module.add_src_file([ 'audio/orchestra/api/Alsa.cpp', @@ -79,19 +79,19 @@ def create(target, module_name): 'audio/orchestra/api/Pulse.cpp', 'audio/orchestra/api/PulseDeviceList.cpp' ]) - my_module.add_optionnal_module_depend('alsa', ["c++", "-DORCHESTRA_BUILD_ALSA"]) - my_module.add_optionnal_module_depend('jack', ["c++", "-DORCHESTRA_BUILD_JACK"]) - my_module.add_optionnal_module_depend('pulse', ["c++", "-DORCHESTRA_BUILD_PULSE"]) + 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 target.config_based_on=="MacOs": my_module.add_src_file([ 'audio/orchestra/api/Core.cpp' ]) # MacOsX core - my_module.add_optionnal_module_depend('CoreAudio', ["c++", "-DORCHESTRA_BUILD_MACOSX_CORE"]) + my_module.add_optionnal_depend('CoreAudio', ["c++", "-DORCHESTRA_BUILD_MACOSX_CORE"]) elif target.config_based_on=="IOs": my_module.add_src_file('audio/orchestra/api/CoreIos.mm') # IOsX core - my_module.add_optionnal_module_depend('CoreAudio', ["c++", "-DORCHESTRA_BUILD_IOS_CORE"]) + my_module.add_optionnal_depend('CoreAudio', ["c++", "-DORCHESTRA_BUILD_IOS_CORE"]) elif target.config_based_on=="Android": my_module.add_src_file('android/org/musicdsp/orchestra/OrchestraConstants.java') my_module.add_src_file('android/org/musicdsp/orchestra/OrchestraManagerCallback.java') @@ -102,7 +102,7 @@ def create(target, module_name): # create inter language interface my_module.add_src_file('org.musicdsp.orchestra.OrchestraConstants.javah') my_module.add_path(tools.get_current_path(__file__) + '/android/', type='java') - my_module.add_module_depend(['SDK', 'jvm-basics', 'ejson']) + my_module.add_depend(['SDK', 'jvm-basics', 'ejson']) my_module.add_export_flag('c++', ['-DORCHESTRA_BUILD_JAVA']) my_module.add_src_file('audio/orchestra/api/Android.cpp') diff --git a/tools/lutin_orchestra-in.py b/tools/lutin_orchestra-in.py index 84c2afb..606afc3 100644 --- a/tools/lutin_orchestra-in.py +++ b/tools/lutin_orchestra-in.py @@ -31,7 +31,7 @@ def create(target, module_name): my_module.add_src_file([ 'orchestra-in.cpp' ]) - my_module.add_module_depend(['audio-orchestra', 'test-debug']) + my_module.add_depend(['audio-orchestra', 'test-debug']) return my_module diff --git a/tools/lutin_orchestra-list.py b/tools/lutin_orchestra-list.py index b19f1e8..47d9ea2 100644 --- a/tools/lutin_orchestra-list.py +++ b/tools/lutin_orchestra-list.py @@ -31,7 +31,7 @@ def create(target, module_name): my_module.add_src_file([ 'orchestra-list.cpp' ]) - my_module.add_module_depend(['audio-orchestra', 'test-debug']) + my_module.add_depend(['audio-orchestra', 'test-debug']) return my_module diff --git a/tools/lutin_orchestra-out.py b/tools/lutin_orchestra-out.py index bb2296b..e0795e9 100644 --- a/tools/lutin_orchestra-out.py +++ b/tools/lutin_orchestra-out.py @@ -31,7 +31,7 @@ def create(target, module_name): my_module.add_src_file([ 'orchestra-out.cpp' ]) - my_module.add_module_depend(['audio-orchestra', 'test-debug']) + my_module.add_depend(['audio-orchestra', 'test-debug']) return my_module