[vlc-commits] macosx: fixed fspanel

Felix Paul Kühne git at videolan.org
Wed Aug 10 01:11:53 CEST 2011


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Wed Aug 10 01:11:44 2011 +0200| [a1e22090eb6dd3c52995bb56101695bdd9df0f60] | committer: Felix Paul Kühne

macosx: fixed fspanel

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a1e22090eb6dd3c52995bb56101695bdd9df0f60
---

 .../English.lproj/MainMenu.nib/designable.nib      |   18 +++++++-----
 modules/gui/macosx/MainWindow.h                    |    3 +-
 modules/gui/macosx/MainWindow.m                    |   18 +++++--------
 modules/gui/macosx/fspanel.m                       |   28 +++++++------------
 modules/gui/macosx/intf.h                          |    1 +
 modules/gui/macosx/intf.m                          |    7 +++++
 modules/gui/macosx/vout.m                          |    4 +--
 7 files changed, 37 insertions(+), 42 deletions(-)

diff --git a/extras/package/macosx/Resources/English.lproj/MainMenu.nib/designable.nib b/extras/package/macosx/Resources/English.lproj/MainMenu.nib/designable.nib
index 347e617..954cce4 100644
--- a/extras/package/macosx/Resources/English.lproj/MainMenu.nib/designable.nib
+++ b/extras/package/macosx/Resources/English.lproj/MainMenu.nib/designable.nib
@@ -2,10 +2,10 @@
 <archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
   <data>
     <int key="IBDocument.SystemTarget">1040</int>
-    <string key="IBDocument.SystemVersion">11A511</string>
+    <string key="IBDocument.SystemVersion">11C35</string>
     <string key="IBDocument.InterfaceBuilderVersion">851</string>
-    <string key="IBDocument.AppKitVersion">1138</string>
-    <string key="IBDocument.HIToolboxVersion">566.00</string>
+    <string key="IBDocument.AppKitVersion">1138.15</string>
+    <string key="IBDocument.HIToolboxVersion">567.00</string>
     <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
       <bool key="EncodedWithXMLCoder">YES</bool>
       <object class="NSArray" key="dict.sortedKeys">
@@ -21,14 +21,14 @@
     </object>
     <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
       <bool key="EncodedWithXMLCoder">YES</bool>
-      <integer value="4596"/>
-      <integer value="915"/>
-      <integer value="1617"/>
       <integer value="2730"/>
-      <integer value="4722"/>
-      <integer value="283"/>
+      <integer value="915"/>
       <integer value="2"/>
+      <integer value="283"/>
+      <integer value="1617"/>
       <integer value="334"/>
+      <integer value="4722"/>
+      <integer value="4596"/>
     </object>
     <object class="NSArray" key="IBDocument.PluginDependencies">
       <bool key="EncodedWithXMLCoder">YES</bool>
@@ -10235,6 +10235,7 @@ LCAuLi4</string>
           <string>2769.IBPluginDependency</string>
           <string>2769.IBWindowTemplateEditedContentRect</string>
           <string>2769.ImportedFromIB2</string>
+          <string>2769.NSWindowTemplate.visibleAtLaunch</string>
           <string>2770.IBPluginDependency</string>
           <string>2770.ImportedFromIB2</string>
           <string>2789.IBPluginDependency</string>
@@ -10981,6 +10982,7 @@ LCAuLi4</string>
           <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
           <string>{{340, 658}, {549, 87}}</string>
           <boolean value="YES"/>
+          <boolean value="NO"/>
           <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
           <boolean value="YES"/>
           <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
diff --git a/modules/gui/macosx/MainWindow.h b/modules/gui/macosx/MainWindow.h
index c817683..b6653e5 100644
--- a/modules/gui/macosx/MainWindow.h
+++ b/modules/gui/macosx/MainWindow.h
@@ -147,6 +147,7 @@
 - (void)setNativeVideoSize:(NSSize)size;
 
 /* fullscreen handling */
+- (void)showFullscreenController;
 - (BOOL)isFullscreen;
 - (void)lockFullscreenAnimation;
 - (void)unlockFullscreenAnimation;
@@ -157,8 +158,6 @@
 - (void)hasBecomeFullscreen;
 - (void)setFrameOnMainThread:(NSData*)packedargs;
 
-- (id)fspanel;
-
 @end
 
 @interface VLCProgressBarGradientEffect : NSView {
diff --git a/modules/gui/macosx/MainWindow.m b/modules/gui/macosx/MainWindow.m
index cd38998..3a59d4d 100644
--- a/modules/gui/macosx/MainWindow.m
+++ b/modules/gui/macosx/MainWindow.m
@@ -218,10 +218,6 @@ static VLCMainWindow *_o_sharedInstance = nil;
     o_temp_view = [[NSView alloc] init];
     [o_temp_view setAutoresizingMask:NSViewHeightSizable | NSViewWidthSizable];
 
-    /* reset the interface */
-    [self updateVolumeSlider];
-    [self updateTimeSlider];
-
     /* create the sidebar */
     o_sidebaritems = [[NSMutableArray alloc] init];
     SideBarItem *libraryItem = [SideBarItem itemWithTitle:_NS("LIBRARY") identifier:@"library"];
@@ -646,8 +642,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
         int i_volume_step = 0;
         i_volume_step = config_GetInt( VLCIntf->p_libvlc, "volume-step" );
         [o_volume_sld setFloatValue: (float)i_lastShownVolume / i_volume_step];
-//        if ([o_fspanel respondsToSelector:@selector(setVolumeLevel:)])
-//            [o_fspanel setVolumeLevel: (float)i_lastShownVolume / i_volume_step];
+        [o_fspanel setVolumeLevel: (float)i_lastShownVolume / i_volume_step];
     }
 }
 
@@ -855,6 +850,12 @@ static VLCMainWindow *_o_sharedInstance = nil;
 
 #pragma mark -
 #pragma mark Fullscreen support
+- (void)showFullscreenController
+{
+    if (b_fullscreen)
+        [o_fspanel fadeIn];
+}
+
 - (BOOL)isFullscreen
 {
     return b_fullscreen;
@@ -1304,11 +1305,6 @@ static VLCMainWindow *_o_sharedInstance = nil;
     }
 }
 
-- (id)fspanel
-{
-    return o_fspanel;
-}
-
 #pragma mark -
 #pragma mark Side Bar Data handling
 /* taken under BSD-new from the PXSourceList sample project, adapted for VLC */
diff --git a/modules/gui/macosx/fspanel.m b/modules/gui/macosx/fspanel.m
index b16df3c..7802af9 100644
--- a/modules/gui/macosx/fspanel.m
+++ b/modules/gui/macosx/fspanel.m
@@ -178,16 +178,8 @@
 
 - (void)setActive:(id)noData
 {
-    vout_thread_t *p_vout = getVout();
-    if (p_vout)
-    {
-        if (var_GetBool( p_vout, "fullscreen" ))
-        {
-            b_nonActive = NO;
-            [self fadeIn];
-        }
-        vlc_object_release( p_vout );
-    }
+    b_nonActive = NO;
+    [[VLCMain sharedInstance] showFullscreenController];
 }
 
 /* This routine is called repeatedly to fade in the window */
@@ -429,7 +421,7 @@
     addButton( o_play, @"fs_play"          , @"fs_play_highlight"         , 267, 10, play );
     addButton( o_fwd, @"fs_forward"       , @"fs_forward_highlight"      , 313, 14, forward );
     addButton( o_next, @"fs_skip_next"     , @"fs_skip_next_highlight"    , 365, 15, next );
-    addButton( o_fullscreen, @"fs_exit_fullscreen", @"fs_exit_fullscreen_hightlight", 507, 13, windowAction );
+    addButton( o_fullscreen, @"fs_exit_fullscreen", @"fs_exit_fullscreen_hightlight", 507, 13, toggleFullscreen );
 /*
     addButton( o_button, @"image (off state)", @"image (on state)", 38, 51, something );
  */
@@ -531,32 +523,32 @@
 
 - (IBAction)play:(id)sender
 {
-    [[[VLCMain sharedInstance] controls] play: sender];
+    [[VLCCoreInteraction sharedInstance] play];
 }
 
 - (IBAction)forward:(id)sender
 {
-    [[[VLCMain sharedInstance] controls] forward: sender];
+    [[VLCCoreInteraction sharedInstance] forward];
 }
 
 - (IBAction)backward:(id)sender
 {
-    [[[VLCMain sharedInstance] controls] backward: sender];
+    [[VLCCoreInteraction sharedInstance] backward];
 }
 
 - (IBAction)prev:(id)sender
 {
-    [[[VLCMain sharedInstance] controls] prev: sender];
+    [[VLCCoreInteraction sharedInstance] previous];
 }
 
 - (IBAction)next:(id)sender
 {
-    [[[VLCMain sharedInstance] controls] next: sender];
+    [[VLCCoreInteraction sharedInstance] next];
 }
 
-- (IBAction)windowAction:(id)sender
+- (IBAction)toggleFullscreen:(id)sender
 {
-    [[[VLCMain sharedInstance] controls] windowAction: sender];
+    [[VLCCoreInteraction sharedInstance] toggleFullscreen];
 }
 
 - (IBAction)fsTimeSliderUpdate:(id)sender
diff --git a/modules/gui/macosx/intf.h b/modules/gui/macosx/intf.h
index f7187cf..917dc6d 100644
--- a/modules/gui/macosx/intf.h
+++ b/modules/gui/macosx/intf.h
@@ -183,6 +183,7 @@ struct intf_sys_t
 - (void)playlistUpdated;
 - (void)updateInfoandMetaPanel;
 - (void)updateMainWindow;
+- (void)showFullscreenController;
 - (void)updateDelays;
 - (void)initStrings;
 - (BOOL)application:(NSApplication *)o_app openFile:(NSString *)o_filename;
diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index 4fa787d..7e643dc 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -609,6 +609,8 @@ static VLCMain *_o_sharedMainInstance = nil;
 
     [self _removeOldPreferences];
 
+    [o_mainwindow updateTimeSlider];
+    [o_mainwindow updateVolumeSlider];
     [o_mainwindow makeKeyAndOrderFront: self];
 
     /* Handle sleep notification */
@@ -1259,6 +1261,11 @@ unsigned int CocoaKeyToVLC( unichar i_key )
     [o_mainwindow updateWindow];
 }
 
+- (void)showFullscreenController
+{
+    [o_mainwindow showFullscreenController];
+}
+
 - (void)updateDelays
 {
     [[VLCTrackSynchronization sharedInstance] performSelectorOnMainThread: @selector(updateValues) withObject: nil waitUntilDone:NO];
diff --git a/modules/gui/macosx/vout.m b/modules/gui/macosx/vout.m
index 42beb51..22b5cbd 100644
--- a/modules/gui/macosx/vout.m
+++ b/modules/gui/macosx/vout.m
@@ -32,7 +32,6 @@
 #import <string.h>
 
 #import "intf.h"
-#import "fspanel.h"
 #import "vout.h"
 #import "CoreInteraction.h"
 #import "MainMenu.h"
@@ -367,9 +366,8 @@ int DeviceCallback( vlc_object_t *p_this, const char *psz_variable,
         {
             var_SetCoords( p_vout, "mouse-moved", ((int)ml.x), ((int)ml.y) );
         }
-//        if( var_GetBool( p_vout, "fullscreen") )
-            [[[VLCMainWindow sharedInstance] fspanel] fadeIn];
         vlc_object_release( p_vout );
+        [[VLCMain sharedInstance] showFullscreenController];
     }
 
     [super mouseMoved: o_event];



More information about the vlc-commits mailing list