mirror of
https://github.com/navidrome/navidrome.git
synced 2025-06-14 14:22:28 +03:00
Workaround to remember logarithmic volume
This commit is contained in:
parent
e79922def1
commit
591a5344ac
@ -198,9 +198,8 @@ const Player = () => {
|
|||||||
])
|
])
|
||||||
|
|
||||||
const onAudioListsChange = useCallback(
|
const onAudioListsChange = useCallback(
|
||||||
(currentPlayIndex, audioLists) => {
|
(currentPlayIndex, audioLists) =>
|
||||||
dispatch(syncQueue(currentPlayIndex, audioLists))
|
dispatch(syncQueue(currentPlayIndex, audioLists)),
|
||||||
},
|
|
||||||
[dispatch]
|
[dispatch]
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -230,7 +229,8 @@ const Player = () => {
|
|||||||
)
|
)
|
||||||
|
|
||||||
const onAudioVolumeChange = useCallback(
|
const onAudioVolumeChange = useCallback(
|
||||||
(volume) => dispatch(setVolume(volume)),
|
// sqrt to compensate for the logarithmic volume
|
||||||
|
(volume) => dispatch(setVolume(Math.sqrt(volume))),
|
||||||
[dispatch]
|
[dispatch]
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -260,12 +260,9 @@ const Player = () => {
|
|||||||
[dispatch, showNotifications]
|
[dispatch, showNotifications]
|
||||||
)
|
)
|
||||||
|
|
||||||
const onAudioPause = useCallback(
|
const onAudioPause = useCallback((info) => dispatch(currentPlaying(info)), [
|
||||||
(info) => {
|
dispatch,
|
||||||
dispatch(currentPlaying(info))
|
])
|
||||||
},
|
|
||||||
[dispatch]
|
|
||||||
)
|
|
||||||
|
|
||||||
const onAudioEnded = useCallback(
|
const onAudioEnded = useCallback(
|
||||||
(currentPlayId, audioLists, info) => {
|
(currentPlayId, audioLists, info) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user