Commit 313a8743 authored by Tanguy Krotoff's avatar Tanguy Krotoff Committed by Pierre d'Herbemont

libvlc: rename all libvlc_MediaInstance in libvlc_MediaPlayer and...

libvlc: rename all libvlc_MediaInstance in libvlc_MediaPlayer and libvlc_MediaDescriptor to libvlc_Media
Signed-off-by: default avatarPierre d'Herbemont <pdherbemont@videolan.org>
parent ee1330c4
...@@ -156,8 +156,8 @@ public class MediaInstance ...@@ -156,8 +156,8 @@ public class MediaInstance
MediaInstanceCallback callback = new MediaInstanceCallback(this, listener); MediaInstanceCallback callback = new MediaInstanceCallback(this, listener);
libvlc_exception_t exception = new libvlc_exception_t(); libvlc_exception_t exception = new libvlc_exception_t();
for (LibVlcEventType event : EnumSet.range( for (LibVlcEventType event : EnumSet.range(
LibVlcEventType.libvlc_MediaInstancePlayed, LibVlcEventType.libvlc_MediaPlayerPlayed,
LibVlcEventType.libvlc_MediaInstanceTimeChanged)) LibVlcEventType.libvlc_MediaPlayerTimeChanged))
{ {
libvlc.libvlc_event_attach(eventManager, event.ordinal(), callback, null, exception); libvlc.libvlc_event_attach(eventManager, event.ordinal(), callback, null, exception);
} }
...@@ -174,8 +174,8 @@ public class MediaInstance ...@@ -174,8 +174,8 @@ public class MediaInstance
for (MediaInstanceCallback callback : callbacks) for (MediaInstanceCallback callback : callbacks)
{ {
for (LibVlcEventType event : EnumSet.range( for (LibVlcEventType event : EnumSet.range(
LibVlcEventType.libvlc_MediaInstancePlayed, LibVlcEventType.libvlc_MediaPlayerPlayed,
LibVlcEventType.libvlc_MediaInstancePositionChanged)) LibVlcEventType.libvlc_MediaPlayerPositionChanged))
{ {
libvlc.libvlc_event_detach(eventManager, event.ordinal(), callback, null, exception); libvlc.libvlc_event_detach(eventManager, event.ordinal(), callback, null, exception);
} }
......
...@@ -52,23 +52,23 @@ public class MediaInstanceCallback implements LibVlcCallback ...@@ -52,23 +52,23 @@ public class MediaInstanceCallback implements LibVlcCallback
@Override @Override
public void callback(libvlc_event_t libvlc_event, Pointer userData) public void callback(libvlc_event_t libvlc_event, Pointer userData)
{ {
if (libvlc_event.type == LibVlcEventType.libvlc_MediaInstancePlayed.ordinal()) if (libvlc_event.type == LibVlcEventType.libvlc_MediaPlayerPlayed.ordinal())
{ {
listener.played(mediaInstance); listener.played(mediaInstance);
} }
else if (libvlc_event.type == LibVlcEventType.libvlc_MediaInstancePaused.ordinal()) else if (libvlc_event.type == LibVlcEventType.libvlc_MediaPlayerPaused.ordinal())
{ {
listener.paused(mediaInstance); listener.paused(mediaInstance);
} }
else if (libvlc_event.type == LibVlcEventType.libvlc_MediaInstanceEndReached.ordinal()) else if (libvlc_event.type == LibVlcEventType.libvlc_MediaPlayerEndReached.ordinal())
{ {
listener.endReached(mediaInstance); listener.endReached(mediaInstance);
} }
else if (libvlc_event.type == LibVlcEventType.libvlc_MediaInstancePositionChanged.ordinal()) else if (libvlc_event.type == LibVlcEventType.libvlc_MediaPlayerPositionChanged.ordinal())
{ {
listener.positionChanged(mediaInstance); listener.positionChanged(mediaInstance);
} }
else if (libvlc_event.type == LibVlcEventType.libvlc_MediaInstanceTimeChanged.ordinal()) else if (libvlc_event.type == LibVlcEventType.libvlc_MediaPlayerTimeChanged.ordinal())
{ {
libvlc_event.event_type_specific.setType(LibVlc.media_player_time_changed.class); libvlc_event.event_type_specific.setType(LibVlc.media_player_time_changed.class);
LibVlc.media_player_time_changed timeChanged = (media_player_time_changed) libvlc_event.event_type_specific LibVlc.media_player_time_changed timeChanged = (media_player_time_changed) libvlc_event.event_type_specific
......
...@@ -28,17 +28,17 @@ package org.videolan.jvlc.internal; ...@@ -28,17 +28,17 @@ package org.videolan.jvlc.internal;
public enum LibVlcEventType { public enum LibVlcEventType {
libvlc_MediaDescriptorMetaChanged, libvlc_MediaMetaChanged,
libvlc_MediaDescriptorSubItemAdded, libvlc_MediaSubItemAdded,
libvlc_MediaDescriptorDurationChanged, libvlc_MediaDurationChanged,
libvlc_MediaDescriptorPreparsedChanged, libvlc_MediaPreparsedChanged,
libvlc_MediaDescriptorFreed, libvlc_MediaFreed,
libvlc_MediaDescriptorStateChanged, libvlc_MediaStateChanged,
libvlc_MediaInstancePlayed, libvlc_MediaPlayerPlayed,
libvlc_MediaInstancePaused, libvlc_MediaPlayerPaused,
libvlc_MediaInstanceEndReached, libvlc_MediaPlayerEndReached,
libvlc_MediaInstanceStopped, libvlc_MediaPlayerStopped,
libvlc_MediaInstanceEncounteredError, libvlc_MediaPlayerEncounteredError,
libvlc_MediaInstanceTimeChanged, libvlc_MediaPlayerTimeChanged,
libvlc_MediaInstancePositionChanged; libvlc_MediaPlayerPositionChanged;
} }
...@@ -91,14 +91,14 @@ public class LibVlcImpl ...@@ -91,14 +91,14 @@ public class LibVlcImpl
libVlc.libvlc_event_attach( libVlc.libvlc_event_attach(
mediaInstanceEventManager, mediaInstanceEventManager,
LibVlcEventType.libvlc_MediaInstancePlayed.ordinal(), LibVlcEventType.libvlc_MediaPlayerPlayed.ordinal(),
played, played,
null, null,
exception); exception);
libVlc.libvlc_event_attach( libVlc.libvlc_event_attach(
mediaInstanceEventManager, mediaInstanceEventManager,
LibVlcEventType.libvlc_MediaInstanceEndReached.ordinal(), LibVlcEventType.libvlc_MediaPlayerEndReached.ordinal(),
endReached, endReached,
null, null,
exception); exception);
......
...@@ -40,22 +40,22 @@ extern "C" { ...@@ -40,22 +40,22 @@ extern "C" {
*/ */
typedef enum libvlc_event_type_t { typedef enum libvlc_event_type_t {
libvlc_MediaDescriptorMetaChanged, libvlc_MediaMetaChanged,
libvlc_MediaDescriptorSubItemAdded, libvlc_MediaSubItemAdded,
libvlc_MediaDescriptorDurationChanged, libvlc_MediaDurationChanged,
libvlc_MediaDescriptorPreparsedChanged, libvlc_MediaPreparsedChanged,
libvlc_MediaDescriptorFreed, libvlc_MediaFreed,
libvlc_MediaDescriptorStateChanged, libvlc_MediaStateChanged,
libvlc_MediaInstancePlayed, libvlc_MediaPlayerPlayed,
libvlc_MediaInstancePaused, libvlc_MediaPlayerPaused,
libvlc_MediaInstanceEndReached, libvlc_MediaPlayerEndReached,
libvlc_MediaInstanceStopped, libvlc_MediaPlayerStopped,
libvlc_MediaInstanceEncounteredError, libvlc_MediaPlayerEncounteredError,
libvlc_MediaInstanceTimeChanged, libvlc_MediaPlayerTimeChanged,
libvlc_MediaInstancePositionChanged, libvlc_MediaPlayerPositionChanged,
libvlc_MediaInstanceSeekableChanged, libvlc_MediaPlayerSeekableChanged,
libvlc_MediaInstancePausableChanged, libvlc_MediaPlayerPausableChanged,
libvlc_MediaListItemAdded, libvlc_MediaListItemAdded,
libvlc_MediaListWillAddItem, libvlc_MediaListWillAddItem,
......
...@@ -231,10 +231,10 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self) ...@@ -231,10 +231,10 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
* We also may receive a -retain in some event callback that may occcur * We also may receive a -retain in some event callback that may occcur
* Before libvlc_event_detach. So this can't happen in dealloc */ * Before libvlc_event_detach. So this can't happen in dealloc */
libvlc_event_manager_t * p_em = libvlc_media_event_manager(p_md, NULL); libvlc_event_manager_t * p_em = libvlc_media_event_manager(p_md, NULL);
libvlc_event_detach(p_em, libvlc_MediaDescriptorMetaChanged, HandleMediaMetaChanged, self, NULL); libvlc_event_detach(p_em, libvlc_MediaMetaChanged, HandleMediaMetaChanged, self, NULL);
// libvlc_event_detach(p_em, libvlc_MediaDescriptorDurationChanged, HandleMediaDurationChanged, self, NULL); // libvlc_event_detach(p_em, libvlc_MediaDurationChanged, HandleMediaDurationChanged, self, NULL);
libvlc_event_detach(p_em, libvlc_MediaDescriptorStateChanged, HandleMediaStateChanged, self, NULL); libvlc_event_detach(p_em, libvlc_MediaStateChanged, HandleMediaStateChanged, self, NULL);
libvlc_event_detach(p_em, libvlc_MediaDescriptorSubItemAdded, HandleMediaSubItemAdded, self, NULL); libvlc_event_detach(p_em, libvlc_MediaSubItemAdded, HandleMediaSubItemAdded, self, NULL);
} }
[super release]; [super release];
} }
...@@ -444,10 +444,10 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self) ...@@ -444,10 +444,10 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
catch_exception( &ex ); catch_exception( &ex );
libvlc_event_manager_t * p_em = libvlc_media_event_manager( p_md, &ex ); libvlc_event_manager_t * p_em = libvlc_media_event_manager( p_md, &ex );
libvlc_event_attach(p_em, libvlc_MediaDescriptorMetaChanged, HandleMediaMetaChanged, self, &ex); libvlc_event_attach(p_em, libvlc_MediaMetaChanged, HandleMediaMetaChanged, self, &ex);
// libvlc_event_attach(p_em, libvlc_MediaDescriptorDurationChanged, HandleMediaDurationChanged, self, &ex); // libvlc_event_attach(p_em, libvlc_MediaDurationChanged, HandleMediaDurationChanged, self, &ex);
libvlc_event_attach(p_em, libvlc_MediaDescriptorStateChanged, HandleMediaStateChanged, self, &ex); libvlc_event_attach(p_em, libvlc_MediaStateChanged, HandleMediaStateChanged, self, &ex);
libvlc_event_attach(p_em, libvlc_MediaDescriptorSubItemAdded, HandleMediaSubItemAdded, self, &ex); libvlc_event_attach(p_em, libvlc_MediaSubItemAdded, HandleMediaSubItemAdded, self, &ex);
catch_exception( &ex ); catch_exception( &ex );
libvlc_media_list_t * p_mlist = libvlc_media_subitems( p_md, NULL ); libvlc_media_list_t * p_mlist = libvlc_media_subitems( p_md, NULL );
......
...@@ -88,13 +88,13 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void * ...@@ -88,13 +88,13 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
{ {
VLCMediaPlayerState newState; VLCMediaPlayerState newState;
if( event->type == libvlc_MediaInstancePlayed ) if( event->type == libvlc_MediaPlayerPlayed )
newState = VLCMediaPlayerStatePlaying; newState = VLCMediaPlayerStatePlaying;
else if( event->type == libvlc_MediaInstancePaused ) else if( event->type == libvlc_MediaPlayerPaused )
newState = VLCMediaPlayerStatePaused; newState = VLCMediaPlayerStatePaused;
else if( event->type == libvlc_MediaInstanceEndReached ) else if( event->type == libvlc_MediaPlayerEndReached )
newState = VLCMediaPlayerStateStopped; newState = VLCMediaPlayerStateStopped;
else if( event->type == libvlc_MediaInstanceEncounteredError ) else if( event->type == libvlc_MediaPlayerEncounteredError )
newState = VLCMediaPlayerStateError; newState = VLCMediaPlayerStateError;
else else
{ {
...@@ -640,23 +640,23 @@ static const VLCMediaPlayerState libvlc_to_local_state[] = ...@@ -640,23 +640,23 @@ static const VLCMediaPlayerState libvlc_to_local_state[] =
// Attach event observers into the media instance // Attach event observers into the media instance
libvlc_event_manager_t * p_em = libvlc_media_player_event_manager( instance, &ex ); libvlc_event_manager_t * p_em = libvlc_media_player_event_manager( instance, &ex );
libvlc_event_attach( p_em, libvlc_MediaInstancePlayed, HandleMediaInstanceStateChanged, self, &ex ); libvlc_event_attach( p_em, libvlc_MediaPlayerPlayed, HandleMediaInstanceStateChanged, self, &ex );
libvlc_event_attach( p_em, libvlc_MediaInstancePaused, HandleMediaInstanceStateChanged, self, &ex ); libvlc_event_attach( p_em, libvlc_MediaPlayerPaused, HandleMediaInstanceStateChanged, self, &ex );
libvlc_event_attach( p_em, libvlc_MediaInstanceEndReached, 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 */ /* FIXME: We may want to turn that off when none is interested by that */
libvlc_event_attach( p_em, libvlc_MediaInstancePositionChanged, HandleMediaPositionChanged, self, &ex ); libvlc_event_attach( p_em, libvlc_MediaPlayerPositionChanged, HandleMediaPositionChanged, self, &ex );
libvlc_event_attach( p_em, libvlc_MediaInstanceTimeChanged, HandleMediaTimeChanged, self, &ex ); libvlc_event_attach( p_em, libvlc_MediaPlayerTimeChanged, HandleMediaTimeChanged, self, &ex );
catch_exception( &ex ); catch_exception( &ex );
} }
- (void)unregisterObservers - (void)unregisterObservers
{ {
libvlc_event_manager_t * p_em = libvlc_media_player_event_manager( instance, NULL ); libvlc_event_manager_t * p_em = libvlc_media_player_event_manager( instance, NULL );
libvlc_event_detach( p_em, libvlc_MediaInstancePlayed, HandleMediaInstanceStateChanged, self, NULL ); libvlc_event_detach( p_em, libvlc_MediaPlayerPlayed, HandleMediaInstanceStateChanged, self, NULL );
libvlc_event_detach( p_em, libvlc_MediaInstancePaused, HandleMediaInstanceStateChanged, self, NULL ); libvlc_event_detach( p_em, libvlc_MediaPlayerPaused, HandleMediaInstanceStateChanged, self, NULL );
libvlc_event_detach( p_em, libvlc_MediaInstanceEndReached, HandleMediaInstanceStateChanged, self, NULL ); libvlc_event_detach( p_em, libvlc_MediaPlayerEndReached, HandleMediaInstanceStateChanged, self, NULL );
libvlc_event_detach( p_em, libvlc_MediaInstancePositionChanged, HandleMediaPositionChanged, self, NULL ); libvlc_event_detach( p_em, libvlc_MediaPlayerPositionChanged, HandleMediaPositionChanged, self, NULL );
libvlc_event_detach( p_em, libvlc_MediaInstanceTimeChanged, HandleMediaTimeChanged, self, NULL ); libvlc_event_detach( p_em, libvlc_MediaPlayerTimeChanged, HandleMediaTimeChanged, self, NULL );
} }
- (void)mediaPlayerTimeChanged:(NSNumber *)newTime - (void)mediaPlayerTimeChanged:(NSNumber *)newTime
......
...@@ -549,7 +549,7 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window ) ...@@ -549,7 +549,7 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
p_md = libvlc_playlist_get_media_player( p_plugin->getVLC(), &ex ); p_md = libvlc_playlist_get_media_player( p_plugin->getVLC(), &ex );
libvlc_exception_init( &ex ); libvlc_exception_init( &ex );
libvlc_event_attach( libvlc_media_player_event_manager( p_md, &ex ), libvlc_event_attach( libvlc_media_player_event_manager( p_md, &ex ),
libvlc_MediaInstancePositionChanged, Redraw, NULL, &ex ); libvlc_MediaPlayerPositionChanged, Redraw, NULL, &ex );
*/ */
/* set/change parent window */ /* set/change parent window */
......
...@@ -254,19 +254,19 @@ void libvlc_event_send( libvlc_event_manager_t * p_em, ...@@ -254,19 +254,19 @@ void libvlc_event_send( libvlc_event_manager_t * p_em,
static const char * event_type_to_name[] = static const char * event_type_to_name[] =
{ {
#define EVENT(a) [a]=#a #define EVENT(a) [a]=#a
EVENT(libvlc_MediaDescriptorMetaChanged), EVENT(libvlc_MediaMetaChanged),
EVENT(libvlc_MediaDescriptorSubItemAdded), EVENT(libvlc_MediaSubItemAdded),
EVENT(libvlc_MediaDescriptorDurationChanged), EVENT(libvlc_MediaDurationChanged),
EVENT(libvlc_MediaDescriptorPreparsedChanged), EVENT(libvlc_MediaPreparsedChanged),
EVENT(libvlc_MediaDescriptorFreed), EVENT(libvlc_MediaFreed),
EVENT(libvlc_MediaDescriptorStateChanged), EVENT(libvlc_MediaStateChanged),
EVENT(libvlc_MediaInstancePlayed), EVENT(libvlc_MediaPlayerPlayed),
EVENT(libvlc_MediaInstancePaused), EVENT(libvlc_MediaPlayerPaused),
EVENT(libvlc_MediaInstanceEndReached), EVENT(libvlc_MediaPlayerEndReached),
EVENT(libvlc_MediaInstanceStopped), EVENT(libvlc_MediaPlayerStopped),
EVENT(libvlc_MediaInstanceTimeChanged), EVENT(libvlc_MediaPlayerTimeChanged),
EVENT(libvlc_MediaInstancePositionChanged), EVENT(libvlc_MediaPlayerPositionChanged),
EVENT(libvlc_MediaListItemAdded), EVENT(libvlc_MediaListItemAdded),
EVENT(libvlc_MediaListWillAddItem), EVENT(libvlc_MediaListWillAddItem),
......
...@@ -203,7 +203,7 @@ media_list_item_added( const libvlc_event_t * p_event, void * user_data ) ...@@ -203,7 +203,7 @@ media_list_item_added( const libvlc_event_t * p_event, void * user_data )
trace("%d\n", index); trace("%d\n", index);
if( index >= 0) if( index >= 0)
libvlc_media_list_view_item_added( p_mlv, p_md, index ); libvlc_media_list_view_item_added( p_mlv, p_md, index );
libvlc_event_attach( p_md->p_event_manager, libvlc_MediaDescriptorSubItemAdded, libvlc_event_attach( p_md->p_event_manager, libvlc_MediaSubItemAdded,
items_subitems_added, p_mlv, NULL ); items_subitems_added, p_mlv, NULL );
} }
...@@ -230,7 +230,7 @@ media_list_item_deleted( const libvlc_event_t * p_event, void * user_data ) ...@@ -230,7 +230,7 @@ media_list_item_deleted( const libvlc_event_t * p_event, void * user_data )
trace("%d\n", index); trace("%d\n", index);
if( index >= 0) if( index >= 0)
libvlc_media_list_view_item_deleted( p_mlv, p_md, index ); libvlc_media_list_view_item_deleted( p_mlv, p_md, index );
libvlc_event_detach( p_md->p_event_manager, libvlc_MediaDescriptorSubItemAdded, libvlc_event_detach( p_md->p_event_manager, libvlc_MediaSubItemAdded,
items_subitems_added, p_mlv, NULL ); items_subitems_added, p_mlv, NULL );
} }
static void static void
......
...@@ -98,7 +98,7 @@ static void input_item_subitem_added( const vlc_event_t *p_event, ...@@ -98,7 +98,7 @@ static void input_item_subitem_added( const vlc_event_t *p_event,
} }
/* Construct the event */ /* Construct the event */
event.type = libvlc_MediaDescriptorSubItemAdded; event.type = libvlc_MediaSubItemAdded;
event.u.media_subitem_added.new_child = p_md_child; event.u.media_subitem_added.new_child = p_md_child;
/* Send the event */ /* Send the event */
...@@ -116,7 +116,7 @@ static void input_item_meta_changed( const vlc_event_t *p_event, ...@@ -116,7 +116,7 @@ static void input_item_meta_changed( const vlc_event_t *p_event,
libvlc_event_t event; libvlc_event_t event;
/* Construct the event */ /* Construct the event */
event.type = libvlc_MediaDescriptorMetaChanged; event.type = libvlc_MediaMetaChanged;
event.u.media_meta_changed.meta_type = event.u.media_meta_changed.meta_type =
vlc_to_libvlc_meta[p_event->u.input_item_meta_changed.meta_type]; vlc_to_libvlc_meta[p_event->u.input_item_meta_changed.meta_type];
...@@ -134,7 +134,7 @@ static void input_item_duration_changed( const vlc_event_t *p_event, ...@@ -134,7 +134,7 @@ static void input_item_duration_changed( const vlc_event_t *p_event,
libvlc_event_t event; libvlc_event_t event;
/* Construct the event */ /* Construct the event */
event.type = libvlc_MediaDescriptorDurationChanged; event.type = libvlc_MediaDurationChanged;
event.u.media_duration_changed.new_duration = event.u.media_duration_changed.new_duration =
p_event->u.input_item_duration_changed.new_duration; p_event->u.input_item_duration_changed.new_duration;
...@@ -152,7 +152,7 @@ static void input_item_preparsed_changed( const vlc_event_t *p_event, ...@@ -152,7 +152,7 @@ static void input_item_preparsed_changed( const vlc_event_t *p_event,
libvlc_event_t event; libvlc_event_t event;
/* Construct the event */ /* Construct the event */
event.type = libvlc_MediaDescriptorPreparsedChanged; event.type = libvlc_MediaPreparsedChanged;
event.u.media_preparsed_changed.new_status = event.u.media_preparsed_changed.new_status =
p_event->u.input_item_preparsed_changed.new_status; p_event->u.input_item_preparsed_changed.new_status;
...@@ -254,15 +254,15 @@ libvlc_media_t * libvlc_media_new_from_input_item( ...@@ -254,15 +254,15 @@ libvlc_media_t * libvlc_media_new_from_input_item(
p_md->p_event_manager = libvlc_event_manager_new( p_md, p_instance, p_e ); p_md->p_event_manager = libvlc_event_manager_new( p_md, p_instance, p_e );
libvlc_event_manager_register_event_type( p_md->p_event_manager, libvlc_event_manager_register_event_type( p_md->p_event_manager,
libvlc_MediaDescriptorMetaChanged, p_e ); libvlc_MediaMetaChanged, p_e );
libvlc_event_manager_register_event_type( p_md->p_event_manager, libvlc_event_manager_register_event_type( p_md->p_event_manager,
libvlc_MediaDescriptorSubItemAdded, p_e ); libvlc_MediaSubItemAdded, p_e );
libvlc_event_manager_register_event_type( p_md->p_event_manager, libvlc_event_manager_register_event_type( p_md->p_event_manager,
libvlc_MediaDescriptorFreed, p_e ); libvlc_MediaFreed, p_e );
libvlc_event_manager_register_event_type( p_md->p_event_manager, libvlc_event_manager_register_event_type( p_md->p_event_manager,
libvlc_MediaDescriptorDurationChanged, p_e ); libvlc_MediaDurationChanged, p_e );
libvlc_event_manager_register_event_type( p_md->p_event_manager, libvlc_event_manager_register_event_type( p_md->p_event_manager,
libvlc_MediaDescriptorStateChanged, p_e ); libvlc_MediaStateChanged, p_e );
vlc_gc_incref( p_md->p_input_item ); vlc_gc_incref( p_md->p_input_item );
...@@ -365,7 +365,7 @@ void libvlc_media_release( libvlc_media_t *p_md ) ...@@ -365,7 +365,7 @@ void libvlc_media_release( libvlc_media_t *p_md )
/* Construct the event */ /* Construct the event */
libvlc_event_t event; libvlc_event_t event;
event.type = libvlc_MediaDescriptorFreed; event.type = libvlc_MediaFreed;
event.u.media_freed.md = p_md; event.u.media_freed.md = p_md;
/* Send the event */ /* Send the event */
...@@ -472,7 +472,7 @@ libvlc_media_set_state( libvlc_media_t *p_md, ...@@ -472,7 +472,7 @@ libvlc_media_set_state( libvlc_media_t *p_md,
p_md->state = state; p_md->state = state;
/* Construct the event */ /* Construct the event */
event.type = libvlc_MediaDescriptorStateChanged; event.type = libvlc_MediaStateChanged;
event.u.media_state_changed.new_state = state; event.u.media_state_changed.new_state = state;
/* Send the event */ /* Send the event */
......
...@@ -170,7 +170,7 @@ static void ...@@ -170,7 +170,7 @@ static void
install_media_player_observer( libvlc_media_list_player_t * p_mlp ) install_media_player_observer( libvlc_media_list_player_t * p_mlp )
{ {
libvlc_event_attach( libvlc_media_player_event_manager( p_mlp->p_mi, NULL ), libvlc_event_attach( libvlc_media_player_event_manager( p_mlp->p_mi, NULL ),
libvlc_MediaInstanceEndReached, libvlc_MediaPlayerEndReached,
media_player_reached_end, p_mlp, NULL ); media_player_reached_end, p_mlp, NULL );
} }
...@@ -187,7 +187,7 @@ uninstall_media_player_observer( libvlc_media_list_player_t * p_mlp ) ...@@ -187,7 +187,7 @@ uninstall_media_player_observer( libvlc_media_list_player_t * p_mlp )
} }
libvlc_event_detach( libvlc_media_player_event_manager( p_mlp->p_mi, NULL ), libvlc_event_detach( libvlc_media_player_event_manager( p_mlp->p_mi, NULL ),
libvlc_MediaInstanceEndReached, libvlc_MediaPlayerEndReached,
media_player_reached_end, p_mlp, NULL ); media_player_reached_end, p_mlp, NULL );
} }
......
...@@ -82,7 +82,7 @@ install_md_listener( libvlc_media_list_view_t * p_mlv, ...@@ -82,7 +82,7 @@ install_md_listener( libvlc_media_list_view_t * p_mlv,
{ {
/* No mlist, wait for a subitem added event */ /* No mlist, wait for a subitem added event */
libvlc_event_attach( p_md->p_event_manager, libvlc_event_attach( p_md->p_event_manager,
libvlc_MediaDescriptorSubItemAdded, libvlc_MediaSubItemAdded,
media_list_subitem_added, p_mlv, NULL ); media_list_subitem_added, p_mlv, NULL );
} }
} }
...@@ -95,7 +95,7 @@ uninstall_md_listener( libvlc_media_list_view_t * p_mlv, ...@@ -95,7 +95,7 @@ uninstall_md_listener( libvlc_media_list_view_t * p_mlv,
libvlc_exception_t ignored_exception; libvlc_exception_t ignored_exception;
libvlc_exception_init( &ignored_exception ); libvlc_exception_init( &ignored_exception );
libvlc_event_detach( p_md->p_event_manager, libvlc_event_detach( p_md->p_event_manager,
libvlc_MediaDescriptorSubItemAdded, libvlc_MediaSubItemAdded,
media_list_subitem_added, p_mlv, &ignored_exception ); media_list_subitem_added, p_mlv, &ignored_exception );
if( libvlc_exception_raised( &ignored_exception ) ) if( libvlc_exception_raised( &ignored_exception ) )
libvlc_exception_clear( &ignored_exception ); /* We don't care if we encounter an exception */ libvlc_exception_clear( &ignored_exception ); /* We don't care if we encounter an exception */
...@@ -154,7 +154,7 @@ media_list_subitem_added( const libvlc_event_t * p_event, void * p_user_data ) ...@@ -154,7 +154,7 @@ media_list_subitem_added( const libvlc_event_t * p_event, void * p_user_data )
/* We have a mlist to which we're going to listen to events /* We have a mlist to which we're going to listen to events
* thus, no need to wait for SubItemAdded events */ * thus, no need to wait for SubItemAdded events */
libvlc_event_detach( p_md->p_event_manager, libvlc_event_detach( p_md->p_event_manager,
libvlc_MediaDescriptorSubItemAdded, libvlc_MediaSubItemAdded,
media_list_subitem_added, p_mlv, NULL ); media_list_subitem_added, p_mlv, NULL );
libvlc_media_list_lock( p_mlist ); libvlc_media_list_lock( p_mlist );
......
...@@ -149,19 +149,19 @@ input_state_changed( vlc_object_t * p_this, char const * psz_cmd, ...@@ -149,19 +149,19 @@ input_state_changed( vlc_object_t * p_this, char const * psz_cmd,
{ {
case END_S: case END_S:
libvlc_media_set_state( p_mi->p_md, libvlc_NothingSpecial, NULL); libvlc_media_set_state( p_mi->p_md, libvlc_NothingSpecial, NULL);
event.type = libvlc_MediaInstanceEndReached; event.type = libvlc_MediaPlayerEndReached;
break; break;
case PAUSE_S: case PAUSE_S:
libvlc_media_set_state( p_mi->p_md, libvlc_Playing, NULL); libvlc_media_set_state( p_mi->p_md, libvlc_Playing, NULL);
event.type = libvlc_MediaInstancePaused; event.type = libvlc_MediaPlayerPaused;
break; break;
case PLAYING_S: case PLAYING_S:
libvlc_media_set_state( p_mi->p_md, libvlc_Playing, NULL); libvlc_media_set_state( p_mi->p_md, libvlc_Playing, NULL);
event.type = libvlc_MediaInstancePlayed; event.type = libvlc_MediaPlayerPlayed;
break; break;
case ERROR_S: case ERROR_S:
libvlc_media_set_state( p_mi->p_md, libvlc_Error, NULL); libvlc_media_set_state( p_mi->p_md, libvlc_Error, NULL);
event.type = libvlc_MediaInstanceEncounteredError; event.type = libvlc_MediaPlayerEncounteredError;
break; break;
default: default:
return VLC_SUCCESS; return VLC_SUCCESS;
...@@ -183,7 +183,7 @@ input_seekable_changed( vlc_object_t * p_this, char const * psz_cmd, ...@@ -183,7 +183,7 @@ input_seekable_changed( vlc_object_t * p_this, char const * psz_cmd,
libvlc_event_t event; libvlc_event_t event;
libvlc_media_set_state( p_mi->p_md, libvlc_NothingSpecial, NULL); libvlc_media_set_state( p_mi->p_md, libvlc_NothingSpecial, NULL);
event.type = libvlc_MediaInstanceSeekableChanged; event.type = libvlc_MediaPlayerSeekableChanged;
event.u.media_player_seekable_changed.new_seekable = newval.b_bool; event.u.media_player_seekable_changed.new_seekable = newval.b_bool;
libvlc_event_send( p_mi->p_event_manager, &event ); libvlc_event_send( p_mi->p_event_manager, &event );
...@@ -202,7 +202,7 @@ input_pausable_changed( vlc_object_t * p_this, char const * psz_cmd, ...@@ -202,7 +202,7 @@ input_pausable_changed( vlc_object_t * p_this, char const * psz_cmd,
libvlc_event_t event; libvlc_event_t event;
libvlc_media_set_state( p_mi->p_md, libvlc_NothingSpecial, NULL); libvlc_media_set_state( p_mi->p_md, libvlc_NothingSpecial, NULL);
event.type = libvlc_MediaInstancePausableChanged; event.type = libvlc_MediaPlayerPausableChanged;
event.u.media_player_pausable_changed.new_pausable = newval.b_bool; event.u.media_player_pausable_changed.new_pausable = newval.b_bool;
libvlc_event_send( p_mi->p_event_manager, &event ); libvlc_event_send( p_mi->p_event_manager, &event );
...@@ -235,7 +235,7 @@ input_position_changed( vlc_object_t * p_this, char const * psz_cmd, ...@@ -235,7 +235,7 @@ input_position_changed( vlc_object_t * p_this, char const * psz_cmd,
val.i_time = newval.i_time; val.i_time = newval.i_time;
libvlc_event_t event; libvlc_event_t event;
event.type = libvlc_MediaInstancePositionChanged; event.type = libvlc_MediaPlayerPositionChanged;
event.u.media_player_position_changed.new_position = val.f_float; event.u.media_player_position_changed.new_position = val.f_float;
libvlc_event_send( p_mi->p_event_manager, &event ); libvlc_event_send( p_mi->p_event_manager, &event );
...@@ -268,7 +268,7 @@ input_time_changed( vlc_object_t * p_this, char const * psz_cmd, ...@@ -268,7 +268,7 @@ input_time_changed( vlc_object_t * p_this, char const * psz_cmd,
val.i_time = newval.i_time; val.i_time = newval.i_time;
libvlc_event_t event; libvlc_event_t event;
event.type = libvlc_MediaInstanceTimeChanged; event.type = libvlc_MediaPlayerTimeChanged;
event.u.media_player_time_changed.new_time = val.i_time; event.u.media_player_time_changed.new_time = val.i_time;
libvlc_event_send( p_mi->p_event_manager, &event ); libvlc_event_send( p_mi->p_event_manager, &event );
return VLC_SUCCESS; return VLC_SUCCESS;
...@@ -316,23 +316,23 @@ libvlc_media_player_new( libvlc_instance_t * p_libvlc_instance, ...@@ -316,23 +316,23 @@ libvlc_media_player_new( libvlc_instance_t * p_libvlc_instance,
} }
libvlc_event_manager_register_event_type( p_mi->p_event_manager, libvlc_event_manager_register_event_type( p_mi->p_event_manager,
libvlc_MediaInstanceEndReached, p_e ); libvlc_MediaPlayerEndReached, p_e );
libvlc_event_manager_register_event_type( p_mi->p_event_manager, libvlc_event_manager_register_event_type( p_mi->p_event_manager,
libvlc_MediaInstanceStopped, p_e ); libvlc_MediaPlayerStopped, p_e );
libvlc_event_manager_register_event_type( p_mi->p_event_manager, libvlc_event_manager_register_event_type( p_mi->p_event_manager,
libvlc_MediaInstanceEncounteredError, p_e ); libvlc_MediaPlayerEncounteredError, p_e );
libvlc_event_manager_register_event_type( p_mi->p_event_manager, libvlc_event_manager_register_event_type( p_mi->p_event_manager,
libvlc_MediaInstancePaused, p_e ); libvlc_MediaPlayerPaused, p_e );
libvlc_event_manager_register_event_type( p_mi->p_event_manager, libvlc_event_manager_register_event_type( p_mi->p_event_manager,
libvlc_MediaInstancePlayed, p_e ); libvlc_MediaPlayerPlayed, p_e );
libvlc_event_manager_register_event_type( p_mi->p_event_manager, libvlc_event_manager_register_event_type( p_mi->p_event_manager,
libvlc_MediaInstancePositionChanged, p_e ); libvlc_MediaPlayerPositionChanged, p_e );
libvlc_event_manager_register_event_type( p_mi->p_event_manager, libvlc_event_manager_register_event_type( p_mi->p_event_manager,
libvlc_MediaInstanceTimeChanged, p_e ); libvlc_MediaPlayerTimeChanged, p_e );
libvlc_event_manager_register_event_type( p_mi->p_event_manager, libvlc_event_manager_register_event_type( p_mi->p_event_manager,
libvlc_MediaInstanceSeekableChanged, p_e ); libvlc_MediaPlayerSeekableChanged, p_e );
libvlc_event_manager_register_event_type( p_mi->p_event_manager, libvlc_event_manager_register_event_type( p_mi->p_event_manager,
libvlc_MediaInstancePausableChanged, p_e ); libvlc_MediaPlayerPausableChanged, p_e );
return p_mi; return p_mi;
} }
...@@ -647,7 +647,7 @@ void libvlc_media_player_stop( libvlc_media_player_t *p_mi, ...@@ -647,7 +647,7 @@ void libvlc_media_player_stop( libvlc_media_player_t *p_mi,
/* Send a stop notification event */ /* Send a stop notification event */
libvlc_event_t event; libvlc_event_t event;
libvlc_media_set_state( p_mi->p_md, libvlc_Stopped, NULL); libvlc_media_set_state( p_mi->p_md, libvlc_Stopped, NULL);
event.type = libvlc_MediaInstanceStopped; event.type = libvlc_MediaPlayerStopped;
libvlc_event_send( p_mi->p_event_manager, &event ); libvlc_event_send( p_mi->p_event_manager, &event );
} }
......
...@@ -245,13 +245,13 @@ static void test_events (const char ** argv, int argc) ...@@ -245,13 +245,13 @@ static void test_events (const char ** argv, int argc)
vlc_bool_t callback_was_called; vlc_bool_t callback_was_called;
libvlc_exception_t ex; libvlc_exception_t ex;
libvlc_event_type_t mi_events[] = { libvlc_event_type_t mi_events[] = {
libvlc_MediaInstancePlayed, libvlc_MediaPlayerPlayed,
libvlc_MediaInstancePaused, libvlc_MediaPlayerPaused,
libvlc_MediaInstanceEndReached, libvlc_MediaPlayerEndReached,
libvlc_MediaInstanceStopped, libvlc_MediaPlayerStopped,
libvlc_MediaInstanceEncounteredError, libvlc_MediaPlayerEncounteredError,
libvlc_MediaInstanceTimeChanged, libvlc_MediaPlayerTimeChanged,
libvlc_MediaInstancePositionChanged, libvlc_MediaPlayerPositionChanged,
}; };
int i, mi_events_len = sizeof(mi_events)/sizeof(*mi_events); int i, mi_events_len = sizeof(mi_events)/sizeof(*mi_events);
......
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