Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

intf.h

00001 /*****************************************************************************
00002  * intf.h: MacOS X interface module
00003  *****************************************************************************
00004  * Copyright (C) 2002-2005 the VideoLAN team
00005  * $Id: intf.h 12756 2005-10-02 19:47:03Z fkuehne $
00006  *
00007  * Authors: Jon Lech Johansen <[email protected]>
00008  *          Christophe Massiot <[email protected]>
00009  *          Derk-Jan Hartman <hartman at videolan dot org>
00010  *
00011  * This program is free software; you can redistribute it and/or modify
00012  * it under the terms of the GNU General Public License as published by
00013  * the Free Software Foundation; either version 2 of the License, or
00014  * (at your option) any later version.
00015  *
00016  * This program is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  * GNU General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU General Public License
00022  * along with this program; if not, write to the Free Software
00023  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
00024  *****************************************************************************/
00025 
00026 #include <vlc/vlc.h>
00027 #include <vlc/intf.h>
00028 #include <vlc/vout.h>
00029 #include <vlc/aout.h>
00030 #include <vlc/input.h>
00031 
00032 #include <Cocoa/Cocoa.h>
00033 
00034 /*****************************************************************************
00035  * Local prototypes.
00036  *****************************************************************************/
00037 int ExecuteOnMainThread( id target, SEL sel, void * p_arg );
00038 unsigned int CocoaKeyToVLC( unichar i_key );
00039 
00040 #define VLCIntf [[VLCMain sharedInstance] getIntf]
00041 
00042 #define _NS(s) [[VLCMain sharedInstance] localizedString: _(s)]
00043 /* Get an alternate version of the string.
00044  * This string is stored as '1:string' but when displayed it only displays
00045  * the translated string. the translation should be '1:translatedstring' though */
00046 #define _ANS(s) [[[VLCMain sharedInstance] localizedString: _(s)] substringFromIndex:2]
00047 
00048 #define MACOS_VERSION [[[NSDictionary dictionaryWithContentsOfFile: \
00049             @"/System/Library/CoreServices/SystemVersion.plist"] \
00050             objectForKey: @"ProductVersion"] floatValue]
00051 
00052 /*****************************************************************************
00053  * intf_sys_t: description and status of the interface
00054  *****************************************************************************/
00055 struct intf_sys_t
00056 {
00057     NSAutoreleasePool * o_pool;
00058     NSPort * o_sendport;
00059 
00060     /* the current input */
00061     input_thread_t * p_input;
00062 
00063     /* special actions */
00064     vlc_bool_t b_mute;
00065     int i_play_status;
00066 
00067     /* interface update */
00068     vlc_bool_t b_intf_update;
00069     vlc_bool_t b_playlist_update;
00070     vlc_bool_t b_playmode_update;
00071     vlc_bool_t b_current_title_update;
00072     vlc_bool_t b_fullscreen_update;
00073     vlc_bool_t b_volume_update;
00074 
00075     /* menus handlers */
00076     vlc_bool_t b_input_update;
00077     vlc_bool_t b_aout_update;
00078     vlc_bool_t b_vout_update;
00079 
00080     /* The messages window */
00081     msg_subscription_t * p_sub;
00082 };
00083 
00084 /*****************************************************************************
00085  * VLCMain interface
00086  *****************************************************************************/
00087 @interface VLCMain : NSObject
00088 {
00089     intf_thread_t *p_intf;      /* The main intf object */
00090     id o_prefs;                 /* VLCPrefs       */
00091     id o_about;                 /* VLAboutBox     */
00092     id o_open;                  /* VLCOpen        */
00093     id o_wizard;                /* VLCWizard      */
00094     id o_extended;              /* VLCExtended    */
00095     id o_bookmarks;             /* VLCBookmarks   */
00096     /*id o_update;                 VLCUpdate      */
00097     BOOL nib_main_loaded;       /* reference to the main-nib */
00098     BOOL nib_open_loaded;       /* reference to the open-nib */
00099     BOOL nib_about_loaded;      /* reference to the about-nib */
00100     BOOL nib_wizard_loaded;     /* reference to the wizard-nib */
00101     BOOL nib_extended_loaded;   /* reference to the extended-nib */
00102     BOOL nib_bookmarks_loaded;  /* reference to the bookmarks-nib */ 
00103     /*BOOL nib_update_loaded;      reference to the update-nib */
00104 
00105     IBOutlet id o_window;       /* main window    */
00106     IBOutlet id o_playlist_view;/* playlist view  */
00107     IBOutlet id o_scrollfield;  /* info field     */
00108     IBOutlet id o_timefield;    /* time field     */
00109     IBOutlet id o_timeslider;   /* time slider    */
00110     float f_slider;             /* slider value   */
00111     float f_slider_old;         /* old slider val */
00112     IBOutlet id o_volumeslider; /* volume slider  */
00113 
00114     IBOutlet id o_btn_prev;     /* btn previous   */
00115     IBOutlet id o_btn_rewind;   /* btn rewind     */
00116     IBOutlet id o_btn_play;     /* btn play       */
00117     IBOutlet id o_btn_stop;     /* btn stop       */
00118     IBOutlet id o_btn_ff;       /* btn fast forward     */
00119     IBOutlet id o_btn_next;     /* btn next       */
00120     IBOutlet id o_btn_fullscreen;/* btn fullscreen      */
00121     IBOutlet id o_btn_playlist; /* btn playlist   */
00122 
00123     NSImage * o_img_play;       /* btn play img   */
00124     NSImage * o_img_pause;      /* btn pause img  */
00125     NSImage * o_img_play_pressed;       /* btn play img   */
00126     NSImage * o_img_pause_pressed;      /* btn pause img  */
00127 
00128     IBOutlet id o_controls;     /* VLCControls    */
00129     IBOutlet id o_playlist;     /* VLCPlaylist    */
00130     IBOutlet id o_info;         /* VLCInfo        */
00131 
00132     IBOutlet id o_messages;     /* messages tv    */
00133     IBOutlet id o_msgs_panel;   /* messages panel */
00134     NSMutableArray * o_msg_arr; /* messages array */
00135     NSLock * o_msg_lock;        /* messages lock  */
00136     IBOutlet id o_msgs_btn_crashlog;    /* messages open crashlog */
00137 
00138     IBOutlet id o_error;        /* error panel    */
00139     IBOutlet id o_err_msg;      /* NSTextView     */
00140     IBOutlet id o_err_lbl;
00141     IBOutlet id o_err_bug_lbl;
00142     IBOutlet id o_err_btn_msgs; /* Open Messages  */
00143     IBOutlet id o_err_btn_dismiss;
00144     IBOutlet id o_err_ckbk_surpress;
00145 
00146     IBOutlet id o_info_window;  /* Info panel     */
00147 
00148     /* main menu */
00149 
00150     IBOutlet id o_mi_about;
00151     IBOutlet id o_mi_prefs;
00152     /*IBOutlet id o_mi_checkForUpdate;*/
00153     IBOutlet id o_mi_add_intf;
00154     IBOutlet id o_mu_add_intf;
00155     IBOutlet id o_mi_services;
00156     IBOutlet id o_mi_hide;
00157     IBOutlet id o_mi_hide_others;
00158     IBOutlet id o_mi_show_all;
00159     IBOutlet id o_mi_quit;
00160 
00161     IBOutlet id o_mu_file;
00162     IBOutlet id o_mi_open_file;
00163     IBOutlet id o_mi_open_generic;
00164     IBOutlet id o_mi_open_disc;
00165     IBOutlet id o_mi_open_net;
00166     IBOutlet id o_mi_open_recent;
00167     IBOutlet id o_mi_open_recent_cm;
00168     IBOutlet id o_mi_open_wizard;
00169 
00170     IBOutlet id o_mu_edit;
00171     IBOutlet id o_mi_cut;
00172     IBOutlet id o_mi_copy;
00173     IBOutlet id o_mi_paste;
00174     IBOutlet id o_mi_clear;
00175     IBOutlet id o_mi_select_all;
00176 
00177     IBOutlet id o_mu_controls;
00178     IBOutlet id o_mi_play;
00179     IBOutlet id o_mi_stop;
00180     IBOutlet id o_mi_faster;
00181     IBOutlet id o_mi_slower;
00182     IBOutlet id o_mi_previous;
00183     IBOutlet id o_mi_next;
00184     IBOutlet id o_mi_random;
00185     IBOutlet id o_mi_repeat;
00186     IBOutlet id o_mi_loop;
00187     IBOutlet id o_mi_fwd;
00188     IBOutlet id o_mi_bwd;
00189     IBOutlet id o_mi_fwd1m;
00190     IBOutlet id o_mi_bwd1m;
00191     IBOutlet id o_mi_fwd5m;
00192     IBOutlet id o_mi_bwd5m;
00193     IBOutlet id o_mi_program;
00194     IBOutlet id o_mu_program;
00195     IBOutlet id o_mi_title;
00196     IBOutlet id o_mu_title;
00197     IBOutlet id o_mi_chapter;
00198     IBOutlet id o_mu_chapter;
00199 
00200     IBOutlet id o_mu_audio;
00201     IBOutlet id o_mi_vol_up;
00202     IBOutlet id o_mi_vol_down;
00203     IBOutlet id o_mi_mute;
00204     IBOutlet id o_mi_audiotrack;
00205     IBOutlet id o_mu_audiotrack;
00206     IBOutlet id o_mi_channels;
00207     IBOutlet id o_mu_channels;
00208     IBOutlet id o_mi_device;
00209     IBOutlet id o_mu_device;
00210     IBOutlet id o_mi_visual;
00211     IBOutlet id o_mu_visual;
00212 
00213     IBOutlet id o_mu_video;
00214     IBOutlet id o_mi_half_window;
00215     IBOutlet id o_mi_normal_window;
00216     IBOutlet id o_mi_double_window;
00217     IBOutlet id o_mi_fittoscreen;
00218     IBOutlet id o_mi_fullscreen;
00219     IBOutlet id o_mi_floatontop;
00220     IBOutlet id o_mi_snapshot;
00221     IBOutlet id o_mi_videotrack;
00222     IBOutlet id o_mu_videotrack;
00223     IBOutlet id o_mi_screen;
00224     IBOutlet id o_mu_screen;
00225     IBOutlet id o_mi_subtitle;
00226     IBOutlet id o_mu_subtitle;
00227     IBOutlet id o_mi_deinterlace;
00228     IBOutlet id o_mu_deinterlace;
00229     IBOutlet id o_mi_ffmpeg_pp;
00230     IBOutlet id o_mu_ffmpeg_pp;
00231 
00232     IBOutlet id o_mu_window;
00233     IBOutlet id o_mi_minimize;
00234     IBOutlet id o_mi_close_window;
00235     IBOutlet id o_mi_controller;
00236     IBOutlet id o_mi_equalizer;
00237     IBOutlet id o_mi_extended;
00238     IBOutlet id o_mi_bookmarks;
00239     IBOutlet id o_mi_playlist;
00240     IBOutlet id o_mi_info;
00241     IBOutlet id o_mi_messages;
00242     IBOutlet id o_mi_bring_atf;
00243 
00244     IBOutlet id o_mu_help;
00245     IBOutlet id o_mi_readme;
00246     IBOutlet id o_mi_documentation;
00247     IBOutlet id o_mi_reportabug;
00248     IBOutlet id o_mi_website;
00249     IBOutlet id o_mi_license;
00250     IBOutlet id o_mi_donation;
00251     IBOutlet id o_mi_forum;
00252 
00253     /* dock menu */
00254     IBOutlet id o_dmi_play;
00255     IBOutlet id o_dmi_stop;
00256     IBOutlet id o_dmi_next;
00257     IBOutlet id o_dmi_previous;
00258     IBOutlet id o_dmi_mute;
00259 
00260     bool b_small_window;
00261 
00262     mtime_t i_end_scroll;
00263 
00264     NSSize o_size_with_playlist;
00265 
00266     int     i_lastShownVolume;
00267 }
00268 
00269 + (VLCMain *)sharedInstance;
00270 
00271 - (intf_thread_t *)getIntf;
00272 - (void)setIntf:(intf_thread_t *)p_mainintf;
00273 
00274 - (id)getControls;
00275 - (id)getPlaylist;
00276 - (id)getInfo;
00277 - (id)getWizard;
00278 - (id)getBookmarks;
00279 - (void)terminate;
00280 - (NSString *)localizedString:(char *)psz;
00281 - (char *)delocalizeString:(NSString *)psz;
00282 - (NSString *)wrapString: (NSString *)o_in_string toWidth: (int)i_width;
00283 - (BOOL)hasDefinedShortcutKey:(NSEvent *)o_event;
00284 
00285 - (void)initStrings;
00286 
00287 - (void)manage;
00288 - (void)manageIntf:(NSTimer *)o_timer;
00289 - (void)setupMenus;
00290 - (void)setScrollField:(NSString *)o_string stopAfter:(int )timeout;
00291 - (void)resetScrollField;
00292 
00293 - (void)updateMessageArray;
00294 - (void)playStatusUpdated:(int) i_status;
00295 - (void)setSubmenusEnabled:(BOOL)b_enabled;
00296 - (void)manageVolumeSlider;
00297 - (IBAction)timesliderUpdate:(id)sender;
00298 
00299 - (IBAction)clearRecentItems:(id)sender;
00300 - (void)openRecentItem:(id)sender;
00301 
00302 - (IBAction)intfOpenFile:(id)sender;
00303 - (IBAction)intfOpenFileGeneric:(id)sender;
00304 - (IBAction)intfOpenDisc:(id)sender;
00305 - (IBAction)intfOpenNet:(id)sender;
00306 
00307 - (IBAction)showWizard:(id)sender;
00308 - (IBAction)showExtended:(id)sender;
00309 - (IBAction)showBookmarks:(id)sender;
00310 
00311 - (IBAction)viewAbout:(id)sender;
00312 - (IBAction)viewPreferences:(id)sender;
00313 /*- (IBAction)checkForUpdate:(id)sender;*/
00314 - (IBAction)closeError:(id)sender;
00315 - (IBAction)openReadMe:(id)sender;
00316 - (IBAction)openDocumentation:(id)sender;
00317 - (IBAction)reportABug:(id)sender;
00318 - (IBAction)openWebsite:(id)sender;
00319 - (IBAction)openLicense:(id)sender;
00320 - (IBAction)openForum:(id)sender;
00321 - (IBAction)openDonate:(id)sender;
00322 - (IBAction)openCrashLog:(id)sender;
00323 
00324 - (IBAction)togglePlaylist:(id)sender;
00325 - (void)updateTogglePlaylistState;
00326 
00327 - (void)windowDidBecomeKey:(NSNotification *)o_notification;
00328 
00329 @end
00330 
00331 @interface VLCMain (Internal)
00332 - (void)handlePortMessage:(NSPortMessage *)o_msg;
00333 @end

Generated on Tue Dec 20 10:14:19 2005 for vlc-0.8.4a by  doxygen 1.4.2