]> git.sesse.net Git - vlc/blobdiff - include/vlc_osd.h
Make sdp_Start static since it is used nowhere outside
[vlc] / include / vlc_osd.h
index 0eb2cb1c68cda37b05cd8398a960e2e18f084c20..45344c4f7e65e112b106e79ca0f5e069cd520f89 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
+#if !defined( __LIBVLC__ )
+  #error You are not libvlc or one of its plugins. You cannot include this file
+#endif
+
 #ifndef _VLC_OSD_H
 #define _VLC_OSD_H 1
 
@@ -142,6 +146,12 @@ VLC_EXPORT( void, spu_RenderSubpictures, ( spu_t *,  video_format_t *, picture_t
  *  --sout='#transcode{osd}:std{access=udp,mux=ts,dst=dest_ipaddr}'
  *  --osdmenu-file=share/osdmenu/dvd.cfg
  *
+ * An example for local usage of the OSD menu is:
+ *
+ *  vlc dvdsimple:///dev/dvd --extraintf rc
+ *  --sub-filter osdmenu
+ *  --osdmenu-file=share/osdmenu/dvd.cfg
+ *
  * Each OSD menu element, called "action", defines a hotkey action. Each action
  * can have several states (unselect, select, pressed). Each state has an image
  * that represents the state visually. The commands "menu right", "menu left",
@@ -173,8 +183,9 @@ VLC_EXPORT( void, spu_RenderSubpictures, ( spu_t *,  video_format_t *, picture_t
  *
  * CONFIG_FILE = FILENAME '.cfg'
  * WS = [ ' ' | '\t' ]+
- * OSDMEN_PATH = PATHNAME
+ * OSDMENU_PATH = PATHNAME
  * DIR = 'dir' WS OSDMENU_PATH '\n'
+ * STYLE = 'style' [ 'default' | 'concat' ] '\n'
  * STATE = [ 'unselect' | 'select' | 'pressed' ]
  * HOTKEY_ACTION = 'key-' [ 'a' .. 'z', 'A' .. 'Z', '-' ]+
  *
@@ -238,10 +249,13 @@ struct text_style_t
     int        i_background_alpha;/**< The transparency of the background.
                                        0x00 is fully opaque,
                                        0xFF fully transparent */
+    int        i_karaoke_background_color;/**< Background color for karaoke 0xRRGGBB */
+    int        i_karaoke_background_alpha;/**< The transparency of the karaoke bg.
+                                       0x00 is fully opaque,
+                                       0xFF fully transparent */
     int        i_outline_width;   /**< The width of the outline in pixels */
     int        i_shadow_width;    /**< The width of the shadow in pixels */
     int        i_spacing;         /**< The spaceing between glyphs in pixels */
-    int        i_text_align;      /**< An alignment hint for the text */
 };
 
 /* Style flags for \ref text_style_t */
@@ -254,7 +268,7 @@ struct text_style_t
 #define STYLE_STRIKEOUT   64
 
 static const text_style_t default_text_style = { NULL, 22, 0xffffff, 0xff, STYLE_OUTLINE,
-                0x000000, 0xff, 0x000000, 0xff, 0xffffff, 0x80, 1, 0, -1, 0 };
+                0x000000, 0xff, 0x000000, 0xff, 0xffffff, 0x80, 0xffffff, 0xff, 1, 0, -1 };
 
 
 
@@ -321,6 +335,20 @@ struct osd_button_t
     int          i_ranges;   /*< number of states */
 };
 
+/**
+ * OSD Menu Style
+ *
+ * The images that make up an OSD menu can be created in such away that
+ * they contain all buttons in the same picture, with the selected one
+ * highlighted or being a concatenation of all the seperate images. The
+ * first case is the default.
+ *
+ * To change the default style the keyword 'style' should be set to 'concat'.
+ */
+
+#define OSD_MENU_STYLE_SIMPLE 0x0
+#define OSD_MENU_STYLE_CONCAT 0x1
+
 /**
  * OSD Menu State object
  *
@@ -359,6 +387,7 @@ struct osd_menu_t
     int     i_y;        /*< y-position of OSD Menu on the video screen */
     int     i_width;    /*< width of OSD Menu on the video screen */
     int     i_height;   /*< height of OSD Menu on the video screen */
+    int     i_style;    /*< style of spu region generation */
 
     char             *psz_path;  /*< directory where OSD menu images are stored */
     osd_button_t     *p_button;  /*< doubly linked list of buttons */
@@ -551,7 +580,7 @@ static inline void osd_SetMenuUpdate( osd_menu_t *p_osd, vlc_bool_t b_value )
  */
 VLC_EXPORT( int, osd_ShowTextRelative, ( spu_t *, int, char *, text_style_t *, int, int, int, mtime_t ) );
 VLC_EXPORT( int, osd_ShowTextAbsolute, ( spu_t *, int, char *, text_style_t *, int, int, int, mtime_t, mtime_t ) );
-VLC_EXPORT( void,osd_Message, ( spu_t *, int, char *, ... ) );
+VLC_EXPORT( void,osd_Message, ( spu_t *, int, char *, ... ) ATTRIBUTE_FORMAT( 3, 4 ) );
 
 /**
  * Default feedback images
@@ -606,7 +635,7 @@ VLC_EXPORT( int, vout_ShowTextRelative, ( vout_thread_t *, int, char *, text_sty
  *               if this is 0 the string will be shown untill the next string
  *               is about to be shown
  */
-VLC_EXPORT( int, vout_ShowTextAbsolute, ( vout_thread_t *, int, char *, text_style_t *, int, int, int, mtime_t, mtime_t ) );
+VLC_EXPORT( int, vout_ShowTextAbsolute, ( vout_thread_t *, int, const char *, text_style_t *, int, int, int, mtime_t, mtime_t ) );
 
 /**
  * Write an informative message at the default location,
@@ -615,7 +644,7 @@ VLC_EXPORT( int, vout_ShowTextAbsolute, ( vout_thread_t *, int, char *, text_sty
  * \param i_channel Subpicture channel
  * \param psz_format printf style formatting
  **/
-VLC_EXPORT( void,  __vout_OSDMessage, ( vlc_object_t *, int, char *, ... ) );
+VLC_EXPORT( void,  __vout_OSDMessage, ( vlc_object_t *, int, const char *, ... ) ATTRIBUTE_FORMAT( 3, 4 ) );
 
 /**
  * Same as __vlc_OSDMessage() but with automatic casting