From 99b349430757dcfa92a30a0dced6f19d2d8604d5 Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Mon, 30 Oct 2023 10:50:12 +0900 Subject: [PATCH] add "split segment" to menu --- public/menu.js | 6 ++++++ src/App.jsx | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/public/menu.js b/public/menu.js index ed0c3dac..fc94fc7a 100644 --- a/public/menu.js +++ b/public/menu.js @@ -264,6 +264,12 @@ module.exports = ({ app, mainWindow, newVersion, isStoreBuild }) => { mainWindow.webContents.send('combineSelectedSegments'); }, }, + { + label: esc(t('Split segment at cursor')), + click() { + mainWindow.webContents.send('splitCurrentSegment'); + }, + }, { label: esc(t('Invert all segments on timeline')), click() { diff --git a/src/App.jsx b/src/App.jsx index b6ef9ed1..e5de8e60 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -2196,6 +2196,7 @@ const App = memo(() => { fillSegmentsGaps, combineOverlappingSegments, combineSelectedSegments, + splitCurrentSegment, fixInvalidDuration: tryFixInvalidDuration, reorderSegsByStartTime, concatCurrentBatch, @@ -2220,7 +2221,7 @@ const App = memo(() => { actionsWithCatch.forEach(([key, action]) => electron.ipcRenderer.on(key, action)); return () => actionsWithCatch.forEach(([key, action]) => electron.ipcRenderer.removeListener(key, action)); - }, [alignSegmentTimesToKeyframes, apparentCutSegments, askSetStartTimeOffset, checkFileOpened, clearSegments, closeBatch, closeFileWithConfirm, combineOverlappingSegments, combineSelectedSegments, concatCurrentBatch, createFixedDurationSegments, createNumSegments, createRandomSegments, createSegmentsFromKeyframes, customOutDir, cutSegments, detectBlackScenes, detectSceneChanges, detectSilentScenes, detectedFps, extractAllStreams, fileFormat, filePath, fillSegmentsGaps, getFrameCount, getKeyboardAction, handleShowStreamsSelectorClick, invertAllSegments, loadCutSegments, loadMedia, openFilesDialog, openSendReportDialogWithState, reorderSegsByStartTime, selectedSegments, setWorking, shiftAllSegmentTimes, shuffleSegments, toggleKeyboardShortcuts, toggleLastCommands, toggleSettings, tryFixInvalidDuration, userHtml5ifyCurrentFile, userOpenFiles]); + }, [alignSegmentTimesToKeyframes, apparentCutSegments, askSetStartTimeOffset, checkFileOpened, clearSegments, closeBatch, closeFileWithConfirm, combineOverlappingSegments, combineSelectedSegments, concatCurrentBatch, createFixedDurationSegments, createNumSegments, createRandomSegments, createSegmentsFromKeyframes, customOutDir, cutSegments, detectBlackScenes, detectSceneChanges, detectSilentScenes, detectedFps, extractAllStreams, fileFormat, filePath, fillSegmentsGaps, getFrameCount, getKeyboardAction, handleShowStreamsSelectorClick, invertAllSegments, loadCutSegments, loadMedia, openFilesDialog, openSendReportDialogWithState, reorderSegsByStartTime, selectedSegments, setWorking, shiftAllSegmentTimes, shuffleSegments, splitCurrentSegment, toggleKeyboardShortcuts, toggleLastCommands, toggleSettings, tryFixInvalidDuration, userHtml5ifyCurrentFile, userOpenFiles]); const showAddStreamSourceDialog = useCallback(async () => { try {