Browse Source

Lua: set playlist object explicitly in state

pull/10/head
Rémi Denis-Courmont 13 years ago
parent
commit
781ff75140
  1. 2
      modules/lua/Makefile.am
  2. 1
      modules/lua/demux.c
  3. 1
      modules/lua/extension.c
  4. 1
      modules/lua/intf.c
  5. 1
      modules/lua/libs/equalizer.c
  6. 1
      modules/lua/libs/input.c
  7. 10
      modules/lua/libs/misc.c
  8. 1
      modules/lua/libs/objects.c
  9. 10
      modules/lua/libs/playlist.c
  10. 30
      modules/lua/libs/playlist.h
  11. 1
      modules/lua/libs/sd.c
  12. 1
      modules/lua/libs/volume.c
  13. 3
      modules/lua/vlc.h

2
modules/lua/Makefile.am

@ -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 \

1
modules/lua/demux.c

@ -37,7 +37,6 @@
#include "vlc.h"
#include "libs.h"
#include "libs/playlist.h"
/*****************************************************************************

1
modules/lua/extension.c

@ -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 );

1
modules/lua/intf.c

@ -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 );

1
modules/lua/libs/equalizer.c

@ -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

1
modules/lua/libs/input.c

@ -41,7 +41,6 @@
#include "../vlc.h"
#include "input.h"
#include "playlist.h"
#include "../libs.h"
#include "../extension.h"

10
modules/lua/libs/misc.c

@ -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
*****************************************************************************/

1
modules/lua/libs/objects.c

@ -38,7 +38,6 @@
#include "../vlc.h"
#include "../libs.h"
#include "objects.h"
#include "playlist.h"
#include "input.h"
/*****************************************************************************

10
modules/lua/libs/playlist.c

@ -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 );

30
modules/lua/libs/playlist.h

@ -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

1
modules/lua/libs/sd.c

@ -41,7 +41,6 @@
#include "../vlc.h"
#include "../libs.h"
#include "playlist.h"
/*****************************************************************************
*

1
modules/lua/libs/volume.c

@ -41,7 +41,6 @@
#include "../vlc.h"
#include "../libs.h"
#include "playlist.h"
/*****************************************************************************
* Volume related

3
modules/lua/vlc.h

@ -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
*****************************************************************************/

Loading…
Cancel
Save