diff --git a/src/gui/timeline/clip-presenter.cpp b/src/gui/timeline/clip-presenter.cpp index 375644182..e0e923623 100644 --- a/src/gui/timeline/clip-presenter.cpp +++ b/src/gui/timeline/clip-presenter.cpp @@ -62,6 +62,9 @@ namespace timeline { ClipPresenter::ClipPresenter (ID identity, ctrl::BusTerm& nexus) : Controller{identity, nexus} + , channels_{} + , effects_{} + , markers_{} , widget_{} { UNIMPLEMENTED ("how inject the ClipWidget into the appropriate GTK display context"); diff --git a/src/gui/timeline/clip-presenter.hpp b/src/gui/timeline/clip-presenter.hpp index f5fe06623..63d081274 100644 --- a/src/gui/timeline/clip-presenter.hpp +++ b/src/gui/timeline/clip-presenter.hpp @@ -58,13 +58,19 @@ //#include "lib/util.hpp" //#include -//#include +#include namespace gui { namespace timeline { + using std::vector; + using std::unique_ptr; + using widget::LabelWidget; + + class MarkerWidget; + /** * @todo WIP-WIP as of 12/2016 @@ -72,9 +78,11 @@ namespace timeline { class ClipPresenter : public model::Controller { + vector> channels_; + vector> effects_; + vector> markers_; + ClipWidget widget_; - //////////////////////////TODO collection for the Effects - //////////////////////////TODO collection for the Labels public: /** diff --git a/src/gui/timeline/marker-widget.cpp b/src/gui/timeline/marker-widget.cpp new file mode 100644 index 000000000..6f8f9a724 --- /dev/null +++ b/src/gui/timeline/marker-widget.cpp @@ -0,0 +1,137 @@ +/* + MarkerWidget - presentation control element for a track within the timeline + + Copyright (C) Lumiera.org + 2016, Hermann Vosseler + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +* *****************************************************/ + + +/** @file marker-widget.cpp + ** Implementation details of track presentation management. + ** + ** @todo WIP-WIP-WIP as of 12/2016 + ** + */ + + +#include "gui/gtk-lumiera.hpp" +#include "gui/timeline/marker-widget.hpp" +#include "gui/timeline/clip-presenter.hpp" + +//#include "gui/ui-bus.hpp" +//#include "lib/format-string.hpp" +//#include "lib/format-cout.hpp" + +//#include "lib/util.hpp" + +//#include +//#include + + + +//using util::_Fmt; +using lib::diff::TreeMutator; +//using util::contains; +//using Gtk::Widget; +//using sigc::mem_fun; +//using sigc::ptr_fun; +//using std::cout; +//using std::endl; + + +namespace gui { +namespace timeline { + + + + + + MarkerWidget::MarkerWidget (ID identity, ctrl::BusTerm& nexus) + : Controller{identity, nexus} + { + UNIMPLEMENTED ("how to attach the TrackPresenter into the two relevant GTK display contexts"); + } + + + MarkerWidget::~MarkerWidget() + { + } + + + + + 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"); + } + + + + +}}// namespace gui::timeline diff --git a/src/gui/timeline/marker-widget.hpp b/src/gui/timeline/marker-widget.hpp new file mode 100644 index 000000000..85fc87c4f --- /dev/null +++ b/src/gui/timeline/marker-widget.hpp @@ -0,0 +1,96 @@ +/* + MARKER-WIDGET.hpp - presentation control element for a track within the timeline + + Copyright (C) Lumiera.org + 2016, Hermann Vosseler + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + + +/** @file marker-widget.hpp + ** Presentation control element to model and manage a track within the timeline UI. + ** In the Lumiera timeline UI, we are mixing two different scope of concerns: For one, + ** we have the globally tangible scope of actual session elements an operations performed + ** on those. And then there are more local considerations regarding the "mechanics" of the + ** UI elements, their state and immediate feedback to user interactions. The _Presenter_ -- + ** as known from the [MVP pattern](https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93presenter) -- + ** serves as link between both levels. For the global angle of view, it is a model::Tangible and thus + ** plays the role of the _View_, while the _Model_ and _Controler_ roles are mediated through the + ** gui::UiBus, exchanging command, state and mutation messages. On the other hand, for the local + ** angle of view, the _Presenter_ is a structural model element, kind of a _view model_, and corresponds + ** to the respective element within the session. In addition, it manages actively the collaborative + ** part of layout building, delegating to a mostly passive GTK widget for the actual display. + ** This way it becomes possible to manage the actual UI resources on a global level, avoiding to + ** represent potentially several thousand individual elements as GTK entities, while at any time + ** only several can be visible and active as far as user interaction is concerned. + ** + ** @todo WIP-WIP-WIP as of 12/2016 + ** + */ + + +#ifndef GUI_TIMELINE_MARKER_WIDGET_H +#define GUI_TIMELINE_MARKER_WIDGET_H + +#include "gui/gtk-base.hpp" +#include "gui/model/controller.hpp" +#include "gui/timeline/track-head-widget.hpp" +#include "gui/timeline/track-body.hpp" + +//#include "lib/util.hpp" + +//#include +#include + + + +namespace gui { +namespace timeline { + + using std::vector; + using std::unique_ptr; + + class ClipPresenter; + + /** + * @todo WIP-WIP as of 12/2016 + */ + class MarkerWidget + : public model::Controller + { + + + public: + /** + * @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. + */ + MarkerWidget (ID identity, ctrl::BusTerm& nexus); + + ~MarkerWidget(); + + + private:/* ===== Internals ===== */ + + /** set up a binding to respond to mutation messages via UiBus */ + virtual void buildMutator (lib::diff::TreeMutator::Handle) override; + + }; + + +}}// namespace gui::timeline +#endif /*GUI_TIMELINE_MARKER_WIDGET_H*/ diff --git a/src/gui/timeline/timeline-controller.hpp b/src/gui/timeline/timeline-controller.hpp index 1c7fce4be..88c95e48c 100644 --- a/src/gui/timeline/timeline-controller.hpp +++ b/src/gui/timeline/timeline-controller.hpp @@ -85,6 +85,7 @@ namespace timeline { public: /** * @param identity used to refer to a corresponding timeline element in the Session + * @param trackID the mandatory root track used in the associated Sequence * @param nexus some established connection to the UI-Bus, used for registration. */ TimelineController (ID identity, ID trackID, ctrl::BusTerm& nexus); diff --git a/src/gui/timeline/track-presenter.cpp b/src/gui/timeline/track-presenter.cpp index d4f161b76..3f3e034eb 100644 --- a/src/gui/timeline/track-presenter.cpp +++ b/src/gui/timeline/track-presenter.cpp @@ -65,6 +65,8 @@ namespace timeline { : Controller{identity, nexus} , subFork_{} , clips_{} + , head_{} + , body_{} { UNIMPLEMENTED ("how to attach the TrackPresenter into the two relevant GTK display contexts"); } diff --git a/src/gui/timeline/track-presenter.hpp b/src/gui/timeline/track-presenter.hpp index 058f99eba..d6e2ded2c 100644 --- a/src/gui/timeline/track-presenter.hpp +++ b/src/gui/timeline/track-presenter.hpp @@ -48,6 +48,8 @@ #include "gui/gtk-base.hpp" #include "gui/model/controller.hpp" +#include "gui/timeline/track-head-widget.hpp" +#include "gui/timeline/track-body.hpp" //#include "lib/util.hpp" @@ -59,6 +61,9 @@ namespace gui { namespace timeline { + using std::vector; + using std::unique_ptr; + class ClipPresenter; /** @@ -67,8 +72,11 @@ namespace timeline { class TrackPresenter : public model::Controller { - std::vector> subFork_; - std::vector> clips_; + vector> subFork_; + vector> clips_; + + TrackHeadWidget head_; + TrackBody body_; public: diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index c3368e275..d0155b73a 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -577,23 +577,17 @@ - +

- eigentlich... + wir lassen es offen, welche Art von ID das ist.

- würde eine BareEntryID genügen. -

-

- Aber die strengere Typisierung erscheint mir ein -

-

- hilfreicher Wink für den User + Irgend eine BareEntryID genügt

@@ -653,7 +647,21 @@ - + + + + + + +

+ theoretisch könnte man eine Timeline ohne Sequenz +

+

+ oder eine Sequenz ohne root-Fork zulassen +

+ + +
@@ -839,6 +847,197 @@
+ + + + + + + + +

+ und zwar interessanterweise über Kreuz gegliedert +

+
    +
  • + die Ctor-Lösung (hat aber etwas mehr Umsetzungsaufwand) +
  • +
  • + die "wird schon klappen"-Lösung +
  • +
+ + +
+ + + + + + + + + + +

+ wenn alle Objekte wirklich auf partiell initialisierten Zustand vorbereitet sind, +

+

+ und auch über ihre APIs dem Nutzer diese Unterscheidnung mit aufzwingen +

+ + +
+ + + + + + + +

+ ...welche darin besteht, +

+

+ daß man überall, in der Fläche, sich um Zustandsabhöngigkeit kümmern muß, +

+

+ und deshalb dazu neigt, das Problem jeweils wegzutricksen. +

+

+ +

+

+ Es besteht also die große Gefahr, zu "sündigen" und +

+

+ heimlich in den "wird schon nix passieren" Fall zu geraten. +

+ + +
+
+ + +
+ + + + + + + +

+ das heißt, nur diese Lösung gründet in der Natur der behandelten Sachverhalte. +

+

+ Wenn etwas seinem Wesen nach nicht optional ist, dann wird es auch nicht optional behandelt. +

+

+ Es ist keine weitere Argumentation notwendig. +

+ + +
+
+ + + + + + +

+ ...nach allen gängigen Prinzipien der instrumentellen Vernunft. +

+

+ KISS +

+

+ YAGNI +

+

+ "fokussiere Dich" +

+ + +
+
+
+ + + + + + + + +

+ hier hab ich endlich mal die Gelegenheit, sauber zu arbeiten +

+ + +
+
+ + + + + + + + +

+ hey, es ist mein Leben +

+ + +
+ + + + + +

+ ...hab ich mich je anders entschieden? +

+

+ wenn ich mich überhaupt entscheiden konnte... +

+ + +
+ +
+
+
+ + + + + + +

+ ...nochmal zusammengefaßt +

+
    +
  • + immer wenn ein Feld seinem Wesen nach zwingend gesetzt sein muß (und aus keinem anderen Grund) +
  • +
  • + dann wird dies per Konstruktor so erzwungen +
  • +
  • + daher muß dann im Diff bereits im INS-Verb die notwendige Information transportiert werden +
  • +
  • + das heißt, bei der Diff-Erzeugung muß man aufpassen und an dieser Stelle bereits einen Record mit den Daten liefern +
  • +
+ + +
+ +
@@ -935,6 +1134,18 @@ + + + + + + + + + + + +