Skip to content
This repository has been archived by the owner on Jul 28, 2021. It is now read-only.

Make Gap duration adjustable #77

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/src/user-guide/concepts/timeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion src/Komposition/Application/TimelineMode.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 20 additions & 2 deletions src/Komposition/UserInterface/GtkInterface/TimelineView.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand All @@ -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
Expand Down