]> git.sesse.net Git - vlc/commitdiff
* added an option to disable auto-playback of newly added items
authorFelix Paul Kühne <fkuehne@videolan.org>
Thu, 9 Nov 2006 14:17:03 +0000 (14:17 +0000)
committerFelix Paul Kühne <fkuehne@videolan.org>
Thu, 9 Nov 2006 14:17:03 +0000 (14:17 +0000)
modules/gui/macosx/macosx.m
modules/gui/macosx/open.h
modules/gui/macosx/open.m

index 5f9c525fd3fd7df4e5adad230cad917c3fa170e0..3dd28e626c8dc59c0812d14137cbc7a8a4f51d9c 100644 (file)
@@ -78,6 +78,10 @@ void E_(CloseVideoGL) ( vlc_object_t * );
 #define WIZARD_OPTIONS_SAVING_LONGTEXT N_("Remember the options in the " \
         "wizard during one session of VLC.") 
 
+#define AUTOPLAY_OSX_TEST N_("Auto-playback of new items")
+#define AUTOPLAY_OSX_LONGTEXT N_("Start playback of new items immediately " \
+        "once they were added." )
+
 vlc_module_begin();
     set_description( _("Mac OS X interface") );
     set_capability( "interface", 100 );
@@ -86,6 +90,8 @@ vlc_module_begin();
     set_subcategory( SUBCAT_INTERFACE_MAIN );
     add_bool( "macosx-embedded", 1, NULL, EMBEDDED_TEXT, EMBEDDED_LONGTEXT,
                      VLC_FALSE );
+    add_bool( "macosx-autoplay", 1, NULL, AUTOPLAY_OSX_TEST, AUTOPLAY_OSX_LONGTEXT,
+                     VLC_FALSE );
     add_bool( "macosx-wizard-keep", 1, NULL, WIZARD_OPTIONS_SAVING_TEXT,
                 WIZARD_OPTIONS_SAVING_LONGTEXT, VLC_TRUE );
 
index 09794603f1ae9ae898b2e034fea0581de44d9854..d51fac6835aa0bf1c0fd4fca1d7f93d8bde1fb04 100644 (file)
@@ -1,12 +1,13 @@
 /*****************************************************************************
  * open.h: MacOS X module for vlc
  *****************************************************************************
- * Copyright (C) 2002-2005 the VideoLAN team
+ * Copyright (C) 2002-2006 the VideoLAN team
  * $Id$
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Christophe Massiot <massiot@via.ecp.fr>
  *          Derk-Jan Hartman <thedj@users.sourceforge.net>
+ *          Felix K\9fhne <fkuehne at videolan dot org>
  *
  * 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
@@ -95,6 +96,8 @@ NSArray *GetEjectableMediaOfClass( const char *psz_class );
 
     IBOutlet id o_output_ckbox;
     IBOutlet id o_sout_options;
+    
+    BOOL * b_autoplay;
 }
 
 + (VLCOpen *)sharedInstance;
index e6c5b05b7e0cbddd43f7c905f4a26bc452a07fda..1b366975e535c705c0f8321bed76dee94b357a61 100644 (file)
@@ -1,13 +1,14 @@
 /*****************************************************************************
  * open.m: MacOS X module for vlc
  *****************************************************************************
- * Copyright (C) 2002-2005 the VideoLAN team
+ * Copyright (C) 2002-2006 the VideoLAN team
  * $Id$
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net> 
  *          Christophe Massiot <massiot@via.ecp.fr>
  *          Derk-Jan Hartman <thedj@users.sourceforge.net>
  *          Benjamin Pracht <bigben at videolan dot org>
+ *          Felix K\9fhne <fkuehne at videolan dot org>
  *
  * 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
@@ -42,6 +43,7 @@
 #include "playlist.h"
 #include "open.h"
 #include "output.h"
+#import <vlc/intf.h>
 
 /*****************************************************************************
  * GetEjectableMediaOfClass 
@@ -304,6 +306,9 @@ static VLCOpen *_o_sharedMainInstance = nil;
 - (void)openTarget:(int)i_type
 {
     int i_result;
+    intf_thread_t * p_intf = VLCIntf;
+
+    b_autoplay = (BOOL *)config_GetInt( VLCIntf, "macosx-autoplay" );
 
     [o_tabview selectTabViewItemAtIndex: i_type];
     [o_file_sub_ckbox setState: NSOffState];
@@ -320,7 +325,6 @@ static VLCOpen *_o_sharedMainInstance = nil;
         o_dic = [NSMutableDictionary dictionaryWithObject: [o_mrl stringValue] forKey: @"ITEM_URL"];
         if( [o_file_sub_ckbox state] == NSOnState )
         {
-            intf_thread_t * p_intf = VLCIntf;
             module_config_t * p_item;
 
             [o_options addObject: [NSString stringWithFormat: @"sub-file=%@", [o_file_sub_path stringValue]]];
@@ -360,7 +364,10 @@ static VLCOpen *_o_sharedMainInstance = nil;
                                                 @"access-filter=timeshift"]];
         }
         [o_dic setObject: (NSArray *)[o_options copy] forKey: @"ITEM_OPTIONS"];
-        [o_playlist appendArray: [NSArray arrayWithObject: o_dic] atPos: -1 enqueue:NO];
+        if( b_autoplay )
+            [o_playlist appendArray: [NSArray arrayWithObject: o_dic] atPos: -1 enqueue:NO];
+        else
+            [o_playlist appendArray: [NSArray arrayWithObject: o_dic] atPos: -1 enqueue:YES];
     }
 }
 
@@ -731,6 +738,7 @@ static VLCOpen *_o_sharedMainInstance = nil;
 {
     NSOpenPanel *o_open_panel = [NSOpenPanel openPanel];
     int i;
+    b_autoplay = (BOOL *)config_GetInt( VLCIntf, "macosx-autoplay" );
     
     [o_open_panel setAllowsMultipleSelection: YES];
     [o_open_panel setCanChooseDirectories: YES];
@@ -750,7 +758,10 @@ static VLCOpen *_o_sharedMainInstance = nil;
             o_dic = [NSDictionary dictionaryWithObject:[o_values objectAtIndex:i] forKey:@"ITEM_URL"];
             o_array = [o_array arrayByAddingObject: o_dic];
         }
-        [o_playlist appendArray: o_array atPos: -1 enqueue:NO];
+        if( b_autoplay )
+            [o_playlist appendArray: o_array atPos: -1 enqueue:NO];
+        else
+            [o_playlist appendArray: o_array atPos: -1 enqueue:YES];
     }
 }