From ea9cd4223a9ff1f0da3276ea12727a59ab09531f Mon Sep 17 00:00:00 2001 From: fulup Date: Wed, 16 May 2018 15:16:00 +0200 Subject: Move to new config syntax --- conf.d/app-templates | 2 +- conf.d/cmake/config.cmake | 7 ++- conf.d/project/etc/4a-softmixer-config.json | 22 ++++------ mixer-binding/mixer-binding.c | 2 +- nbproject/configurations.xml | 66 ++++++++++++++++++++++++++++- 5 files changed, 79 insertions(+), 20 deletions(-) diff --git a/conf.d/app-templates b/conf.d/app-templates index 829dd69..6621af0 160000 --- a/conf.d/app-templates +++ b/conf.d/app-templates @@ -1 +1 @@ -Subproject commit 829dd697c1797893753962df6af1a9ad1592263a +Subproject commit 6621af007c13b12bb1d33d0edf75db600a42f742 diff --git a/conf.d/cmake/config.cmake b/conf.d/cmake/config.cmake index 7a2cbf3..afba6b7 100644 --- a/conf.d/cmake/config.cmake +++ b/conf.d/cmake/config.cmake @@ -74,7 +74,7 @@ set (PKG_REQUIRED_LIST afb-daemon>=4.0 libmicrohttpd>=0.9.55 uuid - alsa>=1.1.2 + alsa>=1.1.2 ) # Prefix path where will be installed the files @@ -130,9 +130,8 @@ list(APPEND link_libraries afb-helpers) # CACHE STRING "Compilation flags for RELEASE build type.") set(CONTROL_SUPPORT_LUA 1) -list(APPEND PKG_REQUIRED_LIST lua>=5.3) -add_definitions(-DCONTROL_PLUGIN_PATH="${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}/lib/plugins:${CMAKE_BINARY_DIR}/package/lib/plugins") -add_definitions(-DCONTROL_CONFIG_PATH="${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}/etc:${CMAKE_BINARY_DIR}/package/etc") +add_definitions(-DCONTROL_PLUGIN_PATH="${CMAKE_BINARY_DIR}/package/lib/plugins:${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}/lib/plugins") +add_definitions(-DCONTROL_CONFIG_PATH="${CMAKE_BINARY_DIR}/package/etc:${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}/etc") add_definitions(-DCONTROL_LUA_PATH="${CMAKE_SOURCE_DIR}/conf.d/project/lua.d:${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}/data") add_definitions(-DCTL_PLUGIN_MAGIC=987456123) add_definitions(-DUSE_API_DYN=1 -DAFB_BINDING_VERSION=dyn) diff --git a/conf.d/project/etc/4a-softmixer-config.json b/conf.d/project/etc/4a-softmixer-config.json index 2b4db11..e67709f 100644 --- a/conf.d/project/etc/4a-softmixer-config.json +++ b/conf.d/project/etc/4a-softmixer-config.json @@ -1,19 +1,18 @@ { - "schema": "http://iot.bzh/download/public/schema/json/ctl-schema.json", + "$schema": "http://iot.bzh/download/public/schema/json/ctl-schema.json", "metadata": { "uid": "Soft Mixer", "version": "1.0", "api": "softmixer", "info": "Soft Mixer emulating hardware mixer" }, - "plugins": [ + "resources": [ { "uid": "alsa-softmixer", "info": "Map alsa-loop subdevices to 4A HAL streams", "spath":"./plugins/alsa:../conf.d/project/lua.d", - "file": ["alsa-router.ctlso", "softmixer-simple.lua"], - "lua2c_prefix": "smix", - "lua2c": ["snd_cards", "snd_zones", "snd_loops", "snd_streams"] + "libs": ["alsa-router.ctlso", "softmixer-simple.lua"], + "lua": {"prefix":"smix","functions": ["snd_cards", "snd_zones", "snd_loops", "snd_streams"]} } ], @@ -21,26 +20,23 @@ { "uid": "init-soft-mixer", "info": "Initialise Audio Router", - "uri": "lua://alsa-softmixer", - "function": "_init_softmixer_" + "action": "lua://alsa-softmixer#_init_softmixer_" } ], "controls": [ { "uid": "mixer-config", - "uri": "lua://alsa-softmixer", - "function": "_mixer_config_" + "action": "lua://alsa-softmixer#_mixer_config_" }, { "uid": "snd-cards", - "uri": "plugin://alsa-softmixer", - "function": "snd_cards" + "action": "plugin://alsa-softmixer#snd_cards" }, { "uid": "snd-zone", - "uri": "plugin://alsa-softmixer", - "function": "snd_zones" + "action": "plugin://alsa-softmixer#snd_zones" } ] + } diff --git a/mixer-binding/mixer-binding.c b/mixer-binding/mixer-binding.c index 15d13cd..7f199bc 100644 --- a/mixer-binding/mixer-binding.c +++ b/mixer-binding/mixer-binding.c @@ -28,7 +28,7 @@ PUBLIC afb_dynapi *AFB_default; // Config Section definition (note: controls section index should match handle retrieval in HalConfigExec) static CtlSectionT ctrlSections[]= { - {.key="plugins" , .loadCB= PluginConfig}, + {.key="resources" , .loadCB= PluginConfig}, {.key="onload" , .loadCB= OnloadConfig}, {.key="controls", .loadCB= ControlConfig}, diff --git a/nbproject/configurations.xml b/nbproject/configurations.xml index 7ec1f1f..966c264 100644 --- a/nbproject/configurations.xml +++ b/nbproject/configurations.xml @@ -14,6 +14,7 @@ ctl-config.c ctl-control.c ctl-event.c + ctl-lua-utils.c ctl-lua.c ctl-onload.c ctl-plugin.c @@ -79,6 +80,8 @@ ${MAKE} -f Makefile ${MAKE} -f Makefile clean + + build @@ -92,6 +95,8 @@ flavor2="2"> + app-controller-submodule/ctl-lib + build/app-controller-submodule/ctl-lib /usr/include/json-c ../../../opt/include /usr/include/p11-kit-1 @@ -114,6 +119,8 @@ + app-controller-submodule/ctl-lib + build/app-controller-submodule/ctl-lib /usr/include/json-c ../../../opt/include /usr/include/p11-kit-1 @@ -162,6 +169,13 @@ tool="0" flavor2="3"> + + ../../../opt/include/afb + app-controller-submodule/ctl-lib + app-afb-helpers-submodule + ../../../opt/include + build/app-controller-submodule/ctl-lib + + + ../../../opt/include/afb + app-controller-submodule/ctl-lib + app-afb-helpers-submodule + ../../../opt/include + build/app-controller-submodule/ctl-lib + + + ../../../opt/include/afb + app-controller-submodule/ctl-lib + app-afb-helpers-submodule + ../../../opt/include + build/app-controller-submodule/ctl-lib + + + ../../../opt/include/afb + app-controller-submodule/ctl-lib + app-afb-helpers-submodule + ../../../opt/include + build/app-controller-submodule/ctl-lib + + + ../../../opt/include/afb + app-controller-submodule/ctl-lib + app-afb-helpers-submodule + ../../../opt/include + build/app-controller-submodule/ctl-lib + + + ../../../opt/include/afb + app-controller-submodule/ctl-lib + app-afb-helpers-submodule + ../../../opt/include + build/app-controller-submodule/ctl-lib + + + ../../../opt/include/afb + app-controller-submodule/ctl-lib + app-afb-helpers-submodule + ../../../opt/include + build/app-controller-submodule/ctl-lib + + + ../../../opt/include/afb + app-controller-submodule/ctl-lib + app-afb-helpers-submodule + ../../../opt/include + build/app-controller-submodule/ctl-lib + @@ -260,6 +323,8 @@ + app-controller-submodule/ctl-lib + build/app-controller-submodule/ctl-lib /usr/include /usr/include/json-c /usr/include/alsa @@ -267,7 +332,6 @@ /usr/include/p11-kit-1 /usr/include/uuid ../../../opt/include/alsa - app-controller-submodule/ctl-lib mixer-binding app-afb-helpers-submodule build/plugins/alsa -- cgit 1.2.3-korg