]> git.sesse.net Git - vlc/commitdiff
MacOSX/Framework/VLCVideoLayer: Implement hasVideo.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Wed, 16 Jan 2008 00:24:54 +0000 (00:24 +0000)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Wed, 16 Jan 2008 00:24:54 +0000 (00:24 +0000)
extras/MacOSX/Framework/Headers/Public/VLCVideoLayer.h
extras/MacOSX/Framework/Headers/Public/VLCVideoView.h
extras/MacOSX/Framework/Sources/VLCVideoLayer.m
extras/MacOSX/Framework/Sources/VLCVideoView.m

index 01f2436441e459a2a6b7fb5d044f67a24332ddd3..86dd63867e26f915ee90f2d9b664053fbf7a5666 100644 (file)
@@ -25,4 +25,8 @@
 #import <QuartzCore/QuartzCore.h>
 
 @interface VLCVideoLayer : CALayer
+{
+    BOOL hasVideo;
+}
+@property (readonly) BOOL hasVideo;
 @end
index 8006ea266b96d8370cfb53d72ac5981f2c96d920..38796f5858abe11bdd613a56416cc57d28916836 100644 (file)
     NSColor * backColor;
     BOOL stretchesVideo;
     id layoutManager;
-    // TODO: Allow for view to report transparency to do some cool effects
-    // with the video?
+    BOOL hasVideo;
 }
 
 @property (assign) id delegate;
 @property (copy) NSColor *backColor;
 @property BOOL fillScreen;
+@property (readonly) BOOL hasVideo;
 @end
index 6b058de55422be0a8155a7de14465f0a7923b4e1..965895f93a3cd06f1e307005797ce74d9ecdc0af 100644 (file)
 - (void)addVoutLayer:(CALayer *)aLayer;
 @end
 
+@interface VLCVideoLayer ()
+@property (readwrite) BOOL hasVideo;
+@end
+
 /******************************************************************************
  * Implementation VLCVideoLayer 
  */
 
 @implementation VLCVideoLayer
+@synthesize hasVideo;
 
 @end
-
 /******************************************************************************
  * Implementation VLCVideoLayer  (Private)
  */
 
 @implementation VLCVideoLayer (Private)
 
+
 /* This is called by the libvlc module 'opengllayer' as soon as there is one 
  * vout available
  */
@@ -73,6 +78,7 @@
     [self setNeedsDisplayOnBoundsChange:YES];
 
     [CATransaction commit];
+    self.hasVideo = YES;
 }
 
 - (void)removeVoutLayer:(CALayer*)voutLayer
@@ -80,6 +86,7 @@
     [CATransaction begin];
     [voutLayer removeFromSuperlayer];
     [CATransaction commit];
+    self.hasVideo = NO;
 }
 
-@end
\ No newline at end of file
+@end
index 0cb20f40078405d0e746fbda76963ad786d1ee19..489690b66f1213edbaeea73779dd349b6149977a 100644 (file)
 - (void)addVoutLayer:(CALayer *)aLayer;
 @end
 
+@interface VLCVideoView ()
+@property (readwrite) BOOL hasVideo;
+@end
+
 /******************************************************************************
  * Implementation VLCVideoView 
  */
@@ -77,6 +81,7 @@
         [self setStretchesVideo:NO];
         [self setAutoresizesSubviews:YES];
         [self setFillScreen: NO];
+        self.hasVideo = NO;
         layoutManager = [[VLCVideoLayoutManager layoutManager] retain];
     }
     return self;
 
 @synthesize delegate;
 @synthesize backColor;
+@synthesize hasVideo;
 
 - (BOOL)fillScreen
 {
 
     [aLayer setNeedsLayout];
     [aLayer setNeedsDisplay];
+
     [rootLayer setNeedsDisplayOnBoundsChange:YES];
     [rootLayer setNeedsDisplay];
     [rootLayer layoutIfNeeded];
     [CATransaction commit];
+    self.hasVideo = YES;
 }
 
 - (void)removeVoutLayer:(CALayer*)voutLayer
     [CATransaction begin];
     [voutLayer removeFromSuperlayer];
     [CATransaction commit];
+    self.hasVideo = NO;
 }
 
 @end