diff --git a/web/app/assets/javascripts/wizard/gear/step_select_gear.js b/web/app/assets/javascripts/wizard/gear/step_select_gear.js index 11c7b748d..b32a75fc8 100644 --- a/web/app/assets/javascripts/wizard/gear/step_select_gear.js +++ b/web/app/assets/javascripts/wizard/gear/step_select_gear.js @@ -300,19 +300,23 @@ } async function inputChannelChanged($checkbox) { - + if (iCheckIgnore) return; - + await assertFTUEProfile(); - + //var $checkbox = $(this); console.log('==inputChannelChanged#checkbox', $checkbox.data('id')); - + var channelId = $checkbox.data('id'); var isChecked = $checkbox.is(':checked'); console.log('===inputChannelChanged===', $checkbox, channelId, isChecked); + + + if (isChecked) { + var newAssignment = newInputAssignment(); logger.debug("assigning input channel %o to track: %o", channelId, newAssignment); await context.jamClient.TrackSetAssignment(channelId, true, newAssignment); @@ -323,7 +327,6 @@ // unassigning creates a hole in our auto-assigned tracks. reassign them all to keep it consistent await reassignInputChannels(); } - await initializeChannels(); } @@ -340,10 +343,10 @@ } - async function outputChannelChanged() { + async function outputChannelChanged($checkbox) { if (iCheckIgnore) return; - var $checkbox = $(this); - var channelId = $checkbox.attr('data-id'); + //var $checkbox = $(this); + var channelId = $checkbox.data('id'); var isChecked = $checkbox.is(':checked'); // don't allow more than 2 output channels selected at once @@ -399,7 +402,9 @@ $checkbox.attr('checked', 'checked'); } context.JK.checkbox($checkbox); - $checkbox.on('ifChanged', outputChannelChanged); + $checkbox.on('ifChanged', function(){ + outputChannelChanged($(this)) + }); $outputChannels.append($outputPort); }); } @@ -569,10 +574,10 @@ safeAtttemptScore(); } - function onFramesizeChanged() { + async function onFramesizeChanged() { //context.JK.prodBubble($resyncBtn, 'push-resync-when-done', {}, {positions:['top']}); updateDefaultBuffers(); - jamClient.FTUESetFrameSize(frameBuffers.selectedFramesize()); + await jamClient.FTUESetFrameSize(frameBuffers.selectedFramesize()); invalidateScore(); safeAtttemptScore(); } @@ -958,7 +963,7 @@ updateDefaultBuffers(); } - function updateDefaultFrameSize() { + async function updateDefaultFrameSize() { if(selectedDeviceInfo && (selectedDeviceInfo.input.info.type == 'Win32_wdm' || selectedDeviceInfo.output.info.type == 'Win32_wdm')) { frameBuffers.setFramesize('10'); } @@ -969,12 +974,12 @@ frameBuffers.setFramesize('2.5') } - jamClient.FTUESetFrameSize(frameBuffers.selectedFramesize()); + await jamClient.FTUESetFrameSize(frameBuffers.selectedFramesize()); } - function updateDefaultBuffers() { - gearUtils.updateDefaultBuffers(selectedDeviceInfo, frameBuffers) + async function updateDefaultBuffers() { + await gearUtils.updateDefaultBuffers(selectedDeviceInfo, frameBuffers) } // refocused affects how IO testing occurs. @@ -1331,9 +1336,9 @@ } async function assertFTUEProfile() { + if(savedProfile) {return;} // once we save the profile, it's name no longer starts with FTUE var profileName = await context.jamClient.FTUEGetMusicProfileName(); - if(profileName && profileName.indexOf('FTUE') != 0) { logger.debug("the profile name *must* start with FTUE during step 2. name=" + profileName) context.JK.alertSupportedNeeded('The application is no longer modifying a new profile. Please restart the application and try the gear wizard again.'); diff --git a/web/app/assets/javascripts/wizard/gear_utils.js b/web/app/assets/javascripts/wizard/gear_utils.js index eb56b12a5..c20395ccd 100644 --- a/web/app/assets/javascripts/wizard/gear_utils.js +++ b/web/app/assets/javascripts/wizard/gear_utils.js @@ -236,7 +236,7 @@ return loadedDevices; } - gearUtils.updateDefaultBuffers = function (selectedDeviceInfo, frameBuffers) { + gearUtils.updateDefaultBuffers = async function (selectedDeviceInfo, frameBuffers) { function hasWDMAssociated() { return selectedDeviceInfo && (selectedDeviceInfo.input.info.type == 'Win32_wdm' || selectedDeviceInfo.output.info.type == 'Win32_wdm') } @@ -280,8 +280,8 @@ frameBuffers.setBufferOut(0); } - context.jamClient.FTUESetInputLatency(frameBuffers.selectedBufferIn()); - context.jamClient.FTUESetOutputLatency(frameBuffers.selectedBufferOut()); + await context.jamClient.FTUESetInputLatency(frameBuffers.selectedBufferIn()); + await context.jamClient.FTUESetOutputLatency(frameBuffers.selectedBufferOut()); } gearUtils.ftueSummary = async function (operatingSystem, deviceInformation, selectedDeviceInfo, gearTest, frameBuffers, isAutomated) { @@ -493,7 +493,6 @@ // if the user does not have any profiles, show the FTUE gearUtils.guardAgainstInvalidGearConfiguration = function (app) { - alert('ff') return new Promise(async function(resolve, reject){ if (await gearUtils.jamClientFTUEGetAllAudioConfigurations().length === 0) {