diff --git a/docs/src/user-guide/concepts/timeline.md b/docs/src/user-guide/concepts/timeline.md index f14a8b6..209d8b7 100644 --- a/docs/src/user-guide/concepts/timeline.md +++ b/docs/src/user-guide/concepts/timeline.md @@ -55,4 +55,4 @@ The sidebar shows properties of the focused timeline part, and for things like video and audio clips, it allows you to adjust certain properties of those timeline parts. You may change the start and end position within the original media of a video clip, or adjust the -playback speed. +playback speed. The gap duration can also be adjusted in the sidebar. diff --git a/src/Komposition/Application/TimelineMode.hs b/src/Komposition/Application/TimelineMode.hs index 8d020a5..ac95ae1 100644 --- a/src/Komposition/Application/TimelineMode.hs +++ b/src/Komposition/Application/TimelineMode.hs @@ -192,7 +192,7 @@ timelineMode gui model = do & modifyFocusedVideoPart (\case VideoClip ann asset ts speed -> VideoClip ann asset ts { spanStart = start } speed - vg@VideoGap{} -> vg) + VideoGap ann _ -> VideoGap ann start) & refreshPreviewAndContinue gui FocusedClipEndSet end -> model diff --git a/src/Komposition/UserInterface/GtkInterface/TimelineView.hs b/src/Komposition/UserInterface/GtkInterface/TimelineView.hs index 18f1635..7c045a3 100644 --- a/src/Komposition/UserInterface/GtkInterface/TimelineView.hs +++ b/src/Komposition/UserInterface/GtkInterface/TimelineView.hs @@ -203,6 +203,18 @@ durationControl vs range' current = toDuration <$> numberInput NumberInputProper } where toDuration (NumberInputChanged n) = durationFromSeconds n +gapDurationControl :: VideoSettings -> Duration -> BoxChild (Event TimelineMode) +gapDurationControl vs d = container + Box + [#orientation := OrientationHorizontal] + [ BoxChild defaultBoxChildProperties { expand = True + , fill = True + , padding = 5 + } + $ FocusedClipStartSet + <$> durationControl vs (0, 1000) d + ] + clipSpanControl :: VideoSettings -> VideoAsset -> TimeSpan -> BoxChild (Event TimelineMode) clipSpanControl vs asset ts = container Box @@ -256,7 +268,10 @@ renderSidebar vs mcomp = pane defaultPaneProperties $ container (formatDuration (asset ^. videoAssetMetadata . duration)) ] Just (SomeVideoPart (VideoGap _ d)) -> - [heading "Video Gap", textEntry "Duration" (formatDuration d)] + [ heading "Video Gap" + , textEntry "Duration" (formatDuration d) + , gapDurationControl vs d + ] Just (SomeAudioPart (AudioClip _ asset)) -> [ heading "Audio Clip" , textEntry "Duration" @@ -267,7 +282,10 @@ renderSidebar vs mcomp = pane defaultPaneProperties $ container (show (asset ^. audioAssetMetadata . path . unOriginalPath)) ] Just (SomeAudioPart (AudioGap _ d)) -> - [heading "Audio Gap", textEntry "Duration" (formatDuration d)] + [ heading "Audio Gap" + , textEntry "Duration" (formatDuration d) + , gapDurationControl vs d + ] Nothing -> [ BoxChild defaultBoxChildProperties { expand = False , fill = False