more MIDI paste improvements, plus move region-mute binding to PRIMARY-m and use...
[ardour.git] / gtk2_ardour / automation_time_axis.cc
index abdfa9841d2663b067b7905edc87e5cc24cdf907..806359e2ab36f2e7b05935accc919f8d2f054060 100644 (file)
 
 #include <utility>
 #include <gtkmm2ext/barcontroller.h>
-#include <pbd/memento_command.h>
-#include <ardour/automation_control.h>
-#include <ardour/event_type_map.h>
-#include <ardour/route.h>
+#include "pbd/memento_command.h"
+#include "ardour/automation_control.h"
+#include "ardour/event_type_map.h"
+#include "ardour/route.h"
 
 #include "ardour_ui.h"
 #include "automation_time_axis.h"
@@ -40,6 +40,7 @@
 
 #include "i18n.h"
 
+using namespace std;
 using namespace ARDOUR;
 using namespace PBD;
 using namespace Gtk;
@@ -103,7 +104,7 @@ AutomationTimeAxisView::AutomationTimeAxisView (Session& s, boost::shared_ptr<Ro
                        mem_fun (_editor, &PublicEditor::canvas_automation_track_event),
                        _base_rect, this));
 
-       _base_rect->lower_to_bottom();
+       // _base_rect->lower_to_bottom();
 
        hide_button.add (*(manage (new Gtk::Image (::get_icon("hide")))));
 
@@ -189,8 +190,6 @@ AutomationTimeAxisView::AutomationTimeAxisView (Session& s, boost::shared_ptr<Ro
        controls_base_unselected_name = X_("AutomationTrackControlsBase");
        controls_ebox.set_name (controls_base_unselected_name);
 
-       controls_frame.set_shadow_type (Gtk::SHADOW_ETCHED_OUT);
-
        XMLNode* xml_node = get_parent_with_state()->get_automation_child_xml_node (
                        _control->parameter());
 
@@ -254,15 +253,20 @@ void
 AutomationTimeAxisView::set_automation_state (AutoState state)
 {
        if (!ignore_state_request) {
+               _automatable->set_parameter_automation_state (_control->parameter(), state);
+#if 0
                if (_route == _automatable) { // This is a time axis for route (not region) automation
                        _route->set_parameter_automation_state (_control->parameter(), state);
                }
 
                if (_control->list())
                        _control->alist()->set_automation_state(state);
+#endif
        }
-       if (_view)
+
+       if (_view) {
                _view->set_automation_state (state);
+       }
 }
 
 void
@@ -560,7 +564,7 @@ AutomationTimeAxisView::build_display_menu ()
 }
 
 void
-AutomationTimeAxisView::add_automation_event (ArdourCanvas::Item* item, GdkEvent* event, nframes_t when, double y)
+AutomationTimeAxisView::add_automation_event (ArdourCanvas::Item* /*item*/, GdkEvent* /*event*/, nframes_t when, double y)
 {
        if (!_line)
                return;
@@ -733,7 +737,7 @@ AutomationTimeAxisView::paste_one (AutomationLine& line, nframes_t pos, float ti
        AutomationSelection::iterator p;
        boost::shared_ptr<AutomationList> alist(line.the_list());
        
-       for (p = selection.lines.begin(); p != selection.lines.end() && nth; ++p, --nth);
+       for (p = selection.lines.begin(); p != selection.lines.end() && nth; ++p, --nth) {}
 
        if (p == selection.lines.end()) {
                return false;