mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-11-26 04:46:07 -08:00
feat(subsync): integrate built-in automatic subtitle syncing
This commit is contained in:
44 files changed
+6498
-135
No files matched your search
@@ -102,6 +102,8 @@ export interface IpcServiceDeps {
|
||||
focusMainWindow: () => void;
|
||||
activatePlaybackWindowForOverlayInteraction?: () => boolean | Promise<boolean>;
|
||||
runSubsyncManual: (request: SubsyncManualRunRequest) => Promise<SubsyncResult>;
|
||||
openSubsyncManual?: () => Promise<void>;
|
||||
pickSubsyncReferenceFile?: () => Promise<string | null>;
|
||||
onYoutubePickerResolve: (
|
||||
request: YoutubePickerResolveRequest,
|
||||
) => Promise<YoutubePickerResolveResult>;
|
||||
@@ -373,6 +375,8 @@ export interface IpcDepsRuntimeOptions {
|
||||
focusMainWindow: () => void;
|
||||
activatePlaybackWindowForOverlayInteraction?: () => boolean | Promise<boolean>;
|
||||
runSubsyncManual: (request: SubsyncManualRunRequest) => Promise<SubsyncResult>;
|
||||
openSubsyncManual?: () => Promise<void>;
|
||||
pickSubsyncReferenceFile?: () => Promise<string | null>;
|
||||
onYoutubePickerResolve: (
|
||||
request: YoutubePickerResolveRequest,
|
||||
) => Promise<YoutubePickerResolveResult>;
|
||||
@@ -457,6 +461,8 @@ export function createIpcDepsRuntime(options: IpcDepsRuntimeOptions): IpcService
|
||||
activatePlaybackWindowForOverlayInteraction:
|
||||
options.activatePlaybackWindowForOverlayInteraction ?? (() => false),
|
||||
runSubsyncManual: options.runSubsyncManual,
|
||||
openSubsyncManual: options.openSubsyncManual,
|
||||
pickSubsyncReferenceFile: options.pickSubsyncReferenceFile,
|
||||
onYoutubePickerResolve: options.onYoutubePickerResolve,
|
||||
previewMediaTimingReview: options.previewMediaTimingReview,
|
||||
getMediaTimingReviewFrame: options.getMediaTimingReviewFrame,
|
||||
@@ -819,6 +825,14 @@ export function registerIpcHandlers(deps: IpcServiceDeps, ipc: IpcMainRegistrar
|
||||
return await deps.runSubsyncManual(parsedRequest);
|
||||
});
|
||||
|
||||
ipc.handle(IPC_CHANNELS.request.openSubsyncManual, async () => {
|
||||
await deps.openSubsyncManual?.();
|
||||
});
|
||||
|
||||
ipc.handle(IPC_CHANNELS.request.pickSubsyncReferenceFile, async () => {
|
||||
return (await deps.pickSubsyncReferenceFile?.()) ?? null;
|
||||
});
|
||||
|
||||
ipc.handle(IPC_CHANNELS.request.getRuntimeOptions, () => {
|
||||
return deps.getRuntimeOptions();
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user