simple_prefs.h 8.71 KB
Newer Older
1 2 3
/*****************************************************************************
* simple_prefs.h: Simple Preferences for Mac OS X
*****************************************************************************
4
* Copyright (C) 2008-2014 VLC authors and VideoLAN
5
* $Id$
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
*
* Authors: Felix Paul Kühne <fkuehne at videolan dot org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/

#import <Cocoa/Cocoa.h>
25
#import "intf.h"
26
#import <vlc_common.h>
27

28
@interface VLCSimplePrefs : NSObject <NSToolbarDelegate, NSWindowDelegate>
29 30 31 32 33 34 35 36 37 38
{
    IBOutlet id o_audio_dolby_pop;
    IBOutlet id o_audio_dolby_txt;
    IBOutlet id o_audio_effects_box;
    IBOutlet id o_audio_enable_ckb;
    IBOutlet id o_audio_general_box;
    IBOutlet id o_audio_lang_fld;
    IBOutlet id o_audio_lang_txt;
    IBOutlet id o_audio_last_box;
    IBOutlet id o_audio_last_ckb;
39
    IBOutlet id o_audio_lastpwd_sfld;
40 41 42 43 44 45 46 47 48
    IBOutlet id o_audio_lastpwd_txt;
    IBOutlet id o_audio_lastuser_fld;
    IBOutlet id o_audio_lastuser_txt;
    IBOutlet id o_audio_spdif_ckb;
    IBOutlet id o_audio_view;
    IBOutlet id o_audio_visual_pop;
    IBOutlet id o_audio_visual_txt;
    IBOutlet id o_audio_vol_fld;
    IBOutlet id o_audio_vol_sld;
49 50 51
    IBOutlet id o_audio_autosavevol_matrix;
    IBOutlet id o_audio_autosavevol_yes_bcell;
    IBOutlet id o_audio_autosavevol_no_bcell;
52

53 54 55 56 57 58 59 60 61 62 63 64
    IBOutlet id o_hotkeys_change_btn;
    IBOutlet id o_hotkeys_change_lbl;
    IBOutlet id o_hotkeys_change_keys_lbl;
    IBOutlet id o_hotkeys_change_taken_lbl;
    IBOutlet id o_hotkeys_change_win;
    IBOutlet id o_hotkeys_change_cancel_btn;
    IBOutlet id o_hotkeys_change_ok_btn;
    IBOutlet id o_hotkeys_clear_btn;
    IBOutlet id o_hotkeys_lbl;
    IBOutlet id o_hotkeys_listbox;
    IBOutlet id o_hotkeys_view;

65 66 67
    IBOutlet id o_input_record_box;
    IBOutlet id o_input_record_fld;
    IBOutlet id o_input_record_btn;
68 69 70 71
    IBOutlet id o_input_avi_pop;
    IBOutlet id o_input_avi_txt;
    IBOutlet id o_input_cachelevel_pop;
    IBOutlet id o_input_cachelevel_txt;
72
    IBOutlet id o_input_cachelevel_custom_txt;
73 74 75
    IBOutlet id o_input_caching_box;
    IBOutlet id o_input_mux_box;
    IBOutlet id o_input_net_box;
76 77
    IBOutlet id o_input_avcodec_hw_txt;
    IBOutlet id o_input_avcodec_hw_pop;
78 79 80
    IBOutlet id o_input_postproc_fld;
    IBOutlet id o_input_postproc_txt;
    IBOutlet id o_input_rtsp_ckb;
81 82
    IBOutlet id o_input_skipLoop_txt;
    IBOutlet id o_input_skipLoop_pop;
83
    IBOutlet id o_input_mkv_preload_dir_ckb;
84
    IBOutlet id o_input_urlhandler_btn;
85 86
    IBOutlet id o_input_view;

87 88
    IBOutlet id o_intf_language_pop;
    IBOutlet id o_intf_language_txt;
89 90 91
    IBOutlet id o_intf_style_txt;
    IBOutlet id o_intf_style_dark_bcell;
    IBOutlet id o_intf_style_bright_bcell;
92
    IBOutlet id o_intf_art_ckb;
93
    IBOutlet id o_intf_embedded_ckb;
94
    IBOutlet id o_intf_fspanel_ckb;
95
    IBOutlet id o_intf_appleremote_ckb;
96
    IBOutlet id o_intf_appleremote_sysvol_ckb;
97
    IBOutlet id o_intf_mediakeys_ckb;
98 99
    IBOutlet id o_intf_network_box;
    IBOutlet id o_intf_view;
100 101
    IBOutlet id o_intf_update_ckb;
    IBOutlet id o_intf_last_update_lbl;
102
    IBOutlet id o_intf_enableGrowl_ckb;
103
    IBOutlet id o_intf_nativefullscreen_ckb;
104 105
    IBOutlet id o_intf_autoresize_ckb;
    IBOutlet id o_intf_pauseminimized_ckb;
106 107 108
    IBOutlet id o_intf_luahttp_box;
    IBOutlet id o_intf_luahttppwd_lbl;
    IBOutlet id o_intf_luahttppwd_fld;
109 110
    IBOutlet id o_intf_pauseitunes_lbl;
    IBOutlet id o_intf_pauseitunes_pop;
111 112
    IBOutlet id o_intf_continueplayback_lbl;
    IBOutlet id o_intf_continueplayback_pop;
113

114 115 116 117 118 119 120 121 122 123 124 125 126
    IBOutlet id o_osd_encoding_pop;
    IBOutlet id o_osd_encoding_txt;
    IBOutlet id o_osd_font_box;
    IBOutlet id o_osd_font_btn;
    IBOutlet id o_osd_font_color_pop;
    IBOutlet id o_osd_font_color_txt;
    IBOutlet id o_osd_font_fld;
    IBOutlet id o_osd_font_size_pop;
    IBOutlet id o_osd_font_size_txt;
    IBOutlet id o_osd_font_txt;
    IBOutlet id o_osd_lang_box;
    IBOutlet id o_osd_lang_fld;
    IBOutlet id o_osd_lang_txt;
127 128 129
    IBOutlet id o_osd_opacity_txt;
    IBOutlet id o_osd_opacity_fld;
    IBOutlet id o_osd_opacity_sld;
130 131 132 133
    IBOutlet id o_osd_outline_color_pop;
    IBOutlet id o_osd_outline_color_txt;
    IBOutlet id o_osd_outline_thickness_pop;
    IBOutlet id o_osd_outline_thickness_txt;
134
    IBOutlet id o_osd_forcebold_ckb;
135 136 137 138
    IBOutlet id o_osd_osd_box;
    IBOutlet id o_osd_osd_ckb;
    IBOutlet id o_osd_view;

139
    IBOutlet id o_sprefs_showAll_btn;
140 141 142 143 144 145
    IBOutlet id o_sprefs_cancel_btn;
    IBOutlet id o_sprefs_controls_box;
    IBOutlet id o_sprefs_reset_btn;
    IBOutlet id o_sprefs_save_btn;
    IBOutlet id o_sprefs_win;

146 147 148 149 150 151
    IBOutlet id o_video_black_ckb;
    IBOutlet id o_video_device_pop;
    IBOutlet id o_video_device_txt;
    IBOutlet id o_video_display_box;
    IBOutlet id o_video_enable_ckb;
    IBOutlet id o_video_fullscreen_ckb;
152
    IBOutlet id o_video_videodeco_ckb;
153 154 155 156 157 158 159 160 161 162 163
    IBOutlet id o_video_onTop_ckb;
    IBOutlet id o_video_skipFrames_ckb;
    IBOutlet id o_video_snap_box;
    IBOutlet id o_video_snap_folder_btn;
    IBOutlet id o_video_snap_folder_fld;
    IBOutlet id o_video_snap_folder_txt;
    IBOutlet id o_video_snap_format_pop;
    IBOutlet id o_video_snap_format_txt;
    IBOutlet id o_video_snap_prefix_fld;
    IBOutlet id o_video_snap_prefix_txt;
    IBOutlet id o_video_snap_seqnum_ckb;
164 165 166 167 168
    IBOutlet id o_video_deinterlace_txt;
    IBOutlet id o_video_deinterlace_pop;
    IBOutlet id o_video_deinterlace_mode_txt;
    IBOutlet id o_video_deinterlace_mode_pop;
    IBOutlet id o_video_video_box;
169 170
    IBOutlet id o_video_view;

171 172 173 174 175 176 177 178 179 180 181 182 183 184
    IBOutlet id o_urlhandler_title_txt;
    IBOutlet id o_urlhandler_subtitle_txt;
    IBOutlet id o_urlhandler_save_btn;
    IBOutlet id o_urlhandler_cancel_btn;
    IBOutlet id o_urlhandler_ftp_pop;
    IBOutlet id o_urlhandler_mms_pop;
    IBOutlet id o_urlhandler_rtmp_pop;
    IBOutlet id o_urlhandler_rtp_pop;
    IBOutlet id o_urlhandler_rtsp_pop;
    IBOutlet id o_urlhandler_sftp_pop;
    IBOutlet id o_urlhandler_smb_pop;
    IBOutlet id o_urlhandler_udp_pop;
    IBOutlet id o_urlhandler_win;

185 186
    BOOL b_audioSettingChanged;
    BOOL b_intfSettingChanged;
187
    BOOL b_videoSettingChanged;
188 189
    BOOL b_osdSettingChanged;
    BOOL b_inputSettingChanged;
190
    BOOL b_hotkeyChanged;
191
    id o_currentlyShownCategoryView;
192

193
    NSOpenPanel *o_selectFolderPanel;
194
    NSArray *o_hotkeyDescriptions;
195
    NSArray *o_hotkeyNames;
196
    NSArray *o_hotkeysNonUseableKeys;
197
    NSMutableArray *o_hotkeySettings;
198
    NSString *o_keyInTransition;
199

200 201 202 203
    intf_thread_t *p_intf;
}
+ (VLCSimplePrefs *)sharedInstance;

204
/* toolbar */
205 206
- (NSToolbarItem *) toolbar: (NSToolbar *)o_toolbar
      itemForItemIdentifier: (NSString *)o_itemIdent
207 208
  willBeInsertedIntoToolbar: (BOOL)b_willBeInserted;
- (NSArray *)toolbarDefaultItemIdentifiers: (NSToolbar *)toolbar;
209
- (NSArray *)toolbarAllowedItemIdentifiers: (NSToolbar *)toolbar;
210 211

- (void)initStrings;
212
- (void)resetControls;
213
- (void)showSimplePrefs;
214
- (void)showSimplePrefsWithLevel:(NSInteger)i_window_level;
215 216

- (IBAction)buttonAction:(id)sender;
217
- (IBAction)resetPreferences:(id)sender;
218
- (void)sheetDidEnd:(NSWindow *)o_sheet
219 220 221
         returnCode:(int)i_return
        contextInfo:(void *)o_context;

222 223
- (void)saveChangedSettings;

224 225 226 227 228 229 230 231 232
/* interface */
- (IBAction)interfaceSettingChanged:(id)sender;
- (void)showInterfaceSettings;

/* audio */
- (IBAction)audioSettingChanged:(id)sender;
- (void)showAudioSettings;

/* video */
233 234
- (IBAction)videoSettingChanged:(id)sender;
- (void)showVideoSettings;
235

236 237
/* OSD / subtitles */
- (IBAction)osdSettingChanged:(id)sender;
Pierre d'Herbemont's avatar
Pierre d'Herbemont committed
238
- (IBAction)showFontPicker:(id)sender;
239
- (void)showOSDSettings;
240
- (void)changeFont:(id)sender;
241 242

/* input & codecs */
243 244
- (IBAction)inputSettingChanged:(id)sender;
- (void)showInputSettings;
245
- (IBAction)urlHandlerAction:(id)sender;
246 247

/* hotkeys */
248 249
- (IBAction)hotkeySettingChanged:(id)sender;
- (void)showHotkeySettings;
250 251
- (int)numberOfRowsInTableView:(NSTableView *)aTableView;
- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex;
252
- (BOOL)changeHotkeyTo: (NSString *)theKey;
253 254 255 256 257

@end

@interface VLCHotkeyChangeWindow : NSWindow

258
@end
259 260 261

@interface VLCSimplePrefsWindow : NSWindow

262
@end