use pane position mgmt on appropriate panes
[ardour.git] / gtk2_ardour / vca_time_axis.cc
index 33f03fda9ff04e622f048c85245d65b0af8e41cd..0c77fd66f844fbdd103a980fb1d8930a61a8a750 100644 (file)
@@ -41,7 +41,7 @@ using namespace Gtkmm2ext;
 using namespace PBD;
 
 VCATimeAxisView::VCATimeAxisView (PublicEditor& ed, Session* s, ArdourCanvas::Canvas& canvas)
-       : AxisView (s)
+       : SessionHandlePtr (s)
        , TimeAxisView (s, ed, (TimeAxisView*) 0, canvas)
        , gain_meter (s, true, 75, 14) // XXX stupid magic numbers, match sizes in RouteTimeAxisView
 {
@@ -95,6 +95,8 @@ VCATimeAxisView::~VCATimeAxisView ()
 void
 VCATimeAxisView::self_delete ()
 {
+       /* reset reference immediately rather than deferring to idle */
+       _vca.reset ();
        delete_when_idle (this);
 }
 
@@ -152,6 +154,8 @@ VCATimeAxisView::set_vca (boost::shared_ptr<VCA> v)
        /* VCA number never changes */
        number_label.set_text (to_string (_vca->number(), std::dec));
 
+       set_height (preset_height (HeightNormal));
+
        update_vca_name ();
        set_button_names ();
        update_solo_display ();
@@ -286,3 +290,33 @@ VCATimeAxisView::stripable () const
 {
        return _vca;
 }
+
+Gdk::Color
+VCATimeAxisView::color () const
+{
+       return gdk_color_from_rgb (_vca->presentation_info().color ());
+}
+
+void
+VCATimeAxisView::set_height (uint32_t h, TrackHeightMode m)
+{
+       TimeAxisView::set_height (h, m);
+       set_gui_property ("height", h);
+       _vca->gui_changed ("track_height", (void*) 0); /* EMIT SIGNAL */
+}
+
+bool
+VCATimeAxisView::marked_for_display () const
+{
+       return !_vca->presentation_info().hidden();
+}
+
+bool
+VCATimeAxisView::set_marked_for_display (bool yn)
+{
+       if (yn == _vca->presentation_info().hidden()) {
+               _vca->presentation_info().set_hidden (!yn);
+               return true; // things changed
+       }
+       return false;
+}