Commit bcf42772 authored by Antoine Cellerier's avatar Antoine Cellerier

src/*, include/* : update core functions. (Should make it relatively easy

                   to use in interfaces)
                   The downloadable plugins part still needs some work.

modules/control/rc.c : add function to query updates (mainly used for testing)

modules/gui/wxwidgets/* : update pannel.
parent 67d1feb2
......@@ -131,6 +131,7 @@ HEADERS_include = \
include/vlc_symbols.h \
include/vlc_threads_funcs.h \
include/vlc_threads.h \
include/vlc_update.h \
include/vlc_video.h \
include/vlc_vlm.h \
include/vlc_vod.h \
......@@ -466,6 +467,7 @@ SOURCES_libvlc_common = \
src/misc/objects.c \
src/misc/variables.c \
src/misc/error.c \
src/misc/update.c \
src/misc/vlm.c \
src/misc/xml.c \
src/misc/version.c \
......
......@@ -416,12 +416,16 @@ typedef struct vlm_schedule_t vlm_schedule_t;
/* divers */
typedef struct vlc_meta_t vlc_meta_t;
/* Stats */
typedef struct counter_t counter_t;
typedef struct counter_sample_t counter_sample_t;
typedef struct stats_handler_t stats_handler_t;
typedef struct input_stats_t input_stats_t;
typedef struct global_stats_t global_stats_t;
/* Update */
typedef struct update_t update_t;
typedef struct update_iterator_t update_iterator_t;
/*****************************************************************************
* Variable callbacks
......
......@@ -84,6 +84,7 @@ void __intf_UserHide (vlc_object_t *, int);
int __config_LoadConfigFile (vlc_object_t *, const char *);
int vlc_asprintf (char **, const char *, ...);
int __var_Change (vlc_object_t *, const char *, int, vlc_value_t *, vlc_value_t *);
update_iterator_t * update_iterator_New (update_t *);
int playlist_Disable (playlist_t *, playlist_item_t *);
char * vlc_input_item_GetInfo (input_item_t *p_i, const char *psz_cat,const char *psz_name);
int vout_VarCallback (vlc_object_t *, const char *, vlc_value_t, vlc_value_t, void *);
......@@ -91,6 +92,7 @@ session_descriptor_t* sout_AnnounceSessionCreate (void);
void __osd_Volume (vlc_object_t *);
int vlc_vasprintf (char **, const char *, va_list);
int playlist_Sort (playlist_t *, int, int);
void update_Check (update_t *, vlc_bool_t);
int aout_DecDelete (aout_instance_t *, aout_input_t *);
int vlc_strcasecmp (const char *s1, const char *s2);
sout_packetizer_input_t * sout_InputNew (sout_instance_t *, es_format_t *);
......@@ -136,6 +138,7 @@ stream_t * __stream_UrlNew (vlc_object_t *p_this, const char *psz_url);
sout_mux_t * sout_MuxNew (sout_instance_t*, char *, sout_access_out_t *);
stream_t * __stream_DemuxNew (vlc_object_t *p_obj, char *psz_demux, es_out_t *out);
int vout_ShowTextRelative (vout_thread_t *, int, char *, text_style_t *, int, int, int, mtime_t);
unsigned int update_iterator_Action (update_iterator_t *, int);
void __stats_TimerDump (vlc_object_t*, const char *);
int block_FifoPut (block_fifo_t *, block_t *);
int playlist_ItemAddParent (playlist_item_t *, int,playlist_item_t *);
......@@ -161,6 +164,7 @@ int httpd_UrlCatch (httpd_url_t *, int i_msg, httpd_callback_t, httpd_callback_s
void __vlc_object_yield (vlc_object_t *);
const char * VLC_CompileBy (void);
playlist_item_t * playlist_LockItemGetByPos (playlist_t *, int);
void update_Delete (update_t *);
input_thread_t * __input_CreateThread (vlc_object_t *, input_item_t *);
const char * DecodeLanguage (uint16_t);
int __aout_VolumeSet (vlc_object_t *, audio_volume_t);
......@@ -220,6 +224,7 @@ void __stats_ComputeGlobalStats (vlc_object_t*,global_stats_t*);
char * vlc_strndup (const char *s, size_t n);
void vout_PlacePicture (vout_thread_t *, unsigned int, unsigned int, unsigned int *, unsigned int *, unsigned int *, unsigned int *);
float __config_GetFloat (vlc_object_t *, const char *);
void update_iterator_Delete (update_iterator_t *);
playlist_item_t * playlist_ItemGetById (playlist_t *, int);
const char * vlc_gai_strerror (int);
void net_ListenClose (int *fd);
......@@ -345,6 +350,7 @@ int playlist_PreparseEnqueue (playlist_t *, input_item_t *);
aout_buffer_t * aout_FifoPop (aout_instance_t * p_aout, aout_fifo_t * p_fifo);
int __vout_InitPicture (vlc_object_t *p_this, picture_t *p_pic, uint32_t i_chroma, int i_width, int i_height, int i_aspect);
int playlist_LockClear (playlist_t *);
unsigned int update_iterator_ChooseMirrorAndFile (update_iterator_t *, int, int, int);
void intf_InteractionManage (playlist_t *);
char * mstrtime (char *psz_buffer, mtime_t date);
void aout_FormatPrepare (audio_sample_format_t * p_format);
......@@ -356,6 +362,7 @@ xml_t * __xml_Create (vlc_object_t *);
msg_subscription_t* __msg_Subscribe (vlc_object_t *, int);
const char * VLC_Version (void);
session_descriptor_t* sout_AnnounceRegisterSDP (sout_instance_t *,const char *, const char *, announce_method_t*);
update_t * __update_New (vlc_object_t *);
char * stream_ReadLine (stream_t *);
int playlist_PreparseEnqueueItem (playlist_t *, playlist_item_t *);
void __osd_MenuPrev (vlc_object_t *);
......@@ -364,6 +371,7 @@ module_t * config_FindModule (vlc_object_t *, const char *);
void aout_VolumeSoftInit (aout_instance_t *);
void block_FifoRelease (block_fifo_t *);
void block_FifoEmpty (block_fifo_t *);
void update_download (update_iterator_t *, char *);
int playlist_ItemAddOption (playlist_item_t *, const char *);
void aout_VolumeNoneInit (aout_instance_t *);
void aout_DateInit (audio_date_t *, uint32_t);
......@@ -903,6 +911,14 @@ struct module_symbols_t
void (*__stats_ComputeGlobalStats_inner) (vlc_object_t*,global_stats_t*);
void (*__stats_TimerStop_inner) (vlc_object_t*, const char *);
void (*__stats_TimersDumpAll_inner) (vlc_object_t*);
update_iterator_t * (*update_iterator_New_inner) (update_t *);
void (*update_Check_inner) (update_t *, vlc_bool_t);
unsigned int (*update_iterator_Action_inner) (update_iterator_t *, int);
void (*update_Delete_inner) (update_t *);
void (*update_iterator_Delete_inner) (update_iterator_t *);
unsigned int (*update_iterator_ChooseMirrorAndFile_inner) (update_iterator_t *, int, int, int);
update_t * (*__update_New_inner) (vlc_object_t *);
void (*update_download_inner) (update_iterator_t *, char *);
};
# if defined (__PLUGIN__)
# define aout_FiltersCreatePipeline (p_symbols)->aout_FiltersCreatePipeline_inner
......@@ -1339,6 +1355,14 @@ struct module_symbols_t
# define __stats_ComputeGlobalStats (p_symbols)->__stats_ComputeGlobalStats_inner
# define __stats_TimerStop (p_symbols)->__stats_TimerStop_inner
# define __stats_TimersDumpAll (p_symbols)->__stats_TimersDumpAll_inner
# define update_iterator_New (p_symbols)->update_iterator_New_inner
# define update_Check (p_symbols)->update_Check_inner
# define update_iterator_Action (p_symbols)->update_iterator_Action_inner
# define update_Delete (p_symbols)->update_Delete_inner
# define update_iterator_Delete (p_symbols)->update_iterator_Delete_inner
# define update_iterator_ChooseMirrorAndFile (p_symbols)->update_iterator_ChooseMirrorAndFile_inner
# define __update_New (p_symbols)->__update_New_inner
# define update_download (p_symbols)->update_download_inner
# elif defined (HAVE_DYNAMIC_PLUGINS) && !defined (__BUILTIN__)
/******************************************************************
* STORE_SYMBOLS: store VLC APIs into p_symbols for plugin access.
......@@ -1778,6 +1802,14 @@ struct module_symbols_t
((p_symbols)->__stats_ComputeGlobalStats_inner) = __stats_ComputeGlobalStats; \
((p_symbols)->__stats_TimerStop_inner) = __stats_TimerStop; \
((p_symbols)->__stats_TimersDumpAll_inner) = __stats_TimersDumpAll; \
((p_symbols)->update_iterator_New_inner) = update_iterator_New; \
((p_symbols)->update_Check_inner) = update_Check; \
((p_symbols)->update_iterator_Action_inner) = update_iterator_Action; \
((p_symbols)->update_Delete_inner) = update_Delete; \
((p_symbols)->update_iterator_Delete_inner) = update_iterator_Delete; \
((p_symbols)->update_iterator_ChooseMirrorAndFile_inner) = update_iterator_ChooseMirrorAndFile; \
((p_symbols)->__update_New_inner) = __update_New; \
((p_symbols)->update_download_inner) = update_download; \
(p_symbols)->net_ConvertIPv4_deprecated = NULL; \
(p_symbols)->__stats_CounterGet_deprecated = NULL; \
(p_symbols)->__stats_TimerDumpAll_deprecated = NULL; \
......
/*****************************************************************************
* vlc_update.h: VLC update and plugins download
*****************************************************************************
* Copyright (C) 2005 the VideoLAN team
* $Id: $
*
* Authors: Antoine Cellerier <dionoea -at- videolan -dot- 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 release 2 of the License, or
* (at your option) any later release.
*
* 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., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#ifndef _VLC_UPDATE_H
#define _VLC_UPDATE_H
#include <vlc/vlc.h>
#define UPDATE_FILE_TYPE_ALL (~0)
#define UPDATE_FILE_TYPE_NONE 0
#define UPDATE_FILE_TYPE_UNDEF 1
#define UPDATE_FILE_TYPE_INFO 2
#define UPDATE_FILE_TYPE_SOURCE 4
#define UPDATE_FILE_TYPE_BINARY 8
#define UPDATE_FILE_TYPE_PLUGIN 16
#define UPDATE_RELEASE_STATUS_ALL (~0)
#define UPDATE_RELEASE_STATUS_NONE 0
#define UPDATE_RELEASE_STATUS_OLDER 1
#define UPDATE_RELEASE_STATUS_EQUAL 2
#define UPDATE_RELEASE_STATUS_NEWER 4
#define UPDATE_RELEASE_TYPE_STABLE 1
#define UPDATE_RELEASE_TYPE_TESTING 2
#define UPDATE_RELEASE_TYPE_UNSTABLE 4
#define UPDATE_FAIL 0
#define UPDATE_SUCCESS 1
#define UPDATE_NEXT 0
#define UPDATE_PREV 2
#define UPDATE_MIRROR 4
#define UPDATE_RELEASE 8
#define UPDATE_FILE 16
#define UPDATE_RESET 32
/**
* Describes an update file
*/
struct update_file_t
{
int i_type; //< File type
char* psz_md5; //< MD5 hash
long int l_size; //< File size in bytes
char* psz_url; //< Relative (to a mirror) or absolute url
char* psz_description; //< Plain text description
};
/**
* Describes an update VLC release number
*/
struct update_release_t
{
char* psz_major; //< Version major string
char* psz_minor; //< Version minor string
char* psz_revision; //< Version revision string
char* psz_extra; //< Version extra string
char* psz_svn_revision; //< SVN revision
int i_type; //< Release type
int i_status; //< Release status compared to current VLC version
struct update_file_t* p_files; //< Files list
int i_files; //< Number of files in the files list
};
/**
* Describes a mirror
*/
struct update_mirror_t
{
char *psz_name; //< Mirror name
char *psz_location; //< Mirror geographical location
char *psz_type; //< Mirror type (FTP, HTTP, ...)
char *psz_base_url; //< Mirror base url
};
/**
* The update object. Stores (and caches) all information relative to updates
*/
struct update_t
{
vlc_t *p_vlc;
vlc_mutex_t lock;
struct update_release_t *p_releases; //< Releases (version) list
int i_releases; //< Number of releases
vlc_bool_t b_releases; //< True if we have a releases list
struct update_mirror_t *p_mirrors; //< Mirrors list
int i_mirrors; //< Number of mirrors
vlc_bool_t b_mirrors; //< True if we have a mirrors list
};
/**
* The update iterator structure. Usefull to browse the update object seamlessly
*/
struct update_iterator_t
{
update_t *p_u; //< Pointer to VLC update object
int i_r; //< Position in the releases list
int i_f; //< Position in the release's files list
int i_m; //< Position in the mirrors list
int i_t; //< File type bitmask
int i_rs; //< Release status bitmask
int i_rt; //< Release type bitmask
struct
{
int i_type; //< Type
char* psz_md5; //< MD5 hash
long int l_size; //< Size in bytes
char* psz_url; //< Absolute URL
char* psz_description; //< Description
} file; //< Local 'copy' of the current file's information
struct
{
char *psz_version; //< Version string
char *psz_svn_revision; //< SVN revision
int i_status; //< Status
int i_type; //< Type
} release; //< Local 'copy' of the current release's information
struct
{
char *psz_name; //< Name
char *psz_location; //< Geographical location
char *psz_type; //< Type (HTTP, FTP, ...)
} mirror; //< Local 'copy' of the current mirror's information
};
#define update_New( a ) __update_New( VLC_OBJECT( a ) )
VLC_EXPORT( update_t *, __update_New, ( vlc_object_t * ) );
VLC_EXPORT( void, update_Delete, (update_t * ) );
VLC_EXPORT( void, update_Check, ( update_t *, vlc_bool_t ) );
VLC_EXPORT( update_iterator_t *, update_iterator_New, ( update_t * ) );
VLC_EXPORT( void, update_iterator_Delete, ( update_iterator_t * ) );
VLC_EXPORT( unsigned int, update_iterator_Action, ( update_iterator_t *, int ) );
VLC_EXPORT( unsigned int, update_iterator_ChooseMirrorAndFile, ( update_iterator_t *, int, int, int ) );
VLC_EXPORT( void, update_download, ( update_iterator_t *, char * ) );
#endif
......@@ -39,6 +39,7 @@
#include <vlc/vout.h>
#include <vlc_video.h>
#include <vlc_osd.h>
#include <vlc_update.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
......@@ -95,6 +96,7 @@ static int AudioConfig ( vlc_object_t *, char const *,
vlc_value_t, vlc_value_t, void * );
static int Menu ( vlc_object_t *, char const *,
vlc_value_t, vlc_value_t, void * );
static void checkUpdates( intf_thread_t *p_intf, char *psz_arg );
/* Status Callbacks */
static int TimeOffsetChanged( vlc_object_t *, char const *,
......@@ -350,7 +352,7 @@ static void Deactivate( vlc_object_t *p_this )
#endif
free( p_intf->p_sys->psz_unix_path );
}
vlc_mutex_destroy( &p_intf->p_sys->status_lock );
vlc_mutex_destroy( &p_intf->p_sys->status_lock );
free( p_intf->p_sys );
}
......@@ -459,7 +461,7 @@ static void RegisterCallbacks( intf_thread_t *p_intf )
/* OSD menu commands */
var_Create( p_intf, "menu", VLC_VAR_STRING | VLC_VAR_ISCOMMAND );
var_AddCallback( p_intf, "menu", Menu, NULL );
var_AddCallback( p_intf, "menu", Menu, NULL );
/* DVD commands */
var_Create( p_intf, "pause", VLC_VAR_VOID | VLC_VAR_ISCOMMAND );
......@@ -793,6 +795,10 @@ static void Run( intf_thread_t *p_intf )
Help( p_intf, b_longhelp );
}
else if( !strcmp( psz_cmd, "check-updates" ) )
{
checkUpdates( p_intf, psz_arg );
}
else switch( psz_cmd[0] )
{
case 'f':
......@@ -944,6 +950,9 @@ static void Help( intf_thread_t *p_intf, vlc_bool_t b_longhelp)
msg_rc(_("| mosaic-cols #. . . . . . . . . . .number of cols"));
msg_rc(_("| mosaic-keep-aspect-ratio {0,1} . . .aspect ratio"));
msg_rc( "| ");
msg_rc(_("| check-updates [newer] [equal] [older]\n"
"| [undef] [info] [source] [binary] [plugin]"));
msg_rc( "| ");
}
msg_rc(_("| help . . . . . . . . . . . . . this help message"));
msg_rc(_("| longhelp . . . . . . . . . a longer help message"));
......@@ -1245,7 +1254,7 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd,
if( p_playlist->p_input )
{
vlc_value_t val;
var_Get( p_playlist->p_input, "rate", &val );
if( val.i_int != INPUT_RATE_DEFAULT )
{
......@@ -1260,10 +1269,10 @@ static int Playlist( vlc_object_t *p_this, char const *psz_cmd,
}
else if (!strcmp( psz_cmd, "goto" ) )
{
if( strlen( newval.psz_string ) > 0)
if( strlen( newval.psz_string ) > 0)
{
val.i_int = atoi( newval.psz_string );
playlist_Goto( p_playlist, val.i_int);
playlist_Goto( p_playlist, val.i_int);
}
}
else if( !strcmp( psz_cmd, "stop" ) )
......@@ -1387,7 +1396,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd,
val.psz_string = newval.psz_string;
var_Set( p_input->p_libvlc, "marq-marquee", val );
}
else
else
{
val.psz_string = "";
var_Set( p_input->p_libvlc, "marq-marquee", val);
......@@ -1395,7 +1404,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd,
}
else if( !strcmp( psz_cmd, "marq-x" ) )
{
if( strlen( newval.psz_string ) > 0)
if( strlen( newval.psz_string ) > 0)
{
val.i_int = atoi( newval.psz_string );
var_Set( p_input->p_libvlc, "marq-x", val );
......@@ -1403,7 +1412,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd,
}
else if( !strcmp( psz_cmd, "marq-y" ) )
{
if( strlen( newval.psz_string ) > 0)
if( strlen( newval.psz_string ) > 0)
{
val.i_int = atoi( newval.psz_string );
var_Set( p_input->p_libvlc, "marq-y", val );
......@@ -1411,7 +1420,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd,
}
else if( !strcmp( psz_cmd, "marq-position" ) )
{
if( strlen( newval.psz_string ) > 0)
if( strlen( newval.psz_string ) > 0)
{
val.i_int = atoi( newval.psz_string );
var_Set( p_input->p_libvlc, "marq-position", val );
......@@ -1419,7 +1428,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd,
}
else if( !strcmp( psz_cmd, "marq-color" ) )
{
if( strlen( newval.psz_string ) > 0)
if( strlen( newval.psz_string ) > 0)
{
val.i_int = strtol( newval.psz_string, NULL, 0 );
var_Set( p_input->p_libvlc, "marq-color", val );
......@@ -1427,7 +1436,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd,
}
else if( !strcmp( psz_cmd, "marq-opacity" ) )
{
if( strlen( newval.psz_string ) > 0)
if( strlen( newval.psz_string ) > 0)
{
val.i_int = strtol( newval.psz_string, NULL, 0 );
var_Set( p_input->p_libvlc, "marq-opacity", val );
......@@ -1435,7 +1444,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd,
}
else if( !strcmp( psz_cmd, "marq-size" ) )
{
if( strlen( newval.psz_string ) > 0)
if( strlen( newval.psz_string ) > 0)
{
val.i_int = atoi( newval.psz_string );
var_Set( p_input->p_libvlc, "marq-size", val );
......@@ -1443,7 +1452,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd,
}
else if( !strcmp( psz_cmd, "marq-timeout" ) )
{
if( strlen( newval.psz_string ) > 0)
if( strlen( newval.psz_string ) > 0)
{
val.i_int = atoi( newval.psz_string );
var_Set( p_input, "marq-timeout", val );
......@@ -1552,7 +1561,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd,
val.psz_string = newval.psz_string;
var_Set( p_input->p_libvlc, "time-format", val );
}
else
else
{
val.psz_string = "";
var_Set( p_input->p_libvlc, "time-format", val);
......@@ -1560,7 +1569,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd,
}
else if( !strcmp( psz_cmd, "time-x" ) )
{
if( strlen( newval.psz_string ) > 0)
if( strlen( newval.psz_string ) > 0)
{
val.i_int = atoi( newval.psz_string );
var_Set( p_input->p_libvlc, "time-x", val );
......@@ -1568,7 +1577,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd,
}
else if( !strcmp( psz_cmd, "time-y" ) )
{
if( strlen( newval.psz_string ) > 0)
if( strlen( newval.psz_string ) > 0)
{
val.i_int = atoi( newval.psz_string );
var_Set( p_input->p_libvlc, "time-y", val );
......@@ -1576,7 +1585,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd,
}
else if( !strcmp( psz_cmd, "time-position" ) )
{
if( strlen( newval.psz_string ) > 0)
if( strlen( newval.psz_string ) > 0)
{
val.i_int = atoi( newval.psz_string );
var_Set( p_input->p_libvlc, "time-position", val );
......@@ -1584,7 +1593,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd,
}
else if( !strcmp( psz_cmd, "time-color" ) )
{
if( strlen( newval.psz_string ) > 0)
if( strlen( newval.psz_string ) > 0)
{
val.i_int = strtol( newval.psz_string, NULL, 0 );
var_Set( p_input->p_libvlc, "time-color", val );
......@@ -1592,7 +1601,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd,
}
else if( !strcmp( psz_cmd, "time-opacity" ) )
{
if( strlen( newval.psz_string ) > 0)
if( strlen( newval.psz_string ) > 0)
{
val.i_int = strtol( newval.psz_string, NULL, 0 );
var_Set( p_input->p_libvlc, "time-opacity", val );
......@@ -1600,7 +1609,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd,
}
else if( !strcmp( psz_cmd, "time-size" ) )
{
if( strlen( newval.psz_string ) > 0)
if( strlen( newval.psz_string ) > 0)
{
val.i_int = atoi( newval.psz_string );
var_Set( p_input->p_libvlc, "time-size", val );
......@@ -1616,7 +1625,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd,
}
else if( !strcmp( psz_cmd, "logo-x" ) )
{
if( strlen( newval.psz_string ) > 0)
if( strlen( newval.psz_string ) > 0)
{
val.i_int = atoi( newval.psz_string );
var_Set( p_input->p_libvlc, "logo-x", val );
......@@ -1624,7 +1633,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd,
}
else if( !strcmp( psz_cmd, "logo-y" ) )
{
if( strlen( newval.psz_string ) > 0)
if( strlen( newval.psz_string ) > 0)
{
val.i_int = atoi( newval.psz_string );
var_Set( p_input->p_libvlc, "logo-y", val );
......@@ -1632,7 +1641,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd,
}
else if( !strcmp( psz_cmd, "logo-position" ) )
{
if( strlen( newval.psz_string ) > 0)
if( strlen( newval.psz_string ) > 0)
{
val.i_int = atoi( newval.psz_string );
var_Set( p_input->p_libvlc, "logo-position", val );
......@@ -1640,7 +1649,7 @@ static int Other( vlc_object_t *p_this, char const *psz_cmd,
}
else if( !strcmp( psz_cmd, "logo-transparency" ) )
{
if( strlen( newval.psz_string ) > 0)
if( strlen( newval.psz_string ) > 0)
{
val.i_int = strtol( newval.psz_string, NULL, 0 );
var_Set( p_input->p_libvlc, "logo-transparency", val );
......@@ -2150,3 +2159,120 @@ static playlist_item_t *parse_MRL( intf_thread_t *p_intf, char *psz_mrl )
return p_item;
}
/*****************************************************************************
* checkUpdates : check for updates
****************************************************************************/
static void checkUpdates( intf_thread_t *p_intf, char *psz_arg )
{
update_iterator_t *p_uit;
update_t *p_u = update_New( p_intf );
if( p_u == NULL ) return;
p_uit = update_iterator_New( p_u );
if( p_uit )
{
int s = 0, t = 0;
if( strstr( psz_arg, "newer" ) )
s |= UPDATE_RELEASE_STATUS_NEWER;
if( strstr( psz_arg, "equal" ) )
s |= UPDATE_RELEASE_STATUS_EQUAL;
if( strstr( psz_arg, "older" ) )
s |= UPDATE_RELEASE_STATUS_OLDER;
if( s ) p_uit->i_rs = s;
else p_uit->i_rs = UPDATE_RELEASE_STATUS_NEWER;
if( strstr( psz_arg, "undef" ) )
t |= UPDATE_FILE_TYPE_UNDEF;
if( strstr( psz_arg, "info" ) )
t |= UPDATE_FILE_TYPE_INFO;
if( strstr( psz_arg, "source" ) )
t |= UPDATE_FILE_TYPE_SOURCE;
if( strstr( psz_arg, "binary" ) )
t |= UPDATE_FILE_TYPE_BINARY;
if( strstr( psz_arg, "plugin" ) )
t |= UPDATE_FILE_TYPE_PLUGIN;
if( t ) p_uit->i_t = t;
update_Check( p_u, VLC_FALSE );
update_iterator_Action( p_uit, UPDATE_MIRROR );
msg_rc( "\nUsing mirror: %s (%s) [%s]",
p_uit->mirror.psz_name,
p_uit->mirror.psz_location,
p_uit->mirror.psz_type );
while( (s = update_iterator_Action( p_uit, UPDATE_FILE )) != UPDATE_FAIL )
{
char *psz_tmp;
if( s & UPDATE_RELEASE )
{
switch( p_uit->release.i_status )
{
case UPDATE_RELEASE_STATUS_OLDER:
psz_tmp = strdup( "older" );
break;
case UPDATE_RELEASE_STATUS_EQUAL:
psz_tmp = strdup( "equal" );
break;
case UPDATE_RELEASE_STATUS_NEWER:
psz_tmp = strdup( "newer" );
break;
default:
psz_tmp = strdup( "?!?" );
break;
}
msg_rc( "\n+----[ VLC %s %s (%s) ] ",
p_uit->release.psz_version,
p_uit->release.psz_svn_revision,
psz_tmp );
free( psz_tmp );
}
switch( p_uit->file.i_type )
{
case UPDATE_FILE_TYPE_UNDEF:
psz_tmp = strdup( "undef" );
break;
case UPDATE_FILE_TYPE_INFO:
psz_tmp = strdup( "info" );
break;
case UPDATE_FILE_TYPE_SOURCE:
psz_tmp = strdup( "source" );
break;
case UPDATE_FILE_TYPE_BINARY:
psz_tmp = strdup( "binary" );
break;
case UPDATE_FILE_TYPE_PLUGIN:
psz_tmp = strdup( "plugin" );
break;
default:
psz_tmp = strdup( "?!?" );
break;
}
msg_rc( "| %s (%s)", p_uit->file.psz_description, psz_tmp );
free( psz_tmp );
if( p_uit->file.l_size )
{
if( p_uit->file.l_size > 1024 * 1024 * 1024 )
asprintf( &psz_tmp, "(%ld GB)",
p_uit->file.l_size / (1024*1024*1024) );
if( p_uit->file.l_size > 1024 * 1024 )
asprintf( &psz_tmp, "(%ld MB)",
p_uit->file.l_size / (1024*1024) );
else if( p_uit->file.l_size > 1024 )
asprintf( &psz_tmp, "(%ld kB)",
p_uit->file.l_size / 1024 );
else
asprintf( &psz_tmp, "(%ld B)", p_uit->file.l_size );
}
else
{
psz_tmp = strdup( "" );
}
msg_rc( "| %s %s", p_uit->file.psz_url, psz_tmp );
msg_rc( "+----" );
free( psz_tmp );
}
msg_rc( "" );
update_iterator_Delete( p_uit );
}
update_Delete( p_u );
}
/* XPM */
static char * update_ascii_xpm[] = {
"34 34 96 2",
" c None",
". c #BCBCBC",
"+ c #F7F7F7",
"@ c #F3F3F3",
"# c #F1F1F1",
"$ c #EFEFEF",
"% c #ECECEC",
"& c #EAEAEA",
"* c #E9E9E9",
"= c #C2C2C2",
"- c #808080",
"; c #FFFFFF",
"> c #FEFEFE",
", c #FBFBFB",
"' c #F2F2F2",
") c #EEEEEE",
"! c #E3E3E3",
"~ c #BDBDBD",
"{ c #C0C0C0",
"] c #BBBBBB",
"^ c #B6B6B6",
"/ c #AFAFAF",
"( c #A2A2A2",
"_ c #8E8E8E",
": c #828282",
"< c #FCFCFC",
"[ c #F8F8F8",
"} c #AEAEAE",
"| c #A9A9A9",
"1 c #9E9E9E",
"2 c #C4C4C4",
"3 c #BABABA",
"4 c #CACACA",
"5 c #C9C9C9",
"6 c #B5B5B5",
"7 c #F9F9F9",
"8 c #E0E0E0",
"9 c #CCCCCC",
"0 c #BEBEBE",
"a c #FDFDFD",
"b c #FAFAFA",
"c c #F5F5F5",
"d c #BFBFBF",
"e c #A0A0A0",
"f c #D5D5D5",
"g c #C6C6C6",
"h c #F4F4F4",
"i c #C1C1C1",
"j c #E1E1E1",
"k c #DBDBDB",
"l c #CECECE",
"m c #F6F6F6",