}
}
+- (void)collapsAll
+{
+ /* collaps all views so Cocoa saves the window position correctly */
+ if( o_adjImg_expanded )
+ {
+ [self extWin_exp_adjImg: nil];
+ }
+ if( o_audFlts_expanded )
+ {
+ [self extWin_exp_audFlts: nil];
+ }
+ if( o_vidFlts_expanded )
+ {
+ [self extWin_exp_vidFlts: nil];
+ }
+}
+
+- (BOOL)getConfigChanged
+{
+ return o_config_changed;
+}
+
- (void)showPanel
{
/* get the correct slider values from the prefs, in case they were changed
[o_sld_gamma setIntValue: (int)(10 * f_value) ];
}
- [o_sld_maxLevel setFloatValue: (config_GetFloat(p_intf, "norm-max-level") \
- * 10)];
+ f_value = config_GetFloat( p_intf, "norm-max-level" );
+ if( f_value > 0 && f_value < 10 )
+ {
+ [o_sld_maxLevel setFloatValue: f_value ];
+ }
[o_sld_opaque setFloatValue: (config_GetFloat( p_intf, \
"macosx-opaqueness") * 100)];
}
vlc_object_release( p_vout );
}
+
+ o_config_changed = YES;
}
/* change the opaqueness of the vouts */
config_PutFloat( p_playlist , "macosx-opaqueness" , val.f_float );
vlc_object_release( p_playlist );
+
+ o_config_changed = YES;
}
- (IBAction)audFtls_hdphnVirt:(id)sender
VLC_OBJECT_AOUT, FIND_ANYWHERE);
if( p_aout != NULL )
{
- var_SetFloat( p_aout, "norm-max-level", [o_sld_maxLevel floatValue] / 10 );
+ var_SetFloat( p_aout, "norm-max-level", [o_sld_maxLevel floatValue] );
vlc_object_release( p_aout );
}
- else
- {
- config_PutFloat( p_intf, "norm-max-level", [o_sld_maxLevel floatValue] /10 );
- }
+ config_PutFloat( p_intf, "norm-max-level", [o_sld_maxLevel floatValue] );
+
+ o_config_changed = YES;
}
- (IBAction)audFtls_vlmeNorm:(id)sender
}
free( psz_string );
+
+ o_config_changed = YES;
}
- (void)changeAFiltersString: (char *)psz_name onOrOff: (vlc_bool_t )b_add;
{
+ /* copied from ../wxwidgets/extrapanel.cpp
+ * renamed to conform with Cocoa's rules */
+
char *psz_parser, *psz_string;
intf_thread_t * p_intf = VLCIntf;
aout_instance_t * p_aout= (aout_instance_t *)vlc_object_find(p_intf,
vlc_object_release( p_aout );
}
free( psz_string );
+
+ o_config_changed = YES;
}
- (void)savePrefs
FIND_ANYWHERE );
int returnedValue;
+ /* FIXME: we should only save the settings actually changed in this panel
+ * and no other. This would make the termination much quicker and is better
+ * for people who are using cmd-line-options (trac #382) -- FK (10/6/05) */
returnedValue = config_SaveConfigFile( p_playlist, NULL);
if (returnedValue == 0)
{
}
vlc_object_release( p_playlist );
}
-
-
-/*****************************************************************************
- * delegate method
- *****************************************************************************/
-
-- (BOOL)applicationShouldTerminate:(NSWindow *)sender
-{
- /* collaps all views so Cocoa saves the window position correctly */
- if( o_adjImg_expanded )
- {
- [self extWin_exp_adjImg: nil];
- }
- if( o_audFlts_expanded )
- {
- [self extWin_exp_audFlts: nil];
- }
- if( o_vidFlts_expanded )
- {
- [self extWin_exp_vidFlts: nil];
- }
-
- /* save the prefs before shutting down */
- [self savePrefs];
-
- return YES;
-}
@end