Lumiera  0.pre.03
»edit your freedom«
TrackBody Class Reference

#include "stage/timeline/track-body.hpp"

Description

Helper to organise and draw the space allocated for a fork of sub-tracks.

TrackBody units work together with the TimelineCanvas, which arranges all elements placed into the tracks and performs custom drawing to mark the working space available for placing those elements (Clips, Effects, Markers). A given TrackBody works with coordinates relative to its vertical starting point; coordinates on the TimelineCanvas operate from top downwards. The fundamental task of a TrackBody is to find out about its own overall height, including the overall height required by all its nested children. Moreover, the height of the content area needs to be negotiated with the actual content elements.

Todo:
WIP-WIP as of 6/2019

Definition at line 95 of file track-body.hpp.

Public Member Functions

void accommodateContentHeight (uint contentExtension)
 ensure content with the given extension can be accommodated within this track's content area
 
Rulers & bindRulers ()
 
uint calcContentHeight () const
 
uint calcHeight () const
 recursively calculate the height in pixels to display this track, including all nested sub-tracks and possibly decoration/padding from CSS More...
 
uint calcRulerHeight () const
 sum up the vertical extension required by all overview rulers. More...
 
uint calcSubtrackHeight () const
 
uint establishTrackSpace (TrackProfile &)
 recursively establish the screen space allocation for this structure of nested tracks. More...
 
uint getContentOffsetY () const
 
void hook (TrackBody &) override
 
void rehook (TrackBody &) noexcept override
 
void remove (TrackBody &) override
 
void setTrackName (cuString &)
 
- Public Member Functions inherited from ViewHook< TrackBody >
virtual ~ViewHook ()
 this is an interface
 
virtual void hook (TrackBody &widget)=0
 
virtual void rehook (TrackBody &widget) noexcept=0
 
virtual void remove (TrackBody &widget)=0
 
void reOrder (IT newOrder)
 re-attach elements in a given, new order. More...
 

Static Public Attributes

static Decoration decoration {}
 storage for common style/padding settings
 

Public Attributes

DisplayManager::SignalStructureChange signalStructureChange_
 

Private Types

using PRuler = std::unique_ptr< RulerTrack >
 
using Rulers = std::vector< PRuler >
 
using SubTracks = std::vector< TrackBody * >
 

Private Attributes

uint contentHeight_
 
uint contentOffset_
 
Rulers rulers_
 
uint startLine_
 
SubTracks subTracks_
 

Member Function Documentation

◆ establishTrackSpace()

uint establishTrackSpace ( TrackProfile profile)

recursively establish the screen space allocation for this structure of nested tracks.

For one, we'll have to find out about the total vertical space for each track, so to establish the vertical starting position, which is required to place clips onto the canvas.

Moreover we have to build the TrackProfile, which is an abstracted description of the sequence of track elements, akin to a vertical cross section through the track bodies. This profile is repeatedly "played back" to paint the background and overlays corresponding to each track.

This function recursively processes the tree of track bodies...

  • pre: the given profile is built and complete up to the (upper side) start of the current track.
  • post: the profile is elaborated for this track and its children, down to the lower end.
    Returns
    total vertical extension required for this track with all its nested sub tracks, in pixels.

Definition at line 213 of file track-body.cpp.

◆ getContentOffsetY()

uint getContentOffsetY ( ) const
inline
Note
relative to local canvas coordinates (body canvas

Definition at line 121 of file track-body.hpp.

◆ calcHeight()

uint calcHeight ( ) const

recursively calculate the height in pixels to display this track, including all nested sub-tracks and possibly decoration/padding from CSS

Note
height attempts to account for everything (to allow sync with header), including the rulers and possibly padding on root track, which are rendered onto a separate canvas, and additionally also nested slope.

Definition at line 132 of file track-body.cpp.

References TrackBody::calcContentHeight().

+ Here is the call graph for this function:

◆ calcRulerHeight()

uint calcRulerHeight ( ) const

sum up the vertical extension required by all overview rulers.

Returns
height in pixels, including all gap space

Definition at line 156 of file track-body.cpp.

References TrackBody::decoration.

Referenced by TrackBody::calcContentHeight().

+ Here is the caller graph for this function:

◆ calcContentHeight()

uint calcContentHeight ( ) const
Remarks
here content means the direct content of this track, plus its rulers and padding, but excluding nested tracks.

Definition at line 143 of file track-body.cpp.

References TrackBody::calcRulerHeight(), and TrackBody::decoration.

Referenced by TrackBody::calcHeight().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ bindRulers()

Rulers& bindRulers ( )
inline

Allow the TrackPresenter to manage the rulers The collection of rulers is part of the systematic UI model and thus formally a direct child of the TrackPresenter; however they are only relevant for the immediate display and interaction mechanics, thus we store them right here, close to usage site.

Note
Ruler entries can be added and removed by diff message, but since the UI is performed single threaded, these mutations never interfere with display evaluation passes.

Definition at line 149 of file track-body.hpp.

+ Inheritance diagram for TrackBody:
+ Collaboration diagram for TrackBody:

The documentation for this class was generated from the following files: