87 #ifndef STAGE_TIMELINE_TRACK_PRESENTER_H 88 #define STAGE_TIMELINE_TRACK_PRESENTER_H 115 using std::unique_ptr;
116 using std::make_unique;
147 hook (WID& widget,
int xPos=0,
int yPos=0)
override 149 refHook_.hook (widget, hookAdjX (xPos), hookAdjY (yPos));
153 move (WID& widget,
int xPos,
int yPos)
override 155 refHook_.move (widget, hookAdjX (xPos), hookAdjY (yPos));
159 remove (WID& widget)
override 161 refHook_.remove (widget);
168 return this->refHook_;
172 virtual int hookAdjX (
int xPos) =0;
173 virtual int hookAdjY (
int yPos) =0;
190 using PFork = unique_ptr<TrackPresenter>;
191 using PClip = unique_ptr<ClipPresenter>;
192 using PMark = unique_ptr<MarkerWidget>;
193 using PRuler = unique_ptr<RulerTrack>;
214 int hookAdjX (
int xPos)
override {
return xPos; };
215 int hookAdjY (
int yPos)
override {
return yPos + body_.getContentOffsetY(); };
226 , head_{displayAnchor.getHeadHook()}
227 , body_{displayAnchor.getBodyHook()}
231 setTrackName (cuString&
name)
233 head_.setTrackName (name);
234 body_.setTrackName (name);
237 vector<unique_ptr<RulerTrack>>&
240 return body_.bindRulers();
243 void establishExtension (vector<PClip>&, vector<PMark>&);
258 vector<PFork> subFork_;
259 vector<PMark> markers_;
260 vector<PClip> clips_;
270 : Controller{id, nexus}
271 , display_{displayAnchor}
276 setTrackName (
id.getSym());
295 display_.setTrackName (name);
298 void relinkContents ();
319 .isApplicableIf ([&](
GenNode const& spec) ->
bool 323 .constructFrom ([&](
GenNode const& spec) -> PRuler
325 return make_unique<RulerTrack> (spec.idi, this->uiBus_, *
this);
328 .isApplicableIf ([&](
GenNode const& spec) ->
bool 332 .constructFrom ([&](
GenNode const& spec) -> PMark
334 return make_unique<MarkerWidget> (spec.idi, this->uiBus_);
337 .isApplicableIf ([&](
GenNode const& spec) ->
bool 341 .constructFrom ([&](
GenNode const& spec) -> PClip
344 return make_unique<ClipPresenter> (spec.idi, this->uiBus_, display_.getClipHook(), timing);
347 .isApplicableIf ([&](
GenNode const& spec) ->
bool 351 .constructFrom ([&](
GenNode const& spec) -> PFork
353 return make_unique<TrackPresenter> (spec.idi, uiBus_, this->display_);
355 .change(ATTR_name, [&](
string val)
357 this->setTrackName (val);
367 ASSERT (displayEvaluation.isCollectPhase());
368 display_.establishExtension (clips_, markers_);
369 for (
auto& subTrack: subFork_)
370 subTrack->establishLayout (displayEvaluation);
377 ASSERT (not displayEvaluation.isCollectPhase());
379 for (
auto& subTrack: subFork_)
380 subTrack->completeLayout (displayEvaluation);
381 this->relinkContents();
383 display_.sync_and_balance (displayEvaluation);
398 uint maxVSize = max (
explore (clips)
399 .transform([](PClip
const& clip)
401 return clip->determineRequiredVerticalExtension();
403 maxVSize = max (maxVSize, head_.getContentHeight());
404 this->body_.accommodateContentHeight (maxVSize);
405 this->head_.accommodateContentHeight (maxVSize);
415 for (
auto& clip: clips_)
417 for (
auto& mark: markers_)
442 uint contentHeight = body_.calcContentHeight();
443 uint overallHeight = contentHeight + body_.calcSubtrackHeight();
444 head_.syncSubtrackStartHeight (contentHeight);
445 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...