qt: playlist: use item title if available
[vlc.git] / modules / lua / libs / video.c
blob8f14651994a50078e7844e335418401a3b546d04
1 /*****************************************************************************
2 * video.c: Generic lua interface functions
3 *****************************************************************************
4 * Copyright (C) 2007-2008 the VideoLAN team
6 * Authors: Antoine Cellerier <dionoea at videolan tod org>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
21 *****************************************************************************/
23 /*****************************************************************************
24 * Preamble
25 *****************************************************************************/
26 #ifndef _GNU_SOURCE
27 # define _GNU_SOURCE
28 #endif
30 #ifdef HAVE_CONFIG_H
31 # include "config.h"
32 #endif
34 #include <vlc_vout.h>
36 #include "../vlc.h"
37 #include "../libs.h"
38 #include "input.h"
39 #include "variables.h"
41 /*****************************************************************************
42 * Vout control
43 *****************************************************************************/
44 static int vlclua_fullscreen( lua_State *L )
46 int i_ret;
48 vout_thread_t *p_vout = vlclua_get_vout_internal(L);
49 if( !p_vout )
50 return vlclua_error( L );
52 i_ret = vlclua_var_toggle_or_set( L, p_vout, "fullscreen" );
54 vout_Release(p_vout);
55 return i_ret;
58 /*****************************************************************************
60 *****************************************************************************/
61 static const luaL_Reg vlclua_video_reg[] = {
62 { "fullscreen", vlclua_fullscreen },
63 { NULL, NULL }
66 void luaopen_video( lua_State *L )
68 lua_newtable( L );
69 luaL_register( L, NULL, vlclua_video_reg );
70 lua_setfield( L, -2, "video" );