diff --git a/src/gui/timeline/clip-presenter.cpp b/src/gui/timeline/clip-presenter.cpp index ca4818f2c..375644182 100644 --- a/src/gui/timeline/clip-presenter.cpp +++ b/src/gui/timeline/clip-presenter.cpp @@ -44,6 +44,7 @@ //using util::_Fmt; +using lib::diff::TreeMutator; //using util::contains; //using Gtk::Widget; //using sigc::mem_fun; @@ -59,8 +60,11 @@ namespace timeline { - ClipPresenter::ClipPresenter () + ClipPresenter::ClipPresenter (ID identity, ctrl::BusTerm& nexus) + : Controller{identity, nexus} + , widget_{} { + UNIMPLEMENTED ("how inject the ClipWidget into the appropriate GTK display context"); } @@ -71,4 +75,63 @@ namespace timeline { + void + ClipPresenter::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 ClipPresenter"); + } + + + + }}// namespace gui::timeline diff --git a/src/gui/timeline/clip-presenter.hpp b/src/gui/timeline/clip-presenter.hpp index ebc709805..f5fe06623 100644 --- a/src/gui/timeline/clip-presenter.hpp +++ b/src/gui/timeline/clip-presenter.hpp @@ -52,6 +52,8 @@ #define GUI_TIMELINE_CLIP_PRESENTER_H #include "gui/gtk-base.hpp" +#include "gui/model/controller.hpp" +#include "gui/timeline/clip-widget.hpp" //#include "lib/util.hpp" @@ -68,13 +70,27 @@ namespace timeline { * @todo WIP-WIP as of 12/2016 */ class ClipPresenter + : public model::Controller { + ClipWidget widget_; + //////////////////////////TODO collection for the Effects + //////////////////////////TODO collection for the Labels + public: - ClipPresenter(); + /** + * @param identity used to refer to a corresponding session::Fork in the Session + * @param nexus a way to connect this Controller to the UI-Bus. + */ + ClipPresenter (ID identity, ctrl::BusTerm& nexus); + ~ClipPresenter(); - + + private:/* ===== Internals ===== */ - + + /** set up a binding to respond to mutation messages via UiBus */ + virtual void buildMutator (lib::diff::TreeMutator::Handle) override; + }; diff --git a/src/gui/timeline/timeline-controller.cpp b/src/gui/timeline/timeline-controller.cpp index ab6005942..f49f8b574 100644 --- a/src/gui/timeline/timeline-controller.cpp +++ b/src/gui/timeline/timeline-controller.cpp @@ -23,6 +23,14 @@ /** @file timeline-controller.cpp ** Implementation details of timeline operation management and control. + ** - we build a binding to allow TimelineController to handle mutation messages + ** on behalf of "the timeline". While the setup of a Timeline is quite flexible + ** at the session level, here, when it comes to UI presentation, it can be + ** boiled down to + ** + a name + ** + a single mandatory root track (which in turn could hold nested tracks) + ** - thus we get a rather simple mapping, with some fixed attributes and no + ** flexible child collection. The root track is implemented as TrackPresenter. ** ** @todo as of 12/2016 a complete rework of the timeline display is underway ** @see TimelineWidget @@ -32,6 +40,7 @@ #include "gui/gtk-lumiera.hpp" #include "gui/timeline/timeline-controller.hpp" +#include "gui/timeline/track-presenter.hpp" //#include "gui/workspace/workspace-window.hpp" //#include "gui/ui-bus.hpp" @@ -68,7 +77,9 @@ namespace timeline { TimelineController::TimelineController (ID identity, ctrl::BusTerm& nexus) : Controller{identity, nexus} + , fork_{} /////////////////////////////////////////////////////////////////////////////////////TODO note that the TrackPresenter will be built later, when the diff assigns the property!!! { + UNIMPLEMENTED ("how to make the controller operative..."); } @@ -77,6 +88,61 @@ namespace timeline { } + void + TimelineController::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 TimelineController"); + } diff --git a/src/gui/timeline/timeline-controller.hpp b/src/gui/timeline/timeline-controller.hpp index 449bb90fd..46967f28f 100644 --- a/src/gui/timeline/timeline-controller.hpp +++ b/src/gui/timeline/timeline-controller.hpp @@ -58,7 +58,7 @@ #include "lib/time/timevalue.hpp" -//#include +#include //#include @@ -66,6 +66,8 @@ namespace gui { namespace timeline { + class TrackPresenter; + /** * Controller to supervise the timeline display. @@ -78,6 +80,8 @@ namespace timeline { class TimelineController : public model::Controller { + std::unique_ptr fork_; + public: /** * @param identity used to refer to a corresponding timeline element in the Session diff --git a/src/gui/timeline/track-presenter.cpp b/src/gui/timeline/track-presenter.cpp index 0dd5a10c5..d4f161b76 100644 --- a/src/gui/timeline/track-presenter.cpp +++ b/src/gui/timeline/track-presenter.cpp @@ -31,6 +31,7 @@ #include "gui/gtk-lumiera.hpp" #include "gui/timeline/track-presenter.hpp" +#include "gui/timeline/clip-presenter.hpp" //#include "gui/ui-bus.hpp" //#include "lib/format-string.hpp" @@ -44,6 +45,7 @@ //using util::_Fmt; +using lib::diff::TreeMutator; //using util::contains; //using Gtk::Widget; //using sigc::mem_fun; @@ -59,8 +61,12 @@ namespace timeline { - TrackPresenter::TrackPresenter () + TrackPresenter::TrackPresenter (ID identity, ctrl::BusTerm& nexus) + : Controller{identity, nexus} + , subFork_{} + , clips_{} { + UNIMPLEMENTED ("how to attach the TrackPresenter into the two relevant GTK display contexts"); } @@ -71,4 +77,63 @@ namespace timeline { + void + TrackPresenter::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"); + } + + + + }}// namespace gui::timeline diff --git a/src/gui/timeline/track-presenter.hpp b/src/gui/timeline/track-presenter.hpp index ade7197db..058f99eba 100644 --- a/src/gui/timeline/track-presenter.hpp +++ b/src/gui/timeline/track-presenter.hpp @@ -47,29 +47,45 @@ #define GUI_TIMELINE_TRACK_PRESENTER_H #include "gui/gtk-base.hpp" +#include "gui/model/controller.hpp" //#include "lib/util.hpp" //#include -//#include +#include namespace gui { namespace timeline { + class ClipPresenter; /** * @todo WIP-WIP as of 12/2016 */ class TrackPresenter + : public model::Controller { + std::vector> subFork_; + std::vector> clips_; + + public: - TrackPresenter (); + /** + * @param identity used to refer to a corresponding session::Fork in the Session + * @param nexus a way to connect this Controller to the UI-Bus. + */ + TrackPresenter (ID identity, ctrl::BusTerm& nexus); + ~TrackPresenter(); - + + private:/* ===== Internals ===== */ - + + /** set up a binding to respond to mutation messages via UiBus */ + virtual void buildMutator (lib::diff::TreeMutator::Handle) override; + }; diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index e49d469cf..9bb0c94dd 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -602,7 +602,11 @@ - + + + + + @@ -646,17 +650,67 @@ + + + + + + + + + + - + + + + + + + + + + +

+ wie in Kopf und Rumpf injizieren +

+ + +
+ +
+
+
- + + + + + + + + + + + + + + + + + + + + + +