Commit a6cb8953 authored by hartman's avatar hartman
Browse files

* fixed fullscreen on osx with multiple vouts.

* different way to remember fullscreen state.
* update the playlist on item-append and item-deleted calls.
* fixed video-on-top with opengl vouts on OSX.
parent 44c6d658
......@@ -174,6 +174,9 @@ C: hartman
D: Mac OS X interface
D: Dutch translation
D: Directory input
D: Mac OS X Video Output
D: Mac OS X Audio Output
D: Kasenna client support
S: Netherlands
N: Gal Hendryckx
......
......@@ -144,7 +144,7 @@ Todo:<br />
- *** Item moving/copying facilities<br />
- * Ability to save playlist on quit<br />
- ? Represent navigation structure as "fake items" ? <br />
- Custom playlist format<br />
- Custom playlist format (http://xspf.xiph.org/ looks like a good idea)<br />
- Helper modules<br />
- ** ASX and B4S parsers (see below)<br />
- * Rewrite SLP announce discovery<br />
......
......@@ -274,9 +274,6 @@
vout_thread_t *p_vout = vlc_object_find( VLCIntf, VLC_OBJECT_VOUT,
FIND_ANYWHERE );
playlist_t * p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_vout != NULL )
{
while ((o_window = [o_enumerator nextObject]))
......@@ -302,30 +299,26 @@
}
else
{
vlc_value_t val;
var_Get( p_vout, "fullscreen", &val );
var_Set( p_vout, "fullscreen", (vlc_value_t)!val.b_bool );
[o_window toggleFullscreen];
}
break;
}
}
vlc_object_release( (vlc_object_t *)p_vout );
if (p_playlist) vlc_object_release(p_playlist);
}
else if ( p_playlist != NULL )
else
{
if (! ([o_title isEqualToString: _NS("Half Size") ] ||
[o_title isEqualToString: _NS("Normal Size") ] ||
[o_title isEqualToString: _NS("Double Size") ] ||
[o_title isEqualToString: _NS("Float on Top") ] ||
[o_title isEqualToString: _NS("Fit to Screen") ] ))
playlist_t * p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist && ( [o_title isEqualToString: _NS("Fullscreen")] ||
[sender isKindOfClass:[NSButton class]] ) )
{
vlc_value_t val;
var_Get( p_playlist, "fullscreen", &val );
var_Set( p_playlist, "fullscreen", (vlc_value_t)!val.b_bool );
}
vlc_object_release( (vlc_object_t *)p_playlist );
if( p_playlist ) vlc_object_release( (vlc_object_t *)p_playlist );
}
}
......@@ -566,13 +559,14 @@
{
vlc_mutex_lock( &p_playlist->object_lock );
}
else return FALSE;
#define p_input p_playlist->p_input
if( [[o_mi title] isEqualToString: _NS("Faster")] ||
[[o_mi title] isEqualToString: _NS("Slower")] )
{
if( p_playlist != NULL && p_input != NULL )
if( p_input != NULL )
{
bEnabled = p_input->input.b_can_pace_control;
}
......@@ -583,7 +577,7 @@
}
else if( [[o_mi title] isEqualToString: _NS("Stop")] )
{
if( p_playlist == NULL || p_input == NULL )
if( p_input == NULL )
{
bEnabled = FALSE;
}
......@@ -592,14 +586,7 @@
else if( [[o_mi title] isEqualToString: _NS("Previous")] ||
[[o_mi title] isEqualToString: _NS("Next")] )
{
if( p_playlist == NULL )
{
bEnabled = FALSE;
}
else
{
bEnabled = p_playlist->i_size > 1;
}
}
else if( [[o_mi title] isEqualToString: _NS("Random")] )
{
......@@ -625,14 +612,10 @@
else if( [[o_mi title] isEqualToString: _NS("Step Forward")] ||
[[o_mi title] isEqualToString: _NS("Step Backward")] )
{
bEnabled = FALSE;
if( p_playlist != NULL && p_input != NULL )
if( p_input != NULL )
{
var_Get( p_input, "seekable", &val);
if( val.b_bool )
{
bEnabled = TRUE;
}
bEnabled = val.b_bool;
}
}
else if( [[o_mi title] isEqualToString: _NS("Mute")] )
......@@ -645,6 +628,7 @@
[[o_mi title] isEqualToString: _NS("Double Size")] ||
[[o_mi title] isEqualToString: _NS("Fit to Screen")] ||
[[o_mi title] isEqualToString: _NS("Snapshot")] ||
[[o_mi title] isEqualToString: _NS("Fullscreen")] ||
[[o_mi title] isEqualToString: _NS("Float on Top")] )
{
id o_window;
......@@ -656,13 +640,13 @@
FIND_ANYWHERE );
if( p_vout != NULL )
{
if ( [[o_mi title] isEqualToString: _NS("Float on Top")] )
if( [[o_mi title] isEqualToString: _NS("Float on Top")] )
{
var_Get( p_vout, "video-on-top", &val );
[o_mi setState: val.b_bool ? NSOnState : NSOffState];
}
while ((o_window = [o_enumerator nextObject]))
while( (o_window = [o_enumerator nextObject]))
{
if( [[o_window className] isEqualToString: @"VLCWindow"] )
{
......@@ -672,28 +656,17 @@
}
vlc_object_release( (vlc_object_t *)p_vout );
}
}
else if( [[o_mi title] isEqualToString: _NS("Fullscreen")])
{
if (p_playlist)
else if( [[o_mi title] isEqualToString: _NS("Fullscreen")] )
{
var_Get(p_playlist, "fullscreen", &val );
var_Get( p_playlist, "fullscreen", &val );
[o_mi setState: val.b_bool];
bEnabled = TRUE;
}
else
{
bEnabled = FALSE;
}
[o_main setupMenus]; /* Make sure video menu is up to date */
}
if( p_playlist != NULL )
{
vlc_mutex_unlock( &p_playlist->object_lock );
vlc_object_release( p_playlist );
}
vlc_mutex_unlock( &p_playlist->object_lock );
vlc_object_release( p_playlist );
return( bEnabled );
}
......
......@@ -772,6 +772,8 @@ static VLCMain *_o_sharedMainInstance = nil;
{
var_AddCallback( p_playlist, "intf-change", PlaylistChanged, self );
var_AddCallback( p_playlist, "item-change", PlaylistChanged, self );
var_AddCallback( p_playlist, "item-append", PlaylistChanged, self );
var_AddCallback( p_playlist, "item-deleted", PlaylistChanged, self );
var_AddCallback( p_playlist, "playlist-current", PlaylistChanged, self );
vlc_object_release( p_playlist );
......@@ -884,9 +886,8 @@ static VLCMain *_o_sharedMainInstance = nil;
{
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
[o_btn_fullscreen setState: ( var_Get( p_playlist, "fullscreen", &val )>=0 && val.b_bool ) ];
var_Get( p_playlist, "fullscreen", &val );
[o_btn_fullscreen setState: val.b_bool];
vlc_object_release( p_playlist );
p_intf->p_sys->b_fullscreen_update = VLC_FALSE;
......
......@@ -365,7 +365,7 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
{
vlc_value_t val;
if( var_Get( p_vout, "video-on-top", &val )>=0 && val.b_bool)
if( var_Get( p_real_vout, "video-on-top", &val )>=0 && val.b_bool)
{
val.b_bool = VLC_FALSE;
}
......@@ -373,24 +373,27 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
{
val.b_bool = VLC_TRUE;
}
var_Set( p_vout, "video-on-top", val );
var_Set( p_real_vout, "video-on-top", val );
}
- (void)toggleFullscreen
{
vlc_value_t val;
val.b_bool = !p_real_vout->b_fullscreen;
var_Get( p_real_vout, "fullscreen", &val );
val.b_bool = !val.b_bool;
var_Set( p_real_vout, "fullscreen", val );
}
- (BOOL)isFullscreen
{
return( p_vout->b_fullscreen );
vlc_value_t val;
var_Get( p_real_vout, "fullscreen", &val );
return( val.b_bool );
}
- (void)snapshot
{
vout_Control( p_vout, VOUT_SNAPSHOT );
vout_Control( p_real_vout, VOUT_SNAPSHOT );
}
- (BOOL)canBecomeKeyWindow
......
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