feat: mac添加音乐控制图标 , 托盘菜单项,更新播放状态和当前歌曲信息的逻辑

feat #105
This commit is contained in:
alger
2025-03-31 23:05:19 +08:00
parent e0d13057c3
commit 374a7a837d
13 changed files with 416 additions and 53 deletions
+4 -3
View File
@@ -353,14 +353,15 @@ export const usePlayerStore = defineStore('player', () => {
const setIsPlay = (value: boolean) => {
isPlay.value = value;
play.value = value;
localStorage.setItem('isPlaying', value.toString());
// 通知主进程播放状态变化
window.electron?.ipcRenderer.send('update-play-state', value);
};
const setPlayMusic = async (value: boolean | SongResult) => {
if (typeof value === 'boolean') {
play.value = value;
isPlay.value = value;
localStorage.setItem('isPlaying', value.toString());
setIsPlay(value);
} else {
await handlePlayMusic(value);
play.value = true;