Changeset 887efa47545fa1e6b08acdb1d1a026049bbafe75
- Timestamp:
- 27/02/08 22:30:20 (8 months ago)
- git-parent:
- Files:
-
- extras/package/macosx/Resources/English.lproj/Preferences.nib/classes.nib (modified) (3 diffs)
- extras/package/macosx/Resources/English.lproj/Preferences.nib/info.nib (modified) (4 diffs)
- extras/package/macosx/Resources/English.lproj/Preferences.nib/keyedobjects.nib (modified) (previous)
- modules/gui/macosx/simple_prefs.h (modified) (4 diffs)
- modules/gui/macosx/simple_prefs.m (modified) (20 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
extras/package/macosx/Resources/English.lproj/Preferences.nib/classes.nib
r343baae r887efa4 28 28 audioSettingChanged = id; 29 29 buttonAction = id; 30 inputSettingChanged = id; 30 31 interfaceSettingChanged = id; 32 osdSettingChanged = id; 31 33 videoSettingChanged = id; 32 34 }; … … 57 59 "o_audio_vol_sld" = id; 58 60 "o_audio_vol_txt" = id; 61 "o_input_access_box" = id; 62 "o_input_avi_pop" = id; 63 "o_input_avi_txt" = id; 64 "o_input_bandwidth_ckb" = id; 65 "o_input_cachelevel_pop" = id; 66 "o_input_cachelevel_txt" = id; 67 "o_input_caching_box" = id; 68 "o_input_dump_ckb" = id; 69 "o_input_httpproxy_fld" = id; 70 "o_input_httpproxy_txt" = id; 71 "o_input_mux_box" = id; 72 "o_input_net_box" = id; 73 "o_input_postproc_fld" = id; 74 "o_input_postproc_txt" = id; 75 "o_input_record_ckb" = id; 76 "o_input_rtsp_ckb" = id; 77 "o_input_serverport_fld" = id; 78 "o_input_serverport_txt" = id; 79 "o_input_timeshift_ckb" = id; 80 "o_input_view" = id; 59 81 "o_intf_art_pop" = id; 60 82 "o_intf_art_txt" = id; … … 66 88 "o_intf_network_box" = id; 67 89 "o_intf_view" = id; 90 "o_osd_encoding_pop" = id; 91 "o_osd_encoding_txt" = id; 92 "o_osd_font_box" = id; 93 "o_osd_font_btn" = id; 94 "o_osd_font_color_pop" = id; 95 "o_osd_font_color_txt" = id; 96 "o_osd_font_effect_pop" = id; 97 "o_osd_font_effect_txt" = id; 98 "o_osd_font_fld" = id; 99 "o_osd_font_size_pop" = id; 100 "o_osd_font_size_txt" = id; 101 "o_osd_font_txt" = id; 102 "o_osd_lang_box" = id; 103 "o_osd_lang_fld" = id; 104 "o_osd_lang_txt" = id; 105 "o_osd_osd_box" = id; 106 "o_osd_osd_ckb" = id; 107 "o_osd_view" = id; 68 108 "o_sprefs_basicFull_matrix" = id; 69 109 "o_sprefs_basic_box" = id; extras/package/macosx/Resources/English.lproj/Preferences.nib/info.nib
r343baae r887efa4 4 4 <dict> 5 5 <key>IBDocumentLocation</key> 6 <string> 113 117505 518 0 0 1280 778 </string>6 <string>391 94 505 518 0 0 1280 778 </string> 7 7 <key>IBEditorPositions</key> 8 8 <dict> … … 10 10 <string>345 406 590 264 0 0 1280 778 </string> 11 11 <key>2330</key> 12 <string> 450 263590 502 0 0 1280 778 </string>12 <string>345 266 590 502 0 0 1280 778 </string> 13 13 <key>2440</key> 14 14 <string>345 343 590 389 0 0 1280 778 </string> 15 <key>2523</key> 16 <string>345 351 590 373 0 0 1280 778 </string> 17 <key>2562</key> 18 <string>345 310 590 455 0 0 1280 778 </string> 15 19 </dict> 16 20 <key>IBFramework Version</key> … … 25 29 </dict> 26 30 <key>IBLastGroupID</key> 27 <string> 2</string>31 <string>3</string> 28 32 <key>IBLockedObjects</key> 29 33 <array> … … 35 39 <key>IBOpenObjects</key> 36 40 <array> 41 <integer>2265</integer> 42 <integer>2523</integer> 43 <integer>2562</integer> 44 <integer>2440</integer> 37 45 <integer>2311</integer> 38 <integer>2440</integer>39 <integer>2265</integer>40 <integer>2330</integer>41 46 </array> 42 47 <key>IBSystem Version</key> modules/gui/macosx/simple_prefs.h
r343baae r887efa4 52 52 IBOutlet id o_audio_vol_txt; 53 53 54 IBOutlet id o_input_access_box; 55 IBOutlet id o_input_avi_pop; 56 IBOutlet id o_input_avi_txt; 57 IBOutlet id o_input_bandwidth_ckb; 58 IBOutlet id o_input_cachelevel_pop; 59 IBOutlet id o_input_cachelevel_txt; 60 IBOutlet id o_input_caching_box; 61 IBOutlet id o_input_dump_ckb; 62 IBOutlet id o_input_httpproxy_fld; 63 IBOutlet id o_input_httpproxy_txt; 64 IBOutlet id o_input_mux_box; 65 IBOutlet id o_input_net_box; 66 IBOutlet id o_input_postproc_fld; 67 IBOutlet id o_input_postproc_txt; 68 IBOutlet id o_input_record_ckb; 69 IBOutlet id o_input_rtsp_ckb; 70 IBOutlet id o_input_serverport_fld; 71 IBOutlet id o_input_serverport_txt; 72 IBOutlet id o_input_timeshift_ckb; 73 IBOutlet id o_input_view; 74 54 75 IBOutlet id o_intf_art_pop; 55 76 IBOutlet id o_intf_art_txt; … … 61 82 IBOutlet id o_intf_network_box; 62 83 IBOutlet id o_intf_view; 84 85 IBOutlet id o_osd_encoding_pop; 86 IBOutlet id o_osd_encoding_txt; 87 IBOutlet id o_osd_font_box; 88 IBOutlet id o_osd_font_btn; 89 IBOutlet id o_osd_font_color_pop; 90 IBOutlet id o_osd_font_color_txt; 91 IBOutlet id o_osd_font_effect_pop; 92 IBOutlet id o_osd_font_effect_txt; 93 IBOutlet id o_osd_font_fld; 94 IBOutlet id o_osd_font_size_pop; 95 IBOutlet id o_osd_font_size_txt; 96 IBOutlet id o_osd_font_txt; 97 IBOutlet id o_osd_lang_box; 98 IBOutlet id o_osd_lang_fld; 99 IBOutlet id o_osd_lang_txt; 100 IBOutlet id o_osd_osd_box; 101 IBOutlet id o_osd_osd_ckb; 102 IBOutlet id o_osd_view; 63 103 64 104 IBOutlet id o_sprefs_basic_box; … … 94 134 BOOL b_intfSettingChanged; 95 135 BOOL b_videoSettingChanged; 136 BOOL b_osdSettingChanged; 137 BOOL b_inputSettingChanged; 96 138 id o_currentlyShownCategoryView; 97 139 98 140 NSToolbar *o_sprefs_toolbar; 99 141 NSOpenPanel *o_selectFolderPanel; 100 142 101 143 intf_thread_t *p_intf; 102 144 } … … 133 175 - (void)showVideoSettings; 134 176 135 /* subtitles */ 177 /* OSD / subtitles */ 178 - (IBAction)osdSettingChanged:(id)sender; 179 - (void)showOSDSettings; 136 180 137 181 /* input & codecs */ 182 - (IBAction)inputSettingChanged:(id)sender; 183 - (void)showInputSettings; 138 184 139 185 /* hotkeys */ modules/gui/macosx/simple_prefs.m
r6cf432c r887efa4 29 29 static NSString* VLCAudioSettingToolbarIdentifier = @"Audio Settings Item Identifier"; 30 30 static NSString* VLCVideoSettingToolbarIdentifier = @"Video Settings Item Identifier"; 31 static NSString* VLCOSDSettingToolbarIdentifier = @"Subtitles Settings Item Identifier"; 32 static NSString* VLCInputSettingToolbarIdentifier = @"Input Settings Item Identifier"; 33 static NSString* VLCHotkeysSettingToolbarIdentifier = @"Hotkeys Settings Item Identifier"; 31 34 32 35 @implementation VLCSimplePrefs … … 116 119 { 117 120 o_toolbarItem = [[[NSToolbarItem alloc] initWithItemIdentifier: o_itemIdent] autorelease]; 118 121 119 122 [o_toolbarItem setLabel: _NS("Video")]; 120 123 [o_toolbarItem setPaletteLabel: _NS("General Video settings")]; 121 124 122 125 [o_toolbarItem setToolTip: _NS("General Video settings")]; 123 126 [o_toolbarItem setImage: [NSImage imageNamed: @"spref_cone_Video_64"]]; 124 127 125 128 [o_toolbarItem setTarget: self]; 126 129 [o_toolbarItem setAction: @selector(showVideoSettings)]; 127 130 128 131 [o_toolbarItem setEnabled: YES]; 129 132 [o_toolbarItem setAutovalidates: YES]; 130 133 } 131 134 else if( [o_itemIdent isEqual: VLCOSDSettingToolbarIdentifier] ) 135 { 136 o_toolbarItem = [[[NSToolbarItem alloc] initWithItemIdentifier: o_itemIdent] autorelease]; 137 138 [o_toolbarItem setLabel: _NS("Subtitles & OSD")]; 139 [o_toolbarItem setPaletteLabel: _NS("Subtitles & OSD settings")]; 140 141 [o_toolbarItem setToolTip: _NS("Subtitles & OSD settings")]; 142 [o_toolbarItem setImage: [NSImage imageNamed: @"spref_cone_Subtitles_64"]]; 143 144 [o_toolbarItem setTarget: self]; 145 [o_toolbarItem setAction: @selector(showOSDSettings)]; 146 147 [o_toolbarItem setEnabled: YES]; 148 [o_toolbarItem setAutovalidates: YES]; 149 } 150 else if( [o_itemIdent isEqual: VLCInputSettingToolbarIdentifier] ) 151 { 152 o_toolbarItem = [[[NSToolbarItem alloc] initWithItemIdentifier: o_itemIdent] autorelease]; 153 154 [o_toolbarItem setLabel: _NS("Input & Codecs")]; 155 [o_toolbarItem setPaletteLabel: _NS("Input & Codec settings")]; 156 157 [o_toolbarItem setToolTip: _NS("Input & Codec settings")]; 158 [o_toolbarItem setImage: [NSImage imageNamed: @"spref_cone_Input_64"]]; 159 160 [o_toolbarItem setTarget: self]; 161 [o_toolbarItem setAction: @selector(showInputSettings)]; 162 163 [o_toolbarItem setEnabled: YES]; 164 [o_toolbarItem setAutovalidates: YES]; 165 } 166 132 167 return o_toolbarItem; 133 168 } … … 135 170 - (NSArray *)toolbarDefaultItemIdentifiers: (NSToolbar *)toolbar 136 171 { 137 return [NSArray arrayWithObjects: VLCIntfSettingToolbarIdentifier, VLCAudioSettingToolbarIdentifier, VLCVideoSettingToolbarIdentifier, NSToolbarFlexibleSpaceItemIdentifier, nil]; 172 return [NSArray arrayWithObjects: VLCIntfSettingToolbarIdentifier, VLCAudioSettingToolbarIdentifier, VLCVideoSettingToolbarIdentifier, 173 VLCOSDSettingToolbarIdentifier, VLCInputSettingToolbarIdentifier, NSToolbarFlexibleSpaceItemIdentifier, nil]; 138 174 } 139 175 140 176 - (NSArray *)toolbarAllowedItemIdentifiers: (NSToolbar *)toolbar 141 177 { 142 return [NSArray arrayWithObjects: VLCIntfSettingToolbarIdentifier, VLCAudioSettingToolbarIdentifier, VLCVideoSettingToolbarIdentifier, NSToolbarFlexibleSpaceItemIdentifier, nil]; 178 return [NSArray arrayWithObjects: VLCIntfSettingToolbarIdentifier, VLCAudioSettingToolbarIdentifier, VLCVideoSettingToolbarIdentifier, 179 VLCOSDSettingToolbarIdentifier, VLCInputSettingToolbarIdentifier, NSToolbarFlexibleSpaceItemIdentifier, nil]; 143 180 } 144 181 145 182 - (NSArray *)toolbarSelectableItemIdentifiers:(NSToolbar *)toolbar 146 183 { 147 return [NSArray arrayWithObjects: VLCIntfSettingToolbarIdentifier, VLCAudioSettingToolbarIdentifier, VLCVideoSettingToolbarIdentifier, nil]; 184 return [NSArray arrayWithObjects: VLCIntfSettingToolbarIdentifier, VLCAudioSettingToolbarIdentifier, VLCVideoSettingToolbarIdentifier, 185 VLCOSDSettingToolbarIdentifier, VLCInputSettingToolbarIdentifier, nil]; 148 186 } 149 187 150 188 - (void)initStrings 151 189 { 152 msg_Warn( p_intf, "localisation of the simple preferences not implemented!" );190 msg_Warn( p_intf, "localisation of the simple preferences is not implemented!" ); 153 191 } 154 192 … … 159 197 char *psz_tmp; 160 198 199 #define SetupIntList( object, name ) \ 200 [object removeAllItems]; \ 201 p_item = config_FindConfig( VLC_OBJECT(p_intf), name ); \ 202 for( i = 0; i < p_item->i_list; i++ ) \ 203 { \ 204 if( p_item->ppsz_list_text[i] != NULL) \ 205 [object addItemWithTitle: _NS( p_item->ppsz_list_text[i] )]; \ 206 else \ 207 [object addItemWithTitle: [NSString stringWithUTF8String: p_item->ppsz_list[i]]]; \ 208 } \ 209 if( p_item->value.i < [object numberOfItems] ) \ 210 [object selectItemAtIndex: p_item->value.i]; \ 211 else \ 212 [object selectItemAtIndex: 0] 213 214 #define SetupStringList( object, name ) \ 215 [object removeAllItems]; \ 216 y = 0; \ 217 p_item = config_FindConfig( VLC_OBJECT(p_intf), name ); \ 218 for( i = 0; p_item->ppsz_list[i] != nil; i++ ) \ 219 { \ 220 [object addItemWithTitle: _NS( p_item->ppsz_list_text[i] )]; \ 221 if( p_item->value.psz && !strcmp( p_item->value.psz, p_item->ppsz_list[i] ) ) \ 222 y = i; \ 223 } \ 224 [object selectItemAtIndex: y] 225 161 226 /********************** 162 227 * interface settings * 163 228 **********************/ 164 [o_intf_lang_pop removeAllItems]; 165 p_item = config_FindConfig( VLC_OBJECT(p_intf), "language" ); 166 for( i = 0; p_item->ppsz_list[i] != nil; i++ ) 167 { 168 [o_intf_lang_pop addItemWithTitle: _NS( p_item->ppsz_list_text[i] )]; 169 if( p_item->value.psz && !strcmp( p_item->value.psz, p_item->ppsz_list[i] ) ) 170 y = i; 171 } 172 [o_intf_lang_pop selectItemAtIndex: y]; 173 174 [o_intf_art_pop removeAllItems]; 175 p_item = config_FindConfig( VLC_OBJECT(p_intf), "album-art" ); 176 for( i = 0; i < p_item->i_list; i++ ) 177 [o_intf_art_pop addItemWithTitle: _NS( p_item->ppsz_list_text[i] )]; 178 [o_intf_art_pop selectItemAtIndex: 0]; 179 [o_intf_art_pop selectItemAtIndex: p_item->value.i]; 229 SetupStringList( o_intf_lang_pop, "language" ); 230 SetupIntList( o_intf_art_pop, "album-art" ); 180 231 181 232 [o_intf_meta_ckb setState: config_GetInt( p_intf, "fetch-meta" )]; 182 233 [o_intf_fspanel_ckb setState: config_GetInt( p_intf, "macosx-fspanel" )]; 183 234 [o_intf_embedded_ckb setState: config_GetInt( p_intf, "embedded-video" )]; 184 185 235 186 236 /****************** … … 193 243 [o_audio_spdif_ckb setState: config_GetInt( p_intf, "spdif" )]; 194 244 195 [o_audio_dolby_pop removeAllItems]; 196 p_item = config_FindConfig( VLC_OBJECT(p_intf), "force-dolby-surround" ); 197 for( i = 0; i < p_item->i_list; i++ ) 198 [o_audio_dolby_pop addItemWithTitle: _NS( p_item->ppsz_list_text[i] )]; 199 [o_audio_dolby_pop selectItemAtIndex: 0]; 200 [o_audio_dolby_pop selectItemAtIndex: p_item->value.i]; 201 245 SetupIntList( o_audio_dolby_pop, "force-dolby-surround" ); 246 202 247 [o_audio_lang_fld setStringValue: [NSString stringWithUTF8String: config_GetPsz( p_intf, "audio-language" )]]; 203 248 … … 217 262 [o_audio_lastuser_fld setStringValue: [NSString stringWithUTF8String: config_GetPsz( p_intf, "lastfm-username" )]]; 218 263 [o_audio_lastpwd_fld setStringValue: [NSString stringWithUTF8String: config_GetPsz( p_intf, "lastfm-password" )]]; 219 264 220 265 if( config_ExistIntf( VLC_OBJECT( p_intf ), "audioscrobbler" ) ) 221 266 [o_audio_last_ckb setState: NSOnState]; … … 239 284 [o_video_snap_prefix_fld setStringValue: [NSString stringWithUTF8String: config_GetPsz( p_intf, "snapshot-prefix" )]]; 240 285 [o_video_snap_seqnum_ckb setState: config_GetInt( p_intf, "snapshot-sequential" )]; 241 [o_video_snap_format_pop removeAllItems];286 242 287 p_item = config_FindConfig( VLC_OBJECT(p_intf), "snapshot-format" ); 243 288 for( i = 0; p_item->ppsz_list[i] != nil; i++ ) … … 249 294 [o_video_snap_format_pop selectItemAtIndex: y]; 250 295 251 /******************* 252 * codecs settings * 253 *******************/ 296 /*************************** 297 * input & codecs settings * 298 ***************************/ 299 [o_input_serverport_fld setIntValue: config_GetInt( p_intf, "server-port" )]; 300 if( config_GetPsz( p_intf, "http-proxy" ) != NULL ) 301 [o_input_httpproxy_fld setStringValue: [NSString stringWithUTF8String: config_GetPsz( p_intf, "http-proxy" )]]; 302 [o_input_postproc_fld setIntValue: config_GetInt( p_intf, "ffmpeg-pp-q" )]; 303 304 SetupIntList( o_input_avi_pop, "avi-index" ); 305 306 [o_input_rtsp_ckb setState: config_GetInt( p_intf, "rtsp-tcp" )]; 307 308 psz_tmp = config_GetPsz( p_intf, "access-filter" ); 309 if( psz_tmp ) 310 { 311 [o_input_record_ckb setState: (int)strstr( psz_tmp, "record" )]; 312 [o_input_dump_ckb setState: (int)strstr( psz_tmp, "dump" )]; 313 [o_input_bandwidth_ckb setState: (int)strstr( psz_tmp, "bandwidth" )]; 314 [o_input_timeshift_ckb setState: (int)strstr( psz_tmp, "timeshift" )]; 315 } 316 317 [o_input_cachelevel_pop removeAllItems]; 318 [o_input_cachelevel_pop addItemsWithTitles: 319 [NSArray arrayWithObjects: _NS("Custom"), _NS("Lowest latency"), _NS("Low latency"), _NS("Normal"), 320 _NS("High latency"), _NS("Higher latency"), nil]]; 321 [[o_input_cachelevel_pop itemAtIndex: 0] setTag: 0]; 322 [[o_input_cachelevel_pop itemAtIndex: 1] setTag: 100]; 323 [[o_input_cachelevel_pop itemAtIndex: 2] setTag: 200]; 324 [[o_input_cachelevel_pop itemAtIndex: 3] setTag: 300]; 325 [[o_input_cachelevel_pop itemAtIndex: 4] setTag: 400]; 326 [[o_input_cachelevel_pop itemAtIndex: 5] setTag: 500]; 327 328 #define TestCaC( name ) \ 329 b_cache_equal = b_cache_equal && \ 330 ( i_cache == config_GetInt( p_intf, name ) ) 331 332 #define TestCaCi( name, int ) \ 333 b_cache_equal = b_cache_equal && \ 334 ( ( i_cache * int ) == config_GetInt( p_intf, name ) ) 335 336 /* Select the accurate value of the PopupButton */ 337 bool b_cache_equal = true; 338 int i_cache = config_GetInt( p_intf, "file-caching"); 339 340 TestCaC( "udp-caching" ); 341 if( module_Exists (p_intf, "dvdread") ) 342 TestCaC( "dvdread-caching" ); 343 if( module_Exists (p_intf, "dvdnav") ) 344 TestCaC( "dvdnav-caching" ); 345 TestCaC( "tcp-caching" ); 346 TestCaC( "fake-caching" ); 347 TestCaC( "cdda-caching" ); 348 TestCaC( "screen-caching" ); 349 TestCaC( "vcd-caching" ); 350 TestCaCi( "rtsp-caching", 4 ); 351 TestCaCi( "ftp-caching", 2 ); 352 TestCaCi( "http-caching", 4 ); 353 if(module_Exists (p_intf, "access_realrtsp")) 354 TestCaCi( "realrtsp-caching", 10 ); 355 TestCaCi( "mms-caching", 19 ); 356 if( b_cache_equal ) 357 [o_input_cachelevel_pop selectItemWithTag: i_cache]; 358 else 359 [o_input_cachelevel_pop selectItemWithTitle: _NS("Custom")]; 254 360 255 361 /********************* 256 362 * subtitle settings * 257 363 *********************/ 258 364 [o_osd_osd_ckb setState: config_GetInt( p_intf, "osd" )]; 365 366 [o_osd_encoding_pop removeAllItems]; 367 y = 0; 368 p_item = config_FindConfig( VLC_OBJECT(p_intf), "subsdec-encoding" ); 369 for( i = 0; p_item->ppsz_list[i] != nil; i++ ) 370 { 371 if( p_item->ppsz_list[i] != "" ) 372 [o_osd_encoding_pop addItemWithTitle: _NS( p_item->ppsz_list[i] )]; 373 else 374 [o_osd_encoding_pop addItemWithTitle: @" "]; 375 376 if( p_item->value.psz && !strcmp( p_item->value.psz, p_item->ppsz_list[i] ) ) 377 y = i; 378 } 379 [o_osd_encoding_pop selectItemAtIndex: y]; 380 381 [o_osd_lang_fld setStringValue: [NSString stringWithUTF8String: config_GetPsz( p_intf, "sub-language" )]]; 382 if( config_GetPsz( p_intf, "freetype-font" ) != NULL ) 383 [o_osd_font_fld setStringValue: [NSString stringWithUTF8String: config_GetPsz( p_intf, "freetype-font" )]]; 384 385 SetupIntList( o_osd_font_color_pop, "freetype-color" ); 386 SetupIntList( o_osd_font_size_pop, "freetype-rel-fontsize" ); 387 SetupIntList( o_osd_font_effect_pop, "freetype-effect" ); 388 259 389 /******************** 260 390 * hotkeys settings * … … 306 436 { 307 437 config_ResetAll( p_intf ); 308 b_intfSettingChanged , b_videoSettingChanged,b_audioSettingChanged = YES;438 b_intfSettingChanged = b_videoSettingChanged = b_audioSettingChanged = YES; 309 439 [self resetControls]; 310 440 } … … 317 447 int i; 318 448 449 #define SaveIntList( object, name ) \ 450 p_item = config_FindConfig( VLC_OBJECT(p_intf), name ); \ 451 if( [object indexOfSelectedItem] >= 0 ) \ 452 config_PutInt( p_intf, name, p_item->pi_list[[object indexOfSelectedItem]] ); \ 453 else \ 454 config_PutInt( p_intf, name, [object intValue] ) \ 455 456 #define SaveStringList( object, name ) \ 457 p_item = config_FindConfig( VLC_OBJECT(p_intf), name ); \ 458 if( [object indexOfSelectedItem] >= 0 ) \ 459 config_PutPsz( p_intf, name, strdup( p_item->ppsz_list[[object indexOfSelectedItem]] ) ); \ 460 else \ 461 config_PutPsz( p_intf, name, strdup( [[VLCMain sharedInstance] delocalizeString: [object stringValue]] ) ) 462 319 463 /********************** 320 464 * interface settings * … … 322 466 if( b_intfSettingChanged ) 323 467 { 324 p_item = config_FindConfig( VLC_OBJECT(p_intf), "language" ); 325 if( [o_intf_lang_pop indexOfSelectedItem] >= 0 ) 326 config_PutPsz( p_intf, "language", strdup( p_item->ppsz_list[[o_intf_lang_pop indexOfSelectedItem]] ) ); 327 else 328 config_PutPsz( p_intf, "language", strdup( [[VLCMain sharedInstance] delocalizeString: [o_intf_lang_pop stringValue]] ) ); 329 330 p_item = config_FindConfig( VLC_OBJECT(p_intf), "album-art" ); 331 if( [o_intf_art_pop indexOfSelectedItem] >= 0 ) 332 config_PutInt( p_intf, "album-art", p_item->pi_list[[o_intf_art_pop indexOfSelectedItem]] ); 333 else 334 config_PutInt( p_intf, "album-art", [o_intf_art_pop intValue] ); 468 SaveStringList( o_intf_lang_pop, "language" ); 469 SaveIntList( o_intf_art_pop, "album-art" ); 335 470 336 471 config_PutInt( p_intf, "fetch-meta", [o_intf_meta_ckb state] ); … … 360 495 config_PutInt( p_intf, "spdif", [o_audio_spdif_ckb state] ); 361 496 362 p_item = config_FindConfig( VLC_OBJECT(p_intf), "force-dolby-surround" ); 363 if( [o_audio_dolby_pop indexOfSelectedItem] >= 0 ) 364 config_PutInt( p_intf, "force-dolby-surround", p_item->pi_list[[o_audio_dolby_pop indexOfSelectedItem]] ); 365 else 366 config_PutInt( p_intf, "force-dolby-surround", [o_audio_dolby_pop intValue] ); 497 SaveIntList( o_audio_dolby_pop, "force-dolby-surround" ); 367 498 368 499 config_PutPsz( p_intf, "audio-language", [[o_audio_lang_fld stringValue] UTF8String] ); … … 391 522 /* Last.FM is optional */ 392 523 if( module_Exists( p_intf, "audioscrobbler" ) ) 393 { 524 { 394 525 if( [o_audio_last_ckb state] == NSOnState ) 395 526 config_AddIntf( VLC_OBJECT( p_intf ), "audioscrobbler" ); … … 436 567 i = config_SaveConfigFile( p_intf, "main" ); 437 568 i = i + config_SaveConfigFile( p_intf, "macosx" ); 438 569 439 570 if( i != 0 ) 440 571 { … … 444 575 b_videoSettingChanged = NO; 445 576 } 577 578 /*************************** 579 * input & codecs settings * 580 ***************************/ 581 if( b_inputSettingChanged ) 582 { 583 config_PutInt( p_intf, "server-port", [o_input_serverport_fld intValue] ); 584 config_PutPsz( p_intf, "http-proxy", [[o_input_httpproxy_fld stringValue] UTF8String] ); 585 config_PutInt( p_intf, "ffmpeg-pp-q", [o_input_postproc_fld intValue] ); 586 587 SaveIntList( o_input_avi_pop, "avi-index" ); 588 589 config_PutInt( p_intf, "rtsp-tcp", [o_input_rtsp_ckb state] ); 590 591 #define CaCi( name, int ) config_PutInt( p_intf, name, int * [[o_input_cachelevel_pop selectedItem] tag] ) 592 #define CaC( name ) CaCi( name, 1 ) 593 msg_Dbg( p_intf, "Adjusting all cache values at: %i", [[o_input_cachelevel_pop selectedItem] tag] ); 594 CaC( "udp-caching" ); 595 if( module_Exists (p_intf, "dvdread" ) ) 596 { 597 CaC( "dvdread-caching" ); 598 i = i + config_SaveConfigFile( p_intf, "dvdread" ); 599 } 600 if( module_Exists (p_intf, "dvdnav" ) ) 601 { 602 CaC( "dvdnav-caching" ); 603 i = i + config_SaveConfigFile( p_intf, "dvdnav" ); 604 } 605 CaC( "tcp-caching" ); CaC( "vcd-caching" ); 606 CaC( "fake-caching" ); CaC( "cdda-caching" ); CaC( "file-caching" ); 607 CaC( "screen-caching" ); 608 CaCi( "rtsp-caching", 4 ); CaCi( "ftp-caching", 2 ); 609 CaCi( "http-caching", 4 ); 610 if( module_Exists (p_intf, "access_realrtsp" ) ) 611 { 612 CaCi( "realrtsp-caching", 10 ); 613 i = i + config_SaveConfigFile( p_intf, "access_realrtsp" ); 614 } 615 CaCi( "mms-caching", 19 ); 616 617 #define SaveAccessFilter( object, name ) \ 618 if( [object state] == NSOnState ) \ 619 { \ 620 if( b_first ) \ 621 { \ 622 [o_temp appendString: name]; \ 623 b_first = NO; \ 624 } \ 625 else \ 626 [o_temp appendFormat: @":%@", name]; \ 627 } 628 629 BOOL b_first = YES; 630 NSMutableString *o_temp = [[NSMutableString alloc] init]; 631 SaveAccessFilter( o_input_record_ckb, @"record" ); 632 SaveAccessFilter( o_input_dump_ckb, @"dump" ); 633 SaveAccessFilter( o_input_bandwidth_ckb, @"bandwidth" ); 634 SaveAccessFilter( o_input_timeshift_ckb, @"timeshift" ); 635 config_PutPsz( p_intf, "access-filter", [o_temp UTF8String] ); 636 [o_temp release]; 637 638 i = config_SaveConfigFile( p_intf, "main" ); 639 i = i + config_SaveConfigFile( p_intf, "ffmpeg" ); 640 i = i + config_SaveConfigFile( p_intf, "access_http" ); 641 i = i + config_SaveConfigFile( p_intf, "access_file" ); 642 i = i + config_SaveConfigFile( p_intf, "access_tcp" ); 643 i = i + config_SaveConfigFile( p_intf, "access_fake" ); 644 i = i + config_SaveConfigFile( p_intf, "cdda" ); 645 i = i + config_SaveConfigFile( p_intf, "screen" ); 646 i = i + config_SaveConfigFile( p_intf, "vcd" ); 647 i = i + config_SaveConfigFile( p_intf, "access_ftp" ); 648 i = i + config_SaveConfigFile( p_intf, "access_mms" ); 649 i = i + config_SaveConfigFile( p_intf, "live555" ); 650 651 if( i != 0 ) 652 { 653 msg_Err( p_intf, "An error occured while saving the Input settings using SimplePrefs" ); 654 i = 0; 655 } 656 b_inputSettingChanged = NO; 657 } 658 659 /********************** 660 * subtitles settings * 661 **********************/ 662 if( b_osdSettingChanged ) 663 { 664 config_PutInt( p_intf, "osd", [o_osd_osd_ckb state] ); 665 666 if( [o_osd_encoding_pop indexOfSelectedItem] >= 0 ) 667 config_PutPsz( p_intf, "subsdec-encoding", [[[o_osd_encoding_pop selectedItem] title] UTF8String] ); 668 669 config_PutPsz( p_intf, "sub-language", [[o_osd_lang_fld stringValue] UTF8String] ); 670 config_PutPsz( p_intf, "freetype-font", [[o_osd_font_fld stringValue] UTF8String] ); 671 672 SaveIntList( o_osd_font_color_pop, "freetype-color" ); 673 SaveIntList( o_osd_font_size_pop, "freetype-rel-fontsize" ); 674 SaveIntList( o_osd_font_effect_pop, "freetype-effect" ); 675 676 i = config_SaveConfigFile( p_intf, NULL ); 677 678 if( i != 0 ) 679 { 680 msg_Err( p_intf, "An error occured while saving the OSD/Subtitle settings using SimplePrefs" ); 681 i = 0; 682 } 683 b_osdSettingChanged = NO; 684 } 685 686 /******************** 687 * hotkeys settings * 688 ********************/ 446 689 } 447 690 … … 457 700 o_old_view_rect = [o_currentlyShownCategoryView frame]; 458 701 o_win_rect.size.height = o_win_rect.size.height - o_old_view_rect.size.height; 459 702 460 703 /* remove our previous category view */ 461 704 [o_currentlyShownCategoryView removeFromSuperviewWithoutNeedingDisplay]; … … 518 761 [o_selectFolderPanel setResolvesAliases: YES]; 519 762 [o_selectFolderPanel setAllowsMultipleSelection: NO]; 520 [o_selectFolderPanel setMessage: _NS("Choose the Folder to save your video snapshots to.")];763 [o_selectFolderPanel setMessage: _NS("Choose the folder to save your video snapshots to.")]; 521 764 [o_selectFolderPanel setCanCreateDirectories: YES]; 522 765 [o_selectFolderPanel setPrompt: _NS("Choose")]; … … 524 767 modalDelegate: self 525 768 didEndSelector: @selector(savePanelDidEnd:returnCode:contextInfo:) 526 contextInfo: nil];769 contextInfo: o_video_snap_folder_btn]; 527 770 } 528 771 else … … 534 777 if( returnCode == NSOKButton ) 535 778 { 536 [o_video_snap_folder_fld setStringValue: [o_selectFolderPanel filename]]; 537 b_videoSettingChanged = YES; 779 if( contextInfo == o_video_snap_folder_btn ) 780 { 781 [o_video_snap_folder_fld setStringValue: [o_selectFolderPanel filename]]; 782 b_videoSettingChanged = YES; 783 } 784 else if( contextInfo == o_osd_font_btn ) 785 { 786 [o_osd_font_fld setStringValue: [o_selectFolderPanel filename]]; 787 b_osdSettingChanged = YES; 788 } 538 789 } 539 790 … … 546 797 [self showSettingsForCategory: o_video_view]; 547 798 } 799 800 - (IBAction)osdSettingChanged:(id)sender 801 { 802 if( sender == o_osd_font_btn ) 803 { 804 o_selectFolderPanel = [[NSOpenPanel alloc] init]; 805 [o_selectFolderPanel setCanChooseDirectories: NO]; 806 [o_selectFolderPanel setCanChooseFiles: YES]; 807 [o_selectFolderPanel setResolvesAliases: YES]; 808 [o_selectFolderPanel setAllowsMultipleSelection: NO]; 809 [o_selectFolderPanel setMessage: _NS("Choose the font to display your Subtitles with.")]; 810 [o_selectFolderPanel setCanCreateDirectories: NO]; 811 [o_selectFolderPanel setPrompt: _NS("Choose")]; 812 [o_selectFolderPanel setAllowedFileTypes: [NSArray arrayWithObjects: @"dfont", @"ttf", @"otf", @"FFIL", nil]]; 813 [o_selectFolderPanel beginSheetForDirectory: @"/System/Library/Fonts/" file: nil modalForWindow: o_sprefs_win 814 modalDelegate: self 815 didEndSelector: @selector(savePanelDidEnd:returnCode:contextInfo:) 816 contextInfo: o_osd_font_btn]; 817 } 818 else 819 b_osdSettingChanged = YES; 820 } 821 822 - (void)showOSDSettings 823 { 824 msg_Dbg( p_intf, "showing OSD settings" ); 825 [self showSettingsForCategory: o_osd_view]; 826 } 827 828 - (IBAction)inputSettingChanged:(id)sender 829 { 830 b_inputSettingChanged = YES; 831 } 832 833 - (void)showInputSettings 834 { 835 msg_Dbg( p_intf, "showing Input Settings" ); 836 [self showSettingsForCategory: o_input_view]; 837 } 838 548 839 @end
