Changeset 887efa47545fa1e6b08acdb1d1a026049bbafe75

Show
Ignore:
Timestamp:
27/02/08 22:30:20 (8 months ago)
Author:
Felix Paul Kühne <fkuehne@videolan.org>
git-committer:
Felix Paul Kühne <fkuehne@videolan.org> 1204147820 +0000
git-parent:

[9ab3a0540fa0d21cc18116bbd5fc03cd21e3a0fc]

git-author:
Felix Paul Kühne <fkuehne@videolan.org> 1204147820 +0000
Message:

macosx: Implemented the Subs/OSD and Input categories of the Simple Prefs

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • extras/package/macosx/Resources/English.lproj/Preferences.nib/classes.nib

    r343baae r887efa4  
    2828                audioSettingChanged = id;  
    2929                buttonAction = id;  
     30                inputSettingChanged = id;  
    3031                interfaceSettingChanged = id;  
     32                osdSettingChanged = id;  
    3133                videoSettingChanged = id;  
    3234            };  
     
    5759                "o_audio_vol_sld" = id;  
    5860                "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;  
    5981                "o_intf_art_pop" = id;  
    6082                "o_intf_art_txt" = id;  
     
    6688                "o_intf_network_box" = id;  
    6789                "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;  
    68108                "o_sprefs_basicFull_matrix" = id;  
    69109                "o_sprefs_basic_box" = id;  
  • extras/package/macosx/Resources/English.lproj/Preferences.nib/info.nib

    r343baae r887efa4  
    44<dict> 
    55    <key>IBDocumentLocation</key> 
    6     <string>113 117 505 518 0 0 1280 778 </string> 
     6    <string>391 94 505 518 0 0 1280 778 </string> 
    77    <key>IBEditorPositions</key> 
    88    <dict> 
     
    1010        <string>345 406 590 264 0 0 1280 778 </string> 
    1111        <key>2330</key> 
    12         <string>450 263 590 502 0 0 1280 778 </string> 
     12        <string>345 266 590 502 0 0 1280 778 </string> 
    1313        <key>2440</key> 
    1414        <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> 
    1519    </dict> 
    1620    <key>IBFramework Version</key> 
     
    2529    </dict> 
    2630    <key>IBLastGroupID</key> 
    27     <string>2</string> 
     31    <string>3</string> 
    2832    <key>IBLockedObjects</key> 
    2933    <array> 
     
    3539    <key>IBOpenObjects</key> 
    3640    <array> 
     41        <integer>2265</integer> 
     42        <integer>2523</integer> 
     43        <integer>2562</integer> 
     44        <integer>2440</integer> 
    3745        <integer>2311</integer> 
    38         <integer>2440</integer> 
    39         <integer>2265</integer> 
    40         <integer>2330</integer> 
    4146    </array> 
    4247    <key>IBSystem Version</key> 
  • modules/gui/macosx/simple_prefs.h

    r343baae r887efa4  
    5252    IBOutlet id o_audio_vol_txt; 
    5353 
     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 
    5475    IBOutlet id o_intf_art_pop; 
    5576    IBOutlet id o_intf_art_txt; 
     
    6182    IBOutlet id o_intf_network_box; 
    6283    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; 
    63103 
    64104    IBOutlet id o_sprefs_basic_box; 
     
    94134    BOOL b_intfSettingChanged; 
    95135    BOOL b_videoSettingChanged; 
     136    BOOL b_osdSettingChanged; 
     137    BOOL b_inputSettingChanged; 
    96138    id o_currentlyShownCategoryView; 
    97      
     139 
    98140    NSToolbar *o_sprefs_toolbar; 
    99141    NSOpenPanel *o_selectFolderPanel; 
    100      
     142 
    101143    intf_thread_t *p_intf; 
    102144} 
     
    133175- (void)showVideoSettings; 
    134176 
    135 /* subtitles */ 
     177/* OSD / subtitles */ 
     178- (IBAction)osdSettingChanged:(id)sender; 
     179- (void)showOSDSettings; 
    136180 
    137181/* input & codecs */ 
     182- (IBAction)inputSettingChanged:(id)sender; 
     183- (void)showInputSettings; 
    138184 
    139185/* hotkeys */ 
  • modules/gui/macosx/simple_prefs.m

    r6cf432c r887efa4  
    2929static NSString* VLCAudioSettingToolbarIdentifier = @"Audio Settings Item Identifier"; 
    3030static NSString* VLCVideoSettingToolbarIdentifier = @"Video Settings Item Identifier"; 
     31static NSString* VLCOSDSettingToolbarIdentifier = @"Subtitles Settings Item Identifier"; 
     32static NSString* VLCInputSettingToolbarIdentifier = @"Input Settings Item Identifier"; 
     33static NSString* VLCHotkeysSettingToolbarIdentifier = @"Hotkeys Settings Item Identifier"; 
    3134 
    3235@implementation VLCSimplePrefs 
     
    116119    { 
    117120        o_toolbarItem = [[[NSToolbarItem alloc] initWithItemIdentifier: o_itemIdent] autorelease]; 
    118          
     121 
    119122        [o_toolbarItem setLabel: _NS("Video")]; 
    120123        [o_toolbarItem setPaletteLabel: _NS("General Video settings")]; 
    121          
     124 
    122125        [o_toolbarItem setToolTip: _NS("General Video settings")]; 
    123126        [o_toolbarItem setImage: [NSImage imageNamed: @"spref_cone_Video_64"]]; 
    124          
     127 
    125128        [o_toolbarItem setTarget: self]; 
    126129        [o_toolbarItem setAction: @selector(showVideoSettings)]; 
    127          
     130 
    128131        [o_toolbarItem setEnabled: YES]; 
    129132        [o_toolbarItem setAutovalidates: YES]; 
    130133    } 
    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 
    132167    return o_toolbarItem; 
    133168} 
     
    135170- (NSArray *)toolbarDefaultItemIdentifiers: (NSToolbar *)toolbar 
    136171{ 
    137     return [NSArray arrayWithObjects: VLCIntfSettingToolbarIdentifier, VLCAudioSettingToolbarIdentifier, VLCVideoSettingToolbarIdentifier, NSToolbarFlexibleSpaceItemIdentifier, nil]; 
     172    return [NSArray arrayWithObjects: VLCIntfSettingToolbarIdentifier, VLCAudioSettingToolbarIdentifier, VLCVideoSettingToolbarIdentifier,  
     173        VLCOSDSettingToolbarIdentifier, VLCInputSettingToolbarIdentifier, NSToolbarFlexibleSpaceItemIdentifier, nil]; 
    138174} 
    139175 
    140176- (NSArray *)toolbarAllowedItemIdentifiers: (NSToolbar *)toolbar 
    141177{ 
    142     return [NSArray arrayWithObjects: VLCIntfSettingToolbarIdentifier, VLCAudioSettingToolbarIdentifier, VLCVideoSettingToolbarIdentifier, NSToolbarFlexibleSpaceItemIdentifier, nil]; 
     178    return [NSArray arrayWithObjects: VLCIntfSettingToolbarIdentifier, VLCAudioSettingToolbarIdentifier, VLCVideoSettingToolbarIdentifier,  
     179        VLCOSDSettingToolbarIdentifier, VLCInputSettingToolbarIdentifier, NSToolbarFlexibleSpaceItemIdentifier, nil]; 
    143180} 
    144181 
    145182- (NSArray *)toolbarSelectableItemIdentifiers:(NSToolbar *)toolbar 
    146183{ 
    147     return [NSArray arrayWithObjects: VLCIntfSettingToolbarIdentifier, VLCAudioSettingToolbarIdentifier, VLCVideoSettingToolbarIdentifier, nil]; 
     184    return [NSArray arrayWithObjects: VLCIntfSettingToolbarIdentifier, VLCAudioSettingToolbarIdentifier, VLCVideoSettingToolbarIdentifier,  
     185        VLCOSDSettingToolbarIdentifier, VLCInputSettingToolbarIdentifier, nil]; 
    148186} 
    149187 
    150188- (void)initStrings 
    151189{ 
    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!" ); 
    153191} 
    154192 
     
    159197    char *psz_tmp; 
    160198 
     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 
    161226    /********************** 
    162227     * interface settings * 
    163228     **********************/ 
    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" ); 
    180231 
    181232    [o_intf_meta_ckb setState: config_GetInt( p_intf, "fetch-meta" )]; 
    182233    [o_intf_fspanel_ckb setState: config_GetInt( p_intf, "macosx-fspanel" )]; 
    183234    [o_intf_embedded_ckb setState: config_GetInt( p_intf, "embedded-video" )]; 
    184  
    185235 
    186236    /****************** 
     
    193243    [o_audio_spdif_ckb setState: config_GetInt( p_intf, "spdif" )]; 
    194244 
    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 
    202247    [o_audio_lang_fld setStringValue: [NSString stringWithUTF8String: config_GetPsz( p_intf, "audio-language" )]]; 
    203248 
     
    217262        [o_audio_lastuser_fld setStringValue: [NSString stringWithUTF8String: config_GetPsz( p_intf, "lastfm-username" )]]; 
    218263        [o_audio_lastpwd_fld setStringValue: [NSString stringWithUTF8String: config_GetPsz( p_intf, "lastfm-password" )]]; 
    219          
     264 
    220265        if( config_ExistIntf( VLC_OBJECT( p_intf ), "audioscrobbler" ) ) 
    221266            [o_audio_last_ckb setState: NSOnState]; 
     
    239284    [o_video_snap_prefix_fld setStringValue: [NSString stringWithUTF8String: config_GetPsz( p_intf, "snapshot-prefix" )]]; 
    240285    [o_video_snap_seqnum_ckb setState: config_GetInt( p_intf, "snapshot-sequential" )]; 
    241     [o_video_snap_format_pop removeAllItems]; 
     286     
    242287    p_item = config_FindConfig( VLC_OBJECT(p_intf), "snapshot-format" ); 
    243288    for( i = 0; p_item->ppsz_list[i] != nil; i++ ) 
     
    249294    [o_video_snap_format_pop selectItemAtIndex: y]; 
    250295 
    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")]; 
    254360 
    255361    /********************* 
    256362     * subtitle settings * 
    257363     *********************/ 
    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 
    259389    /******************** 
    260390     * hotkeys settings * 
     
    306436    { 
    307437        config_ResetAll( p_intf ); 
    308         b_intfSettingChanged, b_videoSettingChanged, b_audioSettingChanged = YES; 
     438        b_intfSettingChanged = b_videoSettingChanged = b_audioSettingChanged = YES; 
    309439        [self resetControls]; 
    310440    } 
     
    317447    int i; 
    318448     
     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 
    319463    /********************** 
    320464     * interface settings * 
     
    322466    if( b_intfSettingChanged ) 
    323467    { 
    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" ); 
    335470 
    336471        config_PutInt( p_intf, "fetch-meta", [o_intf_meta_ckb state] ); 
     
    360495        config_PutInt( p_intf, "spdif", [o_audio_spdif_ckb state] ); 
    361496 
    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" ); 
    367498 
    368499        config_PutPsz( p_intf, "audio-language", [[o_audio_lang_fld stringValue] UTF8String] ); 
     
    391522        /* Last.FM is optional */ 
    392523        if( module_Exists( p_intf, "audioscrobbler" ) ) 
    393         {             
     524        {     
    394525            if( [o_audio_last_ckb state] == NSOnState ) 
    395526                config_AddIntf( VLC_OBJECT( p_intf ), "audioscrobbler" ); 
     
    436567        i = config_SaveConfigFile( p_intf, "main" ); 
    437568        i = i + config_SaveConfigFile( p_intf, "macosx" ); 
    438          
     569 
    439570        if( i != 0 ) 
    440571        { 
     
    444575        b_videoSettingChanged = NO; 
    445576    } 
     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     ********************/ 
    446689} 
    447690 
     
    457700        o_old_view_rect = [o_currentlyShownCategoryView frame]; 
    458701        o_win_rect.size.height = o_win_rect.size.height - o_old_view_rect.size.height; 
    459          
     702 
    460703        /* remove our previous category view */ 
    461704        [o_currentlyShownCategoryView removeFromSuperviewWithoutNeedingDisplay]; 
     
    518761        [o_selectFolderPanel setResolvesAliases: YES]; 
    519762        [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.")]; 
    521764        [o_selectFolderPanel setCanCreateDirectories: YES]; 
    522765        [o_selectFolderPanel setPrompt: _NS("Choose")]; 
     
    524767                                      modalDelegate: self  
    525768                                     didEndSelector: @selector(savePanelDidEnd:returnCode:contextInfo:) 
    526                                         contextInfo: nil]; 
     769                                        contextInfo: o_video_snap_folder_btn]; 
    527770    } 
    528771    else 
     
    534777    if( returnCode == NSOKButton ) 
    535778    { 
    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        } 
    538789    } 
    539790 
     
    546797    [self showSettingsForCategory: o_video_view]; 
    547798} 
     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 
    548839@end