From b005df169766a3d488ff7109b2b24481b9d320b3 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sun, 31 Mar 2019 22:11:33 +0200 Subject: [PATCH] Timeline: pick up work on the track drawing logic ...there was a long intermission, first caused by some contribution to Yoshimi, then by a private project related to Kubernetes --- src/stage/timeline/body-canvas-widget.cpp | 12 ++++++------ src/stage/timeline/patchbay-widget.hpp | 18 ++++++++++++------ src/stage/timeline/track-body.cpp | 1 + src/stage/timeline/track-body.hpp | 4 ++-- src/stage/timeline/track-head-widget.hpp | 3 ++- src/stage/timeline/track-presenter.cpp | 3 ++- src/stage/timeline/track-presenter.hpp | 3 +++ 7 files changed, 28 insertions(+), 16 deletions(-) diff --git a/src/stage/timeline/body-canvas-widget.cpp b/src/stage/timeline/body-canvas-widget.cpp index 8d57dccb9..2f9fb5b4a 100644 --- a/src/stage/timeline/body-canvas-widget.cpp +++ b/src/stage/timeline/body-canvas-widget.cpp @@ -110,7 +110,7 @@ namespace timeline { * including tags and markers, indicators, locators (edit point and playhead) and (semi-transparent) range selections. * @todo according to the documentation for `signal_draw()`, the framework passes the actually visible area as clipping * region. In theory, this information could be used to reduce the load of canvas painting and repainting, which - * becomes crucial for responsiveness on large sessions ////////////////////////////////////TICKET #1191 + * becomes crucial for responsiveness on large sessions ////////////////////////////////////TICKET #1191 */ bool TimelineCanvas::on_draw (Cairo::RefPtr const& cox) @@ -154,7 +154,7 @@ namespace timeline { /** * Finish and close the virtual drawing canvas established by #openCanvas(). - * Discard any coordinate offsets, stroke and drawing settings applied within. + * Discard any coordinate offsets, stroke and drawing settings applied within. */ void TimelineCanvas::closeCanvas (Cairo::RefPtr const& cox) @@ -170,12 +170,12 @@ namespace timeline { void TimelineCanvas::drawGrounding (Cairo::RefPtr const& cox) { - /////////////////////////////////////////////TICKET #1139 : placeholder drawing + /////////////////////////////////////////////TICKET #1039 : placeholder drawing cox->set_source_rgb(0.8, 0.0, 0.0); cox->set_line_width (5.0); cox->rectangle(0,0, 80, 40); cox->stroke(); - /////////////////////////////////////////////TICKET #1139 : placeholder drawing + /////////////////////////////////////////////TICKET #1039 : placeholder drawing } @@ -186,7 +186,7 @@ namespace timeline { void TimelineCanvas::drawOverlays (Cairo::RefPtr const& cox) { - /////////////////////////////////////////////TICKET #1139 : placeholder drawing + /////////////////////////////////////////////TICKET #1039 : placeholder drawing auto alloc = get_allocation(); int w = alloc.get_width(); int h = alloc.get_height(); @@ -196,7 +196,7 @@ namespace timeline { cox->set_line_width (2.0); cox->arc(rad, rad, rad, 0.0, 2.0*M_PI); // full circle cox->stroke(); - /////////////////////////////////////////////TICKET #1139 : placeholder drawing + /////////////////////////////////////////////TICKET #1039 : placeholder drawing } diff --git a/src/stage/timeline/patchbay-widget.hpp b/src/stage/timeline/patchbay-widget.hpp index 9ac995536..ae827613e 100644 --- a/src/stage/timeline/patchbay-widget.hpp +++ b/src/stage/timeline/patchbay-widget.hpp @@ -27,7 +27,9 @@ ** the timeline display as a system of nested tracks. For each of these tracks we get a header ** section, allowing to control its placement parameters, including start time, output routing ** level and panning. The _Patch Bay_ is the container holding all those track header controls, - ** arranged into a recursively nested structure. + ** arranged into a recursively nested structure. Besides that, the Patch Bay serves a secondary + ** concern, namely to present this nested structure with proper vertical scrolling, so to keep + ** each Track Head aligned with the display of the corresponding track's content. ** ** @todo WIP-WIP-WIP as of 10/2018 ** @@ -55,11 +57,15 @@ namespace timeline { /** - * Header pane control area corresponding to a Track with nested child Tracks. - * This structure is used recursively to build up the Fork of nested Tracks. - * - first row: Placement + Property pane - * - second row: content or nested tracks. - * @todo WIP-WIP as of 12/2016 + * Header pane control area corresponding to fork of nested tracks. + * The structure of child tracks is built up recursively, starting with a single + * top level TrackHeadWidget corresponding to the »fork root«. The actual controls + * for the individual tracks are managed by those TrackHeadWidget elements, while + * the PatchbayWidget corresponds to the whole structure and is responsible for + * presenting the proper vertical scrolling, as dictated by the actual track + * content within the BodyCanvasWidget sitting at the right side of the + * HeaderPaneWidget (which is the enclosing container of this PatchbayWidget). + * @todo WIP-WIP as of 4/2019 */ class PatchbayWidget : public Gtk::Viewport diff --git a/src/stage/timeline/track-body.cpp b/src/stage/timeline/track-body.cpp index 7774ecd92..1fdb3c849 100644 --- a/src/stage/timeline/track-body.cpp +++ b/src/stage/timeline/track-body.cpp @@ -67,6 +67,7 @@ namespace timeline { : overviewHeight_{DEFAULT_OVERVIEW_HEIGHT_px} , contentHeight_{DEFAULT_CONTENT_HEIGHT_px} , subTracks_{} + , rulers_{} { } diff --git a/src/stage/timeline/track-body.hpp b/src/stage/timeline/track-body.hpp index cdc4a0d5c..dfae724cb 100644 --- a/src/stage/timeline/track-body.hpp +++ b/src/stage/timeline/track-body.hpp @@ -78,8 +78,8 @@ namespace timeline { using SubTracks = std::vector; - Rulers rulers_; SubTracks subTracks_; + Rulers rulers_; public: TrackBody(); @@ -99,7 +99,7 @@ namespace timeline { * are only relevant for the immediate display and interaction mechanics, * thus we store them right here, close to usage site. * @note Ruler entries can be added and removed by diff message, but since - * the UI is performed single threaded, these mutations never interfer + * the UI is performed single threaded, these mutations never interfere * with display evaluation passes. */ Rulers& diff --git a/src/stage/timeline/track-head-widget.hpp b/src/stage/timeline/track-head-widget.hpp index bb7a5812a..8c80ad11c 100644 --- a/src/stage/timeline/track-head-widget.hpp +++ b/src/stage/timeline/track-head-widget.hpp @@ -35,7 +35,8 @@ ** + video or audio _level_ (=fader) ** - how to locate this content in time (e.g. relative to some marker) ** For each track, we show a patchbay in the timeline header pane, which serves to control - ** such aspects relevant for all content contained within the scope of this track. + ** such aspects relevant for all content contained within the scope of this track, including + ** the sub-tracks nested therein. ** ** @todo WIP-WIP-WIP as of 10/2018 ** diff --git a/src/stage/timeline/track-presenter.cpp b/src/stage/timeline/track-presenter.cpp index 17b08a246..484e79e12 100644 --- a/src/stage/timeline/track-presenter.cpp +++ b/src/stage/timeline/track-presenter.cpp @@ -72,11 +72,12 @@ namespace timeline { /** - * @note we distinguish between the contents of our three nested child collections + * @note we distinguish between the contents of our four nested child collections * based on the symbolic type field sent in the Record type within the diff representation * - "Marker" designates a Marker object * - "Clip" designates a Clip placed on this track * - "Fork" designates a nested sub-track + * - "Ruler" designates a nested ruler (timescale, overview,....) belonging to this track * @see TimelineController::buildMutator() for a basic explanation of the data binding mechanism */ void diff --git a/src/stage/timeline/track-presenter.hpp b/src/stage/timeline/track-presenter.hpp index eb627f6e5..d3ca05c9a 100644 --- a/src/stage/timeline/track-presenter.hpp +++ b/src/stage/timeline/track-presenter.hpp @@ -72,6 +72,9 @@ namespace timeline { /** * Reference frame to organise the display related to a specific Track in the Timeline-GUI. + * With the help of such a common frame of reference, we solve the problem that each individual + * track display needs to hook into two distinct UI presentation structures: the track head controls + * and the presentation of track contents on the BodyCanvasWidget. */ struct DisplayFrame : util::NonCopyable