VRFS-604 show disconnected devices in FTUE
This commit is contained in:
parent
57ea6134ff
commit
9a1bba988b
|
|
@ -28,15 +28,7 @@
|
|||
|
||||
var audioProfiles = prettyPrintAudioProfiles(context.jamClient.TrackGetDevices());
|
||||
|
||||
var badAudioConfigs = [];
|
||||
var allAudioConfigs = context.jamClient.FTUEGetAllAudioConfigurations();
|
||||
var goodAudioConfigs = context.jamClient.FTUEGetGoodAudioConfigurations();
|
||||
|
||||
for (var i=0; i < allAudioConfigs.length; i++) {
|
||||
if ($.inArray(allAudioConfigs[i], goodAudioConfigs) === -1) {
|
||||
badAudioConfigs.push(allAudioConfigs[i]);
|
||||
}
|
||||
}
|
||||
var badAudioConfigs = context.JK.getBadAudioConfigs();
|
||||
|
||||
var template = context.JK.fillTemplate($('#template-account-main').html(), {
|
||||
email: userDetail.email,
|
||||
|
|
@ -49,7 +41,7 @@
|
|||
});
|
||||
$('#account-content-scroller').html(template);
|
||||
|
||||
badAudioConfigs.join(", ")
|
||||
badAudioConfigs.join(", ");
|
||||
}
|
||||
|
||||
function prettyPrintAudioProfiles(devices) {
|
||||
|
|
|
|||
|
|
@ -32,28 +32,18 @@
|
|||
|
||||
$('#account-audio-content-scroller table tbody').html('');
|
||||
|
||||
var badAudioConfigs = [];
|
||||
var allAudioConfigs = context.jamClient.FTUEGetAllAudioConfigurations();
|
||||
var goodAudioConfigs = context.jamClient.FTUEGetGoodAudioConfigurations();
|
||||
var badAudioConfigs = context.JK.getBadAudioConfigs();
|
||||
|
||||
for (var i=0; i < allAudioConfigs.length; i++) {
|
||||
console.log("allAudioConfigs[i]=%o", allAudioConfigs[i]);
|
||||
if ($.inArray(allAudioConfigs[i], goodAudioConfigs) === -1) {
|
||||
console.log("pushing %o onto badAudioConfigs", allAudioConfigs[i]);
|
||||
badAudioConfigs.push(allAudioConfigs[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// render CONNECTED device profiles
|
||||
// render valid device profiles
|
||||
var options = {
|
||||
configurations: goodAudioConfigs,
|
||||
configurations: context.JK.getGoodAudioConfigs(),
|
||||
valid: 1
|
||||
}
|
||||
|
||||
var template = context._.template($('#template-account-audio').html(), options, {variable: 'data'});
|
||||
appendAudio(template);
|
||||
|
||||
// render DISCONNECTED device profiles
|
||||
// render invalid device profiles
|
||||
options = {
|
||||
configurations: badAudioConfigs,
|
||||
valid: 0
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@
|
|||
context.JK.GA.trackSessionMusicians(context.JK.GA.SessionCreationTypes.create);
|
||||
},
|
||||
error: function() {
|
||||
app.ajaxError(arguments);
|
||||
app.notifyServerError(arguments0, "Unable to Create Session");
|
||||
$('#btn-create-session').removeClass('button-disabled');
|
||||
$('#btn-create-session').unbind('click', false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -465,9 +465,14 @@
|
|||
];
|
||||
var optionsHtml = '';
|
||||
var deviceOptionFunc = function (deviceKey, index, list) {
|
||||
optionsHtml += '<option title="' + devices[deviceKey] + '" value="' + deviceKey + '">' +
|
||||
devices[deviceKey] + '</option>';
|
||||
optionsHtml += '<option title="' + devices[deviceKey] + '" value="' + deviceKey + '">' + devices[deviceKey] + '</option>';
|
||||
};
|
||||
var badDeviceOptionFunc = function(deviceKey, index, list) {
|
||||
optionsHtml += '<option disabled="disabled" title="' + deviceKey + '" value="' + deviceKey + '">' + deviceKey + ' (unavailable)' + '</option>';
|
||||
};
|
||||
|
||||
var badAudioConfigs = context.JK.getBadAudioConfigs();
|
||||
|
||||
for (var i = 0; i < funcs.length; i++) {
|
||||
optionsHtml = '<option selected="selected" value="">Choose...</option>';
|
||||
|
||||
|
|
@ -476,10 +481,11 @@
|
|||
$select.empty();
|
||||
var sortedDeviceKeys = context._.keys(devices).sort();
|
||||
context._.each(sortedDeviceKeys, deviceOptionFunc);
|
||||
context._.each(badAudioConfigs, badDeviceOptionFunc);
|
||||
$select.html(optionsHtml);
|
||||
context.JK.dropdown($select);
|
||||
$select.removeAttr("disabled");
|
||||
$('[layout-wizard-step="2"] .settings-asio select').removeAttr("disabled").easyDropDown('enable')
|
||||
$('[layout-wizard-step="2"] .settings-asio select').removeAttr("disabled").easyDropDown('enable');
|
||||
// Set selects to lowest possible values to start:
|
||||
$('#asio-framesize').val('2.5').change();
|
||||
$('#asio-input-latency').val('0').change();
|
||||
|
|
@ -505,6 +511,12 @@
|
|||
drivers[driverKey] + '</option>';
|
||||
};
|
||||
|
||||
var badDeviceOptionFunc = function(deviceKey, index, list) {
|
||||
optionsHtml += '<option disabled="disabled" title="' + deviceKey + '" value="' + deviceKey + '">' + deviceKey + ' (unavailable)' + '</option>';
|
||||
};
|
||||
|
||||
var badAudioConfigs = context.JK.getBadAudioConfigs();
|
||||
|
||||
var optionsHtml = '<option selected="selected" value="">Choose...</option>';
|
||||
var selectors = [
|
||||
'[layout-wizard-step="0"] .settings-2-device select',
|
||||
|
|
@ -513,6 +525,7 @@
|
|||
];
|
||||
var sortedDeviceKeys = context._.keys(drivers).sort();
|
||||
context._.each(sortedDeviceKeys, driverOptionFunc);
|
||||
context._.each(badAudioConfigs, badDeviceOptionFunc);
|
||||
$.each(selectors, function (index, selector) {
|
||||
var $select = $(selector);
|
||||
$select.empty();
|
||||
|
|
|
|||
|
|
@ -642,7 +642,25 @@
|
|||
var result = context.jamClient.FTUEGetGoodConfigurationList();
|
||||
console.log("hasOneConfiguredDevice: ", result);
|
||||
return result.length > 0;
|
||||
}
|
||||
};
|
||||
|
||||
context.JK.getGoodAudioConfigs = function() {
|
||||
return context.jamClient.FTUEGetGoodAudioConfigurations();
|
||||
};
|
||||
|
||||
context.JK.getBadAudioConfigs = function() {
|
||||
var badAudioConfigs = [];
|
||||
var allAudioConfigs = context.jamClient.FTUEGetAllAudioConfigurations();
|
||||
var goodAudioConfigs = context.JK.getGoodAudioConfigs();
|
||||
|
||||
for (var i=0; i < allAudioConfigs.length; i++) {
|
||||
if ($.inArray(allAudioConfigs[i], goodAudioConfigs) === -1) {
|
||||
badAudioConfigs.push(allAudioConfigs[i]);
|
||||
}
|
||||
}
|
||||
|
||||
return badAudioConfigs;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in New Issue