X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fosd%2Fosd.c;h=87be707d6aabb3be2ce1f28575d52101b1c5950a;hb=33a0f4dd254da4475aad732effac6a0e6e2e424e;hp=1dea9bb8ba34ea593d7dc2cf1ec11cf15d3a230a;hpb=aaf55bf8e4f5066624e63ecb5f9efbef564a3548;p=vlc diff --git a/src/osd/osd.c b/src/osd/osd.c index 1dea9bb8ba..87be707d6a 100644 --- a/src/osd/osd.c +++ b/src/osd/osd.c @@ -29,7 +29,7 @@ # include "config.h" #endif -#include +#include #include #include #include @@ -49,11 +49,11 @@ static const char *ppsz_button_states[] = { "unselect", "select", "pressed" }; static void osd_UpdateState( osd_menu_state_t *, int, int, int, int, picture_t * ); static inline osd_state_t *osd_VolumeStateChange( osd_state_t *, int ); static int osd_VolumeStep( vlc_object_t *, int, int ); -static vlc_bool_t osd_isVisible( osd_menu_t *p_osd ); +static bool osd_isVisible( osd_menu_t *p_osd ); static osd_menu_t *osd_ParserLoad( vlc_object_t *, const char * ); static void osd_ParserUnload( osd_menu_t * ); -static vlc_bool_t osd_isVisible( osd_menu_t *p_osd ) +static bool osd_isVisible( osd_menu_t *p_osd ) { vlc_value_t val; @@ -72,11 +72,8 @@ static osd_menu_t *osd_ParserLoad( vlc_object_t *p_this, const char *psz_file ) p_menu = vlc_custom_create( p_this, sizeof( *p_menu ), VLC_OBJECT_OSDMENU, osdmenu_name ); if( !p_menu ) - { - msg_Err( p_this, "out of memory" ); return NULL; - } - vlc_object_yield( p_menu ); + vlc_object_attach( p_menu, p_this->p_libvlc ); /* Stuff needed for Parser */ @@ -99,7 +96,7 @@ static osd_menu_t *osd_ParserLoad( vlc_object_t *p_this, const char *psz_file ) psz_type = (char*)"import-osd-xml"; p_menu->p_parser = module_Need( p_menu, "osd parser", - psz_type, VLC_TRUE ); + psz_type, true ); if( !p_menu->p_parser ) { osd_ParserUnload( p_menu ); @@ -202,7 +199,7 @@ osd_menu_t *__osd_MenuCreate( vlc_object_t *p_this, const char *psz_file ) var_Create( p_osd, "osd-menu-update", VLC_VAR_BOOL ); var_Create( p_osd, "osd-menu-visible", VLC_VAR_BOOL ); - val.b_bool = VLC_FALSE; + val.b_bool = false; var_Set( p_osd, "osd-menu-update", val ); var_Set( p_osd, "osd-menu-visible", val ); } @@ -233,7 +230,7 @@ void __osd_MenuDelete( vlc_object_t *p_this, osd_menu_t *p_osd ) vlc_mutex_lock( lockval.p_address ); vlc_object_release( p_osd ); - if( p_osd->p_internals->i_refcount > 0 ) + if( vlc_internals( VLC_OBJECT(p_osd) )->i_refcount > 0 ) { vlc_mutex_unlock( lockval.p_address ); return; @@ -313,9 +310,9 @@ void __osd_MenuShow( vlc_object_t *p_this ) p_osd->p_state->p_visible->p_current_state->i_width, p_osd->p_state->p_visible->p_current_state->i_height, p_osd->p_state->p_visible->p_current_state->p_pic ); - osd_SetMenuUpdate( p_osd, VLC_TRUE ); + osd_SetMenuUpdate( p_osd, true ); } - osd_SetMenuVisible( p_osd, VLC_TRUE ); + osd_SetMenuVisible( p_osd, true ); vlc_object_release( (vlc_object_t*) p_osd ); vlc_mutex_unlock( lockval.p_address ); @@ -342,7 +339,7 @@ void __osd_MenuHide( vlc_object_t *p_this ) osd_UpdateState( p_osd->p_state, p_osd->p_state->i_x, p_osd->p_state->i_y, 0, 0, NULL ); - osd_SetMenuUpdate( p_osd, VLC_TRUE ); + osd_SetMenuUpdate( p_osd, true ); vlc_object_release( (vlc_object_t*) p_osd ); vlc_mutex_unlock( lockval.p_address ); @@ -361,7 +358,7 @@ void __osd_MenuActivate( vlc_object_t *p_this ) return; } - if( osd_isVisible( p_osd ) == VLC_FALSE ) + if( osd_isVisible( p_osd ) == false ) { vlc_object_release( (vlc_object_t*) p_osd ); return; @@ -400,8 +397,8 @@ void __osd_MenuActivate( vlc_object_t *p_this ) p_osd->p_state->p_visible->p_current_state->i_width, p_osd->p_state->p_visible->p_current_state->i_height, p_button->p_current_state->p_pic ); - osd_SetMenuUpdate( p_osd, VLC_TRUE ); - osd_SetMenuVisible( p_osd, VLC_TRUE ); + osd_SetMenuUpdate( p_osd, true ); + osd_SetMenuVisible( p_osd, true ); osd_SetKeyPressed( VLC_OBJECT(p_osd->p_libvlc), config_GetInt( p_osd, p_button->psz_action ) ); #if defined(OSD_MENU_DEBUG) msg_Dbg( p_osd, "select (%d, %s)", config_GetInt( p_osd, p_button->psz_action ), p_button->psz_action ); @@ -424,7 +421,7 @@ void __osd_MenuNext( vlc_object_t *p_this ) return; } - if( osd_isVisible( p_osd ) == VLC_FALSE ) + if( osd_isVisible( p_osd ) == false ) { vlc_object_release( (vlc_object_t*) p_osd ); return; @@ -452,7 +449,7 @@ void __osd_MenuNext( vlc_object_t *p_this ) p_osd->p_state->p_visible->p_current_state->i_width, p_osd->p_state->p_visible->p_current_state->i_height, p_osd->p_state->p_visible->p_current_state->p_pic ); - osd_SetMenuUpdate( p_osd, VLC_TRUE ); + osd_SetMenuUpdate( p_osd, true ); } #if defined(OSD_MENU_DEBUG) msg_Dbg( p_osd, "direction right [button %s]", p_osd->p_state->p_visible->psz_action ); @@ -475,7 +472,7 @@ void __osd_MenuPrev( vlc_object_t *p_this ) return; } - if( osd_isVisible( p_osd ) == VLC_FALSE ) + if( osd_isVisible( p_osd ) == false ) { vlc_object_release( (vlc_object_t*) p_osd ); return; @@ -503,7 +500,7 @@ void __osd_MenuPrev( vlc_object_t *p_this ) p_osd->p_state->p_visible->p_current_state->i_width, p_osd->p_state->p_visible->p_current_state->i_height, p_osd->p_state->p_visible->p_current_state->p_pic ); - osd_SetMenuUpdate( p_osd, VLC_TRUE ); + osd_SetMenuUpdate( p_osd, true ); } #if defined(OSD_MENU_DEBUG) msg_Dbg( p_osd, "direction left [button %s]", p_osd->p_state->p_visible->psz_action ); @@ -528,7 +525,7 @@ void __osd_MenuUp( vlc_object_t *p_this ) return; } - if( osd_isVisible( p_osd ) == VLC_FALSE ) + if( osd_isVisible( p_osd ) == false ) { vlc_object_release( (vlc_object_t*) p_osd ); return; @@ -564,7 +561,7 @@ void __osd_MenuUp( vlc_object_t *p_this ) p_osd->p_state->p_visible->p_current_state->i_width, p_osd->p_state->p_visible->p_current_state->i_height, p_osd->p_state->p_visible->p_current_state->p_pic ); - osd_SetMenuUpdate( p_osd, VLC_TRUE ); + osd_SetMenuUpdate( p_osd, true ); /* If this is a range style action with associated images of only one state, * then perform "menu select" on every menu navigation */ @@ -600,7 +597,7 @@ void __osd_MenuDown( vlc_object_t *p_this ) return; } - if( osd_isVisible( p_osd ) == VLC_FALSE ) + if( osd_isVisible( p_osd ) == false ) { vlc_object_release( (vlc_object_t*) p_osd ); return; @@ -636,7 +633,7 @@ void __osd_MenuDown( vlc_object_t *p_this ) p_osd->p_state->p_visible->p_current_state->i_width, p_osd->p_state->p_visible->p_current_state->i_height, p_osd->p_state->p_visible->p_current_state->p_pic ); - osd_SetMenuUpdate( p_osd, VLC_TRUE ); + osd_SetMenuUpdate( p_osd, true ); /* If this is a range style action with associated images of only one state, * then perform "menu select" on every menu navigation */ @@ -706,12 +703,12 @@ void __osd_Volume( vlc_object_t *p_this ) p_button->p_current_state->i_width, p_button->p_current_state->i_height, p_button->p_current_state->p_pic ); - osd_SetMenuUpdate( p_osd, VLC_TRUE ); - osd_SetMenuVisible( p_osd, VLC_TRUE ); + osd_SetMenuUpdate( p_osd, true ); + osd_SetMenuVisible( p_osd, true ); } - vlc_object_release( (vlc_object_t*) p_osd ); vlc_mutex_unlock( lockval.p_address ); } + vlc_object_release( p_osd ); } osd_button_t *__osd_ButtonFind( vlc_object_t *p_this, int i_x, int i_y, @@ -729,7 +726,7 @@ osd_button_t *__osd_ButtonFind( vlc_object_t *p_this, int i_x, int i_y, return NULL; } - if( osd_isVisible( p_osd ) == VLC_FALSE ) + if( osd_isVisible( p_osd ) == false ) { vlc_object_release( (vlc_object_t*) p_osd ); return NULL; @@ -811,7 +808,7 @@ void __osd_ButtonSelect( vlc_object_t *p_this, osd_button_t *p_button ) return; } - if( osd_isVisible( p_osd ) == VLC_FALSE ) + if( osd_isVisible( p_osd ) == false ) { vlc_object_release( (vlc_object_t*) p_osd ); return; @@ -836,7 +833,7 @@ void __osd_ButtonSelect( vlc_object_t *p_this, osd_button_t *p_button ) p_osd->p_state->p_visible->p_current_state->i_width, p_osd->p_state->p_visible->p_current_state->i_height, p_osd->p_state->p_visible->p_current_state->p_pic ); - osd_SetMenuUpdate( p_osd, VLC_TRUE ); + osd_SetMenuUpdate( p_osd, true ); } #if defined(OSD_MENU_DEBUG) msg_Dbg( p_osd, "button selected is [button %s]", p_osd->p_state->p_visible->psz_action );