mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-08 04:50:12 +02:00
[enhancement]: Support disabling MPV entirely
Supports running Feishin solely using web audio (useful for clients with problems with MPV). Also moves save/restore queue to utils, as MPV object is now optional
This commit is contained in:
@@ -1,9 +1,31 @@
|
||||
import { IpcRendererEvent, ipcRenderer } from 'electron';
|
||||
import { isMacOS, isWindows, isLinux } from '../utils';
|
||||
import { PlayerState } from '/@/renderer/store';
|
||||
|
||||
const saveQueue = (data: Record<string, any>) => {
|
||||
ipcRenderer.send('player-save-queue', data);
|
||||
};
|
||||
|
||||
const restoreQueue = () => {
|
||||
ipcRenderer.send('player-restore-queue');
|
||||
};
|
||||
|
||||
const onSaveQueue = (cb: (event: IpcRendererEvent) => void) => {
|
||||
ipcRenderer.on('renderer-save-queue', cb);
|
||||
};
|
||||
|
||||
const onRestoreQueue = (cb: (event: IpcRendererEvent, data: Partial<PlayerState>) => void) => {
|
||||
ipcRenderer.on('renderer-restore-queue', cb);
|
||||
};
|
||||
|
||||
export const utils = {
|
||||
isLinux,
|
||||
isMacOS,
|
||||
isWindows,
|
||||
onRestoreQueue,
|
||||
onSaveQueue,
|
||||
restoreQueue,
|
||||
saveQueue,
|
||||
};
|
||||
|
||||
export type Utils = typeof utils;
|
||||
|
||||
Reference in New Issue
Block a user