Toggled automation fixes.
[ardour.git] / gtk2_ardour / automation_controller.cc
index 30ff65631405bf051f9d40f0eb9b69ac92400bf5..1bce94dca2b464c9f024fd3f41bd67680891d607 100644 (file)
@@ -30,7 +30,6 @@
 #include "ardour/tempo.h"
 
 #include "ardour_button.h"
-#include "ardour_ui.h"
 #include "automation_controller.h"
 #include "gui_thread.h"
 #include "note_select_dialog.h"
@@ -84,9 +83,9 @@ AutomationController::AutomationController(boost::shared_ptr<Automatable>
                } else {
                        but->set_name("generic button");
                }
+               but->set_controllable(ac);
                but->signal_clicked.connect(
                        sigc::mem_fun(*this, &AutomationController::toggled));
-
                _widget = but;
        } else {
                AutomationBarController* bar = manage(new AutomationBarController(_printer, ac, adj));
@@ -198,14 +197,6 @@ AutomationController::toggled ()
 {
        ArdourButton* but = dynamic_cast<ArdourButton*>(_widget);
        if (but) {
-               if (_controllable->session().transport_rolling()) {
-                       if (_controllable->automation_state() == Touch) {
-                               _controllable->set_automation_state(Write);
-                       }
-                       if (_controllable->list()) {
-                               _controllable->list()->set_in_write_pass(true, false, _controllable->session().audible_frame());
-                       }
-               }
                const bool was_active = _controllable->get_value() >= 0.5;
                if (was_active && but->get_active()) {
                        _adjustment->set_value(0.0);
@@ -304,7 +295,7 @@ AutomationController::on_button_release(GdkEventButton* ev)
                }
                if (is_low) {
                        for (int beats = 1; beats <= 16; ++beats) {
-                               items.push_back(MenuElem(string_compose(_("Set to %1 beat(s)"), (int)beats),
+                               items.push_back(MenuElem (string_compose(P_("Set to %1 beat", "Set to %1 beats", beats), beats),
                                                         sigc::bind(sigc::mem_fun(*this, &AutomationController::set_freq_beats),
                                                                    (double)beats)));
                        }