diff --git a/src/common/ui-protocol.cpp b/src/common/ui-protocol.cpp index 03649a60f..6b975cca9 100644 --- a/src/common/ui-protocol.cpp +++ b/src/common/ui-protocol.cpp @@ -43,6 +43,7 @@ namespace stage { const Symbol ATTR_name{"name"}; const Symbol ATTR_fork{"fork"}; const Symbol ATTR_assets{"assets"}; + const Symbol ATTR_start{"start"}; /* ======== UI-Element protocol ======== */ diff --git a/src/include/ui-protocol.hpp b/src/include/ui-protocol.hpp index 83956e596..9712d7df5 100644 --- a/src/include/ui-protocol.hpp +++ b/src/include/ui-protocol.hpp @@ -82,6 +82,7 @@ namespace stage { extern const Symbol ATTR_name; extern const Symbol ATTR_fork; extern const Symbol ATTR_assets; + extern const Symbol ATTR_start; /* ======== UI-Element protocol ======== */ diff --git a/src/stage/timeline/clip-presenter.hpp b/src/stage/timeline/clip-presenter.hpp index ee950c47a..5476fe31e 100644 --- a/src/stage/timeline/clip-presenter.hpp +++ b/src/stage/timeline/clip-presenter.hpp @@ -82,7 +82,7 @@ namespace timeline { vector> effects_; vector> markers_; - ClipWidget widget_; + unique_ptr widget_; public: /** diff --git a/src/stage/timeline/clip-widget.cpp b/src/stage/timeline/clip-widget.cpp index a3eae6399..ed5947e31 100644 --- a/src/stage/timeline/clip-widget.cpp +++ b/src/stage/timeline/clip-widget.cpp @@ -64,15 +64,28 @@ namespace timeline { - ClipWidget::ClipWidget () + ClipDelegate::~ClipDelegate() { } + + + ClipDelegate::ClipDelegate () { } - ClipWidget::~ClipWidget() - { - } - + namespace {// details of concrete clip appearance styles... + + class ClipWidget + : public Gtk::Button //////////////////////////////////////////////////////////////////TICKET #1211 : need preliminary placeholder clip widget for timeline layout + , public ClipDelegate + , util::MoveOnly + { + /* === Interface ClipDelegate === */ + + public: + ClipWidget() { } + }; + + }//(End)clip appearance details. diff --git a/src/stage/timeline/clip-widget.hpp b/src/stage/timeline/clip-widget.hpp index 42551bd43..575e47082 100644 --- a/src/stage/timeline/clip-widget.hpp +++ b/src/stage/timeline/clip-widget.hpp @@ -46,7 +46,7 @@ ** content is stylised and the temporal extension does not matter. In this form, ** the clip is reduced to an icon, an expand widget and a ID label. This is the ** standard representation encountered within the _media bins._ The intent of this - ** representation is to save on screen area, especially to minimise vertical extension. + ** representation is to save on screen estate, especially to minimise vertical extension. ** But as a derivative of this layout style, a clip may be shown in abridged form, but ** in fact _with proper representation of the temporal extension;_ to this end, the ** enclosing box is extended horizontally as needed, while the compound of icon, @@ -115,13 +115,16 @@ namespace timeline { /** - * @todo WIP-WIP as of 12/2016 + * @todo WIP-WIP as of 3/2020 */ - class ClipWidget + class ClipDelegate { public: - ClipWidget(); - ~ClipWidget(); + enum Appearance {PENDING, ABRIDGED, COMPACT, EXPANDED, DEGRADED}; + + virtual ~ClipDelegate(); ///< this is an interface + + ClipDelegate(); private:/* ===== Internals ===== */ diff --git a/src/stage/timeline/track-presenter.hpp b/src/stage/timeline/track-presenter.hpp index 6d4806ec8..9cba9e560 100644 --- a/src/stage/timeline/track-presenter.hpp +++ b/src/stage/timeline/track-presenter.hpp @@ -90,6 +90,7 @@ #include "stage/timeline/clip-presenter.hpp" #include "stage/timeline/track-head-widget.hpp" #include "stage/timeline/track-body.hpp" +#include "lib/time/timevalue.hpp" #include "lib/iter-tree-explorer.hpp" #include "lib/util-coll.hpp" /////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1201 : test/code... remove this @@ -100,6 +101,7 @@ //#include "lib/util.hpp" //#include +#include #include #include @@ -110,10 +112,11 @@ namespace timeline { using std::vector; using std::unique_ptr; + using std::make_unique; + using lib::time::Time; using lib::diff::TreeMutator; using lib::diff::collection; - using std::make_unique; using lib::explore; using util::max; @@ -122,6 +125,11 @@ namespace timeline { using PMark = unique_ptr; using PRuler = unique_ptr; + namespace { + const int TODO_px_per_second = 25; + const int TODO_px_per_microtick = TODO_px_per_second / Time::SCALE; + } + /** * Reference frame to organise the presentation related to a specific Track in the Timeline-GUI. @@ -219,6 +227,18 @@ namespace timeline { private:/* ===== Internals ===== */ + /** try to extract the start coordinates from a given Diff spec */ + std::optional + extractStartOffset (GenNode const& spec) + { + Rec const& data{spec.data.get()}; + if (!data.hasAttribute(string{ATTR_start})) + return std::nullopt; + int x = TODO_px_per_microtick * _raw(data.get(string{ATTR_start}).data.get