Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
ruler-track.cpp
Go to the documentation of this file.
1/*
2 RulerTrack - track body area to show overview and timecode and markers
3
4 Copyright (C)
5 2018, Hermann Vosseler <Ichthyostega@web.de>
6
7  **Lumiera** is free software; you can redistribute it and/or modify it
8  under the terms of the GNU General Public License as published by the
9  Free Software Foundation; either version 2 of the License, or (at your
10  option) any later version. See the file COPYING for further details.
11
12* *****************************************************************/
13
14
25#include "stage/gtk-base.hpp"
26#include "stage/style-scheme.hpp"
28
29//#include "stage/ui-bus.hpp"
30//#include "lib/format-string.hpp"
31//#include "lib/format-cout.hpp"
32
33#include "lib/util.hpp"
34
35//#include <algorithm>
36//#include <vector>
37
38
40
41//using util::_Fmt;
42using util::isnil;
43//using util::contains;
44//using Gtk::Widget;
45//using sigc::mem_fun;
46//using sigc::ptr_fun;
47//using std::cout;
48//using std::endl;
49
50
51namespace stage {
52namespace timeline {
53
62
63
64
65
67 : Controller{id, nexus}
68 , track_{parent}
69 , scales_ {}
70 { }
71
72
74
75 void
77 {
78 UNIMPLEMENTED ("what can actually be manipulated on a RulerTrack by diff message?");
79
80// buffer.emplace(
81// TreeMutator::build()
82// .change(ATTR_name, [&](string val)
83// { // »Attribute Setter« : receive a new value for the track name field
84// this->setTrackName (val);
85// }));
86 }
87
88
93 uint
95 {
96 if (isnil (scales_))
97 return DEFAULT_OVERVIEW_HEIGHT_px;
98 else
99 { // handle time ruler ////////////////////////////////////////////////TICKET #1194 : proper handling of ruler tracks
100 uint combinedScaleHeight = 0;
101 for (auto& scale : scales_)
102 combinedScaleHeight += scale.calcHeight();
103 return combinedScaleHeight;
104 }
105 }
106
112 uint
114 {
115 if (not isnil (scales_))
116 return TIMERULE_GAP_BELOW_px;
117 else
118 return 0; // no Gap
119
120 }
121
126 uint
128 {
129 return TIMERULER_SCALE_HEIGHT_px;
130 }
131
132
133
134}}// namespace stage::timeline
A handle to allow for safe »remote implantation« of an unknown subclass into a given opaque InPlaceBu...
Customisable intermediary to abstract mutating operations on arbitrary, hierarchical object-like data...
connection point at the UI-Bus.
Definition bus-term.hpp:98
ctrl::BusTerm::ID ID
Definition tangible.hpp:162
uint calcHeight()
recursively calculate the height in pixels to display this ruler track.
uint getGapHeight()
possibly cause the display of an additional padding gap below this ruler track
RulerTrack(ID id, ctrl::BusTerm &nexus, TrackPresenter &parent)
virtual void buildMutator(lib::diff::TreeMutator::Handle) override
set up a binding to respond to mutation messages via UiBus
A View-Model entity to represent a timeline track in the UI.
A set of basic GTK includes for the UI.
unsigned int uint
Definition integral.hpp:29
Lumiera GTK UI implementation root.
Definition guifacade.cpp:37
bool isnil(lib::time::Duration const &dur)
Timeline presentation helper to organise drawing of the overview rulers.
uint calcHeight()
get vertical extension of this scale on the time(code) overview ruler
Definition of access keys for uniform UI styling.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...