VRFS-633 VRFS-636 added log statements and minor refactor
This commit is contained in:
parent
e36a2f2c26
commit
c8550c2e85
|
|
@ -6,8 +6,6 @@
|
|||
context.JK.AddTrackDialog = function(app, myTracks, sessionId, sessionModel) {
|
||||
var logger = context.JK.logger;
|
||||
|
||||
var myTrackCount = myTracks.length;
|
||||
|
||||
var ASSIGNMENT = {
|
||||
CHAT: -2,
|
||||
OUTPUT: -1,
|
||||
|
|
@ -163,8 +161,6 @@
|
|||
data.instrument_id = instrumentText;
|
||||
data.sound = "stereo";
|
||||
sessionModel.addTrack(sessionId, data);
|
||||
|
||||
context.jamClient.TrackSaveAssignments();
|
||||
}
|
||||
|
||||
function validateSettings() {
|
||||
|
|
|
|||
|
|
@ -5,8 +5,7 @@
|
|||
context.JK = context.JK || {};
|
||||
context.JK.ConfigureTrackDialog = function(app, myTracks, sessionId, sessionModel) {
|
||||
var logger = context.JK.logger;
|
||||
|
||||
var myTrackCount = myTracks.length;
|
||||
var myTrackCount;
|
||||
|
||||
var ASSIGNMENT = {
|
||||
CHAT: -2,
|
||||
|
|
@ -224,7 +223,6 @@
|
|||
voiceChatChanged();
|
||||
});
|
||||
|
||||
// $('#btn-driver-settings').unbind("click");
|
||||
$('#btn-driver-settings').click(function() {
|
||||
context.jamClient.TrackOpenControlPanel();
|
||||
});
|
||||
|
|
@ -239,17 +237,19 @@
|
|||
// app.layout.closeDialog('error-dialog');
|
||||
// });
|
||||
|
||||
$('#btn-save-settings').unbind("click");
|
||||
$('#btn-save-settings').click(saveSettings);
|
||||
$('#btn-cancel-settings').click(cancelSettings);
|
||||
}
|
||||
|
||||
function syncVoiceChatDialog() {
|
||||
// remove Session Audio option from voice chat if none are available
|
||||
if ($('#audio-inputs-unused > option').size() === 0) {
|
||||
if ($('#audio-inputs-unused > option').size() === 0 && originalVoiceChat !== VOICE_CHAT.SESSION) {
|
||||
logger.debug('Removing Option 1 from Voice Chat dropdown.');
|
||||
$('#voice-chat-device > option[value="1"]').remove();
|
||||
}
|
||||
else {
|
||||
// make sure it's not already in list before adding back
|
||||
if ($('#voice-chat-device > option[value="1"]').length === 0) {
|
||||
logger.debug('Adding Option 1 back to Voice Chat dropdown.');
|
||||
$('#voice-chat-device').prepend('<option value="1">Use an input on my session audio device for chat</option>');
|
||||
|
|
@ -326,14 +326,8 @@
|
|||
}
|
||||
|
||||
function showMusicAudioPanel(refreshLists) {
|
||||
|
||||
_setInstructions('audio');
|
||||
|
||||
$('div[tab-id="music-audio"]').show();
|
||||
$('div[tab-id="voice-chat"]').hide();
|
||||
|
||||
$('#tab-configure-audio').addClass('selected');
|
||||
$('#tab-configure-voice').removeClass('selected');
|
||||
_activateTab('audio');
|
||||
|
||||
if (refreshLists) {
|
||||
$('#audio-drivers').empty();
|
||||
|
|
@ -375,7 +369,7 @@
|
|||
$('#audio-output-unused').empty();
|
||||
$('#audio-output-selection').empty();
|
||||
|
||||
initDialogData();
|
||||
//initDialogData();
|
||||
|
||||
// load Unused Inputs
|
||||
context.JK.loadOptions($('#template-option').html(), $('#audio-inputs-unused'), inputUnassignedList, "id", "name", -1);
|
||||
|
|
@ -417,12 +411,7 @@
|
|||
|
||||
function showVoiceChatPanel(refreshLists) {
|
||||
_setInstructions('voice');
|
||||
|
||||
$('div[tab-id="music-audio"]').hide();
|
||||
$('div[tab-id="voice-chat"]').show();
|
||||
|
||||
$('#tab-configure-audio').removeClass('selected');
|
||||
$('#tab-configure-voice').addClass('selected');
|
||||
_activateTab('voice');
|
||||
|
||||
syncVoiceChatDialog();
|
||||
|
||||
|
|
@ -430,7 +419,7 @@
|
|||
$('#voice-inputs-unused').empty();
|
||||
$('#voice-inputs-selection').empty();
|
||||
|
||||
initDialogData();
|
||||
//initDialogData();
|
||||
|
||||
var chatOption = $('#voice-chat-device').val();
|
||||
|
||||
|
|
@ -464,21 +453,57 @@
|
|||
}
|
||||
}
|
||||
|
||||
function _activateTab(type) {
|
||||
if (type === 'voice') {
|
||||
$('div[tab-id="music-audio"]').hide();
|
||||
$('div[tab-id="voice-chat"]').show();
|
||||
|
||||
$('#tab-configure-audio').removeClass('selected');
|
||||
$('#tab-configure-voice').addClass('selected');
|
||||
}
|
||||
else {
|
||||
$('div[tab-id="music-audio"]').show();
|
||||
$('div[tab-id="voice-chat"]').hide();
|
||||
|
||||
$('#tab-configure-audio').addClass('selected');
|
||||
$('#tab-configure-voice').removeClass('selected');
|
||||
}
|
||||
}
|
||||
|
||||
function initDialogData() {
|
||||
inputUnassignedList = [];
|
||||
track1AudioInputChannels = [];
|
||||
track2AudioInputChannels = [];
|
||||
outputUnassignedList = [];
|
||||
chatUnassignedList = [];
|
||||
chatAssignedList = [];
|
||||
chatOtherUnassignedList = [];
|
||||
chatOtherAssignedList = [];
|
||||
|
||||
// set arrays
|
||||
inputUnassignedList = _loadList(ASSIGNMENT.UNASSIGNED, true, false);
|
||||
logger.debug("inputUnassignedList=" + JSON.stringify(inputUnassignedList));
|
||||
|
||||
track1AudioInputChannels = _loadList(ASSIGNMENT.TRACK1, true, false);
|
||||
logger.debug("track1AudioInputChannels=" + JSON.stringify(track1AudioInputChannels));
|
||||
|
||||
track2AudioInputChannels = _loadList(ASSIGNMENT.TRACK2, true, false);
|
||||
logger.debug("track2AudioInputChannels=" + JSON.stringify(track2AudioInputChannels));
|
||||
|
||||
outputUnassignedList = _loadList(ASSIGNMENT.UNASSIGNED, false, false);
|
||||
outputAssignedList = _loadList(ASSIGNMENT.OUTPUT, false, false);
|
||||
|
||||
chatUnassignedList = _loadList(ASSIGNMENT.UNASSIGNED, true, false);
|
||||
logger.debug("chatUnassignedList=" + JSON.stringify(chatUnassignedList));
|
||||
|
||||
chatAssignedList = _loadList(ASSIGNMENT.CHAT, true, false);
|
||||
logger.debug("chatAssignedList=" + JSON.stringify(chatAssignedList));
|
||||
|
||||
chatOtherUnassignedList = _loadList(ASSIGNMENT.UNASSIGNED, true, true);
|
||||
logger.debug("chatOtherUnassignedList=" + JSON.stringify(chatOtherUnassignedList));
|
||||
|
||||
chatOtherAssignedList = _loadList(ASSIGNMENT.CHAT, true, true);
|
||||
logger.debug("chatOtherAssignedList=" + JSON.stringify(chatOtherAssignedList));
|
||||
}
|
||||
|
||||
// TODO: copied in addTrack.js - refactor to common place
|
||||
|
|
@ -750,11 +775,14 @@
|
|||
originalDeviceId = context.jamClient.TrackGetMusicDeviceID();
|
||||
|
||||
context.jamClient.TrackLoadAssignments();
|
||||
initDialogData();
|
||||
}
|
||||
|
||||
this.initialize = function() {
|
||||
events();
|
||||
_init();
|
||||
myTrackCount = myTracks.length;
|
||||
logger.debug("myTrackCount=" + myTrackCount);
|
||||
toggleTrack2ConfigDetails(myTrackCount > 1);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -131,6 +131,7 @@
|
|||
}
|
||||
|
||||
function afterCurrentUserLoaded() {
|
||||
logger.debug("afterCurrentUserLoaded");
|
||||
// It seems the SessionModel should be a singleton.
|
||||
// a client can only be in one session at a time,
|
||||
// and other parts of the code want to know at any certain times
|
||||
|
|
@ -141,6 +142,7 @@
|
|||
);
|
||||
|
||||
sessionModel.subscribe('sessionScreen', sessionChanged);
|
||||
logger.debug("sessionId=" + sessionId);
|
||||
sessionModel.joinSession(sessionId)
|
||||
.fail(function(xhr, textStatus, errorMessage) {
|
||||
if(xhr.status == 404) {
|
||||
|
|
@ -165,6 +167,8 @@
|
|||
}
|
||||
|
||||
function sessionChanged() {
|
||||
logger.debug("sessionChanged()");
|
||||
|
||||
// TODO - in the specific case of a user changing their tracks using the configureTrack dialog,
|
||||
// this event appears to fire before the underlying mixers have updated. I have no event to
|
||||
// know definitively when the underlying mixers are up to date, so for now, we just delay slightly.
|
||||
|
|
@ -204,6 +208,7 @@
|
|||
}
|
||||
|
||||
function _initDialogs() {
|
||||
logger.debug("Calling _initDialogs");
|
||||
configureTrackDialog.initialize();
|
||||
addTrackDialog.initialize();
|
||||
addNewGearDialog.initialize();
|
||||
|
|
@ -413,6 +418,7 @@
|
|||
lookingForMixersTimer = context.setInterval(lookForMixers, 500);
|
||||
}
|
||||
}
|
||||
|
||||
_addTrack(index, trackData);
|
||||
|
||||
// Show settings icons only for my tracks
|
||||
|
|
@ -420,6 +426,7 @@
|
|||
if (myTrack) {
|
||||
$trackSettings.show();
|
||||
myTracks.push(trackData);
|
||||
logger.debug("added trackData to myTracks " + JSON.stringify(trackData));
|
||||
}
|
||||
else {
|
||||
$trackSettings.hide();
|
||||
|
|
@ -436,10 +443,8 @@
|
|||
addNewGearDialog = new context.JK.AddNewGearDialog(app);
|
||||
|
||||
// # NO LONGER HIDING ADD TRACK even when there are 2 tracks (VRFS-537)
|
||||
$('#div-add-track').unbind("click");
|
||||
$('#div-add-track').click(function() {
|
||||
if (myTracks.length === 2) {
|
||||
$('#btn-error-ok').unbind("click");
|
||||
$('#btn-error-ok').click(function() {
|
||||
app.layout.closeDialog('error-dialog');
|
||||
});
|
||||
|
|
@ -567,12 +572,10 @@
|
|||
$closeButton.hide();
|
||||
}
|
||||
else {
|
||||
$closeButton.unbind("click");
|
||||
$closeButton.click(deleteTrack);
|
||||
}
|
||||
|
||||
var $trackSettings = $('div[mixer-id="' + trackData.mixerId + '"].track-icon-settings');
|
||||
$trackSettings.unbind("click");
|
||||
$trackSettings.click(function() {
|
||||
// call this to initialize Voice Chat tab
|
||||
configureTrackDialog.showVoiceChatPanel(true);
|
||||
|
|
@ -776,7 +779,6 @@
|
|||
$('#session-contents').on("click", '[action="delete"]', deleteSession);
|
||||
$('#tracks').on('click', 'div[control="mute"]', toggleMute);
|
||||
|
||||
$('.voicechat-settings').unbind("click");
|
||||
$('.voicechat-settings').click(function() {
|
||||
// call this to initialize Music Audio tab
|
||||
configureTrackDialog.showMusicAudioPanel(true);
|
||||
|
|
|
|||
|
|
@ -131,7 +131,10 @@
|
|||
logger.debug("Current Session Refreshed:");
|
||||
logger.debug(response);
|
||||
currentSession = response;
|
||||
callback();
|
||||
|
||||
if (callback) {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
error: ajaxError
|
||||
});
|
||||
|
|
@ -253,6 +256,8 @@
|
|||
data: JSON.stringify(data),
|
||||
processData:false,
|
||||
success: function(response) {
|
||||
// save to the backend
|
||||
context.jamClient.TrackSaveAssignments();
|
||||
logger.debug("Successfully added track (" + JSON.stringify(data) + ")");
|
||||
refreshCurrentSession();
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue