Most of them where already NULL, saying how meaningless it was.
@protocol VLCMediaPlayerDelegate
/**
* Sent by the default notification center whenever the player's time has changed.
- * \details Discussion The value of aNotification is always an VLCMediaPlayerTimeChanged notification. You can retrieve
+ * \details Discussion The value of aNotification is always an VLCMediaPlayerTimeChanged notification. You can retrieve
* the VLCMediaPlayer object in question by sending object to aNotification.
*/
- (void)mediaPlayerTimeChanged:(NSNotification *)aNotification;
/**
* Sent by the default notification center whenever the player's state has changed.
- * \details Discussion The value of aNotification is always an VLCMediaPlayerStateChanged notification. You can retrieve
+ * \details Discussion The value of aNotification is always an VLCMediaPlayerStateChanged notification. You can retrieve
* the VLCMediaPlayer object in question by sending object to aNotification.
*/
- (void)mediaPlayerStateChanged:(NSNotification *)aNotification;
@end
// TODO: Should we use medialist_player or our own flavor of media player?
-@interface VLCMediaPlayer : NSObject
+@interface VLCMediaPlayer : NSObject
{
id delegate; //< Object delegate
void * instance; // Internal
- (void)setVideoCropGeometry:(char *)value;
- (char *)videoCropGeometry;
-- (void)setVideoTeleText:(NSUInteger)value;
-- (NSUInteger)videoTeleText;
-
/**
* Take a snapshot of the current video.
*
*/
- (void)setTime:(VLCTime *)value;
-/**
+/**
* Returns the current position (or time) of the feed.
* \return VLCTIme object with current time.
*/
/* Playback Operations */
/**
- * Plays a media resource using the currently selected media controller (or
- * default controller. If feed was paused then the feed resumes at the position
+ * Plays a media resource using the currently selected media controller (or
+ * default controller. If feed was paused then the feed resumes at the position
* it was paused in.
* \return A Boolean determining whether the stream was played or not.
*/
- (VLCMediaPlayerState)state;
/**
- * Returns the receiver's position in the reading.
+ * Returns the receiver's position in the reading.
* \return A number between 0 and 1. indicating the position
*/
- (float)position;
* We also may receive a -retain in some event callback that may occcur
* Before libvlc_event_detach. So this can't happen in dealloc */
libvlc_event_manager_t * p_em = libvlc_media_event_manager(p_md);
- libvlc_event_detach(p_em, libvlc_MediaMetaChanged, HandleMediaMetaChanged, self, NULL);
- libvlc_event_detach(p_em, libvlc_MediaDurationChanged, HandleMediaDurationChanged, self, NULL);
- libvlc_event_detach(p_em, libvlc_MediaStateChanged, HandleMediaStateChanged, self, NULL);
- libvlc_event_detach(p_em, libvlc_MediaSubItemAdded, HandleMediaSubItemAdded, self, NULL);
+ libvlc_event_detach(p_em, libvlc_MediaMetaChanged, HandleMediaMetaChanged, self);
+ libvlc_event_detach(p_em, libvlc_MediaDurationChanged, HandleMediaDurationChanged, self);
+ libvlc_event_detach(p_em, libvlc_MediaStateChanged, HandleMediaStateChanged, self);
+ libvlc_event_detach(p_em, libvlc_MediaSubItemAdded, HandleMediaSubItemAdded, self);
}
[super release];
}
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
id self = user_data;
- [[VLCEventManager sharedManager] callOnMainThreadObject:self
- withMethod:@selector(mediaDiscovererStarted)
+ [[VLCEventManager sharedManager] callOnMainThreadObject:self
+ withMethod:@selector(mediaDiscovererStarted)
withArgumentAsObject:nil];
[pool release];
}
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
id self = user_data;
- [[VLCEventManager sharedManager] callOnMainThreadObject:self
- withMethod:@selector(mediaDiscovererEnded)
+ [[VLCEventManager sharedManager] callOnMainThreadObject:self
+ withMethod:@selector(mediaDiscovererEnded)
withArgumentAsObject:nil];
[pool release];
}
-
+
@implementation VLCMediaDiscoverer
+ (NSArray *)availableMediaDiscoverer
{
if (self = [super init])
{
libvlc_exception_t ex;
- libvlc_exception_init( &ex );
+ libvlc_exception_init(&ex);
localizedName = nil;
discoveredMedia = nil;
- mdis = libvlc_media_discoverer_new_from_name( [VLCLibrary sharedInstance],
- [aServiceName UTF8String],
- &ex );
- catch_exception( &ex );
+ mdis = libvlc_media_discoverer_new_from_name([VLCLibrary sharedInstance],
+ [aServiceName UTF8String],
+ &ex);
+ catch_exception(&ex);
libvlc_event_manager_t * p_em = libvlc_media_discoverer_event_manager(mdis);
- libvlc_event_attach(p_em, libvlc_MediaDiscovererStarted, HandleMediaDiscovererStarted, self, NULL);
- libvlc_event_attach(p_em, libvlc_MediaDiscovererEnded, HandleMediaDiscovererEnded, self, NULL);
+ libvlc_event_attach(p_em, libvlc_MediaDiscovererStarted, HandleMediaDiscovererStarted, self, &ex);
+ libvlc_event_attach(p_em, libvlc_MediaDiscovererEnded, HandleMediaDiscovererEnded, self, &ex);
+ catch_exception( &ex );
+
running = libvlc_media_discoverer_is_running(mdis);
}
return self;
/* We must make sure we won't receive new event after an upcoming dealloc
* We also may receive a -retain in some event callback that may occcur
* Before libvlc_event_detach. So this can't happen in dealloc */
- libvlc_event_manager_t * p_em = libvlc_media_list_event_manager(mdis, NULL);
- libvlc_event_detach(p_em, libvlc_MediaDiscovererStarted, HandleMediaDiscovererStarted, self, NULL);
- libvlc_event_detach(p_em, libvlc_MediaDiscovererEnded, HandleMediaDiscovererEnded, self, NULL);
+ libvlc_event_manager_t * p_em = libvlc_media_list_event_manager(mdis);
+ libvlc_event_detach(p_em, libvlc_MediaDiscovererStarted, HandleMediaDiscovererStarted, self);
+ libvlc_event_detach(p_em, libvlc_MediaDiscovererEnded, HandleMediaDiscovererEnded, self);
}
[super release];
}
{
if ( localizedName )
return localizedName;
-
+
char * name = libvlc_media_discoverer_localized_name( mdis );
if (name)
{
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
id self = user_data;
- [[VLCEventManager sharedManager] callOnMainThreadObject:self
- withMethod:@selector(mediaListItemAdded:)
+ [[VLCEventManager sharedManager] callOnMainThreadObject:self
+ withMethod:@selector(mediaListItemAdded:)
withArgumentAsObject:[NSArray arrayWithObject:[NSDictionary dictionaryWithObjectsAndKeys:
[VLCMedia mediaWithLibVLCMediaDescriptor:event->u.media_list_item_added.item], @"media",
[NSNumber numberWithInt:event->u.media_list_item_added.index], @"index",
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
id self = user_data;
- [[VLCEventManager sharedManager] callOnMainThreadObject:self
- withMethod:@selector(mediaListItemRemoved:)
+ [[VLCEventManager sharedManager] callOnMainThreadObject:self
+ withMethod:@selector(mediaListItemRemoved:)
withArgumentAsObject:[NSNumber numberWithInt:event->u.media_list_item_deleted.index]];
[pool release];
}
libvlc_exception_init( &p_e );
p_mlist = libvlc_media_list_new( [VLCLibrary sharedInstance], &p_e );
catch_exception( &p_e );
-
+
// Initialize internals to defaults
cachedMedia = [[NSMutableArray alloc] init];
delegate = flatAspect = hierarchicalAspect = hierarchicalNodeAspect = nil;
/* We must make sure we won't receive new event after an upcoming dealloc
* We also may receive a -retain in some event callback that may occcur
* Before libvlc_event_detach. So this can't happen in dealloc */
- libvlc_event_manager_t * p_em = libvlc_media_list_event_manager(p_mlist, NULL);
- libvlc_event_detach(p_em, libvlc_MediaListItemDeleted, HandleMediaListItemDeleted, self, NULL);
- libvlc_event_detach(p_em, libvlc_MediaListItemAdded, HandleMediaListItemAdded, self, NULL);
+ libvlc_event_manager_t * p_em = libvlc_media_list_event_manager(p_mlist);
+ libvlc_event_detach(p_em, libvlc_MediaListItemDeleted, HandleMediaListItemDeleted, self);
+ libvlc_event_detach(p_em, libvlc_MediaListItemAdded, HandleMediaListItemAdded, self);
}
[super release];
}
{
// Release allocated memory
delegate = nil;
-
+
libvlc_media_list_release( p_mlist );
[cachedMedia release];
[flatAspect release];
- (NSInteger)indexOfMedia:(VLCMedia *)media
{
- libvlc_exception_t p_e;
- libvlc_exception_init( &p_e );
- NSInteger result = libvlc_media_list_index_of_item( p_mlist, [media libVLCMediaDescriptor], &p_e );
- catch_exception( &p_e );
-
+ NSInteger result = libvlc_media_list_index_of_item(p_mlist, [media libVLCMediaDescriptor]);
return result;
}
libvlc_exception_init( &p_e );
BOOL isReadOnly = libvlc_media_list_is_readonly( p_mlist );
catch_exception( &p_e );
-
+
return isReadOnly;
}
{
if( hierarchicalAspect )
return hierarchicalAspect;
-
+
libvlc_media_list_view_t * p_mlv = libvlc_media_list_hierarchical_view( p_mlist, NULL );
hierarchicalAspect = [[VLCMediaListAspect mediaListAspectWithLibVLCMediaListView:p_mlv andMediaList:self] retain];
libvlc_media_list_view_release( p_mlv );
{
if( hierarchicalNodeAspect )
return hierarchicalNodeAspect;
-
+
libvlc_media_list_view_t * p_mlv = libvlc_media_list_hierarchical_node_view( p_mlist, NULL );
hierarchicalNodeAspect = [[VLCMediaListAspect mediaListAspectWithLibVLCMediaListView:p_mlv andMediaList:self] retain];
libvlc_media_list_view_release( p_mlv );
{
if( flatAspect )
return flatAspect;
-
+
libvlc_media_list_view_t * p_mlv = libvlc_media_list_flat_view( p_mlist, NULL );
flatAspect = [[VLCMediaListAspect mediaListAspectWithLibVLCMediaListView:p_mlv andMediaList:self] retain];
libvlc_media_list_view_release( p_mlv );
p_mlist = p_new_mlist;
libvlc_media_list_retain( p_mlist );
libvlc_media_list_lock( p_mlist );
- cachedMedia = [[NSMutableArray alloc] initWithCapacity:libvlc_media_list_count( p_mlist, NULL )];
+ cachedMedia = [[NSMutableArray alloc] initWithCapacity:libvlc_media_list_count(p_mlist)];
- NSUInteger i, count = libvlc_media_list_count( p_mlist, NULL );
+ NSUInteger i, count = libvlc_media_list_count(p_mlist);
for( i = 0; i < count; i++ )
{
libvlc_media_t * p_md = libvlc_media_list_item_at_index( p_mlist, i, NULL );
libvlc_exception_t p_e;
libvlc_exception_init( &p_e );
- libvlc_event_manager_t * p_em = libvlc_media_list_event_manager( p_mlist, &p_e );
+ libvlc_event_manager_t * p_em = libvlc_media_list_event_manager(p_mlist);
libvlc_event_attach( p_em, libvlc_MediaListItemAdded, HandleMediaListItemAdded, self, &p_e );
libvlc_event_attach( p_em, libvlc_MediaListItemDeleted, HandleMediaListItemDeleted, self, &p_e );
-
+
catch_exception( &p_e );
}
[self didChange:NSKeyValueChangeInsertion valuesAtIndexes:[NSIndexSet indexSetWithIndex:[index intValue]] forKey:@"media"];
// Post the notification
- [[NSNotificationCenter defaultCenter] postNotificationName:VLCMediaListItemDeleted
+ [[NSNotificationCenter defaultCenter] postNotificationName:VLCMediaListItemDeleted
object:self
userInfo:[NSDictionary dictionaryWithObjectsAndKeys:
index, @"index",
if(self = [super init])
{
media = nil;
- children = nil;
+ children = nil;
}
return self;
}
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
id self = user_data;
- [[VLCEventManager sharedManager] callOnMainThreadObject:self
- withMethod:@selector(mediaListViewItemAdded:)
+ [[VLCEventManager sharedManager] callOnMainThreadObject:self
+ withMethod:@selector(mediaListViewItemAdded:)
withArgumentAsObject:[NSArray arrayWithObject:[NSDictionary dictionaryWithObjectsAndKeys:
[VLCMedia mediaWithLibVLCMediaDescriptor:event->u.media_list_item_added.item], @"media",
[NSNumber numberWithInt:event->u.media_list_item_added.index], @"index",
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
id self = user_data;
- [[VLCEventManager sharedManager] callOnMainThreadObject:self
- withMethod:@selector(mediaListViewItemRemoved:)
+ [[VLCEventManager sharedManager] callOnMainThreadObject:self
+ withMethod:@selector(mediaListViewItemRemoved:)
withArgumentAsObject:[NSNumber numberWithInt:event->u.media_list_item_deleted.index]];
[pool release];
}
* We also may receive a -retain in some event callback that may occcur
* Before libvlc_event_detach. So this can't happen in dealloc */
libvlc_event_manager_t * p_em = libvlc_media_list_view_event_manager(p_mlv);
- libvlc_event_detach(p_em, libvlc_MediaListViewItemDeleted, HandleMediaListViewItemDeleted, self, NULL);
- libvlc_event_detach(p_em, libvlc_MediaListViewItemAdded, HandleMediaListViewItemAdded, self, NULL);
+ libvlc_event_detach(p_em, libvlc_MediaListViewItemDeleted, HandleMediaListViewItemDeleted, self);
+ libvlc_event_detach(p_em, libvlc_MediaListViewItemAdded, HandleMediaListViewItemAdded, self);
}
[super release];
}
libvlc_exception_init( &p_e );
libvlc_media_t * p_md = libvlc_media_list_view_item_at_index( p_mlv, index, &p_e );
catch_exception( &p_e );
-
- // Returns local object for media descriptor, searchs for user data first. If not found it creates a
+
+ // Returns local object for media descriptor, searchs for user data first. If not found it creates a
// new cocoa object representation of the media descriptor.
return [VLCMedia mediaWithLibVLCMediaDescriptor:p_md];
}
if( !p_sub_mlv )
return nil;
- // Returns local object for media descriptor, searchs for user data first. If not found it creates a
+ // Returns local object for media descriptor, searchs for user data first. If not found it creates a
// new cocoa object representation of the media descriptor.
return [VLCMediaListAspect mediaListAspectWithLibVLCMediaListView:p_sub_mlv];
}
- (void)initInternalMediaListView
{
libvlc_exception_t e;
- libvlc_exception_init( &e );
+ libvlc_exception_init(&e);
- libvlc_event_manager_t * p_em = libvlc_media_list_event_manager( p_mlv, &e );
+ libvlc_event_manager_t * p_em = libvlc_media_list_event_manager(p_mlv);
/* Add internal callback */
- libvlc_event_attach( p_em, libvlc_MediaListViewItemAdded, HandleMediaListViewItemAdded, self, &e );
- libvlc_event_attach( p_em, libvlc_MediaListViewItemDeleted, HandleMediaListViewItemDeleted, self, &e );
- catch_exception( &e );
+ libvlc_event_attach(p_em, libvlc_MediaListViewItemAdded, HandleMediaListViewItemAdded, self, &e);
+ libvlc_event_attach(p_em, libvlc_MediaListViewItemDeleted, HandleMediaListViewItemDeleted, self, &e);
+ catch_exception(&e);
}
- (void)mediaListViewItemAdded:(NSArray *)arrayOfArgs
libvlc_exception_init(&ex);
instance = libvlc_media_list_player_new([VLCLibrary sharedInstance], &ex);
catch_exception(&ex);
- libvlc_media_list_player_set_media_player(instance, [_mediaPlayer libVLCMediaPlayer], &ex);
- catch_exception(&ex);
+ libvlc_media_list_player_set_media_player(instance, [_mediaPlayer libVLCMediaPlayer]);
}
return self;
}
return;
[_mediaList release];
_mediaList = [mediaList retain];
-
- libvlc_exception_t ex;
- libvlc_exception_init(&ex);
- libvlc_media_list_player_set_media_list(instance, [mediaList libVLCMediaList], &ex);
- catch_exception(&ex);
+
+ libvlc_media_list_player_set_media_list(instance, [mediaList libVLCMediaList]);
[self willChangeValueForKey:@"rootMedia"];
[_rootMedia release];
_rootMedia = nil;
- (void)stop
{
- libvlc_exception_t ex;
- libvlc_exception_init(&ex);
- libvlc_media_list_player_stop(instance, &ex);
- catch_exception(&ex);
+ libvlc_media_list_player_stop(instance);
}
- (void)setRepeatMode:(VLCRepeatMode)repeatMode
{
- libvlc_exception_t ex;
- libvlc_exception_init(&ex);
+ libvlc_playback_mode_t mode;
switch (repeatMode) {
case VLCRepeatAllItems:
- libvlc_media_list_player_set_playback_mode(instance, libvlc_playback_mode_default, &ex);
+ mode = libvlc_playback_mode_loop;
break;
case VLCDoNotRepeat:
- libvlc_media_list_player_set_playback_mode(instance, libvlc_playback_mode_default, &ex);
+ mode = libvlc_playback_mode_default;
break;
case VLCRepeatCurrentItem:
- libvlc_media_list_player_set_playback_mode(instance, libvlc_playback_mode_repeat, &ex);
+ mode = libvlc_playback_mode_repeat;
break;
default:
+ NSAssert(0, @"Should not be reached");
break;
}
- catch_exception(&ex);
+ libvlc_media_list_player_set_playback_mode(instance, mode);
+
_repeatMode = repeatMode;
}
- (void)dealloc
{
- NSAssert(libvlc_media_player_get_state(instance, NULL) == libvlc_Stopped, @"You released the media player before ensuring that it is stopped");
+ NSAssert(libvlc_media_player_get_state(instance) == libvlc_Stopped, @"You released the media player before ensuring that it is stopped");
// Always get rid of the delegate first so we can stop sending messages to it
// TODO: Should we tell the delegate that we're shutting down?
// Clear our drawable as we are going to release it, we don't
// want the core to use it from this point. This won't happen as
// the media player must be stopped.
- libvlc_media_player_set_nsobject(instance, nil, NULL);
+ libvlc_media_player_set_nsobject(instance, nil);
libvlc_media_player_release(instance);
- (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_player_set_nsobject(instance, aDrawable, &ex);
- catch_exception( &ex );
+ libvlc_media_player_set_nsobject(instance, aDrawable);
}
- (id)drawable
- (NSArray *)videoSubTitles
{
+ libvlc_exception_t ex;
+ libvlc_exception_init( &ex );
libvlc_track_description_t *currentTrack = libvlc_video_get_spu_description( instance, &ex );
+ catch_exception( &ex );
+
NSMutableArray *tempArray = [NSMutableArray array];
while (currentTrack) {
[tempArray addObject:[NSString stringWithUTF8String:currentTrack->psz_name]];
return result;
}
-- (void)setVideoTeleText:(NSUInteger)value
-{
- libvlc_exception_t ex;
- libvlc_exception_init( &ex );
- libvlc_video_set_teletext( instance, value, &ex );
- catch_exception( &ex );
-}
-
-- (NSUInteger)videoTeleText
-{
- libvlc_exception_t ex;
- libvlc_exception_init( &ex );
- NSInteger result = libvlc_video_get_teletext( instance, &ex );
- catch_exception( &ex );
- return result;
-}
-
- (void)saveVideoSnapshotAt: (NSString *)path withWidth:(NSUInteger)width andHeight:(NSUInteger)height
{
libvlc_exception_t ex;
[media release];
media = [value retain];
- libvlc_exception_t ex;
- libvlc_exception_init( &ex );
- libvlc_media_player_set_media( instance, [media libVLCMediaDescriptor], &ex );
- catch_exception( &ex );
+ libvlc_media_player_set_media(instance, [media libVLCMediaDescriptor]);
}
}
// Pause the stream
libvlc_exception_t ex;
- libvlc_exception_init( &ex );
- libvlc_media_player_pause( (libvlc_media_player_t *)instance, &ex );
+ libvlc_exception_init(&ex);
+ libvlc_media_player_pause(instance, &ex);
// fail gracefully
// in most cases, it's just EOF so let's stop
- (void)stop
{
- libvlc_exception_t ex;
- libvlc_exception_init( &ex );
- libvlc_media_player_stop((libvlc_media_player_t *)instance, &ex);
- catch_exception( &ex );
+ libvlc_media_player_stop(instance);
}
- (void)fastForward
libvlc_exception_init( &ex );
// Attach event observers into the media instance
- libvlc_event_manager_t * p_em = libvlc_media_player_event_manager( instance, &ex );
- libvlc_event_attach( p_em, libvlc_MediaPlayerPlaying, HandleMediaInstanceStateChanged, self, &ex );
- libvlc_event_attach( p_em, libvlc_MediaPlayerPaused, HandleMediaInstanceStateChanged, self, &ex );
- libvlc_event_attach( p_em, libvlc_MediaPlayerEncounteredError, HandleMediaInstanceStateChanged, self, &ex );
- libvlc_event_attach( p_em, libvlc_MediaPlayerEndReached, HandleMediaInstanceStateChanged, self, &ex );
+ libvlc_event_manager_t * p_em = libvlc_media_player_event_manager(instance);
+ libvlc_event_attach(p_em, libvlc_MediaPlayerPlaying, HandleMediaInstanceStateChanged, self, &ex);
+ libvlc_event_attach(p_em, libvlc_MediaPlayerPaused, HandleMediaInstanceStateChanged, self, &ex);
+ libvlc_event_attach(p_em, libvlc_MediaPlayerEncounteredError, HandleMediaInstanceStateChanged, self, &ex);
+ libvlc_event_attach(p_em, libvlc_MediaPlayerEndReached, HandleMediaInstanceStateChanged, self, &ex);
/* FIXME: We may want to turn that off when none is interested by that */
- libvlc_event_attach( p_em, libvlc_MediaPlayerPositionChanged, HandleMediaPositionChanged, self, &ex );
- libvlc_event_attach( p_em, libvlc_MediaPlayerTimeChanged, HandleMediaTimeChanged, self, &ex );
- libvlc_event_attach( p_em, libvlc_MediaPlayerMediaChanged, HandleMediaPlayerMediaChanged, self, &ex );
- catch_exception( &ex );
+ libvlc_event_attach(p_em, libvlc_MediaPlayerPositionChanged, HandleMediaPositionChanged, self, &ex);
+ libvlc_event_attach(p_em, libvlc_MediaPlayerTimeChanged, HandleMediaTimeChanged, self, &ex);
+ libvlc_event_attach(p_em, libvlc_MediaPlayerMediaChanged, HandleMediaPlayerMediaChanged, self, &ex);
+ catch_exception(&ex);
}
- (void)unregisterObservers
{
- libvlc_event_manager_t * p_em = libvlc_media_player_event_manager( instance, NULL );
- libvlc_event_detach( p_em, libvlc_MediaPlayerPlaying, HandleMediaInstanceStateChanged, self, NULL );
- libvlc_event_detach( p_em, libvlc_MediaPlayerPaused, HandleMediaInstanceStateChanged, self, NULL );
- libvlc_event_detach( p_em, libvlc_MediaPlayerEncounteredError, HandleMediaInstanceStateChanged, self, NULL );
- libvlc_event_detach( p_em, libvlc_MediaPlayerEndReached, HandleMediaInstanceStateChanged, self, NULL );
- libvlc_event_detach( p_em, libvlc_MediaPlayerPositionChanged, HandleMediaPositionChanged, self, NULL );
- libvlc_event_detach( p_em, libvlc_MediaPlayerTimeChanged, HandleMediaTimeChanged, self, NULL );
- libvlc_event_attach( p_em, libvlc_MediaPlayerMediaChanged, HandleMediaPlayerMediaChanged, self, NULL );
+ libvlc_event_manager_t * p_em = libvlc_media_player_event_manager(instance);
+ libvlc_event_detach(p_em, libvlc_MediaPlayerPlaying, HandleMediaInstanceStateChanged, self);
+ libvlc_event_detach(p_em, libvlc_MediaPlayerPaused, HandleMediaInstanceStateChanged, self);
+ libvlc_event_detach(p_em, libvlc_MediaPlayerEncounteredError, HandleMediaInstanceStateChanged, self);
+ libvlc_event_detach(p_em, libvlc_MediaPlayerEndReached, HandleMediaInstanceStateChanged, self);
+ libvlc_event_detach(p_em, libvlc_MediaPlayerPositionChanged, HandleMediaPositionChanged, self);
+ libvlc_event_detach(p_em, libvlc_MediaPlayerTimeChanged, HandleMediaTimeChanged, self);
+ libvlc_event_detach(p_em, libvlc_MediaPlayerMediaChanged, HandleMediaPlayerMediaChanged, self);
}
- (void)mediaPlayerTimeChanged:(NSNumber *)newTime