mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-03-01 18:22:41 -08:00
refactor: extract main runtime dependency builders
This commit is contained in:
21
src/main/runtime/secondary-sub-mode-main-deps.ts
Normal file
21
src/main/runtime/secondary-sub-mode-main-deps.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import type { SecondarySubMode } from '../../types';
|
||||
|
||||
export function createBuildCycleSecondarySubModeMainDepsHandler(deps: {
|
||||
getSecondarySubMode: () => SecondarySubMode;
|
||||
setSecondarySubMode: (mode: SecondarySubMode) => void;
|
||||
getLastSecondarySubToggleAtMs: () => number;
|
||||
setLastSecondarySubToggleAtMs: (timestampMs: number) => void;
|
||||
broadcastToOverlayWindows: (channel: string, mode: SecondarySubMode) => void;
|
||||
showMpvOsd: (text: string) => void;
|
||||
}) {
|
||||
return () => ({
|
||||
getSecondarySubMode: () => deps.getSecondarySubMode(),
|
||||
setSecondarySubMode: (mode: SecondarySubMode) => deps.setSecondarySubMode(mode),
|
||||
getLastSecondarySubToggleAtMs: () => deps.getLastSecondarySubToggleAtMs(),
|
||||
setLastSecondarySubToggleAtMs: (timestampMs: number) =>
|
||||
deps.setLastSecondarySubToggleAtMs(timestampMs),
|
||||
broadcastSecondarySubMode: (mode: SecondarySubMode) =>
|
||||
deps.broadcastToOverlayWindows('secondary-subtitle:mode', mode),
|
||||
showMpvOsd: (text: string) => deps.showMpvOsd(text),
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user