lots of odds and ends to do with solo isolate and its GUI
[ardour.git] / gtk2_ardour / automation_time_axis.cc
index aee9b70726ff9f78aa3b5e391047b8ad8ce2343d..bfaa07857250c706037624db7422b8ec8709e213 100644 (file)
@@ -28,6 +28,7 @@
 #include "ardour_ui.h"
 #include "automation_time_axis.h"
 #include "automation_streamview.h"
+#include "gui_thread.h"
 #include "route_time_axis.h"
 #include "automation_line.h"
 #include "public_editor.h"
@@ -119,8 +120,8 @@ AutomationTimeAxisView::AutomationTimeAxisView (Session* s, boost::shared_ptr<Ro
 
        controls_table.set_no_show_all();
 
-       ARDOUR_UI::instance()->tooltips().set_tip(auto_button, _("automation state"));
-       ARDOUR_UI::instance()->tooltips().set_tip(hide_button, _("hide track"));
+       ARDOUR_UI::instance()->set_tip(auto_button, _("automation state"));
+       ARDOUR_UI::instance()->set_tip(hide_button, _("hide track"));
 
        /* rearrange the name display */
 
@@ -173,7 +174,7 @@ AutomationTimeAxisView::AutomationTimeAxisView (Session* s, boost::shared_ptr<Ro
                        tipname += ": ";
                }
                tipname += _name;
-               ARDOUR_UI::instance()->tooltips().set_tip(controls_ebox, tipname);
+               ARDOUR_UI::instance()->set_tip(controls_ebox, tipname);
        }
 
        /* add the buttons */
@@ -453,8 +454,10 @@ AutomationTimeAxisView::set_height (uint32_t h)
        }
 
        if (changed) {
-               /* only emit the signal if the height really changed */
-               _route->gui_changed ("visible_tracks", (void *) 0); /* EMIT_SIGNAL */
+               if (canvas_item_visible (_canvas_display)) {
+                       /* only emit the signal if the height really changed and we were visible */
+                       _route->gui_changed ("visible_tracks", (void *) 0); /* EMIT_SIGNAL */
+               }
        }
 }
 
@@ -815,8 +818,9 @@ AutomationTimeAxisView::get_inverted_selectables (Selection& sel, list<Selectabl
 void
 AutomationTimeAxisView::set_selected_points (PointSelection& points)
 {
-       if (_line)
+       if (_line) {
                _line->set_selected_points (points);
+       }
 }
 
 void
@@ -833,8 +837,7 @@ AutomationTimeAxisView::add_line (boost::shared_ptr<AutomationLine> line)
        assert(!_line);
        assert(line->the_list() == _control->list());
 
-       automation_connection = _control->alist()->automation_state_changed.connect
-               (boost::bind (&AutomationTimeAxisView::automation_state_changed, this));
+       _control->alist()->automation_state_changed.connect (automation_connection, invalidator (*this), boost::bind (&AutomationTimeAxisView::automation_state_changed, this), gui_context());
 
        _line = line;
        //_controller = AutomationController::create(_session, line->the_list(), _control);
@@ -927,3 +930,14 @@ AutomationTimeAxisView::hide ()
        TimeAxisView::hide ();
 }
 
+bool
+AutomationTimeAxisView::set_visibility (bool yn)
+{
+       bool changed = TimeAxisView::set_visibility (yn);
+
+       if (changed) {
+               get_state_node()->add_property ("shown", yn ? X_("yes") : X_("no"));
+       }
+
+       return changed;
+}