Lumiera  0.pre.03
»edit your freedom«
clip-widget.hpp
Go to the documentation of this file.
1 /*
2  CLIP-WIDGET.hpp - display of a clip in timeline or media bin view
3 
4  Copyright (C)
5  2016, Hermann Vosseler <Ichthyostega@web.de>
6 
7   **Lumiera** is free software; you can redistribute it and/or modify it
8   under the terms of the GNU General Public License as published by the
9   Free Software Foundation; either version 2 of the License, or (at your
10   option) any later version. See the file COPYING for further details.
11 
12 */
13 
14 
110 #ifndef STAGE_TIMELINE_CLIP_WIDGET_H
111 #define STAGE_TIMELINE_CLIP_WIDGET_H
112 
113 #include "stage/gtk-base.hpp"
115 #include "lib/time/timevalue.hpp"
116 
117 //#include "lib/util.hpp"
118 
119 #include <optional>
120 #include <memory>
121 #include <string>
122 //#include <vector>
123 
124 
125 
126 namespace stage {
127 namespace timeline {
128 
129  using std::string;
130  using std::nullopt;
131  using std::optional;
132  using lib::time::Time;
133  using lib::time::TimeVar;
134  using lib::time::Duration;
135  using lib::time::TimeSpan;
136 
137  using WidgetHook = model::CanvasHook<Gtk::Widget>;
138 
139  class ClipDelegate;
140  using PDelegate = std::unique_ptr<ClipDelegate>;
141 
142 
147  {
148  TimeSpan timing_;
149 
150  public:
151  virtual ~ClipDelegate();
152  ClipDelegate();
153 
154 
156  enum Appearance {PENDING, SYMBOLIC, DEGRADED, ABRIDGED, COMPACT, EXPANDED};
157 
158 
160  static const int defaultOffsetY;
161 
163  static const string defaultName;
164 
166  virtual Appearance currentAppearance() const =0;
167 
170  virtual Appearance changeAppearance (Appearance desired) =0;
171 
173  virtual cuString getClipName() const =0;
174  virtual void setClipName (cuString&) =0;
175 
176  virtual TimeVar& accessStartTime() =0;
177  virtual TimeVar& accessDuration() =0;
178 
179  virtual uint getVerticalOffset() const =0;
180 
181  virtual WidgetHook& getCanvas() const =0;
182  virtual void updatePosition() =0;
183 
184  virtual uint calcRequiredHeight() const =0;
185 
186 
192  WidgetHook::Pos establishHookPoint (WidgetHook* newView);
193 
194 
219  static Appearance selectAppearance (PDelegate& existing,
220  Appearance desired =PENDING,
221  WidgetHook* newView =nullptr,
222  optional<TimeSpan> const& timing =nullopt);
223 
231  static Gtk::Widget& expect_and_expose_Widget (PDelegate& manager);
232 
233 
234  private:/* ===== Internals ===== */
235 
236  };
237 
238 
239 }}// namespace stage::timeline
240 #endif /*STAGE_TIMELINE_CLIP_WIDGET_H*/
static Appearance selectAppearance(PDelegate &existing, Appearance desired=PENDING, WidgetHook *newView=nullptr, optional< TimeSpan > const &timing=nullopt)
request to change the clip delegate&#39;s appearance style, if possible.
a mutable time value, behaving like a plain number, allowing copy and re-accessing ...
Definition: timevalue.hpp:232
virtual Appearance changeAppearance(Appearance desired)=0
alter appearance style, to the degree possible for this delegate.
static const string defaultName
placeholder name – typically overridden from the model
virtual cuString getClipName() const =0
human readable rendering of the clip&#39;s name or identity
virtual Appearance currentAppearance() const =0
presentation mode and style currently employed
Appearance
desired appearance style for the clip
Lumiera&#39;s internal time value datatype.
Definition: timevalue.hpp:299
Specialised (abstracted) presentation context with positioning by coordinates.
WidgetHook::Pos establishHookPoint(WidgetHook *newView)
(re)establish current canvas attachment coordinates, thereby possibly switching to a new canvas imple...
Lumiera GTK UI implementation root.
Definition: guifacade.cpp:37
virtual ~ClipDelegate()
this is an interface
Duration is the internal Lumiera time metric.
Definition: timevalue.hpp:468
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.
Definition: timevalue.hpp:573
a family of time value like entities and their relationships.
A set of basic GTK includes for the UI.