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