+
+ /******************
+ * video settings *
+ ******************/
+ if( b_videoSettingChanged )
+ {
+ config_PutInt( p_intf, "video", [o_video_enable_ckb state] );
+ config_PutInt( p_intf, "fullscreen", [o_video_fullscreen_ckb state] );
+ config_PutInt( p_intf, "video-on-top", [o_video_onTop_ckb state] );
+ config_PutInt( p_intf, "skip-frames", [o_video_skipFrames_ckb state] );
+ config_PutInt( p_intf, "macosx-black", [o_video_black_ckb state] );
+
+ SaveModuleList( o_video_output_pop, "vout" );
+ config_PutInt( p_intf, "macosx-vdev", [[o_video_device_pop selectedItem] tag] );
+
+ config_PutPsz( p_intf, "snapshot-path", [[o_video_snap_folder_fld stringValue] UTF8String] );
+ config_PutPsz( p_intf, "snapshot-prefix", [[o_video_snap_prefix_fld stringValue] UTF8String] );
+ config_PutInt( p_intf, "snapshot-sequential", [o_video_snap_seqnum_ckb state] );
+ SaveStringList( o_video_snap_format_pop, "snapshot-format" );
+
+ i = config_SaveConfigFile( p_intf, "main" );
+ i = i + config_SaveConfigFile( p_intf, "macosx" );
+
+ if( i != 0 )
+ {
+ msg_Err( p_intf, "An error occurred while saving the Video settings using SimplePrefs (%i)", i );
+ intf_UserFatal( p_intf, false, _("Video Settings not saved"),
+ _("An error occured while saving your settings via SimplePrefs (%i)."), i );
+ i = 0;
+ }
+ b_videoSettingChanged = NO;
+ }
+
+ /***************************
+ * input & codecs settings *
+ ***************************/
+ if( b_inputSettingChanged )
+ {
+ config_PutInt( p_intf, "server-port", [o_input_serverport_fld intValue] );
+ config_PutPsz( p_intf, "http-proxy", [[o_input_httpproxy_fld stringValue] UTF8String] );
+ config_PutPsz( p_intf, "http-proxy-pwd", [[o_input_httpproxypwd_sfld stringValue] UTF8String] );
+ config_PutInt( p_intf, "ffmpeg-pp-q", [o_input_postproc_fld intValue] );
+
+ SaveIntList( o_input_avi_pop, "avi-index" );
+
+ config_PutInt( p_intf, "rtsp-tcp", [o_input_rtsp_ckb state] );
+
+ #define CaCi( name, int ) config_PutInt( p_intf, name, int * [[o_input_cachelevel_pop selectedItem] tag] )
+ #define CaC( name ) CaCi( name, 1 )
+ msg_Dbg( p_intf, "Adjusting all cache values to: %i", [[o_input_cachelevel_pop selectedItem] tag] );
+ CaC( "udp-caching" );
+ if( module_Exists (p_intf, "dvdread" ) )
+ {
+ CaC( "dvdread-caching" );
+ i = i + config_SaveConfigFile( p_intf, "dvdread" );
+ }
+ if( module_Exists (p_intf, "dvdnav" ) )
+ {
+ CaC( "dvdnav-caching" );
+ i = i + config_SaveConfigFile( p_intf, "dvdnav" );
+ }
+ CaC( "tcp-caching" ); CaC( "vcd-caching" );
+ CaC( "fake-caching" ); CaC( "cdda-caching" ); CaC( "file-caching" );
+ CaC( "screen-caching" );
+ CaCi( "rtsp-caching", 4 ); CaCi( "ftp-caching", 2 );
+ CaCi( "http-caching", 4 );
+ if( module_Exists (p_intf, "access_realrtsp" ) )
+ {
+ CaCi( "realrtsp-caching", 10 );
+ i = i + config_SaveConfigFile( p_intf, "access_realrtsp" );
+ }
+ CaCi( "mms-caching", 19 );
+
+ #define SaveAccessFilter( object, name ) \
+ if( [object state] == NSOnState ) \
+ { \
+ if( b_first ) \
+ { \
+ [o_temp appendString: name]; \
+ b_first = NO; \
+ } \
+ else \
+ [o_temp appendFormat: @":%@", name]; \
+ }
+
+ BOOL b_first = YES;
+ NSMutableString *o_temp = [[NSMutableString alloc] init];
+ SaveAccessFilter( o_input_record_ckb, @"record" );
+ SaveAccessFilter( o_input_dump_ckb, @"dump" );
+ SaveAccessFilter( o_input_bandwidth_ckb, @"bandwidth" );
+ SaveAccessFilter( o_input_timeshift_ckb, @"timeshift" );
+ config_PutPsz( p_intf, "access-filter", [o_temp UTF8String] );
+ [o_temp release];
+
+ i = config_SaveConfigFile( p_intf, "main" );
+ i = i + config_SaveConfigFile( p_intf, "ffmpeg" );
+ i = i + config_SaveConfigFile( p_intf, "access_http" );
+ i = i + config_SaveConfigFile( p_intf, "access_file" );
+ i = i + config_SaveConfigFile( p_intf, "access_tcp" );
+ i = i + config_SaveConfigFile( p_intf, "access_fake" );
+ i = i + config_SaveConfigFile( p_intf, "cdda" );
+ i = i + config_SaveConfigFile( p_intf, "screen" );
+ i = i + config_SaveConfigFile( p_intf, "vcd" );
+ i = i + config_SaveConfigFile( p_intf, "access_ftp" );
+ i = i + config_SaveConfigFile( p_intf, "access_mms" );
+ i = i + config_SaveConfigFile( p_intf, "live555" );
+
+ if( i != 0 )
+ {
+ msg_Err( p_intf, "An error occurred while saving the Input settings using SimplePrefs (%i)", i );
+ intf_UserFatal( p_intf, false, _("Input Settings not saved"),
+ _("An error occured while saving your settings via SimplePrefs (%i)."), i );
+ i = 0;
+ }
+ b_inputSettingChanged = NO;
+ }
+
+ /**********************
+ * subtitles settings *
+ **********************/
+ if( b_osdSettingChanged )
+ {
+ config_PutInt( p_intf, "osd", [o_osd_osd_ckb state] );
+
+ if( [o_osd_encoding_pop indexOfSelectedItem] >= 0 )
+ config_PutPsz( p_intf, "subsdec-encoding", [[[o_osd_encoding_pop selectedItem] title] UTF8String] );
+
+ config_PutPsz( p_intf, "sub-language", [[o_osd_lang_fld stringValue] UTF8String] );
+ config_PutPsz( p_intf, "quartztext-font", [[o_osd_font_fld stringValue] UTF8String] );
+
+ SaveIntList( o_osd_font_color_pop, "quartztext-color" );
+ SaveIntList( o_osd_font_size_pop, "quartztext-rel-fontsize" );
+
+ i = config_SaveConfigFile( p_intf, NULL );
+
+ if( i != 0 )
+ {
+ msg_Err( p_intf, "An error occurred while saving the OSD/Subtitle settings using SimplePrefs (%i)", i );
+ intf_UserFatal( p_intf, false, _("On Screen Display/Subtitle Settings not saved"),
+ _("An error occured while saving your settings via SimplePrefs (%i)."), i );
+ i = 0;
+ }
+ b_osdSettingChanged = NO;
+ }
+
+ /********************
+ * hotkeys settings *
+ ********************/
+ if( b_hotkeyChanged )
+ {
+ struct hotkey *p_hotkeys = p_intf->p_libvlc->p_hotkeys;
+ i = 1;
+ while( i < [o_hotkeySettings count] )
+ {
+ config_PutInt( p_intf, p_hotkeys[i].psz_action, [[o_hotkeySettings objectAtIndex: i-1] intValue] );
+ i++;
+ }
+
+ i = config_SaveConfigFile( p_intf, "main" );
+
+ if( i != 0 )
+ {
+ msg_Err( p_intf, "An error occurred while saving the Hotkey settings using SimplePrefs (%i)", i );
+ intf_UserFatal( p_intf, false, _("Hotkeys not saved"),
+ _("An error occured while saving your settings via SimplePrefs (%i)."), i );
+ i = 0;
+ }
+ b_hotkeyChanged = NO;
+ }