1 /*****************************************************************************
2 * simple_prefs.h: Simple Preferences for Mac OS X
3 *****************************************************************************
4 * Copyright (C) 2008 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 @interface VLCSimplePrefs : NSObject
30 IBOutlet id o_audio_dolby_pop;
31 IBOutlet id o_audio_dolby_txt;
32 IBOutlet id o_audio_effects_box;
33 IBOutlet id o_audio_enable_ckb;
34 IBOutlet id o_audio_general_box;
35 IBOutlet id o_audio_headphone_ckb;
36 IBOutlet id o_audio_lang_fld;
37 IBOutlet id o_audio_lang_txt;
38 IBOutlet id o_audio_last_box;
39 IBOutlet id o_audio_last_ckb;
40 IBOutlet id o_audio_lastpwd_sfld;
41 IBOutlet id o_audio_lastpwd_txt;
42 IBOutlet id o_audio_lastuser_fld;
43 IBOutlet id o_audio_lastuser_txt;
44 IBOutlet id o_audio_norm_ckb;
45 IBOutlet id o_audio_norm_fld;
46 IBOutlet id o_audio_spdif_ckb;
47 IBOutlet id o_audio_view;
48 IBOutlet id o_audio_visual_pop;
49 IBOutlet id o_audio_visual_txt;
50 IBOutlet id o_audio_vol_fld;
51 IBOutlet id o_audio_vol_sld;
52 IBOutlet id o_audio_vol_txt;
54 IBOutlet id o_hotkeys_change_btn;
55 IBOutlet id o_hotkeys_change_lbl;
56 IBOutlet id o_hotkeys_change_keys_lbl;
57 IBOutlet id o_hotkeys_change_taken_lbl;
58 IBOutlet id o_hotkeys_change_win;
59 IBOutlet id o_hotkeys_change_cancel_btn;
60 IBOutlet id o_hotkeys_change_ok_btn;
61 IBOutlet id o_hotkeys_clear_btn;
62 IBOutlet id o_hotkeys_lbl;
63 IBOutlet id o_hotkeys_listbox;
64 IBOutlet id o_hotkeys_view;
66 IBOutlet id o_input_access_box;
67 IBOutlet id o_input_avi_pop;
68 IBOutlet id o_input_avi_txt;
69 IBOutlet id o_input_bandwidth_ckb;
70 IBOutlet id o_input_cachelevel_pop;
71 IBOutlet id o_input_cachelevel_txt;
72 IBOutlet id o_input_cachelevel_custom_txt;
73 IBOutlet id o_input_caching_box;
74 IBOutlet id o_input_dump_ckb;
75 IBOutlet id o_input_httpproxy_fld;
76 IBOutlet id o_input_httpproxy_txt;
77 IBOutlet id o_input_httpproxypwd_sfld;
78 IBOutlet id o_input_httpproxypwd_txt;
79 IBOutlet id o_input_mux_box;
80 IBOutlet id o_input_net_box;
81 IBOutlet id o_input_postproc_fld;
82 IBOutlet id o_input_postproc_txt;
83 IBOutlet id o_input_record_ckb;
84 IBOutlet id o_input_rtsp_ckb;
85 IBOutlet id o_input_serverport_fld;
86 IBOutlet id o_input_serverport_txt;
87 IBOutlet id o_input_timeshift_ckb;
88 IBOutlet id o_input_view;
90 IBOutlet id o_intf_art_pop;
91 IBOutlet id o_intf_art_txt;
92 IBOutlet id o_intf_embedded_ckb;
93 IBOutlet id o_intf_fspanel_ckb;
94 IBOutlet id o_intf_lang_pop;
95 IBOutlet id o_intf_lang_txt;
96 IBOutlet id o_intf_network_box;
97 IBOutlet id o_intf_view;
99 IBOutlet id o_osd_encoding_pop;
100 IBOutlet id o_osd_encoding_txt;
101 IBOutlet id o_osd_font_box;
102 IBOutlet id o_osd_font_btn;
103 IBOutlet id o_osd_font_color_pop;
104 IBOutlet id o_osd_font_color_txt;
105 IBOutlet id o_osd_font_effect_pop;
106 IBOutlet id o_osd_font_effect_txt;
107 IBOutlet id o_osd_font_fld;
108 IBOutlet id o_osd_font_size_pop;
109 IBOutlet id o_osd_font_size_txt;
110 IBOutlet id o_osd_font_txt;
111 IBOutlet id o_osd_lang_box;
112 IBOutlet id o_osd_lang_fld;
113 IBOutlet id o_osd_lang_txt;
114 IBOutlet id o_osd_osd_box;
115 IBOutlet id o_osd_osd_ckb;
116 IBOutlet id o_osd_view;
118 IBOutlet id o_sprefs_basic_box;
119 IBOutlet id o_sprefs_basicFull_matrix;
120 IBOutlet id o_sprefs_cancel_btn;
121 IBOutlet id o_sprefs_controls_box;
122 IBOutlet id o_sprefs_reset_btn;
123 IBOutlet id o_sprefs_save_btn;
124 IBOutlet id o_sprefs_win;
126 IBOutlet id o_video_black_ckb;
127 IBOutlet id o_video_device_pop;
128 IBOutlet id o_video_device_txt;
129 IBOutlet id o_video_display_box;
130 IBOutlet id o_video_enable_ckb;
131 IBOutlet id o_video_fullscreen_ckb;
132 IBOutlet id o_video_onTop_ckb;
133 IBOutlet id o_video_output_pop;
134 IBOutlet id o_video_output_txt;
135 IBOutlet id o_video_skipFrames_ckb;
136 IBOutlet id o_video_snap_box;
137 IBOutlet id o_video_snap_folder_btn;
138 IBOutlet id o_video_snap_folder_fld;
139 IBOutlet id o_video_snap_folder_txt;
140 IBOutlet id o_video_snap_format_pop;
141 IBOutlet id o_video_snap_format_txt;
142 IBOutlet id o_video_snap_prefix_fld;
143 IBOutlet id o_video_snap_prefix_txt;
144 IBOutlet id o_video_snap_seqnum_ckb;
145 IBOutlet id o_video_view;
147 BOOL b_audioSettingChanged;
148 BOOL b_intfSettingChanged;
149 BOOL b_videoSettingChanged;
150 BOOL b_osdSettingChanged;
151 BOOL b_inputSettingChanged;
152 BOOL b_hotkeyChanged;
153 id o_currentlyShownCategoryView;
155 NSToolbar *o_sprefs_toolbar;
156 NSOpenPanel *o_selectFolderPanel;
157 NSArray *o_hotkeyDescriptions;
158 NSArray *o_hotkeysNonUseableKeys;
159 NSMutableArray *o_hotkeySettings;
160 NSNumber *o_keyInTransition;
162 intf_thread_t *p_intf;
164 + (VLCSimplePrefs *)sharedInstance;
165 - (NSString *)OSXKeyToString:(int)val;
168 - (NSToolbarItem *) toolbar: (NSToolbar *)o_toolbar
169 itemForItemIdentifier: (NSString *)o_itemIdent
170 willBeInsertedIntoToolbar: (BOOL)b_willBeInserted;
171 - (NSArray *)toolbarDefaultItemIdentifiers: (NSToolbar *)toolbar;
172 - (NSArray *)toolbarAllowedItemIdentifiers: (NSToolbar *)toolbar;
175 - (void)resetControls;
176 - (void)showSimplePrefs;
178 - (IBAction)buttonAction:(id)sender;
179 - (void)sheetDidEnd:(NSWindow *)o_sheet
180 returnCode:(int)i_return
181 contextInfo:(void *)o_context;
183 - (void)saveChangedSettings;
186 - (IBAction)interfaceSettingChanged:(id)sender;
187 - (void)showInterfaceSettings;
190 - (IBAction)audioSettingChanged:(id)sender;
191 - (void)showAudioSettings;
194 - (IBAction)videoSettingChanged:(id)sender;
195 - (void)showVideoSettings;
197 /* OSD / subtitles */
198 - (IBAction)osdSettingChanged:(id)sender;
199 - (void)showOSDSettings;
202 - (IBAction)inputSettingChanged:(id)sender;
203 - (void)showInputSettings;
206 - (IBAction)hotkeySettingChanged:(id)sender;
207 - (void)showHotkeySettings;
208 - (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView;
209 - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex;
210 - (void)changeHotkeyTo: (int)i_theNewKey;
214 @interface VLCHotkeyChangeWindow : NSWindow
216 - (void)keyDown:(NSEvent *)theEvent;