vlc | branch: master | b00tsy <[email protected]> | Fri Jan 27 14:27:41 2012 
+0100| [794418863abbfd428de7defaf21dd1d0b6f61b7e] | committer: Felix Paul Kühne

OSX: NSDistributedNofitication is sent on playerStateChange

Signed-off-by: Felix Paul Kühne <[email protected]>

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

 modules/gui/macosx/intf.h |    1 +
 modules/gui/macosx/intf.m |   19 ++++++++++++++-----
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/modules/gui/macosx/intf.h b/modules/gui/macosx/intf.h
index f79efbf..9f15c9f 100644
--- a/modules/gui/macosx/intf.h
+++ b/modules/gui/macosx/intf.h
@@ -180,6 +180,7 @@ struct intf_sys_t
 - (void)fullscreenChanged;
 - (void)PlaylistItemChanged;
 - (void)playbackStatusUpdated;
+- (void)sendDistributedNotificationWithUpdatedPlaybackStatus;
 - (void)playbackModeUpdated;
 - (void)updateVolume;
 - (void)updatePlaybackPosition;
diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index d7196a4..0d4b5e2 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -660,8 +660,8 @@ static VLCMain *_o_sharedMainInstance = nil;
 
     [[VLCMain sharedInstance] 
performSelectorOnMainThread:@selector(lookForCrashLog) withObject:nil 
waitUntilDone:NO];
 
-       /* we will need this, so let's load it here so the interface appears to 
be more responsive */
-       nib_open_loaded = [NSBundle loadNibNamed:@"Open" owner: NSApp];
+    /* we will need this, so let's load it here so the interface appears to be 
more responsive */
+    nib_open_loaded = [NSBundle loadNibNamed:@"Open" owner: NSApp];
 }
 
 - (void)initStrings
@@ -850,8 +850,8 @@ static VLCMain *_o_sharedMainInstance = nil;
 - (void)applicationDidBecomeActive:(NSNotification *)aNotification
 {
     if( !p_intf ) return;
-       if( config_GetInt( p_intf, "macosx-appleremote" ) == YES )
-               [o_remote startListening: self];
+    if( config_GetInt( p_intf, "macosx-appleremote" ) == YES )
+        [o_remote startListening: self];
 }
 - (void)applicationDidResignActive:(NSNotification *)aNotification
 {
@@ -1484,6 +1484,15 @@ unsigned int CocoaKeyToVLC( unichar i_key )
     }
 
     [[VLCMain sharedInstance] 
performSelectorOnMainThread:@selector(updateMainWindow) withObject: nil 
waitUntilDone: NO];
+    [self 
performSelectorOnMainThread:@selector(sendDistributedNotificationWithUpdatedPlaybackStatus)
 withObject: nil waitUntilDone: NO];
+}
+
+- (void)sendDistributedNotificationWithUpdatedPlaybackStatus
+{
+    [[NSDistributedNotificationCenter defaultCenter] 
postNotificationName:@"VLCPlayerStateDidChange"
+                                                                   object:nil
+                                                                 userInfo:nil
+                                                       deliverImmediately:YES];
 }
 
 - (void)playbackModeUpdated
@@ -1647,7 +1656,7 @@ unsigned int CocoaKeyToVLC( unichar i_key )
 
 - (id)appleRemoteController
 {
-       return o_remote;
+    return o_remote;
 }
 
 - (void)setActiveVideoPlayback:(BOOL)b_value

_______________________________________________
vlc-commits mailing list
[email protected]
http://mailman.videolan.org/listinfo/vlc-commits

Reply via email to