Commit 7ec8deda authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: adapted to latest config API changes

parent b1c3b3ba
......@@ -103,7 +103,6 @@
+ (VLCAudioEffects *)sharedInstance;
- (IBAction)toggleWindow:(id)sender;
- (void)setAudioFilter: (char *)psz_name on:(BOOL)b_on;
- (void)savePrefs;
/* Equalizer */
- (void)setupEqualizer;
......
......@@ -151,25 +151,6 @@ static VLCAudioEffects *_o_sharedInstance = nil;
}
}
- (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,
......@@ -387,9 +368,6 @@ 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 );
......@@ -422,9 +400,6 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf,
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 );
......@@ -443,9 +418,6 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf,
{
/* 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 );
......@@ -464,9 +436,6 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf,
{
/* 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 );
......
......@@ -247,9 +247,6 @@ static bool GetFiltersStatus( intf_thread_t *p_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 );
......@@ -285,9 +282,6 @@ static bool GetFiltersStatus( intf_thread_t *p_intf,
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 );
......@@ -315,9 +309,6 @@ static bool GetFiltersStatus( intf_thread_t *p_intf,
{
/* 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 );
......@@ -352,9 +343,6 @@ static bool GetFiltersStatus( intf_thread_t *p_intf,
{
/* 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 );
......
......@@ -80,7 +80,6 @@
/* global variables */
NSView * o_currentlyshown_view;
BOOL o_config_changed;
}
- (IBAction)viewSelectorAction:(id)sender;
......@@ -95,12 +94,10 @@
- (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
......@@ -181,11 +181,6 @@ static VLCExtended *_o_sharedInstance = nil;
[self initStrings];
}
- (BOOL)configChanged
{
return o_config_changed;
}
- (void)showPanel
{
/* get the correct slider values from the prefs, in case they were changed
......@@ -398,8 +393,6 @@ static VLCExtended *_o_sharedInstance = nil;
vlc_object_release( p_filter );
vlc_object_release( p_vout );
}
o_config_changed = YES;
}
/* change the opaqueness of the vouts */
......@@ -437,8 +430,6 @@ static VLCExtended *_o_sharedInstance = nil;
/* store to prefs */
config_PutFloat( p_playlist , "macosx-opaqueness" , val.f_float );
o_config_changed = YES;
}
- (IBAction)enableHeadphoneVirtualizer:(id)sender
......@@ -463,8 +454,6 @@ static VLCExtended *_o_sharedInstance = nil;
}
config_PutFloat( p_intf, "norm-max-level", [o_sld_maxLevel floatValue] );
o_config_changed = YES;
}
- (IBAction)enableVolumeNormalization:(id)sender
......@@ -601,11 +590,8 @@ static VLCExtended *_o_sharedInstance = nil;
}
free( psz_string );
o_config_changed = YES;
}
- (void)changeVideoFiltersString:(char *)psz_name onOrOff:(bool )b_add
{
/* same as changeVoutFiltersString but addressing the "video-filter"
......@@ -667,8 +653,6 @@ static VLCExtended *_o_sharedInstance = nil;
}
free( psz_string );
o_config_changed = YES;
}
- (void)changeAFiltersString: (char *)psz_name onOrOff: (bool )b_add;
......@@ -738,52 +722,5 @@ static VLCExtended *_o_sharedInstance = nil;
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
......@@ -818,11 +818,6 @@ static VLCMain *_o_sharedMainInstance = nil;
/* 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 );
......
......@@ -212,7 +212,7 @@ static VLCPrefs *_o_sharedMainInstance = nil;
{
/* TODO: call savePrefs on Root item */
[_rootTreeItem applyChanges];
config_SaveConfigFile( p_intf, NULL );
config_SaveConfigFile( p_intf );
[o_prefs_window orderOut:self];
}
......
......@@ -701,7 +701,7 @@ static inline char * __config_GetLabel( vlc_object_t *p_this, const char *psz_na
{
config_ResetAll( p_intf );
[self resetControls];
config_SaveConfigFile( p_intf, NULL );
config_SaveConfigFile( p_intf );
}
}
......@@ -757,7 +757,6 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
- (void)saveChangedSettings
{
char *psz_tmp;
int i;
#define SaveIntList( object, name ) save_int_list( p_intf, object, name )
......@@ -809,19 +808,6 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
[[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;
}
......@@ -880,20 +866,6 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
}
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;
}
......@@ -915,17 +887,6 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
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;
}
......@@ -949,48 +910,17 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
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;
}
......@@ -1021,16 +951,6 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
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;
}
......@@ -1039,24 +959,13 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
********************/
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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment