+ (VLCAudioEffects *)sharedInstance;
- (IBAction)toggleWindow:(id)sender;
- (void)setAudioFilter: (char *)psz_name on:(BOOL)b_on;
-- (void)savePrefs;
/* Equalizer */
- (void)setupEqualizer;
}
}
-- (void)savePrefs
-{
- /* save settings for some of our modules */
- int returnedValue;
- NSArray * theModules;
- theModules = [[NSArray alloc] initWithObjects: @"main", @"headphone", @"normvol", @"headphone_channel_mixer", @"compressor", @"spatializer", nil];
-
- for( int x = 0; x < [theModules count]; x++ )
- {
- returnedValue = config_SaveConfigFile( p_intf, [[theModules objectAtIndex: x] UTF8String] );
-
- if (returnedValue != 0)
- msg_Err(p_intf, "unable to save settings for '%s' (%i)", [[theModules objectAtIndex: x] UTF8String], returnedValue);
- }
-
- msg_Dbg(p_intf, "AudioFilters: saved certain preferences successfully");
- [theModules release];
-}
-
#pragma mark -
#pragma mark Equalizer
static bool GetEqualizerStatus( intf_thread_t *p_custom_intf,
{
/* save changed to config */
config_PutPsz( p_intf, "equalizer-bands", psz_values );
-
- /* save to vlcrc */
- config_SaveConfigFile( p_intf, "equalizer" );
}
vlc_object_release( p_object );
config_PutPsz( p_intf, "equalizer-bands", psz_values );
config_PutFloat( p_intf, "equalizer-preamp", eqz_preset_10b[[sender indexOfSelectedItem]]->f_preamp );
config_PutPsz( p_intf, "equalizer-preset", preset_list[[sender indexOfSelectedItem]] );
-
- /* save to vlcrc */
- config_SaveConfigFile( p_intf, "equalizer" );
}
vlc_object_release( p_object );
{
/* save changed to config */
config_PutFloat( p_intf, "equalizer-preamp", f_preamp );
-
- /* save to vlcrc */
- config_SaveConfigFile( p_intf, "equalizer" );
}
vlc_object_release( p_object );
{
/* save changed to config */
config_PutInt( p_intf, "equalizer-2pass", (int)b_2p );
-
- /* save to vlcrc */
- config_SaveConfigFile( p_intf, "equalizer" );
}
vlc_object_release( p_object );
{
/* save changed to config */
config_PutPsz( p_intf, "equalizer-bands", psz_values );
-
- /* save to vlcrc */
- config_SaveConfigFile( p_intf, "equalizer" );
}
vlc_object_release( p_object );
config_PutPsz( p_intf, "equalizer-bands", psz_values );
config_PutFloat( p_intf, "equalizer-preamp", eqz_preset_10b[[sender indexOfSelectedItem]]->f_preamp );
config_PutPsz( p_intf, "equalizer-preset", preset_list[[sender indexOfSelectedItem]] );
-
- /* save to vlcrc */
- config_SaveConfigFile( p_intf, "equalizer" );
}
vlc_object_release( p_object );
{
/* save changed to config */
config_PutFloat( p_intf, "equalizer-preamp", f_preamp );
-
- /* save to vlcrc */
- config_SaveConfigFile( p_intf, "equalizer" );
}
vlc_object_release( p_object );
{
/* save changed to config */
config_PutInt( p_intf, "equalizer-2pass", (int)b_2p );
-
- /* save to vlcrc */
- config_SaveConfigFile( p_intf, "equalizer" );
}
vlc_object_release( p_object );
/* global variables */
NSView * o_currentlyshown_view;
- BOOL o_config_changed;
}
- (IBAction)viewSelectorAction:(id)sender;
- (IBAction)moreInfoVideoFilters:(id)sender;
+ (VLCExtended *)sharedInstance;
-- (BOOL)configChanged;
- (void)showPanel;
- (void)initStrings;
- (void)changeVoutFiltersString: (char *)psz_name onOrOff: (bool )b_add;
- (void)changeVideoFiltersString: (char *)psz_name onOrOff: (bool )b_add;
- (void)changeAFiltersString: (char *)psz_name onOrOff: (bool )b_add;
-- (void)savePrefs;
@end
[self initStrings];
}
-- (BOOL)configChanged
-{
- return o_config_changed;
-}
-
- (void)showPanel
{
/* get the correct slider values from the prefs, in case they were changed
vlc_object_release( p_filter );
vlc_object_release( p_vout );
}
-
- o_config_changed = YES;
}
/* change the opaqueness of the vouts */
/* store to prefs */
config_PutFloat( p_playlist , "macosx-opaqueness" , val.f_float );
-
- o_config_changed = YES;
}
- (IBAction)enableHeadphoneVirtualizer:(id)sender
}
config_PutFloat( p_intf, "norm-max-level", [o_sld_maxLevel floatValue] );
-
- o_config_changed = YES;
}
- (IBAction)enableVolumeNormalization:(id)sender
}
free( psz_string );
-
- o_config_changed = YES;
}
-
- (void)changeVideoFiltersString:(char *)psz_name onOrOff:(bool )b_add
{
/* same as changeVoutFiltersString but addressing the "video-filter"
}
free( psz_string );
-
- o_config_changed = YES;
}
- (void)changeAFiltersString: (char *)psz_name onOrOff: (bool )b_add;
aout_EnableFilter( pl_Get( p_intf ), psz_string, b_add );
}
free( psz_string );
-
- o_config_changed = YES;
-}
-
-- (void)savePrefs
-{
- /* save the preferences to make sure that our module-changes will up on
- * next launch again */
- playlist_t * p_playlist = pl_Get( VLCIntf );
- int returnedValue;
- NSArray * theModules;
- theModules = [[NSArray alloc] initWithObjects: @"main",
- @"headphone",
- @"transform",
- @"adjust",
- @"invert",
- @"motionblur",
- @"distort",
- @"clone",
- @"crop",
- @"normvol",
- @"headphone_channel_mixer",
- @"macosx",
- nil];
- unsigned int x = 0;
-
- while ( x != [theModules count] )
- {
- returnedValue = config_SaveConfigFile( p_playlist, [[theModules
- objectAtIndex: x] UTF8String] );
-
- if (returnedValue != 0)
- {
- msg_Err(p_playlist, "unable to save the preferences of the "
- "extended control attribute '%s' (%i)",
- [[theModules objectAtIndex: x] UTF8String] , returnedValue);
- [theModules release];
-
- return;
- }
-
- x = ( x + 1 );
- }
-
- msg_Dbg( VLCIntf, "VLCExtended: saved certain preferences successfully" );
-
- [theModules release];
}
@end
/* make sure that the current volume is saved */
config_PutInt( p_intf->p_libvlc, "volume", i_lastShownVolume );
- /* save the prefs if they were changed in the extended panel */
- if(o_extended && [o_extended configChanged])
- [o_extended savePrefs];
- [o_audioeffects savePrefs];
-
/* unsubscribe from the interactive dialogues */
dialog_Unregister( p_intf );
var_DelCallback( p_intf, "dialog-error", DialogCallback, self );
{
/* TODO: call savePrefs on Root item */
[_rootTreeItem applyChanges];
- config_SaveConfigFile( p_intf, NULL );
+ config_SaveConfigFile( p_intf );
[o_prefs_window orderOut:self];
}
{
config_ResetAll( p_intf );
[self resetControls];
- config_SaveConfigFile( p_intf, NULL );
+ config_SaveConfigFile( p_intf );
}
}
- (void)saveChangedSettings
{
char *psz_tmp;
- int i;
#define SaveIntList( object, name ) save_int_list( p_intf, object, name )
[[NSNotificationCenter defaultCenter] postNotificationName: @"VLCMediaKeySupportSettingChanged"
object: nil
userInfo: nil];
-
- /* okay, let's save our changes to vlcrc */
- 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 Interface settings using SimplePrefs (%i)", i );
- dialog_Fatal( p_intf, _("Interface Settings not saved"),
- _("An error occured while saving your settings via SimplePrefs (%i)."), i );
- i = 0;
- }
-
b_intfSettingChanged = NO;
}
}
else
[o_audio_last_ckb setEnabled: NO];
-
- /* okay, let's save our changes to vlcrc */
- i = config_SaveConfigFile( p_intf, "main" );
- i = i + config_SaveConfigFile( p_intf, "audioscrobbler" );
- i = i + config_SaveConfigFile( p_intf, "volnorm" );
-
- if( i != 0 )
- {
- msg_Err( p_intf, "An error occurred while saving the Audio settings using SimplePrefs (%i)", i );
- dialog_Fatal( p_intf, _("Audio Settings not saved"),
- _("An error occured while saving your settings via SimplePrefs (%i)."), i );
-
- i = 0;
- }
b_audioSettingChanged = NO;
}
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 );
- dialog_Fatal( p_intf, _("Video Settings not saved"),
- _("An error occured while saving your settings via SimplePrefs (%i)."), i );
- i = 0;
- }
b_videoSettingChanged = NO;
}
msg_Dbg( p_intf, "Adjusting all cache values to: %i", (int)[[o_input_cachelevel_pop selectedItem] tag] );
CaC( "udp-caching" );
if( module_exists ( "dvdread" ) )
- {
CaC( "dvdread-caching" );
- i = i + config_SaveConfigFile( p_intf, "dvdread" );
- }
if( module_exists ( "dvdnav" ) )
- {
CaC( "dvdnav-caching" );
- i = i + config_SaveConfigFile( p_intf, "dvdnav" );
- }
CaC( "tcp-caching" ); CaC( "vcd-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 ( "access_realrtsp" ) )
- {
CaCi( "realrtsp-caching", 10 );
- i = i + config_SaveConfigFile( p_intf, "access_realrtsp" );
- }
CaCi( "mms-caching", 19 );
-
- i = config_SaveConfigFile( p_intf, "main" );
- i = i + config_SaveConfigFile( p_intf, "avcodec" );
- i = i + config_SaveConfigFile( p_intf, "postproc" );
- 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, "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" );
- i = i + config_SaveConfigFile( p_intf, "avi" );
-
- if( i != 0 )
- {
- msg_Err( p_intf, "An error occurred while saving the Input settings using SimplePrefs (%i)", i );
- dialog_Fatal( p_intf, _("Input Settings not saved"),
- _("An error occured while saving your settings via SimplePrefs (%i)."), i );
- i = 0;
- }
b_inputSettingChanged = NO;
}
SaveIntList( o_osd_font_color_pop, "freetype-color" );
SaveIntList( o_osd_font_size_pop, "freetype-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 );
- dialog_Fatal( p_intf, _("On Screen Display/Subtitle Settings not saved"),
- _("An error occured while saving your settings via SimplePrefs (%i)."), i );
- i = 0;
- }
b_osdSettingChanged = NO;
}
********************/
if( b_hotkeyChanged )
{
- i = 0;
- while( i < [o_hotkeySettings count] )
- {
+ for( NSUInteger i = 0; i < [o_hotkeySettings count]; i++ )
config_PutPsz( p_intf, [[o_hotkeyNames objectAtIndex:i] UTF8String], [[o_hotkeySettings objectAtIndex:i]UTF8String] );
- 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 );
- dialog_Fatal( p_intf, _("Hotkeys not saved"),
- _("An error occured while saving your settings via SimplePrefs (%i)."), i );
- i = 0;
- }
b_hotkeyChanged = NO;
}
+
+ /* okay, let's save our changes to vlcrc */
+ config_SaveConfigFile( p_intf );
}
- (void)showSettingsForCategory: (id)o_new_category_view