Commit 2cd7d7a6 authored by Benjamin Pracht's avatar Benjamin Pracht

* Fullscreen button works again

* It enabled even when no vout is present
* Still a little issue with the fullscreen hotkey
parent 8a530241
......@@ -9,7 +9,7 @@
<key>1617</key>
<string>542 480 104 149 0 0 1024 746 </string>
<key>29</key>
<string>59 849 419 44 0 0 1280 938 </string>
<string>41 667 419 44 0 0 1024 746 </string>
<key>915</key>
<string>54 452 185 199 0 0 1024 746 </string>
</dict>
......@@ -21,8 +21,8 @@
</array>
<key>IBOpenObjects</key>
<array>
<integer>29</integer>
<integer>21</integer>
<integer>29</integer>
</array>
<key>IBSystem Version</key>
<string>7M34</string>
......
......@@ -270,6 +270,9 @@
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]))
......@@ -299,7 +302,24 @@
}
}
vlc_object_release( (vlc_object_t *)p_vout );
if (p_playlist) vlc_object_release(p_playlist);
}
else if ( p_playlist != NULL )
{
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") ] ))
{
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 );
}
}
- (void)setupVarMenuItem:(NSMenuItem *)o_mi
......@@ -610,8 +630,7 @@
{
[o_mi setState: p_intf->p_sys->b_mute ? NSOnState : NSOffState];
}
else if( [[o_mi title] isEqualToString: _NS("Fullscreen")] ||
[[o_mi title] isEqualToString: _NS("Half Size")] ||
else if( [[o_mi title] isEqualToString: _NS("Half Size")] ||
[[o_mi title] isEqualToString: _NS("Normal Size")] ||
[[o_mi title] isEqualToString: _NS("Double Size")] ||
[[o_mi title] isEqualToString: _NS("Fit to Screen")] ||
......@@ -643,6 +662,20 @@
vlc_object_release( (vlc_object_t *)p_vout );
}
}
else if( [[o_mi title] isEqualToString: _NS("Fullscreen")])
{
if (p_playlist)
{
var_Get(p_playlist, "fullscreen", &val );
[o_mi setState: val.b_bool];
bEnabled = TRUE;
}
else
{
bEnabled = FALSE;
}
}
if( p_playlist != NULL )
{
......
......@@ -180,6 +180,19 @@ int PlaylistChanged( vlc_object_t *p_this, const char *psz_variable,
return VLC_SUCCESS;
}
/*****************************************************************************
* FullscreenChanged: Callback triggered by the fullscreen-change playlist
* variable, to let the intf update the controller.
*****************************************************************************/
int FullscreenChanged( vlc_object_t *p_this, const char *psz_variable,
vlc_value_t old_val, vlc_value_t new_val, void *param )
{
intf_thread_t * p_intf = VLCIntf;
p_intf->p_sys->b_fullscreen_update = TRUE;
return VLC_SUCCESS;
}
static struct
{
unichar i_nskey;
......@@ -365,6 +378,11 @@ static VLCMain *_o_sharedMainInstance = nil;
{
playlist_Play( p_playlist );
}
var_Create( p_playlist, "fullscreen", VLC_VAR_BOOL | VLC_VAR_DOINHERIT);
val.b_bool = VLC_FALSE;
var_AddCallback( p_playlist, "fullscreen", FullscreenChanged, self);
[o_btn_fullscreen setState: ( var_Get( p_playlist, "fullscreen", &val )>=0 && val.b_bool )];
vlc_object_release( p_playlist );
}
......@@ -700,6 +718,7 @@ static VLCMain *_o_sharedMainInstance = nil;
{
NSDate * o_sleep_date;
playlist_t * p_playlist;
vlc_value_t val;
/* new thread requires a new pool */
NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init];
......@@ -714,6 +733,7 @@ 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, "playlist-current", PlaylistChanged, self );
vlc_object_release( p_playlist );
}
......@@ -822,8 +842,6 @@ static VLCMain *_o_sharedMainInstance = nil;
if( p_intf->p_sys->b_fullscreen_update )
{
vout_thread_t * p_vout;
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
......@@ -831,16 +849,6 @@ static VLCMain *_o_sharedMainInstance = nil;
vlc_object_release( p_playlist );
p_vout = vlc_object_find( p_intf, VLC_OBJECT_VOUT, FIND_ANYWHERE );
if( p_vout != NULL )
{
[o_btn_fullscreen setEnabled: VLC_TRUE];
vlc_object_release( p_vout );
}
else
{
[o_btn_fullscreen setEnabled: VLC_FALSE];
}
p_intf->p_sys->b_fullscreen_update = VLC_FALSE;
}
......
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