[vlc-devel] [PATCH] libvlc: rename all libvlc_MediaInstance in libvlc_MediaPlayer and libvlc_MediaDescriptor to libvlc_Media

Tanguy Krotoff tkrotoff at gmail.com
Mon Mar 31 06:35:08 CEST 2008


---
 .../main/java/org/videolan/jvlc/MediaInstance.java |    8 ++--
 .../videolan/jvlc/event/MediaInstanceCallback.java |   10 +++---
 .../videolan/jvlc/internal/LibVlcEventType.java    |   26 +++++++-------
 .../org/videolan/jvlc/internal/LibVlcImpl.java     |    4 +-
 include/vlc/libvlc_events.h                        |   30 ++++++++--------
 projects/macosx/framework/Sources/VLCMedia.m       |   16 ++++----
 projects/macosx/framework/Sources/VLCMediaPlayer.m |   28 ++++++++--------
 projects/mozilla/vlcshell.cpp                      |    2 +-
 src/control/event.c                                |   26 +++++++-------
 src/control/hierarchical_node_media_list_view.c    |    4 +-
 src/control/media.c                                |   22 ++++++------
 src/control/media_list_player.c                    |    4 +-
 src/control/media_list_view.c                      |    6 ++--
 src/control/media_player.c                         |   36 ++++++++++----------
 src/control/testapi.c                              |   14 ++++----
 15 files changed, 118 insertions(+), 118 deletions(-)

diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/MediaInstance.java b/bindings/java/core/src/main/java/org/videolan/jvlc/MediaInstance.java
index a802366..0854d82 100644
--- a/bindings/java/core/src/main/java/org/videolan/jvlc/MediaInstance.java
+++ b/bindings/java/core/src/main/java/org/videolan/jvlc/MediaInstance.java
@@ -156,8 +156,8 @@ public class MediaInstance
         MediaInstanceCallback callback = new MediaInstanceCallback(this, listener);
         libvlc_exception_t exception = new libvlc_exception_t();
         for (LibVlcEventType event : EnumSet.range(
-            LibVlcEventType.libvlc_MediaInstancePlayed,
-            LibVlcEventType.libvlc_MediaInstanceTimeChanged))
+            LibVlcEventType.libvlc_MediaPlayerPlayed,
+            LibVlcEventType.libvlc_MediaPlayerTimeChanged))
         {
             libvlc.libvlc_event_attach(eventManager, event.ordinal(), callback, null, exception);
         }
@@ -174,8 +174,8 @@ public class MediaInstance
         for (MediaInstanceCallback callback : callbacks)
         {
             for (LibVlcEventType event : EnumSet.range(
-                LibVlcEventType.libvlc_MediaInstancePlayed,
-                LibVlcEventType.libvlc_MediaInstancePositionChanged))
+                LibVlcEventType.libvlc_MediaPlayerPlayed,
+                LibVlcEventType.libvlc_MediaPlayerPositionChanged))
             {
                 libvlc.libvlc_event_detach(eventManager, event.ordinal(), callback, null, exception);
             }
diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/event/MediaInstanceCallback.java b/bindings/java/core/src/main/java/org/videolan/jvlc/event/MediaInstanceCallback.java
index 8c36e68..9801338 100644
--- a/bindings/java/core/src/main/java/org/videolan/jvlc/event/MediaInstanceCallback.java
+++ b/bindings/java/core/src/main/java/org/videolan/jvlc/event/MediaInstanceCallback.java
@@ -52,23 +52,23 @@ public class MediaInstanceCallback implements LibVlcCallback
     @Override
     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);
         }
-        else if (libvlc_event.type == LibVlcEventType.libvlc_MediaInstancePaused.ordinal())
+        else if (libvlc_event.type == LibVlcEventType.libvlc_MediaPlayerPaused.ordinal())
         {
             listener.paused(mediaInstance);
         }
-        else if (libvlc_event.type == LibVlcEventType.libvlc_MediaInstanceEndReached.ordinal())
+        else if (libvlc_event.type == LibVlcEventType.libvlc_MediaPlayerEndReached.ordinal())
         {
             listener.endReached(mediaInstance);
         }
-        else if (libvlc_event.type == LibVlcEventType.libvlc_MediaInstancePositionChanged.ordinal())
+        else if (libvlc_event.type == LibVlcEventType.libvlc_MediaPlayerPositionChanged.ordinal())
         {
             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.media_player_time_changed timeChanged = (media_player_time_changed) libvlc_event.event_type_specific
diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlcEventType.java b/bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlcEventType.java
index 32615d0..4ef0afb 100644
--- a/bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlcEventType.java
+++ b/bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlcEventType.java
@@ -28,17 +28,17 @@ package org.videolan.jvlc.internal;
 
 public enum LibVlcEventType {
 
-    libvlc_MediaDescriptorMetaChanged,
-    libvlc_MediaDescriptorSubItemAdded,
-    libvlc_MediaDescriptorDurationChanged,
-    libvlc_MediaDescriptorPreparsedChanged,
-    libvlc_MediaDescriptorFreed,
-    libvlc_MediaDescriptorStateChanged,
-    libvlc_MediaInstancePlayed,
-    libvlc_MediaInstancePaused,
-    libvlc_MediaInstanceEndReached,
-    libvlc_MediaInstanceStopped,
-    libvlc_MediaInstanceEncounteredError,
-    libvlc_MediaInstanceTimeChanged,
-    libvlc_MediaInstancePositionChanged;
+    libvlc_MediaMetaChanged,
+    libvlc_MediaSubItemAdded,
+    libvlc_MediaDurationChanged,
+    libvlc_MediaPreparsedChanged,
+    libvlc_MediaFreed,
+    libvlc_MediaStateChanged,
+    libvlc_MediaPlayerPlayed,
+    libvlc_MediaPlayerPaused,
+    libvlc_MediaPlayerEndReached,
+    libvlc_MediaPlayerStopped,
+    libvlc_MediaPlayerEncounteredError,
+    libvlc_MediaPlayerTimeChanged,
+    libvlc_MediaPlayerPositionChanged;
 }
diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlcImpl.java b/bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlcImpl.java
index d9467c7..8df2b59 100644
--- a/bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlcImpl.java
+++ b/bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlcImpl.java
@@ -91,14 +91,14 @@ public class LibVlcImpl
 
         libVlc.libvlc_event_attach(
             mediaInstanceEventManager,
-            LibVlcEventType.libvlc_MediaInstancePlayed.ordinal(),
+            LibVlcEventType.libvlc_MediaPlayerPlayed.ordinal(),
             played,
             null,
             exception);
 
         libVlc.libvlc_event_attach(
             mediaInstanceEventManager,
-            LibVlcEventType.libvlc_MediaInstanceEndReached.ordinal(),
+            LibVlcEventType.libvlc_MediaPlayerEndReached.ordinal(),
             endReached,
             null,
             exception);
diff --git a/include/vlc/libvlc_events.h b/include/vlc/libvlc_events.h
index cba64a3..48b4bba 100644
--- a/include/vlc/libvlc_events.h
+++ b/include/vlc/libvlc_events.h
@@ -40,22 +40,22 @@ extern "C" {
  */
 
 typedef enum libvlc_event_type_t {
-    libvlc_MediaDescriptorMetaChanged,
-    libvlc_MediaDescriptorSubItemAdded,
-    libvlc_MediaDescriptorDurationChanged,
-    libvlc_MediaDescriptorPreparsedChanged,
-    libvlc_MediaDescriptorFreed,
-    libvlc_MediaDescriptorStateChanged,
-
-    libvlc_MediaInstancePlayed,
-    libvlc_MediaInstancePaused,
-    libvlc_MediaInstanceEndReached,
-    libvlc_MediaInstanceStopped,
-    libvlc_MediaInstanceEncounteredError,
-    libvlc_MediaInstanceTimeChanged,
-    libvlc_MediaInstancePositionChanged,
-    libvlc_MediaInstanceSeekableChanged,
-    libvlc_MediaInstancePausableChanged,
+    libvlc_MediaMetaChanged,
+    libvlc_MediaSubItemAdded,
+    libvlc_MediaDurationChanged,
+    libvlc_MediaPreparsedChanged,
+    libvlc_MediaFreed,
+    libvlc_MediaStateChanged,
+
+    libvlc_MediaPlayerPlayed,
+    libvlc_MediaPlayerPaused,
+    libvlc_MediaPlayerEndReached,
+    libvlc_MediaPlayerStopped,
+    libvlc_MediaPlayerEncounteredError,
+    libvlc_MediaPlayerTimeChanged,
+    libvlc_MediaPlayerPositionChanged,
+    libvlc_MediaPlayerSeekableChanged,
+    libvlc_MediaPlayerPausableChanged,
 
     libvlc_MediaListItemAdded,
     libvlc_MediaListWillAddItem,
diff --git a/projects/macosx/framework/Sources/VLCMedia.m b/projects/macosx/framework/Sources/VLCMedia.m
index 9cbe434..02e05fe 100644
--- a/projects/macosx/framework/Sources/VLCMedia.m
+++ b/projects/macosx/framework/Sources/VLCMedia.m
@@ -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
              * 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_detach(p_em, libvlc_MediaDescriptorMetaChanged,     HandleMediaMetaChanged,     self, NULL);
-//            libvlc_event_detach(p_em, libvlc_MediaDescriptorDurationChanged, HandleMediaDurationChanged, self, NULL);
-            libvlc_event_detach(p_em, libvlc_MediaDescriptorStateChanged,    HandleMediaStateChanged,    self, NULL);
-            libvlc_event_detach(p_em, libvlc_MediaDescriptorSubItemAdded,    HandleMediaSubItemAdded,    self, NULL);
+            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);
         }
         [super release];
     }
@@ -444,10 +444,10 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
     catch_exception( &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_MediaDescriptorDurationChanged, HandleMediaDurationChanged, self, &ex);
-    libvlc_event_attach(p_em, libvlc_MediaDescriptorStateChanged,    HandleMediaStateChanged,    self, &ex);
-    libvlc_event_attach(p_em, libvlc_MediaDescriptorSubItemAdded,    HandleMediaSubItemAdded,    self, &ex);
+    libvlc_event_attach(p_em, libvlc_MediaMetaChanged,     HandleMediaMetaChanged,     self, &ex);
+//    libvlc_event_attach(p_em, libvlc_MediaDurationChanged, HandleMediaDurationChanged, self, &ex);
+    libvlc_event_attach(p_em, libvlc_MediaStateChanged,    HandleMediaStateChanged,    self, &ex);
+    libvlc_event_attach(p_em, libvlc_MediaSubItemAdded,    HandleMediaSubItemAdded,    self, &ex);
     catch_exception( &ex );
     
     libvlc_media_list_t * p_mlist = libvlc_media_subitems( p_md, NULL );
diff --git a/projects/macosx/framework/Sources/VLCMediaPlayer.m b/projects/macosx/framework/Sources/VLCMediaPlayer.m
index fd5111c..e08e3fa 100644
--- a/projects/macosx/framework/Sources/VLCMediaPlayer.m
+++ b/projects/macosx/framework/Sources/VLCMediaPlayer.m
@@ -88,13 +88,13 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
 {
     VLCMediaPlayerState newState;
 
-    if( event->type == libvlc_MediaInstancePlayed )
+    if( event->type == libvlc_MediaPlayerPlayed )
         newState = VLCMediaPlayerStatePlaying;
-    else if( event->type == libvlc_MediaInstancePaused )
+    else if( event->type == libvlc_MediaPlayerPaused )
         newState = VLCMediaPlayerStatePaused;
-    else if( event->type == libvlc_MediaInstanceEndReached )
+    else if( event->type == libvlc_MediaPlayerEndReached )
         newState = VLCMediaPlayerStateStopped;
-    else if( event->type == libvlc_MediaInstanceEncounteredError )
+    else if( event->type == libvlc_MediaPlayerEncounteredError )
         newState = VLCMediaPlayerStateError;
     else
     {
@@ -640,23 +640,23 @@ static const VLCMediaPlayerState libvlc_to_local_state[] =
 
     // 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_MediaInstancePlayed,          HandleMediaInstanceStateChanged, self, &ex );
-    libvlc_event_attach( p_em, libvlc_MediaInstancePaused,          HandleMediaInstanceStateChanged, self, &ex );
-    libvlc_event_attach( p_em, libvlc_MediaInstanceEndReached,      HandleMediaInstanceStateChanged, self, &ex );
+    libvlc_event_attach( p_em, libvlc_MediaPlayerPlayed,          HandleMediaInstanceStateChanged, self, &ex );
+    libvlc_event_attach( p_em, libvlc_MediaPlayerPaused,          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_MediaInstancePositionChanged, HandleMediaPositionChanged,      self, &ex );
-    libvlc_event_attach( p_em, libvlc_MediaInstanceTimeChanged,     HandleMediaTimeChanged,          self, &ex );
+    libvlc_event_attach( p_em, libvlc_MediaPlayerPositionChanged, HandleMediaPositionChanged,      self, &ex );
+    libvlc_event_attach( p_em, libvlc_MediaPlayerTimeChanged,     HandleMediaTimeChanged,          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_MediaInstancePlayed,          HandleMediaInstanceStateChanged, self, NULL );
-    libvlc_event_detach( p_em, libvlc_MediaInstancePaused,          HandleMediaInstanceStateChanged, self, NULL );
-    libvlc_event_detach( p_em, libvlc_MediaInstanceEndReached,      HandleMediaInstanceStateChanged, self, NULL );
-    libvlc_event_detach( p_em, libvlc_MediaInstancePositionChanged, HandleMediaPositionChanged,      self, NULL );
-    libvlc_event_detach( p_em, libvlc_MediaInstanceTimeChanged,     HandleMediaTimeChanged,          self, NULL );
+    libvlc_event_detach( p_em, libvlc_MediaPlayerPlayed,          HandleMediaInstanceStateChanged, self, NULL );
+    libvlc_event_detach( p_em, libvlc_MediaPlayerPaused,          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 );
 }
 
 - (void)mediaPlayerTimeChanged:(NSNumber *)newTime
diff --git a/projects/mozilla/vlcshell.cpp b/projects/mozilla/vlcshell.cpp
index b4445a6..925cacb 100644
--- a/projects/mozilla/vlcshell.cpp
+++ b/projects/mozilla/vlcshell.cpp
@@ -549,7 +549,7 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
             p_md = libvlc_playlist_get_media_player( p_plugin->getVLC(), &ex );
             libvlc_exception_init( &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 */
diff --git a/src/control/event.c b/src/control/event.c
index b98f14c..d4dbdca 100644
--- a/src/control/event.c
+++ b/src/control/event.c
@@ -254,19 +254,19 @@ void libvlc_event_send( libvlc_event_manager_t * p_em,
 static const char * event_type_to_name[] =
 {
 #define EVENT(a) [a]=#a
-    EVENT(libvlc_MediaDescriptorMetaChanged),
-    EVENT(libvlc_MediaDescriptorSubItemAdded),
-    EVENT(libvlc_MediaDescriptorDurationChanged),
-    EVENT(libvlc_MediaDescriptorPreparsedChanged),
-    EVENT(libvlc_MediaDescriptorFreed),
-    EVENT(libvlc_MediaDescriptorStateChanged),
-
-    EVENT(libvlc_MediaInstancePlayed),
-    EVENT(libvlc_MediaInstancePaused),
-    EVENT(libvlc_MediaInstanceEndReached),
-    EVENT(libvlc_MediaInstanceStopped),
-    EVENT(libvlc_MediaInstanceTimeChanged),
-    EVENT(libvlc_MediaInstancePositionChanged),
+    EVENT(libvlc_MediaMetaChanged),
+    EVENT(libvlc_MediaSubItemAdded),
+    EVENT(libvlc_MediaDurationChanged),
+    EVENT(libvlc_MediaPreparsedChanged),
+    EVENT(libvlc_MediaFreed),
+    EVENT(libvlc_MediaStateChanged),
+
+    EVENT(libvlc_MediaPlayerPlayed),
+    EVENT(libvlc_MediaPlayerPaused),
+    EVENT(libvlc_MediaPlayerEndReached),
+    EVENT(libvlc_MediaPlayerStopped),
+    EVENT(libvlc_MediaPlayerTimeChanged),
+    EVENT(libvlc_MediaPlayerPositionChanged),
 
     EVENT(libvlc_MediaListItemAdded),
     EVENT(libvlc_MediaListWillAddItem),
diff --git a/src/control/hierarchical_node_media_list_view.c b/src/control/hierarchical_node_media_list_view.c
index 40f48ce..7a297f2 100644
--- a/src/control/hierarchical_node_media_list_view.c
+++ b/src/control/hierarchical_node_media_list_view.c
@@ -203,7 +203,7 @@ media_list_item_added( const libvlc_event_t * p_event, void * user_data )
     trace("%d\n", index);
     if( index >= 0)
         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 );
                          
 }
@@ -230,7 +230,7 @@ media_list_item_deleted( const libvlc_event_t * p_event, void * user_data )
     trace("%d\n", index);
     if( index >= 0)
         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 );
 }
 static void
diff --git a/src/control/media.c b/src/control/media.c
index 38326bc..20b65a3 100644
--- a/src/control/media.c
+++ b/src/control/media.c
@@ -98,7 +98,7 @@ static void input_item_subitem_added( const vlc_event_t *p_event,
     }
 
     /* Construct the event */
-    event.type = libvlc_MediaDescriptorSubItemAdded;
+    event.type = libvlc_MediaSubItemAdded;
     event.u.media_subitem_added.new_child = p_md_child;
 
     /* Send the event */
@@ -116,7 +116,7 @@ static void input_item_meta_changed( const vlc_event_t *p_event,
     libvlc_event_t event;
 
     /* Construct the event */
-    event.type = libvlc_MediaDescriptorMetaChanged;
+    event.type = libvlc_MediaMetaChanged;
     event.u.media_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,
     libvlc_event_t event;
 
     /* Construct the event */
-    event.type = libvlc_MediaDescriptorDurationChanged;
+    event.type = libvlc_MediaDurationChanged;
     event.u.media_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,
     libvlc_event_t event;
 
     /* Construct the event */
-    event.type = libvlc_MediaDescriptorPreparsedChanged;
+    event.type = libvlc_MediaPreparsedChanged;
     event.u.media_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(
 
     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_MediaDescriptorMetaChanged, p_e );
+        libvlc_MediaMetaChanged, p_e );
     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_MediaDescriptorFreed, p_e );
+        libvlc_MediaFreed, p_e );
     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_MediaDescriptorStateChanged, p_e );
+        libvlc_MediaStateChanged, p_e );
 
     vlc_gc_incref( p_md->p_input_item );
 
@@ -365,7 +365,7 @@ void libvlc_media_release( libvlc_media_t *p_md )
 
     /* Construct the event */
     libvlc_event_t event;
-    event.type = libvlc_MediaDescriptorFreed;
+    event.type = libvlc_MediaFreed;
     event.u.media_freed.md = p_md;
 
     /* Send the event */
@@ -472,7 +472,7 @@ libvlc_media_set_state( libvlc_media_t *p_md,
     p_md->state = state;
 
     /* Construct the event */
-    event.type = libvlc_MediaDescriptorStateChanged;
+    event.type = libvlc_MediaStateChanged;
     event.u.media_state_changed.new_state = state;
 
     /* Send the event */
diff --git a/src/control/media_list_player.c b/src/control/media_list_player.c
index 89f1155..1bb9d72 100644
--- a/src/control/media_list_player.c
+++ b/src/control/media_list_player.c
@@ -170,7 +170,7 @@ static void
 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_MediaInstanceEndReached,
+                         libvlc_MediaPlayerEndReached,
                           media_player_reached_end, p_mlp, NULL );
 }
 
@@ -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_MediaInstanceEndReached,
+                         libvlc_MediaPlayerEndReached,
                          media_player_reached_end, p_mlp, NULL );
 }
 
diff --git a/src/control/media_list_view.c b/src/control/media_list_view.c
index 0844c7c..f288c4f 100644
--- a/src/control/media_list_view.c
+++ b/src/control/media_list_view.c
@@ -82,7 +82,7 @@ install_md_listener( libvlc_media_list_view_t * p_mlv,
     {
         /* No mlist, wait for a subitem added event */
         libvlc_event_attach( p_md->p_event_manager,
-                            libvlc_MediaDescriptorSubItemAdded,
+                            libvlc_MediaSubItemAdded,
                             media_list_subitem_added, p_mlv, NULL );
     }
 }
@@ -95,7 +95,7 @@ uninstall_md_listener( libvlc_media_list_view_t * p_mlv,
     libvlc_exception_t ignored_exception;
     libvlc_exception_init( &ignored_exception );
     libvlc_event_detach( p_md->p_event_manager,
-                         libvlc_MediaDescriptorSubItemAdded,
+                         libvlc_MediaSubItemAdded,
                          media_list_subitem_added, p_mlv, &ignored_exception );
     if( libvlc_exception_raised( &ignored_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 )
         /* We have a mlist to which we're going to listen to events
          * thus, no need to wait for SubItemAdded events */
         libvlc_event_detach( p_md->p_event_manager,
-                             libvlc_MediaDescriptorSubItemAdded,
+                             libvlc_MediaSubItemAdded,
                              media_list_subitem_added, p_mlv, NULL );
         libvlc_media_list_lock( p_mlist );
 
diff --git a/src/control/media_player.c b/src/control/media_player.c
index bc026a9..b59fafe 100644
--- a/src/control/media_player.c
+++ b/src/control/media_player.c
@@ -149,19 +149,19 @@ input_state_changed( vlc_object_t * p_this, char const * psz_cmd,
     {
         case END_S:
             libvlc_media_set_state( p_mi->p_md, libvlc_NothingSpecial, NULL);
-            event.type = libvlc_MediaInstanceEndReached;
+            event.type = libvlc_MediaPlayerEndReached;
             break;
         case PAUSE_S:
             libvlc_media_set_state( p_mi->p_md, libvlc_Playing, NULL);
-            event.type = libvlc_MediaInstancePaused;
+            event.type = libvlc_MediaPlayerPaused;
             break;
         case PLAYING_S:
             libvlc_media_set_state( p_mi->p_md, libvlc_Playing, NULL);
-            event.type = libvlc_MediaInstancePlayed;
+            event.type = libvlc_MediaPlayerPlayed;
             break;
         case ERROR_S:
             libvlc_media_set_state( p_mi->p_md, libvlc_Error, NULL);
-            event.type = libvlc_MediaInstanceEncounteredError;
+            event.type = libvlc_MediaPlayerEncounteredError;
             break;
         default:
             return VLC_SUCCESS;
@@ -183,7 +183,7 @@ input_seekable_changed( vlc_object_t * p_this, char const * psz_cmd,
     libvlc_event_t event;
 
     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;
 
     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,
     libvlc_event_t event;
 
     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;
 
     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,
         val.i_time = newval.i_time;
 
     libvlc_event_t event;
-    event.type = libvlc_MediaInstancePositionChanged;
+    event.type = libvlc_MediaPlayerPositionChanged;
     event.u.media_player_position_changed.new_position = val.f_float;
 
     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,
         val.i_time = newval.i_time;
 
     libvlc_event_t event;
-    event.type = libvlc_MediaInstanceTimeChanged;
+    event.type = libvlc_MediaPlayerTimeChanged;
     event.u.media_player_time_changed.new_time = val.i_time;
     libvlc_event_send( p_mi->p_event_manager, &event );
     return VLC_SUCCESS;
@@ -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_MediaInstanceEndReached, p_e );
+            libvlc_MediaPlayerEndReached, p_e );
     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_MediaInstanceEncounteredError, p_e );
+            libvlc_MediaPlayerEncounteredError, p_e );
     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_MediaInstancePlayed, p_e );
+            libvlc_MediaPlayerPlayed, p_e );
     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_MediaInstanceTimeChanged, p_e );
+            libvlc_MediaPlayerTimeChanged, p_e );
     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_MediaInstancePausableChanged, p_e );
+            libvlc_MediaPlayerPausableChanged, p_e );
 
     return p_mi;
 }
@@ -647,7 +647,7 @@ void libvlc_media_player_stop( libvlc_media_player_t *p_mi,
     /* Send a stop notification event */
     libvlc_event_t event;
     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 );
 }
 
diff --git a/src/control/testapi.c b/src/control/testapi.c
index c779fff..568d50e 100644
--- a/src/control/testapi.c
+++ b/src/control/testapi.c
@@ -245,13 +245,13 @@ static void test_events (const char ** argv, int argc)
     vlc_bool_t callback_was_called;
     libvlc_exception_t ex;
     libvlc_event_type_t mi_events[] = {
-        libvlc_MediaInstancePlayed,
-        libvlc_MediaInstancePaused,
-        libvlc_MediaInstanceEndReached,
-        libvlc_MediaInstanceStopped,
-        libvlc_MediaInstanceEncounteredError,
-        libvlc_MediaInstanceTimeChanged,
-        libvlc_MediaInstancePositionChanged,
+        libvlc_MediaPlayerPlayed,
+        libvlc_MediaPlayerPaused,
+        libvlc_MediaPlayerEndReached,
+        libvlc_MediaPlayerStopped,
+        libvlc_MediaPlayerEncounteredError,
+        libvlc_MediaPlayerTimeChanged,
+        libvlc_MediaPlayerPositionChanged,
     };
     int i, mi_events_len = sizeof(mi_events)/sizeof(*mi_events);
     
-- 
1.5.4.3




More information about the vlc-devel mailing list