update selection clock
[ardour.git] / gtk2_ardour / automation_time_axis.cc
index cd57387ac4760fb9d752e757c229705ff7ccbc07..60552ce14eaafb4d3dbb5742ff4faf7d1a81b84d 100644 (file)
@@ -110,6 +110,10 @@ AutomationTimeAxisView::AutomationTimeAxisView (
                _controller = AutomationController::create (_automatable, _control->parameter(), _control->desc(), _control);
        }
 
+       const std::string fill_color_name = (dynamic_cast<MidiTimeAxisView*>(&parent)
+                                            ? "midi automation track fill"
+                                            : "audio automation track fill");
+
        automation_menu = 0;
        auto_off_item = 0;
        auto_touch_item = 0;
@@ -124,7 +128,7 @@ AutomationTimeAxisView::AutomationTimeAxisView (
        CANVAS_DEBUG_NAME (_base_rect, string_compose ("base rect for %1", _name));
        _base_rect->set_x1 (ArdourCanvas::COORD_MAX);
        _base_rect->set_outline (false);
-       _base_rect->set_fill_color (ARDOUR_UI::config()->color ("automation track fill"));
+       _base_rect->set_fill_color (ARDOUR_UI::config()->color_mod (fill_color_name, "automation track fill"));
        _base_rect->set_data ("trackview", this);
        _base_rect->Event.connect (sigc::bind (sigc::mem_fun (_editor, &PublicEditor::canvas_automation_track_event), _base_rect, this));
        if (!a) {
@@ -430,7 +434,7 @@ AutomationTimeAxisView::clear_clicked ()
 {
        assert (_line || _view);
 
-       _session->begin_reversible_command (_("clear automation"));
+       _editor.begin_reversible_command (_("clear automation"));
 
        if (_line) {
                _line->clear ();
@@ -438,7 +442,7 @@ AutomationTimeAxisView::clear_clicked ()
                _view->clear ();
        }
 
-       _session->commit_reversible_command ();
+       _editor.commit_reversible_command ();
        _session->set_dirty ();
 }
 
@@ -623,13 +627,14 @@ AutomationTimeAxisView::add_automation_event (GdkEvent* event, framepos_t when,
 
        _editor.snap_to_with_modifier (when, event);
 
-       _session->begin_reversible_command (_("add automation event"));
+       _editor.begin_reversible_command (_("add automation event"));
        XMLNode& before = list->get_state();
 
        list->add (when, y, with_guard_points);
 
        XMLNode& after = list->get_state();
-       _session->commit_reversible_command (new MementoCommand<ARDOUR::AutomationList> (*list, &before, &after));
+       _session->add_command (new MementoCommand<ARDOUR::AutomationList> (*list, &before, &after));
+       _editor.commit_reversible_command ();
        _session->set_dirty ();
 }
 
@@ -688,7 +693,7 @@ AutomationTimeAxisView::paste_one (framepos_t pos, unsigned paste_count, float t
 }
 
 void
-AutomationTimeAxisView::get_selectables (framepos_t start, framepos_t end, double top, double bot, list<Selectable*>& results)
+AutomationTimeAxisView::get_selectables (framepos_t start, framepos_t end, double top, double bot, list<Selectable*>& results, bool /*within*/)
 {
        if (!_line && !_view) {
                return;