Commit b9c4dee2 authored by Felix Paul Kühne's avatar Felix Paul Kühne

* added an option to disable auto-playback of newly added items

parent 1d524052
......@@ -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 );
......
/*****************************************************************************
* 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 Khne <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;
......
/*****************************************************************************
* 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 Khne <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];
}
}
......
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