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

MacOSX/Framework/VLCMedia.m: Make sure the KVO notification will be sent for the @"state" key.

parent 2cd7ae24
...@@ -71,6 +71,7 @@ NSString * VLCMediaMetaChanged = @"VLCMediaMetaChanged"; ...@@ -71,6 +71,7 @@ NSString * VLCMediaMetaChanged = @"VLCMediaMetaChanged";
/* Callback Methods */ /* Callback Methods */
- (void)metaChanged:(NSString *)metaType; - (void)metaChanged:(NSString *)metaType;
- (void)subItemAdded; - (void)subItemAdded;
- (void)setStateAsNumber:(NSNumber *)newStateAsNumber;
@end @end
static VLCMediaState libvlc_state_to_media_state[] = static VLCMediaState libvlc_state_to_media_state[] =
...@@ -124,7 +125,7 @@ static void HandleMediaStateChanged(const libvlc_event_t * event, void * self) ...@@ -124,7 +125,7 @@ static void HandleMediaStateChanged(const libvlc_event_t * event, void * self)
{ {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
[[VLCEventManager sharedManager] callOnMainThreadObject:self [[VLCEventManager sharedManager] callOnMainThreadObject:self
withMethod:@selector(setState:) withMethod:@selector(setStateAsNumber:)
withArgumentAsObject:[NSNumber numberWithInt: withArgumentAsObject:[NSNumber numberWithInt:
LibVLCStateToMediaState(event->u.media_descriptor_state_changed.new_state)]]; LibVLCStateToMediaState(event->u.media_descriptor_state_changed.new_state)]];
[pool release]; [pool release];
...@@ -309,6 +310,7 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self) ...@@ -309,6 +310,7 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
@synthesize subitems; @synthesize subitems;
@synthesize metaDictionary; @synthesize metaDictionary;
@synthesize state; @synthesize state;
@end @end
/****************************************************************************** /******************************************************************************
...@@ -519,8 +521,14 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self) ...@@ -519,8 +521,14 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
length = value ? [value retain] : nil; length = value ? [value retain] : nil;
} }
- (void)setState:(NSNumber *)newStateAsNumber - (void)setStateAsNumber:(NSNumber *)newStateAsNumber
{ {
state = [newStateAsNumber intValue]; [self setState: [newStateAsNumber intValue]];
} }
- (void)setState:(VLCMediaState)newState
{
state = newState;
}
@end @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