X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fregion_view.cc;h=3923f7e79a8457a9bd777b6da011afcd0eacc2d7;hb=1315ee3dff1e4966ab28bd47e81b5f003cac6e40;hp=3e6921aab9efe87da53bd891cad9586dbb5f21f3;hpb=62c4e8188457c8e0da9eb98202a5bc2a07c9250b;p=ardour.git diff --git a/gtk2_ardour/region_view.cc b/gtk2_ardour/region_view.cc index 3e6921aab9..3923f7e79a 100644 --- a/gtk2_ardour/region_view.cc +++ b/gtk2_ardour/region_view.cc @@ -24,6 +24,7 @@ #include #include +#include #include #include @@ -71,7 +72,6 @@ RegionView::RegionView (ArdourCanvas::Group* parent, , current_visible_sync_position(0.0) , valid(false) , _pixel_width(1.0) - , _height(1.0) , in_destructor(false) , wait_for_data(false) { @@ -87,7 +87,6 @@ RegionView::RegionView (const RegionView& other) current_visible_sync_position = other.current_visible_sync_position; valid = false; _pixel_width = other._pixel_width; - _height = other._height; } RegionView::RegionView (ArdourCanvas::Group* parent, @@ -103,7 +102,6 @@ RegionView::RegionView (ArdourCanvas::Group* parent, , current_visible_sync_position(0.0) , valid(false) , _pixel_width(1.0) - , _height(1.0) , in_destructor(false) , wait_for_data(false) { @@ -114,7 +112,6 @@ RegionView::init (Gdk::Color& basic_color, bool wfd) { valid = true; in_destructor = false; - _height = 0; wait_for_data = wfd; compute_colors (basic_color); @@ -140,7 +137,7 @@ RegionView::init (Gdk::Color& basic_color, bool wfd) reset_width_dependent_items ((double) _region->length() / samples_per_unit); - set_height (trackview.height); + set_y_position_and_height (0, trackview.height); _region->StateChanged.connect (mem_fun(*this, &RegionView::region_changed)); @@ -396,27 +393,37 @@ RegionView::hide_region_editor() } } -void -RegionView::region_renamed () +Glib::ustring +RegionView::make_name () const { - string str; + Glib::ustring str; + + // XXX nice to have some good icons for this if (_region->locked()) { str += '>'; str += _region->name(); str += '<'; + } else if (_region->position_locked()) { + str += '{'; + str += _region->name(); + str += '}'; } else { str = _region->name(); } - if (_region->speed_mismatch (trackview.session().frame_rate())) { - str = string ("*") + str; - } - if (_region->muted()) { str = string ("!") + str; } + return str; +} + +void +RegionView::region_renamed () +{ + Glib::ustring str = make_name (); + set_item_name (str, this); set_name_text (str); reset_width_dependent_items (_pixel_width); @@ -475,7 +482,7 @@ RegionView::region_sync_changed () void RegionView::move (double x_delta, double y_delta) { - if (_region->locked() || (x_delta == 0 && y_delta == 0)) { + if (!_region->can_move() || (x_delta == 0 && y_delta == 0)) { return; }