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]];