diff --git a/src/stage/timeline/body-canvas-widget.cpp b/src/stage/timeline/body-canvas-widget.cpp index 7e4632563..362270d2c 100644 --- a/src/stage/timeline/body-canvas-widget.cpp +++ b/src/stage/timeline/body-canvas-widget.cpp @@ -215,14 +215,13 @@ namespace timeline { template auto - makeRenderer (DisplayManager& layout, TrackProfile& profile) + makeRenderer (DisplayManager& layout, BodyCanvasWidget::ProfileGetter& getProfile) { return [&](CairoC cox) { PINT concreteRenderScheme{cox, layout}; /////////////////////////////////////////////////////////////////////////////////TICKET #1039 : find out a way how to select the header/body part of the profile! - profile.performWith (concreteRenderScheme); - //^^^^^//////////////////////////////////////////////////TODO: need accessor-function here; attach it somehow to establishTrackProfile() + getProfile().performWith (concreteRenderScheme); }; } @@ -246,12 +245,20 @@ namespace timeline { , profile_{} , rootBody_{nullptr} , contentArea_{} - , rulerCanvas_{makeRenderer(layout_,profile_), makeRenderer(layout_,profile_)} - , mainCanvas_ {makeRenderer(layout_,profile_), makeRenderer(layout_,profile_)} + , rulerCanvas_{makeRenderer(layout_,getProfile), makeRenderer(layout_,getProfile)} + , mainCanvas_ {makeRenderer(layout_,getProfile), makeRenderer(layout_,getProfile)} { // respond to any structure changes of the timeline by recomputing the TrackProfile layout_.signalStructureChange_.connect (sigc::mem_fun (*this, &BodyCanvasWidget::slotStructureChange)); + // access and possible (re)establish the current "profile" of the tracks on demand... + getProfile = [this]() -> TrackProfile& + { + if (rootBody_ and isnil (profile_)) + rootBody_->establishTrackSpace (profile_); + return profile_; + }; + this->set_border_width (0); this->property_expand() = true; // dynamically grab any available additional space this->pack_start (rulerCanvas_); @@ -277,7 +284,7 @@ namespace timeline { /** * The Lumiera Timeline model does not rely on a list of tracks, as most conventional video editing software does -- - * rather, each sequence holds a _fork of nested scopes._ This recursively nested structure is reflected in the way + * rather, each sequence holds a _fork of nested scopes._ This recursively nested structure is parallelled in the way * we organise and draw the timeline representation onto the TimelineCanvas: we use an intermediary entity, the TrackBody * as an organisational grouping device, even while we draw _all of the timeline representation_ onto a single global * #mainCanvas_ within the (scrollable) #contentArea_. Thus, adding the first TrackBody to represent the root track @@ -298,21 +305,6 @@ namespace timeline { } - /** - * - */ - TrackProfile& - BodyCanvasWidget::establishTrackProfile() - { - if (rootBody_) - { - if (isnil (profile_)) - rootBody_->establishTrackSpace (profile_); - } - return profile_; //////////////////////////////////////////////////////////////////////////////////////TICKET #1039 : who actually invokes this function? what if not(rootBody_)? - } - - TimelineCanvas::TimelineCanvas (_Renderer groundingFac, _Renderer overlayFac) diff --git a/src/stage/timeline/body-canvas-widget.hpp b/src/stage/timeline/body-canvas-widget.hpp index f60e52042..b40908051 100644 --- a/src/stage/timeline/body-canvas-widget.hpp +++ b/src/stage/timeline/body-canvas-widget.hpp @@ -128,10 +128,13 @@ namespace timeline { return contentArea_.get_vadjustment(); } + /** a way to get and possibly (re)compute the current TrackProfile */ + using ProfileGetter = std::function; + ProfileGetter getProfile; + private:/* ===== Internals ===== */ void slotStructureChange() noexcept; - TrackProfile& establishTrackProfile(); }; diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 4cf0e52b0..a07bb19e6 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -20806,7 +20806,33 @@ - + + + + + + + + + + + + +

+ und macht sich aber hier im Quellcode über mehrere Funktionen verteilt breit, +

+

+ ohne daß man ihn hier komplett überblicken kann. Dazu kommt, daß die ganze Verdrahterei +

+

+ über zwei Lambdas hinweg auch nicht besonders geradlinig und verständlich ist +

+ + +
+
+
+