diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2007-02-19 23:09:20 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2007-02-19 23:09:20 +0000 |
commit | f22f22b5998dbc873c0bd2e8ecb5c58c786dab6e (patch) | |
tree | 446aac833f5c1b2cee482505fa256fd3ae0a7ca6 /gtk2_ardour | |
parent | 6b459529cefd4c7cba4e00fbb896ca5e3592fd1b (diff) |
make transport buttons and shuttle controller work with MIDI CC's
git-svn-id: svn://localhost/ardour2/trunk@1477 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/ardour_ui.cc | 13 | ||||
-rw-r--r-- | gtk2_ardour/editor_mixer.cc | 15 |
2 files changed, 19 insertions, 9 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index ecf60acaa1..71ef0387cf 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -2610,23 +2610,22 @@ void ARDOUR_UI::TransportControllable::set_value (float val) { if (type == ShuttleControl) { - double fract; - if (val == 63.0f) { + if (val == 0.5f) { fract = 0.0; } else { - if (val < 63.0f) { - fract = -((63.0f - val)/63.0f); + if (val < 0.5f) { + fract = -((0.5f - val)/0.5f); } else { - fract = ((val - 63.0f)/63.0f); + fract = ((val - 0.5f)/0.5f); } } ui.set_shuttle_fract (fract); return; } - + if (val < 0.5f) { /* do nothing: these are radio-style actions */ return; @@ -2664,7 +2663,7 @@ ARDOUR_UI::TransportControllable::set_value (float val) return; } - Glib::RefPtr<Action> act = ActionManager::get_action ("transport", action); + Glib::RefPtr<Action> act = ActionManager::get_action ("Transport", action); if (act) { act->activate (); diff --git a/gtk2_ardour/editor_mixer.cc b/gtk2_ardour/editor_mixer.cc index d1dd8be7fa..9048751611 100644 --- a/gtk2_ardour/editor_mixer.cc +++ b/gtk2_ardour/editor_mixer.cc @@ -158,6 +158,9 @@ Editor::set_selected_mixer_strip (TimeAxisView& view) } } +double current = 0.0; +bool currentInitialized = 0; + void Editor::update_current_screen () { @@ -194,7 +197,7 @@ Editor::update_current_screen () playhead_cursor->set_position (frame); -#undef CONTINUOUS_SCROLL +#define CONTINUOUS_SCROLL #ifdef CONTINUOUS_SCROLL /* don't do continuous scroll till the new position is in the rightmost quarter of the @@ -213,7 +216,15 @@ Editor::update_current_screen () } } #else - horizontal_adjustment.set_value (frame / frames_per_unit); + if (!currentInitialized) { + current = (frame - current_page_frames()/2) / frames_per_unit; + currentInitialized = 1; + } + + double target = (frame - current_page_frames()/2) / frames_per_unit; + target = (target * 0.1) + (current * 0.9); + horizontal_adjustment.set_value ( target ); + current = target; #endif #endif // CONTINUOUS_SCROLL |