use running_from_source_tree()
[ardour.git] / gtk2_ardour / automation_time_axis.cc
index ae0a691710a32138476356a59b80051724ddc5e3..564443a7f3e9be81d13eb7f116d63ed9e9a3e938 100644 (file)
@@ -84,7 +84,7 @@ AutomationTimeAxisView::AutomationTimeAxisView (
        const string & nom,
        const string & nomparent
        )
-       : AxisView (s)
+       : SessionHandlePtr (s)
        , TimeAxisView (s, e, &parent, canvas)
        , _route (r)
        , _control (c)
@@ -173,7 +173,9 @@ AutomationTimeAxisView::AutomationTimeAxisView (
        //name label isn't editable on an automation track; remove the tooltip
        set_tooltip (name_label, X_(""));
 
-       /* repack the name label */
+       /* repack the name label, which TimeAxisView has already attached to
+        * the controls_table
+        */
 
        if (name_label.get_parent()) {
                name_label.get_parent()->remove (name_label);
@@ -186,7 +188,6 @@ AutomationTimeAxisView::AutomationTimeAxisView (
 
        /* add the buttons */
        controls_table.set_border_width (1);
-       controls_table.remove (name_hbox);
        controls_table.attach (hide_button, 1, 2, 0, 1, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
        controls_table.attach (name_label,  2, 3, 1, 3, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND, 2, 0);
        controls_table.attach (auto_button, 3, 4, 2, 3, Gtk::SHRINK, Gtk::SHRINK, 0, 0);
@@ -199,12 +200,12 @@ AutomationTimeAxisView::AutomationTimeAxisView (
        // subscribe to route_active_changed, ...
        if (rtv && rtv->is_audio_track()) {
                blank0->set_name ("AudioTrackControlsBaseUnselected");
-       }
-       else if (rtv && rtv->is_midi_track()) {
+       } else if (rtv && rtv->is_midi_track()) {
                blank0->set_name ("MidiTrackControlsBaseUnselected");
-       }
-       else {
+       } else if (rtv) {
                blank0->set_name ("AudioBusControlsBaseUnselected");
+       } else {
+               blank0->set_name ("UnknownControlsBaseUnselected");
        }
        blank0->set_size_request (-1, -1);
        blank1->set_size_request (1, 0);
@@ -1037,3 +1038,21 @@ AutomationTimeAxisView::cut_copy_clear_one (AutomationLine& line, Selection& sel
                }
        }
 }
+
+PresentationInfo const &
+AutomationTimeAxisView::presentation_info () const
+{
+       return _route->presentation_info();
+}
+
+boost::shared_ptr<Stripable>
+AutomationTimeAxisView::stripable () const
+{
+       return _route;
+}
+
+Gdk::Color
+AutomationTimeAxisView::color () const
+{
+       return gdk_color_from_rgb (_route->presentation_info().color());
+}