144 , start_{timings.start()}
145 , dur_{timings.duration()}
167 return Appearance::PENDING;
173 return currentAppearance();
208 return unConst(
this)->display_;
221 , display_{displayAnchor}
228 , display_{existing.getCanvas()}
229 , clipName_{existing.getClipName()}
245 return Appearance::COMPACT;
252 return currentAppearance();
258 return widget::ElementBoxWidget::getName();
264 widget::ElementBoxWidget::setName (newName);
270 return defaultOffsetY;
276 return this->get_height();
282 return HookedWidget::getCanvas();
288 WidgetHook::Pos nominalPos = establishHookPoint(
nullptr);
289 this->moveTo (nominalPos.x, nominalPos.y);
290 establishHorizontalExtension();
301 int hsiz = getCanvas().getMetric().translateTimeToPixels (accessDuration());
308 :
HookedWidget{displayAnchor.hookedAt(timings, defaultOffsetY), widget::Kind::CONTENT
309 , widget::
Type::VIDEO
310 , widget::name(defaultName)
311 , widget::constrained(
312 [this]() {
return establishHorizontalExtension(); }
321 :
HookedWidget{existing.establishHookPoint(newView) , widget::Kind::CONTENT
322 , widget::
Type::VIDEO
323 , widget::name(existing.getClipName())
324 , widget::constrained(
325 [this]() {
return establishHorizontalExtension(); }
327 , ClipData{std::move (existing)}
340 return appearance < ClipDelegate::SYMBOLIC?
HIDDEN
341 : appearance < ClipDelegate::ABRIDGED?
SUMMARY
350 return start != Time::NEVER;
356 return (existing and
canShow(existing->accessStartTime()))
357 or (not existing and timing and
canShow(timing->start())) ;
369 if (existingDelegate)
379 return new ClipWidget (std::move (clipData), newView);
381 UNIMPLEMENTED (
"Summary/Overview presentation style");
386 REQUIRE (newMode==
HIDDEN or (timing and
canShow (timing->start())));
396 UNIMPLEMENTED (
"Summary/Overview presentation style");
399 NOTREACHED(
"unsupported clip display mode.");
407 ClipDelegate::Appearance
410 REQUIRE (existing or newView,
"need either an existing delegate or also a new View/Canvas");
412 Appearance current = existing? existing->currentAppearance()
413 : Appearance::PENDING;
414 if (not canRepresentAsClip (existing, timing))
415 desired = Appearance::PENDING;
417 Mode curMode = classifyAppearance (current);
418 Mode newMode = classifyAppearance (desired);
420 if (newView or newMode != curMode)
422 PDelegate newState (buildDelegateFor (newMode, existing, newView, timing));
423 swap (existing, newState);
426 return existing->changeAppearance (desired);
435 newView = & getCanvas();
436 return newView->
hookedAt (
Time{accessStartTime()}, defaultOffsetY);
441 ClipDelegate::expect_and_expose_Widget (
PDelegate& manager)
443 if (manager and manager->currentAppearance() >= ClipDelegate::ABRIDGED)
444 return static_cast<ClipWidget&
> (*manager);
447 throw error::State (
_Fmt{
"Attempt to access the Widget for clip('%s') in presentation state %d. "
448 "This implies an error in the signal wiring logic and state handling."}
449 %
string{manager? manager->getClipName() :
"<not initialised>"}
450 %
int {manager? manager->currentAppearance() : -1}
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.
Pos hookedAt(int x, int y)
A widget attached onto a display canvas or similar central presentation context.
Appearance
desired appearance style for the clip
static const string defaultName
placeholder name – typically overridden from the model
virtual ~ClipDelegate()
this is an interface
static const int defaultOffsetY
vertical offset below the track start
Types marked with this mix-in may be moved but not copied.
A front-end for using printf-style formatting.
A set of basic GTK includes for the UI.
LumieraError< LERR_(STATE)> State
std::unique_ptr< ClipDelegate > PDelegate
Lumiera GTK UI implementation root.
OBJ * unConst(const OBJ *)
shortcut to save some typing when having to define const and non-const variants of member functions
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
#define INSTANCEOF(CLASS, EXPR)
shortcut for subclass test, intended for assertions only.