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 @@ ...@@ -9,7 +9,7 @@
<key>1617</key> <key>1617</key>
<string>542 480 104 149 0 0 1024 746 </string> <string>542 480 104 149 0 0 1024 746 </string>
<key>29</key> <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> <key>915</key>
<string>54 452 185 199 0 0 1024 746 </string> <string>54 452 185 199 0 0 1024 746 </string>
</dict> </dict>
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
</array> </array>
<key>IBOpenObjects</key> <key>IBOpenObjects</key>
<array> <array>
<integer>29</integer>
<integer>21</integer> <integer>21</integer>
<integer>29</integer>
</array> </array>
<key>IBSystem Version</key> <key>IBSystem Version</key>
<string>7M34</string> <string>7M34</string>
......
...@@ -270,6 +270,9 @@ ...@@ -270,6 +270,9 @@
vout_thread_t *p_vout = vlc_object_find( VLCIntf, VLC_OBJECT_VOUT, vout_thread_t *p_vout = vlc_object_find( VLCIntf, VLC_OBJECT_VOUT,
FIND_ANYWHERE ); FIND_ANYWHERE );
playlist_t * p_playlist = vlc_object_find( VLCIntf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_vout != NULL ) if( p_vout != NULL )
{ {
while ((o_window = [o_enumerator nextObject])) while ((o_window = [o_enumerator nextObject]))
...@@ -299,7 +302,24 @@ ...@@ -299,7 +302,24 @@
} }
} }
vlc_object_release( (vlc_object_t *)p_vout ); 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 - (void)setupVarMenuItem:(NSMenuItem *)o_mi
...@@ -610,8 +630,7 @@ ...@@ -610,8 +630,7 @@
{ {
[o_mi setState: p_intf->p_sys->b_mute ? NSOnState : NSOffState]; [o_mi setState: p_intf->p_sys->b_mute ? NSOnState : NSOffState];
} }
else if( [[o_mi title] isEqualToString: _NS("Fullscreen")] || else if( [[o_mi title] isEqualToString: _NS("Half Size")] ||
[[o_mi title] isEqualToString: _NS("Half Size")] ||
[[o_mi title] isEqualToString: _NS("Normal Size")] || [[o_mi title] isEqualToString: _NS("Normal Size")] ||
[[o_mi title] isEqualToString: _NS("Double Size")] || [[o_mi title] isEqualToString: _NS("Double Size")] ||
[[o_mi title] isEqualToString: _NS("Fit to Screen")] || [[o_mi title] isEqualToString: _NS("Fit to Screen")] ||
...@@ -643,6 +662,20 @@ ...@@ -643,6 +662,20 @@
vlc_object_release( (vlc_object_t *)p_vout ); 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 ) if( p_playlist != NULL )
{ {
......
...@@ -180,6 +180,19 @@ int PlaylistChanged( vlc_object_t *p_this, const char *psz_variable, ...@@ -180,6 +180,19 @@ int PlaylistChanged( vlc_object_t *p_this, const char *psz_variable,
return VLC_SUCCESS; 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 static struct
{ {
unichar i_nskey; unichar i_nskey;
...@@ -365,6 +378,11 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -365,6 +378,11 @@ static VLCMain *_o_sharedMainInstance = nil;
{ {
playlist_Play( p_playlist ); 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 )]; [o_btn_fullscreen setState: ( var_Get( p_playlist, "fullscreen", &val )>=0 && val.b_bool )];
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
} }
...@@ -700,6 +718,7 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -700,6 +718,7 @@ static VLCMain *_o_sharedMainInstance = nil;
{ {
NSDate * o_sleep_date; NSDate * o_sleep_date;
playlist_t * p_playlist; playlist_t * p_playlist;
vlc_value_t val;
/* new thread requires a new pool */ /* new thread requires a new pool */
NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init]; NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init];
...@@ -714,6 +733,7 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -714,6 +733,7 @@ static VLCMain *_o_sharedMainInstance = nil;
var_AddCallback( p_playlist, "intf-change", PlaylistChanged, self ); var_AddCallback( p_playlist, "intf-change", PlaylistChanged, self );
var_AddCallback( p_playlist, "item-change", PlaylistChanged, self ); var_AddCallback( p_playlist, "item-change", PlaylistChanged, self );
var_AddCallback( p_playlist, "playlist-current", PlaylistChanged, self ); var_AddCallback( p_playlist, "playlist-current", PlaylistChanged, self );
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
} }
...@@ -816,14 +836,12 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -816,14 +836,12 @@ static VLCMain *_o_sharedMainInstance = nil;
if ( p_intf->p_sys->b_playlist_update ) if ( p_intf->p_sys->b_playlist_update )
{ {
[o_playlist playlistUpdated]; [o_playlist playlistUpdated];
p_intf->p_sys->b_playlist_update = VLC_FALSE; p_intf->p_sys->b_playlist_update = VLC_FALSE;
} }
if( p_intf->p_sys->b_fullscreen_update ) 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, playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE ); FIND_ANYWHERE );
...@@ -831,16 +849,6 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -831,16 +849,6 @@ static VLCMain *_o_sharedMainInstance = nil;
vlc_object_release( p_playlist ); 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; 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