#import <QuartzCore/QuartzCore.h>
@interface VLCVideoLayer : CALayer
+{
+ BOOL hasVideo;
+}
+@property (readonly) BOOL hasVideo;
@end
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
- (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
*/
[self setNeedsDisplayOnBoundsChange:YES];
[CATransaction commit];
+ self.hasVideo = YES;
}
- (void)removeVoutLayer:(CALayer*)voutLayer
[CATransaction begin];
[voutLayer removeFromSuperlayer];
[CATransaction commit];
+ self.hasVideo = NO;
}
-@end
\ No newline at end of file
+@end
- (void)addVoutLayer:(CALayer *)aLayer;
@end
+@interface VLCVideoView ()
+@property (readwrite) BOOL hasVideo;
+@end
+
/******************************************************************************
* Implementation VLCVideoView
*/
[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