@ -195,7 +195,7 @@ function App() {
const { withErrorHandling , handleError , genericError , setGenericError } = useErrorHandling ( ) ;
const { showGenericDialog , genericDialog , closeGenericDialog , confirmDialog , openExportFinishedDialog , openCutFinishedDialog , openConcatFinishedDialog , openCleanupFilesDialog } = useDialog ( ) ;
const { showGenericDialog , genericDialog , closeGenericDialog , confirmDialog , openExportFinishedDialog , openCutFinishedDialog , openConcatFinishedDialog , openCleanupFilesDialog , openShiftSegmentsDialog } = useDialog ( ) ;
// Note that each action may be multiple key bindings and this will only be the first binding for each action
const keyBindingByAction = useMemo ( ( ) = > Object . fromEntries ( keyBindings . map ( ( binding ) = > [ binding . action , binding ] ) ) , [ keyBindings ] ) ;
@ -350,7 +350,7 @@ function App() {
} , [ isFileOpened ] ) ;
const {
cutSegments , cutSegmentsHistory , createSegmentsFromKeyframes , shuffleSegments , detectBlackScenes , detectSilentScenes , detectSceneChanges , removeSegment , invertAllSegments , fillSegmentsGaps , combineOverlappingSegments , combineSelectedSegments , shiftAll SegmentTimes, alignSegmentTimesToKeyframes , updateSegOrder , updateSegOrders , reorderSegsByStartTime , addSegment , setCutStart , setCutEnd , labelSegment , splitCurrentSegment , focusSegmentAtCursor , selectSegmentsAtCursor , createNumSegments , createFixedDurationSegments , createFixedByteSizedSegments , createRandomSegments , getSegEstimatedSize , haveInvalidSegs , currentSegIndexSafe , currentCutSeg , inverseCutSegments , clearSegments , clearSegColorCounter , loadCutSegments , setCutTime , setCurrentSegIndex , labelSelectedSegments , deselectAllSegments , selectAllSegments , selectOnlyCurrentSegment , toggleCurrentSegmentSelected , invertSelectedSegments , removeSelectedSegments , selectSegmentsByLabel , selectSegmentsByExpr , selectAllMarkers , mutateSegmentsByExpr , toggleSegmentSelected , selectOnlySegment , selectedSegments , segmentsOrInverse , segmentsToExport , duplicateCurrentSegment , duplicateSegment , updateSegAtIndex , findSegmentsAtCursor , maybeCreateFullLengthSegment , currentCutSegOrWholeTimeline , segColorCounter ,
cutSegments , cutSegmentsHistory , createSegmentsFromKeyframes , shuffleSegments , detectBlackScenes , detectSilentScenes , detectSceneChanges , removeSegment , invertAllSegments , fillSegmentsGaps , combineOverlappingSegments , combineSelectedSegments , modifySelected SegmentTimes, alignSegmentTimesToKeyframes , updateSegOrder , updateSegOrders , reorderSegsByStartTime , addSegment , setCutStart , setCutEnd , labelSegment , splitCurrentSegment , focusSegmentAtCursor , selectSegmentsAtCursor , createNumSegments , createFixedDurationSegments , createFixedByteSizedSegments , createRandomSegments , getSegEstimatedSize , haveInvalidSegs , currentSegIndexSafe , currentCutSeg , inverseCutSegments , clearSegments , clearSegColorCounter , loadCutSegments , setCutTime , setCurrentSegIndex , labelSelectedSegments , deselectAllSegments , selectAllSegments , selectOnlyCurrentSegment , toggleCurrentSegmentSelected , invertSelectedSegments , removeSelectedSegments , selectSegmentsByLabel , selectSegmentsByExpr , selectAllMarkers , mutateSegmentsByExpr , toggleSegmentSelected , selectOnlySegment , selectedSegments , segmentsOrInverse , segmentsToExport , duplicateCurrentSegment , duplicateSegment , updateSegAtIndex , findSegmentsAtCursor , maybeCreateFullLengthSegment , currentCutSegOrWholeTimeline , segColorCounter ,
} = useSegments ( { filePath , workingRef , setWorking , setProgress , videoStream : activeVideoStream , fileDuration , getRelevantTime , maxLabelLength , checkFileOpened , invertCutSegments , segmentsToChaptersOnly , timecodePlaceholder , parseTimecode , appendFfmpegCommandLog , fileDurationNonZero , mainFileMeta : mainFileMeta?.ffprobeMeta , seekAbs , activeVideoStreamIndex , activeAudioStreamIndexes , handleError , showGenericDialog , simpleMode , ffmpegHwaccel } ) ;
const { getEdlFilePath , projectFileSavePath , getProjectFileSavePath } = useSegmentsAutoSave ( { autoSaveProjectFile , storeProjectInWorkingDir , filePath , customOutDir , cutSegments } ) ;
@ -1274,6 +1274,23 @@ function App() {
}
} , [ filePath , workingRef , setWorking , withErrorHandling , getRelevantTime , videoRef , usingPreviewFile , captureFrameMethod , captureFrameFromFfmpeg , customOutDir , captureFormat , captureFrameQuality , captureFrameFromTag , simpleMode , prefersReducedMotion , hideAllNotifications , openExportFinishedDialog ] ) ;
const shiftAllSegmentTimes = useCallback ( async ( ) = > {
const shift = await openShiftSegmentsDialog ( { inputPlaceholder : timecodePlaceholder , parseTimecode } ) ;
if ( shift == null ) return ;
const { startShift , endShift } = shift ;
await modifySelectedSegmentTimes ( ( segment ) = > {
const newSegment = { . . . segment } ;
if ( startShift != null ) {
newSegment . start += startShift ;
}
if ( endShift != null && newSegment . end != null ) {
newSegment . end += endShift ;
}
return newSegment ;
} ) ;
} , [ modifySelectedSegmentTimes , openShiftSegmentsDialog , parseTimecode , timecodePlaceholder ] ) ;
const captureSnapshotToClipboard = useCallback ( async ( ) = > {
if ( ! filePath || workingRef . current ) return ;
try {