/* BeginFullScreen, EndFullScreen */
#include <QuickTime/QuickTime.h>
+/* prevent system sleep */
+#import <CoreServices/CoreServices.h>
+
#include <vlc_keys.h>
#include "intf.h"
- (id)initWithFrame: (NSRect)frameRect
{
- [super initWithFrame: frameRect];
+ self = [super initWithFrame: frameRect];
p_vout = NULL;
o_view = nil;
s_frame = &frameRect;
- (void)manage
{
/* Disable Screensaver, when we're playing something, but allow it on pause */
- if( !VLCIntf || !VLCIntf->p_sys || !VLCIntf->p_sys->i_play_status )
+ if( !VLCIntf || !VLCIntf->p_sys )
return;
+ UInt8 UsrActivity;
if( VLCIntf->p_sys->i_play_status == PLAYING_S )
UpdateSystemActivity( UsrActivity );
}
}
else if ( p_vout )
{
- vlc_value_t val;
if( key == ' ')
val.i_int = config_GetInt( p_vout, "key-play-pause" );
else
- val.i_int |= CocoaKeyToVLC( key );
+ val.i_int |= (int)CocoaKeyToVLC( key );
var_Set( p_vout->p_libvlc, "key-pressed", val );
}
else NSLog( @"Could not send keyevent to VLC core" );
}
else
- {
[super keyDown: o_event];
- }
}
- (void)mouseDown:(NSEvent *)o_event
( [o_event modifierFlags] & NSControlKeyMask ) ) )
{
msg_Dbg( p_vout, "received NSRightMouseDown (generic method) or Ctrl clic" );
- [NSMenu popUpContextMenu: [[VLCMain sharedInstance] getVoutMenu] withEvent: o_event forView: [[[VLCMain sharedInstance] getControls] getVoutView]];
+ [NSMenu popUpContextMenu: [[VLCMain sharedInstance] getVoutMenu] withEvent: o_event forView: [[[VLCMain sharedInstance] getControls] voutView]];
}
}
if( p_vout && [o_event type] == NSRightMouseDown )
{
msg_Dbg( p_vout, "received NSRightMouseDown (specific method)" );
- [NSMenu popUpContextMenu: [[VLCMain sharedInstance] getVoutMenu] withEvent: o_event forView: [[[VLCMain sharedInstance] getControls] getVoutView]];
+ [NSMenu popUpContextMenu: [[VLCMain sharedInstance] getVoutMenu] withEvent: o_event forView: [[[VLCMain sharedInstance] getControls] voutView]];
}
[super mouseDown: o_event];
/* FIXME: this isn't the appropriate place, but we can't receive
* NSRightMouseDown some how */
msg_Dbg( p_vout, "received NSRightMouseUp" );
- [NSMenu popUpContextMenu: [[VLCMain sharedInstance] getVoutMenu] withEvent: o_event forView: [[[VLCMain sharedInstance] getControls] getVoutView]];
+ [NSMenu popUpContextMenu: [[VLCMain sharedInstance] getVoutMenu] withEvent: o_event forView: [[[VLCMain sharedInstance] getControls] voutView]];
}
[super mouseUp: o_event];
{
/* p_real_vout: the vout we have to use to check for video-on-top
and a few other things. If we are the QuickTime output, it's us.
- It we are the OpenGL provider, it is our parent. */
- if( p_vout->i_object_type == VLC_OBJECT_OPENGL )
- {
- return (vout_thread_t *) p_vout->p_parent;
- }
- else
- {
- return p_vout;
- }
-
+ It we are the OpenGL provider, it is our parent.
+ Since we can't be the QuickTime output anymore, we need to be
+ the parent.
+ FIXME: check with the caca and x11 vouts! */
+ return (vout_thread_t *) p_vout->p_parent;
}
-+ (id)getVoutView: (vout_thread_t *)p_vout subView: (NSView *)view
- frame: (NSRect *)s_frame
++ (id)voutView: (vout_thread_t *)p_vout subView: (NSView *)view
+ frame: (NSRect *)s_frame
{
vlc_value_t value_drawable;
int i_timeout;
- (void)enterFullscreen
{
/* Save the settings for next playing item */
- playlist_t * p_playlist = pl_Yield( p_real_vout );
+ playlist_t * p_playlist = pl_Hold( p_real_vout );
var_SetBool( p_playlist, "fullscreen", true );
pl_Release( p_real_vout );
}
- (void)leaveFullscreen
{
/* Save the settings for next playing item */
- playlist_t * p_playlist = pl_Yield( p_real_vout );
+ playlist_t * p_playlist = pl_Hold( p_real_vout );
var_SetBool( p_playlist, "fullscreen", false );
pl_Release( p_real_vout );
}
[self setLevel: NSStatusWindowLevel];
}
-- (id)getVoutView // FIXME Naming scheme!
+- (id)voutView
{
return o_view;
}