From e713b5b948bd60c575ccbb2f5ac07767f90d8010 Mon Sep 17 00:00:00 2001 From: Cmdv Date: Tue, 8 Jan 2019 22:15:09 +0000 Subject: [PATCH 1/4] Make Gap duration adjustable --- .../UserInterface/GtkInterface/TimelineView.hs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/Komposition/UserInterface/GtkInterface/TimelineView.hs b/src/Komposition/UserInterface/GtkInterface/TimelineView.hs index 18f1635..08aa91e 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, d) 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" From a144bdf6648834418d5fe9325bfd919a2b0ce832 Mon Sep 17 00:00:00 2001 From: Cmdv Date: Tue, 8 Jan 2019 22:37:03 +0000 Subject: [PATCH 2/4] update docs for gap duration in sidebar --- docs/src/user-guide/concepts/timeline.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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. From d07efb5a8cbe300aaea657893f59be0db571d321 Mon Sep 17 00:00:00 2001 From: Cmdv Date: Tue, 8 Jan 2019 22:37:29 +0000 Subject: [PATCH 3/4] make the end value manual on gapDurationControl --- src/Komposition/UserInterface/GtkInterface/TimelineView.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Komposition/UserInterface/GtkInterface/TimelineView.hs b/src/Komposition/UserInterface/GtkInterface/TimelineView.hs index 08aa91e..20e1f0f 100644 --- a/src/Komposition/UserInterface/GtkInterface/TimelineView.hs +++ b/src/Komposition/UserInterface/GtkInterface/TimelineView.hs @@ -212,7 +212,7 @@ gapDurationControl vs d = container , padding = 5 } $ FocusedClipStartSet - <$> durationControl vs (0, d) d + <$> durationControl vs (0, 1000) d ] clipSpanControl :: VideoSettings -> VideoAsset -> TimeSpan -> BoxChild (Event TimelineMode) From 351d702dd1df3e2eda8d28e1e5565c9de066d850 Mon Sep 17 00:00:00 2001 From: Cmdv Date: Wed, 9 Jan 2019 09:41:39 +0000 Subject: [PATCH 4/4] update state for videoGap in FocusedClipStartSet --- src/Komposition/Application/TimelineMode.hs | 2 +- src/Komposition/UserInterface/GtkInterface/TimelineView.hs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) 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 20e1f0f..7c045a3 100644 --- a/src/Komposition/UserInterface/GtkInterface/TimelineView.hs +++ b/src/Komposition/UserInterface/GtkInterface/TimelineView.hs @@ -282,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