* src/libvlc.h
authorDerk-Jan Hartman <hartman@videolan.org>
Thu, 27 May 2004 00:02:43 +0000 (00:02 +0000)
committerDerk-Jan Hartman <hartman@videolan.org>
Thu, 27 May 2004 00:02:43 +0000 (00:02 +0000)
   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).

modules/demux/demux2.c
src/libvlc.h
src/playlist/playlist.c

index ef8b4da..c8b5af6 100644 (file)
@@ -67,6 +67,7 @@ vlc_module_begin();
     add_shortcut( "ogg" );
     add_shortcut( "h264" );
     add_shortcut( "avi" );
+    add_shortcut( "mjpeg" );
 vlc_module_end();
 
 /*****************************************************************************
index 2996933..ab895c9 100644 (file)
@@ -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 );
index 5dbe6a8..d1d3408 100644 (file)
@@ -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,14 +400,18 @@ 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);
-            PlayItem( p_playlist );
+            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 )
         {