Commit 706da72a authored by Felix Paul Kühne's avatar Felix Paul Kühne Committed by Felix Paul Kühne

macosx: fix compilation on 10.6 with clang 3.0

parent 0ccf1405
...@@ -86,25 +86,25 @@ static AppleRemote *_o_sharedInstance = nil; ...@@ -86,25 +86,25 @@ static AppleRemote *_o_sharedInstance = nil;
hidDeviceInterface = NULL; hidDeviceInterface = NULL;
NSMutableDictionary * mutableCookieToButtonMapping = [[NSMutableDictionary alloc] init]; NSMutableDictionary * mutableCookieToButtonMapping = [[NSMutableDictionary alloc] init];
[mutableCookieToButtonMapping setObject:@(kRemoteButtonVolume_Plus) forKey:@"33_31_30_21_20_2_"]; [mutableCookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonVolume_Plus] forKey:@"33_31_30_21_20_2_"];
[mutableCookieToButtonMapping setObject:@(kRemoteButtonVolume_Minus) forKey:@"33_32_30_21_20_2_"]; [mutableCookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonVolume_Minus] forKey:@"33_32_30_21_20_2_"];
[mutableCookieToButtonMapping setObject:@(kRemoteButtonMenu) forKey:@"33_22_21_20_2_33_22_21_20_2_"]; [mutableCookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonMenu] forKey:@"33_22_21_20_2_33_22_21_20_2_"];
[mutableCookieToButtonMapping setObject:@(kRemoteButtonPlay) forKey:@"33_23_21_20_2_33_23_21_20_2_"]; [mutableCookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonPlay] forKey:@"33_23_21_20_2_33_23_21_20_2_"];
[mutableCookieToButtonMapping setObject:@(kRemoteButtonRight) forKey:@"33_24_21_20_2_33_24_21_20_2_"]; [mutableCookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonRight] forKey:@"33_24_21_20_2_33_24_21_20_2_"];
[mutableCookieToButtonMapping setObject:@(kRemoteButtonLeft) forKey:@"33_25_21_20_2_33_25_21_20_2_"]; [mutableCookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonLeft] forKey:@"33_25_21_20_2_33_25_21_20_2_"];
[mutableCookieToButtonMapping setObject:@(kRemoteButtonRight_Hold) forKey:@"33_21_20_14_12_2_"]; [mutableCookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonRight_Hold] forKey:@"33_21_20_14_12_2_"];
[mutableCookieToButtonMapping setObject:@(kRemoteButtonLeft_Hold) forKey:@"33_21_20_13_12_2_"]; [mutableCookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonLeft_Hold] forKey:@"33_21_20_13_12_2_"];
[mutableCookieToButtonMapping setObject:@(kRemoteButtonMenu_Hold) forKey:@"33_21_20_2_33_21_20_2_"]; [mutableCookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonMenu_Hold] forKey:@"33_21_20_2_33_21_20_2_"];
[mutableCookieToButtonMapping setObject:@(kRemoteButtonPlay_Sleep) forKey:@"37_33_21_20_2_37_33_21_20_2_"]; [mutableCookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonPlay_Sleep] forKey:@"37_33_21_20_2_37_33_21_20_2_"];
[mutableCookieToButtonMapping setObject:@(k2009RemoteButtonPlay) forKey:@"33_21_20_8_2_33_21_20_8_2_"]; [mutableCookieToButtonMapping setObject:[NSNumber numberWithInt:k2009RemoteButtonPlay] forKey:@"33_21_20_8_2_33_21_20_8_2_"];
[mutableCookieToButtonMapping setObject:@(k2009RemoteButtonFullscreen) forKey:@"33_21_20_3_2_33_21_20_3_2_"]; [mutableCookieToButtonMapping setObject:[NSNumber numberWithInt:k2009RemoteButtonFullscreen] forKey:@"33_21_20_3_2_33_21_20_3_2_"];
if( OSX_SNOW_LEOPARD ) if( OSX_SNOW_LEOPARD )
/* 10.6.2+ Snow Leopard cookies */ /* 10.6.2+ Snow Leopard cookies */
[mutableCookieToButtonMapping setObject:@(kRemoteControl_Switched) forKey:@"19_"]; [mutableCookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteControl_Switched] forKey:@"19_"];
else else
/* Lion cookies */ /* Lion cookies */
[mutableCookieToButtonMapping setObject:@(kRemoteControl_Switched) forKey:@"42_33_23_21_20_2_33_23_21_20_2_"]; [mutableCookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteControl_Switched] forKey:@"42_33_23_21_20_2_33_23_21_20_2_"];
_cookieToButtonMapping = [[NSDictionary alloc] initWithDictionary: mutableCookieToButtonMapping]; _cookieToButtonMapping = [[NSDictionary alloc] initWithDictionary: mutableCookieToButtonMapping];
[mutableCookieToButtonMapping release]; [mutableCookieToButtonMapping release];
...@@ -343,7 +343,7 @@ static AppleRemote* sharedInstance=nil; ...@@ -343,7 +343,7 @@ static AppleRemote* sharedInstance=nil;
lastPlusMinusEvent = event; lastPlusMinusEvent = event;
lastPlusMinusEventTime = [NSDate timeIntervalSinceReferenceDate]; lastPlusMinusEventTime = [NSDate timeIntervalSinceReferenceDate];
[self performSelector:@selector(sendSimulatedPlusMinusEvent:) [self performSelector:@selector(sendSimulatedPlusMinusEvent:)
withObject:@(lastPlusMinusEventTime) withObject:[NSNumber numberWithDouble:lastPlusMinusEventTime]
afterDelay:HOLD_RECOGNITION_TIME_INTERVAL]; afterDelay:HOLD_RECOGNITION_TIME_INTERVAL];
return; return;
} else { } else {
...@@ -375,11 +375,11 @@ static AppleRemote* sharedInstance=nil; ...@@ -375,11 +375,11 @@ static AppleRemote* sharedInstance=nil;
eventClickCount = 1; eventClickCount = 1;
} }
lastClickCountEvent = event; lastClickCountEvent = event;
timeNumber = @(lastClickCountEventTime); timeNumber = [NSNumber numberWithDouble:lastClickCountEventTime];
eventNumber= @(event); eventNumber= [NSNumber numberWithUnsignedInt:event];
} }
[self performSelector: @selector(executeClickCountEvent:) [self performSelector: @selector(executeClickCountEvent:)
withObject: @[eventNumber, timeNumber] withObject: [NSArray arrayWithObjects: eventNumber, timeNumber, nil]
afterDelay: _maxClickTimeDifference]; afterDelay: _maxClickTimeDifference];
} else { } else {
[delegate appleRemoteButton:event pressedDown: pressedDown clickCount:1]; [delegate appleRemoteButton:event pressedDown: pressedDown clickCount:1];
...@@ -582,7 +582,7 @@ static void QueueCallbackFunction(void* target, IOReturn result, void* refcon, ...@@ -582,7 +582,7 @@ static void QueueCallbackFunction(void* target, IOReturn result, void* refcon,
if (object == nil || ![object isKindOfClass:[NSNumber class]]) continue; if (object == nil || ![object isKindOfClass:[NSNumber class]]) continue;
usagePage = [object longValue]; usagePage = [object longValue];
[mutableAllCookies addObject: @((int)cookie)]; [mutableAllCookies addObject: [NSNumber numberWithInt:(int)cookie]];
} }
_allCookies = [[NSArray alloc] initWithArray: mutableAllCookies]; _allCookies = [[NSArray alloc] initWithArray: mutableAllCookies];
[mutableAllCookies release]; [mutableAllCookies release];
......
...@@ -76,14 +76,14 @@ static VLCAudioEffects *_o_sharedInstance = nil; ...@@ -76,14 +76,14 @@ static VLCAudioEffects *_o_sharedInstance = nil;
eqz_preset_10b[i].f_amp[9]]; eqz_preset_10b[i].f_amp[9]];
[workValues addObject:workString]; [workValues addObject:workString];
[workPreamp addObject:[NSString stringWithFormat:@"%1.f", eqz_preset_10b[i].f_preamp]]; [workPreamp addObject:[NSString stringWithFormat:@"%1.f", eqz_preset_10b[i].f_preamp]];
[workTitles addObject:@(preset_list_text[i])]; [workTitles addObject:[NSString stringWithUTF8String:preset_list_text[i]]];
[workNames addObject:@(preset_list[i])]; [workNames addObject:[NSString stringWithUTF8String:preset_list[i]]];
} }
NSString *defaultProfile = [NSString stringWithFormat:@"ZmxhdA==;;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%i", 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]; .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", @[defaultProfile], @"AudioEffectProfiles", @[_NS("Default")], @"AudioEffectProfileNames", nil]; 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];
[defaults registerDefaults:appDefaults]; [defaults registerDefaults:appDefaults];
[workValues release]; [workValues release];
...@@ -177,9 +177,9 @@ static VLCAudioEffects *_o_sharedInstance = nil; ...@@ -177,9 +177,9 @@ static VLCAudioEffects *_o_sharedInstance = nil;
} }
} else { } else {
if (psz_tmp) { if (psz_tmp) {
psz_tmp = (char *)[[@(psz_tmp) stringByTrimmingCharactersInSet: [NSCharacterSet characterSetWithCharactersInString:[NSString stringWithFormat:@":%s",psz_name]]] UTF8String]; psz_tmp = (char *)[[[NSString stringWithUTF8String:psz_tmp] stringByTrimmingCharactersInSet: [NSCharacterSet characterSetWithCharactersInString:[NSString stringWithFormat:@":%s",psz_name]]] UTF8String];
psz_tmp = (char *)[[@(psz_tmp) stringByTrimmingCharactersInSet: [NSCharacterSet characterSetWithCharactersInString:[NSString stringWithFormat:@"%s:",psz_name]]] UTF8String]; psz_tmp = (char *)[[[NSString stringWithUTF8String:psz_tmp] stringByTrimmingCharactersInSet: [NSCharacterSet characterSetWithCharactersInString:[NSString stringWithFormat:@"%s:",psz_name]]] UTF8String];
psz_tmp = (char *)[[@(psz_tmp) stringByTrimmingCharactersInSet: [NSCharacterSet characterSetWithCharactersInString:@(psz_name)]] UTF8String]; psz_tmp = (char *)[[[NSString stringWithUTF8String:psz_tmp] stringByTrimmingCharactersInSet: [NSCharacterSet characterSetWithCharactersInString:[NSString stringWithUTF8String:psz_name]]] UTF8String];
config_PutPsz(p_intf, "audio-filter", psz_tmp); config_PutPsz(p_intf, "audio-filter", psz_tmp);
} }
} }
......
...@@ -221,16 +221,16 @@ static VLCConvertAndSave *_o_sharedInstance = nil; ...@@ -221,16 +221,16 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
[self recreateProfilePopup]; [self recreateProfilePopup];
_videoCodecs = [[NSArray alloc] initWithObjects: _videoCodecs = [[NSArray alloc] initWithObjects:
@[@"MPEG-1", @"MPEG-2", @"MPEG-4", @"DIVX 1", @"DIVX 2", @"DIVX 3", @"H.263", @"H.264", @"VP8", @"WMV1", @"WMV2", @"M-JPEG", @"Theora", @"Dirac"], [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],
@[@"mpgv", @"mp2v", @"mp4v", @"DIV1", @"DIV2", @"DIV3", @"H263", @"h264", @"VP80", @"WMV1", @"WMV2", @"MJPG", @"theo", @"drac"], [NSArray arrayWithObjects:@"mpgv", @"mp2v", @"mp4v", @"DIV1", @"DIV2", @"DIV3", @"H263", @"h264", @"VP80", @"WMV1", @"WMV2", @"MJPG", @"theo", @"drac", nil],
nil]; nil];
_audioCodecs = [[NSArray alloc] initWithObjects: _audioCodecs = [[NSArray alloc] initWithObjects:
@[@"MPEG Audio", @"MP3", @"MPEG 4 Audio (AAC)", @"A52/AC-3", @"Vorbis", @"Flac", @"Speex", @"WAV", @"WMA2"], [NSArray arrayWithObjects:@"MPEG Audio", @"MP3", @"MPEG 4 Audio (AAC)", @"A52/AC-3", @"Vorbis", @"Flac", @"Speex", @"WAV", @"WMA2", nil],
@[@"mpga", @"mp3", @"mp4a", @"a52", @"vorb", @"flac", @"spx", @"s16l", @"wma2"], [NSArray arrayWithObjects:@"mpga", @"mp3", @"mp4a", @"a52", @"vorb", @"flac", @"spx", @"s16l", @"wma2", nil],
nil]; nil];
_subsCodecs = [[NSArray alloc] initWithObjects: _subsCodecs = [[NSArray alloc] initWithObjects:
@[@"DVB subtitle", @"T.140"], [NSArray arrayWithObjects:@"DVB subtitle", @"T.140", nil],
@[@"dvbs", @"t140"], [NSArray arrayWithObjects:@"dvbs", @"t140", nil],
nil]; nil];
[_customize_vid_codec_pop removeAllItems]; [_customize_vid_codec_pop removeAllItems];
...@@ -329,7 +329,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil; ...@@ -329,7 +329,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
[openPanel beginSheetModalForWindow:_window completionHandler:^(NSInteger returnCode) { [openPanel beginSheetModalForWindow:_window completionHandler:^(NSInteger returnCode) {
if (returnCode == NSOKButton) if (returnCode == NSOKButton)
{ {
[self setMRL: @(vlc_path2uri([[[openPanel URL] path] UTF8String], NULL))]; [self setMRL: [NSString stringWithUTF8String:vlc_path2uri([[[openPanel URL] path] UTF8String], NULL)]];
[self updateOKButton]; [self updateOKButton];
[self updateDropView]; [self updateDropView];
} }
...@@ -434,7 +434,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil; ...@@ -434,7 +434,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
[saveFilePanel setCanSelectHiddenExtension: YES]; [saveFilePanel setCanSelectHiddenExtension: YES];
[saveFilePanel setCanCreateDirectories: YES]; [saveFilePanel setCanCreateDirectories: YES];
if ([[_customize_encap_matrix selectedCell] tag] != RAW) // there is no clever guess for this if ([[_customize_encap_matrix selectedCell] tag] != RAW) // there is no clever guess for this
[saveFilePanel setAllowedFileTypes:@[[self currentEncapsulationFormatAsFileExtension:YES]]]; [saveFilePanel setAllowedFileTypes:[NSArray arrayWithObject:[self currentEncapsulationFormatAsFileExtension:YES]]];
[saveFilePanel beginSheetModalForWindow:_window completionHandler:^(NSInteger returnCode) { [saveFilePanel beginSheetModalForWindow:_window completionHandler:^(NSInteger returnCode) {
if (returnCode == NSOKButton) { if (returnCode == NSOKButton) {
[self setOutputDestination:[[saveFilePanel URL] path]]; [self setOutputDestination:[[saveFilePanel URL] path]];
...@@ -534,7 +534,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil; ...@@ -534,7 +534,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
NSSavePanel * saveFilePanel = [NSSavePanel savePanel]; NSSavePanel * saveFilePanel = [NSSavePanel savePanel];
[saveFilePanel setCanSelectHiddenExtension: YES]; [saveFilePanel setCanSelectHiddenExtension: YES];
[saveFilePanel setCanCreateDirectories: YES]; [saveFilePanel setCanCreateDirectories: YES];
[saveFilePanel setAllowedFileTypes:@[@"sdp"]]; [saveFilePanel setAllowedFileTypes:[NSArray arrayWithObject:@"sdp"]];
[saveFilePanel beginSheetModalForWindow:_stream_panel completionHandler:^(NSInteger returnCode) { [saveFilePanel beginSheetModalForWindow:_stream_panel completionHandler:^(NSInteger returnCode) {
if (returnCode == NSOKButton) if (returnCode == NSOKButton)
[_stream_sdp_fld setStringValue:[[saveFilePanel URL] path]]; [_stream_sdp_fld setStringValue:[[saveFilePanel URL] path]];
...@@ -544,7 +544,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil; ...@@ -544,7 +544,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender - (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
{ {
NSPasteboard *paste = [sender draggingPasteboard]; NSPasteboard *paste = [sender draggingPasteboard];
NSArray *types = @[NSFilenamesPboardType, @"VLCPlaylistItemPboardType"]; NSArray *types = [NSArray arrayWithObjects:NSFilenamesPboardType, @"VLCPlaylistItemPboardType", nil];
NSString *desired_type = [paste availableTypeFromArray: types]; NSString *desired_type = [paste availableTypeFromArray: types];
NSData *carried_data = [paste dataForType: desired_type]; NSData *carried_data = [paste dataForType: desired_type];
...@@ -553,7 +553,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil; ...@@ -553,7 +553,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
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: @(vlc_path2uri([[values objectAtIndex:0] UTF8String], NULL))]; [self setMRL: [NSString stringWithUTF8String:vlc_path2uri([[values objectAtIndex:0] UTF8String], NULL)]];
[self updateOKButton]; [self updateOKButton];
[self updateDropView]; [self updateDropView];
return YES; return YES;
...@@ -1064,7 +1064,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil; ...@@ -1064,7 +1064,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
- (void)awakeFromNib - (void)awakeFromNib
{ {
[self registerForDraggedTypes:@[NSFilenamesPboardType, @"VLCPlaylistItemPboardType"]]; [self registerForDraggedTypes:[NSArray arrayWithObjects:NSFilenamesPboardType, @"VLCPlaylistItemPboardType", nil]];
} }
- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender - (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
...@@ -1130,7 +1130,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil; ...@@ -1130,7 +1130,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
- (void)awakeFromNib - (void)awakeFromNib
{ {
[self registerForDraggedTypes:@[NSFilenamesPboardType, @"VLCPlaylistItemPboardType"]]; [self registerForDraggedTypes:[NSArray arrayWithObjects:NSFilenamesPboardType, @"VLCPlaylistItemPboardType", nil]];
} }
- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender - (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
...@@ -1159,7 +1159,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil; ...@@ -1159,7 +1159,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
- (void)awakeFromNib - (void)awakeFromNib
{ {
[self registerForDraggedTypes:@[NSFilenamesPboardType, @"VLCPlaylistItemPboardType"]]; [self registerForDraggedTypes:[NSArray arrayWithObjects:NSFilenamesPboardType, @"VLCPlaylistItemPboardType", nil]];
} }
- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender - (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
......
...@@ -240,7 +240,7 @@ static VLCCoreInteraction *_o_sharedInstance = nil; ...@@ -240,7 +240,7 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
} }
NSURL *o_url; NSURL *o_url;
o_url = [NSURL URLWithString:@(psz_uri)]; o_url = [NSURL URLWithString:[NSString stringWithUTF8String:psz_uri]];
vlc_object_release(p_input); vlc_object_release(p_input);
return o_url; return o_url;
...@@ -272,15 +272,15 @@ static VLCCoreInteraction *_o_sharedInstance = nil; ...@@ -272,15 +272,15 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
char *format = var_InheritString(VLCIntf, "input-title-format"); char *format = var_InheritString(VLCIntf, "input-title-format");
char *formated = str_format_meta(pl_Get(VLCIntf), format); char *formated = str_format_meta(pl_Get(VLCIntf), format);
free(format); free(format);
o_name = @(formated); o_name = [NSString stringWithUTF8String:formated];
free(formated); free(formated);
NSURL * o_url = [NSURL URLWithString: @(psz_uri)]; NSURL * o_url = [NSURL URLWithString:[NSString stringWithUTF8String:psz_uri]];
free(psz_uri); free(psz_uri);
if ([o_name isEqualToString:@""]) { if ([o_name isEqualToString:@""]) {
if ([o_url isFileURL]) if ([o_url isFileURL])
o_name = [[NSFileManager defaultManager] displayNameAtPath: [o_url path]]; o_name = [[NSFileManager defaultManager] displayNameAtPath:[o_url path]];
else else
o_name = [o_url absoluteString]; o_name = [o_url absoluteString];
} }
...@@ -570,7 +570,7 @@ static VLCCoreInteraction *_o_sharedInstance = nil; ...@@ -570,7 +570,7 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender - (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
{ {
NSPasteboard *o_paste = [sender draggingPasteboard]; NSPasteboard *o_paste = [sender draggingPasteboard];
NSArray *o_types = @[NSFilenamesPboardType]; NSArray *o_types = [NSArray arrayWithObject:NSFilenamesPboardType];
NSString *o_desired_type = [o_paste availableTypeFromArray:o_types]; NSString *o_desired_type = [o_paste availableTypeFromArray:o_types];
NSData *o_carried_data = [o_paste dataForType:o_desired_type]; NSData *o_carried_data = [o_paste dataForType:o_desired_type];
BOOL b_autoplay = config_GetInt(VLCIntf, "macosx-autoplay"); BOOL b_autoplay = config_GetInt(VLCIntf, "macosx-autoplay");
......
...@@ -154,7 +154,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget, ...@@ -154,7 +154,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget,
// Get the web view // Get the web view
assert([control isKindOfClass:[WebView class]]); assert([control isKindOfClass:[WebView class]]);
WebView *webView = (WebView *)control; WebView *webView = (WebView *)control;
NSString *string = @(widget->psz_text); NSString *string = [NSString stringWithUTF8String:widget->psz_text];
[[webView mainFrame] loadHTMLString:string baseURL:[NSURL URLWithString:@""]]; [[webView mainFrame] loadHTMLString:string baseURL:[NSURL URLWithString:@""]];
[webView setNeedsDisplay:YES]; [webView setNeedsDisplay:YES];
break; break;
...@@ -163,7 +163,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget, ...@@ -163,7 +163,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget,
{ {
assert([control isKindOfClass:[NSTextView class]]); assert([control isKindOfClass:[NSTextView class]]);
NSTextView *textView = (NSTextView *)control; NSTextView *textView = (NSTextView *)control;
NSString *string = @(widget->psz_text); NSString *string = [NSString stringWithUTF8String:widget->psz_text];
NSAttributedString *attrString = [[NSAttributedString alloc] initWithHTML:[string dataUsingEncoding: NSISOLatin1StringEncoding] documentAttributes:NULL]; NSAttributedString *attrString = [[NSAttributedString alloc] initWithHTML:[string dataUsingEncoding: NSISOLatin1StringEncoding] documentAttributes:NULL];
[[textView textStorage] setAttributedString:attrString]; [[textView textStorage] setAttributedString:attrString];
[textView setNeedsDisplay:YES]; [textView setNeedsDisplay:YES];
...@@ -193,7 +193,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget, ...@@ -193,7 +193,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget,
NSButton *button = (NSButton *)control; NSButton *button = (NSButton *)control;
if (!widget->psz_text) if (!widget->psz_text)
break; break;
[button setTitle:@(widget->psz_text)]; [button setTitle:[NSString stringWithUTF8String:widget->psz_text]];
break; break;
} }
case EXTENSION_WIDGET_DROPDOWN: case EXTENSION_WIDGET_DROPDOWN:
...@@ -203,7 +203,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget, ...@@ -203,7 +203,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget,
[popup removeAllItems]; [popup removeAllItems];
struct extension_widget_value_t *value; struct extension_widget_value_t *value;
for (value = widget->p_values; value != NULL; value = value->p_next) for (value = widget->p_values; value != NULL; value = value->p_next)
[popup addItemWithTitle:@(value->psz_text)]; [popup addItemWithTitle:[NSString stringWithUTF8String:value->psz_text]];
[popup synchronizeTitleAndSelectedItem]; [popup synchronizeTitleAndSelectedItem];
[self popUpSelectionChanged:popup]; [self popUpSelectionChanged:popup];
break; break;
...@@ -220,8 +220,8 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget, ...@@ -220,8 +220,8 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget,
for (value = widget->p_values; value != NULL; value = value->p_next) for (value = widget->p_values; value != NULL; value = value->p_next)
{ {
NSDictionary *entry = [NSDictionary dictionaryWithObjectsAndKeys: NSDictionary *entry = [NSDictionary dictionaryWithObjectsAndKeys:
@(value->i_id), @"id", [NSNumber numberWithInt:value->i_id], @"id",
@(value->psz_text), @"text", [NSString stringWithUTF8String:value->psz_text], @"text",
nil]; nil];
[contentArray addObject:entry]; [contentArray addObject:entry];
} }
...@@ -233,7 +233,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget, ...@@ -233,7 +233,7 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget,
{ {
assert([control isKindOfClass:[NSImageView class]]); assert([control isKindOfClass:[NSImageView class]]);
NSImageView *imageView = (NSImageView *)control; NSImageView *imageView = (NSImageView *)control;
NSString *string = widget->psz_text ? @(widget->psz_text) : nil; NSString *string = widget->psz_text ? [NSString stringWithUTF8String:widget->psz_text] : nil;
NSImage *image = nil; NSImage *image = nil;
if (string) if (string)
image = [[NSImage alloc] initWithContentsOfURL:[NSURL fileURLWithPath:string]]; image = [[NSImage alloc] initWithContentsOfURL:[NSURL fileURLWithPath:string]];
...@@ -321,7 +321,7 @@ static ExtensionsDialogProvider *_o_sharedInstance = nil; ...@@ -321,7 +321,7 @@ static ExtensionsDialogProvider *_o_sharedInstance = nil;
- (void)performEventWithObject: (NSValue *)o_value ofType: (const char*)type - (void)performEventWithObject: (NSValue *)o_value ofType: (const char*)type
{ {
NSString *o_type = @(type); NSString *o_type = [NSString stringWithUTF8String:type];
if ([o_type isEqualToString: @"dialog-extension"]) { if ([o_type isEqualToString: @"dialog-extension"]) {
[self performSelectorOnMainThread:@selector(updateExtensionDialog:) [self performSelectorOnMainThread:@selector(updateExtensionDialog:)
...@@ -469,7 +469,7 @@ static ExtensionsDialogProvider *_o_sharedInstance = nil; ...@@ -469,7 +469,7 @@ static ExtensionsDialogProvider *_o_sharedInstance = nil;
defer:NO]; defer:NO];
[dialogWindow setDelegate:self]; [dialogWindow setDelegate:self];
[dialogWindow setDialog:p_dialog]; [dialogWindow setDialog:p_dialog];
[dialogWindow setTitle:@(p_dialog->psz_title)]; [dialogWindow setTitle:[NSString stringWithUTF8String:p_dialog->psz_title]];
VLCDialogGridView *gridView = [[VLCDialogGridView alloc] init]; VLCDialogGridView *gridView = [[VLCDialogGridView alloc] init];
[gridView setAutoresizingMask:NSViewHeightSizable | NSViewWidthSizable]; [gridView setAutoresizingMask:NSViewHeightSizable | NSViewWidthSizable];
......
...@@ -293,7 +293,7 @@ static VLCMainMenu *_o_sharedInstance = nil; ...@@ -293,7 +293,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
[mi setTarget:self]; [mi setTarget:self];
[mi setAction:selector]; [mi setAction:selector];
[mi setTag:p_item->list.i[i]]; [mi setTag:p_item->list.i[i]];
[mi setRepresentedObject:@(psz_name)]; [mi setRepresentedObject:[NSString stringWithUTF8String:psz_name]];
[menu addItem: [mi autorelease]]; [menu addItem: [mi autorelease]];
if (p_item->value.i == p_item->list.i[i]) if (p_item->value.i == p_item->list.i[i])
[mi setState:NSOnState]; [mi setState:NSOnState];
...@@ -931,8 +931,8 @@ static VLCMainMenu *_o_sharedInstance = nil; ...@@ -931,8 +931,8 @@ static VLCMainMenu *_o_sharedInstance = nil;
[openPanel setCanChooseFiles: YES]; [openPanel setCanChooseFiles: YES];
[openPanel setCanChooseDirectories: NO]; [openPanel setCanChooseDirectories: NO];
[openPanel setAllowsMultipleSelection: YES]; [openPanel setAllowsMultipleSelection: YES];
[openPanel setAllowedFileTypes: @[@"cdg",@"@idx",@"srt",@"sub",@"utf",@"ass",@"ssa",@"aqt",@"jss",@"psb",@"rt",@"smi",@"txt",@"smil"]]; [openPanel setAllowedFileTypes: [NSArray arrayWithObjects:@"cdg",@"@idx",@"srt",@"sub",@"utf",@"ass",@"ssa",@"aqt",@"jss",@"psb",@"rt",@"smi",@"txt",@"smil",nil]];
[openPanel setDirectoryURL:[NSURL fileURLWithPath:[@(path) stringByExpandingTildeInPath]]]; [openPanel setDirectoryURL:[NSURL fileURLWithPath:[[NSString stringWithUTF8String:path] stringByExpandingTildeInPath]]];
i_returnValue = [openPanel runModal]; i_returnValue = [openPanel runModal];
free(path); free(path);
......
...@@ -249,19 +249,19 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -249,19 +249,19 @@ static VLCMainWindow *_o_sharedInstance = nil;
else else
[[internetItems lastObject] setIcon: [NSImage imageNamed:@"NSApplicationIcon"]]; [[internetItems lastObject] setIcon: [NSImage imageNamed:@"NSApplicationIcon"]];
[[internetItems lastObject] setSdtype: SD_CAT_INTERNET]; [[internetItems lastObject] setSdtype: SD_CAT_INTERNET];
[[internetItems lastObject] setUntranslatedTitle: @(*ppsz_longname)]; [[internetItems lastObject] setUntranslatedTitle: [NSString stringWithUTF8String:*ppsz_longname]];
break; break;
case SD_CAT_DEVICES: case SD_CAT_DEVICES:
[devicesItems addObject: [SideBarItem itemWithTitle: _NS(*ppsz_longname) identifier: o_identifier]]; [devicesItems addObject: [SideBarItem itemWithTitle: _NS(*ppsz_longname) identifier: o_identifier]];
[[devicesItems lastObject] setIcon: [NSImage imageNamed:@"NSApplicationIcon"]]; [[devicesItems lastObject] setIcon: [NSImage imageNamed:@"NSApplicationIcon"]];
[[devicesItems lastObject] setSdtype: SD_CAT_DEVICES]; [[devicesItems lastObject] setSdtype: SD_CAT_DEVICES];
[[devicesItems lastObject] setUntranslatedTitle: @(*ppsz_longname)]; [[devicesItems lastObject] setUntranslatedTitle: [NSString stringWithUTF8String:*ppsz_longname]];
break; break;
case SD_CAT_LAN: case SD_CAT_LAN:
[lanItems addObject: [SideBarItem itemWithTitle: _NS(*ppsz_longname) identifier: o_identifier]]; [lanItems addObject: [SideBarItem itemWithTitle: _NS(*ppsz_longname) identifier: o_identifier]];
[[lanItems lastObject] setIcon: [NSImage imageNamed:@"sidebar-local"]]; [[lanItems lastObject] setIcon: [NSImage imageNamed:@"sidebar-local"]];
[[lanItems lastObject] setSdtype: SD_CAT_LAN]; [[lanItems lastObject] setSdtype: SD_CAT_LAN];
[[lanItems lastObject] setUntranslatedTitle: @(*ppsz_longname)]; [[lanItems lastObject] setUntranslatedTitle: [NSString stringWithUTF8String:*ppsz_longname]];
break; break;
case SD_CAT_MYCOMPUTER: case SD_CAT_MYCOMPUTER:
[mycompItems addObject: [SideBarItem itemWithTitle: _NS(*ppsz_longname) identifier: o_identifier]]; [mycompItems addObject: [SideBarItem itemWithTitle: _NS(*ppsz_longname) identifier: o_identifier]];
...@@ -273,7 +273,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -273,7 +273,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
[[mycompItems lastObject] setIcon: [NSImage imageNamed:@"sidebar-pictures"]]; [[mycompItems lastObject] setIcon: [NSImage imageNamed:@"sidebar-pictures"]];
else else
[[mycompItems lastObject] setIcon: [NSImage imageNamed:@"NSApplicationIcon"]]; [[mycompItems lastObject] setIcon: [NSImage imageNamed:@"NSApplicationIcon"]];
[[mycompItems lastObject] setUntranslatedTitle: @(*ppsz_longname)]; [[mycompItems lastObject] setUntranslatedTitle: [NSString stringWithUTF8String:*ppsz_longname]];
[[mycompItems lastObject] setSdtype: SD_CAT_MYCOMPUTER]; [[mycompItems lastObject] setSdtype: SD_CAT_MYCOMPUTER];
break; break;
default: default:
...@@ -296,7 +296,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -296,7 +296,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
free(ppsz_longnames); free(ppsz_longnames);
free(p_categories); free(p_categories);
[libraryItem setChildren: @[playlistItem, medialibraryItem]]; [libraryItem setChildren: [NSArray arrayWithObjects:playlistItem, medialibraryItem, nil]];
[o_sidebaritems addObject: libraryItem]; [o_sidebaritems addObject: libraryItem];
if ([mycompItem hasChildren]) if ([mycompItem hasChildren])
[o_sidebaritems addObject: mycompItem]; [o_sidebaritems addObject: mycompItem];
...@@ -310,7 +310,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -310,7 +310,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
[o_sidebar_view reloadData]; [o_sidebar_view reloadData];
[o_sidebar_view selectRowIndexes:[NSIndexSet indexSetWithIndex:1] byExtendingSelection:NO]; [o_sidebar_view selectRowIndexes:[NSIndexSet indexSetWithIndex:1] byExtendingSelection:NO];
[o_sidebar_view setDropItem:playlistItem dropChildIndex:NSOutlineViewDropOnItemIndex]; [o_sidebar_view setDropItem:playlistItem dropChildIndex:NSOutlineViewDropOnItemIndex];
[o_sidebar_view registerForDraggedTypes:@[NSFilenamesPboardType, @"VLCPlaylistItemPboardType"]]; [o_sidebar_view registerForDraggedTypes:[NSArray arrayWithObjects:NSFilenamesPboardType, @"VLCPlaylistItemPboardType", nil]];
[o_sidebar_view setAutosaveName:@"mainwindow-sidebar"]; [o_sidebar_view setAutosaveName:@"mainwindow-sidebar"];
[(PXSourceList *)o_sidebar_view setDataSource:self]; [(PXSourceList *)o_sidebar_view setDataSource:self];
...@@ -635,14 +635,14 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -635,14 +635,14 @@ static VLCMainWindow *_o_sharedInstance = nil;
char *format = var_InheritString(VLCIntf, "input-title-format"); char *format = var_InheritString(VLCIntf, "input-title-format");
char *formated = str_format_meta(pl_Get(VLCIntf), format); char *formated = str_format_meta(pl_Get(VLCIntf), format);
free(format); free(format);
aString = @(formated); aString = [NSString stringWithUTF8String:formated];
free(formated); free(formated);
} else } else
aString = @(config_GetPsz(VLCIntf, "video-title")); aString = [NSString stringWithUTF8String:config_GetPsz(VLCIntf, "video-title")];
char *uri = input_item_GetURI(input_GetItem(p_input)); char *uri = input_item_GetURI(input_GetItem(p_input));
NSURL * o_url = [NSURL URLWithString: @(uri)]; NSURL * o_url = [NSURL URLWithString:[NSString stringWithUTF8String:uri]];
if ([o_url isFileURL]) { if ([o_url isFileURL]) {
[self setRepresentedURL: o_url]; [self setRepresentedURL: o_url];
[[[VLCMain sharedInstance] voutController] updateWindowsUsingBlock:^(VLCVideoWindowCommon *o_window) { [[[VLCMain sharedInstance] voutController] updateWindowsUsingBlock:^(VLCVideoWindowCommon *o_window) {
...@@ -1156,7 +1156,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -1156,7 +1156,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
{ {
if (config_GetPsz(VLCIntf, "podcast-urls") != NULL) { if (config_GetPsz(VLCIntf, "podcast-urls") != NULL) {
[o_podcast_unsubscribe_pop removeAllItems]; [o_podcast_unsubscribe_pop removeAllItems];
[o_podcast_unsubscribe_pop addItemsWithTitles:[@(config_GetPsz(VLCIntf, "podcast-urls")) componentsSeparatedByString:@"|"]]; [o_podcast_unsubscribe_pop addItemsWithTitles:[[NSString stringWithUTF8String:config_GetPsz(VLCIntf, "podcast-urls")] componentsSeparatedByString:@"|"]];
[NSApp beginSheet:o_podcast_unsubscribe_window modalForWindow:self modalDelegate:self didEndSelector:NULL contextInfo:nil]; [NSApp beginSheet:o_podcast_unsubscribe_window modalForWindow:self modalDelegate:self didEndSelector:NULL contextInfo:nil];
} }
} }
...@@ -1167,7 +1167,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -1167,7 +1167,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
[NSApp endSheet: o_podcast_unsubscribe_window]; [NSApp endSheet: o_podcast_unsubscribe_window];
if (sender == o_podcast_unsubscribe_ok_btn) { if (sender == o_podcast_unsubscribe_ok_btn) {
NSMutableArray * urls = [[NSMutableArray alloc] initWithArray:[@(config_GetPsz(VLCIntf, "podcast-urls")) componentsSeparatedByString:@"|"]]; NSMutableArray * urls = [[NSMutableArray alloc] initWithArray:[[NSString stringWithUTF8String:config_GetPsz(VLCIntf, "podcast-urls")] componentsSeparatedByString:@"|"]];
[urls removeObjectAtIndex: [o_podcast_unsubscribe_pop indexOfSelectedItem]]; [urls removeObjectAtIndex: [o_podcast_unsubscribe_pop indexOfSelectedItem]];
config_PutPsz(VLCIntf, "podcast-urls", [[urls componentsJoinedByString:@"|"] UTF8String]); config_PutPsz(VLCIntf, "podcast-urls", [[urls componentsJoinedByString:@"|"] UTF8String]);
var_SetString(pl_Get(VLCIntf), "podcast-urls", config_GetPsz(VLCIntf, "podcast-urls")); var_SetString(pl_Get(VLCIntf), "podcast-urls", config_GetPsz(VLCIntf, "podcast-urls"));
......
...@@ -131,7 +131,8 @@ static CGEventRef tapEventCallback(CGEventTapProxy proxy, CGEventType type, CGEv ...@@ -131,7 +131,8 @@ static CGEventRef tapEventCallback(CGEventTapProxy proxy, CGEventType type, CGEv
+ (NSArray*)defaultMediaKeyUserBundleIdentifiers; + (NSArray*)defaultMediaKeyUserBundleIdentifiers;
{ {
return @[[[NSBundle mainBundle] bundleIdentifier], // your app return [NSArray arrayWithObjects:
[[NSBundle mainBundle] bundleIdentifier], // your app
@"com.spotify.client", @"com.spotify.client",
@"com.apple.iTunes", @"com.apple.iTunes",
@"com.apple.QuickTimePlayerX", @"com.apple.QuickTimePlayerX",
...@@ -157,6 +158,7 @@ static CGEventRef tapEventCallback(CGEventTapProxy proxy, CGEventType type, CGEv ...@@ -157,6 +158,7 @@ static CGEventRef tapEventCallback(CGEventTapProxy proxy, CGEventType type, CGEv
@"com.jriver.MediaCenter18", @"com.jriver.MediaCenter18",
@"com.jriver.MediaCenter19", @"com.jriver.MediaCenter19",
@"com.jriver.MediaCenter20", @"com.jriver.MediaCenter20",
nil
]; ];
} }
......
...@@ -132,18 +132,18 @@ static VLCStringUtility *_o_sharedInstance = nil; ...@@ -132,18 +132,18 @@ static VLCStringUtility *_o_sharedInstance = nil;
theString = [NSString stringWithFormat:@"%@-", theString]; theString = [NSString stringWithFormat:@"%@-", theString];
} }
/* modifiers */ /* modifiers */
theString = [theString stringByReplacingOccurrencesOfString:@"Command" withString: @("\xE2\x8C\x98")]; theString = [theString stringByReplacingOccurrencesOfString:@"Command" withString: [NSString stringWithUTF8String:"\xE2\x8C\x98"]];
theString = [theString stringByReplacingOccurrencesOfString:@"Alt" withString: @("\xE2\x8C\xA5")]; theString = [theString stringByReplacingOccurrencesOfString:@"Alt" withString: [NSString stringWithUTF8String:"\xE2\x8C\xA5"]];
theString = [theString stringByReplacingOccurrencesOfString:@"Shift" withString: @("\xE2\x87\xA7")]; theString = [theString stringByReplacingOccurrencesOfString:@"Shift" withString: [NSString stringWithUTF8String:"\xE2\x87\xA7"]];
theString = [theString stringByReplacingOccurrencesOfString:@"Ctrl" withString: @("\xE2\x8C\x83")]; theString = [theString stringByReplacingOccurrencesOfString:@"Ctrl" withString: [NSString stringWithUTF8String:"\xE2\x8C\x83"]];
/* show non-character keys correctly */ /* show non-character keys correctly */
theString = [theString stringByReplacingOccurrencesOfString:@"Right" withString:@("\xE2\x86\x92")]; theString = [theString stringByReplacingOccurrencesOfString:@"Right" withString:[NSString stringWithUTF8String:"\xE2\x86\x92"]];
theString = [theString stringByReplacingOccurrencesOfString:@"Left" withString:@("\xE2\x86\x90")]; theString = [theString stringByReplacingOccurrencesOfString:@"Left" withString:[NSString stringWithUTF8String:"\xE2\x86\x90"]];
theString = [theString stringByReplacingOccurrencesOfString:@"Up" withString:@("\xE2\x86\x91")]; theString = [theString stringByReplacingOccurrencesOfString:@"Up" withString:[NSString stringWithUTF8String:"\xE2\x86\x91"]];
theString = [theString stringByReplacingOccurrencesOfString:@"Down" withString:@("\xE2\x86\x93")]; theString = [theString stringByReplacingOccurrencesOfString:@"Down" withString:[NSString stringWithUTF8String:"\xE2\x86\x93"]];
theString = [theString stringByReplacingOccurrencesOfString:@"Enter" withString:@("\xe2\x86\xb5")]; theString = [theString stringByReplacingOccurrencesOfString:@"Enter" withString:[NSString stringWithUTF8String:"\xe2\x86\xb5"]];
theString = [theString stringByReplacingOccurrencesOfString:@"Tab" withString:@("\xe2\x87\xa5")]; theString = [theString stringByReplacingOccurrencesOfString:@"Tab" withString:[NSString stringWithUTF8String:"\xe2\x87\xa5"]];
theString = [theString stringByReplacingOccurrencesOfString:@"Delete" withString:@("\xe2\x8c\xab")]; /* capitalize plain characters to suit the menubar's look */ theString = [theString stringByReplacingOccurrencesOfString:@"Delete" withString:[NSString stringWithUTF8String:"\xe2\x8c\xab"]]; /* capitalize plain characters to suit the menubar's look */
theString = [theString capitalizedString]; theString = [theString capitalizedString];
} }
else else
...@@ -167,7 +167,7 @@ static VLCStringUtility *_o_sharedInstance = nil; ...@@ -167,7 +167,7 @@ static VLCStringUtility *_o_sharedInstance = nil;
remaining = dur - time.i_time; remaining = dur - time.i_time;
return [NSString stringWithFormat: @"-%s", secstotimestr(psz_time, (remaining / 1000000))]; return [NSString stringWithFormat: @"-%s", secstotimestr(psz_time, (remaining / 1000000))];
} else } else
return @(secstotimestr(psz_time, (time.i_time / 1000000))); return [NSString stringWithUTF8String:secstotimestr(psz_time, (time.i_time / 1000000))];
} }
#pragma mark - #pragma mark -
......
...@@ -317,10 +317,10 @@ ...@@ -317,10 +317,10 @@
[dict setObject:view forKey:@"view"]; [dict setObject:view forKey:@"view"];
[_griddedViews addObject:dict]; [_griddedViews addObject:dict];
} }
[dict setObject:@(rowSpan) forKey:@"rowSpan"]; [dict setObject:[NSNumber numberWithInt:rowSpan] forKey:@"rowSpan"];
[dict setObject:@(colSpan) forKey:@"colSpan"]; [dict setObject:[NSNumber numberWithInt:colSpan] forKey:@"colSpan"];
[dict setObject:@(row) forKey:@"row"]; [dict setObject:[NSNumber numberWithInt:row] forKey:@"row"];
[dict setObject:@(column) forKey:@"col"]; [dict setObject:[NSNumber numberWithInt:column] forKey:@"col"];
[self addSubview:view]; [self addSubview:view];
[self relayout]; [self relayout];
......
...@@ -53,8 +53,8 @@ static VLCVideoEffects *_o_sharedInstance = nil; ...@@ -53,8 +53,8 @@ static VLCVideoEffects *_o_sharedInstance = nil;
+ (void)initialize + (void)initialize
{ {
NSDictionary *appDefaults = [NSDictionary dictionaryWithObjectsAndKeys:@[@";;;0;1.000000;1.000000;1.000000;1.000000;0.050000;16;2.000000;OTA=;4;4;16711680;20;15;120;Z3JhZGllbnQ=;1;0;16711680;6;80;VkxD;-1;;-1;255;2;3;3"], @"VideoEffectProfiles", NSDictionary *appDefaults = [NSDictionary dictionaryWithObjectsAndKeys:[NSArray arrayWithObject:@";;;0;1.000000;1.000000;1.000000;1.000000;0.050000;16;2.000000;OTA=;4;4;16711680;20;15;120;Z3JhZGllbnQ=;1;0;16711680;6;80;VkxD;-1;;-1;255;2;3;3"], @"VideoEffectProfiles",
@[_NS("Default")], @"VideoEffectProfileNames", nil]; [NSArray arrayWithObject:_NS("Default")], @"VideoEffectProfileNames", nil];
[[NSUserDefaults standardUserDefaults] registerDefaults:appDefaults]; [[NSUserDefaults standardUserDefaults] registerDefaults:appDefaults];
} }
...@@ -364,7 +364,7 @@ static VLCVideoEffects *_o_sharedInstance = nil; ...@@ -364,7 +364,7 @@ static VLCVideoEffects *_o_sharedInstance = nil;
[o_crop_sync_left_right_ckb setState: NSOffState]; [o_crop_sync_left_right_ckb setState: NSOffState];
tmpChar = config_GetPsz(p_intf, "transform-type"); tmpChar = config_GetPsz(p_intf, "transform-type");
tmpString = @(tmpChar); tmpString = [NSString stringWithUTF8String:tmpChar];
if ([tmpString isEqualToString:@"hflip"]) if ([tmpString isEqualToString:@"hflip"])
[o_transform_pop selectItemWithTag: 1]; [o_transform_pop selectItemWithTag: 1];
else if ([tmpString isEqualToString:@"vflip"]) else if ([tmpString isEqualToString:@"vflip"])
...@@ -421,7 +421,7 @@ static VLCVideoEffects *_o_sharedInstance = nil; ...@@ -421,7 +421,7 @@ static VLCVideoEffects *_o_sharedInstance = nil;
[o_sepia_lbl setEnabled: b_state]; [o_sepia_lbl setEnabled: b_state];
tmpChar = config_GetPsz(p_intf, "gradient-mode"); tmpChar = config_GetPsz(p_intf, "gradient-mode");
tmpString = @(tmpChar); tmpString = [NSString stringWithUTF8String:tmpChar];
if ([tmpString isEqualToString:@"hough"]) if ([tmpString isEqualToString:@"hough"])
[o_gradient_mode_pop selectItemWithTag: 3]; [o_gradient_mode_pop selectItemWithTag: 3];
else if ([tmpString isEqualToString:@"edge"]) else if ([tmpString isEqualToString:@"edge"])
...@@ -454,7 +454,7 @@ static VLCVideoEffects *_o_sharedInstance = nil; ...@@ -454,7 +454,7 @@ static VLCVideoEffects *_o_sharedInstance = nil;
tmpChar = config_GetPsz(p_intf, "marq-marquee"); tmpChar = config_GetPsz(p_intf, "marq-marquee");
if (tmpChar) { if (tmpChar) {
[o_addtext_text_fld setStringValue: @(tmpChar)]; [o_addtext_text_fld setStringValue: [NSString stringWithUTF8String:tmpChar]];
FREENULL(tmpChar); FREENULL(tmpChar);
} else } else
[o_addtext_text_fld setStringValue: @""]; [o_addtext_text_fld setStringValue: @""];
...@@ -467,7 +467,7 @@ static VLCVideoEffects *_o_sharedInstance = nil; ...@@ -467,7 +467,7 @@ static VLCVideoEffects *_o_sharedInstance = nil;
tmpChar = config_GetPsz(p_intf, "logo-file"); tmpChar = config_GetPsz(p_intf, "logo-file");
if (tmpChar) { if (tmpChar) {
[o_addlogo_logo_fld setStringValue: @(tmpChar)]; [o_addlogo_logo_fld setStringValue: [NSString stringWithUTF8String:tmpChar]];
FREENULL(tmpChar); FREENULL(tmpChar);
} else } else
[o_addlogo_logo_fld setStringValue: @""]; [o_addlogo_logo_fld setStringValue: @""];
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
-(id)initWithFrame:(NSRect)frameRect -(id)initWithFrame:(NSRect)frameRect
{ {
if (self = [super initWithFrame:frameRect]) { if (self = [super initWithFrame:frameRect]) {
[self registerForDraggedTypes:@[NSFilenamesPboardType]]; [self registerForDraggedTypes:[NSArray arrayWithObject:NSFilenamesPboardType]];
} }
i_lastScrollWheelDirection = 0; i_lastScrollWheelDirection = 0;
......
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
[dict setObject:self forKey:NSViewAnimationTargetKey]; [dict setObject:self forKey:NSViewAnimationTargetKey];
[dict setObject:NSViewAnimationFadeOutEffect forKey:NSViewAnimationEffectKey]; [dict setObject:NSViewAnimationFadeOutEffect forKey:NSViewAnimationEffectKey];
anim = [[NSViewAnimation alloc] initWithViewAnimations:@[dict]]; anim = [[NSViewAnimation alloc] initWithViewAnimations:[NSArray arrayWithObject:dict]];
[dict release]; [dict release];
[anim setAnimationBlockingMode:NSAnimationNonblocking]; [anim setAnimationBlockingMode:NSAnimationNonblocking];
...@@ -176,7 +176,7 @@ ...@@ -176,7 +176,7 @@
[dict setObject:self forKey:NSViewAnimationTargetKey]; [dict setObject:self forKey:NSViewAnimationTargetKey];
[dict setObject:NSViewAnimationFadeInEffect forKey:NSViewAnimationEffectKey]; [dict setObject:NSViewAnimationFadeInEffect forKey:NSViewAnimationEffectKey];
anim = [[NSViewAnimation alloc] initWithViewAnimations:@[dict]]; anim = [[NSViewAnimation alloc] initWithViewAnimations:[NSArray arrayWithObject:dict]];
[dict release]; [dict release];
[anim setAnimationBlockingMode:NSAnimationNonblocking]; [anim setAnimationBlockingMode:NSAnimationNonblocking];
...@@ -851,8 +851,8 @@ ...@@ -851,8 +851,8 @@
- Keep at most 2 animation at a time - Keep at most 2 animation at a time
- leaveFullscreen/enterFullscreen are the only responsible for releasing and alloc-ing - leaveFullscreen/enterFullscreen are the only responsible for releasing and alloc-ing
*/ */
o_fullscreen_anim1 = [[NSViewAnimation alloc] initWithViewAnimations:@[dict1]]; o_fullscreen_anim1 = [[NSViewAnimation alloc] initWithViewAnimations:[NSArray arrayWithObject:dict1]];
o_fullscreen_anim2 = [[NSViewAnimation alloc] initWithViewAnimations:@[dict2]]; o_fullscreen_anim2 = [[NSViewAnimation alloc] initWithViewAnimations:[NSArray arrayWithObject:dict2]];
[dict1 release]; [dict1 release];
[dict2 release]; [dict2 release];
...@@ -966,7 +966,7 @@ ...@@ -966,7 +966,7 @@
[dict2 setObject:self forKey:NSViewAnimationTargetKey]; [dict2 setObject:self forKey:NSViewAnimationTargetKey];
[dict2 setObject:NSViewAnimationFadeInEffect forKey:NSViewAnimationEffectKey]; [dict2 setObject:NSViewAnimationFadeInEffect forKey:NSViewAnimationEffectKey];
o_fullscreen_anim2 = [[NSViewAnimation alloc] initWithViewAnimations:@[dict2]]; o_fullscreen_anim2 = [[NSViewAnimation alloc] initWithViewAnimations:[NSArray arrayWithObject:dict2]];
[dict2 release]; [dict2 release];
[o_fullscreen_anim2 setAnimationBlockingMode: NSAnimationNonblocking]; [o_fullscreen_anim2 setAnimationBlockingMode: NSAnimationNonblocking];
...@@ -981,7 +981,7 @@ ...@@ -981,7 +981,7 @@
[dict1 setObject:[NSValue valueWithRect:[o_fullscreen_window frame]] forKey:NSViewAnimationStartFrameKey]; [dict1 setObject:[NSValue valueWithRect:[o_fullscreen_window frame]] forKey:NSViewAnimationStartFrameKey];
[dict1 setObject:[NSValue valueWithRect:frame] forKey:NSViewAnimationEndFrameKey]; [dict1 setObject:[NSValue valueWithRect:frame] forKey:NSViewAnimationEndFrameKey];
o_fullscreen_anim1 = [[NSViewAnimation alloc] initWithViewAnimations:@[dict1]]; o_fullscreen_anim1 = [[NSViewAnimation alloc] initWithViewAnimations:[NSArray arrayWithObject:dict1]];
[dict1 release]; [dict1 release];
[o_fullscreen_anim1 setAnimationBlockingMode: NSAnimationNonblocking]; [o_fullscreen_anim1 setAnimationBlockingMode: NSAnimationNonblocking];
...@@ -1083,7 +1083,7 @@ ...@@ -1083,7 +1083,7 @@
[dict setObject:self forKey:NSViewAnimationTargetKey]; [dict setObject:self forKey:NSViewAnimationTargetKey];
[dict setObject:NSViewAnimationFadeInEffect forKey:NSViewAnimationEffectKey]; [dict setObject:NSViewAnimationFadeInEffect forKey:NSViewAnimationEffectKey];
o_makekey_anim = [[NSViewAnimation alloc] initWithViewAnimations:@[dict]]; o_makekey_anim = [[NSViewAnimation alloc] initWithViewAnimations:[NSArray arrayWithObject:dict]];
[dict release]; [dict release];
[o_makekey_anim setAnimationBlockingMode: NSAnimationNonblocking]; [o_makekey_anim setAnimationBlockingMode: NSAnimationNonblocking];
...@@ -1109,10 +1109,10 @@ ...@@ -1109,10 +1109,10 @@
static NSMutableArray *attributes = nil; static NSMutableArray *attributes = nil;
if (attributes == nil) { if (attributes == nil) {
attributes = [[super accessibilityAttributeNames] mutableCopy]; attributes = [[super accessibilityAttributeNames] mutableCopy];
NSArray *appendAttributes = @[NSAccessibilitySubroleAttribute, NSArray *appendAttributes = [NSArray arrayWithObjects:NSAccessibilitySubroleAttribute,
NSAccessibilityCloseButtonAttribute, NSAccessibilityCloseButtonAttribute,
NSAccessibilityMinimizeButtonAttribute, NSAccessibilityMinimizeButtonAttribute,
NSAccessibilityZoomButtonAttribute]; NSAccessibilityZoomButtonAttribute, nil];
for(NSString *attribute in appendAttributes) { for(NSString *attribute in appendAttributes) {
if (![attributes containsObject:attribute]) if (![attributes containsObject:attribute])
......
...@@ -90,7 +90,7 @@ static VLAboutBox *_o_sharedInstance = nil; ...@@ -90,7 +90,7 @@ static VLAboutBox *_o_sharedInstance = nil;
/* l10n */ /* l10n */
[o_about_window setTitle: _NS("About VLC media player")]; [o_about_window setTitle: _NS("About VLC media player")];
NSDictionary *stringAttributes = [NSDictionary dictionaryWithObjectsAndKeys:@(NSUnderlineStyleSingle), NSUnderlineStyleAttributeName, [NSColor colorWithCalibratedRed:0. green:0.3411 blue:0.6824 alpha:1.], NSForegroundColorAttributeName, [NSFont systemFontOfSize:13], NSFontAttributeName, nil]; NSDictionary *stringAttributes = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInt:NSUnderlineStyleSingle], NSUnderlineStyleAttributeName, [NSColor colorWithCalibratedRed:0. green:0.3411 blue:0.6824 alpha:1.], NSForegroundColorAttributeName, [NSFont systemFontOfSize:13], NSFontAttributeName, nil];
NSAttributedString *attrStr; NSAttributedString *attrStr;
attrStr = [[NSAttributedString alloc] initWithString:_NS("Credits") attributes:stringAttributes]; attrStr = [[NSAttributedString alloc] initWithString:_NS("Credits") attributes:stringAttributes];
[o_credits_btn setAttributedTitle:attrStr]; [o_credits_btn setAttributedTitle:attrStr];
...@@ -117,7 +117,7 @@ static VLAboutBox *_o_sharedInstance = nil; ...@@ -117,7 +117,7 @@ static VLAboutBox *_o_sharedInstance = nil;
/* Setup the nameversion field */ /* Setup the nameversion field */
[o_name_version_field setStringValue: [NSString stringWithFormat:@"Version %s (%s)", VERSION_MESSAGE, PLATFORM]]; [o_name_version_field setStringValue: [NSString stringWithFormat:@"Version %s (%s)", VERSION_MESSAGE, PLATFORM]];
NSMutableArray *tmpArray = [NSMutableArray arrayWithArray: [@(psz_authors) componentsSeparatedByString:@"\n\n"]]; NSMutableArray *tmpArray = [NSMutableArray arrayWithArray: [[NSString stringWithUTF8String:psz_authors] componentsSeparatedByString:@"\n\n"]];
NSUInteger count = [tmpArray count]; NSUInteger count = [tmpArray count];
for (NSUInteger i = 0; i < count; i++) { for (NSUInteger i = 0; i < count; i++) {
[tmpArray replaceObjectAtIndex:i withObject:[[tmpArray objectAtIndex:i]stringByReplacingOccurrencesOfString:@"\n" withString:@", "]]; [tmpArray replaceObjectAtIndex:i withObject:[[tmpArray objectAtIndex:i]stringByReplacingOccurrencesOfString:@"\n" withString:@", "]];
...@@ -138,7 +138,7 @@ static VLAboutBox *_o_sharedInstance = nil; ...@@ -138,7 +138,7 @@ static VLAboutBox *_o_sharedInstance = nil;
"DVDs, network streams, capture cards and other media formats!</p><p><a href=" "DVDs, network streams, capture cards and other media formats!</p><p><a href="
"\"http://www.videolan.org/contribute/\"><span style=\" text-decoration: " "\"http://www.videolan.org/contribute/\"><span style=\" text-decoration: "
"underline; color:#0057ae;\">Help and join us!</span></a>")]; "underline; color:#0057ae;\">Help and join us!</span></a>")];
NSAttributedString *joinus_readytorender = [[NSAttributedString alloc] initWithHTML:[joinus dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES] options:[NSDictionary dictionaryWithObject:@(NSUTF8StringEncoding) forKey:NSCharacterEncodingDocumentOption] documentAttributes:NULL]; NSAttributedString *joinus_readytorender = [[NSAttributedString alloc] initWithHTML:[joinus dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES] options:[NSDictionary dictionaryWithObject:[NSNumber numberWithInt:NSUTF8StringEncoding] forKey:NSCharacterEncodingDocumentOption] documentAttributes:NULL];
[o_joinus_txt setAllowsEditingTextAttributes: YES]; [o_joinus_txt setAllowsEditingTextAttributes: YES];
[o_joinus_txt setSelectable: YES]; [o_joinus_txt setSelectable: YES];
[o_joinus_txt setAttributedStringValue:joinus_readytorender]; [o_joinus_txt setAttributedStringValue:joinus_readytorender];
...@@ -239,9 +239,9 @@ static VLAboutBox *_o_sharedInstance = nil; ...@@ -239,9 +239,9 @@ static VLAboutBox *_o_sharedInstance = nil;
if (sender == o_authors_btn) if (sender == o_authors_btn)
[o_credits_textview setString:o_authors]; [o_credits_textview setString:o_authors];
else if (sender == o_credits_btn) else if (sender == o_credits_btn)
[o_credits_textview setString:[@(psz_thanks) stringByReplacingOccurrencesOfString:@"\n" withString:@" " options:0 range:NSRangeFromString(@"680 2")]]; [o_credits_textview setString:[[NSString stringWithUTF8String:psz_thanks] stringByReplacingOccurrencesOfString:@"\n" withString:@" " options:0 range:NSRangeFromString(@"680 2")]];
else else
[o_credits_textview setString:@(psz_license)]; [o_credits_textview setString:[NSString stringWithUTF8String:psz_license]];
[o_credits_textview scrollPoint:NSMakePoint(0, 0)]; [o_credits_textview scrollPoint:NSMakePoint(0, 0)];
b_restart = YES; b_restart = YES;
...@@ -258,7 +258,7 @@ static VLAboutBox *_o_sharedInstance = nil; ...@@ -258,7 +258,7 @@ static VLAboutBox *_o_sharedInstance = nil;
[o_credits_textview setHidden:NO]; [o_credits_textview setHidden:NO];
[o_joinus_txt setHidden:YES]; [o_joinus_txt setHidden:YES];
[o_credits_textview setString:@(psz_license)]; [o_credits_textview setString:[NSString stringWithUTF8String:psz_license]];
[o_credits_textview scrollPoint:NSMakePoint(0, 0)]; [o_credits_textview scrollPoint:NSMakePoint(0, 0)];
b_restart = YES; b_restart = YES;
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
if (o_url != nil) if (o_url != nil)
[[NSDocumentController sharedDocumentController] noteNewRecentDocumentURL: o_url]; [[NSDocumentController sharedDocumentController] noteNewRecentDocumentURL: o_url];
NSArray *o_result = @[[NSDictionary dictionaryWithObject:o_urlString forKey: @"ITEM_URL"]]; NSArray *o_result = [NSArray arrayWithObject:[NSDictionary dictionaryWithObject:o_urlString forKey: @"ITEM_URL"]];
if (b_autoplay) if (b_autoplay)
[[[VLCMain sharedInstance] playlist] appendArray: o_result atPos: -1 enqueue: NO]; [[[VLCMain sharedInstance] playlist] appendArray: o_result atPos: -1 enqueue: NO];
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#import <ApplicationServices/ApplicationServices.h> #import <ApplicationServices/ApplicationServices.h>
NSString *toNSStr(const char *str) { NSString *toNSStr(const char *str) {
return str != NULL ? @(str) : @""; return str != NULL ? [NSString stringWithUTF8String:str] : @"";
} }
/***************************************************************************** /*****************************************************************************
...@@ -71,7 +71,7 @@ static VLCCoreDialogProvider *_o_sharedInstance = nil; ...@@ -71,7 +71,7 @@ static VLCCoreDialogProvider *_o_sharedInstance = nil;
-(void)performEventWithObject: (NSValue *)o_value ofType: (const char*)type -(void)performEventWithObject: (NSValue *)o_value ofType: (const char*)type
{ {
NSString *o_type = @(type); NSString *o_type = [NSString stringWithUTF8String:type];
if ([o_type isEqualToString: @"dialog-error"]) if ([o_type isEqualToString: @"dialog-error"])
[self performSelectorOnMainThread:@selector(showFatalDialog:) withObject:o_value waitUntilDone:YES]; [self performSelectorOnMainThread:@selector(showFatalDialog:) withObject:o_value waitUntilDone:YES];
...@@ -167,7 +167,7 @@ static VLCCoreDialogProvider *_o_sharedInstance = nil; ...@@ -167,7 +167,7 @@ static VLCCoreDialogProvider *_o_sharedInstance = nil;
[o_prog_title_txt setStringValue: toNSStr(p_dialog->title)]; [o_prog_title_txt setStringValue: toNSStr(p_dialog->title)];
if (p_dialog->cancel != NULL) if (p_dialog->cancel != NULL)
[o_prog_cancel_btn setTitle: @(p_dialog->cancel)]; [o_prog_cancel_btn setTitle: [NSString stringWithUTF8String:p_dialog->cancel]];
else else
[o_prog_cancel_btn setTitle: _NS("Cancel")]; [o_prog_cancel_btn setTitle: _NS("Cancel")];
......
...@@ -273,7 +273,7 @@ ...@@ -273,7 +273,7 @@
if ([self alphaValue] < 1.0 || b_displayed != YES) { if ([self alphaValue] < 1.0 || b_displayed != YES) {
if (![self fadeTimer]) if (![self fadeTimer])
[self setFadeTimer:[NSTimer scheduledTimerWithTimeInterval:0.05 target:self selector:@selector(focus:) userInfo:@1 repeats:YES]]; [self setFadeTimer:[NSTimer scheduledTimerWithTimeInterval:0.05 target:self selector:@selector(focus:) userInfo:[NSNumber numberWithInt:1] repeats:YES]];
else if ([[[self fadeTimer] userInfo] shortValue]==0) else if ([[[self fadeTimer] userInfo] shortValue]==0)
b_fadeQueued=YES; b_fadeQueued=YES;
} }
...@@ -287,7 +287,7 @@ ...@@ -287,7 +287,7 @@
if (([self alphaValue] > 0.0)) { if (([self alphaValue] > 0.0)) {
if (![self fadeTimer]) if (![self fadeTimer])
[self setFadeTimer:[NSTimer scheduledTimerWithTimeInterval:0.05 target:self selector:@selector(unfocus:) userInfo:@0 repeats:YES]]; [self setFadeTimer:[NSTimer scheduledTimerWithTimeInterval:0.05 target:self selector:@selector(unfocus:) userInfo:[NSNumber numberWithInt:0] repeats:YES]];
else if ([[[self fadeTimer] userInfo] shortValue]==1) else if ([[[self fadeTimer] userInfo] shortValue]==1)
b_fadeQueued=YES; b_fadeQueued=YES;
} }
...@@ -560,13 +560,13 @@ ...@@ -560,13 +560,13 @@
remaining = dur - time.i_time; remaining = dur - time.i_time;
o_total_time = [NSString stringWithFormat: @"-%s", secstotimestr(psz_time, (remaining / 1000000))]; o_total_time = [NSString stringWithFormat: @"-%s", secstotimestr(psz_time, (remaining / 1000000))];
} else } else
o_total_time = @(secstotimestr(psz_time, (dur / 1000000))); o_total_time = [NSString stringWithUTF8String:secstotimestr(psz_time, (dur / 1000000))];
[o_streamLength_txt setStringValue: o_total_time]; [o_streamLength_txt setStringValue: o_total_time];
} }
// update current position (left field) // update current position (left field)
NSString *o_playback_pos = @(secstotimestr(psz_time, (time.i_time / 1000000))); NSString *o_playback_pos = [NSString stringWithUTF8String:secstotimestr(psz_time, (time.i_time / 1000000))];
[o_streamPosition_txt setStringValue: o_playback_pos]; [o_streamPosition_txt setStringValue: o_playback_pos];
vlc_object_release(p_input); vlc_object_release(p_input);
......
...@@ -519,7 +519,7 @@ static int DialogCallback(vlc_object_t *p_this, const char *type, vlc_value_t pr ...@@ -519,7 +519,7 @@ static int DialogCallback(vlc_object_t *p_this, const char *type, vlc_value_t pr
NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init]; NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init];
VLCMain *interface = (VLCMain *)data; VLCMain *interface = (VLCMain *)data;
if ([@(type) isEqualToString: @"dialog-progress-bar"]) { if ([[NSString stringWithUTF8String:type] isEqualToString: @"dialog-progress-bar"]) {
/* the progress panel needs to update itself and therefore wants special treatment within this context */ /* the progress panel needs to update itself and therefore wants special treatment within this context */
dialog_progress_bar_t *p_dialog = (dialog_progress_bar_t *)value.p_address; dialog_progress_bar_t *p_dialog = (dialog_progress_bar_t *)value.p_address;
...@@ -542,7 +542,7 @@ void updateProgressPanel (void *priv, const char *text, float value) ...@@ -542,7 +542,7 @@ void updateProgressPanel (void *priv, const char *text, float value)
NSString *o_txt; NSString *o_txt;
if (text != NULL) if (text != NULL)
o_txt = @(text); o_txt = [NSString stringWithUTF8String:text];
else else
o_txt = @""; o_txt = @"";
...@@ -1202,7 +1202,7 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -1202,7 +1202,7 @@ static VLCMain *_o_sharedMainInstance = nil;
/* simulate an event as long as the user holds the button */ /* simulate an event as long as the user holds the button */
b_remote_button_hold = pressedDown; b_remote_button_hold = pressedDown;
if (pressedDown) { if (pressedDown) {
NSNumber* buttonIdentifierNumber = @(buttonIdentifier); NSNumber* buttonIdentifierNumber = [NSNumber numberWithInt:buttonIdentifier];
[self performSelector:@selector(executeHoldActionForRemoteButton:) [self performSelector:@selector(executeHoldActionForRemoteButton:)
withObject:buttonIdentifierNumber]; withObject:buttonIdentifierNumber];
} }
...@@ -1320,7 +1320,7 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -1320,7 +1320,7 @@ static VLCMain *_o_sharedMainInstance = nil;
&& !strncmp(p_item->psz_name , "key-", 4) && !strncmp(p_item->psz_name , "key-", 4)
&& !EMPTY_STR(p_item->psz_text)) { && !EMPTY_STR(p_item->psz_text)) {
if (p_item->value.psz) if (p_item->value.psz)
[o_tempArray addObject: @(p_item->value.psz)]; [o_tempArray addObject: [NSString stringWithUTF8String:p_item->value.psz]];
} }
} }
module_config_free (p_config); module_config_free (p_config);
...@@ -1926,7 +1926,7 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -1926,7 +1926,7 @@ static VLCMain *_o_sharedMainInstance = nil;
return; return;
} }
NSArray * ourPreferences = @[@"org.videolan.vlc.plist", @"VLC", @"org.videolan.vlc"]; NSArray * ourPreferences = [NSArray arrayWithObjects:@"org.videolan.vlc.plist", @"VLC", @"org.videolan.vlc", nil];
/* Move the file to trash so that user can find them later */ /* Move the file to trash so that user can find them later */
[[NSWorkspace sharedWorkspace] performFileOperation:NSWorkspaceRecycleOperation source:preferences destination:nil files:ourPreferences tag:0]; [[NSWorkspace sharedWorkspace] performFileOperation:NSWorkspaceRecycleOperation source:preferences destination:nil files:ourPreferences tag:0];
...@@ -2045,7 +2045,7 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -2045,7 +2045,7 @@ static VLCMain *_o_sharedMainInstance = nil;
[saveFolderPanel setCanSelectHiddenExtension: NO]; [saveFolderPanel setCanSelectHiddenExtension: NO];
[saveFolderPanel setCanCreateDirectories: YES]; [saveFolderPanel setCanCreateDirectories: YES];
[saveFolderPanel setAllowedFileTypes: @[@"rtf"]]; [saveFolderPanel setAllowedFileTypes: [NSArray arrayWithObject:@"rtf"]];
[saveFolderPanel setNameFieldStringValue:[NSString stringWithFormat: _NS("VLC Debug Log (%s).rtf"), VERSION_MESSAGE]]; [saveFolderPanel setNameFieldStringValue:[NSString stringWithFormat: _NS("VLC Debug Log (%s).rtf"), VERSION_MESSAGE]];
[saveFolderPanel beginSheetModalForWindow: o_msgs_panel completionHandler:^(NSInteger returnCode) { [saveFolderPanel beginSheetModalForWindow: o_msgs_panel completionHandler:^(NSInteger returnCode) {
if (returnCode == NSOKButton) { if (returnCode == NSOKButton) {
......
...@@ -305,7 +305,7 @@ static NSMutableArray *blackoutWindows = NULL; ...@@ -305,7 +305,7 @@ static NSMutableArray *blackoutWindows = NULL;
- (void)awakeFromNib - (void)awakeFromNib
{ {
[self registerForDraggedTypes:@[NSFilenamesPboardType]]; [self registerForDraggedTypes:[NSArray arrayWithObject:NSFilenamesPboardType]];
[self setImageScaling: NSScaleToFit]; [self setImageScaling: NSScaleToFit];
[self setImageFrameStyle: NSImageFrameNone]; [self setImageFrameStyle: NSImageFrameNone];
[self setImageAlignment: NSImageAlignCenter]; [self setImageAlignment: NSImageAlignCenter];
...@@ -817,7 +817,7 @@ void _drawFrameInRect(NSRect frameRect) ...@@ -817,7 +817,7 @@ void _drawFrameInRect(NSRect frameRect)
- (void)awakeFromNib - (void)awakeFromNib
{ {
[self registerForDraggedTypes:@[NSFilenamesPboardType]]; [self registerForDraggedTypes:[NSArray arrayWithObject:NSFilenamesPboardType]];
} }
- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender - (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
......
...@@ -521,9 +521,9 @@ static VLCOpen *_o_sharedMainInstance = nil; ...@@ -521,9 +521,9 @@ static VLCOpen *_o_sharedMainInstance = nil;
/* apply the options to our item(s) */ /* apply the options to our item(s) */
[o_dic setObject: (NSArray *)[o_options copy] forKey: @"ITEM_OPTIONS"]; [o_dic setObject: (NSArray *)[o_options copy] forKey: @"ITEM_OPTIONS"];
if (b_autoplay) if (b_autoplay)
[[[VLCMain sharedInstance] playlist] appendArray: @[o_dic] atPos: -1 enqueue:NO]; [[[VLCMain sharedInstance] playlist] appendArray: [NSArray arrayWithObject:o_dic] atPos: -1 enqueue:NO];
else else
[[[VLCMain sharedInstance] playlist] appendArray: @[o_dic] atPos: -1 enqueue:YES]; [[[VLCMain sharedInstance] playlist] appendArray: [NSArray arrayWithObject:o_dic] atPos: -1 enqueue:YES];
} }
} }
...@@ -857,7 +857,7 @@ static VLCOpen *_o_sharedMainInstance = nil; ...@@ -857,7 +857,7 @@ static VLCOpen *_o_sharedMainInstance = nil;
GetVolParmsInfoBuffer volumeParms; GetVolParmsInfoBuffer volumeParms;
err = FSGetVolumeParms(actualVolume, &volumeParms, sizeof(volumeParms)); err = FSGetVolumeParms(actualVolume, &volumeParms, sizeof(volumeParms));
if (noErr == err) { if (noErr == err) {
NSString *bsdName = @((char *)volumeParms.vMDeviceID); NSString *bsdName = [NSString stringWithUTF8String:(char *)volumeParms.vMDeviceID];
return [NSString stringWithFormat:@"/dev/r%@", bsdName]; return [NSString stringWithFormat:@"/dev/r%@", bsdName];
} }
...@@ -1113,7 +1113,7 @@ static VLCOpen *_o_sharedMainInstance = nil; ...@@ -1113,7 +1113,7 @@ static VLCOpen *_o_sharedMainInstance = nil;
/* work-around for Mountain Lion, which treats folders called "BDMV" including an item named "INDEX.BDM" /* 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 */ * as a _FILE_. Don't ask, move on. There is nothing to see here */
[o_open_panel setCanChooseFiles: YES]; [o_open_panel setCanChooseFiles: YES];
[o_open_panel setAllowedFileTypes:@[@"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] objectAtIndex:0] path];
......
...@@ -112,17 +112,17 @@ ...@@ -112,17 +112,17 @@
- (void)initStrings - (void)initStrings
{ {
NSArray *o_muxers = @[@"MPEG TS", @"MPEG PS", @"MPEG 1", NSArray *o_muxers = [NSArray arrayWithObjects:@"MPEG TS", @"MPEG PS", @"MPEG 1",
@"Ogg", @"AVI", @"ASF", @"MPEG 4", @"Quicktime", @"Raw"]; @"Ogg", @"AVI", @"ASF", @"MPEG 4", @"Quicktime", @"Raw", nil];
NSArray *o_a_channels = @[@"1", @"2", @"4", @"6"]; NSArray *o_a_channels = [NSArray arrayWithObjects:@"1", @"2", @"4", @"6", nil];
NSArray *o_a_bitrates = @[@"16", @"32", @"64", @"96", NSArray *o_a_bitrates = [NSArray arrayWithObjects:@"16", @"32", @"64", @"96",
@"128", @"192", @"256", @"512"]; @"128", @"192", @"256", @"512", nil];
NSArray *o_v_bitrates = @[@"16", @"32", @"64", @"96", NSArray *o_v_bitrates = [NSArray arrayWithObjects:@"16", @"32", @"64", @"96",
@"128", @"192", @"256", @"384", @"512", @"768", @"1024", @"2048", @"3072"]; @"128", @"192", @"256", @"384", @"512", @"768", @"1024", @"2048", @"3072", nil];
NSArray *o_v_scales = @[@"0.25",@"0.5",@"0.75",@"1",@"1.25",@"1.5",@"1.75",@"2"]; 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 = @[@"mpga", @"mp3 ", @"mp4a", @"a52 ", @"vorb", @"flac", @"spx "]; NSArray *o_a_codecs = [NSArray arrayWithObjects:@"mpga", @"mp3 ", @"mp4a", @"a52 ", @"vorb", @"flac", @"spx ", nil];
NSArray *o_v_codecs = @[@"mp1v", @"mp2v", @"mp4v", @"DIV1", NSArray *o_v_codecs = [NSArray arrayWithObjects:@"mp1v", @"mp2v", @"mp4v", @"DIV1",
@"DIV2", @"DIV3", @"h263", @"h264", @"WMV1", @"WMV2", @"MJPG", @"theo"]; @"DIV2", @"DIV3", @"h263", @"h264", @"WMV1", @"WMV2", @"MJPG", @"theo", nil];
[o_output_ckbox setTitle: _NS("Streaming/Saving:")]; [o_output_ckbox setTitle: _NS("Streaming/Saving:")];
[o_output_settings setTitle: _NS("Settings...")]; [o_output_settings setTitle: _NS("Settings...")];
...@@ -340,10 +340,10 @@ ...@@ -340,10 +340,10 @@
if ([o_mode isEqualToString: _NS("File")]) { if ([o_mode isEqualToString: _NS("File")]) {
if ([o_dump_chkbox state] == NSOnState) { if ([o_dump_chkbox state] == NSOnState) {
o_sout_options = @[@":demux=dump", o_sout_options = [NSArray arrayWithObjects:@":demux=dump",
[NSString stringWithFormat: [NSString stringWithFormat:
@":demuxdump-file=%@", @":demuxdump-file=%@",
[o_file_field stringValue]]]; [o_file_field stringValue]], nil];
[self setSoutMRL:o_sout_options]; [self setSoutMRL:o_sout_options];
return; return;
} else } else
...@@ -417,7 +417,7 @@ ...@@ -417,7 +417,7 @@
if ([o_display state] == NSOnState) if ([o_display state] == NSOnState)
[o_mrl_string appendString: @"}"]; [o_mrl_string appendString: @"}"];
o_sout_options = @[o_mrl_string]; o_sout_options = [NSArray arrayWithObject:o_mrl_string];
[self setSoutMRL:o_sout_options]; [self setSoutMRL:o_sout_options];
} }
......
...@@ -295,20 +295,20 @@ ...@@ -295,20 +295,20 @@
if ([o_identifier isEqualToString:TRACKNUM_COLUMN]) { if ([o_identifier isEqualToString:TRACKNUM_COLUMN]) {
psz_value = input_item_GetTrackNumber(p_item->p_input); psz_value = input_item_GetTrackNumber(p_item->p_input);
if (psz_value) { if (psz_value) {
o_value = @(psz_value); o_value = [NSString stringWithUTF8String:psz_value];
free(psz_value); free(psz_value);
} }
} else if ([o_identifier isEqualToString:TITLE_COLUMN]) { } else if ([o_identifier isEqualToString:TITLE_COLUMN]) {
/* sanity check to prevent the NSString class from crashing */ /* sanity check to prevent the NSString class from crashing */
char *psz_title = input_item_GetTitleFbName(p_item->p_input); char *psz_title = input_item_GetTitleFbName(p_item->p_input);
if (psz_title) { if (psz_title) {
o_value = @(psz_title); o_value = [NSString stringWithUTF8String:psz_title];
free(psz_title); free(psz_title);
} }
} else if ([o_identifier isEqualToString:ARTIST_COLUMN]) { } else if ([o_identifier isEqualToString:ARTIST_COLUMN]) {
psz_value = input_item_GetArtist(p_item->p_input); psz_value = input_item_GetArtist(p_item->p_input);
if (psz_value) { if (psz_value) {
o_value = @(psz_value); o_value = [NSString stringWithUTF8String:psz_value];
free(psz_value); free(psz_value);
} }
} else if ([o_identifier isEqualToString:@"duration"]) { } else if ([o_identifier isEqualToString:@"duration"]) {
...@@ -316,45 +316,45 @@ ...@@ -316,45 +316,45 @@
mtime_t dur = input_item_GetDuration(p_item->p_input); mtime_t dur = input_item_GetDuration(p_item->p_input);
if (dur != -1) { if (dur != -1) {
secstotimestr(psz_duration, dur/1000000); secstotimestr(psz_duration, dur/1000000);
o_value = @(psz_duration); o_value = [NSString stringWithUTF8String:psz_duration];
} }
else else
o_value = @"--:--"; o_value = @"--:--";
} else if ([o_identifier isEqualToString:GENRE_COLUMN]) { } else if ([o_identifier isEqualToString:GENRE_COLUMN]) {
psz_value = input_item_GetGenre(p_item->p_input); psz_value = input_item_GetGenre(p_item->p_input);
if (psz_value) { if (psz_value) {
o_value = @(psz_value); o_value = [NSString stringWithUTF8String:psz_value];
free(psz_value); free(psz_value);
} }
} else if ([o_identifier isEqualToString:ALBUM_COLUMN]) { } else if ([o_identifier isEqualToString:ALBUM_COLUMN]) {
psz_value = input_item_GetAlbum(p_item->p_input); psz_value = input_item_GetAlbum(p_item->p_input);
if (psz_value) { if (psz_value) {
o_value = @(psz_value); o_value = [NSString stringWithUTF8String:psz_value];
free(psz_value); free(psz_value);
} }
} else if ([o_identifier isEqualToString:DESCRIPTION_COLUMN]) { } else if ([o_identifier isEqualToString:DESCRIPTION_COLUMN]) {
psz_value = input_item_GetDescription(p_item->p_input); psz_value = input_item_GetDescription(p_item->p_input);
if (psz_value) { if (psz_value) {
o_value = @(psz_value); o_value = [NSString stringWithUTF8String:psz_value];
free(psz_value); free(psz_value);
} }
} else if ([o_identifier isEqualToString:DATE_COLUMN]) { } else if ([o_identifier isEqualToString:DATE_COLUMN]) {
psz_value = input_item_GetDate(p_item->p_input); psz_value = input_item_GetDate(p_item->p_input);
if (psz_value) { if (psz_value) {
o_value = @(psz_value); o_value = [NSString stringWithUTF8String:psz_value];
free(psz_value); free(psz_value);
} }
} else if ([o_identifier isEqualToString:LANGUAGE_COLUMN]) { } else if ([o_identifier isEqualToString:LANGUAGE_COLUMN]) {
psz_value = input_item_GetLanguage(p_item->p_input); psz_value = input_item_GetLanguage(p_item->p_input);
if (psz_value) { if (psz_value) {
o_value = @(psz_value); o_value = [NSString stringWithUTF8String:psz_value];
free(psz_value); free(psz_value);
} }
} }
else if ([o_identifier isEqualToString:URI_COLUMN]) { else if ([o_identifier isEqualToString:URI_COLUMN]) {
psz_value = decode_URI(input_item_GetURI(p_item->p_input)); psz_value = decode_URI(input_item_GetURI(p_item->p_input));
if (psz_value) { if (psz_value) {
o_value = @(psz_value); o_value = [NSString stringWithUTF8String:psz_value];
free(psz_value); free(psz_value);
} }
} }
...@@ -411,9 +411,9 @@ ...@@ -411,9 +411,9 @@
+ (void)initialize{ + (void)initialize{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSMutableArray * o_columnArray = [[NSMutableArray alloc] init]; NSMutableArray * o_columnArray = [[NSMutableArray alloc] init];
[o_columnArray addObject: @[TITLE_COLUMN, @190.]]; [o_columnArray addObject: [NSArray arrayWithObjects:TITLE_COLUMN, [NSNumber numberWithFloat:190.], nil]];
[o_columnArray addObject: @[ARTIST_COLUMN, @95.]]; [o_columnArray addObject: [NSArray arrayWithObjects:ARTIST_COLUMN, [NSNumber numberWithFloat:95.], nil]];
[o_columnArray addObject: @[DURATION_COLUMN, @95.]]; [o_columnArray addObject: [NSArray arrayWithObjects:DURATION_COLUMN, [NSNumber numberWithFloat:95.], nil]];
NSDictionary *appDefaults = [NSDictionary dictionaryWithObject:[NSArray arrayWithArray:o_columnArray] forKey: @"PlaylistColumnSelection"]; NSDictionary *appDefaults = [NSDictionary dictionaryWithObject:[NSArray arrayWithArray:o_columnArray] forKey: @"PlaylistColumnSelection"];
[defaults registerDefaults:appDefaults]; [defaults registerDefaults:appDefaults];
...@@ -446,10 +446,10 @@ ...@@ -446,10 +446,10 @@
[o_outline_view setDoubleAction: @selector(playItem:)]; [o_outline_view setDoubleAction: @selector(playItem:)];
[o_outline_view_other setDoubleAction: @selector(playItem:)]; [o_outline_view_other setDoubleAction: @selector(playItem:)];
[o_outline_view registerForDraggedTypes: @[NSFilenamesPboardType, @"VLCPlaylistItemPboardType"]]; [o_outline_view registerForDraggedTypes: [NSArray arrayWithObjects:NSFilenamesPboardType, @"VLCPlaylistItemPboardType", nil]];
[o_outline_view setIntercellSpacing: NSMakeSize (0.0, 1.0)]; [o_outline_view setIntercellSpacing: NSMakeSize (0.0, 1.0)];
[o_outline_view_other registerForDraggedTypes: @[NSFilenamesPboardType, @"VLCPlaylistItemPboardType"]]; [o_outline_view_other registerForDraggedTypes: [NSArray arrayWithObjects:NSFilenamesPboardType, @"VLCPlaylistItemPboardType", nil]];
[o_outline_view_other setIntercellSpacing: NSMakeSize (0.0, 1.0)]; [o_outline_view_other setIntercellSpacing: NSMakeSize (0.0, 1.0)];
/* This uses a private API, but works fine on all current OSX releases. /* This uses a private API, but works fine on all current OSX releases.
...@@ -792,7 +792,7 @@ ...@@ -792,7 +792,7 @@
continue; continue;
char * psz_url = decode_URI(input_item_GetURI(p_item->p_input)); char * psz_url = decode_URI(input_item_GetURI(p_item->p_input));
o_mrl = [[NSMutableString alloc] initWithString: @(psz_url ? psz_url : "")]; o_mrl = [[NSMutableString alloc] initWithString: [NSString stringWithUTF8String:psz_url ? psz_url : ""]];
if (psz_url != NULL) if (psz_url != NULL)
free( psz_url ); free( psz_url );
...@@ -1111,9 +1111,9 @@ ...@@ -1111,9 +1111,9 @@
NSString *o_current_name, *o_current_author; NSString *o_current_name, *o_current_author;
PL_LOCK; PL_LOCK;
o_current_name = @(p_item->pp_children[i_current]->p_input->psz_name); o_current_name = [NSString stringWithUTF8String:p_item->pp_children[i_current]->p_input->psz_name];
psz_temp = input_item_GetInfo(p_item->p_input, _("Meta-information"),_("Artist")); psz_temp = input_item_GetInfo(p_item->p_input, _("Meta-information"),_("Artist"));
o_current_author = @(psz_temp); o_current_author = [NSString stringWithUTF8String:psz_temp];
free(psz_temp); free(psz_temp);
PL_UNLOCK; PL_UNLOCK;
...@@ -1368,7 +1368,7 @@ ...@@ -1368,7 +1368,7 @@
NSTableColumn * o_currentColumn; NSTableColumn * o_currentColumn;
for (NSUInteger i = 0; i < count; i++) { for (NSUInteger i = 0; i < count; i++) {
o_currentColumn = [o_columns objectAtIndex:i]; o_currentColumn = [o_columns objectAtIndex:i];
[o_arrayToSave addObject: @[[o_currentColumn identifier], @([o_currentColumn width])]]; [o_arrayToSave addObject:[NSArray arrayWithObjects:[o_currentColumn identifier], [NSNumber numberWithFloat:[o_currentColumn width]], nil]];
} }
[[NSUserDefaults standardUserDefaults] setObject: o_arrayToSave forKey:@"PlaylistColumnSelection"]; [[NSUserDefaults standardUserDefaults] setObject: o_arrayToSave forKey:@"PlaylistColumnSelection"];
[[NSUserDefaults standardUserDefaults] synchronize]; [[NSUserDefaults standardUserDefaults] synchronize];
...@@ -1418,7 +1418,7 @@ ...@@ -1418,7 +1418,7 @@
/* We add the "VLCPlaylistItemPboardType" type to be able to recognize /* We add the "VLCPlaylistItemPboardType" type to be able to recognize
a Drop operation coming from the playlist. */ a Drop operation coming from the playlist. */
[pboard declareTypes: @[@"VLCPlaylistItemPboardType"] owner: self]; [pboard declareTypes: [NSArray arrayWithObject:@"VLCPlaylistItemPboardType"] owner: self];
[pboard setData:[NSData data] forType:@"VLCPlaylistItemPboardType"]; [pboard setData:[NSData data] forType:@"VLCPlaylistItemPboardType"];
return YES; return YES;
......
...@@ -216,14 +216,14 @@ static VLCInfo *_o_sharedInstance = nil; ...@@ -216,14 +216,14 @@ static VLCInfo *_o_sharedInstance = nil;
/* fill uri info */ /* fill uri info */
char * psz_url = decode_URI(input_item_GetURI(p_item)); char * psz_url = decode_URI(input_item_GetURI(p_item));
[o_uri_txt setStringValue: @(psz_url ? psz_url : "")]; [o_uri_txt setStringValue: [NSString stringWithUTF8String:psz_url ? psz_url : ""]];
free(psz_url); free(psz_url);
/* fill title info */ /* fill title info */
char * psz_title = input_item_GetTitle(p_item); char * psz_title = input_item_GetTitle(p_item);
if (!psz_title) if (!psz_title)
psz_title = input_item_GetName(p_item); psz_title = input_item_GetName(p_item);
[o_title_txt setStringValue: @(psz_title ? : "")]; [o_title_txt setStringValue: [NSString stringWithUTF8String:psz_title ? : ""]];
free(psz_title); free(psz_title);
#define SET( foo, bar ) \ #define SET( foo, bar ) \
...@@ -252,7 +252,7 @@ static VLCInfo *_o_sharedInstance = nil; ...@@ -252,7 +252,7 @@ static VLCInfo *_o_sharedInstance = nil;
/* FIXME Can also be attachment:// */ /* FIXME Can also be attachment:// */
if (psz_meta && strncmp(psz_meta, "attachment://", 13)) if (psz_meta && strncmp(psz_meta, "attachment://", 13))
o_image = [[NSImage alloc] initWithContentsOfURL: [NSURL URLWithString:@(psz_meta)]]; o_image = [[NSImage alloc] initWithContentsOfURL: [NSURL URLWithString:[NSString stringWithUTF8String:psz_meta]]];
else else
o_image = [[NSImage imageNamed: @"noart.png"] retain]; o_image = [[NSImage imageNamed: @"noart.png"] retain];
[o_image_well setImage: o_image]; [o_image_well setImage: o_image];
...@@ -272,7 +272,7 @@ static VLCInfo *_o_sharedInstance = nil; ...@@ -272,7 +272,7 @@ static VLCInfo *_o_sharedInstance = nil;
- (void)setMeta: (char *)psz_meta forLabel: (id)theItem - (void)setMeta: (char *)psz_meta forLabel: (id)theItem
{ {
if (psz_meta != NULL && *psz_meta) if (psz_meta != NULL && *psz_meta)
[theItem setStringValue: @(psz_meta)]; [theItem setStringValue: [NSString stringWithUTF8String:psz_meta]];
else else
[theItem setStringValue: @""]; [theItem setStringValue: @""];
} }
...@@ -464,7 +464,7 @@ error: ...@@ -464,7 +464,7 @@ error:
vlc_mutex_lock(&p_item->lock); vlc_mutex_lock(&p_item->lock);
o_children = [[NSMutableArray alloc] initWithCapacity: p_item->i_categories]; o_children = [[NSMutableArray alloc] initWithCapacity: p_item->i_categories];
for (int i = 0 ; i < p_item->i_categories ; i++) { for (int i = 0 ; i < p_item->i_categories ; i++) {
NSString * name = @(p_item->pp_categories[i]->psz_name); NSString * name = [NSString stringWithUTF8String:p_item->pp_categories[i]->psz_name];
VLCInfoTreeItem * item = [[VLCInfoTreeItem alloc] initWithName:name value:@"" ID:i parent:self]; VLCInfoTreeItem * item = [[VLCInfoTreeItem alloc] initWithName:name value:@"" ID:i parent:self];
[item autorelease]; [item autorelease];
[o_children addObject:item]; [o_children addObject:item];
...@@ -476,8 +476,8 @@ error: ...@@ -476,8 +476,8 @@ error:
info_category_t * cat = p_item->pp_categories[i_object_id]; info_category_t * cat = p_item->pp_categories[i_object_id];
o_children = [[NSMutableArray alloc] initWithCapacity: cat->i_infos]; o_children = [[NSMutableArray alloc] initWithCapacity: cat->i_infos];
for (int i = 0 ; i < cat->i_infos ; i++) { for (int i = 0 ; i < cat->i_infos ; i++) {
NSString * name = @(cat->pp_infos[i]->psz_name); NSString * name = [NSString stringWithUTF8String:cat->pp_infos[i]->psz_name];
NSString * value = @(cat->pp_infos[i]->psz_value ? : ""); NSString * value = [NSString stringWithUTF8String:cat->pp_infos[i]->psz_value ? : ""];
VLCInfoTreeItem * item = [[VLCInfoTreeItem alloc] initWithName:name value:value ID:i parent:self]; VLCInfoTreeItem * item = [[VLCInfoTreeItem alloc] initWithName:name value:value ID:i parent:self];
[item autorelease]; [item autorelease];
[o_children addObject:item]; [o_children addObject:item];
......
This diff is collapsed.
...@@ -105,7 +105,7 @@ static VLCSimplePrefs *_o_sharedInstance = nil; ...@@ -105,7 +105,7 @@ static VLCSimplePrefs *_o_sharedInstance = nil;
[o_hotkeys_listbox setDoubleAction:@selector(hotkeyTableDoubleClick:)]; [o_hotkeys_listbox setDoubleAction:@selector(hotkeyTableDoubleClick:)];
/* setup useful stuff */ /* setup useful stuff */
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]; 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];
} }
#define CreateToolbarItem(o_name, o_desc, o_img, sel) \ #define CreateToolbarItem(o_name, o_desc, o_img, sel) \
...@@ -155,22 +155,22 @@ create_toolbar_item(NSString * o_itemIdent, NSString * o_name, NSString * o_desc ...@@ -155,22 +155,22 @@ create_toolbar_item(NSString * o_itemIdent, NSString * o_name, NSString * o_desc
- (NSArray *)toolbarDefaultItemIdentifiers: (NSToolbar *)toolbar - (NSArray *)toolbarDefaultItemIdentifiers: (NSToolbar *)toolbar
{ {
return @[VLCIntfSettingToolbarIdentifier, VLCAudioSettingToolbarIdentifier, VLCVideoSettingToolbarIdentifier, return [NSArray arrayWithObjects:VLCIntfSettingToolbarIdentifier, VLCAudioSettingToolbarIdentifier, VLCVideoSettingToolbarIdentifier,
VLCOSDSettingToolbarIdentifier, VLCInputSettingToolbarIdentifier, VLCHotkeysSettingToolbarIdentifier, VLCOSDSettingToolbarIdentifier, VLCInputSettingToolbarIdentifier, VLCHotkeysSettingToolbarIdentifier,
NSToolbarFlexibleSpaceItemIdentifier]; NSToolbarFlexibleSpaceItemIdentifier, nil];
} }
- (NSArray *)toolbarAllowedItemIdentifiers: (NSToolbar *)toolbar - (NSArray *)toolbarAllowedItemIdentifiers: (NSToolbar *)toolbar
{ {
return @[VLCIntfSettingToolbarIdentifier, VLCAudioSettingToolbarIdentifier, VLCVideoSettingToolbarIdentifier, return [NSArray arrayWithObjects:VLCIntfSettingToolbarIdentifier, VLCAudioSettingToolbarIdentifier, VLCVideoSettingToolbarIdentifier,
VLCOSDSettingToolbarIdentifier, VLCInputSettingToolbarIdentifier, VLCHotkeysSettingToolbarIdentifier, VLCOSDSettingToolbarIdentifier, VLCInputSettingToolbarIdentifier, VLCHotkeysSettingToolbarIdentifier,
NSToolbarFlexibleSpaceItemIdentifier]; NSToolbarFlexibleSpaceItemIdentifier, nil];
} }
- (NSArray *)toolbarSelectableItemIdentifiers:(NSToolbar *)toolbar - (NSArray *)toolbarSelectableItemIdentifiers:(NSToolbar *)toolbar
{ {
return @[VLCIntfSettingToolbarIdentifier, VLCAudioSettingToolbarIdentifier, VLCVideoSettingToolbarIdentifier, return [NSArray arrayWithObjects:VLCIntfSettingToolbarIdentifier, VLCAudioSettingToolbarIdentifier, VLCVideoSettingToolbarIdentifier,
VLCOSDSettingToolbarIdentifier, VLCInputSettingToolbarIdentifier, VLCHotkeysSettingToolbarIdentifier]; VLCOSDSettingToolbarIdentifier, VLCInputSettingToolbarIdentifier, VLCHotkeysSettingToolbarIdentifier, nil];
} }
- (void)initStrings - (void)initStrings
...@@ -332,10 +332,10 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam ...@@ -332,10 +332,10 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam
continue; continue;
} }
else if (p_item->list.psz[i]) else if (p_item->list.psz[i])
mi = [[NSMenuItem alloc] initWithTitle: @(p_item->list.psz[i]) action:NULL keyEquivalent: @""]; mi = [[NSMenuItem alloc] initWithTitle: [NSString stringWithUTF8String:p_item->list.psz[i]] action:NULL keyEquivalent: @""];
else else
msg_Err(p_intf, "item %d of pref %s failed to be created", i, name); msg_Err(p_intf, "item %d of pref %s failed to be created", i, name);
[mi setRepresentedObject:@(p_item->list.psz[i])]; [mi setRepresentedObject:[NSString stringWithUTF8String:p_item->list.psz[i]]];
[[object menu] addItem: [mi autorelease]]; [[object menu] addItem: [mi autorelease]];
if (p_item->value.psz && !strcmp(p_item->value.psz, p_item->list.psz[i])) if (p_item->value.psz && !strcmp(p_item->value.psz, p_item->list.psz[i]))
[object selectItem:[object lastItem]]; [object selectItem:[object lastItem]];
...@@ -361,7 +361,7 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam ...@@ -361,7 +361,7 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam
mi = [[NSMenuItem alloc] initWithTitle: [NSString stringWithFormat: @"%d", p_item->list.i[i]] action:NULL keyEquivalent: @""]; mi = [[NSMenuItem alloc] initWithTitle: [NSString stringWithFormat: @"%d", p_item->list.i[i]] action:NULL keyEquivalent: @""];
else else
msg_Err(p_intf, "item %d of pref %s failed to be created", i, name); msg_Err(p_intf, "item %d of pref %s failed to be created", i, name);
[mi setRepresentedObject:@(p_item->list.i[i])]; [mi setRepresentedObject:[NSNumber numberWithInt:p_item->list.i[i]]];
[[object menu] addItem: [mi autorelease]]; [[object menu] addItem: [mi autorelease]];
if (p_item->value.i == p_item->list.i[i]) if (p_item->value.i == p_item->list.i[i])
[object selectItem:[object lastItem]]; [object selectItem:[object lastItem]];
...@@ -390,7 +390,7 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam ...@@ -390,7 +390,7 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam
for (size_t i_index = 0; i_index < count; i_index++) { for (size_t i_index = 0; i_index < count; i_index++) {
p_parser = p_list[i_index]; p_parser = p_list[i_index];
if (module_provides(p_parser, p_item->psz_type)) { if (module_provides(p_parser, p_item->psz_type)) {
[object addItemWithTitle: @(_(module_GetLongName(p_parser)) ?: "")]; [object addItemWithTitle: [NSString stringWithUTF8String:_(module_GetLongName(p_parser)) ?: ""]];
if (p_item->value.psz && !strcmp(p_item->value.psz, module_get_name(p_parser, false))) if (p_item->value.psz && !strcmp(p_item->value.psz, module_get_name(p_parser, false)))
[object selectItem: [object lastItem]]; [object selectItem: [object lastItem]];
} }
...@@ -408,7 +408,7 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam ...@@ -408,7 +408,7 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam
- (void)setupField:(NSTextField *)o_object forOption:(const char *)psz_option - (void)setupField:(NSTextField *)o_object forOption:(const char *)psz_option
{ {
char *psz_tmp = config_GetPsz(p_intf, psz_option); char *psz_tmp = config_GetPsz(p_intf, psz_option);
[o_object setStringValue: @(psz_tmp ?: "")]; [o_object setStringValue: [NSString stringWithUTF8String:psz_tmp ?: ""]];
[o_object setToolTip: _NS(config_GetLabel(p_intf, psz_option))]; [o_object setToolTip: _NS(config_GetLabel(p_intf, psz_option))];
free(psz_tmp); free(psz_tmp);
} }
...@@ -563,8 +563,8 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam ...@@ -563,8 +563,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"]; [self setupButton: o_input_mkv_preload_dir_ckb forBoolValue: "mkv-preload-local-dir"];
[o_input_cachelevel_pop removeAllItems]; [o_input_cachelevel_pop removeAllItems];
[o_input_cachelevel_pop addItemsWithTitles: @[_NS("Custom"), _NS("Lowest latency"), [o_input_cachelevel_pop addItemsWithTitles: [NSArray arrayWithObjects:_NS("Custom"), _NS("Lowest latency"),
_NS("Low latency"), _NS("Normal"), _NS("High latency"), _NS("Higher latency")]]; _NS("Low latency"), _NS("Normal"), _NS("High latency"), _NS("Higher latency"), nil]];
[[o_input_cachelevel_pop itemAtIndex: 0] setTag: 0]; [[o_input_cachelevel_pop itemAtIndex: 0] setTag: 0];
[[o_input_cachelevel_pop itemAtIndex: 1] setTag: 100]; [[o_input_cachelevel_pop itemAtIndex: 1] setTag: 100];
[[o_input_cachelevel_pop itemAtIndex: 2] setTag: 200]; [[o_input_cachelevel_pop itemAtIndex: 2] setTag: 200];
...@@ -636,9 +636,9 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam ...@@ -636,9 +636,9 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam
&& !strncmp(p_item->psz_name , "key-", 4) && !strncmp(p_item->psz_name , "key-", 4)
&& !EMPTY_STR(p_item->psz_text)) { && !EMPTY_STR(p_item->psz_text)) {
[o_tempArray_desc addObject: _NS(p_item->psz_text)]; [o_tempArray_desc addObject: _NS(p_item->psz_text)];
[o_tempArray_names addObject: @(p_item->psz_name)]; [o_tempArray_names addObject: [NSString stringWithUTF8String:p_item->psz_name]];
if (p_item->value.psz) if (p_item->value.psz)
[o_hotkeySettings addObject: @(p_item->value.psz)]; [o_hotkeySettings addObject: [NSString stringWithUTF8String:p_item->value.psz]];
else else
[o_hotkeySettings addObject: [NSString string]]; [o_hotkeySettings addObject: [NSString string]];
} }
...@@ -1120,7 +1120,7 @@ static inline void save_module_list(intf_thread_t * p_intf, id object, const cha ...@@ -1120,7 +1120,7 @@ static inline void save_module_list(intf_thread_t * p_intf, id object, const cha
- (IBAction)showFontPicker:(id)sender - (IBAction)showFontPicker:(id)sender
{ {
char * font = config_GetPsz(p_intf, "freetype-font"); char * font = config_GetPsz(p_intf, "freetype-font");
NSString * fontName = font ? @(font) : nil; NSString * fontName = font ? [NSString stringWithUTF8String:font] : nil;
free(font); free(font);
if (fontName) { if (fontName) {
NSFont * font = [NSFont fontWithName:fontName size:0.0]; NSFont * font = [NSFont fontWithName:fontName size:0.0];
......
This diff is collapsed.
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