vlc_osd.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * vlc_osd.h - OSD menu and subpictures definitions and function prototypes
00003  *****************************************************************************
00004  * Copyright (C) 1999-2006 the VideoLAN team
00005  * Copyright (C) 2004-2005 M2X
00006  * $Id$
00007  *
00008  * Authors: Jean-Paul Saman <jpsaman #_at_# m2x dot nl>
00009  *          Gildas Bazin <gbazin@videolan.org>
00010  *
00011  * Added code from include/osd.h written by:
00012  * Copyright (C) 2003-2005 the VideoLAN team
00013  * Authors: Sigmund Augdal Helberg <dnumgis@videolan.org>
00014  *
00015  * This program is free software; you can redistribute it and/or modify
00016  * it under the terms of the GNU General Public License as published by
00017  * the Free Software Foundation; either version 2 of the License, or
00018  * (at your option) any later version.
00019  *
00020  * This program is distributed in the hope that it will be useful,
00021  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00022  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023  * GNU General Public License for more details.
00024  *
00025  * You should have received a copy of the GNU General Public License
00026  * along with this program; if not, write to the Free Software
00027  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
00028  *****************************************************************************/
00029 
00030 #ifndef VLC_OSD_H
00031 #define VLC_OSD_H 1
00032 
00033 #include "vlc_vout.h"
00034 
00035 # ifdef __cplusplus
00036 extern "C" {
00037 # endif
00038 
00039 /**********************************************************************
00040  * Base SPU structures
00041  **********************************************************************/
00042 /**
00043  * \defgroup spu Subpicture Unit
00044  * This module describes the programming interface for the subpicture unit.
00045  * It includes functions allowing to create/destroy an spu, create/destroy
00046  * subpictures and render them.
00047  * @{
00048  */
00049 
00050 #include <vlc_vout.h>
00051 
00052 /**
00053  * Subpicture unit descriptor
00054  */
00055 struct spu_t
00056 {
00057     VLC_COMMON_MEMBERS
00058 
00059     vlc_mutex_t  subpicture_lock;                  /**< subpicture heap lock */
00060     subpicture_t p_subpicture[VOUT_MAX_SUBPICTURES];        /**< subpictures */
00061     int i_channel;             /**< number of subpicture channels registered */
00062 
00063     filter_t *p_blend;                            /**< alpha blending module */
00064     filter_t *p_text;                              /**< text renderer module */
00065     filter_t *p_scale_yuvp;                     /**< scaling module for YUVP */
00066     filter_t *p_scale;                    /**< scaling module (all but YUVP) */
00067     bool b_force_crop;                     /**< force cropping of subpicture */
00068     int i_crop_x, i_crop_y, i_crop_width, i_crop_height;       /**< cropping */
00069 
00070     int i_margin;                        /**< force position of a subpicture */
00071     bool b_force_palette;             /**< force palette of subpicture */
00072     uint8_t palette[4][4];                               /**< forced palette */
00073 
00074     int ( *pf_control ) ( spu_t *, int, va_list );
00075 
00076     /* Supciture filters */
00077     filter_chain_t *p_chain;
00078 };
00079 
00080 static inline int spu_vaControl( spu_t *p_spu, int i_query, va_list args )
00081 {
00082     if( p_spu->pf_control )
00083         return p_spu->pf_control( p_spu, i_query, args );
00084     else
00085         return VLC_EGENERIC;
00086 }
00087 
00088 static inline int spu_Control( spu_t *p_spu, int i_query, ... )
00089 {
00090     va_list args;
00091     int i_result;
00092 
00093     va_start( args, i_query );
00094     i_result = spu_vaControl( p_spu, i_query, args );
00095     va_end( args );
00096     return i_result;
00097 }
00098 
00099 enum spu_query_e
00100 {
00101     SPU_CHANNEL_REGISTER,         /* arg1= int *   res=    */
00102     SPU_CHANNEL_CLEAR             /* arg1= int     res=    */
00103 };
00104 
00105 #define spu_Create(a) __spu_Create(VLC_OBJECT(a))
00106 VLC_EXPORT( spu_t *, __spu_Create, ( vlc_object_t * ) );
00107 VLC_EXPORT( int, spu_Init, ( spu_t * ) );
00108 VLC_EXPORT( void, spu_Destroy, ( spu_t * ) );
00109 void spu_Attach( spu_t *, vlc_object_t *, bool );
00110 
00111 VLC_EXPORT( subpicture_t *, spu_CreateSubpicture, ( spu_t * ) );
00112 VLC_EXPORT( void, spu_DestroySubpicture, ( spu_t *, subpicture_t * ) );
00113 VLC_EXPORT( void, spu_DisplaySubpicture, ( spu_t *, subpicture_t * ) );
00114 
00115 #define spu_CreateRegion(a,b) __spu_CreateRegion(VLC_OBJECT(a),b)
00116 VLC_EXPORT( subpicture_region_t *,__spu_CreateRegion, ( vlc_object_t *, video_format_t * ) );
00117 #define spu_MakeRegion(a,b,c) __spu_MakeRegion(VLC_OBJECT(a),b,c)
00118 VLC_EXPORT( subpicture_region_t *,__spu_MakeRegion, ( vlc_object_t *, video_format_t *, picture_t * ) );
00119 #define spu_DestroyRegion(a,b) __spu_DestroyRegion(VLC_OBJECT(a),b)
00120 VLC_EXPORT( void, __spu_DestroyRegion, ( vlc_object_t *, subpicture_region_t * ) );
00121 VLC_EXPORT( subpicture_t *, spu_SortSubpictures, ( spu_t *, mtime_t, bool ) );
00122 VLC_EXPORT( void, spu_RenderSubpictures, ( spu_t *,  video_format_t *, picture_t *, picture_t *, subpicture_t *, int, int ) );
00123 
00124 /** @}*/
00125 
00126 /**********************************************************************
00127  * OSD Menu
00128  **********************************************************************/
00129 /**
00130  * \defgroup osdmenu OSD Menu
00131  * The OSD menu core creates the OSD menu structure in memory. It parses a
00132  * configuration file that defines all elements that are part of the menu. The
00133  * core also handles all actions and menu structure updates on behalf of video
00134  * subpicture filters.
00135  *
00136  * The file modules/video_filters/osdmenu.c implements a subpicture filter that
00137  * specifies the final information on positioning of the current state image.
00138  * A subpicture filter is called each time a video picture has to be rendered,
00139  * it also gives a start and end date to the subpicture. The subpicture can be
00140  * streamed if used inside a transcoding command. For example:
00141  *
00142  *  vlc dvdsimple:///dev/dvd --extraintf rc
00143  *  --sout='#transcode{osd}:std{access=udp,mux=ts,dst=dest_ipaddr}'
00144  *  --osdmenu-file=share/osdmenu/dvd.cfg
00145  *
00146  * An example for local usage of the OSD menu is:
00147  *
00148  *  vlc dvdsimple:///dev/dvd --extraintf rc
00149  *  --sub-filter osdmenu
00150  *  --osdmenu-file=share/osdmenu/dvd.cfg
00151  *
00152  * Each OSD menu element, called "action", defines a hotkey action. Each action
00153  * can have several states (unselect, select, pressed). Each state has an image
00154  * that represents the state visually. The commands "menu right", "menu left",
00155  * "menu up" and "menu down" are used to navigate through the OSD menu structure.
00156  * The commands "menu on" or "menu show" and "menu off" or "menu hide" respectively
00157  * show and hide the OSD menu subpictures.
00158  *
00159  * There is one special element called "range". A range is an arbritary range
00160  * of state images that can be browsed using "menu up" and "menu down" commands
00161  * on the rc interface.
00162  *
00163  * The OSD menu configuration file uses a very simple syntax and basic parser.
00164  * A configuration file has the ".cfg".
00165  * An example is "share/osdmenu/dvd256.cfg".
00166  * @{
00167  */
00168 
00169 /**
00170  * \brief The OSD Menu configuration file format.
00171  *
00172  * The configuration file syntax is very basic and so is its parser. See the
00173  * BNF formal representation below:
00174  *
00175  * The keywords FILENAME and PATHNAME represent the filename and pathname
00176  * specification that is valid for the Operating System VLC is compiled for.
00177  *
00178  * The hotkey actions that are supported by VLC are documented in the file
00179  * src/libvlc. The file include/vlc_keys.h defines some hotkey internals.
00180  *
00181  * CONFIG_FILE = FILENAME '.cfg'
00182  * WS = [ ' ' | '\t' ]+
00183  * OSDMENU_PATH = PATHNAME
00184  * DIR = 'dir' WS OSDMENU_PATH '\n'
00185  * STYLE = 'style' [ 'default' | 'concat' ] '\n'
00186  * STATE = [ 'unselect' | 'select' | 'pressed' ]
00187  * HOTKEY_ACTION = 'key-' [ 'a' .. 'z', 'A' .. 'Z', '-' ]+
00188  *
00189  * ACTION_TYPE        = 'type' 'volume' '\n'
00190  * ACTION_BLOCK_START = 'action' WS HOTKEY_ACTION WS '('POS','POS')' '\n'
00191  * ACTION_BLOCK_END   = 'end' '\n'
00192  * ACTION_STATE       = STATE WS FILENAME '\n'
00193  * ACTION_RANGE_START = 'range' WS HOTKEY_ACTION WS DEFAULT_INDEX '\n'
00194  * ACTION_RANGE_END   = 'end' '\n'
00195  * ACTION_RANGE_STATE = FILENAME '\n'
00196  *
00197  * ACTION_BLOCK_RANGE = ACTION_RANGE_START [WS ACTION_RANGE_STATE]+ WS ACTION_RANGE_END
00198  * ACTION_BLOCK = ACTION_BLOCK_START [WS ACTION_TYPE*] [ [WS ACTION_STATE]+3 | [WS ACTION_BLOCK_RANGE]+1 ] ACTION_BLOCK_END
00199  * CONFIG_FILE_CONTENTS = DIR [ACTION_BLOCK]+
00200  *
00201  */
00202 
00203 /**
00204  * OSD menu position and picture type defines
00205  */
00206 
00207 #define OSD_ALIGN_LEFT 0x1
00208 #define OSD_ALIGN_RIGHT 0x2
00209 #define OSD_ALIGN_TOP 0x4
00210 #define OSD_ALIGN_BOTTOM 0x8
00211 
00212 #define OSD_HOR_SLIDER 1
00213 #define OSD_VERT_SLIDER 2
00214 
00215 #define OSD_PLAY_ICON 1
00216 #define OSD_PAUSE_ICON 2
00217 #define OSD_SPEAKER_ICON 3
00218 #define OSD_MUTE_ICON 4
00219 
00220 /**
00221  * Text style
00222  *
00223  * A text style is used to specify the formatting of text.
00224  * A font renderer can use the supplied information to render the
00225  * text specified.
00226  */
00227 struct text_style_t
00228 {
00229     char *     psz_fontname;      /**< The name of the font */
00230     int        i_font_size;       /**< The font size in pixels */
00231     int        i_font_color;      /**< The color of the text 0xRRGGBB
00232                                        (native endianness) */
00233     int        i_font_alpha;      /**< The transparency of the text.
00234                                        0x00 is fully opaque,
00235                                        0xFF fully transparent */
00236     int        i_style_flags;     /**< Formatting style flags */
00237     int        i_outline_color;   /**< The color of the outline 0xRRGGBB */
00238     int        i_outline_alpha;   /**< The transparency of the outline.
00239                                        0x00 is fully opaque,
00240                                        0xFF fully transparent */
00241     int        i_shadow_color;    /**< The color of the shadow 0xRRGGBB */
00242     int        i_shadow_alpha;    /**< The transparency of the shadow.
00243                                         0x00 is fully opaque,
00244                                         0xFF fully transparent */
00245     int        i_background_color;/**< The color of the background 0xRRGGBB */
00246     int        i_background_alpha;/**< The transparency of the background.
00247                                        0x00 is fully opaque,
00248                                        0xFF fully transparent */
00249     int        i_karaoke_background_color;/**< Background color for karaoke 0xRRGGBB */
00250     int        i_karaoke_background_alpha;/**< The transparency of the karaoke bg.
00251                                        0x00 is fully opaque,
00252                                        0xFF fully transparent */
00253     int        i_outline_width;   /**< The width of the outline in pixels */
00254     int        i_shadow_width;    /**< The width of the shadow in pixels */
00255     int        i_spacing;         /**< The spaceing between glyphs in pixels */
00256 };
00257 
00258 /* Style flags for \ref text_style_t */
00259 #define STYLE_BOLD        1
00260 #define STYLE_ITALIC      2
00261 #define STYLE_OUTLINE     4
00262 #define STYLE_SHADOW      8
00263 #define STYLE_BACKGROUND  16
00264 #define STYLE_UNDERLINE   32
00265 #define STYLE_STRIKEOUT   64
00266 
00267 static const text_style_t default_text_style = { NULL, 22, 0xffffff, 0xff, STYLE_OUTLINE,
00268                 0x000000, 0xff, 0x000000, 0xff, 0xffffff, 0x80, 0xffffff, 0xff, 1, 0, -1 };
00269 
00270 /**
00271  * OSD menu button states
00272  *
00273  * Every button has three states, either it is unselected, selected or pressed.
00274  * An OSD menu skin can associate images with each state.
00275  *
00276  *  OSD_BUTTON_UNSELECT 0
00277  *  OSD_BUTTON_SELECT   1
00278  *  OSD_BUTTON_PRESSED  2
00279  */
00280 #define OSD_BUTTON_UNSELECT 0
00281 #define OSD_BUTTON_SELECT   1
00282 #define OSD_BUTTON_PRESSED  2
00283 
00284 /**
00285  * OSD State object
00286  *
00287  * The OSD state object holds the state and associated images for a
00288  * particular state on the screen. The picture is displayed when this
00289  * state is the active state.
00290  */
00291 struct osd_state_t
00292 {
00293     osd_state_t *p_next;    /*< pointer to next state */
00294     osd_state_t *p_prev;    /*< pointer to previous state */
00295     picture_t   *p_pic;     /*< picture of state */
00296 
00297     char        *psz_state; /*< state name */
00298     int          i_state;   /*< state index */
00299 
00300     int     i_x;            /*< x-position of button state image */
00301     int     i_y;            /*< y-position of button state image */
00302     int     i_width;        /*< width of button state image */
00303     int     i_height;       /*< height of button state image */
00304 };
00305 
00306 /**
00307  * OSD Button object
00308  *
00309  * An OSD Button has different states. Each state has an image for display.
00310  */
00311 struct osd_button_t
00312 {
00313     osd_button_t *p_next;   /*< pointer to next button */
00314     osd_button_t *p_prev;   /*< pointer to previous button */
00315     osd_button_t *p_up;     /*< pointer to up button */
00316     osd_button_t *p_down;   /*< pointer to down button */
00317 
00318     osd_state_t *p_current_state; /*< pointer to current state image */
00319     osd_state_t *p_states; /*< doubly linked list of states */
00320     picture_t   *p_feedback; /*< feedback picture */
00321 
00322     char    *psz_name;     /*< name of button */
00323 
00324     /* These member should probably be a struct hotkey */
00325     char    *psz_action;      /*< hotkey action name on button*/
00326     char    *psz_action_down; /*< hotkey action name on range buttons
00327                                   for command "menu down" */
00328     /* end of hotkey specifics */
00329 
00330     int     i_x;            /*< x-position of button visible state image */
00331     int     i_y;            /*< y-position of button visible state image */
00332     int     i_width;        /*< width of button visible state image */
00333     int     i_height;       /*< height of button visible state image */
00334 
00335     /* range style button */
00336     bool   b_range;    /*< button should be interpreted as range */
00337     int          i_ranges;   /*< number of states */
00338 };
00339 
00340 /**
00341  * OSD Menu Style
00342  *
00343  * The images that make up an OSD menu can be created in such away that
00344  * they contain all buttons in the same picture, with the selected one
00345  * highlighted or being a concatenation of all the seperate images. The
00346  * first case is the default.
00347  *
00348  * To change the default style the keyword 'style' should be set to 'concat'.
00349  */
00350 
00351 #define OSD_MENU_STYLE_SIMPLE 0x0
00352 #define OSD_MENU_STYLE_CONCAT 0x1
00353 
00354 /**
00355  * OSD Menu State object
00356  *
00357  * Represents the current state as displayed.
00358  */
00359 /* Represent the menu state */
00360 struct osd_menu_state_t
00361 {
00362     int     i_x;        /*< x position of spu region */
00363     int     i_y;        /*< y position of spu region */
00364     int     i_width;    /*< width of spu region */
00365     int     i_height;   /*< height of spu region */
00366 
00367     picture_t    *p_pic;  /*< pointer to picture to display */
00368     osd_button_t *p_visible; /*< shortcut to visible button */
00369 
00370     bool b_menu_visible; /*< menu currently visible? */
00371     bool b_update;       /*< update OSD Menu when true */
00372 
00373     /* quick hack to volume state. */
00374     osd_button_t *p_volume; /*< pointer to volume range object. */
00375 };
00376 
00377 /**
00378  * OSD Menu object
00379  *
00380  * The main OSD Menu object, which holds a linked list to all buttons
00381  * and images that defines the menu. The p_state variable represents the
00382  * current state of the OSD Menu.
00383  */
00384 struct osd_menu_t
00385 {
00386     VLC_COMMON_MEMBERS
00387 
00388     int     i_x;        /*< x-position of OSD Menu on the video screen */
00389     int     i_y;        /*< y-position of OSD Menu on the video screen */
00390     int     i_width;    /*< width of OSD Menu on the video screen */
00391     int     i_height;   /*< height of OSD Menu on the video screen */
00392     int     i_style;    /*< style of spu region generation */
00393     int     i_position; /*< display position */
00394 
00395     char             *psz_path;  /*< directory where OSD menu images are stored */
00396     osd_button_t     *p_button;  /*< doubly linked list of buttons */
00397     osd_menu_state_t *p_state;   /*< current state of OSD menu */
00398 
00399     /* quick link in the linked list. */
00400     osd_button_t  *p_last_button; /*< pointer to last button in the list */
00401 
00402     /* misc parser */
00403     module_t        *p_parser;  /*< pointer to parser module */
00404     char            *psz_file;  /*< Config file name */
00405     image_handler_t *p_image;   /*< handler to image loading and conversion libraries */
00406 };
00407 
00408 /**
00409  * Initialize an osd_menu_t object
00410  *
00411  * This functions has to be called before any call to other osd_menu_t*
00412  * functions. It creates the osd_menu object and holds a pointer to it
00413  * during its lifetime.
00414  */
00415 VLC_EXPORT( osd_menu_t *, __osd_MenuCreate, ( vlc_object_t *, const char * ) );
00416 
00417 /**
00418  * Delete the osd_menu_t object
00419  *
00420  * This functions has to be called to release the associated module and
00421  * memory for the osdmenu. After return of this function the pointer to
00422  * osd_menu_t* is invalid.
00423  */
00424 VLC_EXPORT( void, __osd_MenuDelete, ( vlc_object_t *, osd_menu_t * ) );
00425 
00426 #define osd_MenuCreate(object,file) __osd_MenuCreate( VLC_OBJECT(object), file )
00427 #define osd_MenuDelete(object,osd)  __osd_MenuDelete( VLC_OBJECT(object), osd )
00428 
00429 /**
00430  * Find OSD Menu button at position x,y
00431  */
00432 VLC_EXPORT( osd_button_t *, __osd_ButtonFind, ( vlc_object_t *p_this,
00433      int, int, int, int, int, int ) );
00434 
00435 #define osd_ButtonFind(object,x,y,h,w,sh,sw)  __osd_ButtonFind(object,x,y,h,w,sh,sw)
00436 
00437 /**
00438  * Select the button provided as the new active button
00439  */
00440 VLC_EXPORT( void, __osd_ButtonSelect, ( vlc_object_t *, osd_button_t *) );
00441 
00442 #define osd_ButtonSelect(object,button) __osd_ButtonSelect(object,button)
00443 
00444 /**
00445  * Show the OSD menu.
00446  *
00447  * Show the OSD menu on the video output or mux it into the stream.
00448  * Every change to the OSD menu will now be visible in the output. An output
00449  * can be a video output window or a stream (\see stream output)
00450  */
00451 VLC_EXPORT( void, __osd_MenuShow, ( vlc_object_t * ) );
00452 
00453 /**
00454  * Hide the OSD menu.
00455  *
00456  * Stop showing the OSD menu on the video output or mux it into the stream.
00457  */
00458 VLC_EXPORT( void, __osd_MenuHide, ( vlc_object_t * ) );
00459 
00460 /**
00461  * Activate the action of this OSD menu item.
00462  *
00463  * The rc interface command "menu select" triggers the sending of an
00464  * hotkey action to the hotkey interface. The hotkey that belongs to
00465  * the current highlighted OSD menu item will be used.
00466  */
00467 VLC_EXPORT( void, __osd_MenuActivate,   ( vlc_object_t * ) );
00468 
00469 #define osd_MenuShow(object) __osd_MenuShow( VLC_OBJECT(object) )
00470 #define osd_MenuHide(object) __osd_MenuHide( VLC_OBJECT(object) )
00471 #define osd_MenuActivate(object)   __osd_MenuActivate( VLC_OBJECT(object) )
00472 
00473 /**
00474  * Next OSD menu item
00475  *
00476  * Select the next OSD menu item to be highlighted.
00477  * Note: The actual position on screen of the menu item is determined by
00478  * the OSD menu configuration file.
00479  */
00480 VLC_EXPORT( void, __osd_MenuNext, ( vlc_object_t * ) );
00481 
00482 /**
00483  * Previous OSD menu item
00484  *
00485  * Select the previous OSD menu item to be highlighted.
00486  * Note: The actual position on screen of the menu item is determined by
00487  * the OSD menu configuration file.
00488  */
00489 VLC_EXPORT( void, __osd_MenuPrev, ( vlc_object_t * ) );
00490 
00491 /**
00492  * OSD menu item above
00493  *
00494  * Select the OSD menu item above the current item to be highlighted.
00495  * Note: The actual position on screen of the menu item is determined by
00496  * the OSD menu configuration file.
00497  */
00498 VLC_EXPORT( void, __osd_MenuUp,   ( vlc_object_t * ) );
00499 
00500 /**
00501  * OSD menu item below
00502  *
00503  * Select the next OSD menu item below the current item to be highlighted.
00504  * Note: The actual position on screen of the menu item is determined by
00505  * the OSD menu configuration file.
00506  */
00507 VLC_EXPORT( void, __osd_MenuDown, ( vlc_object_t * ) );
00508 
00509 #define osd_MenuNext(object) __osd_MenuNext( VLC_OBJECT(object) )
00510 #define osd_MenuPrev(object) __osd_MenuPrev( VLC_OBJECT(object) )
00511 #define osd_MenuUp(object)   __osd_MenuUp( VLC_OBJECT(object) )
00512 #define osd_MenuDown(object) __osd_MenuDown( VLC_OBJECT(object) )
00513 
00514 /**
00515  * Display the audio volume bitmap.
00516  *
00517  * Display the correct audio volume bitmap that corresponds to the
00518  * current Audio Volume setting.
00519  */
00520 VLC_EXPORT( void, __osd_Volume, ( vlc_object_t * ) );
00521 
00522 #define osd_Volume(object)     __osd_Volume( VLC_OBJECT(object) )
00523 
00524 /**
00525  * Retrieve a non modifyable pointer to the OSD Menu state
00526  *
00527  */
00528 static inline const osd_menu_state_t *osd_GetMenuState( osd_menu_t *p_osd )
00529 {
00530     return( p_osd->p_state );
00531 }
00532 
00533 /**
00534  * Get the last key press received by the OSD Menu
00535  *
00536  * Returns 0 when no key has been pressed or the value of the key pressed.
00537  */
00538 static inline bool osd_GetKeyPressed( osd_menu_t *p_osd )
00539 {
00540     return( p_osd->p_state->b_update );
00541 }
00542 
00543 /**
00544  * Set the key pressed to a value.
00545  *
00546  * Assign a new key value to the last key pressed on the OSD Menu.
00547  */
00548 static inline void osd_SetKeyPressed( vlc_object_t *p_this, int i_value )
00549 {
00550     vlc_value_t val;
00551 
00552     val.i_int = i_value;
00553     var_Set( p_this, "key-pressed", val );
00554 }
00555 
00556 /**
00557  * Update the OSD Menu visibility flag.
00558  *
00559  * true means OSD Menu should be shown. false means OSD Menu
00560  * should not be shown.
00561  */
00562 static inline void osd_SetMenuVisible( osd_menu_t *p_osd, bool b_value )
00563 {
00564     vlc_value_t val;
00565 
00566     val.b_bool = p_osd->p_state->b_menu_visible = b_value;
00567     var_Set( p_osd, "osd-menu-visible", val );
00568 }
00569 
00570 /**
00571  * Update the OSD Menu update flag
00572  *
00573  * If the OSD Menu should be updated then set the update flag to
00574  * true, else to false.
00575  */
00576 static inline void osd_SetMenuUpdate( osd_menu_t *p_osd, bool b_value )
00577 {
00578     vlc_value_t val;
00579 
00580     val.b_bool = p_osd->p_state->b_update = b_value;
00581     var_Set( p_osd, "osd-menu-update", val );
00582 }
00583 
00584 /**
00585  * Textual feedback
00586  *
00587  * Functions that provide the textual feedback on the OSD. They are shown
00588  * on hotkey commands. The feedback is also part of the osd_button_t
00589  * object. The types are declared in the include file include/vlc_osd.h
00590  * @see vlc_osd.h
00591  */
00592 VLC_EXPORT( int, osd_ShowTextRelative, ( spu_t *, int, char *, text_style_t *, int, int, int, mtime_t ) );
00593 VLC_EXPORT( int, osd_ShowTextAbsolute, ( spu_t *, int, char *, text_style_t *, int, int, int, mtime_t, mtime_t ) );
00594 VLC_EXPORT( void,osd_Message, ( spu_t *, int, char *, ... ) LIBVLC_FORMAT( 3, 4 ) );
00595 
00596 /**
00597  * Default feedback images
00598  *
00599  * Functions that provide the default OSD feedback images on hotkey
00600  * commands. These feedback images are also part of the osd_button_t
00601  * object. The types are declared in the include file include/vlc_osd.h
00602  * @see vlc_osd.h
00603  */
00604 VLC_EXPORT( int, osd_Slider, ( vlc_object_t *, spu_t *, int, int, int, int, int, int, short ) );
00605 VLC_EXPORT( int, osd_Icon, ( vlc_object_t *, spu_t *, int, int, int, int, int, short ) );
00606 
00607 /** @} */
00608 
00609 /**********************************************************************
00610  * Vout text and widget overlays
00611  **********************************************************************/
00612 
00613 /**
00614  * Show text on the video for some time
00615  * \param p_vout pointer to the vout the text is to be showed on
00616  * \param i_channel Subpicture channel
00617  * \param psz_string The text to be shown
00618  * \param p_style Pointer to a struct with text style info
00619  * \param i_flags flags for alignment and such
00620  * \param i_hmargin horizontal margin in pixels
00621  * \param i_vmargin vertical margin in pixels
00622  * \param i_duration Amount of time the text is to be shown.
00623  */
00624 VLC_EXPORT( int, vout_ShowTextRelative, ( vout_thread_t *, int, char *, text_style_t *, int, int, int, mtime_t ) );
00625 
00626 /**
00627  * Show text on the video from a given start date to a given end date
00628  * \param p_vout pointer to the vout the text is to be showed on
00629  * \param i_channel Subpicture channel
00630  * \param psz_string The text to be shown
00631  * \param p_style Pointer to a struct with text style info
00632  * \param i_flags flags for alignment and such
00633  * \param i_hmargin horizontal margin in pixels
00634  * \param i_vmargin vertical margin in pixels
00635  * \param i_start the time when this string is to appear on the video
00636  * \param i_stop the time when this string should stop to be displayed
00637  *               if this is 0 the string will be shown untill the next string
00638  *               is about to be shown
00639  */
00640 VLC_EXPORT( int, vout_ShowTextAbsolute, ( vout_thread_t *, int, const char *, text_style_t *, int, int, int, mtime_t, mtime_t ) );
00641 
00642 /**
00643  * Write an informative message at the default location,
00644  * for the default duration and only if the OSD option is enabled.
00645  * \param p_caller The object that called the function.
00646  * \param i_channel Subpicture channel
00647  * \param psz_format printf style formatting
00648  **/
00649 VLC_EXPORT( void,  __vout_OSDMessage, ( vlc_object_t *, int, const char *, ... ) LIBVLC_FORMAT( 3, 4 ) );
00650 
00651 /**
00652  * Same as __vlc_OSDMessage() but with automatic casting
00653  */
00654 #define vout_OSDMessage( obj, chan, ...) \
00655       __vout_OSDMessage( VLC_OBJECT(obj), chan, __VA_ARGS__ )
00656 
00657 /**
00658  * Display a slider on the video output.
00659  * \param p_this    The object that called the function.
00660  * \param i_channel Subpicture channel
00661  * \param i_postion Current position in the slider
00662  * \param i_type    Types are: OSD_HOR_SLIDER and OSD_VERT_SLIDER.
00663  * @see vlc_osd.h
00664  */
00665 VLC_EXPORT( void, vout_OSDSlider, ( vlc_object_t *, int, int , short ) );
00666 
00667 /**
00668  * Display an Icon on the video output.
00669  * \param p_this    The object that called the function.
00670  * \param i_channel Subpicture channel
00671  * \param i_type    Types are: OSD_PLAY_ICON, OSD_PAUSE_ICON, OSD_SPEAKER_ICON, OSD_MUTE_ICON
00672  * @see vlc_osd.h
00673  */
00674 VLC_EXPORT( void, vout_OSDIcon, ( vlc_object_t *, int, short ) );
00675 
00676 # ifdef __cplusplus
00677 }
00678 # endif
00679 
00680 #endif /* _VLC_OSD_H */

Generated on Wed Aug 13 08:02:37 2008 for VLC by  doxygen 1.5.1