Commit 08131e5e authored by Felix Paul Kühne's avatar Felix Paul Kühne

* port fullscreen controller fixes, thus [18458], [18417], [18409], [18384]

parent 9386823c
/*****************************************************************************
* fspanel.h: MacOS X full screen panel
*****************************************************************************
* Copyright (C) 2006 the VideoLAN team
* Copyright (C) 2006-2007 the VideoLAN team
* $Id: fspanel.h 16935 2006-10-04 08:19:38Z fkuehne $
*
* Authors: Jérôme Decoodt <djc at videolan dot org>
......@@ -31,6 +31,7 @@
BOOL b_alreadyCounting;
int i_timeToKeepVisibleInSec;
BOOL b_nonActive;
BOOL b_displayed;
BOOL b_voutWasUpdated;
int i_device;
......@@ -50,6 +51,9 @@
- (void)setSeekable:(BOOL) b_seekable;
- (void)setVolumeLevel: (float)f_volumeLevel;
- (void)setNonActive:(id)noData;
- (void)setActive:(id)noData;
- (void)focus:(NSTimer *)timer;
- (void)unfocus:(NSTimer *)timer;
- (void)mouseExited:(NSEvent *)theEvent;
......@@ -72,7 +76,7 @@
@interface VLCFSPanelView : NSView
{
NSColor *fillColor;
NSButton *o_prev, *o_next, *o_slow, *o_fast, *o_play, *o_fullscreen;
NSButton *o_prev, *o_next, *o_bwd, *o_fwd, *o_play, *o_fullscreen;
NSTextField *o_streamTitle_txt, *o_streamPosition_txt;
NSSlider *o_fs_timeSlider, *o_fs_volumeSlider;
}
......@@ -88,8 +92,8 @@
- (IBAction)play:(id)sender;
- (IBAction)prev:(id)sender;
- (IBAction)next:(id)sender;
- (IBAction)faster:(id)sender;
- (IBAction)slower:(id)sender;
- (IBAction)forward:(id)sender;
- (IBAction)backward:(id)sender;
- (IBAction)fsTimeSliderUpdate:(id)sender;
- (IBAction)fsVolumeSliderUpdate:(id)sender;
......
/*****************************************************************************
* fspanel.m: MacOS X full screen panel
*****************************************************************************
* Copyright (C) 2006 the VideoLAN team
* Copyright (C) 2006-2007 the VideoLAN team
* $Id: fspanel.m 17038 2006-10-12 18:24:34Z fkuehne $
*
* Authors: Jérôme Decoodt <djc at videolan dot org>
......@@ -65,6 +65,20 @@
[self mouseEntered:NULL];
if (!isInside)
[self mouseExited:NULL];
/* get a notification if VLC isn't the active app anymore */
[[NSNotificationCenter defaultCenter]
addObserver: self
selector: @selector(setNonActive:)
name: NSApplicationDidResignActiveNotification
object: NSApp];
/* get a notification if VLC is the active app again */
[[NSNotificationCenter defaultCenter]
addObserver: self
selector: @selector(setActive:)
name: NSApplicationDidBecomeActiveNotification
object: NSApp];
}
/* Windows created with NSBorderlessWindowMask normally can't be key, but we want ours to be */
......@@ -80,6 +94,8 @@
-(void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver: self];
if( hideAgainTimer )
[hideAgainTimer release];
[self setFadeTimer:nil];
......@@ -137,6 +153,27 @@
[[self contentView] setVolumeLevel: f_volumeLevel];
}
- (void)setNonActive:(id)noData
{
b_nonActive = YES;
[self orderOut: self];
/* here's fadeOut, just without visibly fading */
b_displayed = NO;
[self setAlphaValue:0.0];
[self setFadeTimer:nil];
b_fadeQueued = NO;
}
- (void)setActive:(id)noData
{
if( [[[[VLCMain sharedInstance] getControls] getVoutView] isFullscreen] )
{
b_nonActive = NO;
[self fadeIn];
}
}
/* This routine is called repeatedly to fade in the window */
- (void)focus:(NSTimer *)timer
{
......@@ -203,7 +240,13 @@
- (void)fadeIn
{
if( [self alphaValue] < 1.0 )
/* in case that the user don't want us to appear, just return here */
if(! config_GetInt( VLCIntf, "macosx-fspanel" ) || b_nonActive )
return;
[self orderFront: nil];
if( [self alphaValue] < 1.0 || b_displayed != YES )
{
if (![self fadeTimer])
[self setFadeTimer:[NSTimer scheduledTimerWithTimeInterval:0.05 target:self selector:@selector(focus:) userInfo:[NSNumber numberWithShort:1] repeats:YES]];
......@@ -349,9 +392,9 @@
fillColor = [[NSColor clearColor] retain];
NSRect s_rc = [self frame];
addButton( o_prev, @"fs_skip_previous" , @"fs_skip_previous_highlight", 174, 15, prev );
addButton( o_slow, @"fs_rewind" , @"fs_rewind_highlight" , 211, 14, slower );
addButton( o_bwd, @"fs_rewind" , @"fs_rewind_highlight" , 211, 14, backward );
addButton( o_play, @"fs_play" , @"fs_play_highlight" , 267, 10, play );
addButton( o_fast, @"fs_forward" , @"fs_forward_highlight" , 313, 14, faster );
addButton( o_fwd, @"fs_forward" , @"fs_forward_highlight" , 313, 14, forward );
addButton( o_next, @"fs_skip_next" , @"fs_skip_next_highlight" , 365, 15, next );
addButton( o_fullscreen, @"fs_exit_fullscreen", @"fs_exit_fullscreen_hightlight", 507, 13, windowAction );
/*
......@@ -409,9 +452,9 @@
[o_fs_volumeSlider release];
[o_prev release];
[o_next release];
[o_slow release];
[o_bwd release];
[o_play release];
[o_fast release];
[o_fwd release];
[o_fullscreen release];
[o_streamTitle_txt release];
[o_streamPosition_txt release];
......@@ -443,8 +486,8 @@
- (void)setSeekable:(BOOL)b_seekable
{
[o_slow setEnabled: b_seekable];
[o_fast setEnabled: b_seekable];
[o_bwd setEnabled: b_seekable];
[o_fwd setEnabled: b_seekable];
[o_fs_timeSlider setEnabled: b_seekable];
}
......@@ -458,14 +501,14 @@
[[[VLCMain sharedInstance] getControls] play: sender];
}
- (IBAction)faster:(id)sender
- (IBAction)forward:(id)sender
{
[[[VLCMain sharedInstance] getControls] faster: sender];
[[[VLCMain sharedInstance] getControls] forward: sender];
}
- (IBAction)slower:(id)sender
- (IBAction)backward:(id)sender
{
[[[VLCMain sharedInstance] getControls] slower: sender];
[[[VLCMain sharedInstance] getControls] backward: sender];
}
- (IBAction)prev:(id)sender
......
/*****************************************************************************
* macosx.m: Mac OS X module for vlc
*****************************************************************************
* Copyright (C) 2001-2005 the VideoLAN team
* Copyright (C) 2001-2007 the VideoLAN team
* $Id$
*
* Authors: Colin Delacroix <colin@zoy.org>
......@@ -79,6 +79,10 @@ void E_(CloseVideoGL) ( vlc_object_t * );
#define BACKGROUND_LONGTEXT N_("Use the video as the Desktop Background " \
"Desktop icons cannot be interacted with in this mode." )
#define FSPANEL_TEXT N_("Show Fullscreen controller")
#define FSPANEL_LONGTEXT N_("Shows a lucent controller when moving the mouse " \
"in fullscreen mode.")
#define WIZARD_OPTIONS_SAVING_TEXT N_("Remember wizard options")
#define WIZARD_OPTIONS_SAVING_LONGTEXT N_("Remember the options in the " \
"wizard during one session of VLC.")
......@@ -96,6 +100,8 @@ vlc_module_begin();
add_submodule();
set_description( _("Quartz video") );
VLC_FALSE );
add_bool( "macosx-fspanel", 1, NULL, FSPANEL_TEXT, FSPANEL_LONGTEXT,
set_capability( "video output", 100 );
set_category( CAT_VIDEO);
set_subcategory( SUBCAT_VIDEO_VOUT );
......
/*****************************************************************************
* vout.m: MacOS X video output module
*****************************************************************************
* Copyright (C) 2001-2006 the VideoLAN team
* Copyright (C) 2001-2007 the VideoLAN team
* $Id$
*
* Authors: Colin Delacroix <colin@zoy.org>
......@@ -374,9 +374,9 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
val.b_bool = !val.b_bool;
var_Set( p_real_vout, "fullscreen", val );
if( [self isFullscreen] )
[[[[VLCMain sharedInstance] getControls] getFSPanel] orderFront: self];
[[[[VLCMain sharedInstance] getControls] getFSPanel] setActive: nil];
else
[[[[VLCMain sharedInstance] getControls] getFSPanel] orderOut: self];
[[[[VLCMain sharedInstance] getControls] getFSPanel] setNonActive: nil];
}
- (BOOL)isFullscreen
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment