Lua: set playlist object explicitly in state
authorRémi Denis-Courmont <remi@remlab.net>
Sun, 5 Jan 2014 11:39:30 +0000 (13:39 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Sun, 5 Jan 2014 11:41:58 +0000 (13:41 +0200)
13 files changed:
modules/lua/Makefile.am
modules/lua/demux.c
modules/lua/extension.c
modules/lua/intf.c
modules/lua/libs/equalizer.c
modules/lua/libs/input.c
modules/lua/libs/misc.c
modules/lua/libs/objects.c
modules/lua/libs/playlist.c
modules/lua/libs/playlist.h [deleted file]
modules/lua/libs/sd.c
modules/lua/libs/volume.c
modules/lua/vlc.h

index 673fc69..38a1b8d 100644 (file)
@@ -20,7 +20,7 @@ liblua_plugin_la_SOURCES = \
        lua/libs/net.c \
        lua/libs/objects.c lua/libs/objects.h \
        lua/libs/osd.c \
-       lua/libs/playlist.c lua/libs/playlist.h \
+       lua/libs/playlist.c \
        lua/libs/sd.c \
        lua/libs/stream.c \
        lua/libs/strings.c \
index a84fd66..c46c3f9 100644 (file)
@@ -37,7 +37,6 @@
 
 #include "vlc.h"
 #include "libs.h"
-#include "libs/playlist.h"
 
 
 /*****************************************************************************
index 291c4bb..6913fa1 100644 (file)
@@ -808,6 +808,7 @@ static lua_State* GetLuaState( extensions_manager_t *p_mgr,
             return NULL;
         }
         vlclua_set_this( L, p_mgr );
+        vlclua_set_playlist_internal( L, pl_Get(p_mgr) );
         vlclua_extension_set( L, p_ext );
 
         luaL_openlibs( L );
index 5df4492..f23eed3 100644 (file)
@@ -242,6 +242,7 @@ static int Start_LuaIntf( vlc_object_t *p_this, const char *name )
     }
 
     vlclua_set_this( L, p_intf );
+    vlclua_set_playlist_internal( L, pl_Get(p_intf) );
 
     luaL_openlibs( L );
 
index e2e8aa3..512bae1 100644 (file)
@@ -40,7 +40,6 @@
 #include "input.h"
 #include "../libs.h"
 #include "../vlc.h"
-#include "playlist.h"
 #include "../../audio_filter/equalizer_presets.h"
 
 #if !defined _WIN32
index 3e347bf..1cceb28 100644 (file)
@@ -41,7 +41,6 @@
 
 #include "../vlc.h"
 #include "input.h"
-#include "playlist.h"
 #include "../libs.h"
 #include "../extension.h"
 
index b2e0839..81b5a7e 100644 (file)
@@ -73,6 +73,16 @@ vlc_object_t * vlclua_get_this( lua_State *L )
     return vlclua_get_object( L, vlclua_set_this );
 }
 
+void vlclua_set_playlist_internal( lua_State *L, playlist_t *pl )
+{
+    vlclua_set_object( L, vlclua_set_playlist_internal, pl );
+}
+
+playlist_t *vlclua_get_playlist_internal( lua_State *L )
+{
+    return vlclua_get_object( L, vlclua_set_playlist_internal );
+}
+
 /*****************************************************************************
  * VLC error code translation
  *****************************************************************************/
index 287a42c..6517816 100644 (file)
@@ -38,7 +38,6 @@
 #include "../vlc.h"
 #include "../libs.h"
 #include "objects.h"
-#include "playlist.h"
 #include "input.h"
 
 /*****************************************************************************
index 29f5e4b..8dfd048 100644 (file)
 #include "../vlc.h"
 #include "../libs.h"
 #include "input.h"
-#include "playlist.h"
 #include "variables.h"
 
-/*****************************************************************************
- * Internal lua<->vlc utils
- *****************************************************************************/
-playlist_t *vlclua_get_playlist_internal( lua_State *L )
-{
-    vlc_object_t *p_this = vlclua_get_this( L );
-    return pl_Get( p_this );
-}
-
 static int vlclua_playlist_prev( lua_State * L )
 {
     playlist_t *p_playlist = vlclua_get_playlist_internal( L );
diff --git a/modules/lua/libs/playlist.h b/modules/lua/libs/playlist.h
deleted file mode 100644 (file)
index 5015c4c..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*****************************************************************************
- * playlist.h
- *****************************************************************************
- * Copyright (C) 2007-2008 the VideoLAN team
- * $Id$
- *
- * Authors: Antoine Cellerier <dionoea at videolan tod org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifndef VLC_LUA_PLAYLIST_H
-#define VLC_LUA_PLAYLIST_H
-
-playlist_t *vlclua_get_playlist_internal( lua_State * );
-
-#endif
-
index fa4d7bf..4bbf1d7 100644 (file)
@@ -41,7 +41,6 @@
 
 #include "../vlc.h"
 #include "../libs.h"
-#include "playlist.h"
 
 /*****************************************************************************
  *
index 6b9409f..b361647 100644 (file)
@@ -41,7 +41,6 @@
 
 #include "../vlc.h"
 #include "../libs.h"
-#include "playlist.h"
 
 /*****************************************************************************
  * Volume related
index d98f7fc..16bea84 100644 (file)
@@ -113,6 +113,9 @@ void vlclua_set_this( lua_State *, vlc_object_t * );
 #define vlclua_set_this(a, b) vlclua_set_this(a, VLC_OBJECT(b))
 vlc_object_t * vlclua_get_this( lua_State * );
 
+void vlclua_set_playlist_internal( lua_State *, playlist_t * );
+playlist_t * vlclua_get_playlist_internal( lua_State * );
+
 /*****************************************************************************
  * Lua function bridge
  *****************************************************************************/