Tweak toolbar meter reset button to unconditionally apply to all DPM
[ardour.git] / gtk2_ardour / region_view.cc
index 39b6e118eee63e64087664ff24d930b09293568a..d0be119ae026e20f6928a44ef1e0b7d17bf63604 100644 (file)
@@ -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)
@@ -222,7 +222,7 @@ RegionView::set_silent_frames (const AudioIntervalResult& silences, double /*thr
 {
        samplecnt_t shortest = max_samplecnt;
 
-       /* remove old silent samples */
+       /* remove old silent frames */
        drop_silent_frames ();
 
        if (silences.empty()) {
@@ -414,11 +414,11 @@ RegionView::region_resized (const PropertyChange& what_changed)
 
                unit_length = _region->length() / samples_per_pixel;
 
-               for (vector<GhostRegion*>::iterator i = ghosts.begin(); i != ghosts.end(); ++i) {
+               for (vector<GhostRegion*>::iterator i = ghosts.begin(); i != ghosts.end(); ++i) {
 
-                       (*i)->set_duration (unit_length);
+                       (*i)->set_duration (unit_length);
 
-               }
+               }
        }
 }
 
@@ -865,7 +865,7 @@ RegionView::trim_front (samplepos_t new_bound, bool no_overlap, const int32_t su
                }
 
                /* Only trim region on the left if the first sample has gone beyond the left region's last sample. */
-               if (region_left != 0 && (region_left->last_sample() > _region->first_sample() || regions_touching)) {
+               if (region_left != 0 && (region_left->last_sample() > _region->first_sample() || regions_touching)) {
                        region_left->trim_end (_region->first_sample() - 1);
                }
        }
@@ -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 ();
+}