From dfb170feaaf0e3308376a6319caaa25245754ee2 Mon Sep 17 00:00:00 2001 From: Matthew Stratford Date: Sat, 30 Jan 2021 17:39:47 +0000 Subject: [PATCH 1/6] Move debug to tooltip, fix outro time. --- src/showplanner/Item.tsx | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/src/showplanner/Item.tsx b/src/showplanner/Item.tsx index e7efef5..fc493b7 100644 --- a/src/showplanner/Item.tsx +++ b/src/showplanner/Item.tsx @@ -8,6 +8,7 @@ import * as MixerState from "../mixer/state"; import { Draggable } from "react-beautiful-dnd"; import { contextMenu } from "react-contexify"; import "./item.scss"; +import { HHMMTosec, secToHHMM } from "../lib/utils"; export const TS_ITEM_MENU_ID = "SongMenu"; export const TS_ITEM_AUX_ID = "AuxMenu"; @@ -76,12 +77,33 @@ export const Item = memo(function Item({ if ("artist" in x && x.artist !== "") data.push("Artist: " + x.artist); if ("album" in x && x.album.title !== "") data.push("Album: " + x.album.title); - data.push("Length: " + x.length.toString()); - if ("intro" in x) data.push("Intro: " + x.intro + " secs"); - if ("cue" in x) data.push("Cue: " + x.cue + " secs"); - if ("outro" in x) data.push("Outro: " + x.outro + " secs"); + data.push("Length: " + x.length); + if ("intro" in x) + data.push( + "Intro: " + (x.intro > 60 ? secToHHMM(x.intro) : x.intro + " secs") + ); + if ("cue" in x) + data.push("Cue: " + (x.cue > 60 ? secToHHMM(x.cue) : x.cue + " secs")); + if ("outro" in x) { + // Outro seconds are counted from end of track, except 0 = no outro; + const outroSecs = x.outro === 0 ? 0 : HHMMTosec(x.length) - x.outro; + data.push( + "Outro: " + + (outroSecs > 60 ? secToHHMM(outroSecs) : outroSecs + " secs") + ); + } data.push("Played: " + ("played" in x ? (x.played ? "Yes" : "No") : "No")); - + data.push( + "ID: " + ("trackid" in x ? x.trackid : "managedid" in x && x.managedid) + ); + if (showDebug) { + data.push( + "Debug: itemId(): " + + itemId(x) + + " - Channel/weight: " + + ("channel" in x && x.channel + "/" + x.weight) + ); + } return data.join("¬"); // Something obscure to split against. } @@ -121,11 +143,6 @@ export const Item = memo(function Item({ > Explicit - {showDebug && ( - - {itemId(x)} {"channel" in x && x.channel + "/" + x.weight} - - )} )} From a82f68e89f0794bfd52d14e3678ae727feec75d2 Mon Sep 17 00:00:00 2001 From: Matthew Stratford Date: Sat, 30 Jan 2021 18:33:15 +0000 Subject: [PATCH 2/6] Put debug back. --- src/showplanner/Item.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/showplanner/Item.tsx b/src/showplanner/Item.tsx index fc493b7..d9565b6 100644 --- a/src/showplanner/Item.tsx +++ b/src/showplanner/Item.tsx @@ -143,6 +143,11 @@ export const Item = memo(function Item({ > Explicit + {showDebug && ( + + {itemId(x)} {"channel" in x && x.channel + "/" + x.weight} + + )} )} From c1a4724e992e9a5bdedb8c7dd060c85ee6fe8996 Mon Sep 17 00:00:00 2001 From: Matthew Stratford Date: Sat, 30 Jan 2021 19:13:04 +0000 Subject: [PATCH 3/6] Fix PFL VU meter trying to update after it's killed. --- src/optionsMenu/helpers/VUMeter.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/optionsMenu/helpers/VUMeter.tsx b/src/optionsMenu/helpers/VUMeter.tsx index 0e7791b..c20bc13 100644 --- a/src/optionsMenu/helpers/VUMeter.tsx +++ b/src/optionsMenu/helpers/VUMeter.tsx @@ -30,18 +30,19 @@ export function VUMeter(props: VUMeterProps) { const FPS = 30; // Limit the FPS so that lower spec machines have a better time juggling CPU. useEffect(() => { + let isMounted = true; // This VU exists as we're calling useEffect const animate = () => { - if (!isMic || isMicOpen) { + if ((!isMic || isMicOpen) && isMounted) { const result = audioEngine.getLevels( props.source, props.stereo ? props.stereo : false ); setPeakL(result[0]); - if (props.stereo) { + if (props.stereo && isMounted) { setPeakR(result[1]); } setTimeout((current = rafRef.current, a = animate) => { - current = requestAnimationFrame(a); + if (isMounted) current = requestAnimationFrame(a); }, 1000 / FPS); } }; @@ -49,6 +50,7 @@ export function VUMeter(props: VUMeterProps) { rafRef.current = requestAnimationFrame(animate); } return () => { + isMounted = false; // Tell the async stuff above to not bother if the VU meter has gone away. if (rafRef.current !== null) { cancelAnimationFrame(rafRef.current); rafRef.current = null; From 76eedd365b1afca695a79d66610ea8c5bbfd14c6 Mon Sep 17 00:00:00 2001 From: Matthew Stratford Date: Sat, 30 Jan 2021 19:37:30 +0000 Subject: [PATCH 4/6] Don't flash the fader during PFL, tell them instead. --- src/showplanner/Player.tsx | 8 ++++++-- src/showplanner/channel.scss | 4 ++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/showplanner/Player.tsx b/src/showplanner/Player.tsx index 0e1cacf..dbec2bd 100644 --- a/src/showplanner/Player.tsx +++ b/src/showplanner/Player.tsx @@ -418,8 +418,10 @@ export function Player({ id }: { id: number }) {
@@ -449,6 +451,8 @@ export function Player({ id }: { id: number }) { Custom audio output disables VU meters. + ) : playerState.pfl ? ( + This Player is playing in PFL. ) : ( Date: Sat, 30 Jan 2021 19:39:14 +0000 Subject: [PATCH 5/6] Update src/optionsMenu/helpers/VUMeter.tsx Co-authored-by: Marks Polakovs --- src/optionsMenu/helpers/VUMeter.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/optionsMenu/helpers/VUMeter.tsx b/src/optionsMenu/helpers/VUMeter.tsx index c20bc13..6b85960 100644 --- a/src/optionsMenu/helpers/VUMeter.tsx +++ b/src/optionsMenu/helpers/VUMeter.tsx @@ -42,7 +42,9 @@ export function VUMeter(props: VUMeterProps) { setPeakR(result[1]); } setTimeout((current = rafRef.current, a = animate) => { - if (isMounted) current = requestAnimationFrame(a); + if (isMounted) { + current = requestAnimationFrame(a); + } }, 1000 / FPS); } }; From e057fbb857635d74869fe5fa165e92b42fbbaa54 Mon Sep 17 00:00:00 2001 From: Matthew Stratford Date: Sat, 30 Jan 2021 19:59:36 +0000 Subject: [PATCH 6/6] It's version 1.5.0 baby! --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ef28bbe..e78c635 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "webstudio", - "version": "1.4.0", + "version": "1.5.0", "private": true, "dependencies": { "@babel/core": "7.6.0",