Add ability to save/restore queue (#111)

* add ability to save/restore play queue

* Add restoreQueue action

* Add optional pause param on setQueue

---------

Co-authored-by: jeffvli <jeffvictorli@gmail.com>
This commit is contained in:
Kendall Garner 2023-05-21 09:29:58 +00:00 committed by GitHub
parent c1c6ce33e4
commit 106fc90c4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 180 additions and 7 deletions

View file

@ -1,5 +1,5 @@
import { IpcRendererEvent } from 'electron';
import { PlayerData } from './store';
import { PlayerData, PlayerState } from './store';
declare global {
interface Window {
@ -17,6 +17,8 @@ declare global {
PLAYER_PAUSE(): void;
PLAYER_PLAY(): void;
PLAYER_PREVIOUS(): void;
PLAYER_RESTORE_DATA(): void;
PLAYER_SAVE_QUEUE(data: PlayerState): void;
PLAYER_SEEK(seconds: number): void;
PLAYER_SEEK_TO(seconds: number): void;
PLAYER_SET_QUEUE(data: PlayerData): void;
@ -30,6 +32,8 @@ declare global {
RENDERER_PLAYER_PLAY(cb: (event: IpcRendererEvent, data: any) => void): void;
RENDERER_PLAYER_PLAY_PAUSE(cb: (event: IpcRendererEvent, data: any) => void): void;
RENDERER_PLAYER_PREVIOUS(cb: (event: IpcRendererEvent, data: any) => void): void;
RENDERER_PLAYER_RESTORE_QUEUE(cb: (event: IpcRendererEvent, data: any) => void): void;
RENDERER_PLAYER_SAVE_QUEUE(cb: (event: IpcRendererEvent, data: any) => void): void;
RENDERER_PLAYER_STOP(cb: (event: IpcRendererEvent, data: any) => void): void;
SETTINGS_GET(data: { property: string }): any;
SETTINGS_SET(data: { property: string; value: any }): void;