]> git.sesse.net Git - vlc/blobdiff - modules/control/rc.c
mkv.cpp: do an EnterAndLeave before seeking in Matroska Script
[vlc] / modules / control / rc.c
index 6d5fe5d76e454bb2d9053caf3a27daed2d038417..11a4a938fd53d3c342369bb521aeaac73b2edf03 100644 (file)
@@ -95,7 +95,6 @@ struct intf_sys_t
     int i_socket_listen;
     int i_socket;
     char *psz_unix_path;
-    vlc_bool_t b_extend;
 
 #ifdef WIN32
     HANDLE hConsoleIn;
@@ -136,8 +135,6 @@ void __msg_rc( intf_thread_t *p_intf, const char *psz_fmt, ... )
 #define HOST_TEXT N_("TCP command input")
 #define HOST_LONGTEXT N_("Accept commands over a socket rather than stdin. " \
             "You can set the address and port the interface will bind to." )
-#define EXTEND_TEXT N_("Extended help")
-#define EXTEND_LONGTEXT N_("List additional commands.")
 
 #ifdef WIN32
 #define QUIET_TEXT N_("Do not open a DOS command box interface")
@@ -149,6 +146,7 @@ void __msg_rc( intf_thread_t *p_intf, const char *psz_fmt, ... )
 #endif
 
 vlc_module_begin();
+    set_shortname( _("RC"));
     set_category( CAT_INTERFACE );
     set_subcategory( SUBCAT_INTERFACE_GENERAL );
     set_description( _("Remote control interface") );
@@ -162,7 +160,6 @@ vlc_module_begin();
 #ifdef WIN32
     add_bool( "rc-quiet", 0, NULL, QUIET_TEXT, QUIET_LONGTEXT, VLC_FALSE );
 #endif
-    add_bool( "rc-extend", 0, NULL, EXTEND_TEXT, EXTEND_LONGTEXT, VLC_FALSE );
 
     set_capability( "interface", 20 );
     set_callbacks( Activate, Deactivate );
@@ -327,6 +324,7 @@ static void Run( intf_thread_t *p_intf )
 
     char       p_buffer[ MAX_LINE_LENGTH + 1 ];
     vlc_bool_t b_showpos = config_GetInt( p_intf, "rc-show-pos" );
+    vlc_bool_t b_longhelp = VLC_FALSE;
 
     int        i_size = 0;
     int        i_oldpos = 0;
@@ -336,7 +334,6 @@ static void Run( intf_thread_t *p_intf )
     p_input = NULL;
     p_playlist = NULL;
  
-    p_intf->p_sys->b_extend = config_GetInt( p_intf, "rc-extend" );
     /* Register commands that will be cleaned up upon object destruction */
     var_Create( p_intf, "quit", VLC_VAR_VOID | VLC_VAR_ISCOMMAND );
     var_AddCallback( p_intf, "quit", Quit, NULL );
@@ -386,6 +383,8 @@ static void Run( intf_thread_t *p_intf )
     var_AddCallback( p_intf, "mosaic-xoffset", Other, NULL );
     var_Create( p_intf, "mosaic-yoffset", VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND );
     var_AddCallback( p_intf, "mosaic-yoffset", Other, NULL );
+    var_Create( p_intf, "mosaic-align", VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND );
+    var_AddCallback( p_intf, "mosaic-align", Other, NULL );
     var_Create( p_intf, "mosaic-vborder", VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND );
     var_AddCallback( p_intf, "mosaic-vborder", Other, NULL );
     var_Create( p_intf, "mosaic-hborder", VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND );
@@ -417,6 +416,19 @@ static void Run( intf_thread_t *p_intf )
     var_Create( p_intf, "time-size", VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND );
     var_AddCallback( p_intf, "time-size", Other, NULL );
     
+    /* logo on the fly items */
+    var_Create( p_intf, "logo-file", VLC_VAR_VOID | VLC_VAR_ISCOMMAND );
+    var_AddCallback( p_intf, "logo-file", Other, NULL );
+    var_Create( p_intf, "logo-x", VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND );
+    var_AddCallback( p_intf, "logo-x", Other, NULL );
+    var_Create( p_intf, "logo-y", VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND );
+    var_AddCallback( p_intf, "logo-y", Other, NULL );
+    var_Create( p_intf, "logo-position", VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND );
+    var_AddCallback( p_intf, "logo-position", Other, NULL );
+    var_Create( p_intf, "logo-transparency", VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND );
+    var_AddCallback( p_intf, "logo-transparency", Other, NULL );
+    
+    
     var_Create( p_intf, "pause", VLC_VAR_VOID | VLC_VAR_ISCOMMAND );
     var_AddCallback( p_intf, "pause", Input, NULL );
     var_Create( p_intf, "seek", VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND );
@@ -649,32 +661,13 @@ static void Run( intf_thread_t *p_intf )
                 msg_rc( "%s\n", p_input->input.p_item->psz_name );
             }
         }
-        else switch( psz_cmd[0] )
+        else if( !strcmp( psz_cmd, "longhelp" ) || !strncmp( psz_cmd, "h", 1 )
+                 || !strncmp( psz_cmd, "H", 1 ) || !strncmp( psz_cmd, "?", 1 ) )
         {
-        case 'f':
-        case 'F':
-            if( p_input )
-            {
-                vout_thread_t *p_vout;
-                p_vout = vlc_object_find( p_input,
-                                          VLC_OBJECT_VOUT, FIND_CHILD );
-
-                if( p_vout )
-                {
-                    p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE;
-                    vlc_object_release( p_vout );
-                }
-            }
-            break;
-
-        case 's':
-        case 'S':
-            ;
-            break;
-
-        case '?':
-        case 'h':
-        case 'H':
+            if( !strcmp( psz_cmd, "longhelp" ) || !strncmp( psz_cmd, "H", 1 ) )
+                 b_longhelp = VLC_TRUE;
+            else b_longhelp = VLC_FALSE;
+            
             msg_rc(_("+----[ Remote control commands ]\n"));
             msg_rc(  "| \n");
             msg_rc(_("| add XYZ  . . . . . . . . . . add XYZ to playlist\n"));
@@ -705,31 +698,73 @@ static void Run( intf_thread_t *p_intf )
             msg_rc(_("| achan [X]. . . . . . . .  set/get audio channels\n"));
             msg_rc(  "| \n");
             
-            if (p_intf->p_sys->b_extend)
+            if (b_longhelp)
             {
                 msg_rc(_("| marq-marquee STRING  . . overlay STRING in video\n"));
-                msg_rc(_("| marq-x X . . . . .  offset of marquee, from left\n"));
-                msg_rc(_("| marq-y Y . . . . . . offset of marquee, from top\n"));
+                msg_rc(_("| marq-x X . . . . . . . . . . . .offset from left\n"));
+                msg_rc(_("| marq-y Y . . . . . . . . . . . . offset from top\n"));
                 msg_rc(_("| marq-position #. . .  .relative position control\n"));
-                msg_rc(_("| marq-color # . . . .  font color of marquee, RGB\n"));
-                msg_rc(_("| marq-opacity # . . . . . . . .opacity of marquee\n"));
-                msg_rc(_("| marq-timeout T. . . .  timeout of marquee, in ms\n"));
-                msg_rc(_("| marq-size # . . . font size of marquee, in pixels\n"));
+                msg_rc(_("| marq-color # . . . . . . . . . . font color, RGB\n"));
+                msg_rc(_("| marq-opacity # . . . . . . . . . . . . . opacity\n"));
+                msg_rc(_("| marq-timeout T. . . . . . . . . . timeout, in ms\n"));
+                msg_rc(_("| marq-size # . . . . . . . . font size, in pixels\n"));
                 msg_rc(  "| \n");
                 msg_rc(_("| time-format STRING . . . overlay STRING in video\n"));
-                msg_rc(_("| time-x X . . . . .offset of timestamp, from left\n"));
-                msg_rc(_("| time-y Y . . . . . offset of timestamp, from top\n"));
-                msg_rc(_("| time-position #. . .  .relative position control\n"));
-                msg_rc(_("| time-color # . . .  font color of timestamp, RGB\n"));
-                msg_rc(_("| time-opacity # . . . . . . .opacity of timestamp\n"));
-                msg_rc(_("| time-size # . .font size of timestamp, in pixels\n"));
+                msg_rc(_("| time-x X . . . . . . . . . . . .offset from left\n"));
+                msg_rc(_("| time-y Y . . . . . . . . . . . . offset from top\n"));
+                msg_rc(_("| time-position #. . . . . . . . relative position\n"));
+                msg_rc(_("| time-color # . . . . . . . . . . font color, RGB\n"));
+                msg_rc(_("| time-opacity # . . . . . . . . . . . . . opacity\n"));
+                msg_rc(_("| time-size # . . . . . . . . font size, in pixels\n"));
+                msg_rc(  "| \n");
+                msg_rc(_("| logo-file STRING . . . the overlay file path/name\n"));
+                msg_rc(_("| logo-x X . . . . . . . . . . . .offset from left\n"));
+                msg_rc(_("| logo-y Y . . . . . . . . . . . . offset from top\n"));
+                msg_rc(_("| logo-position #. . . . . . . . relative position\n"));
+                msg_rc(_("| logo-transparency #. . . . . . . . .transparency\n"));
+                msg_rc(  "| \n");
+                msg_rc(_("| mosaic-alpha # . . . . . . . . . . . . . . alpha\n"));
+                msg_rc(_("| mosaic-height #. . . . . . . . . . . . . .height\n"));
+                msg_rc(_("| mosaic-width # . . . . . . . . . . . . . . width\n"));
+                msg_rc(_("| mosaic-xoffset # . . . .top left corner position\n"));
+                msg_rc(_("| mosaic-yoffset # . . . .top left corner position\n"));
+                msg_rc(_("| mosaic-align 0..2,4..6,8..10. . .mosaic alignment\n"));
+                msg_rc(_("| mosaic-vborder # . . . . . . . . vertical border\n"));
+                msg_rc(_("| mosaic-hborder # . . . . . . . horizontal border\n"));
+                msg_rc(_("| mosaic-position {0=auto,1=fixed} . . . .position\n"));
+                msg_rc(_("| mosaic-rows #. . . . . . . . . . .number of rows\n"));
+                msg_rc(_("| mosaic-cols #. . . . . . . . . . .number of cols\n"));
+                msg_rc(_("| mosaic-keep-aspect-ratio {0,1} . . .aspect ratio\n"));
                 msg_rc(  "| \n");
             }    
             msg_rc(_("| help . . . . . . . . . . . . . this help message\n"));
+            msg_rc(_("| longhelp . . . . . . . . . a longer help message\n"));
             msg_rc(_("| logout . . . . .  exit (if in socket connection)\n"));
             msg_rc(_("| quit . . . . . . . . . . . . . . . . .  quit vlc\n"));
             msg_rc(  "| \n");
             msg_rc(_("+----[ end of help ]\n"));
+        }
+        else switch( psz_cmd[0] )
+        {
+        case 'f':
+        case 'F':
+            if( p_input )
+            {
+                vout_thread_t *p_vout;
+                p_vout = vlc_object_find( p_input,
+                                          VLC_OBJECT_VOUT, FIND_CHILD );
+
+                if( p_vout )
+                {
+                    p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE;
+                    vlc_object_release( p_vout );
+                }
+            }
+            break;
+
+        case 's':
+        case 'S':
+            ;
             break;
 
         case '\0':
@@ -1068,7 +1103,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd,
     }
     else if( !strcmp( psz_cmd, "mosaic-alpha" ) )
     {
-        if( strlen( newval.psz_string) > 0)
+        if( strlen( newval.psz_string ) > 0)
         {
             val.i_int = atoi( newval.psz_string );
             var_Set( p_inp->p_libvlc, "mosaic-alpha", val );
@@ -1076,7 +1111,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd,
     }
     else if( !strcmp( psz_cmd, "mosaic-height" ) )
     {
-        if( strlen( newval.psz_string) > 0)
+        if( strlen( newval.psz_string ) > 0)
         {
             val.i_int = atoi( newval.psz_string );
             var_Set( p_inp->p_libvlc, "mosaic-height", val );
@@ -1084,7 +1119,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd,
     }
     else if( !strcmp( psz_cmd, "mosaic-width" ) )
     {
-        if( strlen( newval.psz_string) > 0)
+        if( strlen( newval.psz_string ) > 0)
         {
             val.i_int = atoi( newval.psz_string );
             var_Set( p_inp->p_libvlc, "mosaic-width", val );
@@ -1092,7 +1127,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd,
     }
     else if( !strcmp( psz_cmd, "mosaic-xoffset" ) )
     {
-        if( strlen( newval.psz_string) > 0)
+        if( strlen( newval.psz_string ) > 0)
         {
             val.i_int = atoi( newval.psz_string );
             var_Set( p_inp->p_libvlc, "mosaic-xoffset", val );
@@ -1100,15 +1135,23 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd,
     }
     else if( !strcmp( psz_cmd, "mosaic-yoffset" ) )
     {
-        if( strlen( newval.psz_string) > 0)
+        if( strlen( newval.psz_string ) > 0)
         {
             val.i_int = atoi( newval.psz_string );
             var_Set( p_inp->p_libvlc, "mosaic-yoffset", val );
         }
     }
+    else if( !strcmp( psz_cmd, "mosaic-align" ) )
+    {
+        if( strlen( newval.psz_string ) > 0 )
+        {
+            val.i_int = atoi( newval.psz_string );
+            var_Set( p_inp->p_libvlc, "mosaic-align", val );
+        }
+    }
     else if( !strcmp( psz_cmd, "mosaic-vborder" ) )
     {
-        if( strlen( newval.psz_string) > 0)
+        if( strlen( newval.psz_string ) > 0)
         {
             val.i_int = atoi( newval.psz_string );
             var_Set( p_inp->p_libvlc, "mosaic-vborder", val );
@@ -1116,7 +1159,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd,
     }
     else if( !strcmp( psz_cmd, "mosaic-hborder" ) )
     {
-        if( strlen( newval.psz_string) > 0)
+        if( strlen( newval.psz_string ) > 0)
         {
             val.i_int = atoi( newval.psz_string );
             var_Set( p_inp->p_libvlc, "mosaic-hborder", val );
@@ -1124,7 +1167,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd,
     }
     else if( !strcmp( psz_cmd, "mosaic-position" ) )
     {
-        if( strlen( newval.psz_string) > 0)
+        if( strlen( newval.psz_string ) > 0)
         {
             val.i_int = atoi( newval.psz_string );
             var_Set( p_inp->p_libvlc, "mosaic-position", val );
@@ -1132,7 +1175,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd,
     }
     else if( !strcmp( psz_cmd, "mosaic-rows" ) )
     {
-        if( strlen( newval.psz_string) > 0)
+        if( strlen( newval.psz_string ) > 0)
         {
             val.i_int = atoi( newval.psz_string );
             var_Set( p_inp->p_libvlc, "mosaic-rows", val );
@@ -1140,7 +1183,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd,
     }
     else if( !strcmp( psz_cmd, "mosaic-cols" ) )
     {
-        if( strlen( newval.psz_string) > 0)
+        if( strlen( newval.psz_string ) > 0)
         {
             val.i_int = atoi( newval.psz_string );
             var_Set( p_inp->p_libvlc, "mosaic-cols", val );
@@ -1148,7 +1191,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd,
     }
     else if( !strcmp( psz_cmd, "mosaic-keep-aspect-ratio" ) )
     {
-        if( strlen( newval.psz_string) > 0)
+        if( strlen( newval.psz_string ) > 0)
         {
             val.i_int = atoi( newval.psz_string );
             var_Set( p_inp->p_libvlc, "mosaic-keep-aspect-ratio", val );
@@ -1215,6 +1258,46 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd,
             var_Set( p_inp->p_libvlc, "time-size", val );
         }
     }
+    else if( !strcmp( psz_cmd, "logo-file" ) )
+    {
+        if( strlen( newval.psz_string ) > 0 )
+        {
+            val.psz_string = newval.psz_string;
+            var_Set( p_inp->p_libvlc, "logo-file", val );
+        }
+    }
+    else if( !strcmp( psz_cmd, "logo-x" ) )
+    {
+        if( strlen( newval.psz_string ) > 0) 
+        {
+            val.i_int = atoi( newval.psz_string );
+            var_Set( p_inp->p_libvlc, "logo-x", val );
+        }
+    }
+    else if( !strcmp( psz_cmd, "logo-y" ) )
+    {
+        if( strlen( newval.psz_string ) > 0) 
+        {
+            val.i_int = atoi( newval.psz_string );
+            var_Set( p_inp->p_libvlc, "logo-y", val );
+        }
+    }
+    else if( !strcmp( psz_cmd, "logo-position" ) )
+    {
+        if( strlen( newval.psz_string ) > 0) 
+        {
+            val.i_int = atoi( newval.psz_string );
+            var_Set( p_inp->p_libvlc, "logo-position", val );
+        }
+    }
+    else if( !strcmp( psz_cmd, "logo-transparency" ) )
+    {
+        if( strlen( newval.psz_string ) > 0) 
+        {
+            val.i_int = strtol( newval.psz_string, NULL, 0 );
+            var_Set( p_inp->p_libvlc, "logo-transparency", val );
+        }
+    }
 
     /*
      * sanity check