1 /*****************************************************************************
2 * simple_prefs.m: Simple Preferences for Mac OS X
3 *****************************************************************************
4 * Copyright (C) 2008 the VideoLAN team
7 * Authors: Felix Paul Kühne <fkuehne at videolan dot org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 #import "simple_prefs.h"
28 static NSString* VLCSPrefsToolbarIdentifier = @"Our Simple Preferences Toolbar Identifier";
29 static NSString* VLCIntfSettingToolbarIdentifier = @"Intf Settings Item Identifier";
30 static NSString* VLCAudioSettingToolbarIdentifier = @"Audio Settings Item Identifier";
31 static NSString* VLCVideoSettingToolbarIdentifier = @"Video Settings Item Identifier";
32 static NSString* VLCOSDSettingToolbarIdentifier = @"Subtitles Settings Item Identifier";
33 static NSString* VLCInputSettingToolbarIdentifier = @"Input Settings Item Identifier";
34 static NSString* VLCHotkeysSettingToolbarIdentifier = @"Hotkeys Settings Item Identifier";
36 @implementation VLCSimplePrefs
38 static VLCSimplePrefs *_o_sharedInstance = nil;
40 + (VLCSimplePrefs *)sharedInstance
42 return _o_sharedInstance ? _o_sharedInstance : [[self alloc] init];
47 if (_o_sharedInstance) {
51 _o_sharedInstance = [super init];
54 return _o_sharedInstance;
59 [o_currentlyShownCategoryView release];
60 [o_sprefs_toolbar release];
62 [o_hotkeySettings release];
63 [o_hotkeyDescriptions release];
64 [o_hotkeysNonUseableKeys release];
66 if( o_keyInTransition )
67 [o_keyInTransition release];
73 - (NSString *)OSXKeyToString:(int)val
75 NSMutableString *o_temp_str = [[[NSMutableString alloc] init] autorelease];
76 if( val & KEY_MODIFIER_CTRL )
77 [o_temp_str appendString: [NSString stringWithUTF8String: "\xE2\x8C\x83"]];
78 if( val & KEY_MODIFIER_ALT )
79 [o_temp_str appendString: [NSString stringWithUTF8String: "\xE2\x8C\xA5"]];
80 if( val & KEY_MODIFIER_SHIFT )
81 [o_temp_str appendString: [NSString stringWithUTF8String: "\xE2\x87\xA7"]];
82 if( val & KEY_MODIFIER_COMMAND )
83 [o_temp_str appendString: [NSString stringWithUTF8String: "\xE2\x8C\x98"]];
85 unsigned int i_keys = sizeof(vlc_keys)/sizeof(key_descriptor_t);
86 for( unsigned int i = 0; i< i_keys; i++ )
88 if( vlc_keys[i].i_key_code == (val& ~KEY_MODIFIER) )
90 if( vlc_keys[i].psz_key_string )
91 [o_temp_str appendString: [NSString stringWithUTF8String: vlc_keys[i].psz_key_string]];
93 o_temp_str = @"Unset";
103 /* setup the toolbar */
104 o_sprefs_toolbar = [[[NSToolbar alloc] initWithIdentifier: VLCSPrefsToolbarIdentifier] autorelease];
105 [o_sprefs_toolbar setAllowsUserCustomization: NO];
106 [o_sprefs_toolbar setAutosavesConfiguration: NO];
107 [o_sprefs_toolbar setDisplayMode: NSToolbarDisplayModeIconAndLabel];
108 [o_sprefs_toolbar setSizeMode: NSToolbarSizeModeRegular];
109 [o_sprefs_toolbar setDelegate: self];
110 [o_sprefs_win setToolbar: o_sprefs_toolbar];
112 /* setup useful stuff */
113 /* TODO: hard-code this instead of one-the-run generation */
114 o_hotkeysNonUseableKeys = [[NSArray arrayWithObjects:
115 [NSNumber numberWithInt: KEY_MODIFIER_COMMAND|'c'],
116 [NSNumber numberWithInt: KEY_MODIFIER_COMMAND|'x'],
117 [NSNumber numberWithInt: KEY_MODIFIER_COMMAND|'v'],
118 [NSNumber numberWithInt: KEY_MODIFIER_COMMAND|'a'],
119 [NSNumber numberWithInt: KEY_MODIFIER_COMMAND|','],
120 [NSNumber numberWithInt: KEY_MODIFIER_COMMAND|'h'],
121 [NSNumber numberWithInt: KEY_MODIFIER_COMMAND|KEY_MODIFIER_ALT|'h'],
122 [NSNumber numberWithInt: KEY_MODIFIER_COMMAND|KEY_MODIFIER_SHIFT|'o'],
123 [NSNumber numberWithInt: KEY_MODIFIER_COMMAND|'o'],
124 [NSNumber numberWithInt: KEY_MODIFIER_COMMAND|'d'],
125 [NSNumber numberWithInt: KEY_MODIFIER_COMMAND|'n'],
126 [NSNumber numberWithInt: KEY_MODIFIER_COMMAND|'s'],
127 [NSNumber numberWithInt: KEY_MODIFIER_COMMAND|'z'],
128 [NSNumber numberWithInt: KEY_MODIFIER_COMMAND|'l'],
129 [NSNumber numberWithInt: KEY_MODIFIER_COMMAND|'r'],
130 [NSNumber numberWithInt: KEY_MODIFIER_COMMAND|'0'],
131 [NSNumber numberWithInt: KEY_MODIFIER_COMMAND|'1'],
132 [NSNumber numberWithInt: KEY_MODIFIER_COMMAND|'2'],
133 [NSNumber numberWithInt: KEY_MODIFIER_COMMAND|'3'],
134 [NSNumber numberWithInt: KEY_MODIFIER_COMMAND|'m'],
135 [NSNumber numberWithInt: KEY_MODIFIER_COMMAND|'q'],
136 [NSNumber numberWithInt: KEY_MODIFIER_COMMAND|'w'],
137 [NSNumber numberWithInt: KEY_MODIFIER_COMMAND|KEY_MODIFIER_SHIFT|'w'],
138 [NSNumber numberWithInt: KEY_MODIFIER_COMMAND|KEY_MODIFIER_SHIFT|'c'],
139 [NSNumber numberWithInt: KEY_MODIFIER_COMMAND|KEY_MODIFIER_SHIFT|'p'],
140 [NSNumber numberWithInt: KEY_MODIFIER_COMMAND|'i'],
141 [NSNumber numberWithInt: KEY_MODIFIER_COMMAND|'e'],
142 [NSNumber numberWithInt: KEY_MODIFIER_COMMAND|KEY_MODIFIER_SHIFT|'e'],
143 [NSNumber numberWithInt: KEY_MODIFIER_COMMAND|'b'],
144 [NSNumber numberWithInt: KEY_MODIFIER_COMMAND|KEY_MODIFIER_SHIFT|'m'],
145 [NSNumber numberWithInt: KEY_MODIFIER_COMMAND|KEY_MODIFIER_CTRL|'m'],
146 [NSNumber numberWithInt: KEY_MODIFIER_COMMAND|'?'],
147 [NSNumber numberWithInt: KEY_MODIFIER_COMMAND|KEY_MODIFIER_ALT|'?'],
151 - (NSToolbarItem *) toolbar: (NSToolbar *)o_sprefs_toolbar
152 itemForItemIdentifier: (NSString *)o_itemIdent
153 willBeInsertedIntoToolbar: (BOOL)b_willBeInserted
155 NSToolbarItem *o_toolbarItem = nil;
157 #define CreateToolbarItem( o_name, o_desc, o_img, sel ) \
158 o_toolbarItem = [[[NSToolbarItem alloc] initWithItemIdentifier: o_itemIdent] autorelease]; \
160 [o_toolbarItem setLabel: o_name]; \
161 [o_toolbarItem setPaletteLabel: o_desc]; \
163 [o_toolbarItem setToolTip: o_desc]; \
164 [o_toolbarItem setImage: [NSImage imageNamed: o_img]]; \
166 [o_toolbarItem setTarget: self]; \
167 [o_toolbarItem setAction: @selector( sel )]; \
169 [o_toolbarItem setEnabled: YES]; \
170 [o_toolbarItem setAutovalidates: YES]
172 if( [o_itemIdent isEqual: VLCIntfSettingToolbarIdentifier] )
174 CreateToolbarItem( _NS("Interface"), _NS("Interface Settings"), @"spref_cone_Interface_64", showInterfaceSettings );
176 else if( [o_itemIdent isEqual: VLCAudioSettingToolbarIdentifier] )
178 CreateToolbarItem( _NS("Audio"), _NS("General Audio Settings"), @"spref_cone_Audio_64", showAudioSettings );
180 else if( [o_itemIdent isEqual: VLCVideoSettingToolbarIdentifier] )
182 CreateToolbarItem( _NS("Video"), _NS("General Video Settings"), @"spref_cone_Video_64", showVideoSettings );
184 else if( [o_itemIdent isEqual: VLCOSDSettingToolbarIdentifier] )
186 CreateToolbarItem( _NS("Subtitles & OSD"), _NS("Subtitles & OSD Settings"), @"spref_cone_Subtitles_64", showOSDSettings );
188 else if( [o_itemIdent isEqual: VLCInputSettingToolbarIdentifier] )
190 CreateToolbarItem( _NS("Input & Codecs"), _NS("Input & Codec settings"), @"spref_cone_Input_64", showInputSettings );
192 else if( [o_itemIdent isEqual: VLCHotkeysSettingToolbarIdentifier] )
194 CreateToolbarItem( _NS("Hotkeys"), _NS("Hotkeys settings"), @"spref_cone_Hotkeys_64", showHotkeySettings );
197 return o_toolbarItem;
200 - (NSArray *)toolbarDefaultItemIdentifiers: (NSToolbar *)toolbar
202 return [NSArray arrayWithObjects: VLCIntfSettingToolbarIdentifier, VLCAudioSettingToolbarIdentifier, VLCVideoSettingToolbarIdentifier,
203 VLCOSDSettingToolbarIdentifier, VLCInputSettingToolbarIdentifier, VLCHotkeysSettingToolbarIdentifier, NSToolbarFlexibleSpaceItemIdentifier, nil];
206 - (NSArray *)toolbarAllowedItemIdentifiers: (NSToolbar *)toolbar
208 return [NSArray arrayWithObjects: VLCIntfSettingToolbarIdentifier, VLCAudioSettingToolbarIdentifier, VLCVideoSettingToolbarIdentifier,
209 VLCOSDSettingToolbarIdentifier, VLCInputSettingToolbarIdentifier, VLCHotkeysSettingToolbarIdentifier, NSToolbarFlexibleSpaceItemIdentifier, nil];
212 - (NSArray *)toolbarSelectableItemIdentifiers:(NSToolbar *)toolbar
214 return [NSArray arrayWithObjects: VLCIntfSettingToolbarIdentifier, VLCAudioSettingToolbarIdentifier, VLCVideoSettingToolbarIdentifier,
215 VLCOSDSettingToolbarIdentifier, VLCInputSettingToolbarIdentifier, VLCHotkeysSettingToolbarIdentifier, nil];
220 msg_Warn( p_intf, "localisation of the simple preferences is not implemented!" );
223 - (void)resetControls
225 module_config_t *p_item;
229 #define SetupIntList( object, name ) \
230 [object removeAllItems]; \
231 p_item = config_FindConfig( VLC_OBJECT(p_intf), name ); \
232 for( i = 0; i < p_item->i_list; i++ ) \
234 if( p_item->ppsz_list_text[i] != NULL) \
235 [object addItemWithTitle: _NS( p_item->ppsz_list_text[i] )]; \
237 [object addItemWithTitle: [NSString stringWithUTF8String: p_item->ppsz_list[i]]]; \
239 if( p_item->value.i < [object numberOfItems] ) \
240 [object selectItemAtIndex: p_item->value.i]; \
242 [object selectItemAtIndex: 0]
244 #define SetupStringList( object, name ) \
245 [object removeAllItems]; \
247 p_item = config_FindConfig( VLC_OBJECT(p_intf), name ); \
248 for( i = 0; p_item->ppsz_list[i] != nil; i++ ) \
250 [object addItemWithTitle: _NS( p_item->ppsz_list_text[i] )]; \
251 if( p_item->value.psz && !strcmp( p_item->value.psz, p_item->ppsz_list[i] ) ) \
254 [object selectItemAtIndex: y]
256 /**********************
257 * interface settings *
258 **********************/
259 SetupStringList( o_intf_lang_pop, "language" );
260 SetupIntList( o_intf_art_pop, "album-art" );
262 [o_intf_meta_ckb setState: config_GetInt( p_intf, "fetch-meta" )];
263 [o_intf_fspanel_ckb setState: config_GetInt( p_intf, "macosx-fspanel" )];
264 [o_intf_embedded_ckb setState: config_GetInt( p_intf, "embedded-video" )];
269 [o_audio_enable_ckb setState: config_GetInt( p_intf, "audio" )];
270 [o_audio_vol_fld setIntValue: config_GetInt( p_intf, "volume" )];
271 [o_audio_vol_sld setIntValue: config_GetInt( p_intf, "volume" )];
273 [o_audio_spdif_ckb setState: config_GetInt( p_intf, "spdif" )];
275 SetupIntList( o_audio_dolby_pop, "force-dolby-surround" );
277 [o_audio_lang_fld setStringValue: [NSString stringWithUTF8String: config_GetPsz( p_intf, "audio-language" )]];
279 [o_audio_headphone_ckb setState: config_GetInt( p_intf, "headphone-dolby" )];
281 psz_tmp = config_GetPsz( p_intf, "audio-filter" );
283 [o_audio_norm_ckb setState: (int)strstr( psz_tmp, "normvol" )];
284 [o_audio_norm_fld setFloatValue: config_GetFloat( p_intf, "norm-max-level" )];
287 msg_Warn( p_intf, "visualizer not implemented!" );
289 /* Last.FM is optional */
290 if( module_Exists( p_intf, "audioscrobbler" ) )
292 [o_audio_lastuser_fld setStringValue: [NSString stringWithUTF8String: config_GetPsz( p_intf, "lastfm-username" )]];
293 [o_audio_lastpwd_fld setStringValue: [NSString stringWithUTF8String: config_GetPsz( p_intf, "lastfm-password" )]];
295 if( config_ExistIntf( VLC_OBJECT( p_intf ), "audioscrobbler" ) )
296 [o_audio_last_ckb setState: NSOnState];
298 [o_audio_last_ckb setState: NSOffState];
304 [o_video_enable_ckb setState: config_GetInt( p_intf, "video" )];
305 [o_video_fullscreen_ckb setState: config_GetInt( p_intf, "fullscreen" )];
306 [o_video_onTop_ckb setState: config_GetInt( p_intf, "video-on-top" )];
307 [o_video_skipFrames_ckb setState: config_GetInt( p_intf, "skip-frames" )];
308 [o_video_black_ckb setState: config_GetInt( p_intf, "macosx-black" )];
310 msg_Warn( p_intf, "vout module and display device selectors not implemented!" );
312 if( config_GetPsz( p_intf, "snapshot-path" ) != NULL )
313 [o_video_snap_folder_fld setStringValue: [NSString stringWithUTF8String: config_GetPsz( p_intf, "snapshot-path" )]];
314 [o_video_snap_prefix_fld setStringValue: [NSString stringWithUTF8String: config_GetPsz( p_intf, "snapshot-prefix" )]];
315 [o_video_snap_seqnum_ckb setState: config_GetInt( p_intf, "snapshot-sequential" )];
317 p_item = config_FindConfig( VLC_OBJECT(p_intf), "snapshot-format" );
318 for( i = 0; p_item->ppsz_list[i] != nil; i++ )
320 [o_video_snap_format_pop addItemWithTitle: [NSString stringWithUTF8String: p_item->ppsz_list[i]]];
321 if( p_item->value.psz && !strcmp( p_item->value.psz, p_item->ppsz_list[i] ) )
324 [o_video_snap_format_pop selectItemAtIndex: y];
326 /***************************
327 * input & codecs settings *
328 ***************************/
329 [o_input_serverport_fld setIntValue: config_GetInt( p_intf, "server-port" )];
330 if( config_GetPsz( p_intf, "http-proxy" ) != NULL )
331 [o_input_httpproxy_fld setStringValue: [NSString stringWithUTF8String: config_GetPsz( p_intf, "http-proxy" )]];
332 [o_input_postproc_fld setIntValue: config_GetInt( p_intf, "ffmpeg-pp-q" )];
334 SetupIntList( o_input_avi_pop, "avi-index" );
336 [o_input_rtsp_ckb setState: config_GetInt( p_intf, "rtsp-tcp" )];
338 psz_tmp = config_GetPsz( p_intf, "access-filter" );
341 [o_input_record_ckb setState: (int)strstr( psz_tmp, "record" )];
342 [o_input_dump_ckb setState: (int)strstr( psz_tmp, "dump" )];
343 [o_input_bandwidth_ckb setState: (int)strstr( psz_tmp, "bandwidth" )];
344 [o_input_timeshift_ckb setState: (int)strstr( psz_tmp, "timeshift" )];
347 [o_input_cachelevel_pop removeAllItems];
348 [o_input_cachelevel_pop addItemsWithTitles:
349 [NSArray arrayWithObjects: _NS("Custom"), _NS("Lowest latency"), _NS("Low latency"), _NS("Normal"),
350 _NS("High latency"), _NS("Higher latency"), nil]];
351 [[o_input_cachelevel_pop itemAtIndex: 0] setTag: 0];
352 [[o_input_cachelevel_pop itemAtIndex: 1] setTag: 100];
353 [[o_input_cachelevel_pop itemAtIndex: 2] setTag: 200];
354 [[o_input_cachelevel_pop itemAtIndex: 3] setTag: 300];
355 [[o_input_cachelevel_pop itemAtIndex: 4] setTag: 400];
356 [[o_input_cachelevel_pop itemAtIndex: 5] setTag: 500];
358 #define TestCaC( name ) \
359 b_cache_equal = b_cache_equal && \
360 ( i_cache == config_GetInt( p_intf, name ) )
362 #define TestCaCi( name, int ) \
363 b_cache_equal = b_cache_equal && \
364 ( ( i_cache * int ) == config_GetInt( p_intf, name ) )
366 /* Select the accurate value of the PopupButton */
367 bool b_cache_equal = true;
368 int i_cache = config_GetInt( p_intf, "file-caching");
370 TestCaC( "udp-caching" );
371 if( module_Exists (p_intf, "dvdread") )
372 TestCaC( "dvdread-caching" );
373 if( module_Exists (p_intf, "dvdnav") )
374 TestCaC( "dvdnav-caching" );
375 TestCaC( "tcp-caching" );
376 TestCaC( "fake-caching" );
377 TestCaC( "cdda-caching" );
378 TestCaC( "screen-caching" );
379 TestCaC( "vcd-caching" );
380 TestCaCi( "rtsp-caching", 4 );
381 TestCaCi( "ftp-caching", 2 );
382 TestCaCi( "http-caching", 4 );
383 if(module_Exists (p_intf, "access_realrtsp"))
384 TestCaCi( "realrtsp-caching", 10 );
385 TestCaCi( "mms-caching", 19 );
387 [o_input_cachelevel_pop selectItemWithTag: i_cache];
389 [o_input_cachelevel_pop selectItemWithTitle: _NS("Custom")];
391 /*********************
392 * subtitle settings *
393 *********************/
394 [o_osd_osd_ckb setState: config_GetInt( p_intf, "osd" )];
396 [o_osd_encoding_pop removeAllItems];
398 p_item = config_FindConfig( VLC_OBJECT(p_intf), "subsdec-encoding" );
399 for( i = 0; p_item->ppsz_list[i] != nil; i++ )
401 if( p_item->ppsz_list[i] != "" )
402 [o_osd_encoding_pop addItemWithTitle: _NS( p_item->ppsz_list[i] )];
404 [o_osd_encoding_pop addItemWithTitle: @" "];
406 if( p_item->value.psz && !strcmp( p_item->value.psz, p_item->ppsz_list[i] ) )
409 [o_osd_encoding_pop selectItemAtIndex: y];
411 [o_osd_lang_fld setStringValue: [NSString stringWithUTF8String: config_GetPsz( p_intf, "sub-language" )]];
412 if( config_GetPsz( p_intf, "freetype-font" ) != NULL )
413 [o_osd_font_fld setStringValue: [NSString stringWithUTF8String: config_GetPsz( p_intf, "freetype-font" )]];
415 SetupIntList( o_osd_font_color_pop, "freetype-color" );
416 SetupIntList( o_osd_font_size_pop, "freetype-rel-fontsize" );
417 SetupIntList( o_osd_font_effect_pop, "freetype-effect" );
419 /********************
421 ********************/
422 struct hotkey *p_hotkeys = p_intf->p_libvlc->p_hotkeys;
423 o_hotkeySettings = [[NSMutableArray alloc] init];
424 NSMutableArray *o_tempArray_desc = [[NSMutableArray alloc] init];
429 p_item = config_FindConfig( VLC_OBJECT(p_intf), p_hotkeys[i].psz_action );
433 [o_tempArray_desc addObject: _NS( p_item->psz_text )];
434 [o_hotkeySettings addObject: [NSNumber numberWithInt: p_item->value.i]];
438 o_hotkeyDescriptions = [[NSArray alloc] initWithArray: o_tempArray_desc copyItems: YES];
439 [o_tempArray_desc release];
440 [o_hotkeys_listbox reloadData];
443 - (void)showSimplePrefs
445 /* we want to show the interface settings, if no category was chosen */
446 if( [o_sprefs_toolbar selectedItemIdentifier] == nil )
448 [o_sprefs_toolbar setSelectedItemIdentifier: VLCIntfSettingToolbarIdentifier];
449 [self showInterfaceSettings];
452 [self resetControls];
454 [o_sprefs_win makeKeyAndOrderFront: self];
457 - (IBAction)buttonAction:(id)sender
459 if( sender == o_sprefs_cancel_btn )
460 [o_sprefs_win orderOut: sender];
461 else if( sender == o_sprefs_save_btn )
463 [self saveChangedSettings];
464 [o_sprefs_win orderOut: sender];
466 else if( sender == o_sprefs_reset_btn )
467 NSBeginInformationalAlertSheet( _NS("Reset Preferences"), _NS("Cancel"),
468 _NS("Continue"), nil, o_sprefs_win, self,
469 @selector(sheetDidEnd: returnCode: contextInfo:), NULL, nil,
470 _NS("Beware this will reset the VLC media player preferences.\n"
471 "Are you sure you want to continue?") );
472 else if( sender == o_sprefs_basicFull_matrix )
474 [o_sprefs_win orderOut: self];
475 [[[VLCMain sharedInstance] getPreferences] showPrefs];
476 [self resetControls];
479 msg_Err( p_intf, "unknown buttonAction sender" );
482 - (void)sheetDidEnd:(NSWindow *)o_sheet
483 returnCode:(int)i_return
484 contextInfo:(void *)o_context
486 if( i_return == NSAlertAlternateReturn )
488 config_ResetAll( p_intf );
489 b_intfSettingChanged = b_videoSettingChanged = b_audioSettingChanged = YES;
490 [self resetControls];
494 - (void)saveChangedSettings
496 module_config_t *p_item;
500 #define SaveIntList( object, name ) \
501 p_item = config_FindConfig( VLC_OBJECT(p_intf), name ); \
502 if( [object indexOfSelectedItem] >= 0 ) \
503 config_PutInt( p_intf, name, p_item->pi_list[[object indexOfSelectedItem]] ); \
505 config_PutInt( p_intf, name, [object intValue] ) \
507 #define SaveStringList( object, name ) \
508 p_item = config_FindConfig( VLC_OBJECT(p_intf), name ); \
509 if( [object indexOfSelectedItem] >= 0 ) \
510 config_PutPsz( p_intf, name, strdup( p_item->ppsz_list[[object indexOfSelectedItem]] ) ); \
512 config_PutPsz( p_intf, name, strdup( [[VLCMain sharedInstance] delocalizeString: [object stringValue]] ) )
514 /**********************
515 * interface settings *
516 **********************/
517 if( b_intfSettingChanged )
519 SaveStringList( o_intf_lang_pop, "language" );
520 SaveIntList( o_intf_art_pop, "album-art" );
522 config_PutInt( p_intf, "fetch-meta", [o_intf_meta_ckb state] );
523 config_PutInt( p_intf, "macosx-fspanel", [o_intf_fspanel_ckb state] );
524 config_PutInt( p_intf, "embedded-video", [o_intf_embedded_ckb state] );
526 /* okay, let's save our changes to vlcrc */
527 i = config_SaveConfigFile( p_intf, "main" );
528 i = config_SaveConfigFile( p_intf, "macosx" );
532 msg_Err( p_intf, "An error occurred while saving the Interface settings using SimplePrefs (%i)", i );
536 b_intfSettingChanged = NO;
542 if( b_audioSettingChanged )
544 config_PutInt( p_intf, "audio", [o_audio_enable_ckb state] );
545 config_PutInt( p_intf, "volume", [o_audio_vol_sld intValue] );
546 config_PutInt( p_intf, "spdif", [o_audio_spdif_ckb state] );
548 SaveIntList( o_audio_dolby_pop, "force-dolby-surround" );
550 config_PutPsz( p_intf, "audio-language", [[o_audio_lang_fld stringValue] UTF8String] );
551 config_PutInt( p_intf, "headphone-dolby", [o_audio_headphone_ckb state] );
553 psz_tmp = config_GetPsz( p_intf, "audio-filter" );
555 config_PutPsz( p_intf, "audio-filter", "volnorm" );
556 else if( (int)strstr( psz_tmp, "normvol" ) == NO )
558 /* work-around a GCC 4.0.1 bug */
559 psz_tmp = (char *)[[NSString stringWithFormat: @"%s:volnorm", psz_tmp] UTF8String];
560 config_PutPsz( p_intf, "audio-filter", psz_tmp );
564 psz_tmp = (char *)[[[NSString stringWithUTF8String: psz_tmp] stringByTrimmingCharactersInSet: [NSCharacterSet characterSetWithCharactersInString:@":volnorm"]] UTF8String];
565 psz_tmp = (char *)[[[NSString stringWithUTF8String: psz_tmp] stringByTrimmingCharactersInSet: [NSCharacterSet characterSetWithCharactersInString:@"volnorm:"]] UTF8String];
566 psz_tmp = (char *)[[[NSString stringWithUTF8String: psz_tmp] stringByTrimmingCharactersInSet: [NSCharacterSet characterSetWithCharactersInString:@"volnorm"]] UTF8String];
567 config_PutPsz( p_intf, "audio-filter", psz_tmp );
569 config_PutFloat( p_intf, "norm-max-level", [o_audio_norm_fld floatValue] );
571 msg_Warn( p_intf, "visualizer not implemented!" );
573 /* Last.FM is optional */
574 if( module_Exists( p_intf, "audioscrobbler" ) )
576 if( [o_audio_last_ckb state] == NSOnState )
577 config_AddIntf( VLC_OBJECT( p_intf ), "audioscrobbler" );
579 config_RemoveIntf( VLC_OBJECT( p_intf ), "audioscrobbler" );
581 config_PutPsz( p_intf, "lastfm-username", [[o_audio_lastuser_fld stringValue] UTF8String] );
582 config_PutPsz( p_intf, "lastfm-password", [[o_audio_lastuser_fld stringValue] UTF8String] );
585 /* okay, let's save our changes to vlcrc */
586 i = config_SaveConfigFile( p_intf, "main" );
587 i = i + config_SaveConfigFile( p_intf, "audioscrobbler" );
588 i = i + config_SaveConfigFile( p_intf, "volnorm" );
592 msg_Err( p_intf, "An error occurred while saving the Audio settings using SimplePrefs (%i)", i );
595 b_audioSettingChanged = NO;
601 if( b_videoSettingChanged )
603 config_PutInt( p_intf, "video", [o_video_enable_ckb state] );
604 config_PutInt( p_intf, "fullscreen", [o_video_fullscreen_ckb state] );
605 config_PutInt( p_intf, "video-on-top", [o_video_onTop_ckb state] );
606 config_PutInt( p_intf, "skip-frames", [o_video_skipFrames_ckb state] );
607 config_PutInt( p_intf, "macosx-black", [o_video_black_ckb state] );
609 msg_Warn( p_intf, "vout module and display device selectors not implemented!" );
611 config_PutPsz( p_intf, "snapshot-path", [[o_video_snap_folder_fld stringValue] UTF8String] );
612 config_PutPsz( p_intf, "snapshot-prefix", [[o_video_snap_prefix_fld stringValue] UTF8String] );
613 config_PutInt( p_intf, "snapshot-sequential", [o_video_snap_seqnum_ckb state] );
615 if( [o_video_snap_format_pop indexOfSelectedItem] >= 0 )
616 config_PutPsz( p_intf, "snapshot-format", [[[o_video_snap_format_pop selectedItem] title] UTF8String] );
618 i = config_SaveConfigFile( p_intf, "main" );
619 i = i + config_SaveConfigFile( p_intf, "macosx" );
623 msg_Err( p_intf, "An error occurred while saving the Video settings using SimplePrefs (%i)", i );
626 b_videoSettingChanged = NO;
629 /***************************
630 * input & codecs settings *
631 ***************************/
632 if( b_inputSettingChanged )
634 config_PutInt( p_intf, "server-port", [o_input_serverport_fld intValue] );
635 config_PutPsz( p_intf, "http-proxy", [[o_input_httpproxy_fld stringValue] UTF8String] );
636 config_PutInt( p_intf, "ffmpeg-pp-q", [o_input_postproc_fld intValue] );
638 SaveIntList( o_input_avi_pop, "avi-index" );
640 config_PutInt( p_intf, "rtsp-tcp", [o_input_rtsp_ckb state] );
642 #define CaCi( name, int ) config_PutInt( p_intf, name, int * [[o_input_cachelevel_pop selectedItem] tag] )
643 #define CaC( name ) CaCi( name, 1 )
644 msg_Dbg( p_intf, "Adjusting all cache values at: %i", [[o_input_cachelevel_pop selectedItem] tag] );
645 CaC( "udp-caching" );
646 if( module_Exists (p_intf, "dvdread" ) )
648 CaC( "dvdread-caching" );
649 i = i + config_SaveConfigFile( p_intf, "dvdread" );
651 if( module_Exists (p_intf, "dvdnav" ) )
653 CaC( "dvdnav-caching" );
654 i = i + config_SaveConfigFile( p_intf, "dvdnav" );
656 CaC( "tcp-caching" ); CaC( "vcd-caching" );
657 CaC( "fake-caching" ); CaC( "cdda-caching" ); CaC( "file-caching" );
658 CaC( "screen-caching" );
659 CaCi( "rtsp-caching", 4 ); CaCi( "ftp-caching", 2 );
660 CaCi( "http-caching", 4 );
661 if( module_Exists (p_intf, "access_realrtsp" ) )
663 CaCi( "realrtsp-caching", 10 );
664 i = i + config_SaveConfigFile( p_intf, "access_realrtsp" );
666 CaCi( "mms-caching", 19 );
668 #define SaveAccessFilter( object, name ) \
669 if( [object state] == NSOnState ) \
673 [o_temp appendString: name]; \
677 [o_temp appendFormat: @":%@", name]; \
681 NSMutableString *o_temp = [[NSMutableString alloc] init];
682 SaveAccessFilter( o_input_record_ckb, @"record" );
683 SaveAccessFilter( o_input_dump_ckb, @"dump" );
684 SaveAccessFilter( o_input_bandwidth_ckb, @"bandwidth" );
685 SaveAccessFilter( o_input_timeshift_ckb, @"timeshift" );
686 config_PutPsz( p_intf, "access-filter", [o_temp UTF8String] );
689 i = config_SaveConfigFile( p_intf, "main" );
690 i = i + config_SaveConfigFile( p_intf, "ffmpeg" );
691 i = i + config_SaveConfigFile( p_intf, "access_http" );
692 i = i + config_SaveConfigFile( p_intf, "access_file" );
693 i = i + config_SaveConfigFile( p_intf, "access_tcp" );
694 i = i + config_SaveConfigFile( p_intf, "access_fake" );
695 i = i + config_SaveConfigFile( p_intf, "cdda" );
696 i = i + config_SaveConfigFile( p_intf, "screen" );
697 i = i + config_SaveConfigFile( p_intf, "vcd" );
698 i = i + config_SaveConfigFile( p_intf, "access_ftp" );
699 i = i + config_SaveConfigFile( p_intf, "access_mms" );
700 i = i + config_SaveConfigFile( p_intf, "live555" );
704 msg_Err( p_intf, "An error occurred while saving the Input settings using SimplePrefs (%i)", i );
707 b_inputSettingChanged = NO;
710 /**********************
711 * subtitles settings *
712 **********************/
713 if( b_osdSettingChanged )
715 config_PutInt( p_intf, "osd", [o_osd_osd_ckb state] );
717 if( [o_osd_encoding_pop indexOfSelectedItem] >= 0 )
718 config_PutPsz( p_intf, "subsdec-encoding", [[[o_osd_encoding_pop selectedItem] title] UTF8String] );
720 config_PutPsz( p_intf, "sub-language", [[o_osd_lang_fld stringValue] UTF8String] );
721 config_PutPsz( p_intf, "freetype-font", [[o_osd_font_fld stringValue] UTF8String] );
723 SaveIntList( o_osd_font_color_pop, "freetype-color" );
724 SaveIntList( o_osd_font_size_pop, "freetype-rel-fontsize" );
725 SaveIntList( o_osd_font_effect_pop, "freetype-effect" );
727 i = config_SaveConfigFile( p_intf, NULL );
731 msg_Err( p_intf, "An error occurred while saving the OSD/Subtitle settings using SimplePrefs (%i)", i );
734 b_osdSettingChanged = NO;
737 /********************
739 ********************/
740 if( b_hotkeyChanged )
742 struct hotkey *p_hotkeys = p_intf->p_libvlc->p_hotkeys;
744 while( i < [o_hotkeySettings count] )
746 config_PutInt( p_intf, p_hotkeys[i].psz_action, [[o_hotkeySettings objectAtIndex: i-1] intValue] );
750 i = config_SaveConfigFile( p_intf, "main" );
754 msg_Err( p_intf, "An error occurred while saving the Hotkey settings using SimplePrefs (%i)", i );
757 b_hotkeyChanged = NO;
761 - (void)showSettingsForCategory: (id)o_new_category_view
763 NSRect o_win_rect, o_view_rect, o_old_view_rect;
764 o_win_rect = [o_sprefs_win frame];
765 o_view_rect = [o_new_category_view frame];
767 if( o_currentlyShownCategoryView != nil )
769 /* restore our window's height, if we've shown another category previously */
770 o_old_view_rect = [o_currentlyShownCategoryView frame];
771 o_win_rect.size.height = o_win_rect.size.height - o_old_view_rect.size.height;
773 /* remove our previous category view */
774 [o_currentlyShownCategoryView removeFromSuperviewWithoutNeedingDisplay];
777 o_win_rect.size.height = o_win_rect.size.height + o_view_rect.size.height;
779 [o_sprefs_win displayIfNeeded];
780 [o_sprefs_win setFrame: o_win_rect display:YES animate: YES];
782 [o_new_category_view setFrame: NSMakeRect( 0,
783 [o_sprefs_controls_box frame].size.height,
784 o_view_rect.size.width,
785 o_view_rect.size.height )];
786 [o_new_category_view setNeedsDisplay: YES];
787 [o_new_category_view setAutoresizesSubviews: YES];
788 [[o_sprefs_win contentView] addSubview: o_new_category_view];
790 /* keep our current category for further reference */
791 [o_currentlyShownCategoryView release];
792 o_currentlyShownCategoryView = o_new_category_view;
793 [o_currentlyShownCategoryView retain];
796 - (IBAction)interfaceSettingChanged:(id)sender
798 b_intfSettingChanged = YES;
801 - (void)showInterfaceSettings
803 msg_Dbg( p_intf, "showing interface settings" );
804 [self showSettingsForCategory: o_intf_view];
807 - (IBAction)audioSettingChanged:(id)sender
809 if( sender == o_audio_vol_sld )
810 [o_audio_vol_fld setIntValue: [o_audio_vol_sld intValue]];
812 if( sender == o_audio_vol_fld )
813 [o_audio_vol_sld setIntValue: [o_audio_vol_fld intValue]];
815 b_audioSettingChanged = YES;
818 - (void)showAudioSettings
820 msg_Dbg( p_intf, "showing audio settings" );
821 [self showSettingsForCategory: o_audio_view];
824 - (IBAction)videoSettingChanged:(id)sender
826 if( sender == o_video_snap_folder_btn )
828 o_selectFolderPanel = [[NSOpenPanel alloc] init];
829 [o_selectFolderPanel setCanChooseDirectories: YES];
830 [o_selectFolderPanel setCanChooseFiles: NO];
831 [o_selectFolderPanel setResolvesAliases: YES];
832 [o_selectFolderPanel setAllowsMultipleSelection: NO];
833 [o_selectFolderPanel setMessage: _NS("Choose the folder to save your video snapshots to.")];
834 [o_selectFolderPanel setCanCreateDirectories: YES];
835 [o_selectFolderPanel setPrompt: _NS("Choose")];
836 [o_selectFolderPanel beginSheetForDirectory: nil file: nil modalForWindow: o_sprefs_win
838 didEndSelector: @selector(savePanelDidEnd:returnCode:contextInfo:)
839 contextInfo: o_video_snap_folder_btn];
842 b_videoSettingChanged = YES;
845 - (void)savePanelDidEnd:(NSOpenPanel * )panel returnCode: (int)returnCode contextInfo: (void *)contextInfo
847 if( returnCode == NSOKButton )
849 if( contextInfo == o_video_snap_folder_btn )
851 [o_video_snap_folder_fld setStringValue: [o_selectFolderPanel filename]];
852 b_videoSettingChanged = YES;
854 else if( contextInfo == o_osd_font_btn )
856 [o_osd_font_fld setStringValue: [o_selectFolderPanel filename]];
857 b_osdSettingChanged = YES;
861 [o_selectFolderPanel release];
864 - (void)showVideoSettings
866 msg_Dbg( p_intf, "showing video settings" );
867 [self showSettingsForCategory: o_video_view];
870 - (IBAction)osdSettingChanged:(id)sender
872 if( sender == o_osd_font_btn )
874 o_selectFolderPanel = [[NSOpenPanel alloc] init];
875 [o_selectFolderPanel setCanChooseDirectories: NO];
876 [o_selectFolderPanel setCanChooseFiles: YES];
877 [o_selectFolderPanel setResolvesAliases: YES];
878 [o_selectFolderPanel setAllowsMultipleSelection: NO];
879 [o_selectFolderPanel setMessage: _NS("Choose the font to display your Subtitles with.")];
880 [o_selectFolderPanel setCanCreateDirectories: NO];
881 [o_selectFolderPanel setPrompt: _NS("Choose")];
882 [o_selectFolderPanel setAllowedFileTypes: [NSArray arrayWithObjects: @"dfont", @"ttf", @"otf", @"FFIL", nil]];
883 [o_selectFolderPanel beginSheetForDirectory: @"/System/Library/Fonts/" file: nil modalForWindow: o_sprefs_win
885 didEndSelector: @selector(savePanelDidEnd:returnCode:contextInfo:)
886 contextInfo: o_osd_font_btn];
889 b_osdSettingChanged = YES;
892 - (void)showOSDSettings
894 msg_Dbg( p_intf, "showing OSD settings" );
895 [self showSettingsForCategory: o_osd_view];
898 - (IBAction)inputSettingChanged:(id)sender
900 b_inputSettingChanged = YES;
903 - (void)showInputSettings
905 msg_Dbg( p_intf, "showing Input Settings" );
906 [self showSettingsForCategory: o_input_view];
909 - (IBAction)hotkeySettingChanged:(id)sender
911 if( sender == o_hotkeys_change_btn || sender == o_hotkeys_listbox )
913 [o_hotkeys_change_lbl setStringValue: [NSString stringWithFormat: _NS("Press new keys for\n\"%@\""),
914 [o_hotkeyDescriptions objectAtIndex: [o_hotkeys_listbox selectedRow]]]];
915 [o_hotkeys_change_keys_lbl setStringValue: [self OSXKeyToString:[[o_hotkeySettings objectAtIndex: [o_hotkeys_listbox selectedRow]] intValue]]];
916 [o_hotkeys_change_taken_lbl setStringValue: @""];
917 [o_hotkeys_change_win setInitialFirstResponder: [o_hotkeys_change_win contentView]];
918 [o_hotkeys_change_win makeFirstResponder: [o_hotkeys_change_win contentView]];
919 [NSApp runModalForWindow: o_hotkeys_change_win];
921 else if( sender == o_hotkeys_change_cancel_btn )
924 [o_hotkeys_change_win close];
926 else if( sender == o_hotkeys_change_ok_btn )
929 if(! o_keyInTransition )
932 [o_hotkeys_change_win close];
933 msg_Err( p_intf, "internal error prevented the hotkey switch" );
937 b_hotkeyChanged = YES;
939 i_returnValue = [o_hotkeySettings indexOfObject: o_keyInTransition];
940 if( i_returnValue != NSNotFound )
941 [o_hotkeySettings replaceObjectAtIndex: i_returnValue withObject: [[NSNumber numberWithInt: 0] retain]];
943 [o_hotkeySettings replaceObjectAtIndex: [o_hotkeys_listbox selectedRow] withObject: [o_keyInTransition retain]];
946 [o_hotkeys_change_win close];
948 [o_hotkeys_listbox reloadData];
950 else if( sender == o_hotkeys_clear_btn )
952 [o_hotkeySettings replaceObjectAtIndex: [o_hotkeys_listbox selectedRow] withObject: [NSNumber numberWithInt: 0]];
953 [o_hotkeys_listbox reloadData];
954 b_hotkeyChanged = YES;
958 - (void)showHotkeySettings
960 msg_Dbg( p_intf, "showing HotKey Settings" );
961 [self showSettingsForCategory: o_hotkeys_view];
964 - (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView
966 return [o_hotkeySettings count];
969 - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex
971 if( [[aTableColumn identifier] isEqualToString: @"action"] )
972 return [o_hotkeyDescriptions objectAtIndex: rowIndex];
973 else if( [[aTableColumn identifier] isEqualToString: @"shortcut"] )
974 return [self OSXKeyToString: [[o_hotkeySettings objectAtIndex: rowIndex] intValue]];
977 msg_Err( p_intf, "unknown TableColumn identifier (%s)!", [[aTableColumn identifier] UTF8String] );
982 - (void)changeHotkeyTo: (int)i_theNewKey
985 i_returnValue = [o_hotkeysNonUseableKeys indexOfObject: [NSNumber numberWithInt: i_theNewKey]];
986 if( i_returnValue != NSNotFound || i_theNewKey == 0 )
988 [o_hotkeys_change_keys_lbl setStringValue: _NS("Invalid combination")];
989 [o_hotkeys_change_taken_lbl setStringValue: _NS("Regrettably, these keys cannot be assigned as hotkey shortcuts.")];
990 [o_hotkeys_change_ok_btn setEnabled: NO];
995 if( o_keyInTransition )
996 [o_keyInTransition release];
997 o_keyInTransition = [[NSNumber numberWithInt: i_theNewKey] retain];
999 o_temp = [self OSXKeyToString: i_theNewKey];
1001 [o_hotkeys_change_keys_lbl setStringValue: o_temp];
1003 i_returnValue = [o_hotkeySettings indexOfObject: o_keyInTransition];
1004 if( i_returnValue != NSNotFound )
1005 [o_hotkeys_change_taken_lbl setStringValue: [NSString stringWithFormat:
1006 _NS("This combination is already taken by \"%@\"."),
1007 [self OSXKeyToString:[[o_hotkeyDescriptions objectAtIndex: i_returnValue] intValue]]]];
1009 [o_hotkeys_change_taken_lbl setStringValue: @""];
1011 [o_hotkeys_change_ok_btn setEnabled: YES];
1017 /********************
1018 * hotkeys settings *
1019 ********************/
1021 @implementation VLCHotkeyChangeWindow
1023 - (BOOL)resignFirstResponder
1025 /* We need to stay the first responder or we'll miss the user's input */
1029 - (void)keyDown:(NSEvent *)o_theEvent
1031 int i_nonReadableKey = 0;
1033 if( [o_theEvent modifierFlags] & NSControlKeyMask )
1034 i_nonReadableKey = i_nonReadableKey | KEY_MODIFIER_CTRL;
1036 if( [o_theEvent modifierFlags] & NSAlternateKeyMask )
1037 i_nonReadableKey = i_nonReadableKey | KEY_MODIFIER_ALT;
1039 if( [o_theEvent modifierFlags] & NSShiftKeyMask )
1040 i_nonReadableKey = i_nonReadableKey | KEY_MODIFIER_SHIFT;
1042 if( [o_theEvent modifierFlags] & NSCommandKeyMask )
1043 i_nonReadableKey = i_nonReadableKey | KEY_MODIFIER_COMMAND;
1045 if( [o_theEvent modifierFlags] & NSFunctionKeyMask )
1048 key = [[o_theEvent charactersIgnoringModifiers] characterAtIndex: 0];
1053 i_nonReadableKey = i_nonReadableKey | KEY_ESC;
1055 case NSF1FunctionKey:
1056 i_nonReadableKey = i_nonReadableKey | KEY_F1;
1058 case NSF2FunctionKey:
1059 i_nonReadableKey = i_nonReadableKey | KEY_F2;
1061 case NSF3FunctionKey:
1062 i_nonReadableKey = i_nonReadableKey | KEY_F3;
1064 case NSF4FunctionKey:
1065 i_nonReadableKey = i_nonReadableKey | KEY_F4;
1067 case NSF5FunctionKey:
1068 i_nonReadableKey = i_nonReadableKey | KEY_F5;
1070 case NSF6FunctionKey:
1071 i_nonReadableKey = i_nonReadableKey | KEY_F6;
1073 case NSF7FunctionKey:
1074 i_nonReadableKey = i_nonReadableKey | KEY_F7;
1076 case NSF8FunctionKey:
1077 i_nonReadableKey = i_nonReadableKey | KEY_F8;
1079 case NSF9FunctionKey:
1080 i_nonReadableKey = i_nonReadableKey | KEY_F9;
1082 case NSF10FunctionKey:
1083 i_nonReadableKey = i_nonReadableKey | KEY_F10;
1085 case NSF11FunctionKey:
1086 i_nonReadableKey = i_nonReadableKey | KEY_F11;
1088 case NSF12FunctionKey:
1089 i_nonReadableKey = i_nonReadableKey | KEY_F12;
1091 case NSInsertFunctionKey:
1092 i_nonReadableKey = i_nonReadableKey | KEY_INSERT;
1094 case NSHomeFunctionKey:
1095 i_nonReadableKey = i_nonReadableKey | KEY_HOME;
1097 case NSEndFunctionKey:
1098 i_nonReadableKey = i_nonReadableKey | KEY_END;
1100 case NSPageUpFunctionKey:
1101 i_nonReadableKey = i_nonReadableKey | KEY_PAGEUP;
1103 case NSPageDownFunctionKey:
1104 i_nonReadableKey = i_nonReadableKey | KEY_PAGEDOWN;
1106 case NSMenuFunctionKey:
1107 i_nonReadableKey = i_nonReadableKey | KEY_MENU;
1109 case NSTabCharacter:
1110 i_nonReadableKey = i_nonReadableKey | KEY_TAB;
1112 case NSDeleteCharacter:
1113 i_nonReadableKey = i_nonReadableKey | KEY_DELETE;
1115 case NSBackspaceCharacter:
1116 i_nonReadableKey = i_nonReadableKey | KEY_BACKSPACE;
1118 case NSUpArrowFunctionKey:
1119 i_nonReadableKey = i_nonReadableKey | KEY_UP;
1121 case NSDownArrowFunctionKey:
1122 i_nonReadableKey = i_nonReadableKey | KEY_DOWN;
1124 case NSRightArrowFunctionKey:
1125 i_nonReadableKey = i_nonReadableKey | KEY_RIGHT;
1127 case NSLeftArrowFunctionKey:
1128 i_nonReadableKey = i_nonReadableKey | KEY_LEFT;
1130 case NSEnterCharacter:
1131 i_nonReadableKey = i_nonReadableKey | KEY_ENTER;
1135 msg_Warn( VLCIntf, "user pressed unknown function key" );
1136 i_nonReadableKey = 0;
1143 if( [[o_theEvent charactersIgnoringModifiers] isEqualToString: @" "] )
1144 i_nonReadableKey = i_nonReadableKey | KEY_SPACE;
1146 i_nonReadableKey = i_nonReadableKey | StringToKey( (char *)[[[o_theEvent charactersIgnoringModifiers] lowercaseString] UTF8String] );
1149 [[[VLCMain sharedInstance] getSimplePreferences] changeHotkeyTo: i_nonReadableKey];