diff --git a/web/app/assets/javascripts/react-components/SessionTrackVolumeHover.js.jsx.coffee b/web/app/assets/javascripts/react-components/SessionTrackVolumeHover.js.jsx.coffee index 93e93a890..04fdaa588 100644 --- a/web/app/assets/javascripts/react-components/SessionTrackVolumeHover.js.jsx.coffee +++ b/web/app/assets/javascripts/react-components/SessionTrackVolumeHover.js.jsx.coffee @@ -63,14 +63,7 @@ ptrCount = 0 $select = $(e.currentTarget) updateRate = $select.val() - #get the mixerid from the select - mixerId = $select.data('mixerid') - - if !mixerId - console.warn("No mixerId found in vuMeterUpdate select") - return - #set the vuMeterUpdateRate of the mixer in localStorage - localStorage.setItem('vuMeterUpdateRate_'+ mixerId, updateRate) + localStorage.setItem('vuMeterUpdateRate', updateRate) render: () -> @@ -100,7 +93,7 @@ ptrCount = 0 vuMeterUpdatePref = `
VU Meter Updates: - @@ -195,9 +188,6 @@ ptrCount = 0 $checkbox.iCheck('uncheck').attr('checked', false) @iCheckMaint = false - #read the vuMeterUpdateRate from localStorage - # if it doesn't exist, set it to 'fast' - vuMixer = @state.mixers?.vuMixer if vuMixer && $.isArray(vuMixer) @@ -207,7 +197,7 @@ ptrCount = 0 console.warn("No vuMixerId found in vuMeterUpdate select") return - vuMeterUpdateRate = localStorage.getItem('vuMeterUpdateRate_'+ vuMixerId) || 'fast' + vuMeterUpdateRate = localStorage.getItem('vuMeterUpdateRate') || 'fast' $vuMeterSelect = $root.find('.vu-meter-pref-select') $vuMeterSelect.val(vuMeterUpdateRate) $vuMeterSelect.on('change', this.handleVuMeterUpdate) diff --git a/web/app/assets/javascripts/react-components/helpers/MixerHelper.js.coffee b/web/app/assets/javascripts/react-components/helpers/MixerHelper.js.coffee index c8d4f848c..3aad080a2 100644 --- a/web/app/assets/javascripts/react-components/helpers/MixerHelper.js.coffee +++ b/web/app/assets/javascripts/react-components/helpers/MixerHelper.js.coffee @@ -25,6 +25,7 @@ MIX_MODES = context.JK.MIX_MODES; @shouldCollectVuStats = false @simulatedMusicCategoryMixers = {} @simulatedChatCategoryMixers = {} + @vuMeterUpdatePrefMap = {} @organize() organize: () -> @@ -1052,7 +1053,6 @@ MIX_MODES = context.JK.MIX_MODES; updateVU: (mixerId, mode, leftValue, leftClipping, rightValue, rightClipping) -> mixer = @getMixer(mixerId, mode) - if mixer? @collectStats(mixer) if @shouldCollectVuStats context.JK.VuHelpers.updateVU3(mixer, leftValue, leftClipping, rightValue, rightClipping) diff --git a/web/app/assets/javascripts/react-components/stores/MixerStore.js.coffee b/web/app/assets/javascripts/react-components/stores/MixerStore.js.coffee index 5a27e2a3b..b52f908a5 100644 --- a/web/app/assets/javascripts/react-components/stores/MixerStore.js.coffee +++ b/web/app/assets/javascripts/react-components/stores/MixerStore.js.coffee @@ -23,8 +23,7 @@ rest = context.JK.Rest() missingMixerPeers : {} recheckTimeout : null clientsWithAudioOverride : {} - - vuMeterUpdatePrefMap : {} + vuMeterUpdatePrefMap: {} init: -> # Register with the app store to get @app @@ -93,6 +92,18 @@ rest = context.JK.Rest() value = null vuInfo = null + vuMeterUpdateRate = localStorage.getItem('vuMeterUpdateRate') || 'fast' + @vuMeterUpdatePrefMap['count'] = (@vuMeterUpdatePrefMap['count'] || 0) + 1 + + if vuMeterUpdateRate == 'medium' && @vuMeterUpdatePrefMap['count'] % 3 != 0 + # skip this update + return + if vuMeterUpdateRate == 'slow' && @vuMeterUpdatePrefMap['count'] % 9 != 0 + # skip this update + return + #console.log('vuMeterUpdateRate', vuMeterUpdateRate, @vuMeterUpdatePrefMap['count']) + @vuMeterUpdatePrefMap['count'] = 0 + for vuInfo in vuData eventName = vuInfo[0]; vuVal = 0.0; @@ -108,28 +119,8 @@ rest = context.JK.Rest() # value is a DB value from -80 to 20. Convert to float from 0.0-1.0 #console.log('handleBridgeCallback@mixers',@mixers) - #read vuMeterUpdateRate from localStorage - vuMeterUpdateRate = localStorage.getItem('vuMeterUpdateRate_'+ mixerId) || 'fast' - - #update vuMeterUpdatePrefMap - if not @vuMeterUpdatePrefMap[mixerId]? - @vuMeterUpdatePrefMap[mixerId] = {} - @vuMeterUpdatePrefMap[mixerId]['rate'] = vuMeterUpdateRate - @vuMeterUpdatePrefMap[mixerId]['count'] = (@vuMeterUpdatePrefMap[mixerId]['count'] || 0) - if @mixers? - #if rate pref is fast, update every time - if @vuMeterUpdatePrefMap[mixerId]['rate'] == 'fast' - @vuMeterUpdatePrefMap[mixerId]['count'] = 0 - @mixers.updateVU(mixerId, mode, (leftValue + 80) / 80, leftClipping, (rightValue + 80) / 80, rightClipping) - #if rate pref is medium, update every 3rd time - else if (@vuMeterUpdatePrefMap[mixerId]['rate'] == 'medium' and @vuMeterUpdatePrefMap[mixerId]['count'] > 0 and @vuMeterUpdatePrefMap[mixerId]['count'] % 3 == 0) - @vuMeterUpdatePrefMap[mixerId]['count'] += 1 - @mixers.updateVU(mixerId, mode, (leftValue + 80) / 80, leftClipping, (rightValue + 80) / 80, rightClipping) - #if rate pref is slow, update every 9th time - else if (@vuMeterUpdatePrefMap[mixerId]['rate'] == 'slow' and @vuMeterUpdatePrefMap[mixerId]['count'] > 0 and @vuMeterUpdatePrefMap[mixerId]['count'] % 9 == 0) - @vuMeterUpdatePrefMap[mixerId]['count'] += 1 - @mixers.updateVU(mixerId, mode, (leftValue + 80) / 80, leftClipping, (rightValue + 80) / 80, rightClipping) + @mixers.updateVU(mixerId, mode, (leftValue + 80) / 80, leftClipping, (rightValue + 80) / 80, rightClipping) #@mixers.updateVU(mixerId + "_vur", (rightValue + 80) / 80, rightClipping) diff --git a/web/app/assets/javascripts/vuHelpers.js b/web/app/assets/javascripts/vuHelpers.js index 5962fe3b5..66d9fbadc 100644 --- a/web/app/assets/javascripts/vuHelpers.js +++ b/web/app/assets/javascripts/vuHelpers.js @@ -216,7 +216,6 @@ updateVU3: function(mixer, leftValue, leftClipping, rightValue, rightClipping) { var fqId = this.createQualifiedId(mixer) - var registrations = this.registeredMixers[fqId] if (registrations) { var j;