]> git.sesse.net Git - vlc/blob - src/video_output/video_text.c
* src/video_output/video_text.c: removed legacy code that has been rotting for ages.
[vlc] / src / video_output / video_text.c
1 /*****************************************************************************
2  * video_text.c : text manipulation functions
3  *****************************************************************************
4  * Copyright (C) 1999-2001 VideoLAN
5  * $Id: video_text.c,v 1.45 2003/08/04 23:35:25 gbazin Exp $
6  *
7  * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  * 
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
22  *****************************************************************************/
23 #include <vlc/vout.h>
24
25 /**
26  * \brief Show text on the video for some time
27  * \param p_vout pointer to the vout the text is to be showed on
28  * \param psz_string The text to be shown
29  * \param p_style Pointer to a struct with text style info
30  * \param i_flags flags for alignment and such
31  * \param i_hmargin horizontal margin in pixels
32  * \param i_vmargin vertical margin in pixels
33  * \param i_duration Amount of time the text is to be shown.
34  */
35 void vout_ShowTextRelative( vout_thread_t *p_vout, char *psz_string, 
36                               text_style_t *p_style, int i_flags, 
37                               int i_hmargin, int i_vmargin, 
38                               mtime_t i_duration )
39 {
40     mtime_t i_now = mdate();
41     if ( p_vout->pf_add_string )
42     {
43         p_vout->pf_add_string( p_vout, psz_string, p_style, i_flags, i_hmargin,
44                                i_vmargin, i_now, i_now + i_duration );
45     }
46     else
47     {
48         msg_Warn( p_vout, "No text renderer found" );
49     }
50 }
51
52 /**
53  * \brief Show text on the video from a given start date to a given end date
54  * \param p_vout pointer to the vout the text is to be showed on
55  * \param psz_string The text to be shown
56  * \param p_style Pointer to a struct with text style info
57  * \param i_flags flags for alignment and such
58  * \param i_hmargin horizontal margin in pixels
59  * \param i_vmargin vertical margin in pixels
60  * \param i_start the time when this string is to appear on the video
61  * \param i_stop the time when this string should stop to be displayed
62  *               if this is 0 the string will be shown untill the next string
63  *               is about to be shown
64  */
65 void vout_ShowTextAbsolute( vout_thread_t *p_vout, char *psz_string, 
66                               text_style_t *p_style, int i_flags, 
67                               int i_hmargin, int i_vmargin, mtime_t i_start, 
68                               mtime_t i_stop )
69 {
70     if ( p_vout->pf_add_string )
71     {
72         p_vout->pf_add_string( p_vout, psz_string, p_style, i_flags, i_hmargin,
73                                i_vmargin, i_start, i_stop );
74     }
75     else
76     {
77         msg_Warn( p_vout, "No text renderer found" );
78     }
79 }