Changeset a5ee53f77453343410be793192b3a7cacb2ce08d

Show
Ignore:
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
  • include/vlc/vlc.h

    rfab59c0 ra5ee53f  
    227227int     VLC_Get          ( int, char const *, vlc_value_t * ); 
    228228 
    229 int     VLC_AddIntf      ( int, char const *, vlc_bool_t ); 
     229int     VLC_AddIntf      ( int, char const *, vlc_bool_t, vlc_bool_t ); 
    230230int     VLC_AddTarget    ( int, char const *, const char **, int, int, int ); 
    231231 
  • include/vlc_interface.h

    ra2edf51 ra5ee53f  
    5151    /* Thread properties and locks */ 
    5252    vlc_bool_t          b_block; 
     53    vlc_bool_t          b_play; 
    5354 
    5455    /* Specific interfaces */ 
  • modules/gui/wxwindows/wxwindows.cpp

    rd9389c2 ra5ee53f  
    149149    p_intf->pf_show_dialog = NULL; 
    150150 
     151    /* We support play on start */ 
     152    p_intf->b_play = VLC_TRUE; 
     153 
    151154    return VLC_SUCCESS; 
    152155} 
     
    307310    vlc_thread_ready( p_intf ); 
    308311 
     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 
    309325    /* Return TRUE to tell program to continue (FALSE would terminate) */ 
    310326    return TRUE; 
  • src/interface/interface.c

    rd8f54d4 ra5ee53f  
    279279    p_intf->pf_run( p_intf ); 
    280280 
     281    /* Reset play on start status */ 
     282    p_intf->b_play = VLC_FALSE; 
     283 
    281284    /* Provide ability to switch the main interface on the fly */ 
    282285    while( p_intf->psz_switch_intf ) 
  • src/libvlc.c

    rfab59c0 ra5ee53f  
    617617        { 
    618618            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 ); 
    620620            free( psz_temp ); 
    621621        } 
     
    629629     * Allways load the hotkeys interface if it exists 
    630630     */ 
    631     VLC_AddIntf( 0, "hotkeys,none", VLC_FALSE ); 
     631    VLC_AddIntf( 0, "hotkeys,none", VLC_FALSE, VLC_FALSE ); 
    632632 
    633633    /* 
     
    662662 * to 0, VLC_AddIntf will return immediately and let the interface run in a 
    663663 * 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 *****************************************************************************/ 
     667int VLC_AddIntf( int i_object, char const *psz_module, 
     668                 vlc_bool_t b_block, vlc_bool_t b_play ) 
    667669{ 
    668670    int i_err; 
     
    685687    } 
    686688 
     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 
    687692    /* Try to run the interface */ 
     693    p_intf->b_play = b_play; 
    688694    p_intf->b_block = b_block; 
    689695    i_err = intf_RunThread( p_intf ); 
  • src/vlc.c

    r1e67ea6 ra5ee53f  
    33 ***************************************************************************** 
    44 * Copyright (C) 1998-2004 VideoLAN 
    5  * $Id: vlc.c,v 1.21 2004/01/25 17:16:05 zorglub Exp
     5 * $Id
    66 * 
    77 * Authors: Vincent Seguin <seguin@via.ecp.fr> 
     
    9999    } 
    100100 
    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 ); 
    106103 
    107104    /* Finish the threads */