#include <vlc_keys.h>
#include <vlc_osd.h>
#include <vlc_image.h>
+#include <vlc_modules.h>
#include "libvlc.h"
if( !p_menu->p_image || !p_menu->psz_file )
{
msg_Err( p_menu, "unable to load images, aborting .." );
- return true;
+ return false;
}
else
{
/**
* Change state on an osd_button_t.
*
- * This function selects the specified state and returns a pointer vlc_custom_createto it. The
- * following states are currently supported:
+ * This function selects the specified state and returns a pointer
+ * vlc_custom_create to it. The following states are currently supported:
* \see OSD_BUTTON_UNSELECT
* \see OSD_BUTTON_SELECT
* \see OSD_BUTTON_PRESSED
osd_state_t *p_temp = NULL;
int i = 0;
- for( i=0; p_current != NULL; i++ )
+ for( i= 0; p_current != NULL; i++ )
{
if( p_current->i_state == i_state )
{
return p_button->p_states;
}
+#undef osd_MenuCreate
/*****************************************************************************
* OSD menu Funtions
*****************************************************************************/
-osd_menu_t *__osd_MenuCreate( vlc_object_t *p_this, const char *psz_file )
+osd_menu_t *osd_MenuCreate( vlc_object_t *p_this, const char *psz_file )
{
osd_menu_t *p_osd = NULL;
vlc_value_t val;
p_lock = osd_GetMutex( p_this );
vlc_mutex_lock( p_lock );
- var_Create( p_this->p_libvlc, "osd", VLC_VAR_ADDRESS );
- var_Get( p_this->p_libvlc, "osd", &val );
+ var_Create( p_this->p_libvlc, "osd-object", VLC_VAR_ADDRESS );
+ var_Get( p_this->p_libvlc, "osd-object", &val );
if( val.p_address == NULL )
{
static const char osdmenu_name[] = "osd menu";
var_SetBool( p_osd, "osd-menu-visible", false );
val.p_address = p_osd;
- var_Set( p_this->p_libvlc, "osd", val );
+ var_Set( p_this->p_libvlc, "osd-object", val );
}
else
p_osd = val.p_address;
error:
vlc_mutex_unlock( p_lock );
- __osd_MenuDelete( p_this, p_osd );
+ osd_MenuDelete( p_this, p_osd );
return NULL;
}
-void __osd_MenuDelete( vlc_object_t *p_this, osd_menu_t *p_osd )
+#undef osd_MenuDelete
+void osd_MenuDelete( vlc_object_t *p_this, osd_menu_t *p_osd )
{
vlc_mutex_t *p_lock;
var_Destroy( p_osd, "osd-menu-update" );
osd_ParserUnload( p_osd );
val.p_address = NULL;
- var_Set( p_this->p_libvlc, "osd", val );
+ var_Set( p_this->p_libvlc, "osd-object", val );
}
vlc_object_release( p_osd );
{
vlc_value_t val;
- if( var_Get( p_this->p_libvlc, "osd", &val ) )
+ if( var_Get( p_this->p_libvlc, "osd-object", &val ) )
return NULL;
return val.p_address;
}
p_state->p_pic = p_pic;
}
-void __osd_MenuShow( vlc_object_t *p_this )
+#undef osd_MenuShow
+void osd_MenuShow( vlc_object_t *p_this )
{
osd_menu_t *p_osd;
osd_button_t *p_button = NULL;
vlc_mutex_unlock( p_lock );
}
-void __osd_MenuHide( vlc_object_t *p_this )
+#undef osd_MenuHide
+void osd_MenuHide( vlc_object_t *p_this )
{
osd_menu_t *p_osd;
vlc_mutex_t *p_lock = osd_GetMutex( p_this );
vlc_mutex_unlock( p_lock );
}
-void __osd_MenuActivate( vlc_object_t *p_this )
+#undef osd_MenuActivate
+void osd_MenuActivate( vlc_object_t *p_this )
{
osd_menu_t *p_osd;
osd_button_t *p_button = NULL;
if( p_button && p_button->p_up )
{
vlc_mutex_unlock( p_lock );
- __osd_MenuUp( p_this ); /* "menu select" means go to menu item above. */
+ osd_MenuUp( p_this ); /* "menu select" means go to menu item above. */
return;
}
if( p_button && p_button->p_down )
{
vlc_mutex_unlock( p_lock );
- __osd_MenuDown( p_this ); /* "menu select" means go to menu item below. */
+ osd_MenuDown( p_this ); /* "menu select" means go to menu item below. */
return;
}
p_button->p_current_state->p_pic );
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 ) );
+ osd_SetKeyPressed( VLC_OBJECT(p_osd->p_libvlc),
+ var_InheritInteger( 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 );
+ msg_Dbg( p_osd, "select (%d, %s)",
+ (int)var_InheritInteger( p_osd, p_button->psz_action ),
+ p_button->psz_action );
#endif
}
vlc_mutex_unlock( p_lock );
}
-void __osd_MenuNext( vlc_object_t *p_this )
+#undef osd_MenuNext
+void osd_MenuNext( vlc_object_t *p_this )
{
osd_menu_t *p_osd;
osd_button_t *p_button = NULL;
vlc_mutex_unlock( p_lock );
}
-void __osd_MenuPrev( vlc_object_t *p_this )
+#undef osd_MenuPrev
+void osd_MenuPrev( vlc_object_t *p_this )
{
osd_menu_t *p_osd;
osd_button_t *p_button = NULL;
vlc_mutex_unlock( p_lock );
}
-void __osd_MenuUp( vlc_object_t *p_this )
+#undef osd_MenuUp
+void osd_MenuUp( vlc_object_t *p_this )
{
osd_menu_t *p_osd;
osd_button_t *p_button = NULL;
*/
if( p_button->b_range )
{
- osd_SetKeyPressed( VLC_OBJECT(p_osd->p_libvlc), config_GetInt(p_osd, p_button->psz_action) );
+ osd_SetKeyPressed( VLC_OBJECT(p_osd->p_libvlc),
+ var_InheritInteger(p_osd, p_button->psz_action) );
#if defined(OSD_MENU_DEBUG)
- msg_Dbg( p_osd, "select (%d, %s)", val.i_int, p_button->psz_action );
+ msg_Dbg( p_osd, "select (%"PRId64", %s)", val.i_int, p_button->psz_action );
#endif
}
}
vlc_mutex_unlock( p_lock );
}
-void __osd_MenuDown( vlc_object_t *p_this )
+#undef osd_MenuDown
+void osd_MenuDown( vlc_object_t *p_this )
{
osd_menu_t *p_osd;
osd_button_t *p_button = NULL;
*/
if( p_button->b_range )
{
- osd_SetKeyPressed( VLC_OBJECT(p_osd->p_libvlc), config_GetInt(p_osd, p_button->psz_action_down) );
+ osd_SetKeyPressed( VLC_OBJECT(p_osd->p_libvlc),
+ var_InheritInteger(p_osd, p_button->psz_action_down) );
#if defined(OSD_MENU_DEBUG)
- msg_Dbg( p_osd, "select (%d, %s)", val.i_int, p_button->psz_action_down );
+ msg_Dbg( p_osd, "select (%"PRId64", %s)", val.i_int, p_button->psz_action_down );
#endif
}
}
return (i_volume/i_volume_step);
}
+#undef osd_Volume
/**
* Display current audio volume bitmap
*
* The OSD Menu audio volume bar is updated to reflect the new audio volume. Call this function
* when the audio volume is updated outside the OSD menu command "menu up", "menu down" or "menu select".
*/
-void __osd_Volume( vlc_object_t *p_this )
+void osd_Volume( vlc_object_t *p_this )
{
osd_menu_t *p_osd;
osd_button_t *p_button = NULL;
vlc_mutex_unlock( p_lock );
}
-osd_button_t *__osd_ButtonFind( vlc_object_t *p_this, int i_x, int i_y,
+#undef osd_ButtonFind
+osd_button_t *osd_ButtonFind( vlc_object_t *p_this, int i_x, int i_y,
int i_window_height, int i_window_width,
int i_scale_width, int i_scale_height )
{
return NULL;
}
+#undef osd_ButtonSelect
/**
* Select the button provided as the new active button
*/
-void __osd_ButtonSelect( vlc_object_t *p_this, osd_button_t *p_button )
+void osd_ButtonSelect( vlc_object_t *p_this, osd_button_t *p_button )
{
osd_menu_t *p_osd;
osd_button_t *p_old;