Lumiera  0.pre.03
»edit your freedom«
ClipDelegate Class Referenceabstract

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

Description

Todo:
WIP-WIP as of 2/2021

Definition at line 155 of file clip-widget.hpp.

Public Types

enum  Appearance {
  PENDING,
  SYMBOLIC,
  DEGRADED,
  ABRIDGED,
  COMPACT,
  EXPANDED
}
 desired appearance style for the clip
 

Public Member Functions

virtual ~ClipDelegate ()
 this is an interface
 
virtual TimeVaraccessDuration ()=0
 
virtual TimeVaraccessStartTime ()=0
 
virtual uint calcRequiredHeight () const =0
 
virtual Appearance changeAppearance (Appearance desired)=0
 alter appearance style, to the degree possible for this delegate. More...
 
virtual Appearance currentAppearance () const =0
 presentation mode and style currently employed
 
WidgetHook::Pos establishHookPoint (WidgetHook *newView)
 (re)establish current canvas attachment coordinates, thereby possibly switching to a new canvas implementation More...
 
virtual WidgetHookgetCanvas () const =0
 
virtual cuString getClipName () const =0
 human readable rendering of the clip's name or identity
 
virtual uint getVerticalOffset () const =0
 
virtual void setClipName (cuString &)=0
 
virtual void updatePosition ()=0
 

Static Public Member Functions

static Gtk::Widget & expect_and_expose_Widget (PDelegate &manager)
 Wrapper to safely expose the actual clip implementation widget. More...
 
static Appearance selectAppearance (PDelegate &existing, Appearance desired=PENDING, WidgetHook *newView=nullptr, optional< TimeSpan > const &timing=nullopt)
 request to change the clip delegate's appearance style, if possible. More...
 

Static Public Attributes

static const string defaultName {_("clip")}
 placeholder name – typically overridden from the model
 
static const int defaultOffsetY {0}
 vertical offset below the track start
 

Private Attributes

TimeSpan timing_
 

Member Function Documentation

◆ changeAppearance()

virtual Appearance changeAppearance ( Appearance  desired)
pure virtual

alter appearance style, to the degree possible for this delegate.

Returns
the new Appearance style acquired

Implemented in ClipWidget, and DormantClip.

◆ establishHookPoint()

WidgetHook::Pos establishHookPoint ( WidgetHook newView)

(re)establish current canvas attachment coordinates, thereby possibly switching to a new canvas implementation

Parameters
newView(optional) new canvas; use existing if not given
Returns
record defining the canvas and the coordinates thereon

Definition at line 441 of file clip-widget.cpp.

References ClipDelegate::defaultOffsetY.

Referenced by ClipWidget::getClipName().

+ Here is the caller graph for this function:

◆ selectAppearance()

ClipDelegate::Appearance selectAppearance ( PDelegate &  existing,
Appearance  desired = PENDING,
WidgetHook newView = nullptr,
optional< TimeSpan > const &  timing = nullopt 
)
static

request to change the clip delegate's appearance style, if possible.

Parameters
existingentity to hold and maintain this specific appearance state.
desired(optionally) the intended style or mode to acquire
newView(optionally) a different view to hook up the delegate.
timingposition and duration of the clip, required when existing is empty
Returns
the actual mode the presentation was switched to
Remarks
switching the appearance style is a state transition; sometimes this change also implies switching the actual implementation of the delegate. And thus there can be prerequisites for achieving a specific appearance and presentation mode. Most notably, to reach any style beyond SYMBOLIC, we need to know the temporal extension of the clip. If such requirements can not be fulfilled, presentation stays or drops to the most elaborate state possible with the current configuration.
Note
This function can build a new delegate from scratch, when the existing smart-ptr is empty. However, in this case it is mandatory to pass newView
Default and fallback appearance style is PENDING, which turns the delegate into a mere data record without visual representation.
whenever a WidgetHook (instance) different than the existing one is given, the existing widget / delegate will be destroyed and replaced by a suitable copy hooked up into the new display. The base ctor #ClipData(WidgetHook&) ensures there is always a display_ (WidgetHook) to refer to.

Definition at line 417 of file clip-widget.cpp.

Referenced by ClipPresenter::establishAppearance().

+ Here is the caller graph for this function:

◆ expect_and_expose_Widget()

Gtk::Widget & expect_and_expose_Widget ( PDelegate &  manager)
static

Wrapper to safely expose the actual clip implementation widget.

Exceptions
error::Stateif the current presentation / appearance style does not actually use a dedicated clip widget.
Remarks
the assumption is for the caller to arrange the calling context such that existence of an actual widget can safely be assumed.

Definition at line 450 of file clip-widget.cpp.

Referenced by ClipPresenter::exposeWidget().

+ Here is the caller graph for this function:
+ Inheritance diagram for ClipDelegate:
+ Collaboration diagram for ClipDelegate:

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