Commit 781ff751 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Lua: set playlist object explicitly in state

parent 3ccae49f
......@@ -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 \
......
......@@ -37,7 +37,6 @@
#include "vlc.h"
#include "libs.h"
#include "libs/playlist.h"
/*****************************************************************************
......
......@@ -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 );
......
......@@ -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 );
......
......@@ -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
......
......@@ -41,7 +41,6 @@
#include "../vlc.h"
#include "input.h"
#include "playlist.h"
#include "../libs.h"
#include "../extension.h"
......
......@@ -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
*****************************************************************************/
......
......@@ -38,7 +38,6 @@
#include "../vlc.h"
#include "../libs.h"
#include "objects.h"
#include "playlist.h"
#include "input.h"
/*****************************************************************************
......
......@@ -40,18 +40,8 @@
#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 );
......
/*****************************************************************************
* 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
......@@ -41,7 +41,6 @@
#include "../vlc.h"
#include "../libs.h"
#include "playlist.h"
/*****************************************************************************
*
......
......@@ -41,7 +41,6 @@
#include "../vlc.h"
#include "../libs.h"
#include "playlist.h"
/*****************************************************************************
* Volume related
......
......@@ -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
*****************************************************************************/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment