X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fvisualization%2Fxosd%2Fxosd.c;h=136e20baea2aa19a25015781f33a5f1582e92bdb;hb=a1e813777408263806ec177c14eedcfe871d6160;hp=fe5a0e8ff5e62873c25117b142a2dce973e32abd;hpb=cfa5300a5b2ae10812c6f518243f6a090d3b735c;p=vlc diff --git a/modules/visualization/xosd/xosd.c b/modules/visualization/xosd/xosd.c index fe5a0e8ff5..136e20baea 100644 --- a/modules/visualization/xosd/xosd.c +++ b/modules/visualization/xosd/xosd.c @@ -2,7 +2,7 @@ * xosd.c : X On Screen Display interface ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: xosd.c,v 1.4 2003/01/22 16:41:15 lool Exp $ + * $Id: xosd.c,v 1.9 2003/03/30 18:14:39 gbazin Exp $ * * Authors: Loïc Minier * @@ -72,15 +72,16 @@ static void Run ( intf_thread_t * ); #define FONT_LONGTEXT N_("Font used to display text in the xosd output") vlc_module_begin(); - add_category_hint( N_("XOSD module"), NULL ); - add_bool( "xosd-position", 1, NULL, POSITION_TEXT, POSITION_LONGTEXT ); - add_integer( "xosd-text-offset", 0, NULL, TXT_OFS_TEXT, TXT_OFS_LONGTEXT ); + int i = getenv( "DISPLAY" ) == NULL ? 10 : 90; + add_category_hint( N_("XOSD module"), NULL, VLC_TRUE ); + add_bool( "xosd-position", 1, NULL, POSITION_TEXT, POSITION_LONGTEXT, VLC_TRUE ); + add_integer( "xosd-text-offset", 0, NULL, TXT_OFS_TEXT, TXT_OFS_LONGTEXT, VLC_TRUE ); add_integer( "xosd-shadow-offset", 1, NULL, - SHD_OFS_TEXT, SHD_OFS_LONGTEXT ); + SHD_OFS_TEXT, SHD_OFS_LONGTEXT, VLC_TRUE ); add_string( "xosd-font", "-misc-fixed-medium-r-*-*-*-300-*-*-*-*-*-*", - NULL, FONT_TEXT, FONT_LONGTEXT ); - set_description( _("xosd interface module") ); - set_capability( "interface", 40 ); + NULL, FONT_TEXT, FONT_LONGTEXT, VLC_TRUE ); + set_description( _("xosd interface") ); + set_capability( "interface", i ); set_callbacks( Open, Close ); vlc_module_end(); @@ -107,7 +108,7 @@ static int Open( vlc_object_t *p_this ) /* Initialize library */ p_intf->p_sys->p_osd = -#ifdef HAVE_OLD_XOSD_H +#if defined(HAVE_XOSD_VERSION_0) || defined(HAVE_XOSD_VERSION_1) xosd_init( config_GetPsz( p_intf, "xosd-font" ), "LawnGreen", 3, XOSD_top, 0, 1 ); #else @@ -189,8 +190,15 @@ static void Run( intf_thread_t *p_intf ) /* Set user preferences */ xosd_set_font( p_intf->p_sys->p_osd, config_GetPsz( p_intf, "xosd-font" ) ); +#ifdef HAVE_XOSD_VERSION_2 + xosd_set_horizontal_offset( p_intf->p_sys->p_osd, + config_GetInt( p_intf, "xosd-text-offset" ) ); + xosd_set_vertical_offset( p_intf->p_sys->p_osd, + config_GetInt( p_intf, "xosd-text-offset" ) ); +#else xosd_set_offset( p_intf->p_sys->p_osd, config_GetInt( p_intf, "xosd-text-offset" ) ); +#endif xosd_set_shadow_offset( p_intf->p_sys->p_osd, config_GetInt( p_intf, "xosd-shadow-offset" )); xosd_set_pos( p_intf->p_sys->p_osd,