Code tidies.

This commit is contained in:
Matthew Stratford 2021-01-28 20:07:00 +00:00
parent f84987c8de
commit df097308ed
4 changed files with 6 additions and 9 deletions

View file

@ -415,7 +415,7 @@ export class AudioEngine extends ((EngineEmitter as unknown) as {
// Player Input // Player Input
this.playerAnalysers = []; this.playerAnalysers = [];
for (let i = 0; i <= PLAYER_COUNT; i++) { for (let i = 0; i < PLAYER_COUNT; i++) {
let analyser = new StereoAnalyserNode(this.audioContext); let analyser = new StereoAnalyserNode(this.audioContext);
analyser.fftSize = ANALYSIS_FFT_SIZE; analyser.fftSize = ANALYSIS_FFT_SIZE;
this.playerAnalysers[i] = analyser; this.playerAnalysers[i] = analyser;

View file

@ -11,7 +11,6 @@ const DB_CONST = 20.0;
declare const sampleRate: number; declare const sampleRate: number;
type StereoModeEnum = "M3" | "M6" | "AB"; type StereoModeEnum = "M3" | "M6" | "AB";
// @ts-ignore
class DBFSPeakProcessor extends AudioWorkletProcessor { class DBFSPeakProcessor extends AudioWorkletProcessor {
process( process(
inputs: Float32Array[][], inputs: Float32Array[][],

View file

@ -472,7 +472,6 @@ export const load = (
dispatch( dispatch(
changeSetting({ changeSetting({
key: "channelOutputIds", key: "channelOutputIds",
// @ts-ignore
val: Array(PLAYER_COUNT).fill(channelOutputId), val: Array(PLAYER_COUNT).fill(channelOutputId),
}) })
); );
@ -555,7 +554,7 @@ export const load = (
} }
}); });
playerInstance.on("finish", () => { playerInstance.on("finish", () => {
// PFL on PFL Player // If the PFL Player finishes playing, turn of PFL.
if (player === PLAYER_PFL_ID) { if (player === PLAYER_PFL_ID) {
dispatch(setChannelPFL(player, false)); dispatch(setChannelPFL(player, false));
} }
@ -633,7 +632,7 @@ export const play = (player: number): AppThunk => async (
return; return;
} }
// PFL on PFL Player // If it's the PFL player starting, turn on PFL automatically.
if (player === PLAYER_PFL_ID) { if (player === PLAYER_PFL_ID) {
dispatch(setChannelPFL(player, true)); dispatch(setChannelPFL(player, true));
} }
@ -678,7 +677,7 @@ export const pause = (player: number): AppThunk => (dispatch, getState) => {
if (audioEngine.players[player]?.isPlaying) { if (audioEngine.players[player]?.isPlaying) {
audioEngine.players[player]?.pause(); audioEngine.players[player]?.pause();
} else { } else {
// PFL on PFL Player // If it's the PFL player starting, turn on PFL automatically.
if (player === PLAYER_PFL_ID) { if (player === PLAYER_PFL_ID) {
dispatch(setChannelPFL(player, true)); dispatch(setChannelPFL(player, true));
} }
@ -709,7 +708,8 @@ export const stop = (player: number): AppThunk => (dispatch, getState) => {
} }
playerInstance.stop(); playerInstance.stop();
// PFL on PFL Player
// If we're stoping the PFL player, turn off PFL in the UI.
if (player === PLAYER_PFL_ID) { if (player === PLAYER_PFL_ID) {
dispatch(setChannelPFL(player, false)); dispatch(setChannelPFL(player, false));
} }

View file

@ -52,7 +52,6 @@ function ChannelOutputSelect({
dispatch( dispatch(
changeSetting({ changeSetting({
key: "channelOutputIds", key: "channelOutputIds",
// @ts-ignore
val: channelOutputIds, val: channelOutputIds,
}) })
); );
@ -120,7 +119,6 @@ export function AdvancedTab() {
fetchOutputNames(); fetchOutputNames();
}, []); }, []);
// @ts-ignore
return ( return (
<> <>
<h2>Selector Options</h2> <h2>Selector Options</h2>