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