1 /*****************************************************************************
2 * MainWindow.h: MacOS X interface module
3 *****************************************************************************
4 * Copyright (C) 2002-2011 VideoLAN
7 * Authors: Felix Paul Kühne <fkuehne -at- videolan -dot- org>
8 * Jon Lech Johansen <jon-vl@nanocrew.net>
9 * Christophe Massiot <massiot@via.ecp.fr>
10 * Derk-Jan Hartman <hartman at videolan.org>
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.
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.
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 *****************************************************************************/
27 #import <Cocoa/Cocoa.h>
28 #import "PXSourceList.h"
33 #ifndef MAC_OS_X_VERSION_10_6
34 @protocol NSAnimationDelegate <NSObject> @end
37 @interface VLCMainWindow : NSWindow <PXSourceListDataSource, PXSourceListDelegate, NSWindowDelegate, NSAnimationDelegate> {
38 IBOutlet id o_play_btn;
39 IBOutlet id o_bwd_btn;
40 IBOutlet id o_fwd_btn;
41 IBOutlet id o_stop_btn;
42 IBOutlet id o_playlist_btn;
43 IBOutlet id o_repeat_btn;
44 IBOutlet id o_shuffle_btn;
45 IBOutlet id o_effects_btn;
46 IBOutlet id o_fullscreen_btn;
47 IBOutlet id o_search_fld;
48 IBOutlet id o_volume_sld;
49 IBOutlet id o_volume_track_view;
50 IBOutlet id o_volume_down_btn;
51 IBOutlet id o_volume_up_btn;
52 IBOutlet id o_time_sld;
53 IBOutlet id o_time_sld_fancygradient_view;
54 IBOutlet id o_time_fld;
55 IBOutlet id o_progress_bar;
56 IBOutlet id o_bottombar_view;
57 IBOutlet id o_time_sld_left_view;
58 IBOutlet id o_time_sld_middle_view;
59 IBOutlet id o_time_sld_right_view;
60 // TODO Playlist table, additional ui stuff at the top of the window
61 IBOutlet id o_playlist_table;
62 IBOutlet id o_video_view;
63 IBOutlet id o_split_view;
64 IBOutlet id o_right_split_view;
65 IBOutlet id o_sidebar_view;
66 IBOutlet id o_chosen_category_lbl;
68 IBOutlet id o_dropzone_view;
69 IBOutlet id o_dropzone_btn;
70 IBOutlet id o_dropzone_lbl;
72 IBOutlet VLCFSPanel *o_fspanel;
74 BOOL b_dark_interface;
75 BOOL b_video_playback_enabled;
76 int i_lastShownVolume;
78 input_state_e cachedInputState;
80 NSImage * o_pause_img;
81 NSImage * o_pause_pressed_img;
83 NSImage * o_play_pressed_img;
84 NSImage * o_repeat_img;
85 NSImage * o_repeat_pressed_img;
86 NSImage * o_repeat_all_img;
87 NSImage * o_repeat_all_pressed_img;
88 NSImage * o_repeat_one_img;
89 NSImage * o_repeat_one_pressed_img;
90 NSImage * o_shuffle_img;
91 NSImage * o_shuffle_pressed_img;
92 NSImage * o_shuffle_on_img;
93 NSImage * o_shuffle_on_pressed_img;
95 NSTimeInterval last_fwd_event;
96 NSTimeInterval last_bwd_event;
97 BOOL just_triggered_next;
98 BOOL just_triggered_previous;
99 NSMutableArray *o_sidebaritems;
101 VLCWindow * o_nonembedded_window;
104 VLCWindow * o_fullscreen_window;
105 NSViewAnimation * o_fullscreen_anim1;
106 NSViewAnimation * o_fullscreen_anim2;
107 NSViewAnimation * o_makekey_anim;
108 NSView * o_temp_view;
109 /* set to yes if we are fullscreen and all animations are over */
111 BOOL b_window_is_invisible;
112 NSRecursiveLock * o_animation_lock;
113 NSSize nativeVideoSize;
115 NSInteger i_originalLevel;
117 + (VLCMainWindow *)sharedInstance;
119 - (IBAction)play:(id)sender;
120 - (IBAction)bwd:(id)sender;
121 - (IBAction)fwd:(id)sender;
122 - (IBAction)stop:(id)sender;
123 - (IBAction)togglePlaylist:(id)sender;
124 - (IBAction)repeat:(id)sender;
125 - (IBAction)shuffle:(id)sender;
126 - (IBAction)timeSliderAction:(id)sender;
127 - (IBAction)volumeAction:(id)sender;
128 - (IBAction)effects:(id)sender;
129 - (IBAction)fullscreen:(id)sender;
130 - (IBAction)dropzoneButtonAction:(id)sender;
132 - (void)showDropZone;
133 - (void)hideDropZone;
134 - (void)updateTimeSlider;
135 - (void)updateVolumeSlider;
136 - (void)updateWindow;
140 - (void)setRepeatOne;
141 - (void)setRepeatAll;
142 - (void)setRepeatOff;
145 - (void)drawFancyGradientEffectForTimeSlider;
148 - (void)setVideoplayEnabled;
149 - (void)resizeWindow;
150 - (void)setNativeVideoSize:(NSSize)size;
152 /* fullscreen handling */
153 - (void)showFullscreenController;
154 - (BOOL)isFullscreen;
155 - (void)lockFullscreenAnimation;
156 - (void)unlockFullscreenAnimation;
157 - (void)enterFullscreen;
158 - (void)leaveFullscreen;
159 - (void)leaveFullscreenAndFadeOut: (BOOL)fadeout;
160 - (void)hasEndedFullscreen;
161 - (void)hasBecomeFullscreen;
162 - (void)setFrameOnMainThread:(NSData*)packedargs;
166 @interface VLCProgressBarGradientEffect : NSView {
167 NSImage * o_time_sld_gradient_left_img;
168 NSImage * o_time_sld_gradient_middle_img;
169 NSImage * o_time_sld_gradient_right_img;
171 - (void)loadImagesInDarkStyle:(BOOL)b_value;