mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-17 13:48:02 +00:00
feat: monorepo
This commit is contained in:
parent
4d54060a4f
commit
42089d4996
200 changed files with 1530 additions and 1521 deletions
|
|
@ -1,39 +0,0 @@
|
|||
import { player } from '@/renderer/store'
|
||||
import {
|
||||
IpcChannels,
|
||||
IpcChannelsReturns,
|
||||
IpcChannelsParams,
|
||||
} from '@/shared/IpcChannels'
|
||||
|
||||
const on = <T extends keyof IpcChannelsParams>(
|
||||
channel: T,
|
||||
listener: (event: any, params: IpcChannelsReturns[T]) => void
|
||||
) => {
|
||||
window.ipcRenderer?.on(channel, listener)
|
||||
}
|
||||
|
||||
export function ipcRenderer() {
|
||||
on(IpcChannels.Play, () => {
|
||||
player.play(true)
|
||||
})
|
||||
|
||||
on(IpcChannels.Pause, () => {
|
||||
player.pause(true)
|
||||
})
|
||||
|
||||
on(IpcChannels.PlayOrPause, () => {
|
||||
player.playOrPause()
|
||||
})
|
||||
|
||||
on(IpcChannels.Next, () => {
|
||||
player.nextTrack()
|
||||
})
|
||||
|
||||
on(IpcChannels.Previous, () => {
|
||||
player.prevTrack()
|
||||
})
|
||||
|
||||
on(IpcChannels.Repeat, (e, mode) => {
|
||||
player.repeatMode = mode
|
||||
})
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue