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

macosx: upgrade read-only array initializations to the modern ObjC syntax

No functional changes
parent a7440cba
......@@ -379,7 +379,7 @@ static AppleRemote* sharedInstance=nil;
eventNumber= [NSNumber numberWithUnsignedInt:event];
}
[self performSelector: @selector(executeClickCountEvent:)
withObject: [NSArray arrayWithObjects:eventNumber, timeNumber, nil]
withObject: @[eventNumber, timeNumber]
afterDelay: _maxClickTimeDifference];
} else {
[delegate appleRemoteButton:event pressedDown: pressedDown clickCount:1];
......
......@@ -84,7 +84,7 @@ static VLCAudioEffects *_o_sharedInstance = nil;
NSString *defaultProfile = [NSString stringWithFormat:@"ZmxhdA==;;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%i",
.0,25.,100.,-11.,8.,2.5,7.,.85,1.,.4,.5,.5,2.,0];
NSDictionary *appDefaults = [NSDictionary dictionaryWithObjectsAndKeys:[NSArray arrayWithArray:workValues], @"EQValues", [NSArray arrayWithArray:workPreamp], @"EQPreampValues", [NSArray arrayWithArray:workTitles], @"EQTitles", [NSArray arrayWithArray:workNames], @"EQNames", [NSArray arrayWithObject:defaultProfile], @"AudioEffectProfiles", [NSArray arrayWithObject:_NS("Default")], @"AudioEffectProfileNames", nil];
NSDictionary *appDefaults = [NSDictionary dictionaryWithObjectsAndKeys:[NSArray arrayWithArray:workValues], @"EQValues", [NSArray arrayWithArray:workPreamp], @"EQPreampValues", [NSArray arrayWithArray:workTitles], @"EQTitles", [NSArray arrayWithArray:workNames], @"EQNames", @[defaultProfile], @"AudioEffectProfiles", @[_NS("Default")], @"AudioEffectProfileNames", nil];
[defaults registerDefaults:appDefaults];
[workValues release];
......
......@@ -217,18 +217,12 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
[self setProfileNames: [defaults arrayForKey:@"CASProfileNames"]];
[self recreateProfilePopup];
_videoCodecs = [[NSArray alloc] initWithObjects:
[NSArray arrayWithObjects:@"MPEG-1", @"MPEG-2", @"MPEG-4", @"DIVX 1", @"DIVX 2", @"DIVX 3", @"H.263", @"H.264", @"VP8", @"WMV1", @"WMV2", @"M-JPEG", @"Theora", @"Dirac", nil],
[NSArray arrayWithObjects:@"mpgv", @"mp2v", @"mp4v", @"DIV1", @"DIV2", @"DIV3", @"H263", @"h264", @"VP80", @"WMV1", @"WMV2", @"MJPG", @"theo", @"drac", nil],
nil];
_audioCodecs = [[NSArray alloc] initWithObjects:
[NSArray arrayWithObjects:@"MPEG Audio", @"MP3", @"MPEG 4 Audio (AAC)", @"A52/AC-3", @"Vorbis", @"Flac", @"Speex", @"WAV", @"WMA2", nil],
[NSArray arrayWithObjects:@"mpga", @"mp3", @"mp4a", @"a52", @"vorb", @"flac", @"spx", @"s16l", @"wma2", nil],
nil];
_subsCodecs = [[NSArray alloc] initWithObjects:
[NSArray arrayWithObjects:@"DVB subtitle", @"T.140", nil],
[NSArray arrayWithObjects:@"dvbs", @"t140", nil],
nil];
_videoCodecs = @[@[@"MPEG-1", @"MPEG-2", @"MPEG-4", @"DIVX 1", @"DIVX 2", @"DIVX 3", @"H.263", @"H.264", @"VP8", @"WMV1", @"WMV2", @"M-JPEG", @"Theora", @"Dirac"],
@[@"mpgv", @"mp2v", @"mp4v", @"DIV1", @"DIV2", @"DIV3", @"H263", @"h264", @"VP80", @"WMV1", @"WMV2", @"MJPG", @"theo", @"drac"]];
_audioCodecs = @[@[@"MPEG Audio", @"MP3", @"MPEG 4 Audio (AAC)", @"A52/AC-3", @"Vorbis", @"Flac", @"Speex", @"WAV", @"WMA2"],
@[@"mpga", @"mp3", @"mp4a", @"a52", @"vorb", @"flac", @"spx", @"s16l", @"wma2"]];
_subsCodecs = @[@[@"DVB subtitle", @"T.140"],
@[@"dvbs", @"t140"]];
[_customize_vid_codec_pop removeAllItems];
[_customize_vid_scale_pop removeAllItems];
......@@ -430,7 +424,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
[saveFilePanel setCanSelectHiddenExtension: YES];
[saveFilePanel setCanCreateDirectories: YES];
if ([[_customize_encap_matrix selectedCell] tag] != RAW) // there is no clever guess for this
[saveFilePanel setAllowedFileTypes:[NSArray arrayWithObject:[self currentEncapsulationFormatAsFileExtension:YES]]];
[saveFilePanel setAllowedFileTypes:@[[self currentEncapsulationFormatAsFileExtension:YES]]];
[saveFilePanel beginSheetModalForWindow:_window completionHandler:^(NSInteger returnCode) {
if (returnCode == NSOKButton) {
[self setOutputDestination:[[saveFilePanel URL] path]];
......@@ -530,7 +524,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
NSSavePanel * saveFilePanel = [NSSavePanel savePanel];
[saveFilePanel setCanSelectHiddenExtension: YES];
[saveFilePanel setCanCreateDirectories: YES];
[saveFilePanel setAllowedFileTypes:[NSArray arrayWithObject:@"sdp"]];
[saveFilePanel setAllowedFileTypes:@[@"sdp"]];
[saveFilePanel beginSheetModalForWindow:_stream_panel completionHandler:^(NSInteger returnCode) {
if (returnCode == NSOKButton)
[_stream_sdp_fld setStringValue:[[saveFilePanel URL] path]];
......@@ -540,7 +534,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
{
NSPasteboard *paste = [sender draggingPasteboard];
NSArray *types = [NSArray arrayWithObjects: NSFilenamesPboardType, @"VLCPlaylistItemPboardType", nil];
NSArray *types = @[NSFilenamesPboardType, @"VLCPlaylistItemPboardType"];
NSString *desired_type = [paste availableTypeFromArray: types];
NSData *carried_data = [paste dataForType: desired_type];
......@@ -1004,7 +998,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
- (void)awakeFromNib
{
[self registerForDraggedTypes:[NSArray arrayWithObjects: NSFilenamesPboardType, @"VLCPlaylistItemPboardType", nil]];
[self registerForDraggedTypes:@[NSFilenamesPboardType, @"VLCPlaylistItemPboardType"]];
}
- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
......@@ -1070,7 +1064,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
- (void)awakeFromNib
{
[self registerForDraggedTypes:[NSArray arrayWithObjects: NSFilenamesPboardType, @"VLCPlaylistItemPboardType", nil]];
[self registerForDraggedTypes:@[NSFilenamesPboardType, @"VLCPlaylistItemPboardType"]];
}
- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
......@@ -1099,7 +1093,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
- (void)awakeFromNib
{
[self registerForDraggedTypes:[NSArray arrayWithObjects: NSFilenamesPboardType, @"VLCPlaylistItemPboardType", nil]];
[self registerForDraggedTypes:@[NSFilenamesPboardType, @"VLCPlaylistItemPboardType"]];
}
- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
......
......@@ -551,7 +551,7 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
{
NSPasteboard *o_paste = [sender draggingPasteboard];
NSArray *o_types = [NSArray arrayWithObject: NSFilenamesPboardType];
NSArray *o_types = @[NSFilenamesPboardType];
NSString *o_desired_type = [o_paste availableTypeFromArray:o_types];
NSData *o_carried_data = [o_paste dataForType:o_desired_type];
BOOL b_autoplay = config_GetInt(VLCIntf, "macosx-autoplay");
......
......@@ -77,8 +77,8 @@ static VLCMainMenu *_o_sharedInstance = nil;
_NS("URI"), URI_COLUMN,
nil];
// this array also assigns tags (index) to type of menu item
o_ptc_menuorder = [NSArray arrayWithObjects:TRACKNUM_COLUMN, TITLE_COLUMN, ARTIST_COLUMN, DURATION_COLUMN,
GENRE_COLUMN, ALBUM_COLUMN, DESCRIPTION_COLUMN, DATE_COLUMN, LANGUAGE_COLUMN, URI_COLUMN, nil];
o_ptc_menuorder = @[TRACKNUM_COLUMN, TITLE_COLUMN, ARTIST_COLUMN, DURATION_COLUMN,
GENRE_COLUMN, ALBUM_COLUMN, DESCRIPTION_COLUMN, DATE_COLUMN, LANGUAGE_COLUMN, URI_COLUMN];
}
return _o_sharedInstance;
......@@ -925,7 +925,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
[openPanel setCanChooseFiles: YES];
[openPanel setCanChooseDirectories: NO];
[openPanel setAllowsMultipleSelection: YES];
[openPanel setAllowedFileTypes: [NSArray arrayWithObjects: @"cdg",@"@idx",@"srt",@"sub",@"utf",@"ass",@"ssa",@"aqt",@"jss",@"psb",@"rt",@"smi",@"txt",@"smil", nil]];
[openPanel setAllowedFileTypes: @[@"cdg",@"@idx",@"srt",@"sub",@"utf",@"ass",@"ssa",@"aqt",@"jss",@"psb",@"rt",@"smi",@"txt",@"smil"]];
[openPanel setDirectoryURL:[NSURL fileURLWithPath:[[NSString stringWithUTF8String:path] stringByExpandingTildeInPath]]];
i_returnValue = [openPanel runModal];
free(path);
......
......@@ -296,7 +296,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
free(ppsz_longnames);
free(p_categories);
[libraryItem setChildren: [NSArray arrayWithObjects: playlistItem, medialibraryItem, nil]];
[libraryItem setChildren: @[playlistItem, medialibraryItem]];
[o_sidebaritems addObject: libraryItem];
if ([mycompItem hasChildren])
[o_sidebaritems addObject: mycompItem];
......@@ -310,7 +310,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
[o_sidebar_view reloadData];
[o_sidebar_view selectRowIndexes:[NSIndexSet indexSetWithIndex:1] byExtendingSelection:NO];
[o_sidebar_view setDropItem:playlistItem dropChildIndex:NSOutlineViewDropOnItemIndex];
[o_sidebar_view registerForDraggedTypes:[NSArray arrayWithObjects: NSFilenamesPboardType, @"VLCPlaylistItemPboardType", nil]];
[o_sidebar_view registerForDraggedTypes:@[NSFilenamesPboardType, @"VLCPlaylistItemPboardType"]];
[o_sidebar_view setAutosaveName:@"mainwindow-sidebar"];
[(PXSourceList *)o_sidebar_view setDataSource:self];
......@@ -836,7 +836,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
[dict setObject:self forKey:NSViewAnimationTargetKey];
[dict setObject:NSViewAnimationFadeInEffect forKey:NSViewAnimationEffectKey];
o_makekey_anim = [[NSViewAnimation alloc] initWithViewAnimations:[NSArray arrayWithObject:dict]];
o_makekey_anim = [[NSViewAnimation alloc] initWithViewAnimations:@[dict]];
[dict release];
[o_makekey_anim setAnimationBlockingMode: NSAnimationNonblocking];
......
......@@ -131,28 +131,26 @@ static CGEventRef tapEventCallback(CGEventTapProxy proxy, CGEventType type, CGEv
+ (NSArray*)defaultMediaKeyUserBundleIdentifiers;
{
return [NSArray arrayWithObjects:
[[NSBundle mainBundle] bundleIdentifier], // your app
@"com.spotify.client",
@"com.apple.iTunes",
@"com.apple.QuickTimePlayerX",
@"com.apple.quicktimeplayer",
@"com.apple.iWork.Keynote",
@"com.apple.iPhoto",
@"org.videolan.vlc",
@"com.apple.Aperture",
@"com.plexsquared.Plex",
@"com.soundcloud.desktop",
@"org.niltsh.MPlayerX",
@"com.ilabs.PandorasHelper",
@"com.mahasoftware.pandabar",
@"com.bitcartel.pandorajam",
@"org.clementine-player.clementine",
@"fm.last.Last.fm",
@"com.beatport.BeatportPro",
@"com.Timenut.SongKey",
@"com.macromedia.fireworks", // the tap messes up their mouse input
nil
return @[[[NSBundle mainBundle] bundleIdentifier], // your app
@"com.spotify.client",
@"com.apple.iTunes",
@"com.apple.QuickTimePlayerX",
@"com.apple.quicktimeplayer",
@"com.apple.iWork.Keynote",
@"com.apple.iPhoto",
@"org.videolan.vlc",
@"com.apple.Aperture",
@"com.plexsquared.Plex",
@"com.soundcloud.desktop",
@"org.niltsh.MPlayerX",
@"com.ilabs.PandorasHelper",
@"com.mahasoftware.pandabar",
@"com.bitcartel.pandorajam",
@"org.clementine-player.clementine",
@"fm.last.Last.fm",
@"com.beatport.BeatportPro",
@"com.Timenut.SongKey",
@"com.macromedia.fireworks", // the tap messes up their mouse input
];
}
......
......@@ -54,7 +54,8 @@ static VLCVideoEffects *_o_sharedInstance = nil;
+ (void)initialize
{
NSDictionary *appDefaults = [NSDictionary dictionaryWithObjectsAndKeys:[NSArray arrayWithObject:@";;;0;1.000000;1.000000;1.000000;1.000000;0.050000;16;2.000000;OTA=;4;4;0;16711680;20;15;120;Z3JhZGllbnQ=;1;0;16711680;6;80;VkxD;-1;;-1;255;2;3;3"], @"VideoEffectProfiles", [NSArray arrayWithObject:_NS("Default")], @"VideoEffectProfileNames", nil];
NSDictionary *appDefaults = [NSDictionary dictionaryWithObjectsAndKeys:@[@";;;0;1.000000;1.000000;1.000000;1.000000;0.050000;16;2.000000;OTA=;4;4;0;16711680;20;15;120;Z3JhZGllbnQ=;1;0;16711680;6;80;VkxD;-1;;-1;255;2;3;3"], @"VideoEffectProfiles",
@[_NS("Default")], @"VideoEffectProfileNames", nil];
[[NSUserDefaults standardUserDefaults] registerDefaults:appDefaults];
}
......
......@@ -62,7 +62,7 @@
-(id)initWithFrame:(NSRect)frameRect
{
if (self = [super initWithFrame:frameRect]) {
[self registerForDraggedTypes:[NSArray arrayWithObject: NSFilenamesPboardType]];
[self registerForDraggedTypes:@[NSFilenamesPboardType]];
}
i_lastScrollWheelDirection = 0;
......
......@@ -123,7 +123,7 @@
[dict setObject:self forKey:NSViewAnimationTargetKey];
[dict setObject:NSViewAnimationFadeOutEffect forKey:NSViewAnimationEffectKey];
anim = [[NSViewAnimation alloc] initWithViewAnimations:[NSArray arrayWithObjects:dict, nil]];
anim = [[NSViewAnimation alloc] initWithViewAnimations:@[dict]];
[dict release];
[anim setAnimationBlockingMode:NSAnimationNonblocking];
......@@ -176,7 +176,7 @@
[dict setObject:self forKey:NSViewAnimationTargetKey];
[dict setObject:NSViewAnimationFadeInEffect forKey:NSViewAnimationEffectKey];
anim = [[NSViewAnimation alloc] initWithViewAnimations:[NSArray arrayWithObjects:dict, nil]];
anim = [[NSViewAnimation alloc] initWithViewAnimations:@[dict]];
[dict release];
[anim setAnimationBlockingMode:NSAnimationNonblocking];
......@@ -859,8 +859,8 @@
- Keep at most 2 animation at a time
- leaveFullscreen/enterFullscreen are the only responsible for releasing and alloc-ing
*/
o_fullscreen_anim1 = [[NSViewAnimation alloc] initWithViewAnimations:[NSArray arrayWithObject:dict1]];
o_fullscreen_anim2 = [[NSViewAnimation alloc] initWithViewAnimations:[NSArray arrayWithObject:dict2]];
o_fullscreen_anim1 = [[NSViewAnimation alloc] initWithViewAnimations:@[dict1]];
o_fullscreen_anim2 = [[NSViewAnimation alloc] initWithViewAnimations:@[dict2]];
[dict1 release];
[dict2 release];
......@@ -978,7 +978,7 @@
[dict2 setObject:self forKey:NSViewAnimationTargetKey];
[dict2 setObject:NSViewAnimationFadeInEffect forKey:NSViewAnimationEffectKey];
o_fullscreen_anim2 = [[NSViewAnimation alloc] initWithViewAnimations:[NSArray arrayWithObjects:dict2, nil]];
o_fullscreen_anim2 = [[NSViewAnimation alloc] initWithViewAnimations:@[dict2]];
[dict2 release];
[o_fullscreen_anim2 setAnimationBlockingMode: NSAnimationNonblocking];
......@@ -993,7 +993,7 @@
[dict1 setObject:[NSValue valueWithRect:[o_fullscreen_window frame]] forKey:NSViewAnimationStartFrameKey];
[dict1 setObject:[NSValue valueWithRect:frame] forKey:NSViewAnimationEndFrameKey];
o_fullscreen_anim1 = [[NSViewAnimation alloc] initWithViewAnimations:[NSArray arrayWithObjects:dict1, nil]];
o_fullscreen_anim1 = [[NSViewAnimation alloc] initWithViewAnimations:@[dict1]];
[dict1 release];
[o_fullscreen_anim1 setAnimationBlockingMode: NSAnimationNonblocking];
......@@ -1074,11 +1074,10 @@
static NSMutableArray *attributes = nil;
if (attributes == nil) {
attributes = [[super accessibilityAttributeNames] mutableCopy];
NSArray *appendAttributes = [NSArray arrayWithObjects: NSAccessibilitySubroleAttribute,
NSAccessibilityCloseButtonAttribute,
NSAccessibilityMinimizeButtonAttribute,
NSAccessibilityZoomButtonAttribute,
nil];
NSArray *appendAttributes = @[NSAccessibilitySubroleAttribute,
NSAccessibilityCloseButtonAttribute,
NSAccessibilityMinimizeButtonAttribute,
NSAccessibilityZoomButtonAttribute];
for(NSString *attribute in appendAttributes) {
if (![attributes containsObject:attribute])
......
......@@ -46,7 +46,7 @@
if (o_url != nil)
[[NSDocumentController sharedDocumentController] noteNewRecentDocumentURL: o_url];
NSMutableArray *o_result = [NSMutableArray arrayWithObject:[NSDictionary dictionaryWithObject:o_urlString forKey:@"ITEM_URL"]];
NSArray *o_result = @[[NSDictionary dictionaryWithObject:o_urlString forKey: @"ITEM_URL"]];
if (b_autoplay)
[[[VLCMain sharedInstance] playlist] appendArray: o_result atPos: -1 enqueue: NO];
......
......@@ -1868,7 +1868,7 @@ static VLCMain *_o_sharedMainInstance = nil;
return;
}
NSArray * ourPreferences = [NSArray arrayWithObjects:@"org.videolan.vlc.plist", @"VLC", @"org.videolan.vlc", nil];
NSArray * ourPreferences = @[@"org.videolan.vlc.plist", @"VLC", @"org.videolan.vlc"];
/* Move the file to trash so that user can find them later */
[[NSWorkspace sharedWorkspace] performFileOperation:NSWorkspaceRecycleOperation source:preferences destination:nil files:ourPreferences tag:0];
......@@ -1982,7 +1982,7 @@ static VLCMain *_o_sharedMainInstance = nil;
[saveFolderPanel setCanSelectHiddenExtension: NO];
[saveFolderPanel setCanCreateDirectories: YES];
[saveFolderPanel setAllowedFileTypes: [NSArray arrayWithObject:@"rtf"]];
[saveFolderPanel setAllowedFileTypes: @[@"rtf"]];
[saveFolderPanel setNameFieldStringValue:[NSString stringWithFormat: _NS("VLC Debug Log (%s).rtf"), VERSION_MESSAGE]];
[saveFolderPanel beginSheetModalForWindow: o_msgs_panel completionHandler:^(NSInteger returnCode) {
if (returnCode == NSOKButton) {
......
......@@ -302,7 +302,7 @@ static NSMutableArray *blackoutWindows = NULL;
- (void)awakeFromNib
{
[self registerForDraggedTypes:[NSArray arrayWithObject: NSFilenamesPboardType]];
[self registerForDraggedTypes:@[NSFilenamesPboardType]];
[self setImageScaling: NSScaleToFit];
[self setImageFrameStyle: NSImageFrameNone];
[self setImageAlignment: NSImageAlignCenter];
......@@ -756,7 +756,7 @@ void _drawFrameInRect(NSRect frameRect)
- (void)awakeFromNib
{
[self registerForDraggedTypes:[NSArray arrayWithObject: NSFilenamesPboardType]];
[self registerForDraggedTypes:@[NSFilenamesPboardType]];
}
- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
......
......@@ -514,9 +514,9 @@ static VLCOpen *_o_sharedMainInstance = nil;
/* apply the options to our item(s) */
[o_dic setObject: (NSArray *)[o_options copy] forKey: @"ITEM_OPTIONS"];
if (b_autoplay)
[[[VLCMain sharedInstance] playlist] appendArray: [NSArray arrayWithObject: o_dic] atPos: -1 enqueue:NO];
[[[VLCMain sharedInstance] playlist] appendArray: @[o_dic] atPos: -1 enqueue:NO];
else
[[[VLCMain sharedInstance] playlist] appendArray: [NSArray arrayWithObject: o_dic] atPos: -1 enqueue:YES];
[[[VLCMain sharedInstance] playlist] appendArray: @[o_dic] atPos: -1 enqueue:YES];
}
}
......@@ -1106,7 +1106,7 @@ static VLCOpen *_o_sharedMainInstance = nil;
/* work-around for Mountain Lion, which treats folders called "BDMV" including an item named "INDEX.BDM"
* as a _FILE_. Don't ask, move on. There is nothing to see here */
[o_open_panel setCanChooseFiles: YES];
[o_open_panel setAllowedFileTypes:[NSArray arrayWithObjects:@"public.directory", nil]];
[o_open_panel setAllowedFileTypes:@[@"public.directory"]];
if ([o_open_panel runModal] == NSOKButton) {
NSString *o_path = [[[o_open_panel URLs] objectAtIndex: 0] path];
......
......@@ -112,17 +112,17 @@
- (void)initStrings
{
NSArray *o_muxers = [NSArray arrayWithObjects: @"MPEG TS", @"MPEG PS", @"MPEG 1",
@"Ogg", @"AVI", @"ASF", @"MPEG 4", @"Quicktime", @"Raw", nil];
NSArray *o_a_channels = [NSArray arrayWithObjects: @"1", @"2", @"4", @"6", nil];
NSArray *o_a_bitrates = [NSArray arrayWithObjects: @"16", @"32", @"64", @"96",
@"128", @"192", @"256", @"512", nil];
NSArray *o_v_bitrates = [NSArray arrayWithObjects: @"16", @"32", @"64", @"96",
@"128", @"192", @"256", @"384", @"512", @"768", @"1024", @"2048", @"3072", nil];
NSArray *o_v_scales = [NSArray arrayWithObjects: @"0.25",@"0.5",@"0.75",@"1",@"1.25",@"1.5",@"1.75",@"2",nil];
NSArray *o_a_codecs = [NSArray arrayWithObjects: @"mpga", @"mp3 ", @"mp4a", @"a52 ", @"vorb", @"flac", @"spx ", nil];
NSArray *o_v_codecs = [NSArray arrayWithObjects: @"mp1v", @"mp2v", @"mp4v", @"DIV1",
@"DIV2", @"DIV3", @"h263", @"h264", @"WMV1", @"WMV2", @"MJPG", @"theo", nil];
NSArray *o_muxers = @[@"MPEG TS", @"MPEG PS", @"MPEG 1",
@"Ogg", @"AVI", @"ASF", @"MPEG 4", @"Quicktime", @"Raw"];
NSArray *o_a_channels = @[@"1", @"2", @"4", @"6"];
NSArray *o_a_bitrates = @[@"16", @"32", @"64", @"96",
@"128", @"192", @"256", @"512"];
NSArray *o_v_bitrates = @[@"16", @"32", @"64", @"96",
@"128", @"192", @"256", @"384", @"512", @"768", @"1024", @"2048", @"3072"];
NSArray *o_v_scales = @[@"0.25",@"0.5",@"0.75",@"1",@"1.25",@"1.5",@"1.75",@"2"];
NSArray *o_a_codecs = @[@"mpga", @"mp3 ", @"mp4a", @"a52 ", @"vorb", @"flac", @"spx "];
NSArray *o_v_codecs = @[@"mp1v", @"mp2v", @"mp4v", @"DIV1",
@"DIV2", @"DIV3", @"h263", @"h264", @"WMV1", @"WMV2", @"MJPG", @"theo"];
[o_output_ckbox setTitle: _NS("Streaming/Saving:")];
[o_output_settings setTitle: _NS("Settings...")];
......@@ -340,13 +340,10 @@
if ([o_mode isEqualToString: _NS("File")]) {
if ([o_dump_chkbox state] == NSOnState) {
NSMutableArray * o_sout_options;
o_sout_options = [NSArray arrayWithObjects:
@":demux=dump",
[NSString stringWithFormat:
@":demuxdump-file=%@",
[o_file_field stringValue]],
nil];
o_sout_options = @[@":demux=dump",
[NSString stringWithFormat:
@":demuxdump-file=%@",
[o_file_field stringValue]]];
[self setSoutMRL:o_sout_options];
return;
} else
......@@ -420,7 +417,7 @@
if ([o_display state] == NSOnState)
[o_mrl_string appendString: @"}"];
o_sout_options = [NSArray arrayWithObjects: o_mrl_string,nil];
o_sout_options = @[o_mrl_string];
[self setSoutMRL:o_sout_options];
}
......
......@@ -411,10 +411,10 @@
+ (void)initialize{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSMutableArray * o_columnArray = [[NSMutableArray alloc] init];
[o_columnArray addObject: [NSArray arrayWithObjects: TITLE_COLUMN, [NSNumber numberWithFloat: 190.], nil]];
[o_columnArray addObject: [NSArray arrayWithObjects: ARTIST_COLUMN, [NSNumber numberWithFloat: 95.], nil]];
[o_columnArray addObject: [NSArray arrayWithObjects: DURATION_COLUMN, [NSNumber numberWithFloat: 95.], nil]];
NSDictionary *appDefaults = [NSDictionary dictionaryWithObject:[NSArray arrayWithArray:o_columnArray] forKey:@"PlaylistColumnSelection"];
[o_columnArray addObject: @[TITLE_COLUMN, @190.]];
[o_columnArray addObject: @[ARTIST_COLUMN, @95.]];
[o_columnArray addObject: @[DURATION_COLUMN, @95.]];
NSDictionary *appDefaults = [NSDictionary dictionaryWithObject:[NSArray arrayWithArray:o_columnArray] forKey: @"PlaylistColumnSelection"];
[defaults registerDefaults:appDefaults];
[o_columnArray release];
......@@ -446,14 +446,10 @@
[o_outline_view setDoubleAction: @selector(playItem:)];
[o_outline_view_other setDoubleAction: @selector(playItem:)];
[o_outline_view registerForDraggedTypes:
[NSArray arrayWithObjects: NSFilenamesPboardType,
@"VLCPlaylistItemPboardType", nil]];
[o_outline_view registerForDraggedTypes: @[NSFilenamesPboardType, @"VLCPlaylistItemPboardType"]];
[o_outline_view setIntercellSpacing: NSMakeSize (0.0, 1.0)];
[o_outline_view_other registerForDraggedTypes:
[NSArray arrayWithObjects: NSFilenamesPboardType,
@"VLCPlaylistItemPboardType", nil]];
[o_outline_view_other registerForDraggedTypes: @[NSFilenamesPboardType, @"VLCPlaylistItemPboardType"]];
[o_outline_view_other setIntercellSpacing: NSMakeSize (0.0, 1.0)];
/* This uses a private API, but works fine on all current OSX releases.
......@@ -1374,7 +1370,7 @@
NSTableColumn * o_currentColumn;
for (NSUInteger i = 0; i < count; i++) {
o_currentColumn = [o_columns objectAtIndex: i];
[o_arrayToSave addObject: [NSArray arrayWithObjects: [o_currentColumn identifier], [NSNumber numberWithFloat: [o_currentColumn width]], nil]];
[o_arrayToSave addObject: @[[o_currentColumn identifier], @([o_currentColumn width])]];
}
[[NSUserDefaults standardUserDefaults] setObject: o_arrayToSave forKey:@"PlaylistColumnSelection"];
[[NSUserDefaults standardUserDefaults] synchronize];
......@@ -1424,8 +1420,7 @@
/* We add the "VLCPlaylistItemPboardType" type to be able to recognize
a Drop operation coming from the playlist. */
[pboard declareTypes: [NSArray arrayWithObjects:
@"VLCPlaylistItemPboardType", nil] owner: self];
[pboard declareTypes: @[@"VLCPlaylistItemPboardType"] owner: self];
[pboard setData:[NSData data] forType:@"VLCPlaylistItemPboardType"];
return YES;
......
......@@ -2132,8 +2132,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
[o_tableColumn setDataCell: o_dataCell];
[o_tableColumn setWidth:s_rc.size.width - 34];
[o_tableview addTableColumn: o_tableColumn];
[o_tableview registerForDraggedTypes:[NSArray arrayWithObjects:
@"VLC media player module", nil]];
[o_tableview registerForDraggedTypes:@[@"VLC media player module"]];
[o_tableview setDataSource:self];
[o_tableview setTarget: self];
......@@ -2205,8 +2204,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain]; \
return NO;
}
[pb declareTypes:[NSArray
arrayWithObject:@"VLC media player module"] owner:nil];
[pb declareTypes:@[@"VLC media player module"] owner:nil];
[pb setPropertyList:rows forType:@"VLC media player module"];
return YES;
}
......
......@@ -105,7 +105,7 @@ static VLCSimplePrefs *_o_sharedInstance = nil;
[o_hotkeys_listbox setDoubleAction:@selector(hotkeyTableDoubleClick:)];
/* setup useful stuff */
o_hotkeysNonUseableKeys = [[NSArray arrayWithObjects: @"Command-c", @"Command-x", @"Command-v", @"Command-a", @"Command-," , @"Command-h", @"Command-Alt-h", @"Command-Shift-o", @"Command-o", @"Command-d", @"Command-n", @"Command-s", @"Command-z", @"Command-l", @"Command-r", @"Command-3", @"Command-m", @"Command-w", @"Command-Shift-w", @"Command-Shift-c", @"Command-Shift-p", @"Command-i", @"Command-e", @"Command-Shift-e", @"Command-b", @"Command-Shift-m", @"Command-Ctrl-m", @"Command-?", @"Command-Alt-?", nil] retain];
o_hotkeysNonUseableKeys = [@[@"Command-c", @"Command-x", @"Command-v", @"Command-a", @"Command-," , @"Command-h", @"Command-Alt-h", @"Command-Shift-o", @"Command-o", @"Command-d", @"Command-n", @"Command-s", @"Command-z", @"Command-l", @"Command-r", @"Command-3", @"Command-m", @"Command-w", @"Command-Shift-w", @"Command-Shift-c", @"Command-Shift-p", @"Command-i", @"Command-e", @"Command-Shift-e", @"Command-b", @"Command-Shift-m", @"Command-Ctrl-m", @"Command-?", @"Command-Alt-?"] retain];
}
#define CreateToolbarItem(o_name, o_desc, o_img, sel) \
......@@ -155,20 +155,22 @@ create_toolbar_item(NSString * o_itemIdent, NSString * o_name, NSString * o_desc
- (NSArray *)toolbarDefaultItemIdentifiers: (NSToolbar *)toolbar
{
return [NSArray arrayWithObjects: VLCIntfSettingToolbarIdentifier, VLCAudioSettingToolbarIdentifier, VLCVideoSettingToolbarIdentifier,
VLCOSDSettingToolbarIdentifier, VLCInputSettingToolbarIdentifier, VLCHotkeysSettingToolbarIdentifier, NSToolbarFlexibleSpaceItemIdentifier, nil];
return @[VLCIntfSettingToolbarIdentifier, VLCAudioSettingToolbarIdentifier, VLCVideoSettingToolbarIdentifier,
VLCOSDSettingToolbarIdentifier, VLCInputSettingToolbarIdentifier, VLCHotkeysSettingToolbarIdentifier,
NSToolbarFlexibleSpaceItemIdentifier];
}
- (NSArray *)toolbarAllowedItemIdentifiers: (NSToolbar *)toolbar
{
return [NSArray arrayWithObjects: VLCIntfSettingToolbarIdentifier, VLCAudioSettingToolbarIdentifier, VLCVideoSettingToolbarIdentifier,
VLCOSDSettingToolbarIdentifier, VLCInputSettingToolbarIdentifier, VLCHotkeysSettingToolbarIdentifier, NSToolbarFlexibleSpaceItemIdentifier, nil];
return @[VLCIntfSettingToolbarIdentifier, VLCAudioSettingToolbarIdentifier, VLCVideoSettingToolbarIdentifier,
VLCOSDSettingToolbarIdentifier, VLCInputSettingToolbarIdentifier, VLCHotkeysSettingToolbarIdentifier,
NSToolbarFlexibleSpaceItemIdentifier];
}
- (NSArray *)toolbarSelectableItemIdentifiers:(NSToolbar *)toolbar
{
return [NSArray arrayWithObjects: VLCIntfSettingToolbarIdentifier, VLCAudioSettingToolbarIdentifier, VLCVideoSettingToolbarIdentifier,
VLCOSDSettingToolbarIdentifier, VLCInputSettingToolbarIdentifier, VLCHotkeysSettingToolbarIdentifier, nil];
return @[VLCIntfSettingToolbarIdentifier, VLCAudioSettingToolbarIdentifier, VLCVideoSettingToolbarIdentifier,
VLCOSDSettingToolbarIdentifier, VLCInputSettingToolbarIdentifier, VLCHotkeysSettingToolbarIdentifier];
}
- (void)initStrings
......@@ -558,9 +560,8 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam
[self setupButton: o_input_mkv_preload_dir_ckb forBoolValue: "mkv-preload-local-dir"];
[o_input_cachelevel_pop removeAllItems];
[o_input_cachelevel_pop addItemsWithTitles:
[NSArray arrayWithObjects: _NS("Custom"), _NS("Lowest latency"), _NS("Low latency"), _NS("Normal"),
_NS("High latency"), _NS("Higher latency"), nil]];
[o_input_cachelevel_pop addItemsWithTitles: @[_NS("Custom"), _NS("Lowest latency"),
_NS("Low latency"), _NS("Normal"), _NS("High latency"), _NS("Higher latency")]];
[[o_input_cachelevel_pop itemAtIndex: 0] setTag: 0];
[[o_input_cachelevel_pop itemAtIndex: 1] setTag: 100];
[[o_input_cachelevel_pop itemAtIndex: 2] setTag: 200];
......
......@@ -83,16 +83,14 @@ static VLCWizard *_o_sharedInstance = nil;
/* add audio-bitrates for transcoding */
NSArray * audioBitratesArray;
audioBitratesArray = [NSArray arrayWithObjects: @"512", @"256", @"192",
@"128", @"64", @"32", @"16", nil ];
audioBitratesArray = @[@"512", @"256", @"192", @"128", @"64", @"32", @"16"];
[o_t4_pop_audioBitrate removeAllItems];
[o_t4_pop_audioBitrate addItemsWithTitles: audioBitratesArray];
[o_t4_pop_audioBitrate selectItemWithTitle: @"192"];
/* add video-bitrates for transcoding */
NSArray * videoBitratesArray;
videoBitratesArray = [NSArray arrayWithObjects: @"3072", @"2048", @"1024",
@"768", @"512", @"256", @"192", @"128", @"64", @"32", @"16", nil ];
videoBitratesArray = @[@"3072", @"2048", @"1024", @"768", @"512", @"256", @"192", @"128", @"64", @"32", @"16"];
[o_t4_pop_videoBitrate removeAllItems];
[o_t4_pop_videoBitrate addItemsWithTitles: videoBitratesArray];
[o_t4_pop_videoBitrate selectItemWithTitle: @"1024"];
......@@ -114,58 +112,58 @@ static VLCWizard *_o_sharedInstance = nil;
NSArray * o_mjpg;
NSArray * o_theo;
NSArray * o_dummyVid;
o_mp1v = [NSArray arrayWithObjects: @"MPEG-1 Video", @"mp1v",
_NS("MPEG-1 Video codec (usable with MPEG PS, MPEG TS, MPEG1, OGG "
"and RAW)"), @"MUX_PS", @"MUX_TS", @"MUX_MPEG", @"MUX_OGG", @"MUX_RAW",
@"NO", @"NO", @"NO", @"NO", nil];
o_mp2v = [NSArray arrayWithObjects: @"MPEG-2 Video", @"mp2v",
_NS("MPEG-2 Video codec (usable with MPEG PS, MPEG TS, MPEG1, OGG "
"and RAW)"), @"MUX_PS", @"MUX_TS", @"MUX_MPEG", @"MUX_OGG", @"MUX_RAW",
@"NO", @"NO", @"NO", @"NO", nil];
o_mp4v = [NSArray arrayWithObjects: @"MPEG-4 Video", @"mp4v",
_NS("MPEG-4 Video codec (useable with MPEG PS, MPEG TS, MPEG1, ASF, "
"MP4, OGG and RAW)"), @"MUX_PS", @"MUX_TS", @"MUX_MPEG", @"MUX_ASF",
@"MUX_MP4", @"MUX_OGG", @"MUX_RAW", @"NO", @"NO", nil];
o_div1 = [NSArray arrayWithObjects: @"DIVX 1", @"DIV1",
_NS("DivX first version (useable with MPEG TS, MPEG1, ASF and OGG)"),
@"MUX_TS", @"MUX_MPEG", @"MUX_ASF", @"MUX_OGG", @"NO", @"NO", @"NO",
@"NO", @"NO", nil];
o_div2 = [NSArray arrayWithObjects: @"DIVX 2", @"DIV2",
_NS("DivX second version (useable with MPEG TS, MPEG1, ASF and OGG)"),
@"MUX_TS", @"MUX_MPEG", @"MUX_ASF", @"MUX_OGG", @"NO", @"NO", @"NO",
@"NO", @"NO", nil];
o_div3 = [NSArray arrayWithObjects: @"DIVX 3", @"DIV3",
_NS("DivX third version (useable with MPEG TS, MPEG1, ASF and OGG)"),
@"MUX_TS", @"MUX_MPEG", @"MUX_ASF", @"MUX_OGG", @"NO", @"NO", @"NO",
@"NO", @"NO", nil];
o_h263 = [NSArray arrayWithObjects: @"H.263", @"h263",
_NS("H263 is a video codec optimized for videoconference "
"(low rates, useable with MPEG TS)"), @"MUX_TS", @"NO", @"NO", @"NO",
@"NO", @"NO", @"NO", @"NO", @"NO", nil];
o_h264 = [NSArray arrayWithObjects: @"H.264", @"h264",
_NS("H264 is a new video codec (useable with MPEG TS and MP4)"),
@"MUX_TS", @"MUX_MP4", @"NO", @"NO", @"NO", @"NO", @"NO", @"NO",
@"NO", nil];
o_wmv1 = [NSArray arrayWithObjects: @"WMV 1", @"WMV1",
_NS("WMV (Windows Media Video) 1 (useable with MPEG TS, MPEG1, ASF and "
"OGG)"), @"MUX_TS", @"MUX_MPEG", @"MUX_ASF", @"MUX_OGG", @"NO", @"NO",
@"NO", @"NO", @"NO", nil];
o_wmv2 = [NSArray arrayWithObjects: @"WMV 2", @"WMV2",
_NS("WMV (Windows Media Video) 2 (useable with MPEG TS, MPEG1, ASF and "
"OGG)"), @"MUX_TS", @"MUX_MPEG", @"MUX_ASF", @"MUX_OGG", @"NO", @"NO",
@"NO", @"NO", @"NO", nil];
o_mjpg = [NSArray arrayWithObjects: @"MJPEG", @"MJPG",
_NS("MJPEG consists of a series of JPEG pictures (useable with MPEG TS,"
" MPEG1, ASF and OGG)"), @"MUX_TS", @"MUX_MPEG", @"MUX_ASF", @"MUX_OGG",
@"NO", @"NO", @"NO", @"NO", @"NO", nil];
o_theo = [NSArray arrayWithObjects: @"Theora", @"theo",
_NS("Theora is a free general-purpose codec (useable with MPEG TS "
"and OGG)"), @"MUX_TS", @"MUX_OGG", @"NO", @"NO", @"NO", @"NO", @"NO",
@"NO", @"NO", nil];
o_dummyVid = [NSArray arrayWithObjects: @"Dummy", @"dummy",
_NS("Dummy codec (do not transcode, useable with all encapsulation "
"formats)"), @"MUX_PS", @"MUX_TS", @"MUX_MPEG", @"MUX_ASF", @"MUX_MP4",
@"MUX_OGG", @"MUX_WAV", @"MUX_RAW", @"MUX_MOV", nil];
o_mp1v = @[@"MPEG-1 Video", @"mp1v",
_NS("MPEG-1 Video codec (usable with MPEG PS, MPEG TS, MPEG1, OGG "
"and RAW)"), @"MUX_PS", @"MUX_TS", @"MUX_MPEG", @"MUX_OGG", @"MUX_RAW",
@"NO", @"NO", @"NO", @"NO"];
o_mp2v = @[@"MPEG-2 Video", @"mp2v",
_NS("MPEG-2 Video codec (usable with MPEG PS, MPEG TS, MPEG1, OGG "
"and RAW)"), @"MUX_PS", @"MUX_TS", @"MUX_MPEG", @"MUX_OGG", @"MUX_RAW",
@"NO", @"NO", @"NO", @"NO"];
o_mp4v = @[@"MPEG-4 Video", @"mp4v",
_NS("MPEG-4 Video codec (useable with MPEG PS, MPEG TS, MPEG1, ASF, "
"MP4, OGG and RAW)"), @"MUX_PS", @"MUX_TS", @"MUX_MPEG", @"MUX_ASF",
@"MUX_MP4", @"MUX_OGG", @"MUX_RAW", @"NO", @"NO"];
o_div1 = @[@"DIVX 1", @"DIV1",
_NS("DivX first version (useable with MPEG TS, MPEG1, ASF and OGG)"),
@"MUX_TS", @"MUX_MPEG", @"MUX_ASF", @"MUX_OGG", @"NO", @"NO", @"NO",
@"NO", @"NO"];
o_div2 = @[@"DIVX 2", @"DIV2",
_NS("DivX second version (useable with MPEG TS, MPEG1, ASF and OGG)"),
@"MUX_TS", @"MUX_MPEG", @"MUX_ASF", @"MUX_OGG", @"NO", @"NO", @"NO",
@"NO", @"NO"];
o_div3 = @[@"DIVX 3", @"DIV3",
_NS("DivX third version (useable with MPEG TS, MPEG1, ASF and OGG)"),
@"MUX_TS", @"MUX_MPEG", @"MUX_ASF", @"MUX_OGG", @"NO", @"NO", @"NO",
@"NO", @"NO"];
o_h263 = @[@"H.263", @"h263",
_NS("H263 is a video codec optimized for videoconference "
"(low rates, useable with MPEG TS)"), @"MUX_TS", @"NO", @"NO", @"NO",
@"NO", @"NO", @"NO", @"NO", @"NO"];
o_h264 = @[@"H.264", @"h264",
_NS("H264 is a new video codec (useable with MPEG TS and MP4)"),
@"MUX_TS", @"MUX_MP4", @"NO", @"NO", @"NO", @"NO", @"NO", @"NO",
@"NO"];
o_wmv1 = @[@"WMV 1", @"WMV1",
_NS("WMV (Windows Media Video) 1 (useable with MPEG TS, MPEG1, ASF and "
"OGG)"), @"MUX_TS", @"MUX_MPEG", @"MUX_ASF", @"MUX_OGG", @"NO", @"NO",
@"NO", @"NO", @"NO"];
o_wmv2 = @[@"WMV 2", @"WMV2",
_NS("WMV (Windows Media Video) 2 (useable with MPEG TS, MPEG1, ASF and "
"OGG)"), @"MUX_TS", @"MUX_MPEG", @"MUX_ASF", @"MUX_OGG", @"NO", @"NO",
@"NO", @"NO", @"NO"];
o_mjpg = @[@"MJPEG", @"MJPG",
_NS("MJPEG consists of a series of JPEG pictures (useable with MPEG TS,"
" MPEG1, ASF and OGG)"), @"MUX_TS", @"MUX_MPEG", @"MUX_ASF", @"MUX_OGG",
@"NO", @"NO", @"NO", @"NO", @"NO"];
o_theo = @[@"Theora", @"theo",
_NS("Theora is a free general-purpose codec (useable with MPEG TS "
"and OGG)"), @"MUX_TS", @"MUX_OGG", @"NO", @"NO", @"NO", @"NO", @"NO",
@"NO", @"NO"];
o_dummyVid = @[@"Dummy", @"dummy",
_NS("Dummy codec (do not transcode, useable with all encapsulation "
"formats)"), @"MUX_PS", @"MUX_TS", @"MUX_MPEG", @"MUX_ASF", @"MUX_MP4",
@"MUX_OGG", @"MUX_WAV", @"MUX_RAW", @"MUX_MOV"];
o_videoCodecs = [[NSArray alloc] initWithObjects: o_mp1v, o_mp2v, o_mp4v,
o_div1, o_div2, o_div3, o_h263, o_h264, o_wmv1, o_wmv2, o_mjpg, o_theo,