110 ClipDelegate::ClipDelegate() { }
129 accessStartTime()
override 135 accessDuration()
override 144 , start_{timings.start()}
145 , dur_{timings.duration()}
167 return Appearance::PENDING;
183 setClipName(cuString& newName)
override 200 getVerticalOffset()
const override 206 getCanvas()
const override 208 return unConst(
this)->display_;
212 updatePosition()
override 221 , display_{displayAnchor}
228 , display_{existing.getCanvas()}
229 , clipName_{existing.getClipName()}
245 return Appearance::COMPACT;
258 return widget::ElementBoxWidget::getName();
262 setClipName(cuString& newName)
override 264 widget::ElementBoxWidget::setName (newName);
268 getVerticalOffset()
const override 274 calcRequiredHeight()
const override 276 return this->get_height();
280 getCanvas()
const override 282 return HookedWidget::getCanvas();
286 updatePosition()
override 289 this->moveTo (nominalPos.x, nominalPos.y);
290 establishHorizontalExtension();
301 int hsiz = getCanvas().getMetric().translateTimeToPixels (accessDuration());
312 [
this]() {
return establishHorizontalExtension(); }
325 [
this]() {
return establishHorizontalExtension(); }
335 enum Mode { HIDDEN, SUMMARY, INDIVIDUAL };
340 return appearance < ClipDelegate::SYMBOLIC? HIDDEN
341 : appearance < ClipDelegate::ABRIDGED? SUMMARY
354 canRepresentAsClip (PDelegate& existing, optional<TimeSpan>
const& timing)
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.");
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)
423 swap (existing, newState);
426 return existing->changeAppearance (desired);
435 newView = & getCanvas();
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}
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.