From b03990b846f4f770ae52937f7485a685d7e7b5c5 Mon Sep 17 00:00:00 2001 From: Matthew Stratford Date: Wed, 2 Jun 2021 20:27:23 +0100 Subject: [PATCH] Compiles, no show plan loaded --- src/mixer/state.ts | 27 +++++++-- src/navbar/index.tsx | 26 ++++----- src/rootReducer.ts | 25 ++++++++- src/showplanner/index.tsx | 112 +++++++++++++++++++++----------------- src/showplanner/state.ts | 7 --- 5 files changed, 118 insertions(+), 79 deletions(-) diff --git a/src/mixer/state.ts b/src/mixer/state.ts index 64f3bdb..71dbef8 100644 --- a/src/mixer/state.ts +++ b/src/mixer/state.ts @@ -13,10 +13,25 @@ import Keys from "keymaster"; import { Track, MYRADIO_NON_API_BASE, AuxItem } from "../api"; import { AppThunk } from "../store"; import { RootState } from "../rootReducer"; -import { audioEngine, ChannelMapping } from "./audio"; + +import { + audioEngine, + ChannelMapping, + INTERNAL_OUTPUT_ID, + PLAYER_COUNT, + PLAYER_ID_PREVIEW, + DEFAULT_TRIM_DB, + OFF_LEVEL_DB, + BED_LEVEL_DB, + FULL_LEVEL_DB, +} from "./audio"; + import * as TheNews from "./the_news"; import { sendBAPSicleChannel } from "../bapsicle"; +import { changeSetting } from "../optionsMenu/settingsState"; +import { PLAYER_COUNTER_UPDATE_PERIOD_MS } from "../showplanner/Player"; + const playerGainTweens: Array<{ target: VolumePresetEnum; tweens: Between[]; @@ -31,14 +46,13 @@ type VolumePresetEnum = "off" | "bed" | "full"; type MicVolumePresetEnum = "off" | "full"; export type MicErrorEnum = "NO_PERMISSION" | "NOT_SECURE_CONTEXT" | "UNKNOWN"; -const defaultTrimDB = -6; // The default trim applied to channel players. - interface PlayerState { loadedItem: PlanItem | Track | AuxItem | null; loading: number; loadError: boolean; state: PlayerStateEnum; volume: number; + volumeEnum: VolumePresetEnum; gain: number; trim: number; micAutoDuck: boolean; @@ -73,8 +87,8 @@ const BasePlayerState: PlayerState = { volume: 1, volumeEnum: "full", gain: 0, - micAutoDuck: false, trim: DEFAULT_TRIM_DB, + micAutoDuck: false, pfl: false, timeCurrent: 0, timeRemaining: 0, @@ -127,7 +141,7 @@ const mixerState = createSlice({ if (action.payload.customOutput) { state.players[action.payload.player].trim = 0; } else if (action.payload.resetTrim) { - state.players[action.payload.player].trim = defaultTrimDB; + state.players[action.payload.player].trim = DEFAULT_TRIM_DB; } } }, @@ -838,7 +852,8 @@ export const redrawWavesurfers = (): AppThunk => () => { const FADE_TIME_SECONDS = 1; export const setVolume = ( player: number, - level: VolumePresetEnum + level: VolumePresetEnum, + fade: boolean = true ): AppThunk => (dispatch, getState) => { let volume: number; let uiLevel: number; diff --git a/src/navbar/index.tsx b/src/navbar/index.tsx index 19f0019..7212fe0 100644 --- a/src/navbar/index.tsx +++ b/src/navbar/index.tsx @@ -115,7 +115,7 @@ export function NavBarMyRadio() { className="dropdown-item" onClick={() => sessionState.currentTimeslot !== null && - dispatch(setItemPlayed({ itemId: "all", played: false })) + dispatch(setItemPlayed("all", false)) } > Mark All Items Unplayed @@ -395,18 +395,18 @@ export function CombinedNavAlertBar() { return ( <> - (!process.env.REACT_APP_BAPSICLE_INTERFACE && - <> -
- - Hover for MyRadio Menu - - -
- - ) + {!process.env.REACT_APP_BAPSICLE_INTERFACE && ( + <> +
+ + Hover for MyRadio Menu + + +
+ + )}