summaryrefslogtreecommitdiff
path: root/gtk2_ardour/region_view.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2019-05-29 15:16:00 -0600
committerPaul Davis <paul@linuxaudiosystems.com>2019-05-29 15:24:40 -0600
commit8463fb728f5215870c67e26a45996f6fc5179571 (patch)
tree4c0cfa45bd301356ae06bf010387a5d4b36eceee /gtk2_ardour/region_view.cc
parentb1587940e46d220a696d6cf11b9b0efd3b144b85 (diff)
add option to show/hide region names
Diffstat (limited to 'gtk2_ardour/region_view.cc')
-rw-r--r--gtk2_ardour/region_view.cc16
1 files changed, 15 insertions, 1 deletions
diff --git a/gtk2_ardour/region_view.cc b/gtk2_ardour/region_view.cc
index 467cacf8b6..d0be119ae0 100644
--- a/gtk2_ardour/region_view.cc
+++ b/gtk2_ardour/region_view.cc
@@ -71,7 +71,7 @@ RegionView::RegionView (ArdourCanvas::Container* parent,
bool automation)
: TimeAxisViewItem (r->name(), *parent, tv, spu, basic_color, r->position(), r->length(), false, automation,
(automation ? TimeAxisViewItem::ShowFrame :
- TimeAxisViewItem::Visibility (TimeAxisViewItem::ShowNameText|
+ TimeAxisViewItem::Visibility ((UIConfiguration::instance().get_show_region_name() ? TimeAxisViewItem::ShowNameText : 0) |
TimeAxisViewItem::ShowNameHighlight| TimeAxisViewItem::ShowFrame)))
, _region (r)
, sync_mark(0)
@@ -959,3 +959,17 @@ RegionView::snap_sample_to_sample (sampleoffset_t x, bool ensure_snap) const
/* back to region relative, keeping the relevant divisor */
return MusicSample (sample.sample - _region->position(), sample.division);
}
+
+void
+RegionView::update_visibility ()
+{
+ /* currently only the name visibility can be changed dynamically */
+
+ if (UIConfiguration::instance().get_show_region_name()) {
+ visibility = Visibility (visibility | ShowNameText);
+ } else {
+ visibility = Visibility (visibility & ~ShowNameText);
+ }
+
+ manage_name_text ();
+}