[vlc-devel] commit: macosx: Save current fullscreen state. (Pierre d'Herbemont )
git version control
git at videolan.org
Sat Jul 12 17:34:13 CEST 2008
vlc | branch: master | Pierre d'Herbemont <pdherbemont at videolan.org> | Sat Jul 12 16:14:07 2008 +0200| [79559bdf7ff37fb54364a3ef7917b1e5481dc4c2]
macosx: Save current fullscreen state.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=79559bdf7ff37fb54364a3ef7917b1e5481dc4c2
---
modules/gui/macosx/controls.m | 7 +++-
modules/gui/macosx/embeddedwindow.m | 1 +
modules/gui/macosx/vout.m | 56 +++++++++++++++++++++++++---------
3 files changed, 47 insertions(+), 17 deletions(-)
diff --git a/modules/gui/macosx/controls.m b/modules/gui/macosx/controls.m
index c68b575..75536d4 100644
--- a/modules/gui/macosx/controls.m
+++ b/modules/gui/macosx/controls.m
@@ -499,6 +499,8 @@
}
else
{
+ playlist_t * p_playlist = pl_Yield( VLCIntf );
+ /* Fullscreen state for next time will be saved here too */
[o_vout_view toggleFullscreen];
}
}
@@ -516,7 +518,7 @@
var_Set( p_playlist, "fullscreen", (vlc_value_t)!val.b_bool );
}
- vlc_object_release( p_playlist );
+ pl_Release( VLCIntf );
}
}
@@ -987,9 +989,10 @@
break;
}
}
+
vlc_object_release( (vlc_object_t *)p_vout );
}
- else if( [[o_mi title] isEqualToString: _NS("Fullscreen")] )
+ if( [[o_mi title] isEqualToString: _NS("Fullscreen")] )
{
var_Get( p_playlist, "fullscreen", &val );
[o_mi setState: val.b_bool];
diff --git a/modules/gui/macosx/embeddedwindow.m b/modules/gui/macosx/embeddedwindow.m
index 4ce60e6..d16a16b 100644
--- a/modules/gui/macosx/embeddedwindow.m
+++ b/modules/gui/macosx/embeddedwindow.m
@@ -492,6 +492,7 @@
- (void)orderOut: (id)sender
{
[super orderOut: sender];
+
/* Make sure we leave fullscreen */
[self leaveFullscreenAndFadeOut: YES];
}
diff --git a/modules/gui/macosx/vout.m b/modules/gui/macosx/vout.m
index 8c70680..bdda538 100644
--- a/modules/gui/macosx/vout.m
+++ b/modules/gui/macosx/vout.m
@@ -766,24 +766,18 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
- (void)enterFullscreen
{
- if( var_GetBool( p_real_vout, "video-on-top" ) )
- {
- [o_window setLevel: NSNormalWindowLevel];
- }
-
- [[o_view class] performSelectorOnMainThread:@selector(resetVout:) withObject:[NSValue valueWithPointer:p_vout] waitUntilDone:YES];
- [[[[VLCMain sharedInstance] getControls] getFSPanel] setActive: nil];
+ /* Save the settings for next playing item */
+ playlist_t * p_playlist = pl_Yield( p_real_vout );
+ var_SetBool( p_playlist, "fullscreen", true );
+ pl_Release( p_real_vout );
}
- (void)leaveFullscreen
{
- if( var_GetBool( p_real_vout, "video-on-top" ) )
- {
- [o_window setLevel: NSStatusWindowLevel];
- }
-
- [[o_view class] performSelectorOnMainThread:@selector(resetVout:) withObject:[NSValue valueWithPointer:p_vout] waitUntilDone:YES];
- [[[[VLCMain sharedInstance] getControls] getFSPanel] setNonActive: nil];
+ /* Save the settings for next playing item */
+ playlist_t * p_playlist = pl_Yield( p_real_vout );
+ var_SetBool( p_playlist, "fullscreen", false );
+ pl_Release( p_real_vout );
}
@end
@@ -871,6 +865,33 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
}
}
+
+- (void)enterFullscreen
+{
+ [super enterFullscreen];
+
+ if( var_GetBool( p_real_vout, "video-on-top" ) )
+ {
+ [o_window setLevel: NSNormalWindowLevel];
+ }
+
+ [[o_view class] performSelectorOnMainThread:@selector(resetVout:) withObject:[NSValue valueWithPointer:p_vout] waitUntilDone:YES];
+ [[[[VLCMain sharedInstance] getControls] getFSPanel] setActive: nil];
+}
+
+- (void)leaveFullscreen
+{
+ [super leaveFullscreen];
+
+ if( var_GetBool( p_real_vout, "video-on-top" ) )
+ {
+ [o_window setLevel: NSStatusWindowLevel];
+ }
+
+ [[o_view class] performSelectorOnMainThread:@selector(resetVout:) withObject:[NSValue valueWithPointer:p_vout] waitUntilDone:YES];
+ [[[[VLCMain sharedInstance] getControls] getFSPanel] setNonActive: nil];
+}
+
@end
/*****************************************************************************
@@ -974,12 +995,18 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
- (void)enterFullscreen
{
+ /* Save settings */
+ [super enterFullscreen];
+
/* We are in a VLCEmbeddedWindow */
[o_embeddedwindow performSelectorOnMainThread: @selector(enterFullscreen) withObject: NULL waitUntilDone: YES];
}
- (void)leaveFullscreen
{
+ /* Save settings */
+ [super leaveFullscreen];
+
/* We are in a VLCEmbeddedWindow */
[o_embeddedwindow performSelectorOnMainThread: @selector(leaveFullscreen) withObject: NULL waitUntilDone: YES];
}
@@ -1200,5 +1227,4 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
return NO;
}
-
@end
More information about the vlc-devel
mailing list