More consistent verbose cursor label style for PC flags.
[ardour.git] / gtk2_ardour / region_view.cc
index a0fd276d12a55af1a53962ff148d1cc42067b317..8ea84409ccc1ab75b7f20793fcf396b56c8aa63e 100644 (file)
@@ -26,8 +26,6 @@
 #include <gtkmm2ext/gtk_ui.h>
 
 #include "ardour/playlist.h"
-#include "ardour/audioregion.h"
-#include "ardour/audiosource.h"
 #include "ardour/session.h"
 
 #include "ardour_ui.h"
@@ -86,7 +84,7 @@ RegionView::RegionView (ArdourCanvas::Group*              parent,
        , _region_relative_time_converter(r->session().tempo_map(), r->position())
        , _source_relative_time_converter(r->session().tempo_map(), r->position() - r->start())
 {
-       GhostRegion::CatchDeletion.connect (*this, invalidator (*this), ui_bind (&RegionView::remove_ghost, this, _1), gui_context());
+       GhostRegion::CatchDeletion.connect (*this, invalidator (*this), boost::bind (&RegionView::remove_ghost, this, _1), gui_context());
 }
 
 RegionView::RegionView (const RegionView& other)
@@ -103,7 +101,7 @@ RegionView::RegionView (const RegionView& other)
        valid = false;
        _pixel_width = other._pixel_width;
 
-       GhostRegion::CatchDeletion.connect (*this, invalidator (*this), ui_bind (&RegionView::remove_ghost, this, _1), gui_context());
+       GhostRegion::CatchDeletion.connect (*this, invalidator (*this), boost::bind (&RegionView::remove_ghost, this, _1), gui_context());
 }
 
 RegionView::RegionView (const RegionView& other, boost::shared_ptr<Region> other_region)
@@ -124,7 +122,7 @@ RegionView::RegionView (const RegionView& other, boost::shared_ptr<Region> other
        valid = false;
        _pixel_width = other._pixel_width;
 
-       GhostRegion::CatchDeletion.connect (*this, invalidator (*this), ui_bind (&RegionView::remove_ghost, this, _1), gui_context());
+       GhostRegion::CatchDeletion.connect (*this, invalidator (*this), boost::bind (&RegionView::remove_ghost, this, _1), gui_context());
 }
 
 RegionView::RegionView (ArdourCanvas::Group*         parent,
@@ -195,7 +193,7 @@ RegionView::init (Gdk::Color const & basic_color, bool wfd)
 
        set_height (trackview.current_height());
 
-       _region->PropertyChanged.connect (*this, invalidator (*this), ui_bind (&RegionView::region_changed, this, _1), gui_context());
+       _region->PropertyChanged.connect (*this, invalidator (*this), boost::bind (&RegionView::region_changed, this, _1), gui_context());
 
        group->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_region_view_event), group, this));
 
@@ -781,7 +779,7 @@ RegionView::update_coverage_frames (LayerDisplay d)
        bool me = false;
 
        /* the color that will be used to show parts of regions that will not be heard */
-       uint32_t non_playing_color = RGBA_TO_UINT (32, 32, 32, 192);
+       uint32_t const non_playing_color = ARDOUR_UI::config()->canvasvar_CoveredRegion.get ();
 
        while (t < end) {
 
@@ -836,11 +834,11 @@ RegionView::update_coverage_frames (LayerDisplay d)
        }
 }
 
-void
+bool
 RegionView::trim_front (framepos_t new_bound, bool no_overlap)
 {
        if (_region->locked()) {
-               return;
+               return false;
        }
 
        RouteTimeAxisView& rtv = dynamic_cast<RouteTimeAxisView&> (trackview);
@@ -868,13 +866,15 @@ RegionView::trim_front (framepos_t new_bound, bool no_overlap)
        }
 
        region_changed (ARDOUR::bounds_change);
+
+       return (pre_trim_first_frame != _region->first_frame());  //return true if we actually changed something
 }
 
-void
+bool
 RegionView::trim_end (framepos_t new_bound, bool no_overlap)
 {
        if (_region->locked()) {
-               return;
+               return false;
        }
 
        RouteTimeAxisView& rtv = dynamic_cast<RouteTimeAxisView&> (trackview);
@@ -905,6 +905,8 @@ RegionView::trim_end (framepos_t new_bound, bool no_overlap)
        } else {
                region_changed (PropertyChange (ARDOUR::Properties::length));
        }
+
+       return (pre_trim_last_frame != _region->last_frame());  //return true if we actually changed something
 }