1 /*****************************************************************************
2 * intf.h: MacOS X interface plugin
3 *****************************************************************************
4 * Copyright (C) 2002 VideoLAN
5 * $Id: intf.h,v 1.18 2003/01/27 00:08:31 jlj Exp $
7 * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
8 * Christophe Massiot <massiot@via.ecp.fr>
9 * Derk-Jan Hartman <thedj@users.sourceforge.net>
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
24 *****************************************************************************/
30 #include <Cocoa/Cocoa.h>
32 /*****************************************************************************
33 * VLCApplication interface
34 *****************************************************************************/
35 @interface VLCApplication : NSApplication
37 NSStringEncoding i_encoding;
38 intf_thread_t *p_intf;
41 - (void)initIntlSupport;
42 - (NSString *)localizedString:(char *)psz;
44 - (void)setIntf:(intf_thread_t *)p_intf;
45 - (intf_thread_t *)getIntf;
49 #define _NS(s) [NSApp localizedString: _(s)]
51 /*****************************************************************************
52 * intf_sys_t: description and status of the interface
53 *****************************************************************************/
56 NSAutoreleasePool * o_pool;
62 vlc_bool_t b_stopping;
66 vlc_bool_t b_chapter_update;
67 vlc_bool_t b_program_update;
68 vlc_bool_t b_title_update;
69 vlc_bool_t b_audio_update;
70 vlc_bool_t b_spu_update;
71 vlc_bool_t b_aout_update;
72 vlc_bool_t b_vout_update;
74 /* The input thread */
75 input_thread_t * p_input;
77 /* The messages window */
78 msg_subscription_t * p_sub;
84 /*****************************************************************************
86 *****************************************************************************/
87 @interface VLCMain : NSObject
89 id o_prefs; /* VLCPrefs */
91 IBOutlet id o_window; /* main window */
92 IBOutlet id o_timefield; /* time field */
93 IBOutlet id o_timeslider; /* time slider */
94 float f_slider; /* slider value */
95 float f_slider_old; /* old slider val */
96 IBOutlet id o_volumeslider; /* volume slider */
98 IBOutlet id o_btn_playlist; /* btn playlist */
99 IBOutlet id o_btn_prev; /* btn previous */
100 IBOutlet id o_btn_slowmotion; /* btn slowmotion */
101 IBOutlet id o_btn_play; /* btn play */
102 IBOutlet id o_btn_stop; /* btn stop */
103 IBOutlet id o_btn_fastforward; /* btn fastforward */
104 IBOutlet id o_btn_next; /* btn next */
105 IBOutlet id o_btn_prefs; /* btn prefs */
107 IBOutlet id o_controls; /* VLCControls */
108 IBOutlet id o_playlist; /* VLCPlaylist */
110 IBOutlet id o_messages; /* messages tv */
111 IBOutlet id o_msgs_panel; /* messages panel */
112 IBOutlet id o_msgs_btn_ok; /* messages btn */
113 NSMutableArray * o_msg_arr; /* messages array */
114 NSLock * o_msg_lock; /* messages lock */
116 IBOutlet id o_error; /* error panel */
117 IBOutlet id o_err_msg; /* NSTextView */
118 IBOutlet id o_err_lbl;
119 IBOutlet id o_err_bug_lbl;
120 IBOutlet id o_err_btn_msgs; /* Open Messages */
121 IBOutlet id o_err_btn_dismiss;
125 IBOutlet id o_mi_about;
126 IBOutlet id o_mi_prefs;
127 IBOutlet id o_mi_hide;
128 IBOutlet id o_mi_hide_others;
129 IBOutlet id o_mi_show_all;
130 IBOutlet id o_mi_quit;
132 IBOutlet id o_mu_file;
133 IBOutlet id o_mi_open_file;
134 IBOutlet id o_mi_open_generic;
135 IBOutlet id o_mi_open_disc;
136 IBOutlet id o_mi_open_net;
137 IBOutlet id o_mi_open_recent;
138 IBOutlet id o_mi_open_recent_cm;
140 IBOutlet id o_mu_edit;
141 IBOutlet id o_mi_cut;
142 IBOutlet id o_mi_copy;
143 IBOutlet id o_mi_paste;
144 IBOutlet id o_mi_clear;
145 IBOutlet id o_mi_select_all;
147 IBOutlet id o_mu_controls;
148 IBOutlet id o_mi_play;
149 IBOutlet id o_mi_stop;
150 IBOutlet id o_mi_faster;
151 IBOutlet id o_mi_slower;
152 IBOutlet id o_mi_previous;
153 IBOutlet id o_mi_next;
154 IBOutlet id o_mi_loop;
155 IBOutlet id o_mi_program;
156 IBOutlet id o_mi_title;
157 IBOutlet id o_mi_chapter;
158 IBOutlet id o_mi_language;
159 IBOutlet id o_mi_subtitle;
161 IBOutlet id o_mu_audio;
162 IBOutlet id o_mi_vol_up;
163 IBOutlet id o_mi_vol_down;
164 IBOutlet id o_mi_mute;
165 IBOutlet id o_mi_channels;
166 IBOutlet id o_mi_device;
168 IBOutlet id o_mu_video;
169 IBOutlet id o_mi_fullscreen;
170 IBOutlet id o_mi_screen;
171 IBOutlet id o_mi_deinterlace;
173 IBOutlet id o_mu_window;
174 IBOutlet id o_mi_minimize;
175 IBOutlet id o_mi_close_window;
176 IBOutlet id o_mi_controller;
177 IBOutlet id o_mi_playlist;
178 IBOutlet id o_mi_messages;
179 IBOutlet id o_mi_bring_atf;
181 IBOutlet id o_mu_help;
182 IBOutlet id o_mi_readme;
183 IBOutlet id o_mi_reportabug;
184 IBOutlet id o_mi_website;
185 IBOutlet id o_mi_license;
188 IBOutlet id o_dmi_play;
189 IBOutlet id o_dmi_stop;
196 - (void)setControlItems;
199 - (void)setupLangMenu:(NSMenuItem *)o_mi
200 es:(es_descriptor_t *)p_es
202 selector:(SEL)pf_callback;
203 - (void)setupVarMenu:(NSMenuItem *)o_mi
204 target:(vlc_object_t *)p_object
205 var:(const char *)psz_var
206 selector:(SEL)pf_callback;
208 - (IBAction)clearRecentItems:(id)sender;
209 - (void)openRecentItem:(id)sender;
211 - (IBAction)viewPreferences:(id)sender;
213 - (IBAction)timesliderUpdate:(id)sender;
216 - (IBAction)closeError:(id)sender;
218 - (IBAction)openReadMe:(id)sender;
219 - (IBAction)reportABug:(id)sender;
220 - (IBAction)openWebsite:(id)sender;
221 - (IBAction)openLicense:(id)sender;
223 - (void)windowDidBecomeKey:(NSNotification *)o_notification;
227 @interface VLCMain (Internal)
228 - (void)handlePortMessage:(NSPortMessage *)o_msg;