1
0
mirror of https://github.com/mifi/lossless-cut.git synced 2024-11-22 02:12:30 +01:00

improve play current segment once

This commit is contained in:
Mikael Finstad 2024-03-17 23:41:37 +08:00
parent 8eebd7ecd6
commit 37931c4d52
No known key found for this signature in database
GPG Key ID: 25AB36E3E81CBC26

View File

@ -940,8 +940,9 @@ function App() {
}
if (playbackModeRef.current != null) {
const isSomeSelectedSegmentAtCursor = selectedSegments.some((selectedSegment) => selectedSegment.segId === segmentAtCursorRef.current?.segId);
if (!isSomeSelectedSegmentAtCursor) { // if a segment is already at cursor, don't do anything
const selectedSegmentAtCursor = selectedSegments.find((selectedSegment) => selectedSegment.segId === segmentAtCursorRef.current?.segId);
const isSomeSegmentAtCursor = selectedSegmentAtCursor != null && commandedTimeRef.current != null && selectedSegmentAtCursor.end - commandedTimeRef.current > 0.1;
if (!isSomeSegmentAtCursor) { // if a segment is already at cursor, don't do anything
if (playbackModeRef.current === 'loop-selected-segments') {
const firstSelectedSegment = selectedSegments[0];
if (firstSelectedSegment == null) throw new Error();