开放API 添加歌词翻译字段
This commit is contained in:
@@ -87,7 +87,7 @@ export const init = () => {
|
||||
onPlay(line, text) {
|
||||
setText(text, Math.max(line, 0))
|
||||
setStatusText(text)
|
||||
window.app_event.lyricLinePlay(text)
|
||||
window.app_event.lyricLinePlay(text, line)
|
||||
// console.log(line, text)
|
||||
},
|
||||
onSetLyric(lines, offset) { // listening lyrics seting event
|
||||
|
||||
@@ -9,6 +9,7 @@ import { throttle } from '@common/utils'
|
||||
import { pause, play, playNext, playPrev } from '@renderer/core/player'
|
||||
import { playProgress } from '@renderer/store/player/playProgress'
|
||||
import { appSetting } from '@renderer/store/setting'
|
||||
import { lyric } from '@renderer/store/player/lyric'
|
||||
|
||||
export default () => {
|
||||
// const setVisibleDesktopLyric = useCommit('setVisibleDesktopLyric')
|
||||
@@ -58,9 +59,11 @@ export default () => {
|
||||
picUrl: musicInfo.pic ?? '',
|
||||
})
|
||||
}
|
||||
const handleSetLyricLine = (text: string) => {
|
||||
const handleSetLyricLine = (text: string, line: number) => {
|
||||
let curLine = lyric.lines[line]?.extendedLyrics.join('\n') ?? ''
|
||||
sendPlayerStatus({
|
||||
lyricLineText: text,
|
||||
lyricLineAllText: curLine ? text + '\n' + curLine : text,
|
||||
})
|
||||
}
|
||||
// const handleSetTaskbarThumbnailClip = (clip) => {
|
||||
|
||||
@@ -145,8 +145,8 @@ export class AppEvent extends Event {
|
||||
}
|
||||
|
||||
// 歌词行播放
|
||||
lyricLinePlay(text: string) {
|
||||
this.emit('lyricLinePlay', text)
|
||||
lyricLinePlay(text: string, line: number) {
|
||||
this.emit('lyricLinePlay', text, line)
|
||||
}
|
||||
|
||||
// 我的列表改变事件
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { reactive } from '@common/utils/vueTools'
|
||||
|
||||
interface Line {
|
||||
export interface Line {
|
||||
text: string
|
||||
time: number
|
||||
extendedLyrics: string[]
|
||||
|
||||
Reference in New Issue
Block a user