Commit 9a426b4b authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* src/libvlc.h

   src/playlist/playlist.c: added a "--play-and-stop" feature.
   This stops the playlist after each played item. It does however increase
   the index. (also very useful for sap playlist when a lot of channels fail to open).
parent 09c86cf0
......@@ -67,6 +67,7 @@ vlc_module_begin();
add_shortcut( "ogg" );
add_shortcut( "h264" );
add_shortcut( "avi" );
add_shortcut( "mjpeg" );
vlc_module_end();
/*****************************************************************************
......
......@@ -550,6 +550,11 @@ static char *ppsz_align_descriptions[] =
"When this is active, VLC will keep playing the current playlist item " \
"over and over again.")
#define PAS_TEXT N_("Play and stop")
#define PAS_LONGTEXT N_( \
"Stop the playlist after each played playlistitem." \
"Does advance the playlistindex.")
#define MISC_CAT_LONGTEXT N_( \
"These options allow you to select default modules. Leave these " \
"alone unless you really know what you are doing." )
......@@ -947,6 +952,7 @@ vlc_module_begin();
change_short('L');
add_bool( "repeat", 0, NULL, REPEAT_TEXT, REPEAT_LONGTEXT, VLC_TRUE );
change_short('R');
add_bool( "play-and-stop", 0, NULL, PAS_TEXT, PAS_LONGTEXT, VLC_TRUE );
/* Misc options */
add_category_hint( N_("Miscellaneous"), MISC_CAT_LONGTEXT, VLC_TRUE );
......
......@@ -86,6 +86,7 @@ playlist_t * __playlist_Create ( vlc_object_t *p_parent )
val.b_bool = VLC_FALSE;
var_Set( p_playlist, "prevent-skip", val );
var_Create( p_playlist, "play-and-stop", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
var_Create( p_playlist, "random", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
var_Create( p_playlist, "repeat", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
var_Create( p_playlist, "loop", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
......@@ -137,6 +138,7 @@ void playlist_Destroy( playlist_t * p_playlist )
var_Destroy( p_playlist, "intf-popmenu" );
var_Destroy( p_playlist, "intf-show" );
var_Destroy( p_playlist, "prevent-skip" );
var_Destroy( p_playlist, "play-and-stop" );
var_Destroy( p_playlist, "random" );
var_Destroy( p_playlist, "repeat" );
var_Destroy( p_playlist, "loop" );
......@@ -398,15 +400,19 @@ static void RunThread ( playlist_t *p_playlist )
}
else if( p_playlist->i_status != PLAYLIST_STOPPED )
{
var_Get( p_playlist, "prevent-skip", &val);
if( val.b_bool == VLC_FALSE)
var_Get( p_playlist, "prevent-skip", &val );
if( val.b_bool == VLC_FALSE )
{
SkipItem( p_playlist, 0 );
}
val.b_bool = VLC_TRUE;
var_Set( p_playlist, "prevent-skip", val);
var_Set( p_playlist, "prevent-skip", val );
var_Get( p_playlist, "play-and-stop", &val );
if( val.b_bool == VLC_FALSE )
{
PlayItem( p_playlist );
}
}
else if( p_playlist->i_status == PLAYLIST_STOPPED )
{
vlc_mutex_unlock( &p_playlist->object_lock );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment