mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-04-23 23:57:22 +08:00
✨ feat: 优化歌词窗口交互和同步机制
- 增强歌词窗口数据同步逻辑,支持实时更新和状态管理 - 添加歌词窗口关闭事件监听和状态处理 - 优化无歌词时的默认提示和窗口行为 - 实现歌词窗口定时同步机制,提升用户体验 - 修复歌词窗口打开和关闭时的状态控制 - 国际化支持无歌曲播放时的提示文案
This commit is contained in:
Vendored
+1
@@ -13,6 +13,7 @@ declare global {
|
||||
miniTray: () => void;
|
||||
restart: () => void;
|
||||
unblockMusic: (id: number, data: any) => Promise<any>;
|
||||
onLyricWindowClosed: (callback: () => void) => void;
|
||||
startDownload: (url: string) => void;
|
||||
onDownloadProgress: (callback: (progress: number, status: string) => void) => void;
|
||||
onDownloadComplete: (callback: (success: boolean, filePath: string) => void) => void;
|
||||
|
||||
@@ -12,6 +12,10 @@ const api = {
|
||||
openLyric: () => ipcRenderer.send('open-lyric'),
|
||||
sendLyric: (data) => ipcRenderer.send('send-lyric', data),
|
||||
unblockMusic: (id) => ipcRenderer.invoke('unblock-music', id),
|
||||
// 歌词窗口关闭事件
|
||||
onLyricWindowClosed: (callback: () => void) => {
|
||||
ipcRenderer.on('lyric-window-closed', () => callback());
|
||||
},
|
||||
// 更新相关
|
||||
startDownload: (url: string) => ipcRenderer.send('start-download', url),
|
||||
onDownloadProgress: (callback: (progress: number, status: string) => void) => {
|
||||
|
||||
Reference in New Issue
Block a user