Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
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 87 of file clip-presenter.hpp.

Classes

class  DragRelocateObserver
 

Public Member Functions

 ClipPresenter (ID identity, ctrl::BusTerm &nexus, WidgetHook &view, optional< TimeSpan > const &timing)
 
 ~ClipPresenter ()
 
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.
 
- Public Member Functions inherited from Controller
 Tangible (ID identity, ctrl::BusTerm &nexus)
 
- Public Member Functions inherited from Tangible
virtual ~Tangible ()
 this is an interface
 
 operator string () const
 diagnostic representation.
 
 operator LuidH () const
 
ID getID () const
 
void reset ()
 invoke the generic reset hook
 
void clearMsg ()
 invoke the hook to clear notification messages
 
void clearErr ()
 invoke the hook to clear error markers
 
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.
 
void slotExpand ()
 Expand this element and remember the expanded state.
 
void slotCollapse ()
 Collapse or minimise this element and remember the collapsed state.
 
void slotReveal ()
 Cause the element to be brought into sight.
 
void markFlash ()
 highlight the element visually to catch the user's attention
 
void markMsg (string message)
 push a notification (or warning) message to the element.
 
void markErr (string error)
 push an error state tag to the element
 
void mark (GenNode const &)
 generic handler for all incoming "state mark" messages
 
void installExpander (Expander::ProbeFun, Expander::ChangeFun)
 Configure the (optional) functionality to expand or collapse the UI-Element.
 
void installRevealer (Revealer::RevealeItFun)
 Configure the (optional) functionality to bring the UI-Element into sight.
 
template<typename... ARGS>
void invoke (Symbol cmdID, ARGS &&... args)
 convenience shortcut to issue a command with several arguments
 
- Public Member Functions inherited from DiffMutable
virtual ~DiffMutable ()
 this is an interface
 

Private Member Functions

void buildGestureObserver (Symbol cmdID, Buffer buffer) override
 prompt the Subject to build an Observer for the gesture in formation
 
Gtk::Widget & exposeWidget () override
 the exposed widget can be used for wiring signal handlers
 
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.
 
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.
 

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 Rec = lib::diff::Rec
 
using GenNode = lib::diff::GenNode
 
- Protected Member Functions inherited from Controller
virtual void doMark (GenNode const &mark) override
 default handler for all generic mark messages.
 
- 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.
 
virtual void doReveal ()
 generic default implementation of the "reveal" functionality.
 
- Protected Member Functions inherited from Subject
virtual ~Subject ()
 this is an interface
 
- Protected Attributes inherited from Tangible
ctrl::BusTerm uiBus_
 
Expander expand_
 
Revealer reveal_
 

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 114 of file clip-presenter.hpp.

References ClipPresenter::establishAppearance(), and ClipPresenter::widget_.

+ Here is the call graph for this function:

◆ ~ClipPresenter()

~ClipPresenter ( )
inline

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

Member Function Documentation

◆ buildMutator()

virtual void buildMutator ( TreeMutator::Handle  buffer)
inlineoverridevirtual

set up a binding to respond to mutation messages via UiBus

Implements Tangible.

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

References stage::ATTR_name, stage::ATTR_timing, TreeMutator::build(), ClipPresenter::channels_, GenNode::data, ClipPresenter::effects_, PlantingHandle< BA, DEFAULT >::emplace(), ClipPresenter::establishAppearance(), ClipPresenter::getClipContentCanvas(), GenNode::idi, ClipPresenter::markers_, DataCap::recordType(), GenNode::retrieveAttribute(), stage::TYPE_Channel, stage::TYPE_Effect, stage::TYPE_Marker, and ClipPresenter::widget_.

+ Here is the call graph for this function:

◆ determineRequiredVerticalExtension()

uint determineRequiredVerticalExtension ( ) const
inline

find out the number of pixels necessary to render this clip properly, assuming its current presentation mode (abbreviated, full, expanded).

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

References ClipPresenter::widget_.

◆ 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 209 of file clip-presenter.hpp.

References ClipPresenter::widget_.

◆ buildGestureObserver()

void buildGestureObserver ( Symbol  cmdID,
Buffer   
)
inlineoverrideprivatevirtual

prompt the Subject to build an Observer for the gesture in formation

Implements Subject.

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

References PlantingHandle< BA, DEFAULT >::create().

+ Here is the call graph for this function:

◆ exposeWidget()

Gtk::Widget & exposeWidget ( )
inlineoverrideprivatevirtual

the exposed widget can be used for wiring signal handlers

Implements Subject.

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

References ClipDelegate::expect_and_expose_Widget(), and ClipPresenter::widget_.

+ Here is the call graph for this function:

◆ 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 287 of file clip-presenter.hpp.

References ClipPresenter::defaultAppearance, ClipDelegate::DEGRADED, stage::GESTURE_dragReolcate, CmdContext::linkSubject(), CmdContext::of(), steam::cmd::scope_moveRelocateClip, ClipDelegate::selectAppearance(), CmdContext::setupRelocateDrag(), and ClipPresenter::widget_.

Referenced by ClipPresenter::ClipPresenter(), and ClipPresenter::buildMutator().

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

◆ getClipContentCanvas()

WidgetHook & getClipContentCanvas ( )
inlineprivate

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

Referenced by ClipPresenter::buildMutator().

+ Here is the caller graph for this function:

Member Data Documentation

◆ channels_

vector<unique_ptr<ClipPresenter> > channels_
private

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

Referenced by ClipPresenter::buildMutator().

◆ effects_

vector<unique_ptr<ClipPresenter> > effects_
private

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

Referenced by ClipPresenter::buildMutator().

◆ markers_

vector<unique_ptr<MarkerWidget> > markers_
private

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

Referenced by ClipPresenter::buildMutator().

◆ widget_

◆ 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 102 of file clip-presenter.hpp.

Referenced by ClipPresenter::establishAppearance().

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

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