修复重启后歌词快进不生效的问题

This commit is contained in:
lyswhut
2023-02-10 19:44:00 +08:00
parent 3d469a4986
commit e81d594d01
10 changed files with 22 additions and 20 deletions
+1
View File
@@ -9,6 +9,7 @@ export const init = () => {
lrc = new Lyric({
shadowContent: true,
activeLineClassName: 'active',
rate: setting['player.playbackRate'],
isVertical: setting['desktopLyric.direction'] == 'vertical',
onPlay(line, text) {
setText(text, line)
@@ -41,7 +41,6 @@ const handleDesktopLyricMessage = (event: LX.DesktopLyric.LyricActions) => {
break
case 'set_status':
setIsPlay(event.data.isPlay)
setPlaybackRate(event.data.rate)
if (event.data.isPlay) play(event.data.played_time)
else pause()
break
+1
View File
@@ -34,6 +34,7 @@ export const setting = shallowReactive<LX.DesktopLyric.Config>({
'player.isShowLyricTranslation': false,
'player.isShowLyricRoma': false,
'player.isPlayLxlrc': false,
'player.playbackRate': 1,
})
// export const themeList = markRaw([
+11 -2
View File
@@ -1,11 +1,20 @@
import { watch } from '@common/utils/vueTools'
import { setLyric, setVertical } from '@lyric/core/lyric'
import { setting } from '@lyric/store/state'
import { setLyric, setVertical, setPlaybackRate } from '@lyric/core/lyric'
import { getStatus } from '@lyric/core/mainWindowChannel'
import { isPlay, setting } from '@lyric/store/state'
export default () => {
watch(() => setting['player.isShowLyricTranslation'], setLyric)
watch(() => setting['player.isShowLyricRoma'], setLyric)
watch(() => setting['player.isPlayLxlrc'], setLyric)
watch(() => setting['player.playbackRate'], (rate) => {
setPlaybackRate(rate)
if (isPlay.value) {
setTimeout(() => {
getStatus()
})
}
})
watch(() => setting['desktopLyric.direction'], (direction) => {
setVertical(direction == 'vertical')
// if (isPlay.value)