[vlc-devel] commit: Add a function to get the current playlist item in the lua interface. ( Antoine Cellerier )

git version control git at videolan.org
Sat Mar 8 16:16:55 CET 2008


vlc | branch: master | Antoine Cellerier <dionoea at videolan.org> | Sat Mar  8 15:37:31 2008 +0100| [f4514d7d0f2fd2c85dd0e0933478cc60a85346e6]

Add a function to get the current playlist item in the lua interface.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f4514d7d0f2fd2c85dd0e0933478cc60a85346e6
---

 modules/misc/lua/intf.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/modules/misc/lua/intf.c b/modules/misc/lua/intf.c
index 48dee62..2f63a9f 100644
--- a/modules/misc/lua/intf.c
+++ b/modules/misc/lua/intf.c
@@ -585,6 +585,14 @@ static int vlclua_playlist_search( lua_State *L )
     return 1;
 }
 
+static int vlclua_playlist_current( lua_State *L )
+{
+    playlist_t *p_playlist = vlclua_get_playlist_internal( L );
+    lua_pushinteger( L, var_GetInteger( p_playlist, "playlist-current" ) );
+    vlc_object_release( p_playlist );
+    return 1;
+}
+
 static int vlc_sort_key_from_string( const char *psz_name )
 {
     static const struct
@@ -794,6 +802,7 @@ static luaL_Reg p_reg_playlist[] =
     { "get", vlclua_playlist_get },
     { "search", vlclua_playlist_search },
     { "sort", vlclua_playlist_sort },
+    { "current", vlclua_playlist_current },
 
     { "stats", vlclua_input_stats },
 




More information about the vlc-devel mailing list