Remove unused variable and the accessor methods for it from ARDOUR_UI
[ardour.git] / gtk2_ardour / region_view.cc
index f11ec2a307668d952ef3b6d8d5dd0c674a37e972..3923f7e79a8457a9bd777b6da011afcd0eacc2d7 100644 (file)
@@ -24,6 +24,7 @@
 #include <gtkmm.h>
 
 #include <gtkmm2ext/gtk_ui.h>
+#include <pbd/stacktrace.h>
 
 #include <ardour/playlist.h>
 #include <ardour/audioregion.h>
@@ -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));
 
@@ -253,14 +250,6 @@ RegionView::reset_width_dependent_items (double pixel_width)
        _pixel_width = pixel_width;
 }
 
-void
-RegionView::set_height (gdouble height)
-{
-       TimeAxisViewItem::set_height (height - 2);
-       
-       _height = height;
-}
-
 void
 RegionView::region_layered ()
 {
@@ -404,26 +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();
        }
 
-       // speed mismatch handled in audio_region_view.cc
-       // FIXME: come up with more elegant solution for this
-       
        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);
@@ -482,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;
        }