]> git.sesse.net Git - vlc/commitdiff
luahttp: implement pl_delete to match oldhttp feature
authorAkash Mehrotra <mehrotra.akash@gmail.com>
Thu, 30 Jun 2011 18:17:27 +0000 (23:47 +0530)
committerJean-Baptiste Kempf <jb@videolan.org>
Thu, 30 Jun 2011 20:37:18 +0000 (22:37 +0200)
THIS IS TOTALLY UNSUPPORTED.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/lua/libs/playlist.c
share/lua/http/requests/README.txt
share/lua/http/requests/status.xml

index df0f15c2b038c23c0f7cf105d0c9e0838e0777ac..ae610f3060ca21f9d264daad30f445c77d5cd7b8 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * playlist.c
  *****************************************************************************
- * Copyright (C) 2007-2008 the VideoLAN team
+ * Copyright (C) 2007-2011 the VideoLAN team
  * $Id$
  *
  * Authors: Antoine Cellerier <dionoea at videolan tod org>
@@ -138,6 +138,16 @@ static int vlclua_playlist_goto( lua_State * L )
     return vlclua_push_ret( L, i_ret );
 }
 
+static int vlclua_playlist_delete( lua_State * L )
+{
+    int i_id = luaL_checkint( L, 1 );
+    playlist_t *p_playlist = vlclua_get_playlist_internal( L );
+    PL_LOCK;
+    int i_ret = playlist_DeleteFromInput(p_playlist, playlist_ItemGetById( p_playlist, i_id ) -> p_input, true );
+    PL_UNLOCK;
+    return vlclua_push_ret( L, i_ret );
+}
+
 static int vlclua_playlist_add( lua_State *L )
 {
     int i_count;
@@ -378,6 +388,7 @@ static const luaL_Reg vlclua_playlist_reg[] = {
     { "current", vlclua_playlist_current },
     { "sort", vlclua_playlist_sort },
     { "status", vlclua_playlist_status },
+    { "delete", vlclua_playlist_delete },
     { NULL, NULL }
 };
 
index a367adcff5d9cd3d34419dfcd442d9485c7df7ce..b12a9892c92422b737840a4edcc51849d092ca09 100644 (file)
@@ -46,6 +46,7 @@ status.xml:
 
 > delete item <id> from playlist:
   ?command=pl_delete&id=<id>
+  NOTA BENE: pl_delete is completly UNSUPPORTED
 
 > empty playlist:
   ?command=pl_empty
@@ -127,11 +128,11 @@ vlm_cmd.xml:
 
 equalizer.xml:
 =============
->command=preamp&val=<val in dB> 
+>command=preamp&val=<val in dB>
  sets the preamp value, must be >=-20 and <=20
 
 >command=equalizer&band=<band>&val=<gain in dB, must be >=-20 and <=20)
 
 <Displays the equalizer band gains.
-Band 0: 60 Hz, 1: 170 Hz, 2: 310 Hz, 3: 600 Hz, 4: 1 kHz, 
+Band 0: 60 Hz, 1: 170 Hz, 2: 310 Hz, 3: 600 Hz, 4: 1 kHz,
 5: 3 kHz, 6: 6 kHz, 7: 12 kHz , 8: 14 kHz , 9: 16 kHz
index 3900454d3d53e75ef101082f57dace343bbd5226..d5b49ac5c34bbaac4c2392f7a94f0fa69c88bf54 100644 (file)
@@ -83,8 +83,7 @@ elseif command == "pl_next" then
 elseif command == "pl_previous" then
   vlc.playlist.prev()
 elseif command == "pl_delete" then
-  vlc.msg.err("FIXME: pl_delete unimplemented")
-  --vlc.playlist.delete(id)
+  vlc.playlist.delete(id)
 elseif command == "pl_empty" then
   vlc.playlist.clear()
 elseif command == "pl_sort" then