/*****************************************************************************
- * luameta.c: Get meta/artwork using lua scripts
+ * vlclua.c: Generic lua inteface functions
*****************************************************************************
- * Copyright (C) 2006 the VideoLAN team
- * $Id: luameta.c 21327 2007-08-20 19:23:10Z courmisch $
+ * Copyright (C) 2007 the VideoLAN team
+ * $Id$
*
* Authors: Antoine Cellerier <dionoea at videolan tod org>
* Pierre d'Herbemont <pdherbemont # videolan.org>
*****************************************************************************/
vlc_module_begin();
- add_shortcut( "lua" );
+ add_shortcut( "luameta" );
+ set_shortname( N_( "Lua Meta" ) );
+ set_description( _("Fetch metadata using lua scripts") );
+ set_capability( "meta fetcher", 10 );
+ set_callbacks( E_(FindMeta), NULL );
add_submodule();
- add_shortcut( "luameta" );
- set_shortname( N_( "Lua Meta" ) );
- set_description( _("Fetch Artwork using lua scripts") );
- set_capability( "meta fetcher", 10 );
- set_callbacks( E_(FindMeta), NULL );
- add_submodule();
- set_capability( "art finder", 10 );
- set_callbacks( E_(FindArt), NULL );
+ set_shortname( N_( "Lua Art" ) );
+ set_description( _("Fetch artwork using lua scripts") );
+ set_capability( "art finder", 10 );
+ set_callbacks( E_(FindArt), NULL );
add_submodule();
add_shortcut( "luaplaylist" );
set_category( CAT_INPUT );
set_subcategory( SUBCAT_INPUT_DEMUX );
-
set_shortname( _("Lua Playlist") );
set_description( _("Lua Playlist Parser Interface") );
set_capability( "demux2", 9 );
char *ppsz_dir_list[] = { NULL, NULL, NULL, NULL };
char **ppsz_dir;
- if( asprintf( &ppsz_dir_list[0], "%s" DIR_SEP CONFIG_DIR DIR_SEP "%s", p_this->p_libvlc->psz_homedir,
- luadirname ) < 0 )
+ if( asprintf( &ppsz_dir_list[0], "%s" DIR_SEP "%s",
+ p_this->p_libvlc->psz_datadir, luadirname ) < 0 )
return VLC_ENOMEM;
# if defined(__APPLE__) || defined(SYS_BEOS) || defined(WIN32)
return VLC_ENOMEM;
}
# else
- if( asprintf( &ppsz_dir_list[1],
+ if( asprintf( &ppsz_dir_list[1],
"share" DIR_SEP "%s", luadirname ) < 0 )
return VLC_ENOMEM;
# ifdef HAVE_SYS_STAT_H
- {
+ {
struct stat stat_info;
if( ( utf8_stat( ppsz_dir_list[1], &stat_info ) == -1 )
|| !S_ISDIR( stat_info.st_mode ) )
{
free(ppsz_dir_list[1]);
- if( asprintf( &ppsz_dir_list[1],
+ if( asprintf( &ppsz_dir_list[1],
DATA_PATH DIR_SEP "%s", luadirname ) < 0 )
return VLC_ENOMEM;
}
for( ppsz_file = ppsz_filelist; ppsz_file < ppsz_fileend; ppsz_file++ )
{
char *psz_filename;
- if( asprintf( &psz_filename,
+ if( asprintf( &psz_filename,
"%s" DIR_SEP "%s", *ppsz_dir, *ppsz_file ) < 0)
return VLC_ENOMEM;
msg_Dbg( p_this, "Trying Lua playlist script %s", psz_filename );
-
+
i_ret = func( p_this, psz_filename, p_state, user_data );
-
+
free( psz_filename );
if( i_ret == VLC_SUCCESS ) break;