add ipc comms for runFFmpegCmd

This commit is contained in:
Abhinav 2022-11-14 17:01:06 +05:30
parent 1131a4dbc8
commit 756b04750e
2 changed files with 19 additions and 1 deletions

View file

@ -1 +1,10 @@
export { runFFmpegCmd } from '../services/ffmpeg'; import { ipcRenderer } from 'electron';
import { ElectronFile } from '../types';
export function runFFmpegCmd(
cmd: string[],
inputFile: ElectronFile,
outputFileName: string
) {
return ipcRenderer.invoke('run-ffmpeg-cmd', cmd, inputFile, outputFileName);
}

View file

@ -20,6 +20,8 @@ import {
skipAppVersion, skipAppVersion,
updateAndRestart, updateAndRestart,
} from '../services/appUpdater'; } from '../services/appUpdater';
import { runFFmpegCmd } from '../services/ffmpeg';
import { ElectronFile } from '../types';
export default function setupIpcComs( export default function setupIpcComs(
tray: Tray, tray: Tray,
@ -125,4 +127,11 @@ export default function setupIpcComs(
ipcMain.handle('get-app-version', () => { ipcMain.handle('get-app-version', () => {
return getAppVersion(); return getAppVersion();
}); });
ipcMain.handle(
'run-ffmpeg-cmd',
(_, cmd: string[], inputFile: ElectronFile, outputFileName: string) => {
return runFFmpegCmd(cmd, inputFile, outputFileName);
}
);
} }