Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
ClipDelegate Class Referenceabstract

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

Description

Todo:
WIP-WIP as of 2/2021

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

Public Types

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

Static Public Attributes

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

Static Public Member Functions

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.
 
static Gtk::Widget & expect_and_expose_Widget (PDelegate &manager)
 Wrapper to safely expose the actual clip implementation widget.
 

Public Member Functions

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

Private Attributes

TimeSpan timing_
 

Constructor & Destructor Documentation

◆ ~ClipDelegate()

~ClipDelegate ( )
virtual

this is an interface

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

◆ ClipDelegate()

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

Member Enumeration Documentation

◆ Appearance

enum Appearance

desired appearance style for the clip

Enumerator
PENDING 
SYMBOLIC 
DEGRADED 
ABRIDGED 
COMPACT 
EXPANDED 

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

Member Function Documentation

◆ currentAppearance()

virtual Appearance currentAppearance ( ) const
pure virtual

presentation mode and style currently employed

Implemented in DormantClip, and ClipWidget.

◆ 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.

◆ getClipName()

virtual cuString getClipName ( ) const
pure virtual

human readable rendering of the clip's name or identity

Implemented in DormantClip, and ClipWidget.

◆ setClipName()

virtual void setClipName ( cuString )
pure virtual

Implemented in DormantClip, and ClipWidget.

◆ accessStartTime()

virtual TimeVar & accessStartTime ( )
pure virtual

Implemented in ClipData.

◆ accessDuration()

virtual TimeVar & accessDuration ( )
pure virtual

Implemented in ClipData.

◆ getVerticalOffset()

virtual uint getVerticalOffset ( ) const
pure virtual

Implemented in DormantClip, and ClipWidget.

◆ getCanvas()

virtual WidgetHook & getCanvas ( ) const
pure virtual

Implemented in DormantClip, and ClipWidget.

◆ updatePosition()

virtual void updatePosition ( )
pure virtual

Implemented in DormantClip, and ClipWidget.

◆ calcRequiredHeight()

virtual uint calcRequiredHeight ( ) const
pure virtual

Implemented in DormantClip, and ClipWidget.

◆ 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 432 of file clip-widget.cpp.

References CanvasHook< WID >::hookedAt().

+ Here is the call 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 408 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 441 of file clip-widget.cpp.

References LERR_.

Referenced by ClipPresenter::exposeWidget().

+ Here is the caller graph for this function:

Member Data Documentation

◆ timing_

TimeSpan timing_
private

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

◆ defaultOffsetY

const int defaultOffsetY {0}
static

vertical offset below the track start

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

◆ defaultName

const string defaultName {_("clip")}
static

placeholder name – typically overridden from the model

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

+ Inheritance diagram for ClipDelegate:
+ Collaboration diagram for ClipDelegate:

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