Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

vlc_osd.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * vlc_osd.h - OSD menu definitions and function prototypes
00003  *****************************************************************************
00004  * Copyright (C) 2004-2005 M2X
00005  * $Id: vlc_osd.h 9451 2004-12-01 01:07:08Z jpsaman $
00006  *
00007  * Authors: Jean-Paul Saman <jpsaman #_at_# m2x dot nl>
00008  *
00009  * Added code from include/osd.h written by:
00010  * Copyright (C) 2003-2005 the VideoLAN team
00011  * Authors: Sigmund Augdal Helberg <[email protected]>
00012  *
00013  * This program is free software; you can redistribute it and/or modify
00014  * it under the terms of the GNU General Public License as published by
00015  * the Free Software Foundation; either version 2 of the License, or
00016  * (at your option) any later version.
00017  *
00018  * This program is distributed in the hope that it will be useful,
00019  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00021  * GNU General Public License for more details.
00022  *
00023  * You should have received a copy of the GNU General Public License
00024  * along with this program; if not, write to the Free Software
00025  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
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;    /*< pointer to next state */
00156     osd_state_t *p_prev;    /*< pointer to previous state */
00157     picture_t   *p_pic;     /*< picture of state */
00158     
00159     char        *psz_state; /*< state name */
00160     int          i_state;   /*< state index */ 
00161 };
00162 
00168 struct osd_button_t
00169 {
00170     osd_button_t *p_next;   /*< pointer to next button */
00171     osd_button_t *p_prev;   /*< pointer to previous button */
00172     osd_button_t *p_up;     /*< pointer to up button */
00173     osd_button_t *p_down;   /*< pointer to down button */
00174     
00175     osd_state_t *p_current_state; /*< pointer to current state image */
00176     osd_state_t *p_states; /*< doubly linked list of states */
00177     picture_t   *p_feedback; /*< feedback picture */
00178         
00179     char    *psz_name;     /*< name of button */
00180     
00181     /* These member should probably be a struct hotkey */
00182     char    *psz_action;      /*< hotkey action name on button*/
00183     char    *psz_action_down; /*< hotkey action name on range buttons for command "menu down" */
00184     /* end of hotkey specifics */
00185     
00186     int     i_x;            /*< x-position of button visible state image */
00187     int     i_y;            /*< y-position of button visible state image */ 
00188     
00189     /* range style button */    
00190     vlc_bool_t   b_range;    /*< button should be interpreted as range */
00191     int          i_ranges;   /*< number of states */
00192 };
00193 
00199 /* Represent the menu state */
00200 struct osd_menu_state_t
00201 {
00202     int     i_x;        /*< x position of spu region */
00203     int     i_y;        /*< y position of spu region */
00204     int     i_width;    /*< width of spu region */
00205     int     i_height;   /*< height of spu region */    
00206     
00207     picture_t    *p_pic;  /*< pointer to picture to display */
00208     osd_button_t *p_visible; /*< shortcut to visible button */
00209     
00210     vlc_bool_t b_menu_visible; /*< menu currently visible? */
00211     vlc_bool_t b_update;       /*< update OSD Menu when VLC_TRUE */
00212     
00213     /* quick hack to volume state. */
00214     osd_button_t *p_volume; /*< pointer to volume range object. */
00215 };
00216 
00224 struct osd_menu_t
00225 {
00226     VLC_COMMON_MEMBERS
00227     
00228     int     i_x;        /*< x-position of OSD Menu on the video screen */ 
00229     int     i_y;        /*< y-position of OSD Menu on the video screen */ 
00230     int     i_width;    /*< width of OSD Menu on the video screen */ 
00231     int     i_height;   /*< height of OSD Menu on the video screen */ 
00232     
00233     char             *psz_path;  /*< directory where OSD menu images are stored */
00234     osd_button_t     *p_button;  /*< doubly linked list of buttons */
00235     osd_menu_state_t *p_state;   /*< current state of OSD menu */
00236         
00237     /* quick link in the linked list. */
00238     osd_button_t  *p_last_button; /*< pointer to last button in the list */
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 /* _VLC_OSD_H */

Generated on Tue Dec 20 10:14:19 2005 for vlc-0.8.4a by  doxygen 1.4.2