]> git.sesse.net Git - vlc/commitdiff
* include/vlc/vlc.h:
authorDerk-Jan Hartman <hartman@videolan.org>
Sat, 20 Sep 2003 19:37:54 +0000 (19:37 +0000)
committerDerk-Jan Hartman <hartman@videolan.org>
Sat, 20 Sep 2003 19:37:54 +0000 (19:37 +0000)
  - removed the defines for i_mode concerning random and loop. We use config
    variables for all of these.
* src/libvlc.h:
  - removed the enqueue playlist config option. It's no longer used.
  - added a repeat option. vlc will keep playing the same playlist_item,
    until the option is unset.
* src/playlist/playlist.c:
  - added a repeat, random and loop variable.
  - wxwindows should use these as well I think.
* modules/gui/macosx:
  - added the INTF_ABOUT_MSG to the about dialog.
  - implemented the about and repeat items.

12 files changed:
extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib
extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib
extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib
include/vlc/vlc.h
modules/gui/macosx/about.m
modules/gui/macosx/controls.h
modules/gui/macosx/controls.m
modules/gui/macosx/intf.h
modules/gui/macosx/intf.m
modules/gui/macosx/vout.m
src/libvlc.h
src/playlist/playlist.c

index 6116211b841b2863a74dfb37aa1f01e969fd03a9..b6e5d083c2430dae68cbcd13b180a66e2fe0e72a 100644 (file)
@@ -27,6 +27,8 @@
                 pause = id; 
                 play = id; 
                 prev = id; 
+                random = id; 
+                repeat = id; 
                 slower = id; 
                 stop = id; 
                 toggleVar = id; 
                 "o_mi_previous" = id; 
                 "o_mi_program" = id; 
                 "o_mi_quit" = id; 
+                "o_mi_random" = id; 
                 "o_mi_readme" = id; 
+                "o_mi_repeat" = id; 
                 "o_mi_reportabug" = id; 
                 "o_mi_screen" = id; 
                 "o_mi_select_all" = id; 
index 24dd17e8e88087b395bac615b1b93e559fce3929..e79f79e539ddaeb0b218384a53a8388729e7f74a 100644 (file)
@@ -23,7 +23,7 @@
        </array>
        <key>IBOpenObjects</key>
        <array>
-               <integer>636</integer>
+               <integer>29</integer>
        </array>
        <key>IBSystem Version</key>
        <string>6L60</string>
index f5fbdb2aa597ff8d6c5c4c3ac1d73c516a14341c..f8113dae160c10952424f6259268960cf30d1aa3 100644 (file)
Binary files a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib and b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib differ
index e823b028ca632f96a6186dfca9af4a0d17dcdca1..46b26d1a89fac6959092cb2e762504e03953dec6 100644 (file)
@@ -2,7 +2,7 @@
  * vlc.h: global header for vlc
  *****************************************************************************
  * Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: vlc.h,v 1.26 2003/09/07 22:45:16 fenrir Exp $
+ * $Id: vlc.h,v 1.27 2003/09/20 19:37:53 hartman Exp $
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -97,15 +97,6 @@ struct vlc_list_t
 
 #define PLAYLIST_END           -666
 
-/* Playlist parsing mode */
-#define PLAYLIST_REPEAT_CURRENT   0             /* Keep playing current item */
-#define PLAYLIST_FORWARD          1              /* Parse playlist until end */
-#define PLAYLIST_BACKWARD        -1                       /* Parse backwards */
-#define PLAYLIST_FORWARD_LOOP     2               /* Parse playlist and loop */
-#define PLAYLIST_BACKWARD_LOOP   -2              /* Parse backwards and loop */
-#define PLAYLIST_RANDOM           3                          /* Shuffle play */
-#define PLAYLIST_REVERSE_RANDOM  -3                  /* Reverse shuffle play */
-
 /** Playlist commands */
 typedef enum {
     PLAYLIST_PLAY,                              /**< Starts playing. No arg. */
index b5ddbda99b96eb6f9ee9c905e6780a9204eaebfd..cf3af32fcbe12c6ba5ccbf7640ebd7f6328376b3 100644 (file)
@@ -2,7 +2,7 @@
  * about.m: MacOS X About Panel
  *****************************************************************************
  * Copyright (C) 2001-2003 VideoLAN
- * $Id: about.m,v 1.2 2003/05/11 23:17:30 hartman Exp $
+ * $Id: about.m,v 1.3 2003/09/20 19:37:53 hartman Exp $
  *
  * Authors: Derk-Jan Hartman <thedj@users.sourceforge.net>
  *
@@ -84,7 +84,7 @@ static VLAboutBox *_o_sharedInstance = nil;
         o_credits = [[NSString alloc] initWithData: [NSData dataWithContentsOfFile: o_credits_path ] encoding:NSWindowsCP1252StringEncoding];
         
         /* Parse the authors string */
-        NSMutableString *o_outString = [NSMutableString string];
+        NSMutableString *o_outString = [NSMutableString stringWithFormat: @"%@\n\n", _NS(INTF_ABOUT_MSG)];
         NSScanner *o_scan_credits = [NSScanner scannerWithString: o_credits];
         NSCharacterSet *o_stopSet = [NSCharacterSet characterSetWithCharactersInString:@"\n\r"];
         
index fa4e0fcd64404c30cf586538983aee9cec107fb9..8e767a54a30529746b291acdab59c70ff60e5876 100644 (file)
@@ -2,7 +2,7 @@
  * controls.h: MacOS X interface plugin
  *****************************************************************************
  * Copyright (C) 2002-2003 VideoLAN
- * $Id: controls.h,v 1.6 2003/06/03 22:21:46 hartman Exp $
+ * $Id: controls.h,v 1.7 2003/09/20 19:37:53 hartman Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Christophe Massiot <massiot@via.ecp.fr>
@@ -41,6 +41,8 @@
 
 - (IBAction)prev:(id)sender;
 - (IBAction)next:(id)sender;
+- (IBAction)random:(id)sender;
+- (IBAction)repeat:(id)sender;
 - (IBAction)loop:(id)sender;
 
 - (IBAction)forward:(id)sender;
index 7e55915b89221808a7790636a182b0a7b209f061..1229bd5cc9dc86cc094f1fd0732896e4f62028b1 100644 (file)
@@ -2,7 +2,7 @@
  * controls.m: MacOS X interface plugin
  *****************************************************************************
  * Copyright (C) 2002-2003 VideoLAN
- * $Id: controls.m,v 1.48 2003/09/20 13:46:00 hartman Exp $
+ * $Id: controls.m,v 1.49 2003/09/20 19:37:53 hartman Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Christophe Massiot <massiot@via.ecp.fr>
     vlc_object_release( p_playlist );
 }
 
-- (IBAction)loop:(id)sender
+- (IBAction)random:(id)sender
+{
+    intf_thread_t * p_intf = [NSApp getIntf];
+    vlc_value_t val;
+    playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
+                                                       FIND_ANYWHERE );
+    if( p_playlist == NULL )
+    {
+        return;
+    }
+
+    var_Get( p_playlist, "random", &val );
+    val.b_bool = !val.b_bool;
+    var_Set( p_playlist, "random", val );
+
+    vlc_object_release( p_playlist );
+}
+
+- (IBAction)repeat:(id)sender
 {
     intf_thread_t * p_intf = [NSApp getIntf];
+    vlc_value_t val;
+    playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
+                                                       FIND_ANYWHERE );
+    if( p_playlist == NULL )
+    {
+        return;
+    }
+
+    var_Get( p_playlist, "repeat", &val );
+    val.b_bool = !val.b_bool;
+    var_Set( p_playlist, "repeat", val );
+
+    vlc_object_release( p_playlist );
+}
 
+- (IBAction)loop:(id)sender
+{
+    intf_thread_t * p_intf = [NSApp getIntf];
+    vlc_value_t val;
     playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
                                                        FIND_ANYWHERE );
     if( p_playlist == NULL )
         return;
     }
 
-    config_PutInt( p_playlist, "loop",
-                   !config_GetInt( p_playlist, "loop" ) );
+    var_Get( p_playlist, "loop", &val );
+    val.b_bool = !val.b_bool;
+    var_Set( p_playlist, "loop", val );
 
     vlc_object_release( p_playlist );
 }
     if( p_input != NULL )
     {
         vlc_value_t time;
-        time.f_float = 5;
+        time.i_time = 5 * 1000000;
         var_Set( p_input, "time-offset", time );
         vlc_object_release( p_input );
     }
     if( p_input != NULL )
     {
         vlc_value_t time;
-        time.f_float = -5;
+        time.i_time = -5 * 1000000;
         var_Set( p_input, "time-offset", time );
         vlc_object_release( p_input );
     }
 - (BOOL)validateMenuItem:(NSMenuItem *)o_mi
 {
     BOOL bEnabled = TRUE;
+    vlc_value_t val;
     intf_thread_t * p_intf = [NSApp getIntf];
-
     playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
                                                        FIND_ANYWHERE );
 
             }
         }
     }
-    else if( [[o_mi title] isEqualToString: _NS("Loop")] )
+    else if( [[o_mi title] isEqualToString: _NS("Shuffle")] )
     {
-        int i_state = config_GetInt( p_playlist, "loop" ) ?
-                      NSOnState : NSOffState;
-
+        int i_state;
+        var_Get( p_playlist, "random", &val );
+        i_state = val.b_bool ? NSOnState : NSOffState;
+        [o_mi setState: i_state];
+    }
+    else if( [[o_mi title] isEqualToString: _NS("Repeat Item")] )
+    {
+        int i_state;
+        var_Get( p_playlist, "repeat", &val );
+        i_state = val.b_bool ? NSOnState : NSOffState;
+        [o_mi setState: i_state];
+    }
+    else if( [[o_mi title] isEqualToString: _NS("Repeat Playlist")] )
+    {
+        int i_state;
+        var_Get( p_playlist, "loop", &val );
+        i_state = val.b_bool ? NSOnState : NSOffState;
         [o_mi setState: i_state];
     }
     else if( [[o_mi title] isEqualToString: _NS("Step Forward")] ||
index 47bbc004afb1b18d1f7811854e5eb308c808605c..ae256bbb43fd0c7701103ea7be9b62fa8548c497 100644 (file)
@@ -2,7 +2,7 @@
  * intf.h: MacOS X interface plugin
  *****************************************************************************
  * Copyright (C) 2002-2003 VideoLAN
- * $Id: intf.h,v 1.44 2003/09/20 13:46:00 hartman Exp $
+ * $Id: intf.h,v 1.45 2003/09/20 19:37:53 hartman Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Christophe Massiot <massiot@via.ecp.fr>
@@ -160,6 +160,8 @@ struct intf_sys_t
     IBOutlet id o_mi_slower;
     IBOutlet id o_mi_previous;
     IBOutlet id o_mi_next;
+    IBOutlet id o_mi_random;
+    IBOutlet id o_mi_repeat;
     IBOutlet id o_mi_loop;
     IBOutlet id o_mi_fwd;
     IBOutlet id o_mi_bwd;
index bec07f92c5e66f7a9e50ae3a9a29df358f0f7955..443a0696e9c1c5aaae2ae57b92e1311c5cecc8ed 100644 (file)
@@ -2,7 +2,7 @@
  * intf.m: MacOS X interface plugin
  *****************************************************************************
  * Copyright (C) 2002-2003 VideoLAN
- * $Id: intf.m,v 1.95 2003/09/20 13:46:00 hartman Exp $
+ * $Id: intf.m,v 1.96 2003/09/20 19:37:53 hartman Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Christophe Massiot <massiot@via.ecp.fr>
@@ -347,7 +347,9 @@ int PlaylistChanged( vlc_object_t *p_this, const char *psz_variable,
     [o_mi_slower setTitle: _NS("Slower")];
     [o_mi_previous setTitle: _NS("Previous")];
     [o_mi_next setTitle: _NS("Next")];
-    [o_mi_loop setTitle: _NS("Loop")];
+    [o_mi_random setTitle: _NS("Shuffle")];
+    [o_mi_repeat setTitle: _NS("Repeat Item")];
+    [o_mi_loop setTitle: _NS("Repeat Playlist")];
     [o_mi_fwd setTitle: _NS("Step Forward")];
     [o_mi_bwd setTitle: _NS("Step Backward")];
     [o_mi_program setTitle: _NS("Program")];
index 2ef183fe3c6f2dd3b5b9bcaf5ee8e12ff7d7ea65..2d0a058e74fe5dddf07d1608a28b4fcc695360da 100644 (file)
@@ -3,7 +3,7 @@
  * vout.m: MacOS X video output plugin
  *****************************************************************************
  * Copyright (C) 2001-2003 VideoLAN
- * $Id: vout.m,v 1.56 2003/09/20 13:46:00 hartman Exp $
+ * $Id: vout.m,v 1.57 2003/09/20 19:37:53 hartman Exp $
  *
  * Authors: Colin Delacroix <colin@zoy.org>
  *          Florian G. Pflug <fgp@phlo.org>
@@ -1412,7 +1412,7 @@ static void QTFreePicture( vout_thread_t *p_vout, picture_t *p_pic )
             backing: NSBackingStoreBuffered
             defer: NO screen: o_screen];
 
-        [p_vout->p_sys->o_window setLevel: NSPopUpMenuWindowLevel - 1];
+        //[p_vout->p_sys->o_window setLevel: NSPopUpMenuWindowLevel - 1];
         p_vout->p_sys->b_mouse_moved = YES;
         p_vout->p_sys->i_time_mouse_last_moved = mdate();
     }
index 335ecdbdd30a7b3faa0c0ab09364dacf13687c34..734a589980e9282cfe67d3192c2548489adff796 100644 (file)
@@ -2,7 +2,7 @@
  * libvlc.h: main libvlc header
  *****************************************************************************
  * Copyright (C) 1998-2002 VideoLAN
- * $Id: libvlc.h,v 1.85 2003/09/20 02:47:41 hartman Exp $
+ * $Id: libvlc.h,v 1.86 2003/09/20 19:37:54 hartman Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -374,15 +374,15 @@ static char *ppsz_language[] = { "auto", "en", "en_GB", "es", "de", "fr", "it",
     "When selected, VLC will randomly play files in the playlist until " \
     "interrupted.")
 
-#define ENQUEUE_TEXT N_("Enqueue items in playlist")
-#define ENQUEUE_LONGTEXT N_( \
-    "If you want VLC to add items to the playlist as you open them, then " \
-    "enable this option.")
-
 #define LOOP_TEXT N_("Loop playlist on end")
 #define LOOP_LONGTEXT N_( \
     "If you want VLC to keep playing the playlist indefinitely then enable " \
     "this option.")
+    
+#define REPEAT_TEXT N_("Repeat the current playlistitem")
+#define REPEAT_LONGTEXT N_( \
+    "When this is active VLC will keep playing the current playlistitem " \
+    "over and over again.")
 
 #define MEMCPY_TEXT N_("Memory copy module")
 #define MEMCPY_LONGTEXT N_( \
@@ -606,8 +606,8 @@ vlc_module_begin();
     /* Playlist options */
     add_category_hint( N_("Playlist"), NULL, VLC_FALSE );
     add_bool_with_short( "random", 'Z', 0, NULL, RANDOM_TEXT, RANDOM_LONGTEXT, VLC_FALSE );
-    add_bool( "enqueue", 0, NULL, ENQUEUE_TEXT, ENQUEUE_LONGTEXT, VLC_FALSE );
     add_bool( "loop", 0, NULL, LOOP_TEXT, LOOP_LONGTEXT, VLC_FALSE );
+    add_bool( "repeat", 0, NULL, REPEAT_TEXT, REPEAT_LONGTEXT, VLC_TRUE );
 
     /* Misc options */
     add_category_hint( N_("Miscellaneous"), NULL, VLC_TRUE );
index c36aa79f287277aea2df358ef949fe97b248d317..ccff3f762cb4ddb316d53c9eb8373bb4c4072012 100644 (file)
@@ -2,7 +2,7 @@
  * playlist.c : Playlist management functions
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: playlist.c,v 1.53 2003/09/19 21:53:48 fenrir Exp $
+ * $Id: playlist.c,v 1.54 2003/09/20 19:37:54 hartman Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -73,6 +73,10 @@ playlist_t * __playlist_Create ( vlc_object_t *p_parent )
     var_Create( p_playlist, "intf-show", VLC_VAR_BOOL );
     val.b_bool = VLC_TRUE;
     var_Set( p_playlist, "intf-show", val );
+    
+    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 );
 
     p_playlist->p_input = NULL;
     p_playlist->i_status = PLAYLIST_STOPPED;
@@ -784,7 +788,7 @@ static void RunThread ( playlist_t *p_playlist )
 static void SkipItem( playlist_t *p_playlist, int i_arg )
 {
     int i_oldindex = p_playlist->i_index;
-    vlc_bool_t b_random;
+    vlc_bool_t b_random, b_repeat, b_loop;
     vlc_value_t val;
 
     /* If the playlist is empty, there is no current item */
@@ -794,7 +798,12 @@ static void SkipItem( playlist_t *p_playlist, int i_arg )
         return;
     }
 
-    b_random = config_GetInt( p_playlist, "random" );
+    var_Get( p_playlist, "random", &val );
+    b_random = val.b_bool;
+    var_Get( p_playlist, "repeat", &val );
+    b_repeat = val.b_bool;
+    var_Get( p_playlist, "loop", &val );
+    b_loop = val.b_bool;
 
     /* Increment */
     if( b_random )
@@ -809,7 +818,10 @@ static void SkipItem( playlist_t *p_playlist, int i_arg )
             i_arg = (int)((float)p_playlist->i_size * rand() / (RAND_MAX+1.0));
         }
     }
-
+    if( b_repeat )
+    {
+        i_arg = 0;
+    }
     p_playlist->i_index += i_arg;
 
     /* Boundary check */
@@ -817,7 +829,7 @@ static void SkipItem( playlist_t *p_playlist, int i_arg )
     {
         if( p_playlist->i_status == PLAYLIST_STOPPED
              || b_random
-             || config_GetInt( p_playlist, "loop" ) )
+             || b_loop )
         {
             p_playlist->i_index -= p_playlist->i_size
                          * ( p_playlist->i_index / p_playlist->i_size );