#import "prefs.h"
#import <vlc_keys.h>
#import <vlc_interface.h>
+#import <vlc_aout_intf.h>
#import <vlc_dialog.h>
#import <vlc_modules.h>
#import <vlc_config_cat.h>
[o_audio_lastuser_txt setStringValue: _NS("User name")];
[o_audio_spdif_ckb setTitle: _NS("Use S/PDIF when available")];
[o_audio_visual_txt setStringValue: _NS("Visualization")];
- [o_audio_vol_txt setStringValue: _NS("Default Volume")];
+ [o_audio_autosavevol_yes_bcell setTitle: _NS("Keep audio level between sessions")];
+ [o_audio_autosavevol_no_bcell setTitle: _NS("Always reset audio start level to:")];
/* hotkeys */
[o_hotkeys_change_btn setTitle: _NS("Change")];
[o_intf_update_ckb setTitle: _NS("Automatically check for updates")];
[o_intf_last_update_lbl setStringValue: @""];
[o_intf_enableGrowl_ckb setTitle: _NS("Enable Growl notifications (on playlist item change)")];
+ [o_intf_autoresize_ckb setTitle: _NS("Resize interface to the native video size")];
+ [o_intf_pauseminimized_ckb setTitle: _NS("Pause the video playback when minimized")];
/* Subtitles and OSD */
[o_osd_encoding_txt setStringValue: _NS("Default Encoding")];
- (void)setupButton: (NSButton *)object forBoolValue: (const char *)name
{
[object setState: config_GetInt( p_intf, name )];
- [object setToolTip: [NSString stringWithUTF8String: config_GetLabel( p_intf, name )]];
+ [object setToolTip: _NS(config_GetLabel( p_intf, name ) ?: "")];
}
- (void)setupField:(NSTextField *)o_object forOption:(const char *)psz_option
{
char *psz_tmp = config_GetPsz( p_intf, psz_option );
[o_object setStringValue: [NSString stringWithUTF8String: psz_tmp ?: ""]];
- [o_object setToolTip: [NSString stringWithUTF8String: config_GetLabel( p_intf, psz_option )]];
+ [o_object setToolTip: _NS(config_GetLabel( p_intf, psz_option ))];
free( psz_tmp );
}
[o_intf_style_dark_bcell setState: NO];
[o_intf_style_bright_bcell setState: YES];
}
+ [self setupButton: o_intf_autoresize_ckb forBoolValue: "macosx-video-autoresize"];
+ [self setupButton: o_intf_pauseminimized_ckb forBoolValue: "macosx-pause-minimized"];
/******************
* audio settings *
******************/
[self setupButton: o_audio_enable_ckb forBoolValue: "audio"];
- i = config_GetInt( p_intf, "volume" );
- [o_audio_vol_fld setToolTip: [NSString stringWithUTF8String: config_GetLabel( p_intf, "volume")]];
- [o_audio_vol_fld setIntValue: i];
- [o_audio_vol_sld setToolTip: [o_audio_vol_fld toolTip]];
- [o_audio_vol_sld setIntValue: i];
+
+ if ( config_GetInt( p_intf, "macosx-autosave-volume" ))
+ {
+ [o_audio_autosavevol_yes_bcell setState: NSOnState];
+ [o_audio_autosavevol_no_bcell setState: NSOffState];
+ [o_audio_vol_fld setEnabled: NO];
+ [o_audio_vol_sld setEnabled: NO];
+
+ [o_audio_vol_sld setIntValue: 100];
+ [o_audio_vol_fld setIntValue: 100];
+ }
+ else
+ {
+ [o_audio_autosavevol_yes_bcell setState: NSOffState];
+ [o_audio_autosavevol_no_bcell setState: NSOnState];
+ [o_audio_vol_fld setEnabled: YES];
+ [o_audio_vol_sld setEnabled: YES];
+
+ i = config_GetInt( p_intf, "volume" );
+ i = i * 200 / AOUT_VOLUME_MAX;
+ [o_audio_vol_sld setIntValue: i];
+ [o_audio_vol_fld setIntValue: i];
+ }
[self setupButton: o_audio_spdif_ckb forBoolValue: "spdif"];
[self setupField: o_input_httpproxy_fld forOption:"http-proxy"];
[self setupField: o_input_httpproxypwd_sfld forOption:"http-proxy-pwd"];
[o_input_postproc_fld setIntValue: config_GetInt( p_intf, "postproc-q")];
- [o_input_postproc_fld setToolTip: [NSString stringWithUTF8String: config_GetLabel( p_intf, "postproc-q")]];
+ [o_input_postproc_fld setToolTip: _NS(config_GetLabel( p_intf, "postproc-q"))];
[self setupButton: o_input_avi_pop forIntList: "avi-index"];
i = config_GetInt( p_intf, "freetype-opacity" );
[o_osd_opacity_fld setIntValue: i];
[o_osd_opacity_sld setIntValue: i];
- [o_osd_opacity_sld setToolTip: [NSString stringWithUTF8String: config_GetLabel( p_intf, "freetype-opacity")]];
+ [o_osd_opacity_sld setToolTip: _NS(config_GetLabel( p_intf, "freetype-opacity"))];
[o_osd_opacity_fld setToolTip: [o_osd_opacity_sld toolTip]];
[self setupButton: o_osd_forcebold_ckb forBoolValue: "freetype-bold"];
config_PutInt( p_intf, "macosx-mediakeys", [o_intf_mediakeys_ckb state] );
config_PutInt( p_intf, "macosx-interfacestyle", [o_intf_style_dark_bcell state] );
config_PutInt( p_intf, "macosx-nativefullscreenmode", [o_intf_nativefullscreen_ckb state] );
+ config_PutInt( p_intf, "macosx-pause-minimized", [o_intf_pauseminimized_ckb state] );
+ config_PutInt( p_intf, "macosx-video-autoresize", [o_intf_autoresize_ckb state] );
if( [o_intf_enableGrowl_ckb state] == NSOnState )
{
tmpString = getString( "control" );
if( b_audioSettingChanged )
{
config_PutInt( p_intf, "audio", [o_audio_enable_ckb state] );
- config_PutInt( p_intf, "volume", [o_audio_vol_sld intValue]);
+ if( [o_audio_vol_fld isEnabled] )
+ config_PutInt( p_intf, "volume", [o_audio_vol_fld intValue] * AOUT_VOLUME_MAX / 200 );
+ config_PutInt( p_intf, "macosx-autosave-volume", [o_audio_autosavevol_yes_bcell state] );
config_PutInt( p_intf, "spdif", [o_audio_spdif_ckb state] );
SaveIntList( o_audio_dolby_pop, "force-dolby-surround" );
}
}
+ if( sender == o_audio_autosavevol_matrix )
+ {
+ BOOL enableVolumeSlider = [o_audio_autosavevol_matrix selectedTag] == 1;
+ [o_audio_vol_fld setEnabled: enableVolumeSlider];
+ [o_audio_vol_sld setEnabled: enableVolumeSlider];
+ }
+
b_audioSettingChanged = YES;
}
[self showSettingsForCategory: o_osd_view];
}
+- (void)controlTextDidChange:(NSNotification *)o_notification
+{
+ id notificationObject = [o_notification object];
+ if( notificationObject == o_audio_lang_fld ||
+ notificationObject == o_audio_lastpwd_sfld ||
+ notificationObject == o_audio_lastuser_fld ||
+ notificationObject == o_audio_vol_fld )
+ b_audioSettingChanged = YES;
+ else if( notificationObject == o_input_record_fld ||
+ notificationObject == o_input_httpproxy_fld ||
+ notificationObject == o_input_httpproxypwd_sfld ||
+ notificationObject == o_input_postproc_fld )
+ b_inputSettingChanged = YES;
+ else if( notificationObject == o_osd_font_fld ||
+ notificationObject == o_osd_lang_fld ||
+ notificationObject == o_osd_opacity_fld)
+ b_osdSettingChanged = YES;
+ else if( notificationObject == o_video_snap_folder_fld ||
+ notificationObject == o_video_snap_prefix_fld )
+ b_videoSettingChanged = YES;
+}
+
- (IBAction)showFontPicker:(id)sender
{
char * font = config_GetPsz( p_intf, "freetype-font" );