From 1627edd96f01dde16d6145007927cd074d83c43f Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sun, 4 Dec 2016 00:29:50 +0100 Subject: [PATCH] define (preliminary) diff bindings for a MarkerWidget ...problem is, I actually don't know much about what kinds of markers we'll get, and how we handle them. Thus introducing a marker kind is just a wild guess, in order to get *any* tangible attribute --- src/gui/timeline/marker-widget.cpp | 60 ++++++------------------------ src/gui/timeline/marker-widget.hpp | 10 ++++- wiki/thinkPad.ichthyo.mm | 28 ++++++++++---- 3 files changed, 40 insertions(+), 58 deletions(-) diff --git a/src/gui/timeline/marker-widget.cpp b/src/gui/timeline/marker-widget.cpp index 08b5aedd5..3fa60f662 100644 --- a/src/gui/timeline/marker-widget.cpp +++ b/src/gui/timeline/marker-widget.cpp @@ -62,6 +62,8 @@ namespace timeline { MarkerWidget::MarkerWidget (ID identity, ctrl::BusTerm& nexus) : Widget{identity, nexus} + , kind_{MARK} + , name_{identity.getSym()} // ID symbol as name fallback { UNIMPLEMENTED ("how to attach the Marker, depending on the actual context"); } @@ -77,57 +79,17 @@ namespace timeline { void MarkerWidget::buildMutator (TreeMutator::Handle buffer) { -#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #1039 - using Attrib = std::pair; - using lib::diff::collection; - buffer.create ( TreeMutator::build() - .attach (collection(scope) - .isApplicableIf ([&](GenNode const& spec) -> bool - { - return spec.data.isNested(); // »Selector« : require object-like sub scope - }) - .matchElement ([&](GenNode const& spec, PMockElm const& elm) -> bool - { - return spec.idi == elm->getID(); - }) - .constructFrom ([&](GenNode const& spec) -> PMockElm - { - PMockElm child = std::make_unique(spec.idi, this->uiBus_); - return child; - }) - .buildChildMutator ([&](PMockElm& target, GenNode::ID const& subID, TreeMutator::Handle buff) -> bool - { - if (target->getID() != subID) return false; //require match on already existing child object - target->buildMutator (buff); // delegate to child to build nested TreeMutator - return true; - })) - .attach (collection(attrib) - .isApplicableIf ([&](GenNode const& spec) -> bool - { - return spec.isNamed() // »Selector« : accept attribute-like values - and not spec.data.isNested(); // but no nested objects - }) - .matchElement ([&](GenNode const& spec, Attrib const& elm) -> bool - { - return elm.first == spec.idi.getSym(); - }) - .constructFrom ([&](GenNode const& spec) -> Attrib - { - string key{spec.idi.getSym()}, - val{render(spec.data)}; - return {key, val}; - }) - .assignElement ([&](Attrib& target, GenNode const& spec) -> bool - { - string key{spec.idi.getSym()}, - newVal{render (spec.data)}; - target.second = newVal; - return true; - }))); -#endif /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #1039 - UNIMPLEMENTED ("diff mutation binding for the TrackPresenter"); + .change("name", [&](string val) + { + name_ = val; + }) + .change("kind", [&](string val) + { + if (val == "LOOP") kind_ = LOOP; + else kind_ = MARK; + })); } diff --git a/src/gui/timeline/marker-widget.hpp b/src/gui/timeline/marker-widget.hpp index 1b8694197..a5d8db171 100644 --- a/src/gui/timeline/marker-widget.hpp +++ b/src/gui/timeline/marker-widget.hpp @@ -39,6 +39,7 @@ #include "gui/gtk-base.hpp" #include "gui/model/widget.hpp" +#include "gui/widget/label-widget.hpp" //#include "lib/util.hpp" @@ -50,14 +51,21 @@ namespace gui { namespace timeline { + enum MarkerKind { + MARK, + LOOP + }; + /** * @todo WIP-WIP as of 12/2016 */ class MarkerWidget : public model::Widget + , public widget::LabelWidget { - + MarkerKind kind_; + string name_; public: /** diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 5c98e65a7..fb9f149c6 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -571,7 +571,8 @@ - + + @@ -597,8 +598,8 @@ - - + + @@ -607,6 +608,7 @@ + @@ -655,7 +657,7 @@ - + @@ -1087,11 +1089,21 @@ - - + + - - + + + + + + +

+ ...sie verwenden dann ein LabelWidget zur Darstellung +

+ + +