Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
timeline-layout.cpp
Go to the documentation of this file.
1/*
2 TimelineLayout - global timeline layout management and display control
3
4 Copyright (C)
5 2016, Hermann Vosseler <Ichthyostega@web.de>
6
7  **Lumiera** is free software; you can redistribute it and/or modify it
8  under the terms of the GNU General Public License as published by the
9  Free Software Foundation; either version 2 of the License, or (at your
10  option) any later version. See the file COPYING for further details.
11
12* *****************************************************************/
13
14
24#include "stage/gtk-base.hpp"
27
28#include "common/advice.hpp"
30
31using lib::time::Time;
34
35
36namespace stage {
37namespace timeline {
38
39
40
41
42
44
45 TimelineLayout::TimelineLayout (Gtk::Paned& topLevelContainer)
46 : paneSplitPosition_{topLevelContainer.property_position()}
47 , bodyCanvas_{*this} // inject (as interface DisplayManager)
48 , headerPane_{bodyCanvas_.get_vadjustment()} // wire the patchbay (Gtk::Viewport) to follow the body vertical scroll movement
49 , displayEvaluation_{}
50 {
51 topLevelContainer.add1 (headerPane_);
52 topLevelContainer.add2 (bodyCanvas_);
54 zoomWindow_.attachChangeNotification (signalStructureChange_);
55 // make the ZoomWindow react on changes to the horizontal scrollbar pos
56 bodyCanvas_.get_hadjustment()->property_value().signal_changed().connect(
57 sigc::bind(sigc::mem_fun(*this, &TimelineLayout::syncZoomWindow)
59 // make the ZoomWindow react on changes to the window geometry
60 bodyCanvas_.signal_size_allocate().connect(
61 sigc::mem_fun(*this, &TimelineLayout::sizeZoomWindow));
62 }
63
64
73 void
75 {
78
79 // detect changes of the track structure
80 body.signalStructureChange_ = signalStructureChange_;
81 signalStructureChange_(); // this _is_ such a change
82 }
83
88 void
95
96 Gtk::WidgetPath
98 {
99 return bodyCanvas_.get_path();
100 }
101
102
103
104
110 void
115
120 void
122 {
123 Time windowStart = zoomWindow_.visible().start();
124 int pxOffset = translateTimeToPixels (windowStart);
125 bodyCanvas_.get_hadjustment()->set_value(pxOffset);
126 }
127
128 void
130 {
131 /* nothing to do for the collect-phase */
132 }
133
143 void
145 {
146 double pos = hadj->get_value();
148 zoomWindow_.setVisibleStart (windowStart);
149 }
150
156 void
157 TimelineLayout::sizeZoomWindow (Gtk::Allocation& alloc)
158 {
159 int contentWidthPx = alloc.get_width();
160 if (abs(contentWidthPx) != zoomWindow_.pxWidth())
161 zoomWindow_.calibrateExtension (contentWidthPx);
162 }
163
164
165
166 /* ==== Interface: ViewHook ===== */
167
168 void
173
174 void
176 {
178
179 // detect changes of the track structure
180 body.signalStructureChange_ = signalStructureChange_;
181 signalStructureChange_(); // this _is_ such a change
182 }
183
184
185 void
190
191 void
196
197
198 void
200 {
201 NOTREACHED ("TimelineLayout: top-Level must not be re-ordered");
202 }
203
204 void
206 {
207 NOTREACHED ("TimelineLayout: top-Level must not be re-ordered");
208 }
209
210
211
212}}// namespace stage::timeline
Expecting Advice and giving Advice: a cross-cutting collaboration of loosely coupled participants.
A time interval anchored at a specific point in time.
Time start() const
basic constant internal time value.
Lumiera's internal time value datatype.
int translateTimeToPixels(TimeValue startTimePoint) const override
TimeValue applyScreenDelta(Time anchor, double deltaPx) const override
TimeSpan overallSpan() const
void calibrateExtension(uint pxWidth)
Define the extension of the window in pixels.
void attachChangeNotification(FUN &&trigger)
Attach a λ or functor to be triggered on each actual change.
TimeSpan visible() const
void setVisibleStart(TimeValue start)
void installForkRoot(TrackBody &rootTrackBody)
The Lumiera Timeline model does not rely on a list of tracks, as most conventional video editing soft...
Visitor and state holder for a collaborative layout adjustment pass.
void perform()
Conduct global passes over the wired layout elements, in order to adjust and coordinate the overall t...
void installForkRoot(TrackHeadWidget &rootTrackHead)
Initially install the root node of the track fork, which later can be extended recursively by adding ...
void remove(TrackHeadWidget &) override
void setupStructure(LayoutElement &)
void syncZoomWindow(PAdjustment)
Signal receiver (slot) to react on scrollbar changes.
void establishLayout(DisplayEvaluation &) override
TimelineLayout also participates itself in the DisplayEvaluation, notably to set up the basic paramet...
Gtk::WidgetPath getBodyWidgetPath() const
void completeLayout(DisplayEvaluation &) override
void triggerDisplayEvaluation() override
Perform a complete recursive pass over all elements relevant for layout, reestablish size allocation ...
void rehook(TrackHeadWidget &) noexcept override
void hook(TrackHeadWidget &) override
void sizeZoomWindow(Gtk::Allocation &)
Signal receiver (slot) to react on changes of the window screen space allocation.
void installRootTrack(TrackHeadWidget &, TrackBody &)
This function is invoked once for each new TimelineWidget, in order to build the starting point for t...
Helper to organise and draw the space allocated for a fork of sub-tracks.
DisplayManager::SignalStructureChange signalStructureChange_
Header pane control area corresponding to a Track with nested child Tracks.
A set of basic GTK includes for the UI.
boost::rational< int64_t > FSecs
rational representation of fractional seconds
Glib::RefPtr< Gtk::Adjustment > PAdjustment
Lumiera GTK UI implementation root.
Definition guifacade.cpp:37
A core service of the timeline UI to ensure consistent display and layout of all components within th...
a family of time value like entities and their relationships.
This helper class serves to manage the layout and display of the horizontally extended space of a "tr...