diff options
author | David Robillard <d@drobilla.net> | 2007-06-30 18:41:50 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-06-30 18:41:50 +0000 |
commit | bbf41757133a29df0d37905f2fdce091878d2ffd (patch) | |
tree | 2506ed83985d406019236c68704df0b9542dbe3a /gtk2_ardour/automation_controller.cc | |
parent | 685fa95e729e5d510b28b4c715da062e9db580d9 (diff) |
Another not-quite-there-but-better commit.
Brought plugin automation into the fold of new automation system.
Fixed plugin automation, broke panner automation :] (pending Panner work).
Made AutomationController better at automatically following it's controller value (mimic what gain meter does).
Fixed some visible automation track bugs (but still broken WRT serialization).
git-svn-id: svn://localhost/ardour2/trunk@2092 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/automation_controller.cc')
-rw-r--r-- | gtk2_ardour/automation_controller.cc | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/gtk2_ardour/automation_controller.cc b/gtk2_ardour/automation_controller.cc index 3149b9784f..a95d469d7f 100644 --- a/gtk2_ardour/automation_controller.cc +++ b/gtk2_ardour/automation_controller.cc @@ -19,11 +19,12 @@ */ #include <pbd/error.h> -#include "automation_controller.h" #include "ardour/automation_event.h" #include "ardour/automation_control.h" #include "ardour_ui.h" #include "utils.h" +#include "automation_controller.h" +#include "gui_thread.h" #include "i18n.h" @@ -51,6 +52,8 @@ AutomationController::AutomationController(boost::shared_ptr<AutomationControl> _screen_update_connection = ARDOUR_UI::RapidScreenUpdate.connect ( mem_fun (*this, &AutomationController::display_effective_value)); + + ac->Changed.connect (mem_fun(*this, &AutomationController::value_changed)); } AutomationController::~AutomationController() @@ -71,14 +74,15 @@ AutomationController::create(Session& s, boost::shared_ptr<AutomationList> al, b void AutomationController::update_label(char* label, int label_len) { - //cerr << "Controller label: " << label << endl; + if (label && label_len) + snprintf(label, label_len, "%.3f", _controllable->get_value()); } void AutomationController::display_effective_value() { - if ( ! _controllable->list()->automation_playback()) - return; + //if ( ! _controllable->list()->automation_playback()) + // return; float value = _controllable->get_value(); @@ -108,3 +112,28 @@ AutomationController::end_touch() { _controllable->list()->stop_touch(); } + +void +AutomationController::automation_state_changed () +{ + ENSURE_GUI_THREAD(mem_fun(*this, &AutomationController::automation_state_changed)); + + bool x = (_controllable->list()->automation_state() != Off); + + /* start watching automation so that things move */ + + _screen_update_connection.disconnect(); + + if (x) { + _screen_update_connection = ARDOUR_UI::RapidScreenUpdate.connect ( + mem_fun (*this, &AutomationController::display_effective_value)); + } +} + +void +AutomationController::value_changed () +{ + Gtkmm2ext::UI::instance()->call_slot ( + mem_fun(*this, &AutomationController::display_effective_value)); +} + |