patch from lincoln to make MIDI track height changes no longer just grow note height...
[ardour.git] / gtk2_ardour / region_view.cc
index 8e45b7ace05ca4d5d61a8b959dc1fea665b72526..aeae3acc9a1015179a6572a11cfb650e8fd48721 100644 (file)
@@ -80,7 +80,7 @@ RegionView::RegionView (ArdourCanvas::Group*              parent,
        , wait_for_data(false)
        , _time_converter(r->session().tempo_map(), r->position())
 {
-       GhostRegion::CatchDeletion.connect (*this, ui_bind (&RegionView::remove_ghost, this, _1), gui_context());
+       GhostRegion::CatchDeletion.connect (*this, invalidator (*this), ui_bind (&RegionView::remove_ghost, this, _1), gui_context());
 }
 
 RegionView::RegionView (const RegionView& other)
@@ -94,9 +94,8 @@ RegionView::RegionView (const RegionView& other)
        current_visible_sync_position = other.current_visible_sync_position;
        valid = false;
        _pixel_width = other._pixel_width;
-       _height = other._height;
 
-       GhostRegion::CatchDeletion.connect (*this, ui_bind (&RegionView::remove_ghost, this, _1), gui_context());
+       GhostRegion::CatchDeletion.connect (*this, invalidator (*this), ui_bind (&RegionView::remove_ghost, this, _1), gui_context());
 }
 
 RegionView::RegionView (const RegionView& other, boost::shared_ptr<Region> other_region)
@@ -114,9 +113,8 @@ RegionView::RegionView (const RegionView& other, boost::shared_ptr<Region> other
        current_visible_sync_position = other.current_visible_sync_position;
        valid = false;
        _pixel_width = other._pixel_width;
-       _height = other._height;
 
-       GhostRegion::CatchDeletion.connect (*this, ui_bind (&RegionView::remove_ghost, this, _1), gui_context());
+       GhostRegion::CatchDeletion.connect (*this, invalidator (*this), ui_bind (&RegionView::remove_ghost, this, _1), gui_context());
 }
 
 RegionView::RegionView (ArdourCanvas::Group*         parent,
@@ -147,7 +145,6 @@ RegionView::init (Gdk::Color const & basic_color, bool wfd)
        editor        = 0;
        valid         = true;
        in_destructor = false;
-       _height       = 0;
        wait_for_data = wfd;
        sync_mark     = 0;
        sync_line     = 0;
@@ -181,7 +178,7 @@ RegionView::init (Gdk::Color const & basic_color, bool wfd)
 
        set_height (trackview.current_height());
 
-       _region->PropertyChanged.connect (*this, ui_bind (&RegionView::region_changed, this, _1), gui_context());
+       _region->PropertyChanged.connect (*this, invalidator (*this), ui_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));
 
@@ -405,6 +402,17 @@ RegionView::fake_set_opaque (bool yn)
        set_frame_color ();
 }
 
+void
+RegionView::show_region_editor ()
+{
+       if (editor == 0) {
+               editor = new RegionEditor (trackview.session(), region());
+       }
+
+       editor->present ();
+       editor->show_all();
+}
+
 void
 RegionView::hide_region_editor()
 {