1
by Bazaar Package Importer
Import upstream version 0.7.2.final |
1 |
/*****************************************************************************
|
2 |
* vout.m: MacOS X video output module
|
|
3 |
*****************************************************************************
|
|
8
by Bazaar Package Importer
Import upstream version 0.8.6.release.c |
4 |
* Copyright (C) 2001-2007 the VideoLAN team
|
10
by Bazaar Package Importer
Import upstream version 0.8.6.release.e+x264svn20071224+faad2.6.1 |
5 |
* $Id: vout.m 24195 2008-01-08 13:22:38Z fkuehne $
|
1
by Bazaar Package Importer
Import upstream version 0.7.2.final |
6 |
*
|
7 |
* Authors: Colin Delacroix <colin@zoy.org>
|
|
8 |
* Florian G. Pflug <fgp@phlo.org>
|
|
9 |
* Jon Lech Johansen <jon-vl@nanocrew.net>
|
|
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
10 |
* Derk-Jan Hartman <hartman at videolan dot org>
|
1
by Bazaar Package Importer
Import upstream version 0.7.2.final |
11 |
* Eric Petit <titer@m0k.org>
|
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
12 |
* Benjamin Pracht <bigben at videolan dot org>
|
4
by Bazaar Package Importer
Import upstream version 0.8.6-svn20060823.debian |
13 |
* Felix Khne <fkuehne at videolan dot org>
|
1
by Bazaar Package Importer
Import upstream version 0.7.2.final |
14 |
*
|
15 |
* This program is free software; you can redistribute it and/or modify
|
|
16 |
* it under the terms of the GNU General Public License as published by
|
|
17 |
* the Free Software Foundation; either version 2 of the License, or
|
|
18 |
* (at your option) any later version.
|
|
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
19 |
*
|
1
by Bazaar Package Importer
Import upstream version 0.7.2.final |
20 |
* This program is distributed in the hope that it will be useful,
|
21 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
22 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
23 |
* GNU General Public License for more details.
|
|
24 |
*
|
|
25 |
* You should have received a copy of the GNU General Public License
|
|
26 |
* along with this program; if not, write to the Free Software
|
|
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
27 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
|
1
by Bazaar Package Importer
Import upstream version 0.7.2.final |
28 |
*****************************************************************************/
|
29 |
||
30 |
/*****************************************************************************
|
|
31 |
* Preamble
|
|
32 |
*****************************************************************************/
|
|
33 |
#include <errno.h> /* ENOMEM */ |
|
34 |
#include <stdlib.h> /* free() */ |
|
35 |
#include <string.h> /* strerror() */ |
|
36 |
||
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
37 |
/* BeginFullScreen, EndFullScreen */
|
1
by Bazaar Package Importer
Import upstream version 0.7.2.final |
38 |
#include <QuickTime/QuickTime.h> |
39 |
||
40 |
#include <vlc_keys.h> |
|
41 |
||
42 |
#include "intf.h" |
|
7
by Bazaar Package Importer
Import upstream version 0.8.6.release |
43 |
#include "fspanel.h" |
1
by Bazaar Package Importer
Import upstream version 0.7.2.final |
44 |
#include "vout.h" |
7
by Bazaar Package Importer
Import upstream version 0.8.6.release |
45 |
#import "controls.h"
|
9
by Bazaar Package Importer
Import upstream version 0.8.6.release.d |
46 |
#include "embeddedwindow.h" |
1
by Bazaar Package Importer
Import upstream version 0.7.2.final |
47 |
|
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
48 |
/*****************************************************************************
|
49 |
* DeviceCallback: Callback triggered when the video-device variable is changed
|
|
50 |
*****************************************************************************/
|
|
51 |
int DeviceCallback( vlc_object_t *p_this, const char *psz_variable, |
|
52 |
vlc_value_t old_val, vlc_value_t new_val, void *param ) |
|
53 |
{
|
|
54 |
vlc_value_t val; |
|
55 |
vout_thread_t *p_vout = (vout_thread_t *)p_this; |
|
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
56 |
|
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
57 |
var_Create( p_vout->p_vlc, "video-device", VLC_VAR_INTEGER ); |
58 |
var_Set( p_vout->p_vlc, "video-device", new_val ); |
|
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
59 |
|
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
60 |
val.b_bool = VLC_TRUE; |
61 |
var_Set( p_vout, "intf-change", val ); |
|
62 |
return VLC_SUCCESS; |
|
63 |
}
|
|
64 |
||
65 |
||
66 |
/*****************************************************************************
|
|
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
67 |
* VLCEmbeddedList implementation
|
68 |
*****************************************************************************/
|
|
69 |
@implementation VLCEmbeddedList |
|
70 |
||
71 |
- (id)init |
|
72 |
{
|
|
73 |
[super init]; |
|
10
by Bazaar Package Importer
Import upstream version 0.8.6.release.e+x264svn20071224+faad2.6.1 |
74 |
o_embedded_array = [[NSMutableArray alloc] init]; |
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
75 |
return self; |
76 |
}
|
|
77 |
||
10
by Bazaar Package Importer
Import upstream version 0.8.6.release.e+x264svn20071224+faad2.6.1 |
78 |
- (void)dealloc |
79 |
{
|
|
80 |
[o_embedded_array release]; |
|
81 |
[super dealloc]; |
|
82 |
}
|
|
83 |
||
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
84 |
- (id)getEmbeddedVout |
85 |
{
|
|
86 |
unsigned int i; |
|
87 |
||
88 |
for( i = 0; i < [o_embedded_array count]; i++ ) |
|
89 |
{
|
|
90 |
id o_vout_view = [o_embedded_array objectAtIndex: i]; |
|
91 |
if( ![o_vout_view isUsed] ) |
|
92 |
{
|
|
93 |
[o_vout_view setUsed: YES]; |
|
94 |
return o_vout_view; |
|
95 |
}
|
|
96 |
}
|
|
97 |
return nil; |
|
98 |
}
|
|
99 |
||
100 |
- (void)releaseEmbeddedVout: (id)o_vout_view |
|
101 |
{
|
|
102 |
if( [o_embedded_array containsObject: o_vout_view] ) |
|
103 |
{
|
|
104 |
[o_vout_view setUsed: NO]; |
|
105 |
}
|
|
106 |
else
|
|
107 |
{
|
|
108 |
msg_Warn( VLCIntf, "cannot find Video Output"); |
|
109 |
}
|
|
110 |
}
|
|
111 |
||
112 |
- (void)addEmbeddedVout: (id)o_vout_view |
|
113 |
{
|
|
114 |
if( ![o_embedded_array containsObject: o_vout_view] ) |
|
115 |
{
|
|
116 |
[o_embedded_array addObject: o_vout_view]; |
|
117 |
}
|
|
118 |
}
|
|
119 |
||
120 |
- (BOOL)windowContainsEmbedded: (id)o_window |
|
121 |
{
|
|
9
by Bazaar Package Importer
Import upstream version 0.8.6.release.d |
122 |
/* if( ![[o_window className] isEqualToString: @"VLCVoutWindow"] )
|
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
123 |
{
|
9
by Bazaar Package Importer
Import upstream version 0.8.6.release.d |
124 |
NSLog( @"We were not given a VLCVoutWindow" );
|
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
125 |
}*/
|
126 |
return ([self getViewForWindow: o_window] == nil ? NO : YES ); |
|
127 |
}
|
|
128 |
||
129 |
- (id)getViewForWindow: (id)o_window |
|
130 |
{
|
|
131 |
id o_enumerator = [o_embedded_array objectEnumerator]; |
|
132 |
id o_current_embedded; |
|
133 |
||
134 |
while( (o_current_embedded = [o_enumerator nextObject]) ) |
|
135 |
{
|
|
136 |
if( [o_current_embedded getWindow] == o_window ) |
|
137 |
{
|
|
138 |
return o_current_embedded; |
|
139 |
}
|
|
140 |
}
|
|
141 |
return nil; |
|
142 |
}
|
|
143 |
||
144 |
@end
|
|
145 |
||
146 |
/*****************************************************************************
|
|
147 |
* VLCVoutView implementation
|
|
148 |
*****************************************************************************/
|
|
149 |
@implementation VLCVoutView |
|
150 |
||
151 |
- (id)initWithFrame:(NSRect)frameRect |
|
152 |
{
|
|
153 |
[super initWithFrame: frameRect]; |
|
154 |
p_vout = NULL; |
|
155 |
o_view = nil; |
|
156 |
s_frame = &frameRect; |
|
157 |
||
158 |
p_real_vout = NULL; |
|
159 |
o_window = nil; |
|
160 |
return self; |
|
161 |
}
|
|
162 |
||
163 |
- (BOOL)setVout: (vout_thread_t *) vout subView: (NSView *) view |
|
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
164 |
frame: (NSRect *) frame |
165 |
{
|
|
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
166 |
int i_device; |
167 |
NSAutoreleasePool *o_pool = [[NSAutoreleasePool alloc] init]; |
|
168 |
NSArray *o_screens = [NSScreen screens]; |
|
10
by Bazaar Package Importer
Import upstream version 0.8.6.release.e+x264svn20071224+faad2.6.1 |
169 |
NSScreen *o_fullscreen_screen = nil; |
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
170 |
|
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
171 |
p_vout = vout; |
172 |
o_view = view; |
|
173 |
s_frame = frame; |
|
174 |
||
175 |
if( [o_screens count] <= 0 ) |
|
176 |
{
|
|
177 |
msg_Err( p_vout, "no OSX screens available" ); |
|
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
178 |
return NO; |
179 |
}
|
|
180 |
||
181 |
p_real_vout = [VLCVoutView getRealVout: p_vout]; |
|
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
182 |
|
183 |
/* Get the pref value when this is the first time, otherwise retrieve the device from the top level video-device var */
|
|
7
by Bazaar Package Importer
Import upstream version 0.8.6.release |
184 |
i_device = var_GetInteger( p_vout, "macosx-vdev" ); |
185 |
if( var_Type( p_real_vout->p_vlc, "video-device" ) != 0 ) |
|
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
186 |
{
|
187 |
i_device = var_GetInteger( p_real_vout->p_vlc, "video-device" ); |
|
188 |
}
|
|
189 |
||
10
by Bazaar Package Importer
Import upstream version 0.8.6.release.e+x264svn20071224+faad2.6.1 |
190 |
o_fullscreen_screen = [NSScreen screenWithDisplayID: (CGDirectDisplayID)i_device]; |
191 |
if( !o_fullscreen_screen ) |
|
192 |
o_fullscreen_screen = [[self window] screen]; |
|
193 |
||
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
194 |
/* Setup the menuitem for the multiple displays. */
|
195 |
if( var_Type( p_real_vout, "video-device" ) == 0 ) |
|
1
by Bazaar Package Importer
Import upstream version 0.7.2.final |
196 |
{
|
197 |
int i = 1; |
|
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
198 |
vlc_value_t val2, text; |
1
by Bazaar Package Importer
Import upstream version 0.7.2.final |
199 |
NSScreen * o_screen; |
200 |
||
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
201 |
var_Create( p_real_vout, "video-device", VLC_VAR_INTEGER | |
202 |
VLC_VAR_HASCHOICE ); |
|
203 |
text.psz_string = _("Video Device"); |
|
204 |
var_Change( p_real_vout, "video-device", VLC_VAR_SETTEXT, &text, NULL ); |
|
1
by Bazaar Package Importer
Import upstream version 0.7.2.final |
205 |
|
206 |
NSEnumerator * o_enumerator = [o_screens objectEnumerator]; |
|
207 |
||
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
208 |
val2.i_int = 0; |
209 |
text.psz_string = _("Default"); |
|
210 |
var_Change( p_real_vout, "video-device", |
|
211 |
VLC_VAR_ADDCHOICE, &val2, &text ); |
|
212 |
var_Set( p_real_vout, "video-device", val2 ); |
|
7
by Bazaar Package Importer
Import upstream version 0.8.6.release |
213 |
var_AddCallback( p_real_vout, "video-device", DeviceCallback, NULL ); |
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
214 |
|
1
by Bazaar Package Importer
Import upstream version 0.7.2.final |
215 |
while( (o_screen = [o_enumerator nextObject]) != NULL ) |
216 |
{
|
|
217 |
char psz_temp[255]; |
|
218 |
NSRect s_rect = [o_screen frame]; |
|
219 |
||
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
220 |
snprintf( psz_temp, sizeof(psz_temp)/sizeof(psz_temp[0])-1, |
1
by Bazaar Package Importer
Import upstream version 0.7.2.final |
221 |
"%s %d (%dx%d)", _("Screen"), i, |
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
222 |
(int)s_rect.size.width, (int)s_rect.size.height ); |
1
by Bazaar Package Importer
Import upstream version 0.7.2.final |
223 |
|
224 |
text.psz_string = psz_temp; |
|
10
by Bazaar Package Importer
Import upstream version 0.8.6.release.e+x264svn20071224+faad2.6.1 |
225 |
val2.i_int = (int)[o_screen displayID]; |
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
226 |
var_Change( p_real_vout, "video-device", |
227 |
VLC_VAR_ADDCHOICE, &val2, &text ); |
|
10
by Bazaar Package Importer
Import upstream version 0.8.6.release.e+x264svn20071224+faad2.6.1 |
228 |
if( [o_screen isScreen:o_fullscreen_screen] ) |
1
by Bazaar Package Importer
Import upstream version 0.7.2.final |
229 |
{
|
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
230 |
var_Set( p_real_vout, "video-device", val2 ); |
1
by Bazaar Package Importer
Import upstream version 0.7.2.final |
231 |
}
|
232 |
i++; |
|
233 |
}
|
|
234 |
||
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
235 |
val2.b_bool = VLC_TRUE; |
236 |
var_Set( p_real_vout, "intf-change", val2 ); |
|
237 |
}
|
|
238 |
||
239 |
/* Add the view. It's automatically resized to fit the window */
|
|
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
240 |
[self addSubview: o_view]; |
241 |
[self setAutoresizesSubviews: YES]; |
|
1
by Bazaar Package Importer
Import upstream version 0.7.2.final |
242 |
[o_pool release]; |
243 |
||
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
244 |
return YES; |
245 |
}
|
|
246 |
||
247 |
- (void)resizeSubviewsWithOldSize:(NSSize)oldBoundsSize |
|
248 |
{
|
|
249 |
[super resizeSubviewsWithOldSize: oldBoundsSize]; |
|
250 |
[o_view setFrameSize: [self frame].size]; |
|
251 |
}
|
|
252 |
||
9
by Bazaar Package Importer
Import upstream version 0.8.6.release.d |
253 |
- (void)drawRect:(NSRect)rect |
254 |
{
|
|
255 |
/* When there is no subview we draw a black background */
|
|
256 |
[self lockFocus]; |
|
257 |
[[NSColor blackColor] set]; |
|
258 |
NSRectFill(rect); |
|
259 |
[self unlockFocus]; |
|
260 |
}
|
|
261 |
||
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
262 |
- (void)closeVout |
263 |
{
|
|
9
by Bazaar Package Importer
Import upstream version 0.8.6.release.d |
264 |
/* Make sure we don't see a white flash */
|
265 |
if( MACOS_VERSION > 10.3f ) |
|
266 |
[[self window] disableScreenUpdatesUntilFlush]; |
|
267 |
||
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
268 |
[o_view removeFromSuperview]; |
269 |
o_view = nil; |
|
270 |
p_vout = NULL; |
|
271 |
s_frame = nil; |
|
272 |
o_window = nil; |
|
273 |
p_real_vout = NULL; |
|
274 |
}
|
|
275 |
||
276 |
- (void)updateTitle |
|
277 |
{
|
|
278 |
NSMutableString * o_title = nil, * o_mrl = nil; |
|
279 |
input_thread_t * p_input; |
|
280 |
||
281 |
if( p_vout == NULL ) |
|
282 |
{
|
|
283 |
return; |
|
284 |
}
|
|
285 |
||
286 |
p_input = vlc_object_find( p_vout, VLC_OBJECT_INPUT, FIND_PARENT ); |
|
287 |
||
288 |
if( p_input == NULL ) |
|
289 |
{
|
|
290 |
return; |
|
291 |
}
|
|
292 |
||
293 |
if( p_input->input.p_item->psz_name != NULL ) |
|
294 |
o_title = [NSMutableString stringWithUTF8String: |
|
295 |
p_input->input.p_item->psz_name]; |
|
296 |
if( p_input->input.p_item->psz_uri != NULL ) |
|
297 |
o_mrl = [NSMutableString stringWithUTF8String: |
|
298 |
p_input->input.p_item->psz_uri]; |
|
299 |
if( o_title == nil ) |
|
300 |
o_title = o_mrl; |
|
301 |
||
302 |
if( o_mrl != nil ) |
|
303 |
{
|
|
304 |
if( p_input->input.p_access && !strcmp( p_input->input.p_access->p_module->psz_shortname, "File" ) ) |
|
305 |
{
|
|
306 |
NSRange prefix_range = [o_mrl rangeOfString: @"file:"]; |
|
307 |
if( prefix_range.location != NSNotFound ) |
|
308 |
[o_mrl deleteCharactersInRange: prefix_range]; |
|
309 |
[o_window setRepresentedFilename: o_mrl]; |
|
310 |
}
|
|
311 |
[o_window setTitle: o_title]; |
|
312 |
}
|
|
313 |
else
|
|
314 |
{
|
|
315 |
[o_window setTitle: [NSString stringWithCString: VOUT_TITLE]]; |
|
316 |
}
|
|
317 |
vlc_object_release( p_input ); |
|
318 |
}
|
|
319 |
||
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
320 |
|
321 |
- (void)setOnTop:(BOOL)b_on_top |
|
322 |
{
|
|
323 |
if( b_on_top ) |
|
324 |
{
|
|
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
325 |
[o_window setLevel: NSStatusWindowLevel]; |
326 |
}
|
|
327 |
else
|
|
328 |
{
|
|
329 |
[o_window setLevel: NSNormalWindowLevel]; |
|
330 |
}
|
|
1
by Bazaar Package Importer
Import upstream version 0.7.2.final |
331 |
}
|
332 |
||
8
by Bazaar Package Importer
Import upstream version 0.8.6.release.c |
333 |
- (void)scaleWindowWithFactor: (float)factor animate: (BOOL)animate |
1
by Bazaar Package Importer
Import upstream version 0.7.2.final |
334 |
{
|
335 |
NSSize newsize; |
|
336 |
int i_corrected_height, i_corrected_width; |
|
337 |
NSPoint topleftbase; |
|
338 |
NSPoint topleftscreen; |
|
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
339 |
|
1
by Bazaar Package Importer
Import upstream version 0.7.2.final |
340 |
if ( !p_vout->b_fullscreen ) |
341 |
{
|
|
9
by Bazaar Package Importer
Import upstream version 0.8.6.release.d |
342 |
NSView *mainView; |
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
343 |
NSRect new_frame; |
1
by Bazaar Package Importer
Import upstream version 0.7.2.final |
344 |
topleftbase.x = 0; |
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
345 |
topleftbase.y = [o_window frame].size.height; |
346 |
topleftscreen = [o_window convertBaseToScreen: topleftbase]; |
|
347 |
||
348 |
if( p_vout->render.i_height * p_vout->render.i_aspect > |
|
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
349 |
p_vout->render.i_width * VOUT_ASPECT_FACTOR ) |
1
by Bazaar Package Importer
Import upstream version 0.7.2.final |
350 |
{
|
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
351 |
i_corrected_width = p_vout->render.i_height * p_vout->render.i_aspect / |
1
by Bazaar Package Importer
Import upstream version 0.7.2.final |
352 |
VOUT_ASPECT_FACTOR; |
353 |
newsize.width = (int) ( i_corrected_width * factor ); |
|
354 |
newsize.height = (int) ( p_vout->render.i_height * factor ); |
|
355 |
}
|
|
356 |
else
|
|
357 |
{
|
|
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
358 |
i_corrected_height = p_vout->render.i_width * VOUT_ASPECT_FACTOR / |
359 |
p_vout->render.i_aspect; |
|
1
by Bazaar Package Importer
Import upstream version 0.7.2.final |
360 |
newsize.width = (int) ( p_vout->render.i_width * factor ); |
361 |
newsize.height = (int) ( i_corrected_height * factor ); |
|
362 |
}
|
|
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
363 |
|
9
by Bazaar Package Importer
Import upstream version 0.8.6.release.d |
364 |
/* In fullscreen mode we need to use a view that is different from
|
365 |
* ourselves, with the VLCEmbeddedWindow */
|
|
366 |
if([o_window isKindOfClass:[VLCEmbeddedWindow class]]) |
|
367 |
mainView = [o_window mainView]; |
|
368 |
else
|
|
369 |
mainView = self; |
|
370 |
||
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
371 |
/* Calculate the window's new size */
|
372 |
new_frame.size.width = [o_window frame].size.width - |
|
9
by Bazaar Package Importer
Import upstream version 0.8.6.release.d |
373 |
[mainView frame].size.width + newsize.width; |
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
374 |
new_frame.size.height = [o_window frame].size.height - |
9
by Bazaar Package Importer
Import upstream version 0.8.6.release.d |
375 |
[mainView frame].size.height + newsize.height; |
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
376 |
|
377 |
new_frame.origin.x = topleftscreen.x; |
|
378 |
new_frame.origin.y = topleftscreen.y - new_frame.size.height; |
|
379 |
||
8
by Bazaar Package Importer
Import upstream version 0.8.6.release.c |
380 |
[o_window setFrame: new_frame display: animate animate: animate]; |
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
381 |
|
1
by Bazaar Package Importer
Import upstream version 0.7.2.final |
382 |
p_vout->i_changes |= VOUT_SIZE_CHANGE; |
383 |
}
|
|
384 |
}
|
|
385 |
||
386 |
- (void)toggleFloatOnTop |
|
387 |
{
|
|
388 |
vlc_value_t val; |
|
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
389 |
|
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
390 |
if( !p_real_vout ) return; |
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
391 |
if( var_Get( p_real_vout, "video-on-top", &val )>=0 && val.b_bool) |
1
by Bazaar Package Importer
Import upstream version 0.7.2.final |
392 |
{
|
393 |
val.b_bool = VLC_FALSE; |
|
394 |
}
|
|
395 |
else
|
|
396 |
{
|
|
397 |
val.b_bool = VLC_TRUE; |
|
398 |
}
|
|
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
399 |
var_Set( p_real_vout, "video-on-top", val ); |
1
by Bazaar Package Importer
Import upstream version 0.7.2.final |
400 |
}
|
401 |
||
402 |
- (void)toggleFullscreen |
|
403 |
{
|
|
404 |
vlc_value_t val; |
|
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
405 |
if( !p_real_vout ) return; |
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
406 |
var_Get( p_real_vout, "fullscreen", &val ); |
407 |
val.b_bool = !val.b_bool; |
|
408 |
var_Set( p_real_vout, "fullscreen", val ); |
|
1
by Bazaar Package Importer
Import upstream version 0.7.2.final |
409 |
}
|
410 |
||
411 |
- (BOOL)isFullscreen |
|
412 |
{
|
|
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
413 |
vlc_value_t val; |
8
by Bazaar Package Importer
Import upstream version 0.8.6.release.c |
414 |
if( !p_real_vout ) return NO; |
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
415 |
var_Get( p_real_vout, "fullscreen", &val ); |
416 |
return( val.b_bool ); |
|
417 |
}
|
|
418 |
||
419 |
- (void)snapshot |
|
420 |
{
|
|
421 |
vout_Control( p_real_vout, VOUT_SNAPSHOT ); |
|
1
by Bazaar Package Importer
Import upstream version 0.7.2.final |
422 |
}
|
423 |
||
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
424 |
- (void)manage |
1
by Bazaar Package Importer
Import upstream version 0.7.2.final |
425 |
{
|
8
by Bazaar Package Importer
Import upstream version 0.8.6.release.c |
426 |
/* Disable Screensaver, when we're playing something, but allow it on pause */
|
10
by Bazaar Package Importer
Import upstream version 0.8.6.release.e+x264svn20071224+faad2.6.1 |
427 |
if( VLCIntf->p_sys && !VLCIntf->b_die ) |
428 |
if( VLCIntf->p_sys->i_play_status == PLAYING_S ) |
|
429 |
UpdateSystemActivity( UsrActivity ); |
|
1
by Bazaar Package Importer
Import upstream version 0.7.2.final |
430 |
}
|
431 |
||
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
432 |
- (id)getWindow |
1
by Bazaar Package Importer
Import upstream version 0.7.2.final |
433 |
{
|
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
434 |
return o_window; |
435 |
}
|
|
1
by Bazaar Package Importer
Import upstream version 0.7.2.final |
436 |
|
437 |
- (void)keyDown:(NSEvent *)o_event |
|
438 |
{
|
|
439 |
unichar key = 0; |
|
440 |
vlc_value_t val; |
|
441 |
unsigned int i_pressed_modifiers = 0; |
|
442 |
val.i_int = 0; |
|
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
443 |
|
1
by Bazaar Package Importer
Import upstream version 0.7.2.final |
444 |
i_pressed_modifiers = [o_event modifierFlags]; |
445 |
||
446 |
if( i_pressed_modifiers & NSShiftKeyMask ) |
|
447 |
val.i_int |= KEY_MODIFIER_SHIFT; |
|
448 |
if( i_pressed_modifiers & NSControlKeyMask ) |
|
449 |
val.i_int |= KEY_MODIFIER_CTRL; |
|
450 |
if( i_pressed_modifiers & NSAlternateKeyMask ) |
|
451 |
val.i_int |= KEY_MODIFIER_ALT; |
|
452 |
if( i_pressed_modifiers & NSCommandKeyMask ) |
|
453 |
val.i_int |= KEY_MODIFIER_COMMAND; |
|
454 |
||
455 |
key = [[o_event charactersIgnoringModifiers] characterAtIndex: 0]; |
|
456 |
||
457 |
if( key ) |
|
458 |
{
|
|
459 |
/* Escape should always get you out of fullscreen */
|
|
460 |
if( key == (unichar) 0x1b ) |
|
461 |
{
|
|
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
462 |
if( p_real_vout && [self isFullscreen] ) |
1
by Bazaar Package Importer
Import upstream version 0.7.2.final |
463 |
{
|
464 |
[self toggleFullscreen]; |
|
465 |
}
|
|
466 |
}
|
|
467 |
else if ( key == ' ' ) |
|
468 |
{
|
|
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
469 |
vlc_value_t val; |
470 |
val.i_int = config_GetInt( p_vout, "key-play-pause" ); |
|
471 |
var_Set( p_vout->p_vlc, "key-pressed", val ); |
|
1
by Bazaar Package Importer
Import upstream version 0.7.2.final |
472 |
}
|
473 |
else
|
|
474 |
{
|
|
475 |
val.i_int |= CocoaKeyToVLC( key ); |
|
476 |
var_Set( p_vout->p_vlc, "key-pressed", val ); |
|
477 |
}
|
|
478 |
}
|
|
479 |
else
|
|
480 |
{
|
|
481 |
[super keyDown: o_event]; |
|
482 |
}
|
|
483 |
}
|
|
484 |
||
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
485 |
- (void)mouseDown:(NSEvent *)o_event |
486 |
{
|
|
487 |
vlc_value_t val; |
|
488 |
||
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
489 |
if( p_vout ) |
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
490 |
{
|
4
by Bazaar Package Importer
Import upstream version 0.8.6-svn20060823.debian |
491 |
if( ( [o_event type] == NSLeftMouseDown ) && |
492 |
( ! ( [o_event modifierFlags] & NSControlKeyMask ) ) ) |
|
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
493 |
{
|
4
by Bazaar Package Importer
Import upstream version 0.8.6-svn20060823.debian |
494 |
if( [o_event clickCount] <= 1 ) |
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
495 |
{
|
4
by Bazaar Package Importer
Import upstream version 0.8.6-svn20060823.debian |
496 |
/* single clicking */
|
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
497 |
var_Get( p_vout, "mouse-button-down", &val ); |
498 |
val.i_int |= 1; |
|
499 |
var_Set( p_vout, "mouse-button-down", val ); |
|
500 |
}
|
|
4
by Bazaar Package Importer
Import upstream version 0.8.6-svn20060823.debian |
501 |
else
|
502 |
{
|
|
503 |
/* multiple clicking */
|
|
504 |
[self toggleFullscreen]; |
|
505 |
}
|
|
506 |
}
|
|
507 |
else if( ( [o_event type] == NSRightMouseDown ) || |
|
508 |
( ( [o_event type] == NSLeftMouseDown ) && |
|
509 |
( [o_event modifierFlags] & NSControlKeyMask ) ) ) |
|
510 |
{
|
|
511 |
[NSMenu popUpContextMenu: [[VLCMain sharedInstance] getVoutMenu] withEvent: o_event forView: [[[VLCMain sharedInstance] getControls] getVoutView]]; |
|
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
512 |
}
|
513 |
}
|
|
6
by Bazaar Package Importer
Import upstream version 0.8.6-svn20061012.debian |
514 |
|
515 |
[super mouseDown: o_event]; |
|
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
516 |
}
|
517 |
||
518 |
- (void)otherMouseDown:(NSEvent *)o_event |
|
519 |
{
|
|
520 |
vlc_value_t val; |
|
521 |
||
6
by Bazaar Package Importer
Import upstream version 0.8.6-svn20061012.debian |
522 |
if( p_vout && [o_event type] == NSOtherMouseDown ) |
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
523 |
{
|
6
by Bazaar Package Importer
Import upstream version 0.8.6-svn20061012.debian |
524 |
var_Get( p_vout, "mouse-button-down", &val ); |
525 |
val.i_int |= 2; |
|
526 |
var_Set( p_vout, "mouse-button-down", val ); |
|
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
527 |
}
|
6
by Bazaar Package Importer
Import upstream version 0.8.6-svn20061012.debian |
528 |
|
529 |
[super mouseDown: o_event]; |
|
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
530 |
}
|
531 |
||
532 |
- (void)rightMouseDown:(NSEvent *)o_event |
|
533 |
{
|
|
6
by Bazaar Package Importer
Import upstream version 0.8.6-svn20061012.debian |
534 |
if( p_vout && [o_event type] == NSRightMouseDown ) |
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
535 |
{
|
6
by Bazaar Package Importer
Import upstream version 0.8.6-svn20061012.debian |
536 |
[NSMenu popUpContextMenu: [[VLCMain sharedInstance] getVoutMenu] withEvent: o_event forView: [[[VLCMain sharedInstance] getControls] getVoutView]]; |
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
537 |
}
|
6
by Bazaar Package Importer
Import upstream version 0.8.6-svn20061012.debian |
538 |
|
539 |
[super mouseDown: o_event]; |
|
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
540 |
}
|
541 |
||
542 |
- (void)mouseUp:(NSEvent *)o_event |
|
543 |
{
|
|
544 |
vlc_value_t val; |
|
545 |
||
6
by Bazaar Package Importer
Import upstream version 0.8.6-svn20061012.debian |
546 |
if( p_vout && [o_event type] == NSLeftMouseUp ) |
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
547 |
{
|
6
by Bazaar Package Importer
Import upstream version 0.8.6-svn20061012.debian |
548 |
vlc_value_t b_val; |
549 |
b_val.b_bool = VLC_TRUE; |
|
550 |
var_Set( p_vout, "mouse-clicked", b_val ); |
|
551 |
||
552 |
var_Get( p_vout, "mouse-button-down", &val ); |
|
553 |
val.i_int &= ~1; |
|
554 |
var_Set( p_vout, "mouse-button-down", val ); |
|
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
555 |
}
|
6
by Bazaar Package Importer
Import upstream version 0.8.6-svn20061012.debian |
556 |
|
557 |
[super mouseUp: o_event]; |
|
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
558 |
}
|
559 |
||
560 |
- (void)otherMouseUp:(NSEvent *)o_event |
|
561 |
{
|
|
562 |
vlc_value_t val; |
|
563 |
||
6
by Bazaar Package Importer
Import upstream version 0.8.6-svn20061012.debian |
564 |
if( p_vout && [o_event type] == NSOtherMouseUp ) |
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
565 |
{
|
6
by Bazaar Package Importer
Import upstream version 0.8.6-svn20061012.debian |
566 |
var_Get( p_vout, "mouse-button-down", &val ); |
567 |
val.i_int &= ~2; |
|
568 |
var_Set( p_vout, "mouse-button-down", val ); |
|
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
569 |
}
|
6
by Bazaar Package Importer
Import upstream version 0.8.6-svn20061012.debian |
570 |
|
571 |
[super mouseUp: o_event]; |
|
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
572 |
}
|
573 |
||
574 |
- (void)rightMouseUp:(NSEvent *)o_event |
|
575 |
{
|
|
6
by Bazaar Package Importer
Import upstream version 0.8.6-svn20061012.debian |
576 |
if( p_vout && [o_event type] == NSRightMouseUp ) |
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
577 |
{
|
6
by Bazaar Package Importer
Import upstream version 0.8.6-svn20061012.debian |
578 |
/* FIXME: this isn't the appropriate place, but we can't receive
|
579 |
* NSRightMouseDown some how */
|
|
580 |
[NSMenu popUpContextMenu: [[VLCMain sharedInstance] getVoutMenu] withEvent: o_event forView: [[[VLCMain sharedInstance] getControls] getVoutView]]; |
|
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
581 |
}
|
6
by Bazaar Package Importer
Import upstream version 0.8.6-svn20061012.debian |
582 |
|
583 |
[super mouseUp: o_event]; |
|
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
584 |
}
|
585 |
||
586 |
- (void)mouseDragged:(NSEvent *)o_event |
|
587 |
{
|
|
588 |
[self mouseMoved: o_event]; |
|
589 |
}
|
|
590 |
||
591 |
- (void)otherMouseDragged:(NSEvent *)o_event |
|
592 |
{
|
|
593 |
[self mouseMoved: o_event]; |
|
594 |
}
|
|
595 |
||
596 |
- (void)rightMouseDragged:(NSEvent *)o_event |
|
597 |
{
|
|
598 |
[self mouseMoved: o_event]; |
|
599 |
}
|
|
600 |
||
601 |
- (void)mouseMoved:(NSEvent *)o_event |
|
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
602 |
{
|
2
by Bazaar Package Importer
Import upstream version 0.8.4.debian |
603 |
NSPoint ml; |
604 |
NSRect s_rect; |
|
605 |
BOOL b_inside; |
|
606 |
||
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
607 |
if( p_vout ) |
608 |
{
|
|
609 |
s_rect = [o_view bounds]; |
|
610 |
ml = [o_view convertPoint: [o_event locationInWindow] fromView: nil]; |
|
611 |
b_inside = [o_view mouse: ml inRect: s_rect]; |
|
612 |
||
613 |
if( b_inside ) |
|
614 |
{
|
|
615 |
vlc_value_t val; |
|
616 |
unsigned int i_width, i_height, i_x, i_y; |
|
617 |
||
618 |
vout_PlacePicture( p_vout, (unsigned int)s_rect.size.width, |
|
619 |
(unsigned int)s_rect.size.height, |
|
620 |
&i_x, &i_y, &i_width, &i_height ); |
|
621 |
||
622 |
val.i_int = ( ((int)ml.x) - i_x ) * |
|
623 |
p_vout->render.i_width / i_width; |
|
624 |
var_Set( p_vout, "mouse-x", val ); |
|
625 |
||
626 |
if( [[o_view className] isEqualToString: @"VLCGLView"] ) |
|
627 |
{
|
|
628 |
val.i_int = ( ((int)(s_rect.size.height - ml.y)) - i_y ) * |
|
629 |
p_vout->render.i_height / i_height; |
|
630 |
}
|
|
631 |
else
|
|
632 |
{
|
|
633 |
val.i_int = ( ((int)ml.y) - i_y ) * |
|
634 |
p_vout->render.i_height / i_height; |
|
635 |
}
|
|
636 |
var_Set( p_vout, "mouse-y", val ); |
|
637 |
||
638 |
val.b_bool = VLC_TRUE; |
|
639 |
var_Set( p_vout, "mouse-moved", val ); |
|
640 |
}
|
|
7
by Bazaar Package Importer
Import upstream version 0.8.6.release |
641 |
if( [self isFullscreen] ) |
642 |
[[[[VLCMain sharedInstance] getControls] getFSPanel] fadeIn]; |
|
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
643 |
}
|
6
by Bazaar Package Importer
Import upstream version 0.8.6-svn20061012.debian |
644 |
|
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
645 |
[super mouseMoved: o_event]; |
646 |
}
|
|
647 |
||
648 |
- (BOOL)acceptsFirstResponder |
|
649 |
{
|
|
650 |
return YES; |
|
651 |
}
|
|
652 |
||
653 |
- (BOOL)becomeFirstResponder |
|
654 |
{
|
|
655 |
return YES; |
|
656 |
}
|
|
657 |
||
658 |
- (BOOL)resignFirstResponder |
|
659 |
{
|
|
660 |
/* We need to stay the first responder or we'll miss some
|
|
661 |
events */
|
|
662 |
return NO; |
|
663 |
}
|
|
664 |
||
665 |
/* Class methods used by the different vout modules */
|
|
666 |
||
667 |
+ (vout_thread_t *)getRealVout: (vout_thread_t *)p_vout |
|
668 |
{
|
|
669 |
/* p_real_vout: the vout we have to use to check for video-on-top
|
|
670 |
and a few other things. If we are the QuickTime output, it's us.
|
|
671 |
It we are the OpenGL provider, it is our parent. */
|
|
672 |
if( p_vout->i_object_type == VLC_OBJECT_OPENGL ) |
|
673 |
{
|
|
674 |
return (vout_thread_t *) p_vout->p_parent; |
|
675 |
}
|
|
676 |
else
|
|
677 |
{
|
|
678 |
return p_vout; |
|
679 |
}
|
|
680 |
||
681 |
}
|
|
682 |
||
683 |
+ (id)getVoutView: (vout_thread_t *)p_vout subView: (NSView *)view |
|
684 |
frame: (NSRect *)s_frame |
|
685 |
{
|
|
686 |
vlc_value_t value_drawable; |
|
687 |
int i_timeout; |
|
688 |
id o_return = nil; |
|
689 |
||
690 |
var_Get( p_vout->p_vlc, "drawable", &value_drawable ); |
|
691 |
||
692 |
var_Create( p_vout, "macosx-vdev", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT ); |
|
693 |
var_Create( p_vout, "macosx-fill", VLC_VAR_BOOL | VLC_VAR_DOINHERIT ); |
|
694 |
var_Create( p_vout, "macosx-stretch", VLC_VAR_BOOL | VLC_VAR_DOINHERIT ); |
|
695 |
var_Create( p_vout, "macosx-opaqueness", VLC_VAR_FLOAT | VLC_VAR_DOINHERIT ); |
|
696 |
var_Create( p_vout, "macosx-background", VLC_VAR_BOOL | VLC_VAR_DOINHERIT ); |
|
697 |
var_Create( p_vout, "macosx-black", VLC_VAR_BOOL | VLC_VAR_DOINHERIT ); |
|
698 |
var_Create( p_vout, "macosx-embedded", VLC_VAR_BOOL | VLC_VAR_DOINHERIT ); |
|
699 |
||
700 |
||
701 |
/* We only wait for NSApp to initialise if we're not embedded (as in the
|
|
702 |
* case of the Mozilla plugin). We can tell whether we're embedded or not
|
|
703 |
* by examining the "drawable" value: if it's zero, we're running in the
|
|
704 |
* main Mac intf; if it's non-zero, we're embedded. */
|
|
705 |
if( value_drawable.i_int == 0 ) |
|
706 |
{
|
|
707 |
/* Wait for a MacOS X interface to appear. Timeout is 2 seconds. */
|
|
708 |
for( i_timeout = 20 ; i_timeout-- ; ) |
|
709 |
{
|
|
710 |
if( NSApp == NULL ) |
|
711 |
{
|
|
712 |
msleep( INTF_IDLE_SLEEP ); |
|
713 |
}
|
|
714 |
}
|
|
715 |
||
716 |
if( NSApp == NULL ) |
|
717 |
{
|
|
718 |
/* No MacOS X intf, unable to communicate with MT */
|
|
719 |
msg_Err( p_vout, "no MacOS X interface present" ); |
|
720 |
return nil; |
|
721 |
}
|
|
722 |
else
|
|
723 |
{
|
|
724 |
if ( VLCIntf && !(p_vout->b_fullscreen) && |
|
7
by Bazaar Package Importer
Import upstream version 0.8.6.release |
725 |
!(var_GetBool( p_vout, "macosx-background" )) && |
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
726 |
var_GetBool( p_vout, "macosx-embedded") ) |
727 |
{
|
|
728 |
o_return = [[[VLCMain sharedInstance] getEmbeddedList] |
|
729 |
getEmbeddedVout]; |
|
730 |
}
|
|
731 |
}
|
|
732 |
}
|
|
733 |
||
734 |
/* No embedded vout is available */
|
|
735 |
if( o_return == nil ) |
|
736 |
{
|
|
737 |
NSRect null_rect; |
|
738 |
bzero( &null_rect, sizeof( NSRect ) ); |
|
739 |
o_return = [[VLCDetachedVoutView alloc] initWithFrame: null_rect ]; |
|
740 |
}
|
|
741 |
[o_return setVout: p_vout subView: view frame: s_frame]; |
|
742 |
return o_return; |
|
743 |
}
|
|
744 |
||
9
by Bazaar Package Importer
Import upstream version 0.8.6.release.d |
745 |
- (void)enterFullscreen |
746 |
{
|
|
747 |
[[o_view class] performSelectorOnMainThread:@selector(resetVout:) withObject:[NSValue valueWithPointer:p_vout] waitUntilDone:YES]; |
|
748 |
[[[[VLCMain sharedInstance] getControls] getFSPanel] setActive: nil]; |
|
749 |
}
|
|
750 |
||
751 |
- (void)leaveFullscreen |
|
752 |
{
|
|
753 |
[[o_view class] performSelectorOnMainThread:@selector(resetVout:) withObject:[NSValue valueWithPointer:p_vout] waitUntilDone:YES]; |
|
754 |
[[[[VLCMain sharedInstance] getControls] getFSPanel] setNonActive: nil]; |
|
755 |
}
|
|
756 |
||
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
757 |
@end
|
758 |
||
759 |
/*****************************************************************************
|
|
760 |
* VLCDetachedVoutView implementation
|
|
761 |
*****************************************************************************/
|
|
762 |
@implementation VLCDetachedVoutView |
|
763 |
||
764 |
- (id)initWithFrame: (NSRect)frameRect |
|
765 |
{
|
|
766 |
[super initWithFrame: frameRect]; |
|
767 |
i_time_mouse_last_moved = 0; |
|
768 |
return self; |
|
769 |
}
|
|
770 |
||
771 |
- (bool)setVout: (vout_thread_t *) p_arg_vout subView: (NSView *) view |
|
772 |
frame: (NSRect *) s_arg_frame |
|
773 |
{
|
|
774 |
BOOL b_return = [super setVout: p_arg_vout subView: view frame:s_arg_frame]; |
|
775 |
i_time_mouse_last_moved = mdate(); |
|
9
by Bazaar Package Importer
Import upstream version 0.8.6.release.d |
776 |
o_window = [[VLCVoutWindow alloc] initWithVout: p_arg_vout view: self |
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
777 |
frame: s_arg_frame]; |
778 |
[self updateTitle]; |
|
779 |
[view setFrame: [self frame]]; |
|
780 |
||
781 |
if( var_GetBool( p_real_vout, "video-on-top" ) ) |
|
782 |
{
|
|
783 |
[o_window setLevel: NSStatusWindowLevel]; |
|
784 |
}
|
|
785 |
||
786 |
||
787 |
[o_window setAcceptsMouseMovedEvents: TRUE]; |
|
788 |
return b_return; |
|
789 |
}
|
|
790 |
||
791 |
- (void)closeVout |
|
792 |
{
|
|
9
by Bazaar Package Importer
Import upstream version 0.8.6.release.d |
793 |
[[[[VLCMain sharedInstance] getControls] getFSPanel] fadeOut]; |
794 |
||
795 |
if( MACOS_VERSION > 10.3f ) |
|
796 |
[[self window] disableScreenUpdatesUntilFlush]; |
|
797 |
||
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
798 |
[o_window closeWindow]; |
799 |
[o_window setAcceptsMouseMovedEvents: NO]; |
|
800 |
i_time_mouse_last_moved = 0; |
|
801 |
[super closeVout]; |
|
802 |
}
|
|
803 |
||
804 |
- (void)mouseMoved:(NSEvent *)o_event |
|
805 |
{
|
|
806 |
i_time_mouse_last_moved = mdate(); |
|
807 |
[super mouseMoved: o_event]; |
|
808 |
}
|
|
809 |
||
810 |
- (void)hideMouse:(BOOL)b_hide |
|
811 |
{
|
|
812 |
BOOL b_inside; |
|
813 |
NSPoint ml; |
|
814 |
NSView *o_contents = [o_window contentView]; |
|
815 |
||
816 |
ml = [o_window convertScreenToBase:[NSEvent mouseLocation]]; |
|
817 |
ml = [o_contents convertPoint:ml fromView:nil]; |
|
818 |
b_inside = [o_contents mouse: ml inRect: [o_contents bounds]]; |
|
819 |
||
820 |
if( b_hide && b_inside ) |
|
821 |
{
|
|
822 |
[NSCursor setHiddenUntilMouseMoves: YES]; |
|
823 |
}
|
|
824 |
else if( !b_hide ) |
|
825 |
{
|
|
826 |
[NSCursor setHiddenUntilMouseMoves: NO]; |
|
827 |
}
|
|
828 |
}
|
|
829 |
||
830 |
- (void)manage |
|
831 |
{
|
|
832 |
[super manage]; |
|
833 |
if( p_vout->b_fullscreen ) |
|
834 |
{
|
|
835 |
if( mdate() - i_time_mouse_last_moved > 3000000 ) |
|
836 |
{
|
|
837 |
[self hideMouse: YES]; |
|
838 |
}
|
|
839 |
}
|
|
840 |
else
|
|
841 |
{
|
|
842 |
[self hideMouse: NO]; |
|
843 |
}
|
|
844 |
}
|
|
845 |
||
846 |
@end
|
|
847 |
||
848 |
/*****************************************************************************
|
|
849 |
* VLCEmbeddedVoutView implementation
|
|
850 |
*****************************************************************************/
|
|
851 |
||
852 |
@implementation VLCEmbeddedVoutView |
|
853 |
||
854 |
- (id)initWithFrame: (NSRect)frameRect |
|
855 |
{
|
|
856 |
[super initWithFrame: frameRect]; |
|
857 |
b_used = NO; |
|
858 |
[[[VLCMain sharedInstance] getEmbeddedList] addEmbeddedVout: self]; |
|
859 |
return self; |
|
860 |
}
|
|
861 |
||
862 |
- (BOOL)setVout: (vout_thread_t *) p_arg_vout subView: (NSView *) view |
|
9
by Bazaar Package Importer
Import upstream version 0.8.6.release.d |
863 |
frame: (NSRect *) s_arg_frame showWindow: (BOOL)b_show_window |
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
864 |
{
|
865 |
BOOL b_return; |
|
866 |
b_return = [super setVout: p_arg_vout subView: view frame: s_arg_frame]; |
|
867 |
if( b_return ) |
|
868 |
{
|
|
869 |
o_window = [self window]; |
|
9
by Bazaar Package Importer
Import upstream version 0.8.6.release.d |
870 |
if (b_show_window) |
871 |
[o_window makeKeyAndOrderFront: self]; |
|
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
872 |
[o_window setAcceptsMouseMovedEvents: TRUE]; |
873 |
||
874 |
if( var_GetBool( p_real_vout, "video-on-top" ) ) |
|
875 |
{
|
|
876 |
[o_window setLevel: NSStatusWindowLevel]; |
|
877 |
}
|
|
878 |
||
879 |
[view setFrameSize: [self frame].size]; |
|
880 |
}
|
|
881 |
return b_return; |
|
882 |
}
|
|
883 |
||
9
by Bazaar Package Importer
Import upstream version 0.8.6.release.d |
884 |
- (BOOL)setVout: (vout_thread_t *) p_arg_vout subView: (NSView *) view |
885 |
frame: (NSRect *) s_arg_frame |
|
886 |
||
887 |
{
|
|
888 |
return [self setVout: p_arg_vout subView: view frame:s_arg_frame showWindow: YES]; |
|
889 |
}
|
|
890 |
||
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
891 |
- (void)setUsed: (BOOL)b_new_used |
892 |
{
|
|
893 |
b_used = b_new_used; |
|
894 |
}
|
|
895 |
||
896 |
- (BOOL)isUsed |
|
897 |
{
|
|
898 |
return b_used; |
|
899 |
}
|
|
900 |
||
901 |
- (void)closeVout |
|
902 |
{
|
|
903 |
[super closeVout]; |
|
904 |
[o_window setAcceptsMouseMovedEvents: NO]; |
|
905 |
[[[VLCMain sharedInstance] getEmbeddedList] releaseEmbeddedVout: self]; |
|
906 |
}
|
|
907 |
||
908 |
||
909 |
@end
|
|
910 |
||
911 |
@implementation VLCDetachedEmbeddedVoutView |
|
9
by Bazaar Package Importer
Import upstream version 0.8.6.release.d |
912 |
- (void)awakeFromNib |
913 |
{
|
|
914 |
o_embeddedwindow = [self window]; |
|
915 |
}
|
|
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
916 |
|
917 |
- (BOOL)setVout: (vout_thread_t *) p_arg_vout subView: (NSView *) view |
|
918 |
frame: (NSRect *) s_arg_frame |
|
919 |
{
|
|
9
by Bazaar Package Importer
Import upstream version 0.8.6.release.d |
920 |
BOOL b_return = [super setVout: p_arg_vout subView: view frame: s_arg_frame showWindow: NO]; |
921 |
||
922 |
/* o_window needs to point to our o_embeddedwindow, super might have set it
|
|
923 |
* to the fullscreen window that o_embeddedwindow setups during fullscreen */
|
|
924 |
o_window = o_embeddedwindow; |
|
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
925 |
|
926 |
if( b_return ) |
|
927 |
{
|
|
9
by Bazaar Package Importer
Import upstream version 0.8.6.release.d |
928 |
[o_window lockFullscreenAnimation]; |
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
929 |
[o_window setAlphaValue: var_GetFloat( p_vout, "macosx-opaqueness" )]; |
930 |
[self updateTitle]; |
|
9
by Bazaar Package Importer
Import upstream version 0.8.6.release.d |
931 |
|
932 |
/* Make the window the front and key window before animating */
|
|
933 |
if ([o_window isVisible] && (![o_window isFullscreen])) |
|
934 |
[o_window makeKeyAndOrderFront: self]; |
|
935 |
||
936 |
[self scaleWindowWithFactor: 1.0 animate: [o_window isVisible] && (![o_window isFullscreen])]; |
|
937 |
||
938 |
/* Make sure our window is visible, if we are not in fullscreen */
|
|
939 |
if (![o_window isFullscreen]) |
|
940 |
[o_window makeKeyAndOrderFront: self]; |
|
941 |
||
942 |
[o_window unlockFullscreenAnimation]; |
|
943 |
||
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
944 |
}
|
945 |
return b_return; |
|
946 |
}
|
|
947 |
||
948 |
- (void)closeVout |
|
949 |
{
|
|
9
by Bazaar Package Importer
Import upstream version 0.8.6.release.d |
950 |
playlist_t * p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST, |
951 |
FIND_ANYWHERE ); |
|
10
by Bazaar Package Importer
Import upstream version 0.8.6.release.e+x264svn20071224+faad2.6.1 |
952 |
if( p_playlist ) |
953 |
{
|
|
954 |
if(!playlist_IsPlaying( p_playlist )) |
|
955 |
[o_window performSelectorOnMainThread: @selector(orderOut:) withObject: self waitUntilDone: YES]; |
|
9
by Bazaar Package Importer
Import upstream version 0.8.6.release.d |
956 |
|
10
by Bazaar Package Importer
Import upstream version 0.8.6.release.e+x264svn20071224+faad2.6.1 |
957 |
vlc_object_release( p_playlist ); |
958 |
}
|
|
9
by Bazaar Package Importer
Import upstream version 0.8.6.release.d |
959 |
|
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
960 |
[super closeVout]; |
961 |
}
|
|
962 |
||
9
by Bazaar Package Importer
Import upstream version 0.8.6.release.d |
963 |
- (void)enterFullscreen |
964 |
{
|
|
965 |
/* We are in a VLCEmbeddedWindow */
|
|
966 |
[o_embeddedwindow performSelectorOnMainThread: @selector(enterFullscreen) withObject: NULL waitUntilDone: YES]; |
|
967 |
}
|
|
968 |
||
969 |
- (void)leaveFullscreen |
|
970 |
{
|
|
971 |
/* We are in a VLCEmbeddedWindow */
|
|
972 |
[o_embeddedwindow performSelectorOnMainThread: @selector(leaveFullscreen) withObject: NULL waitUntilDone: YES]; |
|
973 |
}
|
|
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
974 |
@end
|
975 |
||
976 |
/*****************************************************************************
|
|
9
by Bazaar Package Importer
Import upstream version 0.8.6.release.d |
977 |
* VLCVoutWindow implementation
|
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
978 |
*****************************************************************************/
|
9
by Bazaar Package Importer
Import upstream version 0.8.6.release.d |
979 |
@implementation VLCVoutWindow |
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
980 |
|
981 |
- (id) initWithVout: (vout_thread_t *) vout view: (VLCVoutView *) view |
|
982 |
frame: (NSRect *) frame |
|
983 |
{
|
|
984 |
p_vout = vout; |
|
985 |
o_view = view; |
|
986 |
s_frame = frame; |
|
987 |
||
988 |
[self performSelectorOnMainThread: @selector(initReal:) |
|
989 |
withObject: NULL waitUntilDone: YES]; |
|
990 |
||
991 |
if( !b_init_ok ) |
|
992 |
{
|
|
993 |
return NULL; |
|
994 |
}
|
|
995 |
||
996 |
return self; |
|
997 |
}
|
|
998 |
||
999 |
- (id)initReal: (id) sender |
|
1000 |
{
|
|
1001 |
NSAutoreleasePool *o_pool = [[NSAutoreleasePool alloc] init]; |
|
1002 |
NSArray *o_screens = [NSScreen screens]; |
|
1003 |
NSScreen *o_screen; |
|
1004 |
vlc_bool_t b_menubar_screen = VLC_FALSE; |
|
1005 |
int i_device; |
|
1006 |
||
1007 |
b_init_ok = VLC_FALSE; |
|
1008 |
||
1009 |
p_real_vout = [VLCVoutView getRealVout: p_vout]; |
|
1010 |
i_device = var_GetInteger( p_real_vout->p_vlc, "video-device" ); |
|
7
by Bazaar Package Importer
Import upstream version 0.8.6.release |
1011 |
b_black = var_GetBool( p_vout, "macosx-black" ); |
1012 |
b_embedded = var_GetBool( p_vout, "macosx-embedded" ); |
|
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
1013 |
|
1014 |
/* Find out on which screen to open the window */
|
|
10
by Bazaar Package Importer
Import upstream version 0.8.6.release.e+x264svn20071224+faad2.6.1 |
1015 |
o_screen = [NSScreen screenWithDisplayID: (CGDirectDisplayID)i_device]; |
1016 |
if( !o_screen ) |
|
1017 |
o_screen = [self screen]; |
|
1018 |
if( [o_screen isMainScreen] ) |
|
1019 |
b_menubar_screen = VLC_TRUE; |
|
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
1020 |
|
1021 |
if( p_vout->b_fullscreen ) |
|
1022 |
{
|
|
1023 |
CGDisplayFadeReservationToken token; |
|
1024 |
NSRect screen_rect = [o_screen frame]; |
|
1025 |
screen_rect.origin.x = screen_rect.origin.y = 0; |
|
1026 |
||
7
by Bazaar Package Importer
Import upstream version 0.8.6.release |
1027 |
/* move the FSPanel to front in case that it is currently shown
|
1028 |
* this won't and is not supposed to work when it's fading right now */
|
|
1029 |
if( [[[[VLCMain sharedInstance] getControls] getFSPanel] isDisplayed] ) |
|
8
by Bazaar Package Importer
Import upstream version 0.8.6.release.c |
1030 |
[[[[VLCMain sharedInstance] getControls] getFSPanel] setActive: nil]; |
1031 |
||
7
by Bazaar Package Importer
Import upstream version 0.8.6.release |
1032 |
/* tell the fspanel to move itself to front next time it's triggered */
|
10
by Bazaar Package Importer
Import upstream version 0.8.6.release.e+x264svn20071224+faad2.6.1 |
1033 |
[[[[VLCMain sharedInstance] getControls] getFSPanel] setVoutWasUpdated: o_screen]; |
7
by Bazaar Package Importer
Import upstream version 0.8.6.release |
1034 |
|
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
1035 |
/* Creates a window with size: screen_rect on o_screen */
|
1036 |
[self initWithContentRect: screen_rect |
|
1037 |
styleMask: NSBorderlessWindowMask |
|
1038 |
backing: NSBackingStoreBuffered |
|
1039 |
defer: YES screen: o_screen]; |
|
1040 |
||
1041 |
if( b_black == VLC_TRUE ) |
|
1042 |
{
|
|
1043 |
CGAcquireDisplayFadeReservation(kCGMaxDisplayReservationInterval, &token); |
|
1044 |
CGDisplayFade( token, 0.5, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0, 0, 0, true ); |
|
1045 |
CGReleaseDisplayFadeReservation( token ); |
|
1046 |
unsigned int i; |
|
1047 |
for( i = 0 ; i < [o_screens count]; i++) |
|
1048 |
{
|
|
1049 |
struct
|
|
1050 |
{
|
|
1051 |
CGDirectDisplayID displayID; |
|
1052 |
CGGammaValue redMin, redMax, redGamma, |
|
1053 |
greenMin, greenMax, greenGamma, |
|
1054 |
blueMin, blueMax, blueGamma; |
|
1055 |
} dispSettings; |
|
1056 |
CGDisplayCount dspyCnt; |
|
1057 |
CGPoint gPoint; |
|
1058 |
||
10
by Bazaar Package Importer
Import upstream version 0.8.6.release.e+x264svn20071224+faad2.6.1 |
1059 |
if( [[o_screens objectAtIndex:i] isScreen: o_screen] ) continue; |
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
1060 |
|
1061 |
screen_rect = [[o_screens objectAtIndex: i] frame]; |
|
1062 |
||
1063 |
gPoint.x = screen_rect.origin.x; |
|
1064 |
gPoint.y = screen_rect.origin.y; |
|
1065 |
CGGetDisplaysWithPoint( gPoint, 1, &(dispSettings.displayID), &dspyCnt); |
|
1066 |
CGGetDisplayTransferByFormula( |
|
1067 |
dispSettings.displayID, |
|
1068 |
&dispSettings.redMin, &dispSettings.redMax, &dispSettings.redGamma, |
|
1069 |
&dispSettings.greenMin, &dispSettings.greenMax, &dispSettings.greenGamma, |
|
1070 |
&dispSettings.blueMin, &dispSettings.blueMax, &dispSettings.blueGamma ); |
|
1071 |
CGSetDisplayTransferByFormula( |
|
1072 |
dispSettings.displayID, |
|
1073 |
dispSettings.redMin, 0, dispSettings.redGamma, |
|
1074 |
dispSettings.greenMin, 0, dispSettings.greenGamma, |
|
1075 |
dispSettings.blueMin, 0, dispSettings.blueGamma ); |
|
1076 |
}
|
|
1077 |
}
|
|
1078 |
if( b_menubar_screen ) |
|
1079 |
{
|
|
4
by Bazaar Package Importer
Import upstream version 0.8.6-svn20060823.debian |
1080 |
SetSystemUIMode( kUIModeAllHidden, kUIOptionAutoShowMenuBar); |
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
1081 |
}
|
1082 |
if( b_black == VLC_TRUE ) |
|
1083 |
{
|
|
1084 |
CGAcquireDisplayFadeReservation(kCGMaxDisplayReservationInterval, &token); |
|
1085 |
CGDisplayFade( token, 2 , kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0, 0, 0, false ); |
|
1086 |
CGReleaseDisplayFadeReservation( token); |
|
1087 |
}
|
|
1088 |
}
|
|
7
by Bazaar Package Importer
Import upstream version 0.8.6.release |
1089 |
else if( var_GetBool( p_vout, "macosx-background" ) ) |
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
1090 |
{
|
1091 |
NSRect screen_rect = [o_screen frame]; |
|
1092 |
screen_rect.origin.x = screen_rect.origin.y = 0; |
|
1093 |
||
1094 |
/* Creates a window with size: screen_rect on o_screen */
|
|
1095 |
[self initWithContentRect: screen_rect |
|
1096 |
styleMask: NSBorderlessWindowMask |
|
1097 |
backing: NSBackingStoreBuffered |
|
1098 |
defer: YES screen: o_screen]; |
|
1099 |
||
1100 |
[self setLevel: CGWindowLevelForKey(kCGDesktopWindowLevelKey)]; |
|
1101 |
}
|
|
1102 |
else
|
|
1103 |
{
|
|
1104 |
unsigned int i_stylemask = NSTitledWindowMask | |
|
1105 |
NSMiniaturizableWindowMask | |
|
1106 |
NSClosableWindowMask | |
|
1107 |
NSResizableWindowMask; |
|
1108 |
||
1109 |
NSRect s_rect; |
|
1110 |
if( !s_frame ) |
|
1111 |
{
|
|
1112 |
s_rect.size.width = p_vout->i_window_width; |
|
1113 |
s_rect.size.height = p_vout->i_window_height; |
|
1114 |
}
|
|
1115 |
else
|
|
1116 |
{
|
|
1117 |
s_rect = *s_frame; |
|
1118 |
}
|
|
1119 |
||
1120 |
[self initWithContentRect: s_rect |
|
1121 |
styleMask: i_stylemask |
|
1122 |
backing: NSBackingStoreBuffered |
|
1123 |
defer: YES screen: o_screen]; |
|
1124 |
||
1125 |
[self setAlphaValue: var_GetFloat( p_vout, "macosx-opaqueness" )]; |
|
1126 |
||
1127 |
if( !s_frame ) |
|
1128 |
{
|
|
1129 |
[self center]; |
|
1130 |
}
|
|
1131 |
}
|
|
1132 |
||
1133 |
[self makeKeyAndOrderFront: nil]; |
|
1134 |
[self setReleasedWhenClosed: YES]; |
|
1135 |
||
1136 |
/* We'll catch mouse events */
|
|
1137 |
[self makeFirstResponder: o_view]; |
|
1138 |
||
1139 |
/* Add the view. It's automatically resized to fit the window */
|
|
1140 |
[self setContentView: o_view]; |
|
1141 |
||
1142 |
[o_pool release]; |
|
1143 |
||
1144 |
b_init_ok = VLC_TRUE; |
|
1145 |
return self; |
|
1146 |
}
|
|
1147 |
||
1148 |
- (void)close |
|
1149 |
{
|
|
1150 |
[o_view closeVout]; |
|
1151 |
}
|
|
1152 |
||
1153 |
- (void) closeWindow |
|
1154 |
{
|
|
1155 |
/* XXX waitUntilDone = NO to avoid a possible deadlock when hitting
|
|
1156 |
Command-Q */
|
|
1157 |
[self performSelectorOnMainThread: @selector(closeReal:) |
|
1158 |
withObject: NULL waitUntilDone: NO]; |
|
1159 |
}
|
|
1160 |
||
7
by Bazaar Package Importer
Import upstream version 0.8.6.release |
1161 |
- (id)closeReal: (id)sender |
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
1162 |
{
|
1163 |
if( b_black == VLC_TRUE ) |
|
1164 |
{
|
|
1165 |
CGDisplayFadeReservationToken token; |
|
1166 |
CGAcquireDisplayFadeReservation(kCGMaxDisplayReservationInterval, &token); |
|
10
by Bazaar Package Importer
Import upstream version 0.8.6.release.e+x264svn20071224+faad2.6.1 |
1167 |
CGDisplayFade( token, 0.3 , kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0, 0, 0, YES ); |
1168 |
||
1169 |
[self disableScreenUpdatesUntilFlush]; |
|
1170 |
[self orderOut: self]; |
|
1171 |
||
1172 |
CGDisplayFade( token, 0.6 , kCGDisplayBlendSolidColor, kCGDisplayBlendNormal, 0, 0, 0, YES ); |
|
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
1173 |
CGReleaseDisplayFadeReservation( token); |
1174 |
CGDisplayRestoreColorSyncSettings(); |
|
1175 |
}
|
|
10
by Bazaar Package Importer
Import upstream version 0.8.6.release.e+x264svn20071224+faad2.6.1 |
1176 |
[NSScreen unblackoutScreens]; |
1177 |
||
4
by Bazaar Package Importer
Import upstream version 0.8.6-svn20060823.debian |
1178 |
SetSystemUIMode( kUIModeNormal, 0); |
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
1179 |
[super close]; |
7
by Bazaar Package Importer
Import upstream version 0.8.6.release |
1180 |
|
1181 |
/* this does only work in embedded mode */
|
|
1182 |
if( b_embedded == VLC_TRUE ) |
|
1183 |
[[[[VLCMain sharedInstance] getControls] getFSPanel] orderOut: self]; |
|
1184 |
||
3
by Bazaar Package Importer
Import upstream version 0.8.5.debian |
1185 |
return NULL; |
1186 |
}
|
|
1187 |
||
1188 |
- (id)getVoutView |
|
1189 |
{
|
|
1190 |
return o_view; |
|
1191 |
}
|
|
1192 |
||
1193 |
- (BOOL)canBecomeKeyWindow |
|
1194 |
{
|
|
1195 |
return YES; |
|
1196 |
}
|
|
1197 |
||
1198 |
/* Sometimes crashes VLC....
|
|
1199 |
- (BOOL)performKeyEquivalent:(NSEvent *)o_event
|
|
1200 |
{
|
|
1201 |
return [[VLCMain sharedInstance] hasDefinedShortcutKey:o_event];
|
|
1202 |
}*/
|
|
1203 |
||
1204 |
/* This is actually the same as VLCControls::stop. */
|
|
1205 |
||
1206 |
- (BOOL)windowShouldClose:(id)sender |
|
1207 |
{
|
|
1208 |
playlist_t * p_playlist = vlc_object_find( p_vout, VLC_OBJECT_PLAYLIST, |
|
1209 |
FIND_ANYWHERE ); |
|
1210 |
if( p_playlist == NULL ) |
|
1211 |
{
|
|
1212 |
return NO; |
|
1213 |
}
|
|
1214 |
||
1215 |
playlist_Stop( p_playlist ); |
|
1216 |
vlc_object_release( p_playlist ); |
|
1217 |
||
1218 |
/* The window will be closed by the intf later. */
|
|
1219 |
return NO; |
|
1220 |
}
|
|
1221 |
||
1
by Bazaar Package Importer
Import upstream version 0.7.2.final |
1222 |
|
1223 |
@end
|