00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00060 #ifndef _VLC_OSD_H
00061 #define _VLC_OSD_H 1
00062
00063 #include "vlc_video.h"
00064
00065 # ifdef __cplusplus
00066 extern "C" {
00067 # endif
00068
00106 #define OSD_ALIGN_LEFT 0x1
00107 #define OSD_ALIGN_RIGHT 0x2
00108 #define OSD_ALIGN_TOP 0x4
00109 #define OSD_ALIGN_BOTTOM 0x8
00110
00111 #define OSD_HOR_SLIDER 1
00112 #define OSD_VERT_SLIDER 2
00113
00114 #define OSD_PLAY_ICON 1
00115 #define OSD_PAUSE_ICON 2
00116 #define OSD_SPEAKER_ICON 3
00117 #define OSD_MUTE_ICON 4
00118
00123 struct text_style_t
00124 {
00125 int i_size;
00126 uint32_t i_color;
00127 vlc_bool_t b_italic;
00128 vlc_bool_t b_bold;
00129 vlc_bool_t b_underline;
00130 };
00131 static const text_style_t default_text_style = { 22, 0xffffff, VLC_FALSE, VLC_FALSE, VLC_FALSE };
00132
00143 #define OSD_BUTTON_UNSELECT 0
00144 #define OSD_BUTTON_SELECT 1
00145 #define OSD_BUTTON_PRESSED 2
00146
00153 struct osd_state_t
00154 {
00155 osd_state_t *p_next;
00156 osd_state_t *p_prev;
00157 picture_t *p_pic;
00158
00159 char *psz_state;
00160 int i_state;
00161 };
00162
00168 struct osd_button_t
00169 {
00170 osd_button_t *p_next;
00171 osd_button_t *p_prev;
00172 osd_button_t *p_up;
00173 osd_button_t *p_down;
00174
00175 osd_state_t *p_current_state;
00176 osd_state_t *p_states;
00177 picture_t *p_feedback;
00178
00179 char *psz_name;
00180
00181
00182 char *psz_action;
00183 char *psz_action_down;
00184
00185
00186 int i_x;
00187 int i_y;
00188
00189
00190 vlc_bool_t b_range;
00191 int i_ranges;
00192 };
00193
00199
00200 struct osd_menu_state_t
00201 {
00202 int i_x;
00203 int i_y;
00204 int i_width;
00205 int i_height;
00206
00207 picture_t *p_pic;
00208 osd_button_t *p_visible;
00209
00210 vlc_bool_t b_menu_visible;
00211 vlc_bool_t b_update;
00212
00213
00214 osd_button_t *p_volume;
00215 };
00216
00224 struct osd_menu_t
00225 {
00226 VLC_COMMON_MEMBERS
00227
00228 int i_x;
00229 int i_y;
00230 int i_width;
00231 int i_height;
00232
00233 char *psz_path;
00234 osd_button_t *p_button;
00235 osd_menu_state_t *p_state;
00236
00237
00238 osd_button_t *p_last_button;
00239 };
00240
00247 VLC_EXPORT( osd_menu_t *, __osd_MenuCreate, ( vlc_object_t *, const char * ) );
00248
00255 VLC_EXPORT( void, __osd_MenuDelete, ( vlc_object_t *, osd_menu_t * ) );
00256
00266 VLC_EXPORT( osd_state_t *, __osd_StateChange, ( osd_state_t *, const int ) );
00267
00268 #define osd_MenuCreate(object,file) __osd_MenuCreate( VLC_OBJECT(object), file )
00269 #define osd_MenuDelete(object,osd) __osd_MenuDelete( VLC_OBJECT(object), osd )
00270 #define osd_StateChange(object,value) __osd_StateChange( object, value )
00271
00279 VLC_EXPORT( void, __osd_MenuShow, ( vlc_object_t * ) );
00280
00286 VLC_EXPORT( void, __osd_MenuHide, ( vlc_object_t * ) );
00287
00295 VLC_EXPORT( void, __osd_MenuActivate, ( vlc_object_t * ) );
00296
00297 #define osd_MenuShow(object) __osd_MenuShow( VLC_OBJECT(object) )
00298 #define osd_MenuHide(object) __osd_MenuHide( VLC_OBJECT(object) )
00299 #define osd_MenuActivate(object) __osd_MenuActivate( VLC_OBJECT(object) )
00300
00308 VLC_EXPORT( void, __osd_MenuNext, ( vlc_object_t * ) );
00309
00317 VLC_EXPORT( void, __osd_MenuPrev, ( vlc_object_t * ) );
00318
00326 VLC_EXPORT( void, __osd_MenuUp, ( vlc_object_t * ) );
00327
00335 VLC_EXPORT( void, __osd_MenuDown, ( vlc_object_t * ) );
00336
00337 #define osd_MenuNext(object) __osd_MenuNext( VLC_OBJECT(object) )
00338 #define osd_MenuPrev(object) __osd_MenuPrev( VLC_OBJECT(object) )
00339 #define osd_MenuUp(object) __osd_MenuUp( VLC_OBJECT(object) )
00340 #define osd_MenuDown(object) __osd_MenuDown( VLC_OBJECT(object) )
00341
00348 VLC_EXPORT( void, __osd_Volume, ( vlc_object_t * ) );
00349
00350 #define osd_Volume(object) __osd_Volume( VLC_OBJECT(object) )
00351
00356 static inline const osd_menu_state_t *osd_GetMenuState( osd_menu_t *p_osd )
00357 {
00358 return( p_osd->p_state );
00359 }
00360
00366 static inline vlc_bool_t osd_GetKeyPressed( osd_menu_t *p_osd )
00367 {
00368 return( p_osd->p_state->b_update );
00369 }
00370
00376 static inline void osd_SetKeyPressed( vlc_object_t *p_this, int i_value )
00377 {
00378 vlc_value_t val;
00379
00380 val.i_int = i_value;
00381 var_Set( p_this, "key-pressed", val );
00382 }
00383
00389 static inline void osd_SetMenuVisible( osd_menu_t *p_osd, vlc_bool_t b_value )
00390 {
00391 vlc_value_t val;
00392
00393 val.b_bool = p_osd->p_state->b_menu_visible = b_value;
00394 var_Set( p_osd, "osd-menu-visible", val );
00395 }
00396
00402 static inline void osd_SetMenuUpdate( osd_menu_t *p_osd, vlc_bool_t b_value )
00403 {
00404 vlc_value_t val;
00405
00406 val.b_bool = p_osd->p_state->b_update = b_value;
00407 var_Set( p_osd, "osd-menu-update", val );
00408 }
00409
00418 VLC_EXPORT( int, osd_ShowTextRelative, ( spu_t *, int, char *, text_style_t *, int, int, int, mtime_t ) );
00419 VLC_EXPORT( int, osd_ShowTextAbsolute, ( spu_t *, int, char *, text_style_t *, int, int, int, mtime_t, mtime_t ) );
00420 VLC_EXPORT( void,osd_Message, ( spu_t *, int, char *, ... ) );
00421
00430 VLC_EXPORT( int, osd_Slider, ( vlc_object_t *, spu_t *, int, int, int, int, short ) );
00431 VLC_EXPORT( int, osd_Icon, ( vlc_object_t *, spu_t *, int, int, int, short ) );
00432
00439 VLC_EXPORT( int, osd_ConfigLoader, ( vlc_object_t *, const char *, osd_menu_t ** ) );
00440 VLC_EXPORT( void, osd_ConfigUnload, ( vlc_object_t *, osd_menu_t ** ) );
00441
00442 # ifdef __cplusplus
00443 }
00444 # endif
00445
00446 #endif