mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-04-10 04:19:25 -07:00
Add playlist browser overlay modal (#37)
This commit is contained in:
46
src/main/runtime/playlist-browser-ipc.ts
Normal file
46
src/main/runtime/playlist-browser-ipc.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
import type { RegisterIpcRuntimeServicesParams } from '../ipc-runtime';
|
||||
import {
|
||||
appendPlaylistBrowserFileRuntime,
|
||||
getPlaylistBrowserSnapshotRuntime,
|
||||
movePlaylistBrowserIndexRuntime,
|
||||
playPlaylistBrowserIndexRuntime,
|
||||
removePlaylistBrowserIndexRuntime,
|
||||
type PlaylistBrowserRuntimeDeps,
|
||||
} from './playlist-browser-runtime';
|
||||
|
||||
type PlaylistBrowserMainDeps = Pick<
|
||||
RegisterIpcRuntimeServicesParams['mainDeps'],
|
||||
| 'getPlaylistBrowserSnapshot'
|
||||
| 'appendPlaylistBrowserFile'
|
||||
| 'playPlaylistBrowserIndex'
|
||||
| 'removePlaylistBrowserIndex'
|
||||
| 'movePlaylistBrowserIndex'
|
||||
>;
|
||||
|
||||
export type PlaylistBrowserIpcRuntime = {
|
||||
playlistBrowserRuntimeDeps: PlaylistBrowserRuntimeDeps;
|
||||
playlistBrowserMainDeps: PlaylistBrowserMainDeps;
|
||||
};
|
||||
|
||||
export function createPlaylistBrowserIpcRuntime(
|
||||
getMpvClient: PlaylistBrowserRuntimeDeps['getMpvClient'],
|
||||
): PlaylistBrowserIpcRuntime {
|
||||
const playlistBrowserRuntimeDeps: PlaylistBrowserRuntimeDeps = {
|
||||
getMpvClient,
|
||||
};
|
||||
|
||||
return {
|
||||
playlistBrowserRuntimeDeps,
|
||||
playlistBrowserMainDeps: {
|
||||
getPlaylistBrowserSnapshot: () => getPlaylistBrowserSnapshotRuntime(playlistBrowserRuntimeDeps),
|
||||
appendPlaylistBrowserFile: (filePath: string) =>
|
||||
appendPlaylistBrowserFileRuntime(playlistBrowserRuntimeDeps, filePath),
|
||||
playPlaylistBrowserIndex: (index: number) =>
|
||||
playPlaylistBrowserIndexRuntime(playlistBrowserRuntimeDeps, index),
|
||||
removePlaylistBrowserIndex: (index: number) =>
|
||||
removePlaylistBrowserIndexRuntime(playlistBrowserRuntimeDeps, index),
|
||||
movePlaylistBrowserIndex: (index: number, direction: 1 | -1) =>
|
||||
movePlaylistBrowserIndexRuntime(playlistBrowserRuntimeDeps, index, direction),
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user