summaryrefslogtreecommitdiff
path: root/gtk2_ardour/time_axis_view.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2015-03-19 21:47:34 +0100
committerRobin Gareus <robin@gareus.org>2015-03-19 21:47:34 +0100
commitf1ce87a699c9cca17197b4f33bec5da163810d4f (patch)
treeb050b8ceeb6a2b23494da82cfb3f9d87cac9512f /gtk2_ardour/time_axis_view.cc
parent6874bca886ad9778a7bedd78a25d56f0bd277cf3 (diff)
add API to select TAV height mode.
preparation for further Summary and Number of visible track count fixes. * “Only Self”: don’t resize child-views (old default) * “Total Height”: distribute height equally among all visible child [automation] lanes * “Height per Lane”: given height should be applied to all sub-views.
Diffstat (limited to 'gtk2_ardour/time_axis_view.cc')
-rw-r--r--gtk2_ardour/time_axis_view.cc16
1 files changed, 15 insertions, 1 deletions
diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc
index a117bb64c1..cb03252d7f 100644
--- a/gtk2_ardour/time_axis_view.cc
+++ b/gtk2_ardour/time_axis_view.cc
@@ -568,8 +568,16 @@ TimeAxisView::set_height_enum (Height h, bool apply_to_selection)
}
void
-TimeAxisView::set_height (uint32_t h)
+TimeAxisView::set_height (uint32_t h, TrackHeightMode m)
{
+ uint32_t lanes = 0;
+ if (m == TotalHeight) {
+ for (Children::iterator i = children.begin(); i != children.end(); ++i) {
+ if ( !(*i)->hidden()) ++lanes;
+ }
+ }
+ h /= (lanes + 1);
+
if (h < preset_height (HeightSmall)) {
h = preset_height (HeightSmall);
}
@@ -590,6 +598,12 @@ TimeAxisView::set_height (uint32_t h)
show_selection (_editor.get_selection().time);
}
+ if (m != OnlySelf) {
+ for (Children::iterator i = children.begin(); i != children.end(); ++i) {
+ (*i)->set_height(h, OnlySelf);
+ }
+ }
+
_editor.override_visible_track_count ();
}