]> git.sesse.net Git - vlc/commitdiff
* fixed fullscreen on osx with multiple vouts.
authorDerk-Jan Hartman <hartman@videolan.org>
Tue, 12 Apr 2005 14:41:47 +0000 (14:41 +0000)
committerDerk-Jan Hartman <hartman@videolan.org>
Tue, 12 Apr 2005 14:41:47 +0000 (14:41 +0000)
* 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.

AUTHORS
TODO
modules/gui/macosx/controls.m
modules/gui/macosx/intf.m
modules/gui/macosx/vout.m

diff --git a/AUTHORS b/AUTHORS
index 360b69e6b2f70fe80c6ab2ef40c37c5dc05d2e2e..f829e0bc30c157caa6060a8db6d6822a568a026b 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -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: GaĆ«l Hendryckx
diff --git a/TODO b/TODO
index 0a3a98acc7a14f041a39ea8997ffa0be9d91fb65..d3f8db7a4cae1b139c1af4692a2f66a60316da3c 100644 (file)
--- a/TODO
+++ b/TODO
@@ -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 />
index b70b5c8a2315a0565861256f5e42817e94dcdde6..8ec38f0edf1b04da2cb716a57b7fe53a02f1e781 100644 (file)
     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]))
                 }
                 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 );
     }
 
 }
     {
         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;
         }
     }
     else if( [[o_mi title] isEqualToString: _NS("Stop")] )
     {
-        if( p_playlist == NULL || p_input == NULL )
+        if( p_input == NULL )
         {
             bEnabled = FALSE;
         }
     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")] )
     {
     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")] ) 
                 [[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;
                                               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"] )
                 {
             }
             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 );
 }
index e2ac383708bcd91c88d826080eabf93a37f5e5cb..b5ab6f14a676a6a90ce89756e866c8524d27b18a 100644 (file)
@@ -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;
index 32ee72ce016dcd5f6d026e0bd1e807672d23a7da..9abf2a9ef694f1f0070e137345845ffba13e7586 100644 (file)
@@ -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