intf.h 5.8 KB
Newer Older
1
/*****************************************************************************
2
 * intf.h: MacOS X interface module
3
 *****************************************************************************
4
 * Copyright (C) 2002-2014 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 14 15 16
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
17
 *
18 19 20 21 22 23 24
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
dionoea's avatar
dionoea committed
25
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
26 27
 *****************************************************************************/

Rafaël Carré's avatar
Rafaël Carré committed
28 29 30 31
#ifdef HAVE_CONFIG_H
#   include "config.h"
#endif

32 33 34 35 36 37
#import <vlc_common.h>
#import <vlc_interface.h>
#import <vlc_playlist.h>
#import <vlc_vout.h>
#import <vlc_aout.h>
#import <vlc_input.h>
38
#import <vlc_vout_window.h>
39

40
#import <Cocoa/Cocoa.h>
41
#import "SPMediaKeyTap.h"                   /* for the media key support */
42
#import "misc.h"
43
#import "MainWindow.h"
44
#import "VLCVoutWindowController.h"
45
#import "StringUtility.h"
46

47
/*****************************************************************************
hartman's avatar
hartman committed
48
 * Local prototypes.
49
 *****************************************************************************/
50
#define VLCIntf [[VLCMain sharedInstance] intf]
51

52 53 54
// You need to release those objects after use
input_thread_t *getInput(void);
vout_thread_t *getVout(void);
55
vout_thread_t *getVoutForActiveWindow(void);
56
audio_output_t *getAout(void);
57

58
static NSString * VLCInputChangedNotification = @"VLCInputChangedNotification";
59 60

/*****************************************************************************
61
 * VLCMain interface
62
 *****************************************************************************/
63
@class AppleRemote;
64
@class VLCInfo;
65
@class VLCControls;
66
@class VLCMainMenu;
67
@class VLCPlaylist;
68
@class InputManager;
69

70
@interface VLCMain : NSObject <NSWindowDelegate, NSApplicationDelegate>
71
{
hartman's avatar
hartman committed
72
    intf_thread_t *p_intf;      /* The main intf object */
Rafaël Carré's avatar
Rafaël Carré committed
73 74
    BOOL launched;              /* finishedLaunching */
    int items_at_launch;        /* items in playlist after launch */
75
    VLCMainMenu *o_mainmenu;    /* VLCMainMenu */
76
    id o_prefs;                 /* VLCPrefs       */
77
    id o_sprefs;                /* VLCSimplePrefs */
78
    id o_open;                  /* VLCOpen        */
79
    id o_wizard;                /* VLCWizard      */
80
    id o_coredialogs;           /* VLCCoreDialogProvider */
81
    VLCInfo *o_info;            /* VLCInformation */
82
    id o_eyetv;                 /* VLCEyeTVController */
83
    id o_bookmarks;             /* VLCBookmarks */
84
    id o_coreinteraction;       /* VLCCoreInteraction */
85 86 87 88
    BOOL nib_main_loaded;       /* main nibfile */
    BOOL nib_open_loaded;       /* open nibfile */
    BOOL nib_about_loaded;      /* about nibfile */
    BOOL nib_wizard_loaded;     /* wizard nibfile */
89
    BOOL nib_prefs_loaded;      /* preferences nibfile */
90
    BOOL nib_info_loaded;       /* information panel nibfile */
91
    BOOL nib_coredialogs_loaded; /* CoreDialogs nibfile */
92
    BOOL nib_bookmarks_loaded;   /* Bookmarks nibfile */
93
    BOOL b_active_videoplayback;
94
    BOOL b_nativeFullscreenMode;
95

96
    IBOutlet VLCMainWindow *o_mainwindow;            /* VLCMainWindow */
97

98 99
    IBOutlet VLCControls * o_controls;     /* VLCControls    */
    IBOutlet VLCPlaylist * o_playlist;     /* VLCPlaylist    */
100

101 102
    bool b_intf_terminating; /* Makes sure applicationWillTerminate will be called only once */

103
    AppleRemote * o_remote;
104
    BOOL b_remote_button_hold; /* true as long as the user holds the left,right,plus or minus on the remote control */
105

106 107 108 109
    /* media key support */
    BOOL b_mediaKeySupport;
    BOOL b_mediakeyJustJumped;
    SPMediaKeyTap * o_mediaKeyController;
110
    BOOL b_mediaKeyTrapEnabled;
111

112
    NSArray *o_usedHotkeys;
113

114
    VLCVoutWindowController *o_vout_controller;
115

116
    InputManager *o_input_manager;
117 118
}

119
@property (readonly) VLCVoutWindowController* voutController;
120
@property (readonly) BOOL nativeFullscreenMode;
121
@property (nonatomic, readwrite) BOOL playlistUpdatedSelectorInQueue;
hartman's avatar
hartman committed
122 123
+ (VLCMain *)sharedInstance;

124
- (intf_thread_t *)intf;
hartman's avatar
hartman committed
125 126
- (void)setIntf:(intf_thread_t *)p_mainintf;

127
- (VLCMainMenu *)mainMenu;
128
- (VLCMainWindow *)mainWindow;
129
- (id)controls;
130 131
- (id)bookmarks;
- (id)open;
132 133
- (id)simplePreferences;
- (id)preferences;
134 135
- (VLCPlaylist *)playlist;
- (VLCInfo *)info;
136 137 138
- (id)wizard;
- (id)coreDialogProvider;
- (id)eyeTVController;
139
- (id)appleRemoteController;
140 141
- (void)setActiveVideoPlayback:(BOOL)b_value;
- (BOOL)activeVideoPlayback;
142
- (void)applicationWillTerminate:(NSNotification *)notification;
143
- (void)updateCurrentlyUsedHotkeys;
144
- (BOOL)hasDefinedShortcutKey:(NSEvent *)o_event force:(BOOL)b_force;
145

146
- (void)plItemUpdated;
147
- (void)playbackModeUpdated;
Felix Paul Kühne's avatar
Felix Paul Kühne committed
148
- (void)showFullscreenController;
149

150 151
- (void)updateTogglePlaylistState;

152
- (void)mediaKeyTap:(SPMediaKeyTap*)keyTap receivedMediaKeyEvent:(NSEvent*)event;
153 154 155

- (void)resetAndReinitializeUserDefaults;

156 157
- (BOOL)isTerminating;

158 159
@end

160 161 162 163 164 165

/*****************************************************************************
 * VLCApplication interface
 *****************************************************************************/

@interface VLCApplication : NSApplication
Felix Paul Kühne's avatar
Felix Paul Kühne committed
166

167
@end