Commit fb76e3b6 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

MacOSX/Framework/VLCVideoLayer: Implement hasVideo.

parent 0b0a9159
......@@ -25,4 +25,8 @@
#import <QuartzCore/QuartzCore.h>
@interface VLCVideoLayer : CALayer
{
BOOL hasVideo;
}
@property (readonly) BOOL hasVideo;
@end
......@@ -31,11 +31,11 @@
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
......@@ -42,20 +42,25 @@
- (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
......@@ -62,6 +62,10 @@
- (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;
......@@ -105,6 +110,7 @@
@synthesize delegate;
@synthesize backColor;
@synthesize hasVideo;
- (BOOL)fillScreen
{
......@@ -141,10 +147,12 @@
[aLayer setNeedsLayout];
[aLayer setNeedsDisplay];
[rootLayer setNeedsDisplayOnBoundsChange:YES];
[rootLayer setNeedsDisplay];
[rootLayer layoutIfNeeded];
[CATransaction commit];
self.hasVideo = YES;
}
- (void)removeVoutLayer:(CALayer*)voutLayer
......@@ -152,6 +160,7 @@
[CATransaction begin];
[voutLayer removeFromSuperlayer];
[CATransaction commit];
self.hasVideo = NO;
}
@end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment