Commit 3efeac83 authored by Felix Paul Kühne's avatar Felix Paul Kühne

Revert "macosx: clean code of objectAtIndex"

This reverts commit 00b2fcce.

[__MNSArray objectAtIndexedSubscript] isn't part of the OS X 10.7 ObjC runtime and in turn, we can't use this feature of the modern ObjC syntax until we drop support for 10.7 some day
parent 2b82c9fd
......@@ -296,8 +296,8 @@ static int Open(vlc_object_t *p_this)
for ( ivideo = 0; ivideo < deviceCount; ivideo++ )
{
AVCaptureDevice *avf_device;
avf_device = myVideoDevices[ivideo];
msg_Dbg(p_demux, "avcapture %u/%u %s %s", ivideo, deviceCount, [[avf_device modelID] UTF8String], [[avf_device uniqueID] UTF8String]);
avf_device = [myVideoDevices objectAtIndex:ivideo];
msg_Dbg(p_demux, "avcapture %lu/%lu %s %s", ivideo, deviceCount, [[avf_device modelID] UTF8String], [[avf_device uniqueID] UTF8String]);
if ([[[avf_device uniqueID]stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] isEqualToString:avf_currdevice_uid]) {
break;
}
......@@ -305,7 +305,7 @@ static int Open(vlc_object_t *p_this)
if ( ivideo < [myVideoDevices count] )
{
p_sys->device = myVideoDevices[ivideo];
p_sys->device = [myVideoDevices objectAtIndex:ivideo];
}
else
{
......
......@@ -256,7 +256,7 @@ static int Open(vlc_object_t *p_this)
NSUInteger deviceCount = [myVideoDevices count];
for (ivideo = 0; ivideo < deviceCount; ivideo++) {
QTCaptureDevice *qtk_device;
qtk_device = myVideoDevices[ivideo];
qtk_device = [myVideoDevices objectAtIndex:ivideo];
msg_Dbg(p_demux, "qtcapture %lu/%lu %s %s", ivideo, deviceCount, [[qtk_device localizedDisplayName] UTF8String], [[qtk_device uniqueID] UTF8String]);
if ([[[qtk_device uniqueID]stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] isEqualToString:qtk_currdevice_uid]) {
break;
......@@ -268,7 +268,7 @@ static int Open(vlc_object_t *p_this)
QTCaptureDeviceInput * input = nil;
NSError *o_returnedError;
if (ivideo < [myVideoDevices count])
p_sys->device = myVideoDevices[ivideo];
p_sys->device = [myVideoDevices objectAtIndex:ivideo];
else {
/* cannot found designated device, fall back to open default device */
msg_Dbg(p_demux, "Cannot find designated uid device as %s, falling back to default.", [qtk_currdevice_uid UTF8String]);
......@@ -306,13 +306,13 @@ static int Open(vlc_object_t *p_this)
QTFormatDescription* camera_format = NULL;
NSUInteger formatCount = [format_array count];
for (NSUInteger k = 0; k < formatCount; k++) {
camera_format = format_array[k];
camera_format = [format_array objectAtIndex:k];
msg_Dbg(p_demux, "localized Format: %s", [[camera_format localizedFormatSummary] UTF8String]);
msg_Dbg(p_demux, "format description: %s", [[[camera_format formatDescriptionAttributes] description] UTF8String]);
}
if ([format_array count])
camera_format = format_array[0];
camera_format = [format_array objectAtIndex:0];
else
goto error;
......
......@@ -275,7 +275,7 @@ static int Open(vlc_object_t *p_this)
unsigned iaudio;
for (iaudio = 0; iaudio < [myAudioDevices count]; iaudio++) {
QTCaptureDevice *qtk_audioDevice;
qtk_audioDevice = myAudioDevices[iaudio];
qtk_audioDevice = [myAudioDevices objectAtIndex:iaudio];
msg_Dbg(p_demux, "qtsound audio %u/%lu localizedDisplayName: %s uniqueID: %s", iaudio, [myAudioDevices count], [[qtk_audioDevice localizedDisplayName] UTF8String], [[qtk_audioDevice uniqueID] UTF8String]);
if ([[[qtk_audioDevice uniqueID]stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] isEqualToString:qtk_curraudiodevice_uid]) {
msg_Dbg(p_demux, "Device found");
......@@ -285,7 +285,7 @@ static int Open(vlc_object_t *p_this)
audioInput = nil;
if(iaudio < [myAudioDevices count])
p_sys->audiodevice = myAudioDevices[iaudio];
p_sys->audiodevice = [myAudioDevices objectAtIndex:iaudio];
else {
/* cannot find designated audio device, fall back to open default audio device */
msg_Dbg(p_demux, "Cannot find designated uid audio device as %s. Fall back to open default audio device.", [qtk_curraudiodevice_uid UTF8String]);
......@@ -357,7 +357,7 @@ static int Open(vlc_object_t *p_this)
audioformat_array = [p_sys->audiodevice formatDescriptions];
audio_format = NULL;
for(int k = 0; k < [audioformat_array count]; k++) {
audio_format = (QTFormatDescription *)audioformat_array[k];
audio_format = (QTFormatDescription *)[audioformat_array objectAtIndex:k];
msg_Dbg(p_demux, "Audio localized format summary: %s", [[audio_format localizedFormatSummary] UTF8String]);
msg_Dbg(p_demux, "Audio format description attributes: %s",[[[audio_format formatDescriptionAttributes] description] UTF8String]);
......@@ -400,7 +400,7 @@ static int Open(vlc_object_t *p_this)
}
if([audioformat_array count])
audio_format = audioformat_array[0];
audio_format = [audioformat_array objectAtIndex:0];
else
goto error;
......
......@@ -388,8 +388,8 @@ static AppleRemote* sharedInstance=nil;
}
- (void) executeClickCountEvent: (NSArray*) values {
AppleRemoteEventIdentifier event = [values[0] unsignedIntValue];
NSTimeInterval eventTimePoint = [values[1] doubleValue];
AppleRemoteEventIdentifier event = [[values objectAtIndex:0] unsignedIntValue];
NSTimeInterval eventTimePoint = [[values objectAtIndex:1] doubleValue];
BOOL finishedClicking = NO;
int finalClickCount = eventClickCount;
......@@ -564,7 +564,7 @@ static void QueueCallbackFunction(void* target, IOReturn result, void* refcon,
NSMutableArray *mutableAllCookies = [[NSMutableArray alloc] init];
NSUInteger elementCount = [elements count];
for (NSUInteger i=0; i< elementCount; i++) {
element = elements[i];
element = [elements objectAtIndex:i];
//Get cookie
object = [element valueForKey: (NSString*)CFSTR(kIOHIDElementCookieKey) ];
......@@ -610,7 +610,7 @@ static void QueueCallbackFunction(void* target, IOReturn result, void* refcon,
NSUInteger cookieCount = [_allCookies count];
for(NSUInteger i=0; i<cookieCount; i++) {
IOHIDElementCookie cookie = (IOHIDElementCookie)[_allCookies[i] intValue];
IOHIDElementCookie cookie = (IOHIDElementCookie)[[_allCookies objectAtIndex:i] intValue];
(*queue)->addElement(queue, cookie, 0);
}
......
......@@ -302,17 +302,17 @@ static VLCAudioEffects *_o_sharedInstance = nil;
}
/* fetch preset */
NSArray *items = [[defaults objectForKey:@"AudioEffectProfiles"][selectedProfile] componentsSeparatedByString:@";"];
NSArray *items = [[[defaults objectForKey:@"AudioEffectProfiles"] objectAtIndex:selectedProfile] componentsSeparatedByString:@";"];
/* eq preset */
vlc_object_t *p_object = VLC_OBJECT(getAout());
if (p_object == NULL)
p_object = vlc_object_hold(pl_Get(p_intf));
var_SetString(p_object,"equalizer-preset",vlc_b64_decode([items[0] UTF8String]));
var_SetString(p_object,"equalizer-preset",vlc_b64_decode([[items objectAtIndex:0] UTF8String]));
vlc_object_release(p_object);
/* filter handling */
NSString *tempString = [NSString stringWithFormat:@"%s", vlc_b64_decode([items[1] UTF8String])];
NSString *tempString = [NSString stringWithFormat:@"%s", vlc_b64_decode([[items objectAtIndex:1] UTF8String])];
NSArray *tempArray;
NSUInteger count;
/* enable the new filters, if we have an aout */
......@@ -321,43 +321,43 @@ static VLCAudioEffects *_o_sharedInstance = nil;
tempArray = [tempString componentsSeparatedByString:@":"];
count = [tempArray count];
for (NSUInteger x = 0; x < count; x++)
playlist_EnableAudioFilter(p_playlist, (char *)[tempArray[x] UTF8String], true);
playlist_EnableAudioFilter(p_playlist, (char *)[[tempArray objectAtIndex:x] UTF8String], true);
}
}
config_PutPsz(p_intf,"audio-filter",[tempString UTF8String]);
/* values */
config_PutFloat(p_intf, "compressor-rms-peak",[items[2] floatValue]);
config_PutFloat(p_intf, "compressor-attack",[items[3] floatValue]);
config_PutFloat(p_intf, "compressor-release",[items[4] floatValue]);
config_PutFloat(p_intf, "compressor-threshold",[items[5] floatValue]);
config_PutFloat(p_intf, "compressor-ratio",[items[6] floatValue]);
config_PutFloat(p_intf, "compressor-knee",[items[7] floatValue]);
config_PutFloat(p_intf, "compressor-makeup-gain",[items[8] floatValue]);
config_PutFloat(p_intf, "spatializer-roomsize",[items[9] floatValue]);
config_PutFloat(p_intf, "spatializer-width",[items[10] floatValue]);
config_PutFloat(p_intf, "spatializer-wet",[items[11] floatValue]);
config_PutFloat(p_intf, "spatializer-dry",[items[12] floatValue]);
config_PutFloat(p_intf, "spatializer-damp",[items[13] floatValue]);
config_PutFloat(p_intf, "norm-max-level",[items[14] floatValue]);
config_PutInt(p_intf, "equalizer-2pass",[items[15] intValue]);
config_PutFloat(p_intf, "compressor-rms-peak",[[items objectAtIndex:2] floatValue]);
config_PutFloat(p_intf, "compressor-attack",[[items objectAtIndex:3] floatValue]);
config_PutFloat(p_intf, "compressor-release",[[items objectAtIndex:4] floatValue]);
config_PutFloat(p_intf, "compressor-threshold",[[items objectAtIndex:5] floatValue]);
config_PutFloat(p_intf, "compressor-ratio",[[items objectAtIndex:6] floatValue]);
config_PutFloat(p_intf, "compressor-knee",[[items objectAtIndex:7] floatValue]);
config_PutFloat(p_intf, "compressor-makeup-gain",[[items objectAtIndex:8] floatValue]);
config_PutFloat(p_intf, "spatializer-roomsize",[[items objectAtIndex:9] floatValue]);
config_PutFloat(p_intf, "spatializer-width",[[items objectAtIndex:10] floatValue]);
config_PutFloat(p_intf, "spatializer-wet",[[items objectAtIndex:11] floatValue]);
config_PutFloat(p_intf, "spatializer-dry",[[items objectAtIndex:12] floatValue]);
config_PutFloat(p_intf, "spatializer-damp",[[items objectAtIndex:13] floatValue]);
config_PutFloat(p_intf, "norm-max-level",[[items objectAtIndex:14] floatValue]);
config_PutInt(p_intf, "equalizer-2pass",[[items objectAtIndex:15] intValue]);
/* set values on-the-fly if we have an aout */
if (p_aout) {
var_SetFloat(p_aout, "compressor-rms-peak", [items[2] floatValue]);
var_SetFloat(p_aout, "compressor-attack", [items[3] floatValue]);
var_SetFloat(p_aout, "compressor-release", [items[4] floatValue]);
var_SetFloat(p_aout, "compressor-threshold", [items[5] floatValue]);
var_SetFloat(p_aout, "compressor-ratio", [items[6] floatValue]);
var_SetFloat(p_aout, "compressor-knee", [items[7] floatValue]);
var_SetFloat(p_aout, "compressor-makeup-gain", [items[8] floatValue]);
var_SetFloat(p_aout, "spatializer-roomsize", [items[9] floatValue]);
var_SetFloat(p_aout, "spatializer-width", [items[10] floatValue]);
var_SetFloat(p_aout, "spatializer-wet", [items[11] floatValue]);
var_SetFloat(p_aout, "spatializer-dry", [items[12] floatValue]);
var_SetFloat(p_aout, "spatializer-damp", [items[13] floatValue]);
var_SetFloat(p_aout, "norm-max-level", [items[14] floatValue]);
var_SetBool(p_aout, "equalizer-2pass", (BOOL)[items[15] intValue]);
var_SetFloat(p_aout, "compressor-rms-peak", [[items objectAtIndex:2] floatValue]);
var_SetFloat(p_aout, "compressor-attack", [[items objectAtIndex:3] floatValue]);
var_SetFloat(p_aout, "compressor-release", [[items objectAtIndex:4] floatValue]);
var_SetFloat(p_aout, "compressor-threshold", [[items objectAtIndex:5] floatValue]);
var_SetFloat(p_aout, "compressor-ratio", [[items objectAtIndex:6] floatValue]);
var_SetFloat(p_aout, "compressor-knee", [[items objectAtIndex:7] floatValue]);
var_SetFloat(p_aout, "compressor-makeup-gain", [[items objectAtIndex:8] floatValue]);
var_SetFloat(p_aout, "spatializer-roomsize", [[items objectAtIndex:9] floatValue]);
var_SetFloat(p_aout, "spatializer-width", [[items objectAtIndex:10] floatValue]);
var_SetFloat(p_aout, "spatializer-wet", [[items objectAtIndex:11] floatValue]);
var_SetFloat(p_aout, "spatializer-dry", [[items objectAtIndex:12] floatValue]);
var_SetFloat(p_aout, "spatializer-damp", [[items objectAtIndex:13] floatValue]);
var_SetFloat(p_aout, "norm-max-level", [[items objectAtIndex:14] floatValue]);
var_SetBool(p_aout, "equalizer-2pass", (BOOL)[[items objectAtIndex:15] intValue]);
}
/* update UI */
......@@ -365,7 +365,7 @@ static VLCAudioEffects *_o_sharedInstance = nil;
[o_eq_enable_ckb setState:NSOffState];
else
[o_eq_enable_ckb setState:NSOnState];
[o_eq_twopass_ckb setState:[items[15] intValue]];
[o_eq_twopass_ckb setState:[[items objectAtIndex:15] intValue]];
[self resetCompressor];
[self resetSpatializer];
[self resetAudioFilters];
......@@ -491,7 +491,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
[self eq_changePreset: o_eq_presets_popup];
[o_eq_preamp_sld setFloatValue:[[defaults objectForKey:@"EQPreampValues"][currentPresetIndex] floatValue]];
[o_eq_preamp_sld setFloatValue:[[[defaults objectForKey:@"EQPreampValues"] objectAtIndex:currentPresetIndex] floatValue]];
[self setBandSliderValuesForPreset:currentPresetIndex];
}
......@@ -528,11 +528,11 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
- (void)setBandSliderValuesForPreset:(NSInteger)presetID
{
NSString *preset = [[NSUserDefaults standardUserDefaults] objectForKey:@"EQValues"][presetID];
NSString *preset = [[[NSUserDefaults standardUserDefaults] objectForKey:@"EQValues"] objectAtIndex:presetID];
NSArray *values = [preset componentsSeparatedByString:@" "];
NSUInteger count = [values count];
for (NSUInteger x = 0; x < count; x++)
[self setValue:[values[x] floatValue] forSlider:x];
[self setValue:[[values objectAtIndex:x] floatValue] forSlider:x];
}
- (NSString *)generatePresetString
......@@ -581,14 +581,14 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
NSInteger numberOfChosenPreset = [sender indexOfSelectedItem];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString *preset = [defaults objectForKey:@"EQValues"][numberOfChosenPreset];
NSString *preamp = [defaults objectForKey:@"EQPreampValues"][numberOfChosenPreset];
NSString *preset = [[defaults objectForKey:@"EQValues"] objectAtIndex:numberOfChosenPreset];
NSString *preamp = [[defaults objectForKey:@"EQPreampValues"] objectAtIndex:numberOfChosenPreset];
audio_output_t *p_aout = getAout();
if (p_aout) {
var_SetString(p_aout, "equalizer-bands", [preset UTF8String]);
var_SetFloat(p_aout, "equalizer-preamp", [preamp floatValue]);
var_SetString(p_aout, "equalizer-preset" , [[defaults objectForKey:@"EQNames"][numberOfChosenPreset] UTF8String]);
var_SetString(p_aout, "equalizer-preset" , [[[defaults objectForKey:@"EQNames"] objectAtIndex:numberOfChosenPreset] UTF8String]);
vlc_object_release(p_aout);
}
......@@ -598,7 +598,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
/* save changed to config */
config_PutPsz(p_intf, "equalizer-bands", [preset UTF8String]);
config_PutFloat(p_intf, "equalizer-preamp", [preamp floatValue]);
config_PutPsz(p_intf, "equalizer-preset", [[defaults objectForKey:@"EQNames"][numberOfChosenPreset] UTF8String]);
config_PutPsz(p_intf, "equalizer-preset", [[[defaults objectForKey:@"EQNames"] objectAtIndex:numberOfChosenPreset] UTF8String]);
}
......
......@@ -238,9 +238,9 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
[_customize_aud_samplerate_pop removeAllItems];
[_customize_subs_pop removeAllItems];
[_customize_vid_codec_pop addItemsWithTitles:_videoCodecs[0]];
[_customize_aud_codec_pop addItemsWithTitles:_audioCodecs[0]];
[_customize_subs_pop addItemsWithTitles:_subsCodecs[0]];
[_customize_vid_codec_pop addItemsWithTitles:[_videoCodecs objectAtIndex:0]];
[_customize_aud_codec_pop addItemsWithTitles:[_audioCodecs objectAtIndex:0]];
[_customize_subs_pop addItemsWithTitles:[_subsCodecs objectAtIndex:0]];
[_customize_aud_samplerate_pop addItemWithTitle:@"8000"];
[_customize_aud_samplerate_pop addItemWithTitle:@"11025"];
......@@ -259,7 +259,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
[_ok_btn setEnabled: NO];
[self resetCustomizationSheetBasedOnProfile:self.profileValueList[0]];
[self resetCustomizationSheetBasedOnProfile:[self.profileValueList objectAtIndex:0]];
}
# pragma mark -
......@@ -277,7 +277,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
{
if (b_streaming) {
if ([[[_stream_type_pop selectedItem] title] isEqualToString:@"HTTP"]) {
NSString *muxformat = self.currentProfile[0];
NSString *muxformat = [self.currentProfile objectAtIndex:0];
if ([muxformat isEqualToString:@"wav"] || [muxformat isEqualToString:@"mov"] || [muxformat isEqualToString:@"mp4"] || [muxformat isEqualToString:@"mkv"]) {
NSBeginInformationalAlertSheet(_NS("Invalid container format for HTTP streaming"), _NS("OK"), @"", @"", _window,
nil, nil, nil, nil,
......@@ -339,7 +339,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
{
NSUInteger index = [_profile_pop indexOfSelectedItem];
if (index < ([self.profileValueList count] - 1))
[self resetCustomizationSheetBasedOnProfile:self.profileValueList[index]];
[self resetCustomizationSheetBasedOnProfile:[self.profileValueList objectAtIndex:index]];
}
- (IBAction)customizeProfile:(id)sender
......@@ -551,7 +551,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
NSArray *values = [[paste propertyListForType: NSFilenamesPboardType] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
if ([values count] > 0) {
[self setMRL: @(vlc_path2uri([values[0] UTF8String], NULL))];
[self setMRL: @(vlc_path2uri([[values objectAtIndex:0] UTF8String], NULL))];
[self updateOKButton];
[self updateDropView];
return YES;
......@@ -566,7 +566,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
PL_LOCK;
/* let's look for the first proper input item */
for (NSUInteger x = 0; x < count; x++) {
p_item = [array[x] pointerValue];
p_item = [[array objectAtIndex:x] pointerValue];
if (p_item) {
if (p_item->p_input) {
if (p_item->p_input->psz_uri != nil) {
......@@ -692,57 +692,57 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
return;
}
[self selectCellByEncapsulationFormat:components[0]];
[_customize_vid_ckb setState:[components[1] intValue]];
[_customize_aud_ckb setState:[components[2] intValue]];
[_customize_subs_ckb setState:[components[3] intValue]];
[self setVidBitrate:[components[5] intValue]];
[_customize_vid_scale_pop selectItemWithTitle:components[6]];
[self setVidFramerate:[components[7] intValue]];
[_customize_vid_width_fld setStringValue:components[8]];
[_customize_vid_height_fld setStringValue:components[9]];
[self setAudBitrate:[components[11] intValue]];
[self setAudChannels:[components[12] intValue]];
[_customize_aud_samplerate_pop selectItemWithTitle:components[13]];
[_customize_subs_overlay_ckb setState:[components[15] intValue]];
[self selectCellByEncapsulationFormat:[components objectAtIndex:0]];
[_customize_vid_ckb setState:[[components objectAtIndex:1] intValue]];
[_customize_aud_ckb setState:[[components objectAtIndex:2] intValue]];
[_customize_subs_ckb setState:[[components objectAtIndex:3] intValue]];
[self setVidBitrate:[[components objectAtIndex:5] intValue]];
[_customize_vid_scale_pop selectItemWithTitle:[components objectAtIndex:6]];
[self setVidFramerate:[[components objectAtIndex:7] intValue]];
[_customize_vid_width_fld setStringValue:[components objectAtIndex:8]];
[_customize_vid_height_fld setStringValue:[components objectAtIndex:9]];
[self setAudBitrate:[[components objectAtIndex:11] intValue]];
[self setAudChannels:[[components objectAtIndex:12] intValue]];
[_customize_aud_samplerate_pop selectItemWithTitle:[components objectAtIndex:13]];
[_customize_subs_overlay_ckb setState:[[components objectAtIndex:15] intValue]];
/* since there is no proper lookup mechanism in arrays, we need to implement a string specific one ourselves */
NSArray * tempArray = _videoCodecs[1];
NSArray * tempArray = [_videoCodecs objectAtIndex:1];
NSUInteger count = [tempArray count];
NSString * searchString = components[4];
NSString * searchString = [components objectAtIndex:4];
if ([searchString isEqualToString:@"none"] || [searchString isEqualToString:@"0"]) {
[_customize_vid_codec_pop selectItemAtIndex:-1];
} else {
for (NSUInteger x = 0; x < count; x++) {
if ([tempArray[x] isEqualToString: searchString]) {
if ([[tempArray objectAtIndex:x] isEqualToString: searchString]) {
[_customize_vid_codec_pop selectItemAtIndex:x];
break;
}
}
}
tempArray = _audioCodecs[1];
tempArray = [_audioCodecs objectAtIndex:1];
count = [tempArray count];
searchString = components[10];
searchString = [components objectAtIndex:10];
if ([searchString isEqualToString:@"none"] || [searchString isEqualToString:@"0"]) {
[_customize_aud_codec_pop selectItemAtIndex:-1];
} else {
for (NSUInteger x = 0; x < count; x++) {
if ([tempArray[x] isEqualToString: searchString]) {
if ([[tempArray objectAtIndex:x] isEqualToString: searchString]) {
[_customize_aud_codec_pop selectItemAtIndex:x];
break;
}
}
}
tempArray = _subsCodecs[1];
tempArray = [_subsCodecs objectAtIndex:1];
count = [tempArray count];
searchString = components[14];
searchString = [components objectAtIndex:14];
if ([searchString isEqualToString:@"none"] || [searchString isEqualToString:@"0"]) {
[_customize_subs_pop selectItemAtIndex:-1];
} else {
for (NSUInteger x = 0; x < count; x++) {
if ([tempArray[x] isEqualToString: searchString]) {
if ([[tempArray objectAtIndex:x] isEqualToString: searchString]) {
[_customize_subs_pop selectItemAtIndex:x];
break;
}
......@@ -861,47 +861,47 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
- (NSString *)composedOptions
{
NSMutableString *composedOptions = [[NSMutableString alloc] initWithString:@":sout=#transcode{"];
if ([self.currentProfile[1] intValue]) {
if ([[self.currentProfile objectAtIndex:1] intValue]) {
// video is enabled
[composedOptions appendFormat:@"vcodec=%@", self.currentProfile[4]];
if (![self.currentProfile[4] isEqualToString:@"none"]) {
if ([self.currentProfile[5] intValue] > 0) // bitrate
[composedOptions appendFormat:@",vb=%@", self.currentProfile[5]];
if ([self.currentProfile[6] floatValue] > 0.) // scale
[composedOptions appendFormat:@",scale=%@", self.currentProfile[6]];
if ([self.currentProfile[7] floatValue] > 0.) // fps
[composedOptions appendFormat:@",fps=%@", self.currentProfile[7]];
if ([self.currentProfile[8] intValue] > 0) // width
[composedOptions appendFormat:@",width=%@", self.currentProfile[8]];
if ([self.currentProfile[9] intValue] > 0) // height
[composedOptions appendFormat:@",height=%@", self.currentProfile[9]];
[composedOptions appendFormat:@"vcodec=%@", [self.currentProfile objectAtIndex:4]];
if (![[self.currentProfile objectAtIndex:4] isEqualToString:@"none"]) {
if ([[self.currentProfile objectAtIndex:5] intValue] > 0) // bitrate
[composedOptions appendFormat:@",vb=%@", [self.currentProfile objectAtIndex:5]];
if ([[self.currentProfile objectAtIndex:6] floatValue] > 0.) // scale
[composedOptions appendFormat:@",scale=%@", [self.currentProfile objectAtIndex:6]];
if ([[self.currentProfile objectAtIndex:7] floatValue] > 0.) // fps
[composedOptions appendFormat:@",fps=%@", [self.currentProfile objectAtIndex:7]];
if ([[self.currentProfile objectAtIndex:8] intValue] > 0) // width
[composedOptions appendFormat:@",width=%@", [self.currentProfile objectAtIndex:8]];
if ([[self.currentProfile objectAtIndex:9] intValue] > 0) // height
[composedOptions appendFormat:@",height=%@", [self.currentProfile objectAtIndex:9]];
}
}
if ([self.currentProfile[2] intValue]) {
if ([[self.currentProfile objectAtIndex:2] intValue]) {
// audio is enabled
// add another comma in case video is enabled
if ([self.currentProfile[1] intValue])
if ([[self.currentProfile objectAtIndex:1] intValue])
[composedOptions appendString:@","];
[composedOptions appendFormat:@"acodec=%@", self.currentProfile[10]];
if (![self.currentProfile[10] isEqualToString:@"none"]) {
[composedOptions appendFormat:@",ab=%@", self.currentProfile[11]]; // bitrate
[composedOptions appendFormat:@",channels=%@", self.currentProfile[12]]; // channel number
[composedOptions appendFormat:@",samplerate=%@", self.currentProfile[13]]; // sample rate
[composedOptions appendFormat:@"acodec=%@", [self.currentProfile objectAtIndex:10]];
if (![[self.currentProfile objectAtIndex:10] isEqualToString:@"none"]) {
[composedOptions appendFormat:@",ab=%@", [self.currentProfile objectAtIndex:11]]; // bitrate
[composedOptions appendFormat:@",channels=%@", [self.currentProfile objectAtIndex:12]]; // channel number
[composedOptions appendFormat:@",samplerate=%@", [self.currentProfile objectAtIndex:13]]; // sample rate
}
}
if (self.currentProfile[3]) {
if ([self.currentProfile objectAtIndex:3]) {
// subtitles enabled
[composedOptions appendFormat:@",scodec=%@", self.currentProfile[14]];
if ([self.currentProfile[15] intValue])
[composedOptions appendFormat:@",scodec=%@", [self.currentProfile objectAtIndex:14]];
if ([[self.currentProfile objectAtIndex:15] intValue])
[composedOptions appendFormat:@",soverlay"];
}
if (!b_streaming) {
/* file transcoding */
// add muxer
[composedOptions appendFormat:@"}:standard{mux=%@", self.currentProfile[0]];
[composedOptions appendFormat:@"}:standard{mux=%@", [self.currentProfile objectAtIndex:0]];
// add output destination
[composedOptions appendFormat:@",access=file{no-overwrite},dst=%@}", _outputDestination];
......@@ -914,7 +914,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
else if ([[[_stream_type_pop selectedItem] title] isEqualToString:@"MMSH"])
[composedOptions appendFormat:@":standard{mux=asfh,dst=%@,port=%@,access=mmsh", _outputDestination, [_stream_port_fld stringValue]];
else
[composedOptions appendFormat:@":standard{mux=%@,dst=%@,port=%@,access=http", self.currentProfile[0], [_stream_port_fld stringValue], _outputDestination];
[composedOptions appendFormat:@":standard{mux=%@,dst=%@,port=%@,access=http", [self.currentProfile objectAtIndex:0], [_stream_port_fld stringValue], _outputDestination];
if ([_stream_sap_ckb state])
[composedOptions appendFormat:@",sap,name=\"%@\"", [_stream_channel_fld stringValue]];
......@@ -954,7 +954,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
[self.currentProfile addObject: [NSString stringWithFormat:@"%li", [_customize_subs_ckb state]]];
i = [_customize_vid_codec_pop indexOfSelectedItem];
if (i >= 0)
[self.currentProfile addObject: _videoCodecs[1][i]];
[self.currentProfile addObject: [[_videoCodecs objectAtIndex:1] objectAtIndex:i]];
else
[self.currentProfile addObject: @"none"];
[self.currentProfile addObject: [NSString stringWithFormat:@"%i", [self vidBitrate]]];
......@@ -964,7 +964,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
[self.currentProfile addObject: [NSString stringWithFormat:@"%i", [_customize_vid_height_fld intValue]]];
i = [_customize_aud_codec_pop indexOfSelectedItem];
if (i >= 0)
[self.currentProfile addObject: _audioCodecs[1][i]];
[self.currentProfile addObject: [[_audioCodecs objectAtIndex:1] objectAtIndex:i]];
else
[self.currentProfile addObject: @"none"];
[self.currentProfile addObject: [NSString stringWithFormat:@"%i", [self audBitrate]]];
......@@ -972,7 +972,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
[self.currentProfile addObject: [[_customize_aud_samplerate_pop selectedItem] title]];
i = [_customize_subs_pop indexOfSelectedItem];
if (i >= 0)
[self.currentProfile addObject: _subsCodecs[1][i]];
[self.currentProfile addObject: [[_subsCodecs objectAtIndex:1] objectAtIndex:i]];
else
[self.currentProfile addObject: @"none"];
[self.currentProfile addObject: [NSString stringWithFormat:@"%li", [_customize_subs_overlay_ckb state]]];
......
......@@ -566,7 +566,7 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
BOOL b_returned = NO;
if (count == 1 && p_input) {
b_returned = input_AddSubtitle(p_input, [o_values[0] UTF8String], true);
b_returned = input_AddSubtitle(p_input, [[o_values objectAtIndex:0] UTF8String], true);
vlc_object_release(p_input);
if (!b_returned)
return YES;
......@@ -576,7 +576,7 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
for (NSUInteger i = 0; i < count; i++) {
NSDictionary *o_dic;
char *psz_uri = vlc_path2uri([o_values[i] UTF8String], NULL);
char *psz_uri = vlc_path2uri([[o_values objectAtIndex:i] UTF8String], NULL);
if (!psz_uri)
continue;
......
......@@ -126,7 +126,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
/* check whether the user runs OSX with a RTL language */
NSArray* languages = [NSLocale preferredLanguages];
NSString* preferredLanguage = languages[0];
NSString* preferredLanguage = [languages objectAtIndex:0];
if ([NSLocale characterDirectionForLanguage:preferredLanguage] == NSLocaleLanguageDirectionRightToLeft) {
msg_Dbg(VLCIntf, "adapting interface since '%s' is a RTL language", [preferredLanguage UTF8String]);
......@@ -478,12 +478,12 @@ static VLCMainMenu *_o_sharedInstance = nil;
NSMenuItem *o_mi_tmp;
NSUInteger count = [o_ptc_menuorder count];
for (NSUInteger i = 0; i < count; i++) {
NSString *o_title = [o_ptc_translation_dict objectForKey:o_ptc_menuorder[i]];
NSString *o_title = [o_ptc_translation_dict objectForKey:[o_ptc_menuorder objectAtIndex:i]];
o_mi_tmp = [o_mu_playlistTableColumns addItemWithTitle:o_title
action:@selector(togglePlaylistColumnTable:)
keyEquivalent:@""];
/* don't set a valid target for the title column selector, since we want it to be disabled */
if (![o_ptc_menuorder[i] isEqualToString: TITLE_COLUMN])
if (![[o_ptc_menuorder objectAtIndex:i] isEqualToString: TITLE_COLUMN])
[o_mi_tmp setTarget:self];
[o_mi_tmp setTag:i];
......@@ -491,7 +491,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
action:@selector(togglePlaylistColumnTable:)
keyEquivalent:@""];
/* don't set a valid target for the title column selector, since we want it to be disabled */
if (![o_ptc_menuorder[i] isEqualToString: TITLE_COLUMN])
if (![[o_ptc_menuorder objectAtIndex:i] isEqualToString: TITLE_COLUMN])
[o_mi_tmp setTarget:self];
[o_mi_tmp setTag:i];
}
......@@ -510,7 +510,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
NSArray *menuitems_array = [the_menu itemArray];
NSUInteger menuItemCount = [menuitems_array count];
for (NSUInteger i=0; i < menuItemCount; i++) {
NSMenuItem *one_item = menuitems_array[i];
NSMenuItem *one_item = [menuitems_array objectAtIndex:i];
if ([one_item hasSubmenu])
[self releaseRepresentedObjects: [one_item submenu]];
......@@ -604,11 +604,11 @@ static VLCMainMenu *_o_sharedInstance = nil;
[o_mitem setTarget: self];
NSRect s_rect;
for (NSUInteger i = 0; i < count; i++) {
s_rect = [o_screens[i] frame];
s_rect = [[o_screens objectAtIndex:i] frame];
[o_submenu addItemWithTitle: [NSString stringWithFormat: @"%@ %li (%ix%i)", _NS("Screen"), i+1,