mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-06-12 15:13:32 -07:00
30 lines
1.4 KiB
TypeScript
30 lines
1.4 KiB
TypeScript
import type { MpvCommandFromIpcRuntimeDeps } from '../ipc-mpv-command';
|
|
|
|
export function createBuildMpvCommandFromIpcRuntimeMainDepsHandler(
|
|
deps: MpvCommandFromIpcRuntimeDeps,
|
|
) {
|
|
return (): MpvCommandFromIpcRuntimeDeps => {
|
|
const showPlaybackFeedback = deps.showPlaybackFeedback;
|
|
const showRawMpvOsd = deps.showRawMpvOsd;
|
|
return {
|
|
triggerSubsyncFromConfig: () => deps.triggerSubsyncFromConfig(),
|
|
openRuntimeOptionsPalette: () => deps.openRuntimeOptionsPalette(),
|
|
openJimaku: () => deps.openJimaku(),
|
|
openYoutubeTrackPicker: () => deps.openYoutubeTrackPicker(),
|
|
openPlaylistBrowser: () => deps.openPlaylistBrowser(),
|
|
cycleRuntimeOption: (id, direction) => deps.cycleRuntimeOption(id, direction),
|
|
showMpvOsd: (text: string) => deps.showMpvOsd(text),
|
|
...(showRawMpvOsd ? { showRawMpvOsd: (text: string) => showRawMpvOsd(text) } : {}),
|
|
...(showPlaybackFeedback
|
|
? { showPlaybackFeedback: (text: string) => showPlaybackFeedback(text) }
|
|
: {}),
|
|
replayCurrentSubtitle: () => deps.replayCurrentSubtitle(),
|
|
playNextSubtitle: () => deps.playNextSubtitle(),
|
|
sendMpvCommand: (command: (string | number)[]) => deps.sendMpvCommand(command),
|
|
getMpvClient: () => deps.getMpvClient(),
|
|
isMpvConnected: () => deps.isMpvConnected(),
|
|
hasRuntimeOptionsManager: () => deps.hasRuntimeOptionsManager(),
|
|
};
|
|
};
|
|
}
|