-
- {sliderState.position}
-
+
handleSelectChange(+e.target.value, 'start')}
+ />
@@ -105,4 +146,6 @@ export function _PlayerSlider() {
>
}
-export const PlayerSlider = memo(_PlayerSlider, () => true)
\ No newline at end of file
+export const PlayerSlider = memo(_PlayerSlider, (p,v) => {
+ return p.onChange === v.onChange
+})
\ No newline at end of file
diff --git a/src/components/pages/Player/PlayerSongControls.tsx b/src/components/pages/Player/PlayerSongControls.tsx
index 8513a752..fc8fcd3a 100644
--- a/src/components/pages/Player/PlayerSongControls.tsx
+++ b/src/components/pages/Player/PlayerSongControls.tsx
@@ -1,7 +1,7 @@
import {SPEED_CHANGERS} from "$config"
import {MemoizedIcon} from "$cmp/shared/Utility/Memoized";
-import {FaStop, FaSyncAlt} from "react-icons/fa";
-import {ChangeEvent, memo} from "react";
+import {FaEye, FaEyeSlash, FaStop} from "react-icons/fa";
+import {ChangeEvent, memo, useCallback, useEffect, useState} from "react";
import {playerStore} from "$stores/PlayerStore";
import {playerControlsStore} from "$stores/PlayerControlsStore";
import {hasTooltip, Tooltip} from '$cmp/shared/Utility/Tooltip'
@@ -14,6 +14,7 @@ import {PlayerVisualSheetRenderer} from "./PlayerPagesRenderer";
import s from './Slider.module.css'
import svs from './VisualSheet.module.css'
import {useTranslation} from "react-i18next";
+import {VscDebugRestart} from "react-icons/vsc";
interface PlayerSongControlsProps {
onRestart: () => void
@@ -21,7 +22,13 @@ interface PlayerSongControlsProps {
onToggleRecordAudio: (override: boolean) => void
onToggleMetronome: () => void
speedChanger: typeof SPEED_CHANGERS[number]
+ loopEnabled: boolean
+
+ hidePracticeNotes: boolean | undefined
+ setHidePracticeNotes: (hide: boolean) => void
+ setLoopEnabled: (enabled: boolean) => void
isVisualSheetVisible: boolean
+ visualSheetColumns: number
hasSong: boolean
isMetronomePlaying: boolean
isRecordingAudio: boolean
@@ -36,10 +43,24 @@ function _PlayerSongControls({
onToggleMetronome,
isRecordingAudio,
onToggleRecordAudio,
- isVisualSheetVisible
+ isVisualSheetVisible,
+ visualSheetColumns,
+ loopEnabled,
+ setLoopEnabled,
+ hidePracticeNotes,
+ setHidePracticeNotes,
}: PlayerSongControlsProps) {
+ const [needsRefresh, setNeedsRefresh] = useState(false)
const songData = useObservableObject(playerStore.state)
- const {t} = useTranslation(["player", 'common', "settings"])
+ const {t} = useTranslation(["player", 'common', "settings", "shortcuts"])
+
+ const toggleNeedsRefresh = useCallback(() => {
+ setNeedsRefresh(true)
+ }, [])
+
+ useEffect(() => {
+ setNeedsRefresh(false)
+ }, [songData.key]);
return <>
{songData.eventType === 'approaching' &&
@@ -57,8 +78,32 @@ function _PlayerSongControls({
}