aboutsummaryrefslogtreecommitdiffstats
path: root/htdocs/audio-logic.html
diff options
context:
space:
mode:
authorFulup Ar Foll <fulup@iot.bzh>2017-03-08 23:56:40 +0100
committerFulup Ar Foll <fulup@iot.bzh>2017-03-08 23:56:40 +0100
commita237499e8c2e2a045ae3eea0b9a4aaac12032e81 (patch)
tree4971c10f24585fa04f0a414cb319d3b0554c8a85 /htdocs/audio-logic.html
parent1393b5d318e22dbd1625692847a51c27932fd442 (diff)
Late Evening Commit
Diffstat (limited to 'htdocs/audio-logic.html')
-rw-r--r--htdocs/audio-logic.html47
1 files changed, 18 insertions, 29 deletions
diff --git a/htdocs/audio-logic.html b/htdocs/audio-logic.html
index ff806ad..79ab114 100644
--- a/htdocs/audio-logic.html
+++ b/htdocs/audio-logic.html
@@ -2,39 +2,28 @@
<head>
<title>Hello world test</title>
- <script type="text/javascript" src="websock.js"></script>
- <script type="text/javascript">
- var ws;
-
- function onopen() {
- document.getElementById("main").style.visibility = "visible";
- document.getElementById("connected").innerHTML = "WebSocket Open";
- }
- function onabort() {
- document.getElementById("main").style.visibility = "hidden";
- document.getElementById("connected").innerHTML = "Connected Closed";
- }
- function init() {
- ws = new AfbWsItf("api", onopen, onabort, new AfbCtxItf("mysecret"));
- }
- function replyok(obj) {
- document.getElementById("output").innerHTML = "OK: "+JSON.stringify(obj);
- }
- function replyerr(obj) {
- document.getElementById("output").innerHTML = "ERROR: "+JSON.stringify(obj);
- }
- function subscribe(devid) {
- ws.call("alsacore", "subctl", {devid:devid}, replyok, replyerr);
- }
- </script>
+ <script type="text/javascript" src="AFB-websock.js"></script>
+ <script type="text/javascript" src="AudioBinding.js"></script>
<body onload="init();">
<h1>Hello world test</h1>
+ <button id="connected">Binder WS Fail</button></li>
+ <br>
<ol>
- <li><a href="api/audio/setvol?devid=hw:0&pcm=master&vol=50%">Set Master PCM volume to 50%</a>
- <li><a href="api/audio/getvol?devid=hw:0&pcm=master">Get Master PCM volume</a>
- <li><a href="api/alsacore/monitor?devid=hw:0">Activate devid=hw:0 monitoring</a>
- <li><button id="connected" onclick="subscribe('hw:0')">Click to Subscribe</button></li>
+ <li><button onclick="callbinder('audio','open',{sndname: sndname})">Open SndCard</button></li>
+ <br>
+ <li><button onclick="callbinder('audio','setvol', {pcm:'master', vol='+10'})">Increase +10 Master</button></li>
+ <li><button onclick="callbinder('audio','setvol', {pcm:'master', vol='-10'})">Decrease -10 Master</button></li>
+ <li><button onclick="callbinder('audio','setvol', {pcm:'master', vol='%50'})">SetVol %50 Master</button></li>
+ <li><button onclick="callbinder('audio','getvol', {pcm:'master'})">GetVolume Master</button></li>
+ <br>
+ <li><button onclick="callbinder('audio','monitor')">Monitor LowLevel Events</button></li>
+ <li><button onclick="callbinder('audio','subscribe')">Subscribe AudioBinding Events</button></li>
+ <br>
+ <li><button onclick="callbinder('audio','close')">Close SndCard</button></li>
+
+ <br>
<div id="main" style="visibility:hidden">
Server says... <div id="output"></div>
+ Events: <div id="outevt"></div>
</div>