]> git.sesse.net Git - vlc/blob - modules/gui/macosx/open.h
macosx: Fix drawing issues with podcast controls and dropzone
[vlc] / modules / gui / macosx / open.h
1 /*****************************************************************************
2  * open.h: Open dialogues for VLC's MacOS X port
3  *****************************************************************************
4  * Copyright (C) 2002-2012 VLC authors and VideoLAN
5  * $Id$
6  *
7  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
8  *          Christophe Massiot <massiot@via.ecp.fr>
9  *          Derk-Jan Hartman <thedj@users.sourceforge.net>
10  *          Felix Paul Kühne <fkuehne at videolan dot org>
11  *
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 2 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, write to the Free Software
24  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
25  *****************************************************************************/
26
27 #define kVLCMediaAudioCD @"AudioCD"
28 #define kVLCMediaDVD @"DVD"
29 #define kVLCMediaVCD @"VCD"
30 #define kVLCMediaSVCD @"SVCD"
31 #define kVLCMediaBD @"Blu-ray"
32 #define kVLCMediaVideoTSFolder @"VIDEO_TS"
33 #define kVLCMediaBDMVFolder @"BDMV"
34 #define kVLCMediaUnknown @"Unknown"
35
36 /*****************************************************************************
37  * Intf_Open interface
38  *****************************************************************************/
39 @interface VLCOpen : NSObject
40 {
41     IBOutlet id o_panel;
42
43     IBOutlet id o_mrl_fld;
44     IBOutlet id o_mrl_lbl;
45     IBOutlet id o_mrl_view;
46     IBOutlet id o_mrl_btn;
47     IBOutlet id o_tabview;
48
49     IBOutlet id o_btn_ok;
50     IBOutlet id o_btn_cancel;
51
52     /* bottom-line items */
53     IBOutlet id o_output_ckbox;
54     IBOutlet id o_sout_options;
55
56     /* open file */
57     IBOutlet id o_file_name;
58     IBOutlet id o_file_name_stub;
59     IBOutlet id o_file_icon_well;
60     IBOutlet id o_file_btn_browse;
61     IBOutlet id o_file_stream;
62     IBOutlet id o_file_slave_ckbox;
63     IBOutlet id o_file_slave_select_btn;
64     IBOutlet id o_file_slave_filename_lbl;
65     IBOutlet id o_file_slave_icon_well;
66     IBOutlet id o_file_subtitles_filename_lbl;
67     IBOutlet id o_file_subtitles_icon_well;
68     IBOutlet id o_file_custom_timing_ckb;
69     IBOutlet id o_file_starttime_fld;
70     IBOutlet id o_file_starttime_lbl;
71     IBOutlet id o_file_stoptime_fld;
72     IBOutlet id o_file_stoptime_lbl;
73
74     /* open disc */
75     IBOutlet id o_disc_selector_pop;
76
77     IBOutlet id o_disc_nodisc_view;
78     IBOutlet id o_disc_nodisc_lbl;
79     IBOutlet id o_disc_nodisc_videots_btn;
80
81     IBOutlet id o_disc_audiocd_view;
82     IBOutlet id o_disc_audiocd_lbl;
83     IBOutlet id o_disc_audiocd_trackcount_lbl;
84     IBOutlet id o_disc_audiocd_videots_btn;
85
86     IBOutlet id o_disc_dvd_view;
87     IBOutlet id o_disc_dvd_lbl;
88     IBOutlet id o_disc_dvd_disablemenus_btn;
89     IBOutlet id o_disc_dvd_videots_btn;
90
91     IBOutlet id o_disc_dvdwomenus_view;
92     IBOutlet id o_disc_dvdwomenus_lbl;
93     IBOutlet id o_disc_dvdwomenus_enablemenus_btn;
94     IBOutlet id o_disc_dvdwomenus_videots_btn;
95     IBOutlet id o_disc_dvdwomenus_title;
96     IBOutlet id o_disc_dvdwomenus_title_lbl;
97     IBOutlet id o_disc_dvdwomenus_title_stp;
98     IBOutlet id o_disc_dvdwomenus_chapter;
99     IBOutlet id o_disc_dvdwomenus_chapter_lbl;
100     IBOutlet id o_disc_dvdwomenus_chapter_stp;
101
102     IBOutlet id o_disc_vcd_view;
103     IBOutlet id o_disc_vcd_lbl;
104     IBOutlet id o_disc_vcd_videots_btn;
105     IBOutlet id o_disc_vcd_title;
106     IBOutlet id o_disc_vcd_title_lbl;
107     IBOutlet id o_disc_vcd_title_stp;
108     IBOutlet id o_disc_vcd_chapter;
109     IBOutlet id o_disc_vcd_chapter_lbl;
110     IBOutlet id o_disc_vcd_chapter_stp;
111
112     IBOutlet id o_disc_bd_view;
113     IBOutlet id o_disc_bd_lbl;
114     IBOutlet id o_disc_bd_videots_btn;
115
116     /* open network */
117     IBOutlet id o_net_http_url;
118     IBOutlet id o_net_http_url_lbl;
119     IBOutlet id o_net_help_lbl;
120
121     /* open UDP stuff panel */
122     IBOutlet id o_net_help_udp_lbl;
123     IBOutlet id o_net_udp_protocol_mat;
124     IBOutlet id o_net_udp_protocol_lbl;
125     IBOutlet id o_net_udp_address_lbl;
126     IBOutlet id o_net_udp_mode_lbl;
127     IBOutlet id o_net_mode;
128     IBOutlet id o_net_openUDP_btn;
129     IBOutlet id o_net_udp_cancel_btn;
130     IBOutlet id o_net_udp_ok_btn;
131     IBOutlet id o_net_udp_panel;
132     IBOutlet id o_net_udp_port;
133     IBOutlet id o_net_udp_port_lbl;
134     IBOutlet id o_net_udp_port_stp;
135     IBOutlet id o_net_udpm_addr;
136     IBOutlet id o_net_udpm_addr_lbl;
137     IBOutlet id o_net_udpm_port;
138     IBOutlet id o_net_udpm_port_lbl;
139     IBOutlet id o_net_udpm_port_stp;
140
141     /* open subtitle file */
142     IBOutlet id o_file_sub_ckbox;
143     IBOutlet id o_file_sub_btn_settings;
144     IBOutlet id o_file_sub_sheet;
145     IBOutlet id o_file_sub_path_lbl;
146     IBOutlet id o_file_sub_path_fld;
147     IBOutlet id o_file_sub_icon_view;
148     IBOutlet id o_file_sub_btn_browse;
149     IBOutlet id o_file_sub_override;
150     IBOutlet id o_file_sub_delay;
151     IBOutlet id o_file_sub_delay_lbl;
152     IBOutlet id o_file_sub_delay_stp;
153     IBOutlet id o_file_sub_fps;
154     IBOutlet id o_file_sub_fps_lbl;
155     IBOutlet id o_file_sub_fps_stp;
156     IBOutlet id o_file_sub_encoding_pop;
157     IBOutlet id o_file_sub_encoding_lbl;
158     IBOutlet id o_file_sub_size_pop;
159     IBOutlet id o_file_sub_size_lbl;
160     IBOutlet id o_file_sub_align_pop;
161     IBOutlet id o_file_sub_align_lbl;
162     IBOutlet id o_file_sub_ok_btn;
163     IBOutlet id o_file_sub_font_box;
164     IBOutlet id o_file_sub_file_box;
165
166     /* generic capturing stuff */
167     IBOutlet id o_capture_lbl;
168     IBOutlet id o_capture_long_lbl;
169     IBOutlet id o_capture_mode_pop;
170     IBOutlet id o_capture_label_view;
171
172     /* eyetv support */
173     IBOutlet id o_eyetv_notLaunched_view;
174     IBOutlet id o_eyetv_running_view;
175     IBOutlet id o_eyetv_channels_pop;
176     IBOutlet id o_eyetv_currentChannel_lbl;
177     IBOutlet id o_eyetv_chn_status_txt;
178     IBOutlet id o_eyetv_chn_bgbar;
179     IBOutlet id o_eyetv_launchEyeTV_btn;
180     IBOutlet id o_eyetv_getPlugin_btn;
181     IBOutlet id o_eyetv_nextProgram_btn;
182     IBOutlet id o_eyetv_noInstance_lbl;
183     IBOutlet id o_eyetv_noInstanceLong_lbl;
184     IBOutlet id o_eyetv_previousProgram_btn;
185
186     /* screen support */
187     IBOutlet id o_screen_view;
188     IBOutlet id o_screen_long_lbl;
189     IBOutlet id o_screen_fps_fld;
190     IBOutlet id o_screen_fps_lbl;
191     IBOutlet id o_screen_fps_stp;
192     IBOutlet id o_screen_screen_lbl;
193     IBOutlet id o_screen_screen_pop;
194     IBOutlet id o_screen_left_fld;
195     IBOutlet id o_screen_left_lbl;
196     IBOutlet id o_screen_left_stp;
197     IBOutlet id o_screen_top_fld;
198     IBOutlet id o_screen_top_lbl;
199     IBOutlet id o_screen_top_stp;
200     IBOutlet id o_screen_width_fld;
201     IBOutlet id o_screen_width_lbl;
202     IBOutlet id o_screen_width_stp;
203     IBOutlet id o_screen_height_fld;
204     IBOutlet id o_screen_height_lbl;
205     IBOutlet id o_screen_height_stp;
206     IBOutlet id o_screen_follow_mouse_ckb;
207     IBOutlet id o_screen_qtk_audio_pop;
208     IBOutlet id o_screen_qtk_audio_ckb;
209
210     /* QTK support */
211     IBOutlet id o_qtk_view;
212     IBOutlet id o_qtk_video_device_pop;
213     IBOutlet id o_qtk_video_ckb;
214     IBOutlet id o_qtk_audio_device_pop;
215     IBOutlet id o_qtk_audio_ckb;
216     IBOutlet id o_capture_width_lbl;
217     IBOutlet id o_capture_width_fld;
218     IBOutlet id o_capture_width_stp;
219     IBOutlet id o_capture_height_lbl;
220     IBOutlet id o_capture_height_fld;
221     IBOutlet id o_capture_height_stp;
222
223     NSArray         *qtkvideoDevices;
224     NSArray         *qtkaudioDevices;
225     NSString        *qtk_currdevice_uid;
226     NSString        *qtkaudio_currdevice_uid;
227
228     BOOL b_autoplay;
229     BOOL b_nodvdmenus;
230     id o_currentOpticalMediaView;
231     id o_currentOpticalMediaIconView;
232     NSMutableArray *o_allMediaDevices;
233     NSArray *o_opticalDevices;
234     NSMutableArray *o_specialMediaFolders;
235     NSString *o_file_path;
236     id o_currentCaptureView;
237     NSString *o_file_slave_path;
238     NSString *o_sub_path;
239     NSString *o_mrl;
240     NSMutableArray *o_displayInfos;
241 }
242
243 + (VLCOpen *)sharedInstance;
244
245 @property (readwrite, assign) NSString *MRL;
246 @property (readonly) NSArray *qtkvideoDevices;
247 @property (readonly) NSArray *qtkaudioDevices;
248
249 /* text field / stepper binding values - subs panel */
250 @property (nonatomic) float fileSubDelay;
251 @property (nonatomic) float fileSubFps;
252
253
254 - (void)qtkrefreshVideoDevices;
255 - (void)qtkrefreshAudioDevices;
256
257 - (void)setSubPanel;
258 - (void)openTarget:(int)i_type;
259 - (void)tabView:(NSTabView *)o_tv didSelectTabViewItem:(NSTabViewItem *)o_tvi;
260 - (void)textFieldWasClicked:(NSNotification *)o_notification;
261 - (IBAction)expandMRLfieldAction:(id)sender;
262 - (IBAction)inputSlaveAction:(id)sender;
263 - (IBAction)fileTimeCustomization:(id)sender;
264
265 - (void)openFileGeneric;
266 - (void)openFilePathChanged:(NSNotification *)o_notification;
267 - (IBAction)openFileBrowse:(id)sender;
268 - (IBAction)openFileStreamChanged:(id)sender;
269
270 - (void)openDisc;
271 - (void)scanOpticalMedia:(NSNotification *)o_notification;
272 - (IBAction)discSelectorChanged:(id)sender;
273 - (IBAction)openSpecialMediaFolder:(id)sender;
274 - (IBAction)dvdreadOptionChanged:(id)sender;
275 - (IBAction)vcdOptionChanged:(id)sender;
276
277 // static helper functions
278 + (NSString *)getVolumeTypeFromMountPath:(NSString *)mountPath;
279 + (NSString *)getBSDNodeFromMountPath:(NSString *)mountPath;
280
281 - (void)openNet;
282 - (IBAction)openNetModeChanged:(id)sender;
283 - (IBAction)openNetStepperChanged:(id)sender;
284 - (void)openNetInfoChanged:(NSNotification *)o_notification;
285 - (IBAction)openNetUDPButtonAction:(id)sender;
286
287 - (void)openCapture;
288 - (void)showCaptureView: theView;
289 - (IBAction)openCaptureModeChanged:(id)sender;
290 - (IBAction)qtkChanged:(id)sender;
291 - (IBAction)qtkAudioChanged:(id)sender;
292 - (IBAction)qtkToggleUIElements:(id)sender;
293 - (IBAction)screenChanged:(id)sender;
294 - (IBAction)eyetvSwitchChannel:(id)sender;
295 - (IBAction)eyetvLaunch:(id)sender;
296 - (IBAction)eyetvGetPlugin:(id)sender;
297 - (void)eyetvChanged:(NSNotification *)o_notification;
298 - (void)setupChannelInfo;
299 - (void)screenFPSfieldChanged:(NSNotification *)o_notification;
300
301 - (IBAction)subsChanged:(id)sender;
302 - (IBAction)subSettings:(id)sender;
303 - (IBAction)subFileBrowse:(id)sender;
304 - (IBAction)subOverride:(id)sender;
305
306 - (IBAction)subCloseSheet:(id)sender;
307
308 - (IBAction)panelCancel:(id)sender;
309 - (IBAction)panelOk:(id)sender;
310
311 - (void)openFile;
312 @end
313
314 @interface VLCOpenTextField : NSTextField
315 - (void)mouseDown:(NSEvent *)theEvent;
316 @end