]> git.sesse.net Git - vlc/blob - modules/gui/macosx/intf.h
Simplify FLAC extradata (streaminfo) parsing
[vlc] / modules / gui / macosx / intf.h
1 /*****************************************************************************
2  * intf.h: MacOS X interface module
3  *****************************************************************************
4  * Copyright (C) 2002-2013 VLC authors and VideoLAN
5  * $Id$
6  *
7  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
8  *          Derk-Jan Hartman <hartman at videolan dot org>
9  *          Felix Paul Kühne <fkuehne at videolan dot org>
10  *          David Fuhrmann <david dot fuhrmann at googlemail dot com>
11  *          Pierre d'Herbemont <pdherbemont # videolan org>
12  *
13  * This program is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation; either version 2 of the License, or
16  * (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software
25  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
26  *****************************************************************************/
27
28 #ifdef HAVE_CONFIG_H
29 #   include "config.h"
30 #endif
31
32 #import <vlc_common.h>
33 #import <vlc_interface.h>
34 #import <vlc_playlist.h>
35 #import <vlc_vout.h>
36 #import <vlc_aout.h>
37 #import <vlc_input.h>
38 #import <vlc_vout_window.h>
39
40 #import <Cocoa/Cocoa.h>
41 #import "CompatibilityFixes.h"
42 #import "SPMediaKeyTap.h"                   /* for the media key support */
43 #import "misc.h"
44 #import "MainWindow.h"
45 #import "VLCVoutWindowController.h"
46 #import "StringUtility.h"
47
48 #import <IOKit/pwr_mgt/IOPMLib.h>           /* for sleep prevention */
49
50 /*****************************************************************************
51  * Local prototypes.
52  *****************************************************************************/
53 #define VLCIntf [[VLCMain sharedInstance] intf]
54
55 // You need to release those objects after use
56 input_thread_t *getInput(void);
57 vout_thread_t *getVout(void);
58 vout_thread_t *getVoutForActiveWindow(void);
59 audio_output_t *getAout(void);
60
61 /*****************************************************************************
62  * intf_sys_t: description and status of the interface
63  *****************************************************************************/
64 struct intf_sys_t
65 {
66     /* menus handlers */
67     bool b_input_update;
68     bool b_aout_update;
69     bool b_vout_update;
70 };
71
72 /*****************************************************************************
73  * VLCMain interface
74  *****************************************************************************/
75 @class AppleRemote;
76 @class VLCInformation;
77 @class VLCEmbeddedWindow;
78 @class VLCControls;
79 @class VLCPlaylist;
80
81 @interface VLCMain : NSObject <NSWindowDelegate, NSApplicationDelegate>
82 {
83     intf_thread_t *p_intf;      /* The main intf object */
84     input_thread_t *p_current_input, *p_input_changed;
85     id o_mainmenu;              /* VLCMainMenu */
86     id o_prefs;                 /* VLCPrefs       */
87     id o_sprefs;                /* VLCSimplePrefs */
88     id o_open;                  /* VLCOpen        */
89     id o_wizard;                /* VLCWizard      */
90     id o_coredialogs;           /* VLCCoreDialogProvider */
91     id o_info;                  /* VLCInformation */
92     id o_eyetv;                 /* VLCEyeTVController */
93     id o_bookmarks;             /* VLCBookmarks */
94     id o_coreinteraction;       /* VLCCoreInteraction */
95     BOOL nib_main_loaded;       /* main nibfile */
96     BOOL nib_open_loaded;       /* open nibfile */
97     BOOL nib_about_loaded;      /* about nibfile */
98     BOOL nib_wizard_loaded;     /* wizard nibfile */
99     BOOL nib_prefs_loaded;      /* preferences nibfile */
100     BOOL nib_info_loaded;       /* information panel nibfile */
101     BOOL nib_coredialogs_loaded; /* CoreDialogs nibfile */
102     BOOL nib_bookmarks_loaded;   /* Bookmarks nibfile */
103     BOOL b_active_videoplayback;
104     BOOL b_nativeFullscreenMode;
105
106     VLCMainWindow *o_mainwindow;            /* VLCMainWindow */
107
108     IBOutlet VLCControls * o_controls;     /* VLCControls    */
109     IBOutlet VLCPlaylist * o_playlist;     /* VLCPlaylist    */
110
111     /* messages panel */
112     IBOutlet NSWindow * o_msgs_panel;           /* messages panel */
113     NSMutableArray * o_msg_arr;                 /* messages array */
114     NSLock * o_msg_lock;                        /* messages lock */
115     BOOL b_msg_arr_changed;                     /* did the array change? */
116     IBOutlet NSButton * o_msgs_crashlog_btn;    /* messages open crashlog */
117     IBOutlet NSButton * o_msgs_save_btn;        /* save the log as rtf */
118     IBOutlet NSButton * o_msgs_refresh_btn;     /* update the panel */
119     IBOutlet id o_msgs_table;
120
121     /* CrashReporter panel */
122     IBOutlet NSButton * o_crashrep_dontSend_btn;
123     IBOutlet NSButton * o_crashrep_send_btn;
124     IBOutlet NSTextView * o_crashrep_fld;
125     IBOutlet NSTextField * o_crashrep_title_txt;
126     IBOutlet NSTextField * o_crashrep_desc_txt;
127     IBOutlet NSWindow * o_crashrep_win;
128     IBOutlet NSButton * o_crashrep_includeEmail_ckb;
129     IBOutlet NSButton * o_crashrep_dontaskagain_ckb;
130     IBOutlet NSTextField * o_crashrep_includeEmail_txt;
131     NSURLConnection * crashLogURLConnection;
132
133     AppleRemote * o_remote;
134     BOOL b_remote_button_hold; /* true as long as the user holds the left,right,plus or minus on the remote control */
135
136     /* media key support */
137     BOOL b_mediaKeySupport;
138     BOOL b_mediakeyJustJumped;
139     SPMediaKeyTap * o_mediaKeyController;
140
141     NSArray *o_usedHotkeys;
142
143     /* sleep management */
144     IOPMAssertionID systemSleepAssertionID;
145     IOPMAssertionID userActivityAssertionID;
146
147     VLCVoutWindowController *o_vout_controller;
148
149     /* iTunes play/pause support */
150     BOOL b_has_itunes_paused;
151     NSTimer *o_itunes_play_timer;
152
153     BOOL b_playlist_updated_selector_in_queue;
154 }
155
156 @property (readonly) VLCVoutWindowController* voutController;
157 @property (readonly) BOOL nativeFullscreenMode;
158 @property (nonatomic, readwrite) BOOL playlistUpdatedSelectorInQueue;
159 + (VLCMain *)sharedInstance;
160
161 - (intf_thread_t *)intf;
162 - (void)setIntf:(intf_thread_t *)p_mainintf;
163
164 - (id)mainMenu;
165 - (VLCMainWindow *)mainWindow;
166 - (id)controls;
167 - (id)bookmarks;
168 - (id)open;
169 - (id)simplePreferences;
170 - (id)preferences;
171 - (id)playlist;
172 - (id)info;
173 - (id)wizard;
174 - (id)coreDialogProvider;
175 - (id)eyeTVController;
176 - (id)appleRemoteController;
177 - (void)setActiveVideoPlayback:(BOOL)b_value;
178 - (BOOL)activeVideoPlayback;
179 - (void)applicationWillTerminate:(NSNotification *)notification;
180 - (void)updateCurrentlyUsedHotkeys;
181 - (BOOL)hasDefinedShortcutKey:(NSEvent *)o_event force:(BOOL)b_force;
182
183 - (void)PlaylistItemChanged;
184 - (void)playbackStatusUpdated;
185 - (void)sendDistributedNotificationWithUpdatedPlaybackStatus;
186 - (void)playbackModeUpdated;
187 - (void)updateVolume;
188 - (void)updatePlaybackPosition;
189 - (void)updateName;
190 - (void)playlistUpdated;
191 - (void)updateRecordState: (BOOL)b_value;
192 - (void)updateInfoandMetaPanel;
193 - (void)updateMainMenu;
194 - (void)updateMainWindow;
195 - (void)showMainWindow;
196 - (void)showFullscreenController;
197 - (void)updateDelays;
198 - (void)initStrings;
199
200 - (IBAction)crashReporterAction:(id)sender;
201 - (IBAction)openCrashLog:(id)sender;
202 - (IBAction)saveDebugLog:(id)sender;
203 - (IBAction)showMessagesPanel:(id)sender;
204 - (IBAction)updateMessagesPanel:(id)sender;
205
206 - (void)processReceivedlibvlcMessage:(const vlc_log_t *) item ofType: (int)type withStr: (char *)str;
207
208 - (void)updateTogglePlaylistState;
209
210 - (void)windowDidBecomeKey:(NSNotification *)o_notification;
211
212 - (void)mediaKeyTap:(SPMediaKeyTap*)keyTap receivedMediaKeyEvent:(NSEvent*)event;
213 @end
214
215
216 /*****************************************************************************
217  * VLCApplication interface
218  *****************************************************************************/
219
220 @interface VLCApplication : NSApplication
221
222 @end