119 ClipDelegate::ClipDelegate() { }
138 accessStartTime()
override 144 accessDuration()
override 153 , start_{timings.start()}
154 , dur_{timings.duration()}
176 return Appearance::PENDING;
192 setClipName(cuString& newName)
override 209 getVerticalOffset()
const override 215 getCanvas()
const override 217 return unConst(
this)->display_;
221 updatePosition()
override 230 , display_{displayAnchor}
237 , display_{existing.getCanvas()}
238 , clipName_{existing.getClipName()}
254 return Appearance::COMPACT;
267 return widget::ElementBoxWidget::getName();
271 setClipName(cuString& newName)
override 273 widget::ElementBoxWidget::setName (newName);
277 getVerticalOffset()
const override 283 calcRequiredHeight()
const override 285 return this->get_height();
289 getCanvas()
const override 291 return HookedWidget::getCanvas();
295 updatePosition()
override 298 this->moveTo (nominalPos.x, nominalPos.y);
299 establishHorizontalExtension();
310 int hsiz = getCanvas().getMetric().translateTimeToPixels (accessDuration());
321 [
this]() {
return establishHorizontalExtension(); }
334 [
this]() {
return establishHorizontalExtension(); }
344 enum Mode { HIDDEN, SUMMARY, INDIVIDUAL };
349 return appearance < ClipDelegate::SYMBOLIC? HIDDEN
350 : appearance < ClipDelegate::ABRIDGED? SUMMARY
363 canRepresentAsClip (PDelegate& existing, optional<TimeSpan>
const& timing)
365 return (existing and
canShow(existing->accessStartTime()))
366 or (not existing and timing and
canShow(timing->start())) ;
378 if (existingDelegate)
388 return new ClipWidget (std::move (clipData), newView);
390 UNIMPLEMENTED (
"Summary/Overview presentation style");
395 REQUIRE (newMode==HIDDEN or (timing and
canShow (timing->start())));
405 UNIMPLEMENTED (
"Summary/Overview presentation style");
408 NOTREACHED(
"unsupported clip display mode.");
419 REQUIRE (existing or newView,
"need either an existing delegate or also a new View/Canvas");
421 Appearance current = existing? existing->currentAppearance()
422 : Appearance::PENDING;
423 if (not canRepresentAsClip (existing, timing))
424 desired = Appearance::PENDING;
426 Mode curMode = classifyAppearance (current);
427 Mode newMode = classifyAppearance (desired);
429 if (newView or newMode != curMode)
432 swap (existing, newState);
435 return existing->changeAppearance (desired);
444 newView = & getCanvas();
452 if (manager and manager->currentAppearance() >= ClipDelegate::ABRIDGED)
453 return static_cast<ClipWidget&> (*manager);
456 throw error::State (
_Fmt{
"Attempt to access the Widget for clip('%s') in presentation state %d. " 457 "This implies an error in the signal wiring logic and state handling."}
458 %
string{manager? manager->getClipName() :
"<not initialised>"}
459 %
int {manager? manager->currentAppearance() : -1}
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.
a mutable time value, behaving like a plain number, allowing copy and re-accessing ...
static const string defaultName
placeholder name – typically overridden from the model
#define INSTANCEOF(CLASS, EXPR)
shortcut for subclass test, intended for assertions only.
Types marked with this mix-in may be moved but not copied.
A widget attached onto a display canvas or similar central presentation context.
virtual Appearance currentAppearance() const =0
presentation mode and style currently employed
Appearance
desired appearance style for the clip
A front-end for using printf-style formatting.
static const Duration NIL
constant to indicate "no duration"
Lumiera's internal time value datatype.
Derived specific exceptions within Lumiera's exception hierarchy.
WidgetHook::Pos establishHookPoint(WidgetHook *newView)
(re)establish current canvas attachment coordinates, thereby possibly switching to a new canvas imple...
Lumiera GTK UI implementation root.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
virtual ~ClipDelegate()
this is an interface
static const Time NEVER
border condition marker value. NEVER >= any time value
static Gtk::Widget & expect_and_expose_Widget(PDelegate &manager)
Wrapper to safely expose the actual clip implementation widget.
static const int defaultOffsetY
vertical offset below the track start
A time interval anchored at a specific point in time.
A set of basic GTK includes for the UI.