From df097308ed19f9a2abb2bb3eecc67a05f7fd87ee Mon Sep 17 00:00:00 2001 From: Matthew Stratford Date: Thu, 28 Jan 2021 20:07:00 +0000 Subject: [PATCH] Code tidies. --- src/mixer/audio.ts | 2 +- src/mixer/loudness.worklet.ts | 1 - src/mixer/state.ts | 10 +++++----- src/optionsMenu/AdvancedTab.tsx | 2 -- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/mixer/audio.ts b/src/mixer/audio.ts index cebbc6f..fc10f2c 100644 --- a/src/mixer/audio.ts +++ b/src/mixer/audio.ts @@ -415,7 +415,7 @@ export class AudioEngine extends ((EngineEmitter as unknown) as { // Player Input this.playerAnalysers = []; - for (let i = 0; i <= PLAYER_COUNT; i++) { + for (let i = 0; i < PLAYER_COUNT; i++) { let analyser = new StereoAnalyserNode(this.audioContext); analyser.fftSize = ANALYSIS_FFT_SIZE; this.playerAnalysers[i] = analyser; diff --git a/src/mixer/loudness.worklet.ts b/src/mixer/loudness.worklet.ts index 3a111fc..f20749e 100644 --- a/src/mixer/loudness.worklet.ts +++ b/src/mixer/loudness.worklet.ts @@ -11,7 +11,6 @@ const DB_CONST = 20.0; declare const sampleRate: number; type StereoModeEnum = "M3" | "M6" | "AB"; -// @ts-ignore class DBFSPeakProcessor extends AudioWorkletProcessor { process( inputs: Float32Array[][], diff --git a/src/mixer/state.ts b/src/mixer/state.ts index 70c2cd7..230406f 100644 --- a/src/mixer/state.ts +++ b/src/mixer/state.ts @@ -472,7 +472,6 @@ export const load = ( dispatch( changeSetting({ key: "channelOutputIds", - // @ts-ignore val: Array(PLAYER_COUNT).fill(channelOutputId), }) ); @@ -555,7 +554,7 @@ export const load = ( } }); playerInstance.on("finish", () => { - // PFL on PFL Player + // If the PFL Player finishes playing, turn of PFL. if (player === PLAYER_PFL_ID) { dispatch(setChannelPFL(player, false)); } @@ -633,7 +632,7 @@ export const play = (player: number): AppThunk => async ( return; } - // PFL on PFL Player + // If it's the PFL player starting, turn on PFL automatically. if (player === PLAYER_PFL_ID) { dispatch(setChannelPFL(player, true)); } @@ -678,7 +677,7 @@ export const pause = (player: number): AppThunk => (dispatch, getState) => { if (audioEngine.players[player]?.isPlaying) { audioEngine.players[player]?.pause(); } else { - // PFL on PFL Player + // If it's the PFL player starting, turn on PFL automatically. if (player === PLAYER_PFL_ID) { dispatch(setChannelPFL(player, true)); } @@ -709,7 +708,8 @@ export const stop = (player: number): AppThunk => (dispatch, getState) => { } playerInstance.stop(); - // PFL on PFL Player + + // If we're stoping the PFL player, turn off PFL in the UI. if (player === PLAYER_PFL_ID) { dispatch(setChannelPFL(player, false)); } diff --git a/src/optionsMenu/AdvancedTab.tsx b/src/optionsMenu/AdvancedTab.tsx index c85b22c..36e3be9 100644 --- a/src/optionsMenu/AdvancedTab.tsx +++ b/src/optionsMenu/AdvancedTab.tsx @@ -52,7 +52,6 @@ function ChannelOutputSelect({ dispatch( changeSetting({ key: "channelOutputIds", - // @ts-ignore val: channelOutputIds, }) ); @@ -120,7 +119,6 @@ export function AdvancedTab() { fetchOutputNames(); }, []); - // @ts-ignore return ( <>

Selector Options