Commit 90f36ed3 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

MacOSX/Framework: Publish @property id drawable. Make sure the KVO will be sent for isPlaying.

parent 916af6f5
......@@ -93,6 +93,8 @@ extern NSString * VLCMediaPlayerStateToString(VLCMediaPlayerState state);
- (void)setVideoView:(VLCVideoView *)aVideoView;
- (void)setVideoLayer:(VLCVideoLayer *)aVideoLayer;
@property (retain) id drawable; /* The videoView or videoLayer */
- (void)setVideoAspectRatio:(char *)value;
- (char *)videoAspectRatio;
- (void)setVideoSubTitles:(int)value;
......
......@@ -114,7 +114,6 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
// TODO: Documentation
@interface VLCMediaPlayer (Private)
- (id)initWithDrawable:(id)aDrawable;
- (void)setDrawable:(id)aDrawable;
- (void)registerObservers;
- (void)unregisterObservers;
......@@ -214,6 +213,27 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
[self setDrawable: aVideoLayer];
}
- (void)setDrawable:(id)aDrawable
{
// Make sure that this instance has been associated with the drawing canvas.
libvlc_exception_t ex;
libvlc_exception_init( &ex );
libvlc_media_instance_set_drawable ((libvlc_media_instance_t *)instance,
(libvlc_drawable_t)aDrawable,
&ex);
catch_exception( &ex );
}
- (id)drawable
{
libvlc_exception_t ex;
libvlc_exception_init( &ex );
libvlc_drawable_t ret = libvlc_media_instance_get_drawable ((libvlc_media_instance_t *)instance,
&ex);
catch_exception( &ex );
return (id)ret;
}
- (void)setVideoAspectRatio:(char *)value
{
libvlc_video_set_aspect_ratio( instance, value, NULL );
......@@ -508,6 +528,11 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
[self setRate: -rate];
}
+ (NSSet *)keyPathsForValuesAffectingIsPlaying
{
return [NSSet setWithObjects:@"state", nil];
}
- (BOOL)isPlaying
{
VLCMediaPlayerState state = [self state];
......@@ -575,6 +600,8 @@ static const VLCMediaPlayerState libvlc_to_local_state[] =
catch_exception( &ex );
return ret;
}
@end
@implementation VLCMediaPlayer (Private)
......@@ -603,17 +630,6 @@ static const VLCMediaPlayerState libvlc_to_local_state[] =
return self;
}
- (void)setDrawable:(id)aDrawable
{
// Make sure that this instance has been associated with the drawing canvas.
libvlc_exception_t ex;
libvlc_exception_init( &ex );
libvlc_media_instance_set_drawable ((libvlc_media_instance_t *)instance,
(libvlc_drawable_t)aDrawable,
&ex);
catch_exception( &ex );
}
- (void)registerObservers
{
libvlc_exception_t ex;
......
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