1 /*****************************************************************************
2 * simple_prefs.h: Simple Preferences for Mac OS X
3 *****************************************************************************
4 * Copyright (C) 2008-2011 the VideoLAN team
7 * Authors: Felix Paul Kühne <fkuehne at videolan dot org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 #import <Cocoa/Cocoa.h>
26 #import <vlc_common.h>
28 #ifndef MAC_OS_X_VERSION_10_6
29 @protocol NSToolbarDelegate <NSObject> @end
32 @interface VLCSimplePrefs : NSObject <NSToolbarDelegate>
34 IBOutlet id o_audio_dolby_pop;
35 IBOutlet id o_audio_dolby_txt;
36 IBOutlet id o_audio_effects_box;
37 IBOutlet id o_audio_enable_ckb;
38 IBOutlet id o_audio_general_box;
39 IBOutlet id o_audio_lang_fld;
40 IBOutlet id o_audio_lang_txt;
41 IBOutlet id o_audio_last_box;
42 IBOutlet id o_audio_last_ckb;
43 IBOutlet id o_audio_lastpwd_sfld;
44 IBOutlet id o_audio_lastpwd_txt;
45 IBOutlet id o_audio_lastuser_fld;
46 IBOutlet id o_audio_lastuser_txt;
47 IBOutlet id o_audio_spdif_ckb;
48 IBOutlet id o_audio_view;
49 IBOutlet id o_audio_visual_pop;
50 IBOutlet id o_audio_visual_txt;
51 IBOutlet id o_audio_vol_fld;
52 IBOutlet id o_audio_vol_sld;
53 IBOutlet id o_audio_vol_txt;
55 IBOutlet id o_hotkeys_change_btn;
56 IBOutlet id o_hotkeys_change_lbl;
57 IBOutlet id o_hotkeys_change_keys_lbl;
58 IBOutlet id o_hotkeys_change_taken_lbl;
59 IBOutlet id o_hotkeys_change_win;
60 IBOutlet id o_hotkeys_change_cancel_btn;
61 IBOutlet id o_hotkeys_change_ok_btn;
62 IBOutlet id o_hotkeys_clear_btn;
63 IBOutlet id o_hotkeys_lbl;
64 IBOutlet id o_hotkeys_listbox;
65 IBOutlet id o_hotkeys_view;
67 IBOutlet id o_input_avi_pop;
68 IBOutlet id o_input_avi_txt;
69 IBOutlet id o_input_cachelevel_pop;
70 IBOutlet id o_input_cachelevel_txt;
71 IBOutlet id o_input_cachelevel_custom_txt;
72 IBOutlet id o_input_caching_box;
73 IBOutlet id o_input_httpproxy_fld;
74 IBOutlet id o_input_httpproxy_txt;
75 IBOutlet id o_input_httpproxypwd_sfld;
76 IBOutlet id o_input_httpproxypwd_txt;
77 IBOutlet id o_input_mux_box;
78 IBOutlet id o_input_net_box;
79 IBOutlet id o_input_postproc_fld;
80 IBOutlet id o_input_postproc_txt;
81 IBOutlet id o_input_rtsp_ckb;
82 IBOutlet id o_input_skipLoop_txt;
83 IBOutlet id o_input_skipLoop_pop;
84 IBOutlet id o_input_serverport_fld;
85 IBOutlet id o_input_serverport_txt;
86 IBOutlet id o_input_view;
88 IBOutlet id o_intf_style_txt;
89 IBOutlet id o_intf_style_dark_bcell;
90 IBOutlet id o_intf_style_bright_bcell;
91 IBOutlet id o_intf_art_pop;
92 IBOutlet id o_intf_art_txt;
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_mediakeys_ckb;
97 IBOutlet id o_intf_lang_pop;
98 IBOutlet id o_intf_lang_txt;
99 IBOutlet id o_intf_network_box;
100 IBOutlet id o_intf_view;
101 IBOutlet id o_intf_update_ckb;
102 IBOutlet id o_intf_last_update_lbl;
103 IBOutlet id o_intf_enableGrowl_ckb;
105 IBOutlet id o_osd_encoding_pop;
106 IBOutlet id o_osd_encoding_txt;
107 IBOutlet id o_osd_font_box;
108 IBOutlet id o_osd_font_btn;
109 IBOutlet id o_osd_font_color_pop;
110 IBOutlet id o_osd_font_color_txt;
111 IBOutlet id o_osd_font_fld;
112 IBOutlet id o_osd_font_size_pop;
113 IBOutlet id o_osd_font_size_txt;
114 IBOutlet id o_osd_font_txt;
115 IBOutlet id o_osd_lang_box;
116 IBOutlet id o_osd_lang_fld;
117 IBOutlet id o_osd_lang_txt;
118 IBOutlet id o_osd_opacity_txt;
119 IBOutlet id o_osd_opacity_fld;
120 IBOutlet id o_osd_opacity_sld;
121 IBOutlet id o_osd_forcebold_ckb;
122 IBOutlet id o_osd_moreoptions_txt;
123 IBOutlet id o_osd_osd_box;
124 IBOutlet id o_osd_osd_ckb;
125 IBOutlet id o_osd_view;
127 IBOutlet id o_sprefs_basic_box;
128 IBOutlet id o_sprefs_basicFull_matrix;
129 IBOutlet id o_sprefs_cancel_btn;
130 IBOutlet id o_sprefs_controls_box;
131 IBOutlet id o_sprefs_reset_btn;
132 IBOutlet id o_sprefs_save_btn;
133 IBOutlet id o_sprefs_win;
135 IBOutlet id o_video_black_ckb;
136 IBOutlet id o_video_device_pop;
137 IBOutlet id o_video_device_txt;
138 IBOutlet id o_video_display_box;
139 IBOutlet id o_video_enable_ckb;
140 IBOutlet id o_video_fullscreen_ckb;
141 IBOutlet id o_video_onTop_ckb;
142 IBOutlet id o_video_output_pop;
143 IBOutlet id o_video_output_txt;
144 IBOutlet id o_video_skipFrames_ckb;
145 IBOutlet id o_video_snap_box;
146 IBOutlet id o_video_snap_folder_btn;
147 IBOutlet id o_video_snap_folder_fld;
148 IBOutlet id o_video_snap_folder_txt;
149 IBOutlet id o_video_snap_format_pop;
150 IBOutlet id o_video_snap_format_txt;
151 IBOutlet id o_video_snap_prefix_fld;
152 IBOutlet id o_video_snap_prefix_txt;
153 IBOutlet id o_video_snap_seqnum_ckb;
154 IBOutlet id o_video_view;
156 BOOL b_audioSettingChanged;
157 BOOL b_intfSettingChanged;
158 BOOL b_videoSettingChanged;
159 BOOL b_osdSettingChanged;
160 BOOL b_inputSettingChanged;
161 BOOL b_hotkeyChanged;
162 id o_currentlyShownCategoryView;
164 NSOpenPanel *o_selectFolderPanel;
165 NSArray *o_hotkeyDescriptions;
166 NSArray *o_hotkeyNames;
167 NSArray *o_hotkeysNonUseableKeys;
168 NSMutableArray *o_hotkeySettings;
169 NSString *o_keyInTransition;
171 intf_thread_t *p_intf;
173 + (VLCSimplePrefs *)sharedInstance;
174 - (NSString *)OSXStringKeyToString:(NSString *)theString;
177 - (NSToolbarItem *) toolbar: (NSToolbar *)o_toolbar
178 itemForItemIdentifier: (NSString *)o_itemIdent
179 willBeInsertedIntoToolbar: (BOOL)b_willBeInserted;
180 - (NSArray *)toolbarDefaultItemIdentifiers: (NSToolbar *)toolbar;
181 - (NSArray *)toolbarAllowedItemIdentifiers: (NSToolbar *)toolbar;
184 - (void)resetControls;
185 - (void)showSimplePrefs;
187 - (IBAction)buttonAction:(id)sender;
188 - (void)sheetDidEnd:(NSWindow *)o_sheet
189 returnCode:(int)i_return
190 contextInfo:(void *)o_context;
192 - (void)saveChangedSettings;
195 - (IBAction)interfaceSettingChanged:(id)sender;
196 - (void)showInterfaceSettings;
199 - (IBAction)audioSettingChanged:(id)sender;
200 - (void)showAudioSettings;
203 - (IBAction)videoSettingChanged:(id)sender;
204 - (void)showVideoSettings;
206 /* OSD / subtitles */
207 - (IBAction)osdSettingChanged:(id)sender;
208 - (IBAction)showFontPicker:(id)sender;
209 - (void)showOSDSettings;
210 - (void)changeFont:(id)sender;
213 - (IBAction)inputSettingChanged:(id)sender;
214 - (void)showInputSettings;
217 - (IBAction)hotkeySettingChanged:(id)sender;
218 - (void)showHotkeySettings;
219 - (int)numberOfRowsInTableView:(NSTableView *)aTableView;
220 - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex;
221 - (BOOL)changeHotkeyTo: (NSString *)theKey;
225 @interface VLCHotkeyChangeWindow : NSWindow
229 @interface VLCSimplePrefsWindow : NSWindow