Changeset a5ee53f77453343410be793192b3a7cacb2ce08d
- Timestamp:
- 04/20/04 17:05:24
(4 years ago)
- Author:
- Gildas Bazin <gbazin@videolan.org>
- git-committer:
- Gildas Bazin <gbazin@videolan.org> 1082473524 +0000
- git-parent:
[1741388f379b2de3feb921233c1d929d73ddd06c]
- git-author:
- Gildas Bazin <gbazin@videolan.org> 1082473524 +0000
- Message:
* include/vlc/vlc.h: added a b_play parameter to the libvlc VLC_AddIntf() prototype.
When true, the interface will automatically start playing the playlist when (and only when) it is ready. (particularly useful for embedded vouts).
* src/libvlc.c, src/vlc.c: new VLC_AddIntf() prototype.
* src/interface/interface.c: if the interface doesn't support "playing on start", do it ourselves.
* modules/gui/wxwindows/wxwindows.cpp: implement "play on start".
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rfab59c0 |
ra5ee53f |
|
| 227 | 227 | int VLC_Get ( int, char const *, vlc_value_t * ); |
|---|
| 228 | 228 | |
|---|
| 229 | | int VLC_AddIntf ( int, char const *, vlc_bool_t ); |
|---|
| | 229 | int VLC_AddIntf ( int, char const *, vlc_bool_t, vlc_bool_t ); |
|---|
| 230 | 230 | int VLC_AddTarget ( int, char const *, const char **, int, int, int ); |
|---|
| 231 | 231 | |
|---|
| ra2edf51 |
ra5ee53f |
|
| 51 | 51 | /* Thread properties and locks */ |
|---|
| 52 | 52 | vlc_bool_t b_block; |
|---|
| | 53 | vlc_bool_t b_play; |
|---|
| 53 | 54 | |
|---|
| 54 | 55 | /* Specific interfaces */ |
|---|
| rd9389c2 |
ra5ee53f |
|
| 149 | 149 | p_intf->pf_show_dialog = NULL; |
|---|
| 150 | 150 | |
|---|
| | 151 | /* We support play on start */ |
|---|
| | 152 | p_intf->b_play = VLC_TRUE; |
|---|
| | 153 | |
|---|
| 151 | 154 | return VLC_SUCCESS; |
|---|
| 152 | 155 | } |
|---|
| … | … | |
| 307 | 310 | vlc_thread_ready( p_intf ); |
|---|
| 308 | 311 | |
|---|
| | 312 | /* Check if we need to start playing */ |
|---|
| | 313 | if( p_intf->b_play ) |
|---|
| | 314 | { |
|---|
| | 315 | playlist_t *p_playlist = |
|---|
| | 316 | (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, |
|---|
| | 317 | FIND_ANYWHERE ); |
|---|
| | 318 | if( p_playlist ) |
|---|
| | 319 | { |
|---|
| | 320 | playlist_Play( p_playlist ); |
|---|
| | 321 | vlc_object_release( p_playlist ); |
|---|
| | 322 | } |
|---|
| | 323 | } |
|---|
| | 324 | |
|---|
| 309 | 325 | /* Return TRUE to tell program to continue (FALSE would terminate) */ |
|---|
| 310 | 326 | return TRUE; |
|---|
| rd8f54d4 |
ra5ee53f |
|
| 279 | 279 | p_intf->pf_run( p_intf ); |
|---|
| 280 | 280 | |
|---|
| | 281 | /* Reset play on start status */ |
|---|
| | 282 | p_intf->b_play = VLC_FALSE; |
|---|
| | 283 | |
|---|
| 281 | 284 | /* Provide ability to switch the main interface on the fly */ |
|---|
| 282 | 285 | while( p_intf->psz_switch_intf ) |
|---|
| rfab59c0 |
ra5ee53f |
|
| 617 | 617 | { |
|---|
| 618 | 618 | sprintf( psz_temp, "%s,none", psz_module ); |
|---|
| 619 | | VLC_AddIntf( 0, psz_temp, VLC_FALSE ); |
|---|
| | 619 | VLC_AddIntf( 0, psz_temp, VLC_FALSE, VLC_FALSE ); |
|---|
| 620 | 620 | free( psz_temp ); |
|---|
| 621 | 621 | } |
|---|
| … | … | |
| 629 | 629 | * Allways load the hotkeys interface if it exists |
|---|
| 630 | 630 | */ |
|---|
| 631 | | VLC_AddIntf( 0, "hotkeys,none", VLC_FALSE ); |
|---|
| | 631 | VLC_AddIntf( 0, "hotkeys,none", VLC_FALSE, VLC_FALSE ); |
|---|
| 632 | 632 | |
|---|
| 633 | 633 | /* |
|---|
| … | … | |
| 662 | 662 | * to 0, VLC_AddIntf will return immediately and let the interface run in a |
|---|
| 663 | 663 | * separate thread. If b_block is set to 1, VLC_AddIntf will continue until |
|---|
| 664 | | * user requests to quit. |
|---|
| 665 | | *****************************************************************************/ |
|---|
| 666 | | int VLC_AddIntf( int i_object, char const *psz_module, vlc_bool_t b_block ) |
|---|
| | 664 | * user requests to quit. If b_play is set to 1, VLC_AddIntf will start playing |
|---|
| | 665 | * the playlist when it is completely initialised. |
|---|
| | 666 | *****************************************************************************/ |
|---|
| | 667 | int VLC_AddIntf( int i_object, char const *psz_module, |
|---|
| | 668 | vlc_bool_t b_block, vlc_bool_t b_play ) |
|---|
| 667 | 669 | { |
|---|
| 668 | 670 | int i_err; |
|---|
| … | … | |
| 685 | 687 | } |
|---|
| 686 | 688 | |
|---|
| | 689 | /* Interface doesn't handle play on start so do it ourselves */ |
|---|
| | 690 | if( !p_intf->b_play && b_play ) VLC_Play( i_object ); |
|---|
| | 691 | |
|---|
| 687 | 692 | /* Try to run the interface */ |
|---|
| | 693 | p_intf->b_play = b_play; |
|---|
| 688 | 694 | p_intf->b_block = b_block; |
|---|
| 689 | 695 | i_err = intf_RunThread( p_intf ); |
|---|
| r1e67ea6 |
ra5ee53f |
|
| 3 | 3 | ***************************************************************************** |
|---|
| 4 | 4 | * Copyright (C) 1998-2004 VideoLAN |
|---|
| 5 | | * $Id: vlc.c,v 1.21 2004/01/25 17:16:05 zorglub Exp $ |
|---|
| | 5 | * $Id$ |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Authors: Vincent Seguin <seguin@via.ecp.fr> |
|---|
| … | … | |
| 99 | 99 | } |
|---|
| 100 | 100 | |
|---|
| 101 | | /* Run libvlc, in non-blocking mode */ |
|---|
| 102 | | i_ret = VLC_Play( 0 ); |
|---|
| 103 | | |
|---|
| 104 | | /* Add a blocking interface and keep the return value */ |
|---|
| 105 | | i_ret = VLC_AddIntf( 0, NULL, VLC_TRUE ); |
|---|
| | 101 | /* Add a blocking interface, start playing, and keep the return value */ |
|---|
| | 102 | i_ret = VLC_AddIntf( 0, NULL, VLC_TRUE, VLC_TRUE ); |
|---|
| 106 | 103 | |
|---|
| 107 | 104 | /* Finish the threads */ |
|---|