Changeset 0702b8f8e48dca927ff62d00e0a37f83dacd1987

Show
Ignore:
Timestamp:
02/09/06 23:22:19 (2 years ago)
Author:
Clément Stenac <zorglub@videolan.org>
git-committer:
Clément Stenac <zorglub@videolan.org> 1157232139 +0000
git-parent:

[1aa4230a8154b65139570ee8a953e9cc0b0b2bfd]

git-author:
Clément Stenac <zorglub@videolan.org> 1157232139 +0000
Message:

Add --play-and-exit option to quit after no more items are in playlist.
To be backported, but will need some manual merging (diff in vlc-devel should apply pristine to 0.8.5).
Thanks to Georgi Chorbadzhiyski for the patch

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/libvlc.h

    r69c492d r0702b8f  
    954954#define PAS_LONGTEXT N_( \ 
    955955    "Stop the playlist after each played playlist item." ) 
     956 
     957#define PAE_TEXT N_("Play and exit") 
     958#define PAE_LONGTEXT N_( \ 
     959                "Exit if there are no more items in the playlist." ) 
    956960 
    957961#define ML_TEXT N_("Use media library") 
     
    16191623    add_bool( "repeat", 0, NULL, REPEAT_TEXT, REPEAT_LONGTEXT, VLC_FALSE ); 
    16201624        change_short('R'); 
     1625    add_bool( "play-and-exit", 0, NULL, PAE_TEXT, PAE_LONGTEXT, VLC_FALSE ); 
    16211626    add_bool( "play-and-stop", 0, NULL, PAS_TEXT, PAS_LONGTEXT, VLC_FALSE ); 
    16221627    add_bool( "media-library", 1, NULL, ML_TEXT, ML_LONGTEXT, VLC_FALSE ); 
  • src/playlist/engine.c

    r532a761 r0702b8f  
    144144    var_Destroy( p_playlist, "intf-show" ); 
    145145    var_Destroy( p_playlist, "play-and-stop" ); 
     146    var_Destroy( p_playlist, "play-and-exit" ); 
    146147    var_Destroy( p_playlist, "random" ); 
    147148    var_Destroy( p_playlist, "repeat" ); 
     
    210211{ 
    211212    playlist_item_t *p_item = NULL; 
    212  
    213  
     213    vlc_bool_t b_playexit = var_GetBool( p_playlist, "play-and-exit" ); 
    214214    PL_LOCK 
    215215 
     
    322322             { 
    323323                msg_Dbg( p_playlist, "nothing to play" ); 
     324                if( b_playexit == VLC_TRUE ) 
     325                { 
     326                    msg_Info( p_playlist, "end of playlist, exiting" ); 
     327                    p_playlist->p_vlc->b_die = VLC_TRUE; 
     328                } 
    324329                p_playlist->status.i_status = PLAYLIST_STOPPED; 
    325330                PL_UNLOCK 
     
    511516    /* Variables to control playback */ 
    512517    var_CreateGetBool( p_playlist, "play-and-stop" ); 
     518    var_CreateGetBool( p_playlist, "play-and-exit" ); 
    513519    var_CreateGetBool( p_playlist, "random" ); 
    514520    var_CreateGetBool( p_playlist, "repeat" );