fix logic error that prevent input monitoring during slave wait states
[ardour.git] / gtk2_ardour / region_view.cc
index 893a973ddd2ef6b467172d6005c484eac4bf289d..d94c1fae64591a2fa30ad6c60f1491e63ade07bf 100644 (file)
 #include "ardour/profile.h"
 #include "ardour/session.h"
 
+#include "gtkmm2ext/colors.h"
+
 #include "canvas/polygon.h"
 #include "canvas/debug.h"
 #include "canvas/pixbuf.h"
 #include "canvas/text.h"
 #include "canvas/line.h"
-#include "canvas/utils.h"
-#include "canvas/colors.h"
 
 #include "streamview.h"
 #include "region_view.h"
@@ -377,6 +377,9 @@ RegionView::region_changed (const PropertyChange& what_changed)
        if (what_changed.contains (ARDOUR::Properties::name)) {
                region_renamed ();
        }
+       if (what_changed.contains (ARDOUR::Properties::position_lock_style)) {
+               region_renamed ();
+       }
        if (what_changed.contains (ARDOUR::Properties::sync_position)) {
                region_sync_changed ();
        }
@@ -512,7 +515,7 @@ void
 RegionView::set_sync_mark_color ()
 {
        if (sync_mark) {
-               ArdourCanvas::Color c = UIConfiguration::instance().color ("sync mark");
+               Gtkmm2ext::Color c = UIConfiguration::instance().color ("sync mark");
                sync_mark->set_fill_color (c);
                sync_mark->set_outline_color (c);
                sync_line->set_outline_color (c);
@@ -522,7 +525,7 @@ RegionView::set_sync_mark_color ()
 uint32_t
 RegionView::get_fill_color () const
 {
-       ArdourCanvas::Color f = TimeAxisViewItem::get_fill_color();
+       Gtkmm2ext::Color f = TimeAxisViewItem::get_fill_color();
        char const *modname;
 
        if (_region->opaque() && (!ARDOUR::Profile->get_mixbus() || (!_dragging && !_region->muted ()))) {
@@ -531,7 +534,7 @@ RegionView::get_fill_color () const
                modname = "transparent region base";
        }
 
-       return HSV(f).mod (UIConfiguration::instance().modifier (modname)).color ();
+       return Gtkmm2ext::HSV(f).mod (UIConfiguration::instance().modifier (modname)).color ();
 }
 
 void
@@ -559,21 +562,22 @@ RegionView::make_name () const
        std::string str;
 
        // XXX nice to have some good icons for this
+       if (_region->position_lock_style() == MusicTime) {
+               str += "\u266B"; // BEAMED EIGHTH NOTES
+       }
 
        if (_region->locked()) {
-               str += '>';
+               str += "\u2629"; // CROSS OF JERUSALEM
                str += _region->name();
-               str += '<';
        } else if (_region->position_locked()) {
-               str += '{';
+               str += "\u21B9"; // LEFTWARDS ARROW TO BAR OVER RIGHTWARDS ARROW TO BAR
                str += _region->name();
-               str += '}';
        } else if (_region->video_locked()) {
                str += '[';
                str += _region->name();
                str += ']';
        } else {
-               str = _region->name();
+               str += _region->name();
        }
 
        if (_region->muted()) {
@@ -841,18 +845,13 @@ RegionView::trim_front (framepos_t new_bound, bool no_overlap, const int32_t sub
                return false;
        }
 
-       RouteTimeAxisView& rtv = dynamic_cast<RouteTimeAxisView&> (trackview);
-       double const speed = rtv.track()->speed ();
-
        framepos_t const pre_trim_first_frame = _region->first_frame();
 
-       const framepos_t speed_bound = (framepos_t) (new_bound * speed);
-
-       if (_region->position() == speed_bound) {
+       if (_region->position() == new_bound) {
                return false;
        }
 
-       _region->trim_front (speed_bound, sub_num);
+       _region->trim_front (new_bound, sub_num);
 
        if (no_overlap) {
                // Get the next region on the left of this region and shrink/expand it.
@@ -883,12 +882,9 @@ RegionView::trim_end (framepos_t new_bound, bool no_overlap, const int32_t sub_n
                return false;
        }
 
-       RouteTimeAxisView& rtv = dynamic_cast<RouteTimeAxisView&> (trackview);
-       double const speed = rtv.track()->speed ();
-
        framepos_t const pre_trim_last_frame = _region->last_frame();
 
-       _region->trim_end ((framepos_t) (new_bound * speed), sub_num);
+       _region->trim_end (new_bound, sub_num);
 
        if (no_overlap) {
                // Get the next region on the right of this region and shrink/expand it.