summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfulup <fulup.arfoll@iot.bzh>2018-05-16 15:16:00 +0200
committerfulup <fulup.arfoll@iot.bzh>2018-05-16 15:16:00 +0200
commitea9cd4223a9ff1f0da3276ea12727a59ab09531f (patch)
tree6bd889e82ddec28bdbfc060627c97af6b45840bf
parent0b33f91f060fe79e1ecc3f364b8adfe0cdd776d7 (diff)
Move to new config syntax
m---------conf.d/app-templates0
-rw-r--r--conf.d/cmake/config.cmake7
-rw-r--r--conf.d/project/etc/4a-softmixer-config.json22
-rw-r--r--mixer-binding/mixer-binding.c2
-rw-r--r--nbproject/configurations.xml66
5 files changed, 78 insertions, 19 deletions
diff --git a/conf.d/app-templates b/conf.d/app-templates
-Subproject 829dd697c1797893753962df6af1a9ad1592263
+Subproject 6621af007c13b12bb1d33d0edf75db600a42f74
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 @@
<in>ctl-config.c</in>
<in>ctl-control.c</in>
<in>ctl-event.c</in>
+ <in>ctl-lua-utils.c</in>
<in>ctl-lua.c</in>
<in>ctl-onload.c</in>
<in>ctl-plugin.c</in>
@@ -79,6 +80,8 @@
<buildCommand>${MAKE} -f Makefile</buildCommand>
<cleanCommand>${MAKE} -f Makefile clean</cleanCommand>
<executablePath></executablePath>
+ <cTool flags="1">
+ </cTool>
</makeTool>
<preBuild>
<preBuildCommandWorkingDir>build</preBuildCommandWorkingDir>
@@ -92,6 +95,8 @@
flavor2="2">
<cTool flags="0">
<incDir>
+ <pElem>app-controller-submodule/ctl-lib</pElem>
+ <pElem>build/app-controller-submodule/ctl-lib</pElem>
<pElem>/usr/include/json-c</pElem>
<pElem>../../../opt/include</pElem>
<pElem>/usr/include/p11-kit-1</pElem>
@@ -114,6 +119,8 @@
<item path="app-afb-helpers-submodule/escape.c" ex="false" tool="0" flavor2="2">
<cTool flags="0">
<incDir>
+ <pElem>app-controller-submodule/ctl-lib</pElem>
+ <pElem>build/app-controller-submodule/ctl-lib</pElem>
<pElem>/usr/include/json-c</pElem>
<pElem>../../../opt/include</pElem>
<pElem>/usr/include/p11-kit-1</pElem>
@@ -162,6 +169,13 @@
tool="0"
flavor2="3">
<cTool flags="1">
+ <incDir>
+ <pElem>../../../opt/include/afb</pElem>
+ <pElem>app-controller-submodule/ctl-lib</pElem>
+ <pElem>app-afb-helpers-submodule</pElem>
+ <pElem>../../../opt/include</pElem>
+ <pElem>build/app-controller-submodule/ctl-lib</pElem>
+ </incDir>
</cTool>
</item>
<item path="app-controller-submodule/ctl-lib/ctl-config.c"
@@ -169,6 +183,13 @@
tool="0"
flavor2="3">
<cTool flags="1">
+ <incDir>
+ <pElem>../../../opt/include/afb</pElem>
+ <pElem>app-controller-submodule/ctl-lib</pElem>
+ <pElem>app-afb-helpers-submodule</pElem>
+ <pElem>../../../opt/include</pElem>
+ <pElem>build/app-controller-submodule/ctl-lib</pElem>
+ </incDir>
</cTool>
</item>
<item path="app-controller-submodule/ctl-lib/ctl-control.c"
@@ -176,6 +197,13 @@
tool="0"
flavor2="3">
<cTool flags="1">
+ <incDir>
+ <pElem>../../../opt/include/afb</pElem>
+ <pElem>app-controller-submodule/ctl-lib</pElem>
+ <pElem>app-afb-helpers-submodule</pElem>
+ <pElem>../../../opt/include</pElem>
+ <pElem>build/app-controller-submodule/ctl-lib</pElem>
+ </incDir>
</cTool>
</item>
<item path="app-controller-submodule/ctl-lib/ctl-event.c"
@@ -183,6 +211,13 @@
tool="0"
flavor2="3">
<cTool flags="1">
+ <incDir>
+ <pElem>../../../opt/include/afb</pElem>
+ <pElem>app-controller-submodule/ctl-lib</pElem>
+ <pElem>app-afb-helpers-submodule</pElem>
+ <pElem>../../../opt/include</pElem>
+ <pElem>build/app-controller-submodule/ctl-lib</pElem>
+ </incDir>
</cTool>
</item>
<item path="app-controller-submodule/ctl-lib/ctl-lua-utils.c"
@@ -201,6 +236,13 @@
tool="0"
flavor2="3">
<cTool flags="1">
+ <incDir>
+ <pElem>../../../opt/include/afb</pElem>
+ <pElem>app-controller-submodule/ctl-lib</pElem>
+ <pElem>app-afb-helpers-submodule</pElem>
+ <pElem>../../../opt/include</pElem>
+ <pElem>build/app-controller-submodule/ctl-lib</pElem>
+ </incDir>
</cTool>
</item>
<item path="app-controller-submodule/ctl-lib/ctl-onload.c"
@@ -208,6 +250,13 @@
tool="0"
flavor2="3">
<cTool flags="1">
+ <incDir>
+ <pElem>../../../opt/include/afb</pElem>
+ <pElem>app-controller-submodule/ctl-lib</pElem>
+ <pElem>app-afb-helpers-submodule</pElem>
+ <pElem>../../../opt/include</pElem>
+ <pElem>build/app-controller-submodule/ctl-lib</pElem>
+ </incDir>
</cTool>
</item>
<item path="app-controller-submodule/ctl-lib/ctl-plugin.c"
@@ -215,6 +264,13 @@
tool="0"
flavor2="3">
<cTool flags="1">
+ <incDir>
+ <pElem>../../../opt/include/afb</pElem>
+ <pElem>app-controller-submodule/ctl-lib</pElem>
+ <pElem>app-afb-helpers-submodule</pElem>
+ <pElem>../../../opt/include</pElem>
+ <pElem>build/app-controller-submodule/ctl-lib</pElem>
+ </incDir>
</cTool>
</item>
<item path="app-controller-submodule/ctl-lib/ctl-timer.c"
@@ -222,6 +278,13 @@
tool="0"
flavor2="3">
<cTool flags="1">
+ <incDir>
+ <pElem>../../../opt/include/afb</pElem>
+ <pElem>app-controller-submodule/ctl-lib</pElem>
+ <pElem>app-afb-helpers-submodule</pElem>
+ <pElem>../../../opt/include</pElem>
+ <pElem>build/app-controller-submodule/ctl-lib</pElem>
+ </incDir>
</cTool>
</item>
<folder path="0/app-controller-submodule">
@@ -260,6 +323,8 @@
<folder path="0/plugins">
<cTool>
<incDir>
+ <pElem>app-controller-submodule/ctl-lib</pElem>
+ <pElem>build/app-controller-submodule/ctl-lib</pElem>
<pElem>/usr/include</pElem>
<pElem>/usr/include/json-c</pElem>
<pElem>/usr/include/alsa</pElem>
@@ -267,7 +332,6 @@
<pElem>/usr/include/p11-kit-1</pElem>
<pElem>/usr/include/uuid</pElem>
<pElem>../../../opt/include/alsa</pElem>
- <pElem>app-controller-submodule/ctl-lib</pElem>
<pElem>mixer-binding</pElem>
<pElem>app-afb-helpers-submodule</pElem>
<pElem>build/plugins/alsa</pElem>