Commit 4e862a1f authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: use NSArray's firstObject where appropriate

parent 9e783b71
...@@ -361,7 +361,7 @@ static AppleRemote* sharedInstance=nil; ...@@ -361,7 +361,7 @@ static AppleRemote* sharedInstance=nil;
} }
- (void) executeClickCountEvent: (NSArray*) values { - (void) executeClickCountEvent: (NSArray*) values {
AppleRemoteEventIdentifier event = [[values objectAtIndex:0] unsignedIntValue]; AppleRemoteEventIdentifier event = [[values firstObject] unsignedIntValue];
NSTimeInterval eventTimePoint = [[values objectAtIndex:1] doubleValue]; NSTimeInterval eventTimePoint = [[values objectAtIndex:1] doubleValue];
BOOL finishedClicking = NO; BOOL finishedClicking = NO;
......
...@@ -293,7 +293,7 @@ ...@@ -293,7 +293,7 @@
vlc_object_t *p_object = VLC_OBJECT(getAout()); vlc_object_t *p_object = VLC_OBJECT(getAout());
if (p_object == NULL) if (p_object == NULL)
p_object = vlc_object_hold(pl_Get(p_intf)); p_object = vlc_object_hold(pl_Get(p_intf));
var_SetString(p_object, "equalizer-preset", [B64DecNSStr([items objectAtIndex:0]) UTF8String]); var_SetString(p_object, "equalizer-preset", [B64DecNSStr([items firstObject]) UTF8String]);
vlc_object_release(p_object); vlc_object_release(p_object);
/* filter handling */ /* filter handling */
......
...@@ -221,9 +221,9 @@ ...@@ -221,9 +221,9 @@
[_customize_aud_samplerate_pop removeAllItems]; [_customize_aud_samplerate_pop removeAllItems];
[_customize_subs_pop removeAllItems]; [_customize_subs_pop removeAllItems];
[_customize_vid_codec_pop addItemsWithTitles:[_videoCodecs objectAtIndex:0]]; [_customize_vid_codec_pop addItemsWithTitles:[_videoCodecs firstObject]];
[_customize_aud_codec_pop addItemsWithTitles:[_audioCodecs objectAtIndex:0]]; [_customize_aud_codec_pop addItemsWithTitles:[_audioCodecs firstObject]];
[_customize_subs_pop addItemsWithTitles:[_subsCodecs objectAtIndex:0]]; [_customize_subs_pop addItemsWithTitles:[_subsCodecs firstObject]];
[_customize_aud_samplerate_pop addItemWithTitle:@"8000"]; [_customize_aud_samplerate_pop addItemWithTitle:@"8000"];
[_customize_aud_samplerate_pop addItemWithTitle:@"11025"]; [_customize_aud_samplerate_pop addItemWithTitle:@"11025"];
...@@ -246,7 +246,7 @@ ...@@ -246,7 +246,7 @@
[_drop_box enablePlaylistItems]; [_drop_box enablePlaylistItems];
[_drop_box setDropHandler: self]; [_drop_box setDropHandler: self];
[self resetCustomizationSheetBasedOnProfile:[self.profileValueList objectAtIndex:0]]; [self resetCustomizationSheetBasedOnProfile:[self.profileValueList firstObject]];
} }
# pragma mark - # pragma mark -
...@@ -264,7 +264,7 @@ ...@@ -264,7 +264,7 @@
{ {
if (b_streaming) { if (b_streaming) {
if ([[[_stream_type_pop selectedItem] title] isEqualToString:@"HTTP"]) { if ([[[_stream_type_pop selectedItem] title] isEqualToString:@"HTTP"]) {
NSString *muxformat = [self.currentProfile objectAtIndex:0]; NSString *muxformat = [self.currentProfile firstObject];
if ([muxformat isEqualToString:@"wav"] || [muxformat isEqualToString:@"mov"] || [muxformat isEqualToString:@"mp4"] || [muxformat isEqualToString:@"mkv"]) { if ([muxformat isEqualToString:@"wav"] || [muxformat isEqualToString:@"mov"] || [muxformat isEqualToString:@"mp4"] || [muxformat isEqualToString:@"mkv"]) {
NSBeginInformationalAlertSheet(_NS("Invalid container format for HTTP streaming"), _NS("OK"), @"", @"", _window, NSBeginInformationalAlertSheet(_NS("Invalid container format for HTTP streaming"), _NS("OK"), @"", @"", _window,
nil, nil, nil, nil, nil, nil, nil, nil,
...@@ -541,7 +541,7 @@ ...@@ -541,7 +541,7 @@
NSArray *values = [[paste propertyListForType: NSFilenamesPboardType] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)]; NSArray *values = [[paste propertyListForType: NSFilenamesPboardType] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
if ([values count] > 0) { if ([values count] > 0) {
[self setMRL: [NSString stringWithUTF8String:vlc_path2uri([[values objectAtIndex:0] UTF8String], NULL)]]; [self setMRL: [NSString stringWithUTF8String:vlc_path2uri([[values firstObject] UTF8String], NULL)]];
[self updateOKButton]; [self updateOKButton];
[self updateDropView]; [self updateDropView];
return YES; return YES;
...@@ -694,7 +694,7 @@ ...@@ -694,7 +694,7 @@
return; return;
} }
[self selectCellByEncapsulationFormat:[components objectAtIndex:0]]; [self selectCellByEncapsulationFormat:[components firstObject]];
[_customize_vid_ckb setState:[[components objectAtIndex:1] intValue]]; [_customize_vid_ckb setState:[[components objectAtIndex:1] intValue]];
[_customize_aud_ckb setState:[[components objectAtIndex:2] intValue]]; [_customize_aud_ckb setState:[[components objectAtIndex:2] intValue]];
[_customize_subs_ckb setState:[[components objectAtIndex:3] intValue]]; [_customize_subs_ckb setState:[[components objectAtIndex:3] intValue]];
...@@ -924,7 +924,7 @@ ...@@ -924,7 +924,7 @@
if (!b_streaming) { if (!b_streaming) {
/* file transcoding */ /* file transcoding */
// add muxer // add muxer
[composedOptions appendFormat:@"}:standard{mux=%@", [self.currentProfile objectAtIndex:0]]; [composedOptions appendFormat:@"}:standard{mux=%@", [self.currentProfile firstObject]];
// add output destination // add output destination
[composedOptions appendFormat:@",access=file{no-overwrite},dst=%@}", _outputDestination]; [composedOptions appendFormat:@",access=file{no-overwrite},dst=%@}", _outputDestination];
...@@ -937,7 +937,7 @@ ...@@ -937,7 +937,7 @@
else if ([[[_stream_type_pop selectedItem] title] isEqualToString:@"MMSH"]) else if ([[[_stream_type_pop selectedItem] title] isEqualToString:@"MMSH"])
[composedOptions appendFormat:@":standard{mux=asfh,dst=%@,port=%@,access=mmsh", _outputDestination, [_stream_port_fld stringValue]]; [composedOptions appendFormat:@":standard{mux=asfh,dst=%@,port=%@,access=mmsh", _outputDestination, [_stream_port_fld stringValue]];
else else
[composedOptions appendFormat:@":standard{mux=%@,dst=%@,port=%@,access=http", [self.currentProfile objectAtIndex:0], [_stream_port_fld stringValue], _outputDestination]; [composedOptions appendFormat:@":standard{mux=%@,dst=%@,port=%@,access=http", [self.currentProfile firstObject], [_stream_port_fld stringValue], _outputDestination];
if ([_stream_sap_ckb state]) if ([_stream_sap_ckb state])
[composedOptions appendFormat:@",sap,name=\"%@\"", [_stream_channel_fld stringValue]]; [composedOptions appendFormat:@",sap,name=\"%@\"", [_stream_channel_fld stringValue]];
......
...@@ -576,7 +576,7 @@ ...@@ -576,7 +576,7 @@
input_thread_t * p_input = pl_CurrentInput(VLCIntf); input_thread_t * p_input = pl_CurrentInput(VLCIntf);
if (count == 1 && p_input) { if (count == 1 && p_input) {
int i_result = input_AddSubtitleOSD(p_input, [[o_values objectAtIndex:0] UTF8String], true, true); int i_result = input_AddSubtitleOSD(p_input, [[o_values firstObject] UTF8String], true, true);
vlc_object_release(p_input); vlc_object_release(p_input);
if (i_result == VLC_SUCCESS) if (i_result == VLC_SUCCESS)
return YES; return YES;
......
...@@ -136,7 +136,7 @@ ...@@ -136,7 +136,7 @@
/* check whether the user runs OSX with a RTL language */ /* check whether the user runs OSX with a RTL language */
NSArray* languages = [NSLocale preferredLanguages]; NSArray* languages = [NSLocale preferredLanguages];
NSString* preferredLanguage = [languages objectAtIndex:0]; NSString* preferredLanguage = [languages firstObject];
if ([NSLocale characterDirectionForLanguage:preferredLanguage] == NSLocaleLanguageDirectionRightToLeft) { if ([NSLocale characterDirectionForLanguage:preferredLanguage] == NSLocaleLanguageDirectionRightToLeft) {
msg_Dbg(VLCIntf, "adapting interface since '%s' is a RTL language", [preferredLanguage UTF8String]); msg_Dbg(VLCIntf, "adapting interface since '%s' is a RTL language", [preferredLanguage UTF8String]);
......
...@@ -491,7 +491,7 @@ static VLCMainWindow *sharedInstance = nil; ...@@ -491,7 +491,7 @@ static VLCMainWindow *sharedInstance = nil;
} }
if ([[self.videoView subviews] count] > 0) if ([[self.videoView subviews] count] > 0)
[self makeFirstResponder: [[self.videoView subviews] objectAtIndex:0]]; [self makeFirstResponder: [[self.videoView subviews] firstObject]];
} }
......
...@@ -577,7 +577,7 @@ ...@@ -577,7 +577,7 @@
input_thread_t *p_input = playlist_CurrentInput(p_playlist); input_thread_t *p_input = playlist_CurrentInput(p_playlist);
if (count == 1 && p_input) { if (count == 1 && p_input) {
int i_result = input_AddSubtitleOSD(p_input, vlc_path2uri([[o_values objectAtIndex:0] UTF8String], NULL), true, true); int i_result = input_AddSubtitleOSD(p_input, vlc_path2uri([[o_values firstObject] UTF8String], NULL), true, true);
vlc_object_release(p_input); vlc_object_release(p_input);
if (i_result == VLC_SUCCESS) if (i_result == VLC_SUCCESS)
return YES; return YES;
......
...@@ -711,7 +711,7 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe ...@@ -711,7 +711,7 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe
NSInteger row = [self rowForItem:item]; NSInteger row = [self rowForItem:item];
//Return the default table column //Return the default table column
return [[[self tableColumns] objectAtIndex:0] dataCellForRow:row]; return [[[self tableColumns] firstObject] dataCellForRow:row];
} }
- (void)outlineView:(NSOutlineView *)outlineView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item - (void)outlineView:(NSOutlineView *)outlineView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item
......
...@@ -281,7 +281,7 @@ NSString *kIgnoreMediaKeysDefaultsKey = @"SPIgnoreMediaKeys"; ...@@ -281,7 +281,7 @@ NSString *kIgnoreMediaKeysDefaultsKey = @"SPIgnoreMediaKeys";
ProcessSerialNumber mySerial, topSerial; ProcessSerialNumber mySerial, topSerial;
GetCurrentProcess(&mySerial); GetCurrentProcess(&mySerial);
[[_mediaKeyAppList objectAtIndex:0] getValue:&topSerial]; [[_mediaKeyAppList firstObject] getValue:&topSerial];
Boolean same; Boolean same;
OSErr err = SameProcess(&mySerial, &topSerial, &same); OSErr err = SameProcess(&mySerial, &topSerial, &same);
......
...@@ -193,7 +193,7 @@ ...@@ -193,7 +193,7 @@
// cascade windows if we have more than one vout // cascade windows if we have more than one vout
if (b_multiple_vout_windows) { if (b_multiple_vout_windows) {
if ([o_vout_dict count] == 1) { if ([o_vout_dict count] == 1) {
NSWindow * o_first_window = [o_vout_dict objectForKey: [[o_vout_dict allKeys] objectAtIndex:0]]; NSWindow * o_first_window = [o_vout_dict objectForKey: [[o_vout_dict allKeys] firstObject]];
NSPoint topleftbase = NSMakePoint(0, [o_first_window frame].size.height); NSPoint topleftbase = NSMakePoint(0, [o_first_window frame].size.height);
top_left_point = [o_first_window convertBaseToScreen: topleftbase]; top_left_point = [o_first_window convertBaseToScreen: topleftbase];
......
...@@ -599,7 +599,7 @@ ...@@ -599,7 +599,7 @@
} }
/* filter handling */ /* filter handling */
NSString *tempString = B64DecNSStr([items objectAtIndex:0]); NSString *tempString = B64DecNSStr([items firstObject]);
vout_thread_t *p_vout = getVout(); vout_thread_t *p_vout = getVout();
/* enable the new filters */ /* enable the new filters */
......
...@@ -149,7 +149,7 @@ ...@@ -149,7 +149,7 @@
@synchronized(self) { @synchronized(self) {
current_anim = self->o_current_animation; current_anim = self->o_current_animation;
if (!([[[current_anim viewAnimations] objectAtIndex:0] objectForKey: NSViewAnimationEffectKey] == NSViewAnimationFadeOutEffect && [current_anim isAnimating])) { if (!([[[current_anim viewAnimations] firstObject] objectForKey: NSViewAnimationEffectKey] == NSViewAnimationFadeOutEffect && [current_anim isAnimating])) {
if (current_anim) { if (current_anim) {
[current_anim stopAnimation]; [current_anim stopAnimation];
[anim setCurrentProgress:1.0 - [current_anim currentProgress]]; [anim setCurrentProgress:1.0 - [current_anim currentProgress]];
...@@ -197,7 +197,7 @@ ...@@ -197,7 +197,7 @@
@synchronized(self) { @synchronized(self) {
current_anim = self->o_current_animation; current_anim = self->o_current_animation;
if (!([[[current_anim viewAnimations] objectAtIndex:0] objectForKey: NSViewAnimationEffectKey] == NSViewAnimationFadeInEffect && [current_anim isAnimating])) { if (!([[[current_anim viewAnimations] firstObject] objectForKey: NSViewAnimationEffectKey] == NSViewAnimationFadeInEffect && [current_anim isAnimating])) {
if (current_anim) { if (current_anim) {
[current_anim stopAnimation]; [current_anim stopAnimation];
[anim setCurrentProgress:1.0 - [current_anim currentProgress]]; [anim setCurrentProgress:1.0 - [current_anim currentProgress]];
...@@ -227,7 +227,7 @@ ...@@ -227,7 +227,7 @@
{ {
NSArray *o_subViews = [[self contentView] subviews]; NSArray *o_subViews = [[self contentView] subviews];
if ([o_subViews count] > 0) { if ([o_subViews count] > 0) {
id o_vout_view = [o_subViews objectAtIndex:0]; id o_vout_view = [o_subViews firstObject];
if ([o_vout_view class] == [VLCVoutView class]) if ([o_vout_view class] == [VLCVoutView class])
return (VLCVoutView *)o_vout_view; return (VLCVoutView *)o_vout_view;
...@@ -1006,7 +1006,7 @@ ...@@ -1006,7 +1006,7 @@
- (void)hasBecomeFullscreen - (void)hasBecomeFullscreen
{ {
if ([[_videoView subviews] count] > 0) if ([[_videoView subviews] count] > 0)
[o_fullscreen_window makeFirstResponder: [[_videoView subviews] objectAtIndex:0]]; [o_fullscreen_window makeFirstResponder: [[_videoView subviews] firstObject]];
[o_fullscreen_window makeKeyWindow]; [o_fullscreen_window makeKeyWindow];
[o_fullscreen_window setAcceptsMouseMovedEvents: YES]; [o_fullscreen_window setAcceptsMouseMovedEvents: YES];
...@@ -1132,7 +1132,7 @@ ...@@ -1132,7 +1132,7 @@
[[o_temp_view superview] replaceSubview:o_temp_view with:_videoView]; [[o_temp_view superview] replaceSubview:o_temp_view with:_videoView];
[_videoView setFrame:[o_temp_view frame]]; [_videoView setFrame:[o_temp_view frame]];
if ([[_videoView subviews] count] > 0) if ([[_videoView subviews] count] > 0)
[self makeFirstResponder: [[_videoView subviews] objectAtIndex:0]]; [self makeFirstResponder: [[_videoView subviews] firstObject]];
[_videoView setHidden: b_video_view_was_hidden]; [_videoView setHidden: b_video_view_was_hidden];
...@@ -1158,7 +1158,7 @@ ...@@ -1158,7 +1158,7 @@
/* Fullscreen ended or started (we are a delegate only for leaveFullscreen's/enterFullscren's anim2) */ /* Fullscreen ended or started (we are a delegate only for leaveFullscreen's/enterFullscren's anim2) */
viewAnimations = [o_fullscreen_anim2 viewAnimations]; viewAnimations = [o_fullscreen_anim2 viewAnimations];
if ([viewAnimations count] >=1 && if ([viewAnimations count] >=1 &&
[[[viewAnimations objectAtIndex:0] objectForKey: NSViewAnimationEffectKey] isEqualToString:NSViewAnimationFadeInEffect]) { [[[viewAnimations firstObject] objectForKey: NSViewAnimationEffectKey] isEqualToString:NSViewAnimationFadeInEffect]) {
/* Fullscreen ended */ /* Fullscreen ended */
[self hasEndedFullscreen]; [self hasEndedFullscreen];
} else } else
......
...@@ -239,11 +239,11 @@ ...@@ -239,11 +239,11 @@
NSArray * components = [[_editTimeTextField stringValue] componentsSeparatedByString:@":"]; NSArray * components = [[_editTimeTextField stringValue] componentsSeparatedByString:@":"];
NSUInteger componentCount = [components count]; NSUInteger componentCount = [components count];
if (componentCount == 1) if (componentCount == 1)
pp_bookmarks[i]->i_time_offset = 1000000LL * ([[components objectAtIndex:0] longLongValue]); pp_bookmarks[i]->i_time_offset = 1000000LL * ([[components firstObject] longLongValue]);
else if (componentCount == 2) else if (componentCount == 2)
pp_bookmarks[i]->i_time_offset = 1000000LL * ([[components objectAtIndex:0] longLongValue] * 60 + [[components objectAtIndex:1] longLongValue]); pp_bookmarks[i]->i_time_offset = 1000000LL * ([[components firstObject] longLongValue] * 60 + [[components objectAtIndex:1] longLongValue]);
else if (componentCount == 3) else if (componentCount == 3)
pp_bookmarks[i]->i_time_offset = 1000000LL * ([[components objectAtIndex:0] longLongValue] * 3600 + [[components objectAtIndex:1] longLongValue] * 60 + [[components objectAtIndex:2] longLongValue]); pp_bookmarks[i]->i_time_offset = 1000000LL * ([[components firstObject] longLongValue] * 3600 + [[components objectAtIndex:1] longLongValue] * 60 + [[components objectAtIndex:2] longLongValue]);
else { else {
msg_Err(VLCIntf, "Invalid string format for time"); msg_Err(VLCIntf, "Invalid string format for time");
goto clear; goto clear;
......
...@@ -208,11 +208,11 @@ ...@@ -208,11 +208,11 @@
[fieldContent componentsSeparatedByString: @":"]; [fieldContent componentsSeparatedByString: @":"];
if ([[fieldContent componentsSeparatedByString: @":"] count] == 3) { if ([[fieldContent componentsSeparatedByString: @":"] count] == 3) {
timeInSec += ([[ourTempArray objectAtIndex:0] intValue] * 3600); //h timeInSec += ([[ourTempArray firstObject] intValue] * 3600); //h
timeInSec += ([[ourTempArray objectAtIndex:1] intValue] * 60); //m timeInSec += ([[ourTempArray objectAtIndex:1] intValue] * 60); //m
timeInSec += [[ourTempArray objectAtIndex:2] intValue]; //s timeInSec += [[ourTempArray objectAtIndex:2] intValue]; //s
} else { } else {
timeInSec += ([[ourTempArray objectAtIndex:0] intValue] * 60); //m timeInSec += ([[ourTempArray firstObject] intValue] * 60); //m
timeInSec += [[ourTempArray objectAtIndex:1] intValue]; //s timeInSec += [[ourTempArray objectAtIndex:1] intValue]; //s
} }
} }
......
...@@ -909,13 +909,13 @@ audio_output_t *getAout(void) ...@@ -909,13 +909,13 @@ audio_output_t *getAout(void)
} }
} }
char *psz_uri = vlc_path2uri([[o_names objectAtIndex:0] UTF8String], NULL); char *psz_uri = vlc_path2uri([[o_names firstObject] UTF8String], NULL);
// try to add file as subtitle // try to add file as subtitle
if ([o_names count] == 1 && psz_uri) { if ([o_names count] == 1 && psz_uri) {
input_thread_t * p_input = pl_CurrentInput(VLCIntf); input_thread_t * p_input = pl_CurrentInput(VLCIntf);
if (p_input) { if (p_input) {
int i_result = input_AddSubtitleOSD(p_input, [[o_names objectAtIndex:0] UTF8String], true, true); int i_result = input_AddSubtitleOSD(p_input, [[o_names firstObject] UTF8String], true, true);
vlc_object_release(p_input); vlc_object_release(p_input);
if (i_result == VLC_SUCCESS) { if (i_result == VLC_SUCCESS) {
free(psz_uri); free(psz_uri);
...@@ -1163,7 +1163,7 @@ audio_output_t *getAout(void) ...@@ -1163,7 +1163,7 @@ audio_output_t *getAout(void)
- (void)plItemAppended:(NSArray *)o_val - (void)plItemAppended:(NSArray *)o_val
{ {
int i_node = [[o_val objectAtIndex:0] intValue]; int i_node = [[o_val firstObject] intValue];
int i_item = [[o_val objectAtIndex:1] intValue]; int i_item = [[o_val objectAtIndex:1] intValue];
[[[self playlist] model] addItem:i_item withParentNode:i_node]; [[[self playlist] model] addItem:i_item withParentNode:i_node];
...@@ -1274,7 +1274,7 @@ audio_output_t *getAout(void) ...@@ -1274,7 +1274,7 @@ audio_output_t *getAout(void)
- (id)open - (id)open
{ {
if (!nib_open_loaded) if (!nib_open_loaded)
nib_open_loaded = [NSBundle loadNibNamed:@"Open" owner: NSApp]; nib_open_loaded = [NSBundle loadNibNamed:@"Open" owner: o_open];
return o_open; return o_open;
} }
...@@ -1396,7 +1396,7 @@ static const int kCurrentPreferencesVersion = 3; ...@@ -1396,7 +1396,7 @@ static const int kCurrentPreferencesVersion = 3;
NSArray *libraries = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSArray *libraries = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory,
NSUserDomainMask, YES); NSUserDomainMask, YES);
if (!libraries || [libraries count] == 0) return; if (!libraries || [libraries count] == 0) return;
NSString * preferences = [[libraries objectAtIndex:0] stringByAppendingPathComponent:@"Preferences"]; NSString * preferences = [[libraries firstObject] stringByAppendingPathComponent:@"Preferences"];
int res = NSRunInformationalAlertPanel(_NS("Remove old preferences?"), int res = NSRunInformationalAlertPanel(_NS("Remove old preferences?"),
_NS("We just found an older version of VLC's preferences files."), _NS("We just found an older version of VLC's preferences files."),
......
...@@ -198,7 +198,7 @@ static bool b_old_spaces_style = YES; ...@@ -198,7 +198,7 @@ static bool b_old_spaces_style = YES;
- (BOOL)hasMenuBar - (BOOL)hasMenuBar
{ {
if (b_old_spaces_style) if (b_old_spaces_style)
return ([self displayID] == [[[NSScreen screens] objectAtIndex:0] displayID]); return ([self displayID] == [[[NSScreen screens] firstObject] displayID]);
else else
return YES; return YES;
} }
......
...@@ -433,21 +433,21 @@ struct display_info_t ...@@ -433,21 +433,21 @@ struct display_info_t
NSUInteger componentCount = [components count]; NSUInteger componentCount = [components count];
NSInteger tempValue = 0; NSInteger tempValue = 0;
if (componentCount == 1) if (componentCount == 1)
tempValue = [[components objectAtIndex:0] intValue]; tempValue = [[components firstObject] intValue];
else if (componentCount == 2) else if (componentCount == 2)
tempValue = [[components objectAtIndex:0] intValue] * 60 + [[components objectAtIndex:1] intValue]; tempValue = [[components firstObject] intValue] * 60 + [[components objectAtIndex:1] intValue];
else if (componentCount == 3) else if (componentCount == 3)
tempValue = [[components objectAtIndex:0] intValue] * 3600 + [[components objectAtIndex:1] intValue] * 60 + [[components objectAtIndex:2] intValue]; tempValue = [[components firstObject] intValue] * 3600 + [[components objectAtIndex:1] intValue] * 60 + [[components objectAtIndex:2] intValue];
if (tempValue > 0) if (tempValue > 0)
[o_options addObject: [NSString stringWithFormat:@"start-time=%li", tempValue]]; [o_options addObject: [NSString stringWithFormat:@"start-time=%li", tempValue]];
components = [[o_file_stoptime_fld stringValue] componentsSeparatedByString:@":"]; components = [[o_file_stoptime_fld stringValue] componentsSeparatedByString:@":"];
componentCount = [components count]; componentCount = [components count];
if (componentCount == 1) if (componentCount == 1)
tempValue = [[components objectAtIndex:0] intValue]; tempValue = [[components firstObject] intValue];
else if (componentCount == 2) else if (componentCount == 2)
tempValue = [[components objectAtIndex:0] intValue] * 60 + [[components objectAtIndex:1] intValue]; tempValue = [[components firstObject] intValue] * 60 + [[components objectAtIndex:1] intValue];
else if (componentCount == 3) else if (componentCount == 3)
tempValue = [[components objectAtIndex:0] intValue] * 3600 + [[components objectAtIndex:1] intValue] * 60 + [[components objectAtIndex:2] intValue]; tempValue = [[components firstObject] intValue] * 3600 + [[components objectAtIndex:1] intValue] * 60 + [[components objectAtIndex:2] intValue];
if (tempValue != 0) if (tempValue != 0)
[o_options addObject: [NSString stringWithFormat:@"stop-time=%li", tempValue]]; [o_options addObject: [NSString stringWithFormat:@"stop-time=%li", tempValue]];
} }
...@@ -515,7 +515,7 @@ struct display_info_t ...@@ -515,7 +515,7 @@ struct display_info_t
{ {
NSInteger i_selectedDevice = [o_qtk_video_device_pop indexOfSelectedItem]; NSInteger i_selectedDevice = [o_qtk_video_device_pop indexOfSelectedItem];
if (_qtkvideoDevices.count >= 1) { if (_qtkvideoDevices.count >= 1) {
NSValue *sizes = [[[[qtkvideoDevices objectAtIndex:i_selectedDevice] formatDescriptions] objectAtIndex:0] attributeForKey: QTFormatDescriptionVideoEncodedPixelsSizeAttribute]; NSValue *sizes = [[[_qtkvideoDevices[i_selectedDevice] formatDescriptions] firstObject] attributeForKey: QTFormatDescriptionVideoEncodedPixelsSizeAttribute];
[o_capture_width_fld setIntValue: [sizes sizeValue].width]; [o_capture_width_fld setIntValue: [sizes sizeValue].width];
[o_capture_height_fld setIntValue: [sizes sizeValue].height]; [o_capture_height_fld setIntValue: [sizes sizeValue].height];
...@@ -709,7 +709,7 @@ struct display_info_t ...@@ -709,7 +709,7 @@ struct display_info_t
[o_open_panel setPrompt: _NS("Open")]; [o_open_panel setPrompt: _NS("Open")];
[o_open_panel beginSheetModalForWindow:[sender window] completionHandler:^(NSInteger returnCode) { [o_open_panel beginSheetModalForWindow:[sender window] completionHandler:^(NSInteger returnCode) {
if (returnCode == NSFileHandlingPanelOKButton) { if (returnCode == NSFileHandlingPanelOKButton) {
o_file_path = [[[o_open_panel URLs] objectAtIndex:0] path]; o_file_path = [[[o_open_panel URLs] firstObject] path];
[self openFilePathChanged: nil]; [self openFilePathChanged: nil];
} }
}]; }];
...@@ -730,7 +730,7 @@ struct display_info_t ...@@ -730,7 +730,7 @@ struct display_info_t
[o_open_panel setCanChooseFiles: YES]; [o_open_panel setCanChooseFiles: YES];
[o_open_panel setCanChooseDirectories: NO]; [o_open_panel setCanChooseDirectories: NO];
if ([o_open_panel runModal] == NSOKButton) { if ([o_open_panel runModal] == NSOKButton) {
o_file_slave_path = [[[o_open_panel URLs] objectAtIndex:0] path]; o_file_slave_path = [[[o_open_panel URLs] firstObject] path];
} }
} }
if (o_file_slave_path && [o_file_slave_ckbox state] == NSOnState) { if (o_file_slave_path && [o_file_slave_ckbox state] == NSOnState) {
...@@ -945,7 +945,7 @@ struct display_info_t ...@@ -945,7 +945,7 @@ struct display_info_t
[o_open_panel setAllowedFileTypes:[NSArray arrayWithObject:@"public.directory"]]; [o_open_panel setAllowedFileTypes:[NSArray arrayWithObject:@"public.directory"]];
if ([o_open_panel runModal] == NSOKButton) { if ([o_open_panel runModal] == NSOKButton) {
NSString *o_path = [[[o_open_panel URLs] objectAtIndex:0] path]; NSString *o_path = [[[o_open_panel URLs] firstObject] path];
if ([o_path length] > 0) { if ([o_path length] > 0) {
[NSThread detachNewThreadSelector:@selector(scanSpecialPath:) toTarget:self withObject:o_path]; [NSThread detachNewThreadSelector:@selector(scanSpecialPath:) toTarget:self withObject:o_path];
} }
...@@ -1380,7 +1380,7 @@ struct display_info_t ...@@ -1380,7 +1380,7 @@ struct display_info_t
[o_open_panel setPrompt: _NS("Open")]; [o_open_panel setPrompt: _NS("Open")];
if ([o_open_panel runModal] == NSOKButton) { if ([o_open_panel runModal] == NSOKButton) {
o_sub_path = [[[o_open_panel URLs] objectAtIndex:0] path]; o_sub_path = [[[o_open_panel URLs] firstObject] path];
[o_file_subtitles_filename_lbl setStringValue: [[NSFileManager defaultManager] displayNameAtPath:o_sub_path]]; [o_file_subtitles_filename_lbl setStringValue: [[NSFileManager defaultManager] displayNameAtPath:o_sub_path]];
[o_file_sub_path_fld setStringValue: [o_file_subtitles_filename_lbl stringValue]]; [o_file_sub_path_fld setStringValue: [o_file_subtitles_filename_lbl stringValue]];
[o_file_sub_path_lbl setHidden: YES]; [o_file_sub_path_lbl setHidden: YES];
......
...@@ -334,7 +334,7 @@ ...@@ -334,7 +334,7 @@
if ([urlItems count] == 1) if ([urlItems count] == 1)
[finalStreamAddress appendFormat: @"\"%@:%@\"", [self.streamAddressTextField stringValue],[self.streamPortTextField stringValue]]; [finalStreamAddress appendFormat: @"\"%@:%@\"", [self.streamAddressTextField stringValue],[self.streamPortTextField stringValue]];
else { else {
[finalStreamAddress appendFormat: @"\"%@:%@", [urlItems objectAtIndex:0], [self.streamPortTextField stringValue]]; [finalStreamAddress appendFormat: @"\"%@:%@", [urlItems firstObject], [self.streamPortTextField stringValue]];
NSUInteger itemCount = [urlItems count]; NSUInteger itemCount = [urlItems count];
for (NSUInteger x = 0; x < itemCount; x++) for (NSUInteger x = 0; x < itemCount; x++)
[finalStreamAddress appendFormat: @"/%@", [urlItems objectAtIndex:x]]; [finalStreamAddress appendFormat: @"/%@", [urlItems objectAtIndex:x]];
......
...@@ -242,7 +242,7 @@ ...@@ -242,7 +242,7 @@
[o_playlist_header setMenu: o_context_menu]; [o_playlist_header setMenu: o_context_menu];
for (NSUInteger i = 0; i < count; i++) { for (NSUInteger i = 0; i < count; i++) {
o_column = [[o_columnArray objectAtIndex:i] objectAtIndex:0]; o_column = [[o_columnArray objectAtIndex:i] firstObject];
if ([o_column isEqualToString:@"status"]) if ([o_column isEqualToString:@"status"])
continue; continue;
...@@ -1016,8 +1016,8 @@ ...@@ -1016,8 +1016,8 @@
NSUInteger mediaListCount = mediaList.count; NSUInteger mediaListCount = mediaList.count;
if (mediaListCount > 30) { if (mediaListCount > 30) {
for (NSUInteger x = 0; x < mediaListCount - 30; x++) { for (NSUInteger x = 0; x < mediaListCount - 30; x++) {
[mutDict removeObjectForKey:[mediaList objectAtIndex:0]]; [mutDict removeObjectForKey:[mediaList firstObject]];
[mediaList removeObjectAtIndex:0]; [mediaList removefirstObject];
} }
} }
} else { } else {
......
...@@ -1173,7 +1173,7 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \ ...@@ -1173,7 +1173,7 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc]; \
[o_open_panel setCanChooseDirectories: b_directory]; [o_open_panel setCanChooseDirectories: b_directory];
[o_open_panel beginSheetModalForWindow:[sender window] completionHandler:^(NSInteger returnCode) { [o_open_panel beginSheetModalForWindow:[sender window] completionHandler:^(NSInteger returnCode) {
if (returnCode == NSOKButton) { if (returnCode == NSOKButton) {
NSString *o_path = [[[o_open_panel URLs] objectAtIndex:0] path]; NSString *o_path = [[[o_open_panel URLs] firstObject] path];
[o_textfield setStringValue: o_path]; [o_textfield setStringValue: o_path];
} }
}]; }];
...@@ -2168,7 +2168,7 @@ o_moduleenabled = [NSNumber numberWithBool:NO];\ ...@@ -2168,7 +2168,7 @@ o_moduleenabled = [NSNumber numberWithBool:NO];\
if ([[[o_modulearray objectAtIndex:i] objectAtIndex:2] if ([[[o_modulearray objectAtIndex:i] objectAtIndex:2]
boolValue] != NO) { boolValue] != NO) {
o_newstring = [o_newstring stringByAppendingString: o_newstring = [o_newstring stringByAppendingString:
[[o_modulearray objectAtIndex:i] objectAtIndex:0]]; [[o_modulearray objectAtIndex:i] firstObject]];
o_newstring = [o_newstring stringByAppendingString:@":"]; o_newstring = [o_newstring stringByAppendingString:@":"];
} }
......
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