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

#include "stage/timeline/clip-presenter.hpp"

Description

A View-Model entity to represent a clip within the timeline-UI.

Remarks
  • by means of implementing interact::Subject, "the Clip", as represented through the ClipPresenter, can be subject to dragging gestures; the wiring to trigger the detection of such gestures is provided by establishAppearance(), more specifically, this wiring happens whenever a new clip-widget is established.
Todo:
WIP-WIP as of 12/2016

Definition at line 96 of file clip-presenter.hpp.

Public Member Functions

 ClipPresenter (ID identity, ctrl::BusTerm &nexus, WidgetHook &view, optional< TimeSpan > const &timing)
 
virtual void buildMutator (TreeMutator::Handle buffer) override
 set up a binding to respond to mutation messages via UiBus
 
uint determineRequiredVerticalExtension () const
 find out the number of pixels necessary to render this clip properly, assuming its current presentation mode (abbreviated, full, expanded).
 
void relink ()
 update and re-attach the presentation widget into its presentation context. More...
 
- Public Member Functions inherited from Tangible
virtual ~Tangible ()
 this is an interface
 
void clearErr ()
 invoke the hook to clear error markers More...
 
void clearMsg ()
 invoke the hook to clear notification messages More...
 
ID getID () const
 
void installExpander (Expander::ProbeFun, Expander::ChangeFun)
 Configure the (optional) functionality to expand or collapse the UI-Element. More...
 
void installRevealer (Revealer::RevealeItFun)
 Configure the (optional) functionality to bring the UI-Element into sight. More...
 
template<typename... ARGS>
void invoke (Symbol cmdID, ARGS &&...)
 
void invoke (Symbol cmdID, Rec &&arguments)
 Perform a command or action, once the execution context has been established. More...
 
template<typename... ARGS>
void invoke (Symbol cmdID, ARGS &&... args)
 convenience shortcut to issue a command with several arguments
 
void mark (GenNode const &)
 generic handler for all incoming "state mark" messages
 
void markErr (string error)
 push an error state tag to the element More...
 
void markFlash ()
 highlight the element visually to catch the user's attention More...
 
void markMsg (string message)
 push a notification (or warning) message to the element. More...
 
 operator LuidH () const
 
 operator string () const
 diagnostic representation. More...
 
void reset ()
 invoke the generic reset hook More...
 
void slotCollapse ()
 Collapse or minimise this element and remember the collapsed state. More...
 
void slotExpand ()
 Expand this element and remember the expanded state. More...
 
void slotReveal ()
 Cause the element to be brought into sight. More...
 
- Public Member Functions inherited from DiffMutable
virtual ~DiffMutable ()
 this is an interface
 

Classes

class  DragRelocateObserver
 

Private Member Functions

void buildGestureObserver (Symbol cmdID, Buffer buffer) override
 prompt the Subject to build an Observer for the gesture in formation
 
void establishAppearance (WidgetHook *newView=nullptr, optional< TimeSpan > const &timing=nullopt)
 reevaluate desired presentation mode and available data, possibly leading to a changed appearance style of the clip. More...
 
Gtk::Widget & exposeWidget () override
 the exposed widget can be used for wiring signal handlers
 
WidgetHookgetClipContentCanvas ()
 

Private Attributes

vector< unique_ptr< ClipPresenter > > channels_
 
vector< unique_ptr< ClipPresenter > > effects_
 
vector< unique_ptr< MarkerWidget > > markers_
 
unique_ptr< ClipDelegatewidget_
 

Static Private Attributes

static const ClipDelegate::Appearance defaultAppearance = ClipDelegate::COMPACT
 default maximum level of detail presentation desired for each clip. More...
 

Additional Inherited Members

- Public Types inherited from Tangible
using ID = ctrl::BusTerm::ID
 
using LuidH = lib::hash::LuidH
 
- Public Types inherited from Subject
using Buffer = lib::PlantingHandle< GestureObserver, InactiveObserver >
 
- Protected Types inherited from Tangible
using GenNode = lib::diff::GenNode
 
using Rec = lib::diff::Rec
 
- Protected Member Functions inherited from Controller
virtual void doMark (GenNode const &mark) override
 default handler for all generic mark messages. More...
 
- Protected Member Functions inherited from Tangible
 Tangible (ID identity, ctrl::BusTerm &nexus)
 
virtual bool doExpand (bool yes)
 generic default implementation of the expand/collapse functionality. More...
 
virtual void doReveal ()
 generic default implementation of the "reveal" functionality. More...
 
- Protected Member Functions inherited from Subject
virtual ~Subject ()
 this is an interface
 
- Protected Attributes inherited from Tangible
Expander expand_
 
Revealer reveal_
 
ctrl::BusTerm uiBus_
 

Constructor & Destructor Documentation

◆ ClipPresenter()

ClipPresenter ( ID  identity,
ctrl::BusTerm nexus,
WidgetHook view,
optional< TimeSpan > const &  timing 
)
inline
Parameters
identityreferring to the corresponding session::Clip in Steam-Layer.
nexusa way to connect this Controller to the UI-Bus.
view(abstracted) canvas or display framework to attach this clip to
timing(optional) start time point and duration of the clip.
Note
Clip can not be displayed unless #timing is given
Todo:
2022 should provide a way to specify a media type immediately at construction //////////////TICKET #1251 : how to specify media type for the Clip

Definition at line 123 of file clip-presenter.hpp.

References ClipPresenter::establishAppearance().

+ Here is the call graph for this function:

Member Function Documentation

◆ relink()

void relink ( )
inline

update and re-attach the presentation widget into its presentation context.

Will be called during the "re-link phase" of DisplayEvaluation, after the timeline layout has been (re)established globally. Often, this incurs attaching the presentation widget (ClipDelegate) at a different actual position onto the drawing canvas, be it due to a zoom change, or as result of layout re-flow.

Definition at line 218 of file clip-presenter.hpp.

◆ establishAppearance()

void establishAppearance ( WidgetHook newView = nullptr,
optional< TimeSpan > const &  timing = nullopt 
)
inlineprivate

reevaluate desired presentation mode and available data, possibly leading to a changed appearance style of the clip.

Whenever a new clip widget has been created, this function is also responsible for additional setup, and especially to enable the dragging gestures on this clip.

Remarks
a typical example would be, when a clip's temporal position, previously unspecified, now becomes defined through a diff message. With this data, it then would become feasible actually to show the clip in the timeline. Thus the Appearance style of the presentation widget (delegate) can be switched up from PENDING to ABRIDGED.
Note
however this function is also invoked from ctor and then serves to allocate the delegate initially.

Definition at line 296 of file clip-presenter.hpp.

References CmdContext::of(), and ClipDelegate::selectAppearance().

Referenced by ClipPresenter::ClipPresenter().

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

Member Data Documentation

◆ defaultAppearance

const ClipDelegate::Appearance defaultAppearance = ClipDelegate::COMPACT
staticprivate

default maximum level of detail presentation desired for each clip.

Note
the actual appearance style is chosen based on this setting, yet limited by the additional information necessary to establish a given level; e.g. name and content renderer must be available to allow for a detailed rendering of the clip in the timeline.

Definition at line 111 of file clip-presenter.hpp.

+ Inheritance diagram for ClipPresenter:
+ Collaboration diagram for ClipPresenter:

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