Finish FTUE functional, but bugs in bridge prevent test. Checking in to let Nat see test code. Re-include TestLatency on fakeJamClient to fix failing test.
This commit is contained in:
parent
914bc7302f
commit
fd57f3f01e
|
|
@ -53,9 +53,8 @@
|
|||
function StopRecording(map) { dbg('StopRecording' + JSON.stringify(arguments)); }
|
||||
function TestASIOLatency(s) { dbg('TestASIOLatency' + JSON.stringify(arguments)); }
|
||||
|
||||
|
||||
function testLatency(clientID, callbackFunctionName) {
|
||||
logger.debug("Fake JamClient: testLatency called with client, " + clientID + " and callback function name: " + callbackFunctionName);
|
||||
function TestLatency(clientID, callbackFunctionName) {
|
||||
logger.debug("Fake JamClient: TestLatency called with client, " + clientID + " and callback function name: " + callbackFunctionName);
|
||||
var response = {
|
||||
clientID: clientID,
|
||||
latency: 50
|
||||
|
|
@ -95,6 +94,7 @@
|
|||
this.StopPlayTest = StopPlayTest;
|
||||
this.StopRecording = StopRecording;
|
||||
this.TestASIOLatency = TestASIOLatency;
|
||||
this.TestLatency = TestLatency;
|
||||
this.connected = true;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@
|
|||
context.JK.FTUEScreen = function(app) {
|
||||
var logger = context.JK.logger;
|
||||
var jamClient = context.jamClient;
|
||||
var playbackTestRunning = false;
|
||||
var recordingTestRunning = false;
|
||||
|
||||
function beforeShow(data) {
|
||||
loadDevices();
|
||||
|
|
@ -60,6 +62,10 @@
|
|||
$('#choose-output-audio-device select').html(outputOptions.join(''));
|
||||
}
|
||||
|
||||
/**
|
||||
* Use the currently selecting input and output device to call SetASIOEnabled
|
||||
* on the bridge.
|
||||
*/
|
||||
function enableAudioDevices() {
|
||||
var input = $('#choose-input-audio-device select').val().split('.');
|
||||
var output = $('#choose-output-audio-device select').val().split('.');
|
||||
|
|
@ -72,8 +78,66 @@
|
|||
parseInt(output[2], 10));
|
||||
}
|
||||
|
||||
function testLatency() {
|
||||
$('#latency-testing p').html("Testing latency...");
|
||||
context.jamClient.TestASIOLatency("JK.latencyTestingComplete");
|
||||
}
|
||||
|
||||
function latencyTestingComplete() {
|
||||
logger.debug("latencyTestingComplete. Arguments:");
|
||||
logger.debug(arguments);
|
||||
$('#latency-testing p').html("Done.");
|
||||
}
|
||||
|
||||
function playbackButtonHandler(evt) {
|
||||
if (playbackTestRunning) {
|
||||
$('#playback-testing p').html('Test stopped by user');
|
||||
$('#playbackTestingButton').html('Start Playback Test');
|
||||
playbackTestRunning = false;
|
||||
context.jamClient.StopPlayTest();
|
||||
} else {
|
||||
$('#playback-testing p').html('Playback test in progress... Click the button below when things start to sound crappy');
|
||||
$('#playbackTestingButton').html('Click when things sound bad...');
|
||||
playbackTestRunning = true;
|
||||
context.jamClient.StartPlayTest('JK.playbackTestComplete');
|
||||
}
|
||||
}
|
||||
|
||||
function playbackTestComplete() {
|
||||
logger.debug('playbackTestComplete. Arguments:');
|
||||
logger.debug(arguments);
|
||||
$('#playback-testing p').html('Done');
|
||||
$('#playbackTestingButton').html('Start Playback Test');
|
||||
playbackTestRunning = false;
|
||||
}
|
||||
|
||||
function recordingButtonHandler(evt) {
|
||||
if (recordingTestRunning) {
|
||||
$('#recording-testing p').html('Recording complete.');
|
||||
$('#recordingTestingButton').html('Start Recording Test');
|
||||
recordingTestRunning = false;
|
||||
context.jamClient.RecordTestEnd();
|
||||
} else {
|
||||
$('#recording-testing p').html('Recording in progress... Click the button below to stop recording');
|
||||
$('#recordingTestingButton').html('Stop Recording');
|
||||
recordingTestRunning = true;
|
||||
context.jamClient.RecordTestBegin();
|
||||
}
|
||||
}
|
||||
|
||||
function recordingPlaybackButtonHandler(evt) {
|
||||
context.jamClient.RecordTestPlayback();
|
||||
}
|
||||
|
||||
function events() {
|
||||
$('#enableDevices').click(enableAudioDevices);
|
||||
$('#enableDevices').click(function() {
|
||||
enableAudioDevices();
|
||||
testLatency();
|
||||
});
|
||||
|
||||
$('#playbackTestingButton').click(playbackButtonHandler);
|
||||
$('#recordingTestingButton').click(recordingButtonHandler);
|
||||
$('#recordingTestPlaybackButton').click(recordingPlaybackButtonHandler);
|
||||
}
|
||||
|
||||
function initialize() {
|
||||
|
|
@ -85,6 +149,10 @@
|
|||
// Expose publics
|
||||
this.initialize = initialize;
|
||||
|
||||
// Expose callbacks for the bridge on the global namespace
|
||||
context.JK.latencyTestingComplete = latencyTestingComplete;
|
||||
context.JK.playbackTestComplete = playbackTestComplete;
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,25 @@
|
|||
<select>
|
||||
</select>
|
||||
</label>
|
||||
<button id="enableDevices">Next</button>
|
||||
<button id="enableDevices">Enable Selected and Test Latency</button>
|
||||
</div>
|
||||
|
||||
<div id="latency-testing">
|
||||
<h2>Latency Testing</h2>
|
||||
<p></p>
|
||||
</div>
|
||||
|
||||
<div id="playback-testing">
|
||||
<h2>Playback Testing</h2>
|
||||
<p>Click the button below to start a playback test. We'll start with safe settings, and then lower the values for better latency. When things begin to sound bad, click the button again.</p>
|
||||
<button id="playbackTestingButton">Start Playback Test</button>
|
||||
</div>
|
||||
|
||||
<div id="recording-testing">
|
||||
<h2>Recording Testing</h2>
|
||||
<p>When ready, click the button below to enable recording of your audio input. When done, click the button again, and use the other button for playback to see how things sound.</p>
|
||||
<button id="recordingTestingButton">Start Recording Test</button>
|
||||
<button id="recordingTestPlaybackButton">Playback Recorded Audio</button>
|
||||
</div>
|
||||
|
||||
<p>If everything looks good, then <a cucumber-id="ftue-home-link" href="#/home">WE'RE DONE</a>.</p>
|
||||
|
|
|
|||
Loading…
Reference in New Issue