changeset 32593:0c5bb45690ea

Allow cycling subtitles backwards with 'J'.
author reimar
date Sat, 11 Dec 2010 12:44:39 +0000
parents 9ec31cdc76ad
children 24e4682ce6ec
files DOCS/man/en/mplayer.1 DOCS/tech/slave.txt command.c input/input.c
diffstat 4 files changed, 19 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/DOCS/man/en/mplayer.1	Sat Dec 11 12:23:07 2010 +0000
+++ b/DOCS/man/en/mplayer.1	Sat Dec 11 12:44:39 2010 +0000
@@ -271,7 +271,7 @@
 (see \-framedrop and \-hardframedrop).
 .IPs "v\ \ \ \ "
 Toggle subtitle visibility.
-.IPs "j\ \ \ \ "
+.IPs "j and J"
 Cycle through the available subtitles.
 .IPs "y and g"
 Step forward/backward in the subtitle list.
--- a/DOCS/tech/slave.txt	Sat Dec 11 12:23:07 2010 +0000
+++ b/DOCS/tech/slave.txt	Sat Dec 11 12:44:39 2010 +0000
@@ -342,7 +342,8 @@
     Display subtitle with index [value]. Turn subtitle display off if
     [value] is -1 or greater than the highest available subtitle index.
     Cycle through the available subtitles if [value] is omitted or less
-    than -1. Supported subtitle sources are -sub options on the command
+    than -1 ((forward or backward respectively).
+    Supported subtitle sources are -sub options on the command
     line, VOBsubs, DVD subtitles, and Ogg and Matroska text streams.
     This command is mainly for cycling all subtitles, if you want to set
     a specific subtitle, use sub_file, sub_vob, or sub_demux.
@@ -352,26 +353,30 @@
     SUB_SOURCE_SUBS   (0) for file subs
     SUB_SOURCE_VOBSUB (1) for VOBsub files
     SUB_SOURCE_DEMUX  (2) for subtitle embedded in the media file or DVD subs.
-    If [source] is -1, will turn off subtitle display. If [source] less than -1,
-    will cycle between the first subtitle of each currently available sources.
+    If [source] is -1, will turn off subtitle display.
+    If [value] is omitted or less than -1, will cycle between the first subtitle
+    of each currently available source (forward or backward respectively).
 
 sub_file [value]
     Display subtitle specifid by [value] for file subs. The [value] is
     corresponding to ID_FILE_SUB_ID values reported by '-identify'.
-    If [value] is -1, will turn off subtitle display. If [value] less than -1,
-    will cycle all file subs.
+    If [value] is -1, will turn off subtitle display.
+    If [value] is omitted or less than -1, will cycle all file subs
+    (forward or backward respectively).
 
 sub_vob [value]
     Display subtitle specifid by [value] for vobsubs. The [value] is
     corresponding to ID_VOBSUB_ID values reported by '-identify'.
-    If [value] is -1, will turn off subtitle display. If [value] less than -1,
-    will cycle all vobsubs.
+    If [value] is -1, will turn off subtitle display.
+    If [value] is omitted or less than -1, will cycle all vobsubs
+    (forward or backward respectively).
 
 sub_demux [value]
     Display subtitle specifid by [value] for subtitles from DVD or embedded
     in media file. The [value] is corresponding to ID_SUBTITLE_ID values
     reported by '-identify'. If [value] is -1, will turn off subtitle display.
-    If [value] less than -1, will cycle all DVD subs or embedded subs.
+    If [value] is omitted or less than -1, will cycle all DVD subs or embedded subs
+    (forward or backward respectively).
 
 sub_scale <value> [abs]
     Adjust the subtitle size by +/- <value> or set it to <value> when [abs]
--- a/command.c	Sat Dec 11 12:23:07 2010 +0000
+++ b/command.c	Sat Dec 11 12:44:39 2010 +0000
@@ -2302,8 +2302,8 @@
  *
  * Toggle commands take 0 or 1 parameters. With no parameter
  * or a value less than the property minimum it just steps the
- * property to its next value. Otherwise it sets it to the given
- * value.
+ * property to its next or previous value respectively.
+ * Otherwise it sets it to the given value.
  *
  *@{
  */
@@ -2396,6 +2396,8 @@
         // set to value
         if (cmd->nargs > 0 && cmd->args[0].v.i >= prop->min)
             r = mp_property_do(pname, M_PROPERTY_SET, &cmd->args[0].v.i, mpctx);
+        else if (cmd->nargs > 0)
+            r = mp_property_do(pname, M_PROPERTY_STEP_DOWN, NULL, mpctx);
         else
             r = mp_property_do(pname, M_PROPERTY_STEP_UP, NULL, mpctx);
     } else if (cmd->args[1].v.i)        //set
--- a/input/input.c	Sat Dec 11 12:23:07 2010 +0000
+++ b/input/input.c	Sat Dec 11 12:44:39 2010 +0000
@@ -427,6 +427,7 @@
   { { 'a', 0 }, "sub_alignment" },
   { { 'v', 0 }, "sub_visibility" },
   { { 'j', 0 }, "sub_select" },
+  { { 'J', 0 }, "sub_select -3" },
   { { 'F', 0 }, "forced_subs_only" },
   { { '#', 0 }, "switch_audio" },
   { { '_', 0 }, "step_property switch_video" },