]> git.sesse.net Git - vlc/blobdiff - modules/control/rc.c
Desperate attempt to recover the wxwidgets plugin
[vlc] / modules / control / rc.c
index 3b7bc938827dc2bd5e2f15617b28b392a550a7c9..137164404410d9a638ea252dccab2a82a2fcb86f 100644 (file)
@@ -363,6 +363,10 @@ static void RegisterCallbacks( intf_thread_t *p_intf )
 
     var_Create( p_intf, "add", VLC_VAR_STRING | VLC_VAR_ISCOMMAND );
     var_AddCallback( p_intf, "add", Playlist, NULL );
+    var_Create( p_intf, "repeat", VLC_VAR_STRING | VLC_VAR_ISCOMMAND );
+    var_AddCallback( p_intf, "repeat", Playlist, NULL );
+    var_Create( p_intf, "loop", VLC_VAR_STRING | VLC_VAR_ISCOMMAND );
+    var_AddCallback( p_intf, "loop", Playlist, NULL );
     var_Create( p_intf, "enqueue", VLC_VAR_STRING | VLC_VAR_ISCOMMAND );
     var_AddCallback( p_intf, "enqueue", Playlist, NULL );
     var_Create( p_intf, "playlist", VLC_VAR_VOID | VLC_VAR_ISCOMMAND );
@@ -433,22 +437,6 @@ static void RegisterCallbacks( intf_thread_t *p_intf )
                      VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND );
     var_AddCallback( p_intf, "mosaic-keep-aspect-ratio", Other, NULL );
 
-    /* time on the fly items */
-    var_Create( p_intf, "time-format", VLC_VAR_VOID | VLC_VAR_ISCOMMAND );
-    var_AddCallback( p_intf, "time-format", Other, NULL );
-    var_Create( p_intf, "time-x", VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND );
-    var_AddCallback( p_intf, "time-x", Other, NULL );
-    var_Create( p_intf, "time-y", VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND );
-    var_AddCallback( p_intf, "time-y", Other, NULL );
-    var_Create( p_intf, "time-position", VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND );
-    var_AddCallback( p_intf, "time-position", Other, NULL );
-    var_Create( p_intf, "time-color", VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND );
-    var_AddCallback( p_intf, "time-color", Other, NULL );
-    var_Create( p_intf, "time-opacity", VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND );
-    var_AddCallback( p_intf, "time-opacity", Other, NULL );
-    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 );
@@ -903,6 +891,8 @@ static void Help( intf_thread_t *p_intf, vlc_bool_t b_longhelp)
     msg_rc(_("| next . . . . . . . . . . . .  next playlist item"));
     msg_rc(_("| prev . . . . . . . . . .  previous playlist item"));
     msg_rc(_("| goto . . . . . . . . . . . .  goto item at index"));
+    msg_rc(_("| repeat [on|off] . .  toggle playlist item repeat"));
+    msg_rc(_("| loop [on|off] . . . .  toggle playlist item loop"));
     msg_rc(_("| clear . . . . . . . . . . .   clear the playlist"));
     msg_rc(_("| status . . . . . . . . . current playlist status"));
     msg_rc(_("| title [X]  . . . . set/get title in current item"));
@@ -951,14 +941,6 @@ static void Help( intf_thread_t *p_intf, vlc_bool_t b_longhelp)
         msg_rc(_("| marq-timeout T. . . . . . . . . . timeout, in ms"));
         msg_rc(_("| marq-size # . . . . . . . . font size, in pixels"));
         msg_rc(  "| ");
-        msg_rc(_("| time-format STRING . . . overlay STRING in video"));
-        msg_rc(_("| time-x X . . . . . . . . . . . .offset from left"));
-        msg_rc(_("| time-y Y . . . . . . . . . . . . offset from top"));
-        msg_rc(_("| time-position #. . . . . . . . relative position"));
-        msg_rc(_("| time-color # . . . . . . . . . . font color, RGB"));
-        msg_rc(_("| time-opacity # . . . . . . . . . . . . . opacity"));
-        msg_rc(_("| time-size # . . . . . . . . font size, in pixels"));
-        msg_rc(  "| ");
         msg_rc(_("| logo-file STRING . . .the overlay file path/name"));
         msg_rc(_("| logo-x X . . . . . . . . . . . .offset from left"));
         msg_rc(_("| logo-y Y . . . . . . . . . . . . offset from top"));
@@ -970,6 +952,7 @@ static void Help( intf_thread_t *p_intf, vlc_bool_t b_longhelp)
         msg_rc(_("| mosaic-width # . . . . . . . . . . . . . . width"));
         msg_rc(_("| mosaic-xoffset # . . . .top left corner position"));
         msg_rc(_("| mosaic-yoffset # . . . .top left corner position"));
+        msg_rc(_("| mosaic-offsets x,y(,x,y)*. . . . list of offsets"));
         msg_rc(_("| mosaic-align 0..2,4..6,8..10. . .mosaic alignment"));
         msg_rc(_("| mosaic-vborder # . . . . . . . . vertical border"));
         msg_rc(_("| mosaic-hborder # . . . . . . . horizontal border"));
@@ -1322,13 +1305,14 @@ static int Input( vlc_object_t *p_this, char const *psz_cmd,
 static int Playlist( vlc_object_t *p_this, char const *psz_cmd,
                      vlc_value_t oldval, vlc_value_t newval, void *p_data )
 {
+    vlc_value_t val;
+
     intf_thread_t *p_intf = (intf_thread_t*)p_this;
     playlist_t *p_playlist = pl_Yield( p_this );
 
     PL_LOCK;
     if( p_playlist->p_input )
     {
-        vlc_value_t val;
         var_Get( p_playlist->p_input, "state", &val );
         if( ( val.i_int == PAUSE_S ) || ( val.i_int == PLAYLIST_PAUSED ) )
         {
@@ -1354,6 +1338,50 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd,
         msg_Warn( p_playlist, "play" );
         playlist_Play( p_playlist );
     }
+    else if( !strcmp( psz_cmd, "repeat" ) )
+    {
+        vlc_bool_t b_update = VLC_TRUE;
+
+        var_Get( p_playlist, "repeat", &val );
+
+        if( strlen( newval.psz_string ) > 0 )
+        {
+            if ( ( !strncmp( newval.psz_string, "on", 2 ) && ( val.b_bool == VLC_TRUE ) ) ||
+                 ( !strncmp( newval.psz_string, "off", 3 ) && ( val.b_bool == VLC_FALSE ) ) )
+            {
+                b_update = VLC_FALSE;
+            }
+        }
+
+        if ( b_update )
+        {
+            val.b_bool = !val.b_bool;
+            var_Set( p_playlist, "repeat", val );
+        }
+        msg_rc( "Setting repeat to %d", val.b_bool );
+    }
+    else if( !strcmp( psz_cmd, "loop" ) )
+    {
+        vlc_bool_t b_update = VLC_TRUE;
+
+        var_Get( p_playlist, "loop", &val );
+
+        if( strlen( newval.psz_string ) > 0 )
+        {
+            if ( ( !strncmp( newval.psz_string, "on", 2 ) && ( val.b_bool == VLC_TRUE ) ) ||
+                 ( !strncmp( newval.psz_string, "off", 3 ) && ( val.b_bool == VLC_FALSE ) ) )
+            {
+                b_update = VLC_FALSE;
+            }
+        }
+
+        if ( b_update )
+        {
+            val.b_bool = !val.b_bool;
+            var_Set( p_playlist, "loop", val );
+        }
+        msg_rc( "Setting loop to %d", val.b_bool );
+    }
     else if (!strcmp( psz_cmd, "goto" ) )
     {
         msg_rc( _("goto is deprecated" ) );
@@ -1650,7 +1678,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd,
         if( strlen( newval.psz_string ) > 0)
         {
             val.psz_string = newval.psz_string;
-            var_Set( p_input->p_libvlc, "mosaic-offsets", val );
+            var_Set( p_input->p_libvlc_global, "mosaic-offsets", val );
         }
     }
     else if( !strcmp( psz_cmd, "mosaic-keep-aspect-ratio" ) )
@@ -1661,67 +1689,6 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd,
             var_Set( p_input->p_libvlc_global, "mosaic-keep-aspect-ratio", val );
         }
     }
-    else if( !strcmp( psz_cmd, "time-format" ) )
-    {
-        if( strlen( newval.psz_string ) > 0 )
-        {
-            val.psz_string = newval.psz_string;
-            var_Set( p_input->p_libvlc_global, "time-format", val );
-        }
-        else
-        {
-            val.psz_string = "";
-            var_Set( p_input->p_libvlc_global, "time-format", val);
-        }
-    }
-    else if( !strcmp( psz_cmd, "time-x" ) )
-    {
-        if( strlen( newval.psz_string ) > 0)
-        {
-            val.i_int = atoi( newval.psz_string );
-            var_Set( p_input->p_libvlc_global, "time-x", val );
-        }
-    }
-    else if( !strcmp( psz_cmd, "time-y" ) )
-    {
-        if( strlen( newval.psz_string ) > 0)
-        {
-            val.i_int = atoi( newval.psz_string );
-            var_Set( p_input->p_libvlc_global, "time-y", val );
-        }
-    }
-    else if( !strcmp( psz_cmd, "time-position" ) )
-    {
-        if( strlen( newval.psz_string ) > 0)
-        {
-            val.i_int = atoi( newval.psz_string );
-            var_Set( p_input->p_libvlc_global, "time-position", val );
-        }
-    }
-    else if( !strcmp( psz_cmd, "time-color" ) )
-    {
-        if( strlen( newval.psz_string ) > 0)
-        {
-            val.i_int = strtol( newval.psz_string, NULL, 0 );
-            var_Set( p_input->p_libvlc_global, "time-color", val );
-        }
-    }
-    else if( !strcmp( psz_cmd, "time-opacity" ) )
-    {
-        if( strlen( newval.psz_string ) > 0)
-        {
-            val.i_int = strtol( newval.psz_string, NULL, 0 );
-            var_Set( p_input->p_libvlc_global, "time-opacity", val );
-        }
-    }
-    else if( !strcmp( psz_cmd, "time-size" ) )
-    {
-        if( strlen( newval.psz_string ) > 0)
-        {
-            val.i_int = atoi( newval.psz_string );
-            var_Set( p_input->p_libvlc_global, "time-size", val );
-        }
-    }
     else if( !strcmp( psz_cmd, "logo-file" ) )
     {
         if( strlen( newval.psz_string ) > 0 )
@@ -2374,7 +2341,7 @@ static input_item_t *parse_MRL( intf_thread_t *p_intf, char *psz_mrl )
     /* Now create a playlist item */
     if( psz_item_mrl )
     {
-        p_item = input_ItemNew( p_intf, psz_item_mrl, psz_item_mrl );
+        p_item = input_ItemNew( p_intf, psz_item_mrl, NULL );
         for( i = 0; i < i_options; i++ )
         {
             input_ItemAddOption( p_item, ppsz_options[i] );