Changes for updated GetASIODevices with no callback

This commit is contained in:
Jonathon Wilson 2012-12-30 13:48:24 -07:00
parent d491025e3b
commit 9a6d15280b
2 changed files with 33 additions and 8 deletions

View File

@ -13,7 +13,8 @@
jSession: '#testBridge-joinSession',
testLatency: '#testBridge-TestLatency',
testLatencyResponse: '#testBridge-TestLatencyResponse',
getDevices: '#testBridge-GetDevices'
getDevices: '#testBridge-GetDevices',
ftue: '#testBridge-GetSetFTUE'
};
function afterShow(data) {}
@ -88,14 +89,22 @@
}
function getDevicesHandler(evt) {
var jsFunction = "JK.GetASIODevicesResponse";
logger.debug("About to try and call jamClient.GetASIODevices. Here's full jamClient:");
logger.debug(context.jamClient);
context.jamClient.GetASIODevices(jsFunction);
var response = context.jamClient.GetASIODevices();
logger.debug(response);
$(selectors.getDevices + ' textarea').val(JSON.stringify(response));
}
function GetASIODevicesResponse(response) {
$(selectors.getDevices + ' textarea').val(JSON.stringify(response));
function getFTUEHandler(evt) {
var response = context.jamClient.GetFTUE();
logger.debug(response);
$(selectors.ftue + ' textarea[data-what="GetFTUE"]').val(JSON.stringify(response));
}
function setFTUEHandler(evt) {
var val = Boolean($(selectors.ftue + ' form input[name="ftue"]:checked').val());
logger.debug('ftue:' + val);
logger.debug(typeof(val));
context.jamClient.SetFTUE(val);
}
function events() {
@ -103,6 +112,8 @@
$(selectors.jSession + ' input[type="button"]').click(joinSessionHandler);
$(selectors.testLatency + ' input[type="button"]').click(testLatencyHandler);
$(selectors.getDevices + ' input[type="button"]').click(getDevicesHandler);
$(selectors.ftue + ' input[type="button"][value="Get"]').click(getFTUEHandler);
$(selectors.ftue + ' input[type="button"][value="Set"]').click(setFTUEHandler);
}
function initialize() {
@ -116,7 +127,6 @@
this.initialize = initialize;
context.JK.TestBridgeLatencyResponse = latencyResponse;
context.JK.GetASIODevicesResponse = GetASIODevicesResponse;
};

View File

@ -34,6 +34,21 @@
</div>
<hr/>
<div id="testBridge-GetSetFTUE" style="float:left;">
<div style="float:left">
<h2>GetFTUE</h2>
<input type="button" value="Get"/>
<textarea data-what="GetFTUE"></textarea>
</div>
<div style="float:left;"
<h2>SetFTUE</h2>
<form>
<label>true <input name="ftue" type="radio" value="true"/></label>
<label>false <input name="ftue" type="radio" value=""/></label>
<input type="button" value="Set"/>
</form>
</div>
</div>
<div id="testBridge-GetDevices">
<h2>GetASIODevices</h2>
<input type="button" value="Invoke"/>