diff options
author | Fulup Ar Foll <fulup@iot.bzh> | 2018-05-18 13:31:36 +0200 |
---|---|---|
committer | Fulup Ar Foll <fulup@iot.bzh> | 2018-05-18 13:31:36 +0200 |
commit | 7454d66bb47349418f8f65b8d7bec79039a2be32 (patch) | |
tree | 9816b7c9d213c890adfcde58646e50e6545ebb70 /conf.d | |
parent | 3fd11a5eb799a391351334b3580c5582a065f780 (diff) |
Implements volume ramping
Diffstat (limited to 'conf.d')
-rw-r--r-- | conf.d/project/htdocs/index.html | 9 | ||||
-rw-r--r-- | conf.d/project/lua.d/softmixer-simple-test.lua | 32 |
2 files changed, 31 insertions, 10 deletions
diff --git a/conf.d/project/htdocs/index.html b/conf.d/project/htdocs/index.html index 3125f29..67a4a26 100644 --- a/conf.d/project/htdocs/index.html +++ b/conf.d/project/htdocs/index.html @@ -16,10 +16,15 @@ <h2>V3 API CALL</h2> <ol> <li><button onclick="callbinder('softmixer','simple_mixer',{list:{streams:true}});">Streams List</button></li> + <br> <li><button onclick="callbinder('softmixer','simple_mixer/multimedia',{toggle: true});">Stream Multimedia pause/resume</button></li> <li><button onclick="callbinder('softmixer','simple_mixer/navigation',{toggle: true});">Stream Navigation pause/resume</button></li> - <li><button onclick="callbinder('softmixer','simple_mixer/multimedia',{volume: '+10'});">Stream Navigation volume=+10"</button></li> - <li><button onclick="callbinder('softmixer','simple_mixer/multimedia',{volume: '-10'});">Stream Navigation volume=-10"</button></li> + <br> + <li><button onclick="callbinder('softmixer','simple_mixer/multimedia',{volume: '+10'});">Stream Multimedia volume=+10"</button></li> + <li><button onclick="callbinder('softmixer','simple_mixer/multimedia',{volume: '-10'});">Stream Multimedia volume=-10"</button></li> + <br> + <li><button onclick="callbinder('softmixer','simple_mixer/multimedia',{ramp: 30});">Stream Multimedia ramp=30"</button></li> + <li><button onclick="callbinder('softmixer','simple_mixer/multimedia',{ramp: 80});">Stream Multimedia ramp=80"</button></li> </ol> <div id="main" style="visibility:hidden"> diff --git a/conf.d/project/lua.d/softmixer-simple-test.lua b/conf.d/project/lua.d/softmixer-simple-test.lua index 6d6dffc..115831b 100644 --- a/conf.d/project/lua.d/softmixer-simple-test.lua +++ b/conf.d/project/lua.d/softmixer-simple-test.lua @@ -38,6 +38,11 @@ function _mixer_simple_test_ (source, args) -- ================== Default Alsa snd-aloop numid and subdev config local aloop = { ["devices"] = {["playback"]=0,["capture"]=1}, + ["ramps"] = { + {["uid"]="ramp-fast", ["delay"]= 050, ["up"]=10,["down"]=3}, + {["uid"]="ramp-slow", ["delay"]= 250, ["up"]=03,["down"]=1}, + {["uid"]="ramp-normal", ["delay"]= 100, ["up"]=06,["down"]=2}, + }, ["subdevs"] = { {["subdev"]= 0, ["numid"]= 51}, {["subdev"]= 1, ["numid"]= 57}, @@ -61,6 +66,7 @@ function _mixer_simple_test_ (source, args) ["uid"] = "Alsa-Loop", ["devpath"] = "/dev/snd/by-path/platform-snd_aloop.0", ["params"] = audio_defaults, + ["ramps"] = aloop.ramps, ["devices"] = aloop.devices, ["subdevs"] = aloop.subdevs, } @@ -72,8 +78,8 @@ function _mixer_simple_test_ (source, args) ["devpath"]= "/dev/snd/by-id/usb-YAMAHA_Corporation_YAMAHA_AP-U70_USB_Audio_00-00", ["params"] = snd_params, ["sink"] = { - [0]= {["uid"]= "front-right", ["port"]= 0}, - [1]= {["uid"]= "front-left", ["port"]= 1}, + {["uid"]= "front-right", ["port"]= 0}, + {["uid"]= "front-left", ["port"]= 1}, } } @@ -82,8 +88,8 @@ function _mixer_simple_test_ (source, args) ["devpath"]= "/dev/snd/by-id/usb-0b0e_Jabra_SOLEMATE_v1.34.0-00", ["params"] = snd_params, ["sink"] = { - [0]= {["uid"]= "front-right", ["port"]= 0}, - [1]= {["uid"]= "front-left", ["port"]= 1}, + {["uid"]= "front-right", ["port"]= 0}, + {["uid"]= "front-left", ["port"]= 1}, } } @@ -102,13 +108,23 @@ function _mixer_simple_test_ (source, args) local stream_music= { ["uid"] = "multimedia", ["zone"] = "front-seats", - ["volume"]= 70, + ["ramp"] = "ramp-slow", + ["volume"]= 60, ["mute"] = false, } local stream_navigation= { ["uid"] = "navigation", ["zone"] = "front-seats", + ["ramp"] = "ramp-normal", + ["volume"]= 70, + ["mute"] = false, + } + + local stream_emergency= { + ["uid"] = "emergency", + ["zone"] = "front-seats", + ["ramp"] = "ramp-fast", ["volume"]= 80, ["mute"] = false, } @@ -119,7 +135,7 @@ function _mixer_simple_test_ (source, args) ["backend"] = {snd_yamaha}, ["frontend"]= {snd_aloop}, ["zones"] = {zone_front}, - ["streams"] = {stream_music,stream_navigation}, + ["streams"] = {stream_music,stream_navigation,stream_emergency}, } local error,response= smix:_mixer_new_ (source, MyMixer) @@ -132,11 +148,11 @@ function _mixer_simple_test_ (source, args) -- ================== Happy End ============================= - AFB:notice (source, "--InLua-- _mixer_config_ done") + AFB:notice (source, "--InLua-- Test success") return 0 end -- ================= Unhappy End ============================ ::OnErrorExit:: - AFB:error (source, "--InLua-- snd_attach fail") + AFB:error (source, "--InLua-- Test fail") return 1 -- unhappy end -- end |