From 25be54ecbe9e7fc25416258194113397e34ca233 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Wed, 25 Jan 2023 01:42:40 +0100 Subject: [PATCH] Timeline: remove diagnostic code (closes: #1211) Layout calculation and balancing between body and track header now works reasonably well, labels are placed properly and the calculated layout remains stable when changing window size, connected panes and scrollbars behave as expected now. Quite a feat! --- src/stage/model/canvas-hook.hpp | 5 - src/stage/model/zoom-metric.hpp | 13 -- src/stage/timeline/body-canvas-widget.cpp | 4 - src/stage/timeline/body-canvas-widget.hpp | 4 - src/stage/timeline/clip-widget.cpp | 12 +- src/stage/timeline/display-evaluation.cpp | 16 -- src/stage/timeline/display-manager.hpp | 23 +-- src/stage/timeline/timeline-controller.cpp | 4 - src/stage/timeline/timeline-layout.cpp | 25 --- src/stage/timeline/track-body.cpp | 20 --- src/stage/timeline/track-body.hpp | 4 +- src/stage/timeline/track-head-widget.cpp | 16 -- src/stage/timeline/track-head-widget.hpp | 4 - src/stage/timeline/track-presenter.hpp | 38 +---- src/stage/widget/element-box-widget.cpp | 10 -- .../session/dummy-session-connection.cpp | 8 +- wiki/thinkPad.ichthyo.mm | 160 ++++++++++++++---- 17 files changed, 140 insertions(+), 226 deletions(-) diff --git a/src/stage/model/canvas-hook.hpp b/src/stage/model/canvas-hook.hpp index 4382585db..b228b5fb6 100644 --- a/src/stage/model/canvas-hook.hpp +++ b/src/stage/model/canvas-hook.hpp @@ -57,7 +57,6 @@ #include "lib/util.hpp" #include -#include ///////////////TODO namespace stage { @@ -67,7 +66,6 @@ namespace model { using lib::time::Offset; using lib::time::TimeValue; using lib::time::TimeSpan; - using std::string; //////////////////////////TODO @@ -101,9 +99,6 @@ namespace model { * @return resulting TimeValue when applying the offset within current metric */ virtual TimeValue applyScreenDelta(Time anchor, double deltaPx) const =0; -//////////////////////////////////////////////////////////////TODO -virtual string tranZ(TimeValue staTiPoi) const =0; -//////////////////////////////////////////////////////////////TODO }; diff --git a/src/stage/model/zoom-metric.hpp b/src/stage/model/zoom-metric.hpp index 9f71af049..805acc5c8 100644 --- a/src/stage/model/zoom-metric.hpp +++ b/src/stage/model/zoom-metric.hpp @@ -51,8 +51,6 @@ #include "lib/meta/trait.hpp" #include "stage/model/canvas-hook.hpp" #include "stage/model/zoom-window.hpp" -#include "lib/format-obj.hpp"////////////////////////////TODO -#include "lib/format-string.hpp"/////////////////////////TODO @@ -94,17 +92,6 @@ namespace model { return zoomWindow_.overallSpan(); } -//////////////////////////////////////////////////////////////TODO -string tranZ(TimeValue staTiPoi) const override - { - auto sta = zoomWindow_.overallSpan().start(); - Offset offi{sta, staTiPoi}; - Rat mulli = zoomWindow_.px_per_sec() * _FSecs(offi); - int64_t casti = rational_cast (mulli); - static util::_Fmt formi{"Offset(%d, %d) = %d ⟼ px = %s ⟼ %s"}; - return formi % _raw(sta) % _raw(staTiPoi) % _raw(offi) % util::toString(mulli) % casti; - } -//////////////////////////////////////////////////////////////TODO int translateTimeToPixels (TimeValue startTimePoint) const override { diff --git a/src/stage/timeline/body-canvas-widget.cpp b/src/stage/timeline/body-canvas-widget.cpp index 6cc9ef5a6..620a442c0 100644 --- a/src/stage/timeline/body-canvas-widget.cpp +++ b/src/stage/timeline/body-canvas-widget.cpp @@ -531,7 +531,6 @@ namespace timeline { contentArea_.get_allocated_size(allo,basi); int alloW = allo.get_width(); auto hadj = contentArea_.get_hadjustment(); -cout<<"|?| win::width="<get_upper()<save(); cox->translate(-offH, -offV); -cout<<"|.| trans->"<get_lower()<<"·"<get_upper()<<"("<get_page_size()<<"±"<get_page_increment()<<")"< -//#include #include diff --git a/src/stage/timeline/clip-widget.cpp b/src/stage/timeline/clip-widget.cpp index 8a0d94cb7..6b7a6ef46 100644 --- a/src/stage/timeline/clip-widget.cpp +++ b/src/stage/timeline/clip-widget.cpp @@ -94,27 +94,17 @@ #include "stage/timeline/clip-widget.hpp" #include "stage/widget/element-box-widget.hpp" -//#include "stage/ui-bus.hpp" #include "lib/format-string.hpp" -#include "lib/format-cout.hpp" ///////////////////TODO debugging #include "lib/util.hpp" -//#include -//#include #include using util::_Fmt; -//using util::contains; -//using Gtk::Widget; -//using sigc::mem_fun; -//using sigc::ptr_fun; using lib::time::TimeVar; using util::unConst; -//using std::cout; -//using std::endl; using std::optional; @@ -305,7 +295,7 @@ namespace timeline { updatePosition() override { WidgetHook::Pos nominalPos = establishHookPoint(nullptr); - this->moveTo (nominalPos.x, nominalPos.y); + this->moveTo (nominalPos.x, nominalPos.y); /////////////////////////TICKET #1267 : sometimes fails to cause re-draw (especially when dragging) but position calculated correctly establishHorizontalExtension(); } diff --git a/src/stage/timeline/display-evaluation.cpp b/src/stage/timeline/display-evaluation.cpp index 22774682c..bacf6f7fa 100644 --- a/src/stage/timeline/display-evaluation.cpp +++ b/src/stage/timeline/display-evaluation.cpp @@ -32,24 +32,8 @@ #include "stage/gtk-base.hpp" #include "stage/timeline/display-evaluation.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 util::contains; -//using Gtk::Widget; -//using sigc::mem_fun; -//using sigc::ptr_fun; -//using std::cout; -//using std::endl; using util::isnil; diff --git a/src/stage/timeline/display-manager.hpp b/src/stage/timeline/display-manager.hpp index 9890e7e5d..541710d01 100644 --- a/src/stage/timeline/display-manager.hpp +++ b/src/stage/timeline/display-manager.hpp @@ -85,7 +85,6 @@ #include "stage/model/view-hook.hpp" #include "stage/model/canvas-hook.hpp" #include "lib/util.hpp" -#include "lib/format-cout.hpp"///////////////////////TODO: 4debug #include @@ -99,7 +98,6 @@ namespace timeline { using lib::time::TimeValue; class TrackHeadWidget; class TrackBody; - using std::string;///////////////////////////////TODO /** @@ -183,24 +181,9 @@ namespace timeline { PixSpan getPixSpan() { -//////////////////////////////////////////////////////////////////////////////TODO: DUMP debug - auto covfefe1 = coveredTime(); - auto start = covfefe1.start(); - auto tranS = translateTimeToPixels(start); - auto covfefe2 = coveredTime(); - auto end = covfefe2.end(); - auto tranE = translateTimeToPixels(end); - - string buggi = tranZ(end); - -cout<<"|↯| "<fork_->attachElementBox(); } - if (mark.idi.getSym() == "manip" && this->fork_) - { - this->fork_->manipulateBox(); - } else // forward to default handler model::Controller::doMark (mark); } diff --git a/src/stage/timeline/timeline-layout.cpp b/src/stage/timeline/timeline-layout.cpp index 8eb44a980..3b9d0d853 100644 --- a/src/stage/timeline/timeline-layout.cpp +++ b/src/stage/timeline/timeline-layout.cpp @@ -37,29 +37,11 @@ #include "stage/timeline/timeline-layout.hpp" #include "stage/timeline/track-body.hpp" -//#include "stage/ui-bus.hpp" -//#include "lib/format-string.hpp" -#include "lib/format-cout.hpp"///////////////////////////TODO - #include "common/advice.hpp" -//#include "lib/util.hpp" #include "lib/time/timevalue.hpp" -//#include -//#include - - - -//using util::_Fmt; -//using util::contains; -//using Gtk::Widget; -//using sigc::mem_fun; -//using sigc::ptr_fun; -//using std::cout; -//using std::endl; using lib::time::Time; using lib::time::FSecs; -//using lib::time::Duration; using lib::time::TimeSpan; @@ -152,7 +134,6 @@ namespace timeline { { Time windowStart = zoomWindow_.visible().start(); int pxOffset = translateTimeToPixels (windowStart); -cout<<"|↯| establishLayout time="<offset="<set_value(pxOffset); } @@ -176,7 +157,6 @@ cout<<"|↯| establishLayout time="<offset="<get_value(); TimeValue windowStart = applyScreenDelta(zoomWindow_.overallSpan().start(), pos); -cout<<"|!| zoom-scroll pos="< -//#include - - - -//using util::_Fmt; using util::isnil; using util::min; -//using util::contains; -//using Gtk::Widget; -//using sigc::mem_fun; -//using sigc::ptr_fun; -//using std::cout; -//using std::endl; namespace stage { @@ -133,10 +117,7 @@ namespace timeline { TrackBody::accommodateContentHeight(uint contentExtension) { if (contentExtension > contentHeight_) -{//////////////////////////////////////////////////////TODO - cout<<"|+| contentHeight("< #include @@ -117,7 +116,6 @@ namespace timeline { void setTrackName (cuString&); uint establishTrackSpace (TrackProfile&); void accommodateContentHeight(uint contentExtension); -uint DEBUGconH() const { return contentHeight_;}////////////////////////////////////TODO /** @note relative to local canvas coordinates (body canvas */ uint getContentOffsetY() const { return startLine_ + contentOffset_; } @@ -146,7 +144,7 @@ uint DEBUGconH() const { return contentHeight_;}//////////////////////////////// * @note Ruler entries can be added and removed by diff message, but since * the UI is performed single threaded, these mutations never interfere * with display evaluation passes. - */ + */ Rulers& bindRulers() { diff --git a/src/stage/timeline/track-head-widget.cpp b/src/stage/timeline/track-head-widget.cpp index 6c9a5b776..efed985ca 100644 --- a/src/stage/timeline/track-head-widget.cpp +++ b/src/stage/timeline/track-head-widget.cpp @@ -48,8 +48,6 @@ #include "stage/gtk-base.hpp" #include "stage/timeline/track-head-widget.hpp" -#include "lib/format-cout.hpp"/////////////////////////////TODO 4dump - #include "lib/util.hpp" using util::max; @@ -122,14 +120,7 @@ namespace timeline { { uint heightSum{0}; for (uint line=1; line <= 2u + childCnt_; ++line) - {/////////////////////////////////////////////TODO - int h1 = getHeightAt (0,line); - int h2 = getHeightAt (1,line); -////////////////////////////////////////////////////TODO -cout<<"|o| cH(line="<get_child_at(left,top); REQUIRE (cell); -cell->get_size_request (reqW, reqH); cell->set_size_request (-1, height); -uint hnach = getOverallHeight(); -cell->get_size_request (reqW, reqHn); -cout<<"|+| Head:inc ("< -//#include diff --git a/src/stage/timeline/track-presenter.hpp b/src/stage/timeline/track-presenter.hpp index 0648773cf..fdc129b9a 100644 --- a/src/stage/timeline/track-presenter.hpp +++ b/src/stage/timeline/track-presenter.hpp @@ -108,15 +108,9 @@ #include "lib/time/timevalue.hpp" #include "lib/iter-tree-explorer.hpp" #include "lib/util-coll.hpp" -/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1201 : test/code... remove this -#include "lib/format-cout.hpp" -#include "lib/test/test-helper.hpp" -/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1201 : test/code... remove this #include "lib/nocopy.hpp" -//#include "lib/util.hpp" -//#include #include #include #include @@ -297,7 +291,6 @@ namespace timeline { /////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1201 : test/code... remove this void injectDebugTrackLabels(); void attachElementBox(); - void manipulateBox(); /////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1201 : test/code... remove this /////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1201 : test/code... remove this uString TODO_trackName_; @@ -359,14 +352,6 @@ namespace timeline { }) }); } - inline void - TrackPresenter::manipulateBox() - { - if (not theBox_) return; - string rands = lib::test::randStr(rand() % 40); - cout << _Fmt{"maniRandS(%d):%s"} % rands.length() % rands <setName (rands); - } /////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1201 : test/code... remove this /** * @note we distinguish between the contents of our four nested child collections @@ -467,14 +452,9 @@ namespace timeline { { return clip->determineRequiredVerticalExtension(); })); -auto headH = head_.getContentHeight();/////////////////////////////////////////////////////////////////////TODO -auto bodyH = maxVSize; - maxVSize = max (maxVSize, headH); + maxVSize = max (maxVSize, head_.getContentHeight()); this->body_.accommodateContentHeight (maxVSize); this->head_.accommodateContentHeight (maxVSize); -auto headN = head_.getContentHeight(); -auto bodyN = body_.DEBUGconH(); -cout<<"|*| establishExtension(clipH="< -//#include - - - -//using util::contains; -//using Gtk::Widget; namespace stage { diff --git a/src/steam/mobject/session/dummy-session-connection.cpp b/src/steam/mobject/session/dummy-session-connection.cpp index d4ebb83c2..4d8843d38 100644 --- a/src/steam/mobject/session/dummy-session-connection.cpp +++ b/src/steam/mobject/session/dummy-session-connection.cpp @@ -218,13 +218,13 @@ namespace session { , mut (forkRoot) , ins (rootTrackName) , ins (track1) -/* , ins (track2) + , ins (track2) , ins (timeRuler) , ins (scopeRuler0) -*/ , mut (track1) + , mut (track1) , ins (makeName(track1)) , emu (track1) -/* , mut (track2) + , mut (track2) , ins (makeName(track2)) , ins (track21) , ins (track22) @@ -246,7 +246,7 @@ namespace session { , emu (track222) , emu (track22) , emu (track2) -*/ , emu (forkRoot) + , emu (forkRoot) , emu (timeline) }; } diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 0f2b63424..b12ac39cc 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -26369,16 +26369,34 @@ - - + + + + + - - + + + + + + + + + +

+ ...was bisher nur nicht aufgefallen war, weil die Display-Evaluation nur einmal lief;
Nachdem ich das ZoomWindow integriert hatte, zeigten sich diverse Defekte / run-away-Effekte, die erst beoben waren, nachdem ich die Layout-Berechnung im TrackHeadWidget komplett überarbeitet und systematisch ausgestaltet hatte +

+ +
+ + +
@@ -26396,6 +26414,54 @@
+ + + + + + +

+ Clip-Drag reagiert manchmal nicht »live« +

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

+ nachweislich... +

+
    +
  • + die (x,y)-Koordinaten des Clip werden sinnvoll und korrekt aktualisiert +
  • +
  • + der Aufruf geht durch bis auf das Gtk::Layout +
  • +
  • + nach einer Invalidierung des ganzen Fensters springt der Clip plötzlich an die neue Position +
  • +
+ +
+
+ + + + + + +
@@ -28091,16 +28157,20 @@ - + - + + - + + + + @@ -29137,31 +29207,41 @@ - + - - - - + + + + + + + + + - + + + + - + + + - - - + + + - - + + @@ -29180,8 +29260,8 @@ - - + + @@ -29203,17 +29283,18 @@ + - + - + @@ -29343,7 +29424,7 @@ - + @@ -29527,11 +29608,11 @@ - + @@ -29830,7 +29911,7 @@ - + @@ -29855,7 +29936,7 @@ - + @@ -29894,7 +29975,7 @@ - + @@ -29930,6 +30011,9 @@ + + + @@ -43942,12 +44026,12 @@ - + - + @@ -44044,21 +44128,29 @@ - + - + + - - + + + + + + + + +