Changeset 594067729597cc5867ff2094958d59c759bf0445
- Timestamp:
- 12/06/07 13:28:54
(1 year ago)
- Author:
- Jean-Paul Saman <jpsaman@videolan.org>
- git-committer:
- Jean-Paul Saman <jpsaman@videolan.org> 1181647734 +0000
- git-parent:
[f075fa60d9aef1a78f640ba8af9f6a17e9999952]
- git-author:
- Jean-Paul Saman <jpsaman@videolan.org> 1181647734 +0000
- Message:
Show title on video output based on users preferences. Defaults are:--video-title-show --video-title-position=8 --video-title-timeout=5000
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rd546db7 |
r5940677 |
|
| 497 | 497 | /* Video output configuration */ |
|---|
| 498 | 498 | config_chain_t *p_cfg; |
|---|
| | 499 | |
|---|
| | 500 | /* Show media title on videoutput */ |
|---|
| | 501 | vlc_bool_t b_title_show; |
|---|
| | 502 | mtime_t i_title_timeout; |
|---|
| | 503 | int i_title_position; |
|---|
| 499 | 504 | }; |
|---|
| 500 | 505 | |
|---|
| rdd73262 |
r5940677 |
|
| 303 | 303 | #define VIDEO_ON_TOP_LONGTEXT N_( \ |
|---|
| 304 | 304 | "Always place the video window on top of other windows." ) |
|---|
| | 305 | |
|---|
| | 306 | #define VIDEO_TITLE_SHOW_TEXT N_("Show media title on video.") |
|---|
| | 307 | #define VIDEO_TITLE_SHOW_LONGTEXT N_( \ |
|---|
| | 308 | "Display the title of the video on top of the movie.") |
|---|
| | 309 | |
|---|
| | 310 | #define VIDEO_TITLE_TIMEOUT_TEXT N_("Show video title for x miliseconds.") |
|---|
| | 311 | #define VIDEO_TITLE_TIMEOUT_LONGTEXT N_( \ |
|---|
| | 312 | "Show the video title for n miliseconds, default is 5000 ms (5 sec.)") |
|---|
| | 313 | |
|---|
| | 314 | #define VIDEO_TITLE_POSITION_TEXT N_("Position of video title.") |
|---|
| | 315 | #define VIDEO_TITLE_POSITION_LONGTEXT N_( \ |
|---|
| | 316 | "Place on video where to display the title (default bottom center).") |
|---|
| | 317 | |
|---|
| | 318 | static int pi_pos_values[] = { 0, 1, 2, 4, 8, 5, 6, 9, 10 }; |
|---|
| | 319 | static const char *ppsz_pos_descriptions[] = |
|---|
| | 320 | { N_("Center"), N_("Left"), N_("Right"), N_("Top"), N_("Bottom"), |
|---|
| | 321 | N_("Top-Left"), N_("Top-Right"), N_("Bottom-Left"), N_("Bottom-Right") }; |
|---|
| 305 | 322 | |
|---|
| 306 | 323 | #define SS_TEXT N_("Disable screensaver") |
|---|
| … | … | |
| 1310 | 1327 | add_bool( "disable-screensaver", VLC_TRUE, NULL, SS_TEXT, SS_LONGTEXT, |
|---|
| 1311 | 1328 | VLC_TRUE ); |
|---|
| | 1329 | |
|---|
| | 1330 | add_bool( "video-title-show", 1, NULL, VIDEO_TITLE_SHOW_TEXT, |
|---|
| | 1331 | VIDEO_TITLE_SHOW_LONGTEXT, VLC_FALSE ); |
|---|
| | 1332 | add_integer( "video-title-timeout", 5000, NULL, VIDEO_TITLE_TIMEOUT_TEXT, |
|---|
| | 1333 | VIDEO_TITLE_TIMEOUT_LONGTEXT, VLC_FALSE ); |
|---|
| | 1334 | add_integer( "video-title-position", 8, NULL, VIDEO_TITLE_POSITION_TEXT, |
|---|
| | 1335 | VIDEO_TITLE_POSITION_LONGTEXT, VLC_FALSE ); |
|---|
| | 1336 | change_integer_list( pi_pos_values, ppsz_pos_descriptions, 0 ); |
|---|
| 1312 | 1337 | |
|---|
| 1313 | 1338 | set_section( N_("Snapshot") , NULL ); |
|---|
| re3223c2 |
r5940677 |
|
| 759 | 759 | } |
|---|
| 760 | 760 | |
|---|
| 761 | | DisplayTitleOnOSD( p_vout ); |
|---|
| | 761 | if( p_vout->b_title_show ) |
|---|
| | 762 | DisplayTitleOnOSD( p_vout ); |
|---|
| 762 | 763 | |
|---|
| 763 | 764 | /* |
|---|
| … | … | |
| 1643 | 1644 | { |
|---|
| 1644 | 1645 | i_now = mdate(); |
|---|
| 1645 | | i_stop = i_now + (mtime_t)(15000000); |
|---|
| | 1646 | i_stop = i_now + (mtime_t)(p_vout->i_title_timeout * 1000); |
|---|
| 1646 | 1647 | if( input_GetItem(p_input)->p_meta && |
|---|
| 1647 | 1648 | input_GetItem(p_input)->p_meta->psz_nowplaying && |
|---|
| … | … | |
| 1650 | 1651 | vout_ShowTextAbsolute( p_vout, DEFAULT_CHAN, |
|---|
| 1651 | 1652 | input_GetItem(p_input)->p_meta->psz_nowplaying, NULL, |
|---|
| 1652 | | OSD_ALIGN_BOTTOM, |
|---|
| | 1653 | p_vout->i_title_position, |
|---|
| 1653 | 1654 | 30 + p_vout->fmt_in.i_width |
|---|
| 1654 | 1655 | - p_vout->fmt_in.i_visible_width |
|---|
| … | … | |
| 1673 | 1674 | vout_ShowTextAbsolute( p_vout, DEFAULT_CHAN, |
|---|
| 1674 | 1675 | psz_string, NULL, |
|---|
| 1675 | | OSD_ALIGN_BOTTOM, |
|---|
| | 1676 | p_vout->i_title_position, |
|---|
| 1676 | 1677 | 30 + p_vout->fmt_in.i_width |
|---|
| 1677 | 1678 | - p_vout->fmt_in.i_visible_width |
|---|
| … | … | |
| 1686 | 1687 | vout_ShowTextAbsolute( p_vout, DEFAULT_CHAN, |
|---|
| 1687 | 1688 | input_GetItem(p_input)->psz_name, NULL, |
|---|
| 1688 | | OSD_ALIGN_BOTTOM, |
|---|
| | 1689 | p_vout->i_title_position, |
|---|
| 1689 | 1690 | 30 + p_vout->fmt_in.i_width |
|---|
| 1690 | 1691 | - p_vout->fmt_in.i_visible_width |
|---|
| r74e74a9 |
r5940677 |
|
| 63 | 63 | static int SnapshotCallback( vlc_object_t *, char const *, |
|---|
| 64 | 64 | vlc_value_t, vlc_value_t, void * ); |
|---|
| | 65 | static int TitleCallback( vlc_object_t *, char const *, |
|---|
| | 66 | vlc_value_t, vlc_value_t, void * ); |
|---|
| 65 | 67 | |
|---|
| 66 | 68 | /***************************************************************************** |
|---|
| … | … | |
| 209 | 211 | var_Create( p_vout, "video-x", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT ); |
|---|
| 210 | 212 | var_Create( p_vout, "video-y", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT ); |
|---|
| | 213 | |
|---|
| | 214 | var_Create( p_vout, "video-title-show", VLC_VAR_BOOL | VLC_VAR_DOINHERIT ); |
|---|
| | 215 | var_Create( p_vout, "video-title-timeout", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT ); |
|---|
| | 216 | var_Create( p_vout, "video-title-position", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT ); |
|---|
| | 217 | |
|---|
| | 218 | p_vout->b_title_show = var_GetBool( p_vout, "video-title-show" ); |
|---|
| | 219 | p_vout->i_title_timeout = (mtime_t) var_GetInteger( p_vout, "video-title-timeout" ); |
|---|
| | 220 | p_vout->i_title_position = var_GetInteger( p_vout, "video-title-position" ); |
|---|
| | 221 | |
|---|
| | 222 | var_AddCallback( p_vout, "video-title-show", TitleCallback, NULL ); |
|---|
| | 223 | var_AddCallback( p_vout, "video-title-timeout", TitleCallback, NULL ); |
|---|
| | 224 | var_AddCallback( p_vout, "video-title-position", TitleCallback, NULL ); |
|---|
| 211 | 225 | |
|---|
| 212 | 226 | /* Zoom object var */ |
|---|
| … | … | |
| 1168 | 1182 | return VLC_SUCCESS; |
|---|
| 1169 | 1183 | } |
|---|
| | 1184 | |
|---|
| | 1185 | static int TitleCallback( vlc_object_t *p_this, char const *psz_cmd, |
|---|
| | 1186 | vlc_value_t oldval, vlc_value_t newval, void *p_data ) |
|---|
| | 1187 | { |
|---|
| | 1188 | vout_thread_t *p_vout = (vout_thread_t *)p_this; |
|---|
| | 1189 | |
|---|
| | 1190 | if( !strncmp( psz_cmd, "video-title-show", 16 ) ) |
|---|
| | 1191 | p_vout->b_title_show = newval.b_bool; |
|---|
| | 1192 | else if( !strncmp( psz_cmd, "video-title-timeout", 19 ) ) |
|---|
| | 1193 | p_vout->i_title_timeout = (mtime_t) newval.i_int; |
|---|
| | 1194 | else if( !strncmp( psz_cmd, "video-title-position", 20 ) ) |
|---|
| | 1195 | p_vout->i_title_position = newval.i_int; |
|---|
| | 1196 | } |
|---|