diff options
author | fulup <fulup.arfoll@iot.bzh> | 2018-06-06 11:47:08 +0200 |
---|---|---|
committer | fulup <fulup.arfoll@iot.bzh> | 2018-06-06 11:47:08 +0200 |
commit | 4ca3244a440b798b91c252bf22e5299df98218e7 (patch) | |
tree | 9c0d386543face266dd08f7d3463f86ed179c0bf /conf.d | |
parent | 7aaf36d8e729400f7efc75d7e03e162e1f262293 (diff) |
Move smixer API create+attach into controller onload section
Diffstat (limited to 'conf.d')
-rw-r--r-- | conf.d/project/etc/smixer-test-config.json | 20 | ||||
-rw-r--r-- | conf.d/project/htdocs/index.html | 22 | ||||
-rw-r--r-- | conf.d/project/lua.d/smixer-test-simple.lua | 12 |
3 files changed, 21 insertions, 33 deletions
diff --git a/conf.d/project/etc/smixer-test-config.json b/conf.d/project/etc/smixer-test-config.json index 3ed9f29..71eded8 100644 --- a/conf.d/project/etc/smixer-test-config.json +++ b/conf.d/project/etc/smixer-test-config.json @@ -12,24 +12,20 @@ "info": "Map alsa-loop subdevices to 4A HAL streams", "spath": "./package/lib/plugins:./package/var:./lib/plugins:./var", "libs": ["alsa-softmixer.ctlso", "smixer-test-simple.lua"], - "lua": { - "prefix": "smix", - "functions": ["_mixer_new_"] - } } ], "onload": [ { - "uid": "init-soft-mixer", - "info": "Initialise Audio Router", - "action": "lua://softmixer#_mixer_simple_test_" - } - ], - "controls": [ + "uid": "create-soft-mixer", + "info": "Create Audio Router", + "action": "plugin://softmixer#CreateMixer", + "args": {"uid":"Simple_Test_Mixer"} + }, { - "uid": "create", - "action": "plugin://softmixer#mixer_new" + "uid": "attach-soft-mixer", + "info": "Attach Stream to Audio Router", + "action": "lua://softmixer#_mixer_simple_test_" } ] } diff --git a/conf.d/project/htdocs/index.html b/conf.d/project/htdocs/index.html index df7ec80..c667dde 100644 --- a/conf.d/project/htdocs/index.html +++ b/conf.d/project/htdocs/index.html @@ -18,21 +18,21 @@ <h2>V3 API CALL</h2> <ol> - <li><button onclick="callbinder('MyMixer', 'info', {streams: true});">Streams List</button></li> - <li><button onclick="callbinder('MyMixer', 'info', {ramps: true});">Ramps List</button></li> - <li><button onclick="callbinder('MyMixer', 'info', {zones: true});">Zones List</button></li> + <li><button onclick="callbinder('smixer', 'info', {streams: true});">Streams List</button></li> + <li><button onclick="callbinder('smixer', 'info', {ramps: true});">Ramps List</button></li> + <li><button onclick="callbinder('smixer', 'info', {zones: true});">Zones List</button></li> <br> - <li><button onclick="callbinder('MyMixer', '8CH-USB/playback', {volume: '+10'});">Master 8CH-USB vol=+10</button></li> - <li><button onclick="callbinder('MyMixer', '8CH-USB/playback', {volume: '-10'});">Master 8CH-USB vol=-10</button></li> + <li><button onclick="callbinder('smixer', '8CH-USB/playback', {volume: '+10'});">Master 8CH-USB vol=+10</button></li> + <li><button onclick="callbinder('smixer', '8CH-USB/playback', {volume: '-10'});">Master 8CH-USB vol=-10</button></li> <br> - <li><button onclick="callbinder('MyMixer', 'multimedia', {toggle: true});">Stream Multimedia pause/resume</button></li> - <li><button onclick="callbinder('MyMixer', 'navigation', {toggle: true});">Stream Navigation pause/resume</button></li> + <li><button onclick="callbinder('smixer', 'multimedia', {toggle: true});">Stream Multimedia pause/resume</button></li> + <li><button onclick="callbinder('smixer', 'navigation', {toggle: true});">Stream Navigation pause/resume</button></li> <br> - <li><button onclick="callbinder('MyMixer', 'multimedia', {volume: '+10'});">Stream Multimedia volume=+10"</button></li> - <li><button onclick="callbinder('MyMixer', 'multimedia', {volume: '-10'});">Stream Multimedia volume=-10"</button></li> + <li><button onclick="callbinder('smixer', 'multimedia', {volume: '+10'});">Stream Multimedia volume=+10"</button></li> + <li><button onclick="callbinder('smixer', 'multimedia', {volume: '-10'});">Stream Multimedia volume=-10"</button></li> <br> - <li><button onclick="callbinder('MyMixer', 'multimedia', {ramp: {uid:'ramp-slow', volume:30}});">Stream Multimedia ramp-slow=30"</button></li> - <li><button onclick="callbinder('MyMixer', 'multimedia', {ramp: {uid:'ramp-fast', volume:80}});">Stream Multimedia ramp-fast=80"</button></li> + <li><button onclick="callbinder('smixer', 'multimedia', {ramp: {uid:'ramp-slow', volume:30}});">Stream Multimedia ramp-slow=30"</button></li> + <li><button onclick="callbinder('smixer', 'multimedia', {ramp: {uid:'ramp-fast', volume:80}});">Stream Multimedia ramp-fast=80"</button></li> </ol> <div id="main" style="visibility:hidden"> diff --git a/conf.d/project/lua.d/smixer-test-simple.lua b/conf.d/project/lua.d/smixer-test-simple.lua index 3a5dc98..99893c1 100644 --- a/conf.d/project/lua.d/smixer-test-simple.lua +++ b/conf.d/project/lua.d/smixer-test-simple.lua @@ -37,7 +37,6 @@ end function _mixer_simple_test_ (source, args) do - -- Mixer UID is used as API name -- ==================== Default rate =========================== @@ -220,16 +219,9 @@ function _mixer_simple_test_ (source, args) } - -- direct LUA call because controller cannot call its own API from AFB:servsync - error,result= smix:_mixer_new_ (source, {["uid"]="MyMixer"}) - if (error ~= 0) then - AFB:error (source, "--InLua-- smix:_mixer_new_ fail config=%s", Dump_Table(result)) - goto OnErrorExit - else - AFB:notice (source, "--InLua-- smix:_mixer_new_ done\n") - end - error,result= AFB:servsync(source, "MyMixer", "attach", MyTestHal) + + error,result= AFB:servsync(source, "smixer", "attach", MyTestHal) if (error) then AFB:error (source, "--InLua-- API MyMixer/attach fail error=%d", error) goto OnErrorExit |