add spu text scaling actions
authorFrancois Cartegnie <fcvlcdev@free.fr>
Fri, 28 Aug 2015 11:01:14 +0000 (13:01 +0200)
committerFrancois Cartegnie <fcvlcdev@free.fr>
Sun, 6 Sep 2015 22:12:31 +0000 (00:12 +0200)
include/vlc_keys.h
modules/control/hotkeys.c
src/config/keys.c

index 49edab3..ea54950 100644 (file)
@@ -173,6 +173,9 @@ typedef enum vlc_action {
     ACTIONID_AUDIO_TRACK,
     ACTIONID_SUBTITLE_TRACK,
     ACTIONID_SUBTITLE_TOGGLE,
+    ACTIONID_SUBTITLE_TEXT_SCALE_NORMAL,
+    ACTIONID_SUBTITLE_TEXT_SCALE_UP,
+    ACTIONID_SUBTITLE_TEXT_SCALE_DOWN,
     ACTIONID_INTF_TOGGLE_FSC,
     ACTIONID_INTF_HIDE,
     ACTIONID_INTF_BOSS,
index f5d0638..7c4ee7f 100644 (file)
@@ -1092,6 +1092,28 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
             break;
         }
 
+        case ACTIONID_SUBTITLE_TEXT_SCALE_DOWN:
+        case ACTIONID_SUBTITLE_TEXT_SCALE_UP:
+        case ACTIONID_SUBTITLE_TEXT_SCALE_NORMAL:
+        {
+            if( p_vout )
+            {
+                int i_scale;
+                if( i_action == ACTIONID_SUBTITLE_TEXT_SCALE_NORMAL )
+                {
+                    i_scale = 100;
+                }
+                else
+                {
+                    i_scale = var_GetInteger( p_vout, "sub-text-scale" );
+                    i_scale += ((i_action == ACTIONID_SUBTITLE_TEXT_SCALE_UP) ? 1 : -1) * 25;
+                    i_scale = VLC_CLIP( i_scale, 10, 500 );
+                }
+                var_SetInteger( p_vout, "sub-text-scale", i_scale );
+                DisplayMessage( p_vout, _( "Subtitle text scale %d%%" ), i_scale );
+            }
+        }
+
         /* Input + video output */
         case ACTIONID_POSITION:
             if( p_vout && vout_OSDEpg( p_vout, input_GetItem( p_input ) ) )
index b247a57..94e5cf5 100644 (file)
@@ -260,7 +260,7 @@ found:
 
 /*** VLC key map ***/
 
-#define MAXACTION 20
+#define MAXACTION 26
 struct action
 {
     char name[MAXACTION];
@@ -353,6 +353,9 @@ static const struct action actions[] =
     { "subsync-markaudio", ACTIONID_SUBSYNC_MARKAUDIO, },
     { "subsync-marksub", ACTIONID_SUBSYNC_MARKSUB, },
     { "subsync-reset", ACTIONID_SUBSYNC_RESET, },
+    { "subtitle-text-scale-down", ACTIONID_SUBTITLE_TEXT_SCALE_DOWN, },
+    { "subtitle-text-scale-normal", ACTIONID_SUBTITLE_TEXT_SCALE_NORMAL, },
+    { "subtitle-text-scale-up", ACTIONID_SUBTITLE_TEXT_SCALE_UP, },
     { "subtitle-toggle", ACTIONID_SUBTITLE_TOGGLE, },
     { "subtitle-track", ACTIONID_SUBTITLE_TRACK, },
     { "title-next", ACTIONID_TITLE_NEXT, },