aboutsummaryrefslogtreecommitdiffstats
path: root/htdocs
diff options
context:
space:
mode:
Diffstat (limited to 'htdocs')
-rw-r--r--htdocs/AFB-websock.js6
-rw-r--r--htdocs/AudioBinding.js80
-rw-r--r--htdocs/README.md2
-rw-r--r--htdocs/alsa-core.html28
-rw-r--r--htdocs/alsa-hal.html16
-rw-r--r--htdocs/audio-control.html20
-rw-r--r--htdocs/audio-logic.html2
7 files changed, 77 insertions, 77 deletions
diff --git a/htdocs/AFB-websock.js b/htdocs/AFB-websock.js
index ff9fa60..99ab3b8 100644
--- a/htdocs/AFB-websock.js
+++ b/htdocs/AFB-websock.js
@@ -123,14 +123,14 @@ var AFB_websocket;
switch (code) {
case RETOK:
reply(this.pendings, id, ans, 0);
- break;
+ break;
case RETERR:
reply(this.pendings, id, ans, 1);
- break;
+ break;
case EVENT:
default:
fire(this.awaitens, id, ans);
- break;
+ break;
}
}
diff --git a/htdocs/AudioBinding.js b/htdocs/AudioBinding.js
index 4d14600..0f5caf9 100644
--- a/htdocs/AudioBinding.js
+++ b/htdocs/AudioBinding.js
@@ -37,50 +37,50 @@
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, " "));
}
-
+
// default soundcard is "PCH"
var devid=getParameterByName("devid");
if (!devid) devid="hw:1";
-
+
var haldev=getParameterByName("haldev");
if (!haldev) haldev="scarlett-usb";
-
+
var sndname=getParameterByName("sndname");
if (!sndname) sndname="PCH";
-
+
var mode=getParameterByName("mode");
if (!mode) mode="0";
-
+
function replyok(obj) {
console.log("replyok:" + JSON.stringify(obj));
document.getElementById("output").innerHTML = "OK: "+ syntaxHighlight(obj);
}
-
+
function replyerr(obj) {
console.log("replyerr:" + JSON.stringify(obj));
document.getElementById("output").innerHTML = "ERROR: "+ syntaxHighlight(obj);
}
-
+
function gotevent(obj) {
console.log("gotevent:" + JSON.stringify(obj));
document.getElementById("outevt").innerHTML = (evtidx++) +": "+JSON.stringify(obj);
}
-
+
function send(message) {
var api = document.getElementById("api").value;
var verb = document.getElementById("verb").value;
document.getElementById("question").innerHTML = "subscribe: "+api+"/"+verb + " (" + JSON.stringify(message) +")";
ws.call(api+"/"+verb, {data:message}).then(replyok, replyerr);
}
-
- // On button click from HTML page
+
+ // On button click from HTML page
function callbinder(api, verb, query) {
console.log ("subscribe api="+api+" verb="+verb+" query=" +query);
- var question = urlws +"/" +api +"/" +verb + "?query=" + JSON.stringify(query);
+ var question = urlws +"/" +api +"/" +verb + "?query=" + JSON.stringify(query);
document.getElementById("question").innerHTML = syntaxHighlight(question);
ws.call(api+"/"+verb, query).then(replyok, replyerr);
}
@@ -89,26 +89,26 @@
// Retreive Select value and Text from the binder
// Note: selection of value/text for a given context is huggly!!!
function querySelectList (elemid, api, verb, query) {
-
+
console.log("querySelectList elemid=%s api=%s verb=%s query=%s", elemid, api, verb, query);
-
+
var selectobj = document.getElementById(elemid);
if (!selectobj) {
return;
}
-
+
// onlick update selected HAL api
selectobj.onclick=function(){
- sndcard= this.value;
- console.log ("Default Selection=" + sndcard);
+ sndcard= this.value;
+ console.log ("Default Selection=" + sndcard);
};
function gotit (result) {
-
+
// display response as for normal onclick action
replyok(result);
var response=result.response;
-
+
// fulfill select with avaliable active HAL
for (idx=0; idx<response.length; idx++) {
var opt = document.createElement('option');
@@ -120,39 +120,39 @@
// HAL selection mode
if (response[idx].shortname) opt.text = response[idx].shortname;
if (response[idx].api) opt.value = response[idx].api;
-
+
selectobj.appendChild(opt);
}
-
+
sndcard= selectobj.value;
}
-
- var question = urlws +"/"+api +"/" +verb + "?query=" + JSON.stringify(query);
+
+ var question = urlws +"/"+api +"/" +verb + "?query=" + JSON.stringify(query);
document.getElementById("question").innerHTML = syntaxHighlight(question);
// request lowlevel ALSA to get API list
ws.call(api+"/"+verb, query).then(gotit, replyerr);
}
-
+
function refresh_list (self, api, verb, query) {
console.log("refresh_list id=%s api=%s verb=%s query=%s", self.id, api, verb, query);
-
- if (self.value > 0) return;
-
+
+ if (self.value > 0) return;
+
// onlick update selected HAL api
self.onclick=function(){
- numid = parseInt(self.value);
- console.log ("Default numid=%d", numid);
+ numid = parseInt(self.value);
+ console.log ("Default numid=%d", numid);
};
function gotit (result) {
-
+
// display response as for normal onclick action
replyok(result);
var response=result.response;
-
+
// fulfill select with avaliable active HAL
for (idx=0; idx<response.length; idx++) {
var opt = document.createElement('option');
@@ -160,27 +160,27 @@
// Alsa LowLevel selection mode
opt.text = response[idx].name + ' id=' + response[idx].id;
opt.value = response[idx].id;
-
+
self.appendChild(opt);
- }
+ }
self.selectedIndex=2;
- numid = parseInt (self.value);
+ numid = parseInt (self.value);
}
-
- var question = urlws +"/"+api +"/" +verb + "?query=" + JSON.stringify(query);
+
+ var question = urlws +"/"+api +"/" +verb + "?query=" + JSON.stringify(query);
document.getElementById("question").innerHTML = syntaxHighlight(question);
// request lowlevel ALSA to get API list
ws.call(api+"/"+verb, query).then(gotit, replyerr);
}
-
-
+
+
function init(elemid, api, verb, query) {
-
+
function onopen() {
// check for active HALs
querySelectList (elemid, api, verb, query);
-
+
document.getElementById("main").style.visibility = "visible";
document.getElementById("connected").innerHTML = "Binder WS Active";
document.getElementById("connected").style.background = "lightgreen";
@@ -192,6 +192,6 @@
document.getElementById("connected").innerHTML = "Connected Closed";
document.getElementById("connected").style.background = "red";
- }
+ }
ws = new afb.ws(onopen, onabort);
}
diff --git a/htdocs/README.md b/htdocs/README.md
index bb14b7e..bb5f9fb 100644
--- a/htdocs/README.md
+++ b/htdocs/README.md
@@ -1,7 +1,7 @@
------------------------------------------------------------------------
Basic HTML & WS test
------------------------------------------------------------------------
-
+
# Load bindings directly from development tree for debug
afb-daemon --verbose --verbose --token="" --ldpaths=build --port=1234 --roothttp=htdocs
diff --git a/htdocs/alsa-core.html b/htdocs/alsa-core.html
index e946bdb..d8a02d6 100644
--- a/htdocs/alsa-core.html
+++ b/htdocs/alsa-core.html
@@ -2,23 +2,23 @@
<head>
<link rel="stylesheet" href="AudioBinding.css">
<title>Alsa Low Level Simple Test</title>
-
+
<script type="text/javascript" src="AFB-websock.js"></script>
<script type="text/javascript" src="AudioBinding.js"></script>
</head>
-
+
<body onload="init('alsa_registry','alsacore', 'getinfo')">
-
+
<button id="connected" onclick="init('alsa_registry','alsacore', 'getinfo');">Binder WS Fail</button>
<br><br>
<b>Selected SndCard </b>
<select id='alsa_registry'></select>
<b>Select NUMID </b>
- <select id='alsa_ctl_list' onclick="refresh_list(this, 'alsacore', 'getctl', {devid:sndcard, mode:1})">
+ <select id='alsa_ctl_list' onclick="refresh_list(this, 'alsacore', 'getctl', {devid:sndcard, mode:1})">
<option value='-1'>Refresh NUMID list</option>
- </select>
-
+ </select>
+
<b>API Verbosity </b>
<select id='api_verbosity' onclick='mode=this.value'>
<option value='0'>Quiet</option>
@@ -26,7 +26,7 @@
<option value='2'>Verbose</option>
<option value='3'>Full</option>
</select>
-
+
<br>
<ol>
@@ -34,29 +34,29 @@
<li><button onclick="callbinder('alsacore','getctl', {devid:sndcard, mode:mode, ctl:[numid]})">Get Alsa Ctls [numid]</button></li>
<li><button onclick="callbinder('alsacore','getctl', {devid:sndcard, mode:mode, ctl:[numid,numid+1]})">Get Alsa Ctls [numid,numid+1]</button></li>
<br>
-
-
+
+
<li><button onclick="callbinder('alsacore','setctl', {devid:sndcard, mode:mode, ctl:[[9,20]]})">Set Alsa Ctl ctl:[[9,20]]</button></li>
<li><button onclick="callbinder('alsacore','setctl', {devid:sndcard, mode:mode, ctl:[{id:9,val:50}]})">Set Alsa Ctl ctl:[{id:9,val:50}]}</button></li>
<li><button onclick="callbinder('alsacore','setctl', {devid:sndcard, mode:mode, ctl:[[6,[20,20]]]})">Set Alsa Ctl ctl:[[6,[20,20]]]</button></li>
<li><button onclick="callbinder('alsacore','setctl', {devid:sndcard, mode:mode, ctl:[{id:6,val:[50,50]}]})">Set Alsa Ctl ctl:[{id:2,val:[50,50]}]</button></li>
<li><button onclick="callbinder('alsacore','setctl', {devid:sndcard, mode:mode, ctl:[{id:6,val:[50,50]}, {id:9,val:50,50}]})">Set Alsa Ctl ctl:[{id:6,val:[50,50]}, {id:9,val:50,50}]</button></li>
- <br>
+ <br>
<li><button onclick="callbinder('alsacore','ucmquery', {devid:sndcard, mode:mode})">List UCM verbs</button></li>
<li><button onclick="callbinder('alsacore','ucmset' , {devid:sndcard, mode:mode, verb:'HiFi'})">Set UCM HiFi</button></li>
<li><button onclick="callbinder('alsacore','ucmset' , {devid:sndcard, mode:mode, verb:'HiFi', dev:'Headphone'})">Set UCM HiFi+Headphone</button></li>
<li><button onclick="callbinder('alsacore','ucmset' , {devid:sndcard, mode:mode, verb:'HiFi', dev:'Headphone', mod:'RecordMedia'})">Set UCM HiFi+Headphone+RecordMedia</button></li>
- <br>
+ <br>
<li><button onclick="callbinder('alsacore','ucmget' , {devid:sndcard, mode:mode, values:['OutputDspName','PlaybackPCM','CapturePCM']})">Get UCM OutputDspName+PlaybackPCM+CapturePCM (SET UCM)</button></li>
- <br>
+ <br>
<li><button onclick="callbinder('alsacore','subscribe', {devid:sndcard})">Subscribe AlsaCtl Events</button></li>
<br>
</ol>
-
+
<div id="main" style="visibility:hidden">
<ol>
<li>Question <pre id="question"></pre>
<li>Response <pre id="output"></pre>
<li>Events: <pre id="outevt"></pre>
</ol>
- </div>
+ </div>
diff --git a/htdocs/alsa-hal.html b/htdocs/alsa-hal.html
index 013c547..c05605d 100644
--- a/htdocs/alsa-hal.html
+++ b/htdocs/alsa-hal.html
@@ -6,27 +6,27 @@
<script type="text/javascript" src="AudioBinding.js"></script>
</head>
-
+
<body onload="init('hal_registry','alsacore', 'hallist')">
-
+
<h1>Simple AlsaHAL tests</h1>
<button id="connected" onclick="init('hal_registry','alsacore', 'hallist')">Binder WS Fail</button>
<br><br>
<b>Selected HAL </b>
<select id='hal_registry'></select>
-
+
<b>API Verbosity </b>
<select id='api_verbosity' onclick='mode=this.value'>
<option value='0'>Quiet</option>
<option value='1'>Compact</option>
<option value='2'>Verbose</option>
<option value='3'>Full</option>
- </select>
+ </select>
<br>
<br>
<ol>
-
+
<li><button onclick="callbinder(sndcard,'ctllist')">List Selected HAL Controls </button></li>
<li><button onclick="callbinder(sndcard,'ctlget', {label:'Master_Playback_Volume'})">Get {label:'Master_Playback_Volume'}</button></li>
<li><button onclick="callbinder(sndcard,'ctlget', [{tag:4},{tag:5}])">Get[{tag:4},{tag:5}]</button></li>
@@ -37,18 +37,18 @@
<li><button onclick="callbinder(sndcard,'ctlset', [{tag:4, val:25},{tag:5, val:25}])">Set[{tag:4, val:25},{tag:5, val:25}]</button></li>
<li><button onclick="callbinder(sndcard,'ctlset', [{tag:4, val:[55,45]},{tag:5, val:[45,55]}])">Set[{tag:4, val:[55,45]},{tag:5, val:[45,55]}]]</button></li>
<br>
-
+
<li>
<label for="volramp">Volume Ramp</label>
<input id="volramp" type="number" min=0 max=100 step=10 maxlength=3 placeholder="Enter 0-100" onChange="callbinder(sndcard,'ctl-set', {label:'Volume_Ramp', val:this.value})">
</li>
<br>
</ol>
-
+
<div id="main" style="visibility:hidden">
<ol>
<li>Question <pre id="question"></pre>
<li>Response <pre id="output"></pre>
<li>Events: <pre id="outevt"></pre>
</ol>
- </div>
+ </div>
diff --git a/htdocs/audio-control.html b/htdocs/audio-control.html
index 06010e5..46352c1 100644
--- a/htdocs/audio-control.html
+++ b/htdocs/audio-control.html
@@ -5,41 +5,41 @@
<script type="text/javascript" src="AFB-websock.js"></script>
<script type="text/javascript" src="AudioBinding.js"></script>
</head>
-
+
<body onload="init('hal_registry','alsacore', 'hallist')">
-
+
<h1>Simple Audio Control Test</h1>
<button id="connected" onclick="init('hal_registry','alsacore', 'hallist')">Binder WS Fail</button>
<br><br>
<b>Selected HAL </b>
<select id='hal_registry'></select>
-
+
<b>API Verbosity </b>
<select id='api_verbosity' onclick='mode=this.value'>
<option value='0'>Quiet</option>
<option value='1'>Compact</option>
<option value='2'>Verbose</option>
<option value='3'>Full</option>
- </select>
+ </select>
<br>
<br>
-
+
<ol>
-
+
<li><button onclick="callbinder('control','dispatch' ,{'target':'navigation','args':{'apihal':sndcard}});">Dispatch Navigation</button></li>
<li><button onclick="callbinder('control','dispatch' ,{'target':'multimedia','args':{'apihal':sndcard}});">Dispatch Mutimedia</button></li>
<li><button onclick="callbinder('control','dispatch' ,{'target':'emergency' });">Dispatch Emergency</button></li>
- <br>
+ <br>
<li><button onclick="callbinder('control','request' , {'target':'_Simple_Echo_Args', 'args':{speed:20}});">LUA function</button></li>
<li><button onclick="callbinder('control','request' , {'target':'_Simple_Timer_Test', args:{label:'MyTimer', 'delay':3000, 'count':10}});">LUA Timer</button></li>
<li><button onclick="callbinder('control','debuglua' , {'target':'helloworld', args:{'arg1':'abcd', 'next':7890, 'last':[1,2,3,4]}});">LUA script</button></li>
-
+
</ol>
-
+
<div id="main" style="visibility:hidden">
<ol>
<li>Question <pre id="question"></pre>
<li>Response <pre id="output"></pre>
<li>Events: <pre id="outevt"></pre>
</ol>
- </div>
+ </div>
diff --git a/htdocs/audio-logic.html b/htdocs/audio-logic.html
index c31282a..6eb97e3 100644
--- a/htdocs/audio-logic.html
+++ b/htdocs/audio-logic.html
@@ -1,7 +1,7 @@
<html>
<head>
<title>High Level API Simple Test Page</title>
-
+
<script type="text/javascript" src="AFB-websock.js"></script>
<script type="text/javascript" src="AudioBinding.js"></script>
</head>