[ardour-dev] Transport shuttle slower/faster patch

Wolfgang Woehl tito at rumford.de
Tue Apr 26 09:09:09 PDT 2005


This adds some key-bindings to shuttle operation. I wanted smaller/higher
values to start out with. It gives you modifiers for changing shuttle speed 
and unifies mixer/editor reaction to the keys. Not in an elegant way.

The behaviour is slightly odd as "Ctrl-Right" (transport-forward-slower) 
for example doesn't slow you down but makes the speed-increment smaller. 
Keyboard people quickly go "Left" and then "Ctrl-Right" again to run 
slow. Oh well.

It changes the "Left/Right" for "scroll-backward/forward" 
to "Shift-Left/Right" which I will probably regret myself. Will see.

Wolfgang

Index: ardour.rc.in
===================================================================
RCS file: /home/las/cvsroot/ardour/ardour/ardour.rc.in,v
retrieving revision 1.11
diff -u -r1.11 ardour.rc.in
--- ardour.rc.in 19 Apr 2005 21:24:53 -0000 1.11
+++ ardour.rc.in 26 Apr 2005 15:33:51 -0000
@@ -45,6 +45,10 @@
       <binding keys="Ctrl-q" action="quit"/>
       <binding keys="Left" action="transport-rewind"/>
       <binding keys="Right" action="transport-forward"/>
+      <binding keys="Ctrl-Left" action="transport-rewind-slower"/>
+      <binding keys="Ctrl-Right" action="transport-forward-slower"/>
+      <binding keys="Ctrl-Shift-Left" action="transport-rewind-faster"/>
+      <binding keys="Ctrl-Shift-Right" action="transport-forward-faster"/>
       <binding keys="R" action="transport-record"/>
       <binding keys="i" action="toggle-punch-in"/>
       <binding keys="Home" action="transport-goto-start"/>
@@ -64,8 +68,8 @@
       <binding keys="Ctrl-]" action="edit-cursor-to-next-region-end"/>
       <binding keys="'" action="edit-cursor-to-next-region-sync"/>
       <binding keys=";" action="edit-cursor-to-previous-region-sync"/>
-      <binding keys="Left" action="scroll-backward"/>
-      <binding keys="Right" action="scroll-forward"/>
+      <binding keys="Shift-Left" action="scroll-backward"/>
+      <binding keys="Shift-Right" action="scroll-forward"/>
       <binding keys="KP_6" action="jump-forward-to-mark"/>
       <binding keys="KP_Right" action="jump-forward-to-mark"/>
       <binding keys="KP_4" action="jump-backward-to-mark"/> 
Index: gtk_ardour/ardour_ui.cc
===================================================================
RCS file: /home/las/cvsroot/ardour/ardour/gtk_ardour/ardour_ui.cc,v
retrieving revision 1.251
diff -u -r1.251 ardour_ui.cc
--- gtk_ardour/ardour_ui.cc 10 Apr 2005 04:05:13 -0000 1.251
+++ gtk_ardour/ardour_ui.cc 26 Apr 2005 15:33:51 -0000
@@ -2154,6 +2154,86 @@
 }
 
 void
+ARDOUR_UI::transport_rewind_slower ()
+{
+ float current_transport_speed;
+ 
+        if (session) {
+  current_transport_speed = session->transport_speed();
+  
+  if (current_transport_speed > 0.0f) {
+   /* set to slower reverse speed */
+   session->request_transport_speed (-0.5f);
+  } else if (current_transport_speed == 0.0f) {
+   session->request_transport_speed (-0.5f);
+  } else {
+   /* speed up */
+   session->request_transport_speed (current_transport_speed * 1.1f);
+  }
+ }
+}
+
+void
+ARDOUR_UI::transport_forward_slower ()
+{
+ float current_transport_speed;
+ 
+ if (session) {
+  current_transport_speed = session->transport_speed();
+  
+  if (current_transport_speed < 0.0f) {
+   /* set to slower forward speed */
+   session->request_transport_speed (0.5f);
+  } else if (current_transport_speed == 0.0f) {
+   session->request_transport_speed (0.5f);
+  } else {
+   /* speed up */
+   session->request_transport_speed (current_transport_speed * 1.1f);
+  }
+ }
+}
+
+void
+ARDOUR_UI::transport_rewind_faster ()
+{
+ float current_transport_speed;
+ 
+        if (session) {
+  current_transport_speed = session->transport_speed();
+  
+  if (current_transport_speed > 0.0f) {
+   /* set to faster reverse speed */
+   session->request_transport_speed (-2.0f);
+  } else if (current_transport_speed == 0.0f) {
+   session->request_transport_speed (-2.0f);
+  } else {
+   /* speed up */
+   session->request_transport_speed (current_transport_speed * 1.5f);
+  }
+ }
+}
+
+void
+ARDOUR_UI::transport_forward_faster ()
+{
+ float current_transport_speed;
+ 
+        if (session) {
+  current_transport_speed = session->transport_speed();
+  
+  if (current_transport_speed < 0.0f) {
+   /* set to faster forward speed */
+   session->request_transport_speed (2.0f);
+  } else if (current_transport_speed == 0.0f) {
+   session->request_transport_speed (2.0f);
+  } else {
+   /* speed up */
+   session->request_transport_speed (current_transport_speed * 1.5f);
+  }
+ }
+}
+
+void
 ARDOUR_UI::toggle_monitor_enable (guint32 dstream)
 {
  if (session == 0) {
Index: gtk_ardour/ardour_ui.h
===================================================================
RCS file: /home/las/cvsroot/ardour/ardour/gtk_ardour/ardour_ui.h,v
retrieving revision 1.153
diff -u -r1.153 ardour_ui.h
--- gtk_ardour/ardour_ui.h 9 Apr 2005 13:38:10 -0000 1.153
+++ gtk_ardour/ardour_ui.h 26 Apr 2005 15:33:54 -0000
@@ -595,6 +595,10 @@
  void transport_play_selection(); 
  void transport_forward ();
  void transport_rewind ();
+ void transport_forward_slower ();
+ void transport_rewind_slower ();
+ void transport_forward_faster ();
+ void transport_rewind_faster ();
  void transport_loop ();
 
  void transport_locating ();
Index: gtk_ardour/default_keys.cc
===================================================================
RCS file: /home/las/cvsroot/ardour/ardour/gtk_ardour/default_keys.cc,v
retrieving revision 1.10
diff -u -r1.10 default_keys.cc
--- gtk_ardour/default_keys.cc 13 Jan 2005 22:15:47 -0000 1.10
+++ gtk_ardour/default_keys.cc 26 Apr 2005 15:33:54 -0000
@@ -58,7 +58,10 @@
  KeyboardTarget::add_action ("transport-record", slot (*this, &ARDOUR_UI::transport_record));
  KeyboardTarget::add_action ("transport-rewind", slot (*this, &ARDOUR_UI::transport_rewind));
  KeyboardTarget::add_action ("transport-forward", slot (*this, &ARDOUR_UI::transport_forward));
-
+ KeyboardTarget::add_action ("transport-rewind-slower", slot (*this, &ARDOUR_UI::transport_rewind_slower));
+ KeyboardTarget::add_action ("transport-forward-slower", slot (*this, &ARDOUR_UI::transport_forward_slower));
+ KeyboardTarget::add_action ("transport-rewind-faster", slot (*this, &ARDOUR_UI::transport_rewind_faster));
+ KeyboardTarget::add_action ("transport-forward-faster", slot (*this, &ARDOUR_UI::transport_forward_faster));
  KeyboardTarget::add_action ("transport-goto-start", slot (*this, &ARDOUR_UI::transport_goto_start));
  KeyboardTarget::add_action ("transport-goto-end", slot (*this, &ARDOUR_UI::transport_goto_end));
 




More information about the Ardour-Dev mailing list