96 #ifndef STAGE_TIMELINE_TRACK_PRESENTER_H 97 #define STAGE_TIMELINE_TRACK_PRESENTER_H 124 using std::unique_ptr;
125 using std::make_unique;
156 hook (WID& widget,
int xPos=0,
int yPos=0)
override 158 refHook_.hook (widget, hookAdjX (xPos), hookAdjY (yPos));
162 move (WID& widget,
int xPos,
int yPos)
override 164 refHook_.move (widget, hookAdjX (xPos), hookAdjY (yPos));
168 remove (WID& widget)
override 170 refHook_.remove (widget);
177 return this->refHook_;
181 virtual int hookAdjX (
int xPos) =0;
182 virtual int hookAdjY (
int yPos) =0;
199 using PFork = unique_ptr<TrackPresenter>;
200 using PClip = unique_ptr<ClipPresenter>;
201 using PMark = unique_ptr<MarkerWidget>;
202 using PRuler = unique_ptr<RulerTrack>;
223 int hookAdjX (
int xPos)
override {
return xPos; };
224 int hookAdjY (
int yPos)
override {
return yPos + body_.getContentOffsetY(); };
235 , head_{displayAnchor.getHeadHook()}
236 , body_{displayAnchor.getBodyHook()}
240 setTrackName (cuString&
name)
242 head_.setTrackName (name);
243 body_.setTrackName (name);
246 vector<unique_ptr<RulerTrack>>&
249 return body_.bindRulers();
252 void establishExtension (vector<PClip>&, vector<PMark>&);
267 vector<PFork> subFork_;
268 vector<PMark> markers_;
269 vector<PClip> clips_;
279 : Controller{id, nexus}
280 , display_{displayAnchor}
285 setTrackName (
id.getSym());
304 display_.setTrackName (name);
307 void relinkContents ();
328 .isApplicableIf ([&](
GenNode const& spec) ->
bool 332 .constructFrom ([&](
GenNode const& spec) -> PRuler
334 return make_unique<RulerTrack> (spec.idi, this->uiBus_, *
this);
337 .isApplicableIf ([&](
GenNode const& spec) ->
bool 341 .constructFrom ([&](
GenNode const& spec) -> PMark
343 return make_unique<MarkerWidget> (spec.idi, this->uiBus_);
346 .isApplicableIf ([&](
GenNode const& spec) ->
bool 350 .constructFrom ([&](
GenNode const& spec) -> PClip
353 return make_unique<ClipPresenter> (spec.idi, this->uiBus_, display_.getClipHook(), timing);
356 .isApplicableIf ([&](
GenNode const& spec) ->
bool 360 .constructFrom ([&](
GenNode const& spec) -> PFork
362 return make_unique<TrackPresenter> (spec.idi, uiBus_, this->display_);
364 .change(ATTR_name, [&](
string val)
366 this->setTrackName (val);
376 ASSERT (displayEvaluation.isCollectPhase());
377 display_.establishExtension (clips_, markers_);
378 for (
auto& subTrack: subFork_)
379 subTrack->establishLayout (displayEvaluation);
386 ASSERT (not displayEvaluation.isCollectPhase());
388 for (
auto& subTrack: subFork_)
389 subTrack->completeLayout (displayEvaluation);
390 this->relinkContents();
392 display_.sync_and_balance (displayEvaluation);
407 uint maxVSize = max (
explore (clips)
408 .transform([](PClip
const& clip)
410 return clip->determineRequiredVerticalExtension();
412 maxVSize = max (maxVSize, head_.getContentHeight());
413 this->body_.accommodateContentHeight (maxVSize);
414 this->head_.accommodateContentHeight (maxVSize);
424 for (
auto& clip: clips_)
426 for (
auto& mark: markers_)
451 uint contentHeight = body_.calcContentHeight();
452 uint overallHeight = contentHeight + body_.calcSubtrackHeight();
453 head_.syncSubtrackStartHeight (contentHeight);
454 head_.accommodateOverallHeight (overallHeight);
void relinkContents()
second pass of the DisplayEvaluation: reassemble content to match adjusted layout ...
A widget attached onto a display canvas or similar central presentation context.
Hard wired key constants and basic definitions for communication with the GUI.
model::DisplayMetric & getMetric() const override
delegating layout metric to the root canvas
connection point at the UI-Bus.
auto explore(IT &&srcSeq)
start building a IterExplorer by suitably wrapping the given iterable source.
Mix-in interface to allow for concrete CanvasHooked widgets to adapt themselves to the metric current...
void sync_and_balance(DisplayEvaluation &)
re-flow and adjust after the global layout has been established At this point we can assume that both...
Any copy and copy construction prohibited.
void setTrackName(string name)
invoked via diff to show a (changed) track name
void establishLayout(DisplayEvaluation &) override
handle Phase-1 of the DisplayEvaluation pass for this track and its sub-tracks.
Allow widgets to connect to a common shared presentation context.
void establishExtension(vector< PClip > &, vector< PMark > &)
Find out about the vertical extension of a single track display.
virtual DisplayMetric & getMetric() const =0
access the component to handle layout metric
Interface to represent _"some presentation layout entity",_ with the ability to place widgets (manage...
A View-Model entity to represent a timeline track in the UI.
A collaboration to establish a globally coherent timeline display layout.
static Builder< TreeMutator > build()
DSL: start building a custom adapted tree mutator, where the operations are tied by closures or wrapp...
SUB & emplace(SUB &&implementation)
move-construct an instance of a subclass into the opaque buffer
Visitor and state holder for a collaborative layout adjustment pass.
Mix-Ins to allow or prohibit various degrees of copying and cloning.
A handle to allow for safe »remote implantation« of an unknown subclass into a given opaque InPlaceBu...
virtual CanvasHook< WID > & getAnchorHook() noexcept
Anchor point to build chains of related View Hooks.
Lumiera GTK UI implementation root.
Interface: a compound of anchoring facilities.
model::CanvasHook< WID > & getAnchorHook() noexcept override
allow to build a derived relative hook with different offset
TrackPresenter(ID id, ctrl::BusTerm &nexus, DisplayViewHooks &displayAnchor)
Presentation control element to model and manage a clip within the timeline UI.
std::optional< X > retrieveAttribute(string key) const
mismatch tolerant convenience shortcut to peek into the attributes of a nested Record ...
This helper class serves to manage the layout and display of the horizontally extended space of a "tr...
string recordType() const
peek into the type field of a nested Record<GenNode>
Reference frame to organise the presentation related to a specific Track in the Timeline-GUI.
Special CanvasHook decorator to apply a (dynamic) offset when attaching or moving Widgets on the shar...
virtual void buildMutator(lib::diff::TreeMutator::Handle) override
set up a binding to respond to mutation messages via UiBus
Some small helpers and convenience shortcuts to ease working with collections and sequences (given by...
void completeLayout(DisplayEvaluation &) override
handle Phase-2 (collect/balancing phase) for this track and its sub-tracks.
A time interval anchored at a specific point in time.
auto collection(COLL &coll)
Entry point to a nested DSL for setup and configuration of a collection binding.
Building tree expanding and backtracking evaluations within hierarchical scopes.
a family of time value like entities and their relationships.
Common Abstraction of all sub-controller, coordinated by the UI-Bus.
A set of basic GTK includes for the UI.
generic data element node within a tree
Customisable intermediary to abstract mutating operations on arbitrary, hierarchical object-like data...