]> git.sesse.net Git - vlc/blobdiff - modules/control/http/rpn.c
Finish the playlist API transition (hopefully)
[vlc] / modules / control / http / rpn.c
index ee86775335ffe7ad157b71650481fab21587639f..c1ba23ca79d446fb2e9f9a4752fe5d7406dc6bd3 100644 (file)
@@ -37,10 +37,8 @@ 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_VLC" ) )
-        p_object = VLC_OBJECT(p_intf->p_vlc);
+    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);
     else if( !strcmp( psz_object, "VLC_OBJECT_PLAYLIST" ) )
@@ -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" ) )
@@ -981,29 +972,29 @@ void E_(EvaluateRPN)( intf_thread_t *p_intf, mvar_t  *vars,
 #define p_item  p_sys->p_input->input.p_item
                 if( !strcmp( psz_meta, "ARTIST" ) )
                 {
-                    psz_val = vlc_input_item_GetInfo( p_item,
+                    psz_val = input_ItemGetInfo( p_item,
                                 _(VLC_META_INFO_CAT), _(VLC_META_ARTIST) );
                 }
                 else if( !strcmp( psz_meta, "TITLE" ) )
                 {
-                    psz_val = vlc_input_item_GetInfo( p_item,
+                    psz_val = input_ItemGetInfo( p_item,
                                 _(VLC_META_INFO_CAT), _(VLC_META_TITLE) );
                     if( psz_val == NULL )
                         psz_val = strdup( p_item->psz_name );
                 }
                 else if( !strcmp( psz_meta, "ALBUM" ) )
                 {
-                    psz_val = vlc_input_item_GetInfo( p_item,
+                    psz_val = input_ItemGetInfo( p_item,
                                 _(VLC_META_INFO_CAT), _(VLC_META_COLLECTION) );
                 }
                 else if( !strcmp( psz_meta, "GENRE" ) )
                 {
-                    psz_val = vlc_input_item_GetInfo( p_item,
+                    psz_val = input_ItemGetInfo( p_item,
                                 _(VLC_META_INFO_CAT), _(VLC_META_GENRE) );
                 }
                 else
                 {
-                    psz_val = vlc_input_item_GetInfo( p_item,
+                    psz_val = input_ItemGetInfo( p_item,
                                             _(VLC_META_INFO_CAT), psz_meta );
                 }
 #undef p_item