[vlc-commits] commit: Simplify up/down subtitle hotkey. (Laurent Aimar )

git at videolan.org git at videolan.org
Sat May 29 22:12:53 CEST 2010


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Fri May 28 21:50:18 2010 +0200| [dbc2edaca2d8d2412c6c197124c4c8788c3fc5d6] | committer: Laurent Aimar 

Simplify up/down subtitle hotkey.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=dbc2edaca2d8d2412c6c197124c4c8788c3fc5d6
---

 modules/control/hotkeys.c |   22 ++++++++--------------
 1 files changed, 8 insertions(+), 14 deletions(-)

diff --git a/modules/control/hotkeys.c b/modules/control/hotkeys.c
index b1444d7..31e1895 100644
--- a/modules/control/hotkeys.c
+++ b/modules/control/hotkeys.c
@@ -783,21 +783,15 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
                                 _( "Subtitle delay %i ms" ),
                                  (int)(i_delay/1000) );
             }
-            else if( i_action == ACTIONID_SUBPOS_DOWN )
+            else if( i_action == ACTIONID_SUBPOS_DOWN ||
+                     i_action == ACTIONID_SUBPOS_UP )
             {
-                int i_pos = var_GetInteger( p_input, "sub-margin" );
-                --i_pos;
-                var_SetInteger( p_input, "sub-margin", i_pos );
-                ClearChannels( p_intf, p_vout );
-                DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
-                                _( "Subtitle position %i px" ),
-                                 (int)(i_pos) );
-            }
-            else if( i_action == ACTIONID_SUBPOS_UP )
-            {
-                int i_pos = var_GetInteger( p_input, "sub-margin" );
-                ++i_pos;
-                var_SetInteger( p_input, "sub-margin", i_pos );
+                int i_pos;
+                if( i_action == ACTIONID_SUBPOS_DOWN )
+                    i_pos = var_DecInteger( p_input, "sub-margin" );
+                else
+                    i_pos = var_IncInteger( p_input, "sub-margin" );
+
                 ClearChannels( p_intf, p_vout );
                 DisplayMessage( p_vout, SPU_DEFAULT_CHANNEL,
                                 _( "Subtitle position %i px" ),



More information about the vlc-commits mailing list