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 "CompatibilityFixes.h"
29 #import "PXSourceList.h"
34 @interface VLCMainWindow : NSWindow <PXSourceListDataSource, PXSourceListDelegate, NSWindowDelegate, NSAnimationDelegate> {
35 IBOutlet id o_play_btn;
36 IBOutlet id o_bwd_btn;
37 IBOutlet id o_fwd_btn;
38 IBOutlet id o_stop_btn;
39 IBOutlet id o_playlist_btn;
40 IBOutlet id o_repeat_btn;
41 IBOutlet id o_shuffle_btn;
42 IBOutlet id o_effects_btn;
43 IBOutlet id o_fullscreen_btn;
44 IBOutlet id o_search_fld;
45 IBOutlet id o_volume_sld;
46 IBOutlet id o_volume_track_view;
47 IBOutlet id o_volume_down_btn;
48 IBOutlet id o_volume_up_btn;
49 IBOutlet id o_time_sld;
50 IBOutlet id o_time_sld_fancygradient_view;
51 IBOutlet id o_time_fld;
52 IBOutlet id o_progress_bar;
53 IBOutlet id o_bottombar_view;
54 IBOutlet id o_time_sld_left_view;
55 IBOutlet id o_time_sld_middle_view;
56 IBOutlet id o_time_sld_right_view;
57 // TODO Playlist table, additional ui stuff at the top of the window
58 IBOutlet id o_playlist_table;
59 IBOutlet id o_video_view;
60 IBOutlet id o_split_view;
61 IBOutlet id o_left_split_view;
62 IBOutlet id o_right_split_view;
63 IBOutlet id o_sidebar_view;
64 IBOutlet id o_chosen_category_lbl;
66 IBOutlet id o_dropzone_view;
67 IBOutlet id o_dropzone_btn;
68 IBOutlet id o_dropzone_lbl;
70 IBOutlet VLCFSPanel *o_fspanel;
72 BOOL b_dark_interface;
73 BOOL b_video_playback_enabled;
74 int i_lastShownVolume;
76 input_state_e cachedInputState;
78 NSImage * o_pause_img;
79 NSImage * o_pause_pressed_img;
81 NSImage * o_play_pressed_img;
82 NSImage * o_repeat_img;
83 NSImage * o_repeat_pressed_img;
84 NSImage * o_repeat_all_img;
85 NSImage * o_repeat_all_pressed_img;
86 NSImage * o_repeat_one_img;
87 NSImage * o_repeat_one_pressed_img;
88 NSImage * o_shuffle_img;
89 NSImage * o_shuffle_pressed_img;
90 NSImage * o_shuffle_on_img;
91 NSImage * o_shuffle_on_pressed_img;
93 NSTimeInterval last_fwd_event;
94 NSTimeInterval last_bwd_event;
95 BOOL just_triggered_next;
96 BOOL just_triggered_previous;
97 NSMutableArray *o_sidebaritems;
99 VLCWindow * o_nonembedded_window;
102 VLCWindow * o_fullscreen_window;
103 NSViewAnimation * o_fullscreen_anim1;
104 NSViewAnimation * o_fullscreen_anim2;
105 NSViewAnimation * o_makekey_anim;
106 NSView * o_temp_view;
107 /* set to yes if we are fullscreen and all animations are over */
109 BOOL b_window_is_invisible;
110 NSRecursiveLock * o_animation_lock;
111 NSSize nativeVideoSize;
113 NSInteger i_originalLevel;
115 + (VLCMainWindow *)sharedInstance;
117 - (IBAction)play:(id)sender;
118 - (IBAction)bwd:(id)sender;
119 - (IBAction)fwd:(id)sender;
120 - (IBAction)stop:(id)sender;
121 - (IBAction)togglePlaylist:(id)sender;
122 - (IBAction)repeat:(id)sender;
123 - (IBAction)shuffle:(id)sender;
124 - (IBAction)timeSliderAction:(id)sender;
125 - (IBAction)volumeAction:(id)sender;
126 - (IBAction)effects:(id)sender;
127 - (IBAction)fullscreen:(id)sender;
128 - (IBAction)dropzoneButtonAction:(id)sender;
130 - (void)showDropZone;
131 - (void)hideDropZone;
132 - (void)updateTimeSlider;
133 - (void)updateVolumeSlider;
134 - (void)updateWindow;
138 - (void)setRepeatOne;
139 - (void)setRepeatAll;
140 - (void)setRepeatOff;
143 - (void)drawFancyGradientEffectForTimeSlider;
146 - (void)setVideoplayEnabled;
147 - (void)resizeWindow;
148 - (void)setNativeVideoSize:(NSSize)size;
150 /* fullscreen handling */
151 - (void)showFullscreenController;
152 - (BOOL)isFullscreen;
153 - (void)lockFullscreenAnimation;
154 - (void)unlockFullscreenAnimation;
155 - (void)enterFullscreen;
156 - (void)leaveFullscreen;
157 - (void)leaveFullscreenAndFadeOut: (BOOL)fadeout;
158 - (void)hasEndedFullscreen;
159 - (void)hasBecomeFullscreen;
160 - (void)setFrameOnMainThread:(NSData*)packedargs;
164 @interface VLCProgressBarGradientEffect : NSView {
165 NSImage * o_time_sld_gradient_left_img;
166 NSImage * o_time_sld_gradient_middle_img;
167 NSImage * o_time_sld_gradient_right_img;
169 - (void)loadImagesInDarkStyle:(BOOL)b_value;