43#ifndef STAGE_TIMELINE_CLIP_PRESENTER_H
44#define STAGE_TIMELINE_CLIP_PRESENTER_H
70 using std::unique_ptr;
71 using std::make_unique;
74 using lib::diff::collection;
115 : Controller{identity, nexus}
132 using PChannel = unique_ptr<ClipPresenter>;
133 using PEffect = unique_ptr<ClipPresenter>;
134 using PMarker = unique_ptr<MarkerWidget>;
139 .isApplicableIf ([&](
GenNode const& spec) ->
bool
143 .constructFrom ([&](
GenNode const& spec) -> PMarker
145 return make_unique<MarkerWidget> (spec.
idi, this->uiBus_);
148 .isApplicableIf ([&](
GenNode const& spec) ->
bool
152 .constructFrom ([&](
GenNode const& spec) -> PEffect
155 return make_unique<ClipPresenter> (spec.
idi, this->uiBus_
160 .isApplicableIf ([&](
GenNode const& spec) ->
bool
164 .constructFrom ([&](
GenNode const& spec) -> PChannel
166 return make_unique<ClipPresenter> (spec.
idi, this->uiBus_
178 widget_->accessStartTime() = val.start();
179 widget_->accessDuration() = val.duration();
182 .onLocalChange ([
this]()
197 return widget_->calcRequiredHeight()
198 +
widget_->getVerticalOffset();
232 std::cerr <<
_Fmt{
"Gesture(%s) → Δ ≔ (%3.1f,%3.1f) ⟹ %s ↷ %s"}
244 std::cerr <<
_Fmt{
"!!BANG!! Gesture-Cmd '%s' Time ↷ %s"}
288 optional<TimeSpan>
const& timing =nullopt)
290 void* prevDelegate =
widget_.get();
293 if (prevDelegate !=
widget_.get()
306 UNIMPLEMENTED (
"how to create and wire an embedded canvas for the clip contents/effects");
A handle to allow for safe »remote implantation« of an unknown subclass into a given opaque InPlaceBu...
SUB & emplace(SUB &&implementation)
move-construct an instance of a subclass into the opaque buffer
SUB & create(ARGS &&...args)
Abbreviation for placement new of a subclass SUB into the opaque buffer.
Token or Atom with distinct identity.
string recordType() const
peek into the type field of a nested Record<GenNode>
Customisable intermediary to abstract mutating operations on arbitrary, hierarchical object-like data...
static Builder< TreeMutator > build()
DSL: start building a custom adapted tree mutator, where the operations are tied by closures or wrapp...
A time interval anchored at a specific point in time.
a mutable time value, behaving like a plain number, allowing copy and re-accessing
Lumiera's internal time value datatype.
connection point at the UI-Bus.
static CmdContext of(Symbol cmdID, Symbol ctxID)
global static service accessor function.
CmdContext && linkSubject(Subject &subj)
Builder operation: define the subject to use for the following interaction bindings.
void setupRelocateDrag()
Terminal builder operation: establish the infrastructure for the already defined participants to be i...
Collaboration interface for tracking the formation of a gesture.
GestureObserver(Symbol cmdID)
Role-Interface: the Subject of Interaction.
Mix-in interface to allow for concrete CanvasHooked widgets to adapt themselves to the metric current...
virtual TimeValue applyScreenDelta(Time anchor, double deltaPx) const =0
translate an offset in pixel coordinates into a temporal position
Appearance
desired appearance style for the clip
static Gtk::Widget & expect_and_expose_Widget(PDelegate &manager)
Wrapper to safely expose the actual clip implementation widget.
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.
void markGestureCompleted() override
void updateOffset(double deltaX, double deltaY) override
DragRelocateObserver(Symbol cmdID, ClipPresenter &clipPresenter)
model::DisplayMetric const & metric_
A View-Model entity to represent a clip within the timeline-UI.
vector< unique_ptr< ClipPresenter > > effects_
void buildGestureObserver(Symbol cmdID, Buffer buffer) override
prompt the Subject to build an Observer for the gesture in formation
vector< unique_ptr< MarkerWidget > > markers_
void establishAppearance(WidgetHook *newView=nullptr, optional< TimeSpan > const &timing=nullopt)
reevaluate desired presentation mode and available data, possibly leading to a changed appearance sty...
void relink()
update and re-attach the presentation widget into its presentation context.
vector< unique_ptr< ClipPresenter > > channels_
unique_ptr< ClipDelegate > widget_
Gtk::Widget & exposeWidget() override
the exposed widget can be used for wiring signal handlers
virtual void buildMutator(TreeMutator::Handle buffer) override
set up a binding to respond to mutation messages via UiBus
static const ClipDelegate::Appearance defaultAppearance
default maximum level of detail presentation desired for each clip.
uint determineRequiredVerticalExtension() const
find out the number of pixels necessary to render this clip properly, assuming its current presentati...
ClipPresenter(ID identity, ctrl::BusTerm &nexus, WidgetHook &view, optional< TimeSpan > const &timing)
WidgetHook & getClipContentCanvas()
A front-end for using printf-style formatting.
Abstraction: support for binding command invocation into an UI context.
Common ID definitions for Steam-Layer commands.
Common Abstraction of all sub-controller, coordinated by the UI-Bus.
A set of basic GTK includes for the UI.
Lumiera GTK UI implementation root.
const Symbol TYPE_Channel
const Symbol GESTURE_dragReolcate
CommandSetup scope_moveRelocateClip
generic data element node within a tree
std::optional< X > retrieveAttribute(string key) const
mismatch tolerant convenience shortcut to peek into the attributes of a nested Record
a family of time value like entities and their relationships.
Hard wired key constants and basic definitions for communication with the GUI.