]> git.sesse.net Git - vlc/blobdiff - modules/control/http/rpn.c
Finish the playlist API transition (hopefully)
[vlc] / modules / control / http / rpn.c
index ee9291bd23ca88f6f8529e4da67729f0d7b6231a..c1ba23ca79d446fb2e9f9a4752fe5d7406dc6bd3 100644 (file)
@@ -37,9 +37,7 @@ static vlc_object_t *GetVLCObject( intf_thread_t *p_intf,
     vlc_object_t *p_object = NULL;
     *pb_need_release = VLC_FALSE;
 
-    if( !strcmp( psz_object, "VLC_OBJECT_ROOT" ) )
-        i_object_type = VLC_OBJECT_ROOT;
-    else if( !strcmp( psz_object, "VLC_OBJECT_LIBVLC" ) )
+    if( !strcmp( psz_object, "VLC_OBJECT_LIBVLC" ) )
         p_object = VLC_OBJECT(p_intf->p_libvlc);
     else if( !strcmp( psz_object, "VLC_OBJECT_INTF" ) )
         p_object = VLC_OBJECT(p_intf);
@@ -491,31 +489,31 @@ void E_(EvaluateRPN)( intf_thread_t *p_intf, mvar_t  *vars,
             int i_id = E_(SSPopN)( st, vars );
             int i_ret;
 
-            i_ret = playlist_Control( p_sys->p_playlist, PLAYLIST_VIEWPLAY,
+            i_ret = playlist_Control( p_sys->p_playlist, PLAYLIST_VIEWPLAY, VLC_TRUE,
                                       NULL,
                                       playlist_ItemGetById( p_sys->p_playlist,
-                                      i_id ) );
+                                      i_id, VLC_TRUE ) );
             msg_Dbg( p_intf, "requested playlist item: %i", i_id );
             E_(SSPushN)( st, i_ret );
         }
         else if( !strcmp( s, "vlc_stop" ) )
         {
-            playlist_Control( p_sys->p_playlist, PLAYLIST_STOP );
+            playlist_Control( p_sys->p_playlist, VLC_TRUE, PLAYLIST_STOP );
             msg_Dbg( p_intf, "requested playlist stop" );
         }
         else if( !strcmp( s, "vlc_pause" ) )
         {
-            playlist_Control( p_sys->p_playlist, PLAYLIST_PAUSE );
+            playlist_Control( p_sys->p_playlist, VLC_TRUE, PLAYLIST_PAUSE );
             msg_Dbg( p_intf, "requested playlist pause" );
         }
         else if( !strcmp( s, "vlc_next" ) )
         {
-            playlist_Control( p_sys->p_playlist, PLAYLIST_SKIP, 1 );
+            playlist_Control( p_sys->p_playlist, VLC_TRUE, PLAYLIST_SKIP, 1 );
             msg_Dbg( p_intf, "requested playlist next" );
         }
         else if( !strcmp( s, "vlc_previous" ) )
         {
-            playlist_Control( p_sys->p_playlist, PLAYLIST_SKIP, -1 );
+            playlist_Control( p_sys->p_playlist, VLC_TRUE, PLAYLIST_SKIP, -1 );
             msg_Dbg( p_intf, "requested playlist previous" );
         }
         else if( !strcmp( s, "vlc_seek" ) )
@@ -843,14 +841,7 @@ void E_(EvaluateRPN)( intf_thread_t *p_intf, mvar_t  *vars,
             free( mrl );
             mrl = tmp;
 
-            if( !*psz_name )
-            {
-                p_input = E_(MRLParse)( p_intf, mrl, mrl );
-            }
-            else
-            {
-                p_input = E_(MRLParse)( p_intf, mrl, psz_name );
-            }
+            p_input = E_(MRLParse)( p_intf, mrl, psz_name );
 
             if( !p_input || !p_input->psz_uri || !*p_input->psz_uri )
             {
@@ -859,8 +850,8 @@ void E_(EvaluateRPN)( intf_thread_t *p_intf, mvar_t  *vars,
             }
             else
             {
-                i_id = playlist_PlaylistAddInput( p_sys->p_playlist, p_input,
-                                         PLAYLIST_APPEND, PLAYLIST_END );
+                i_id = playlist_AddInput( p_sys->p_playlist, p_input,
+                                   PLAYLIST_APPEND, PLAYLIST_END, VLC_TRUE );
                 msg_Dbg( p_intf, "requested mrl add: %s", mrl );
             }
             E_(SSPushN)( st, i_id );
@@ -870,13 +861,13 @@ void E_(EvaluateRPN)( intf_thread_t *p_intf, mvar_t  *vars,
         }
         else if( !strcmp( s, "playlist_empty" ) )
         {
-            playlist_LockClear( p_sys->p_playlist );
+            playlist_Clear( p_sys->p_playlist, VLC_FALSE );
             msg_Dbg( p_intf, "requested playlist empty" );
         }
         else if( !strcmp( s, "playlist_delete" ) )
         {
             int i_id = E_(SSPopN)( st, vars );
-            playlist_LockDelete( p_sys->p_playlist, i_id );
+            playlist_DeleteFromInput( p_sys->p_playlist, i_id, VLC_FALSE );
             msg_Dbg( p_intf, "requested playlist delete: %d", i_id );
         }
         else if( !strcmp( s, "playlist_move" ) )