[vlc-devel] commit: jvlc: libvlc state and event type enums aligned with libvlc ( Filippo Carone )

git version control git at videolan.org
Sun Jul 20 12:41:35 CEST 2008


vlc | branch: master | Filippo Carone <littlejohn at videolan.org> | Sun Jul 20 12:44:01 2008 +0200| [71c4969b02aaf38c70a499d72ff1ac052aac68b7]

jvlc: libvlc state and event type enums aligned with libvlc

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=71c4969b02aaf38c70a499d72ff1ac052aac68b7
---

 .../main/java/org/videolan/jvlc/MediaPlayer.java   |    4 +-
 .../videolan/jvlc/event/MediaInstanceCallback.java |    2 +-
 .../videolan/jvlc/internal/LibVlcEventType.java    |   31 ++++++++++++++++++--
 .../org/videolan/jvlc/internal/LibVlcImpl.java     |    2 +-
 .../org/videolan/jvlc/internal/LibVlcState.java    |   10 ++++--
 .../jvlc/internal/MediaListPlayerTest.java         |    6 ++--
 6 files changed, 41 insertions(+), 14 deletions(-)

diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/MediaPlayer.java b/bindings/java/core/src/main/java/org/videolan/jvlc/MediaPlayer.java
index 66bbb1f..5394ffb 100644
--- a/bindings/java/core/src/main/java/org/videolan/jvlc/MediaPlayer.java
+++ b/bindings/java/core/src/main/java/org/videolan/jvlc/MediaPlayer.java
@@ -156,7 +156,7 @@ public class MediaPlayer
         MediaInstanceCallback callback = new MediaInstanceCallback(this, listener);
         libvlc_exception_t exception = new libvlc_exception_t();
         for (LibVlcEventType event : EnumSet.range(
-            LibVlcEventType.libvlc_MediaPlayerPlayed,
+            LibVlcEventType.libvlc_MediaPlayerPlaying,
             LibVlcEventType.libvlc_MediaPlayerTimeChanged))
         {
             libvlc.libvlc_event_attach(eventManager, event.ordinal(), callback, null, exception);
@@ -174,7 +174,7 @@ public class MediaPlayer
         for (MediaInstanceCallback callback : callbacks)
         {
             for (LibVlcEventType event : EnumSet.range(
-                LibVlcEventType.libvlc_MediaPlayerPlayed,
+                LibVlcEventType.libvlc_MediaPlayerPlaying,
                 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 397d46f..f527f09 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
@@ -51,7 +51,7 @@ public class MediaInstanceCallback implements LibVlcCallback
      */
     public void callback(libvlc_event_t libvlc_event, Pointer userData)
     {
-        if (libvlc_event.type == LibVlcEventType.libvlc_MediaPlayerPlayed.ordinal())
+        if (libvlc_event.type == LibVlcEventType.libvlc_MediaPlayerPlaying.ordinal())
         {
             listener.played(mediaInstance);
         }
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 4ef0afb..db7d19a 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
@@ -34,11 +34,36 @@ public enum LibVlcEventType {
     libvlc_MediaPreparsedChanged,
     libvlc_MediaFreed,
     libvlc_MediaStateChanged,
-    libvlc_MediaPlayerPlayed,
+
+    libvlc_MediaPlayerNothingSpecial,
+    libvlc_MediaPlayerOpening,
+    libvlc_MediaPlayerBuffering,
+    libvlc_MediaPlayerPlaying,
     libvlc_MediaPlayerPaused,
-    libvlc_MediaPlayerEndReached,
     libvlc_MediaPlayerStopped,
+    libvlc_MediaPlayerForward,
+    libvlc_MediaPlayerBackward,
+    libvlc_MediaPlayerEndReached,
     libvlc_MediaPlayerEncounteredError,
     libvlc_MediaPlayerTimeChanged,
-    libvlc_MediaPlayerPositionChanged;
+    libvlc_MediaPlayerPositionChanged,
+    libvlc_MediaPlayerSeekableChanged,
+    libvlc_MediaPlayerPausableChanged,
+
+    libvlc_MediaListItemAdded,
+    libvlc_MediaListWillAddItem,
+    libvlc_MediaListItemDeleted,
+    libvlc_MediaListWillDeleteItem,
+
+    libvlc_MediaListViewItemAdded,
+    libvlc_MediaListViewWillAddItem,
+    libvlc_MediaListViewItemDeleted,
+    libvlc_MediaListViewWillDeleteItem,
+
+    libvlc_MediaListPlayerPlayed,
+    libvlc_MediaListPlayerNextItemSet,
+    libvlc_MediaListPlayerStopped,
+
+    libvlc_MediaDiscovererStarted,
+    libvlc_MediaDiscovererEnded;
 }
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 bdbc921..b4f264d 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
@@ -92,7 +92,7 @@ public class LibVlcImpl
 
         libVlc.libvlc_event_attach(
             mediaInstanceEventManager,
-            LibVlcEventType.libvlc_MediaPlayerPlayed.ordinal(),
+            LibVlcEventType.libvlc_MediaPlayerPlaying.ordinal(),
             played,
             null,
             exception);
diff --git a/bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlcState.java b/bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlcState.java
index 7512861..446ddee 100644
--- a/bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlcState.java
+++ b/bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlcState.java
@@ -29,11 +29,13 @@ package org.videolan.jvlc.internal;
 public enum LibVlcState
 {
     libvlc_NothingSpecial,
-    libvlc_Stopped,
     libvlc_Opening,
     libvlc_Buffering,
-    libvlc_Ended,
-    libvlc_Error,
     libvlc_Playing,
-    libvlc_Paused
+    libvlc_Paused,
+    libvlc_Stopped,
+    libvlc_Forward,
+    libvlc_Backward,
+    libvlc_Ended,
+    libvlc_Error;
 }
diff --git a/bindings/java/core/src/test/java/org/videolan/jvlc/internal/MediaListPlayerTest.java b/bindings/java/core/src/test/java/org/videolan/jvlc/internal/MediaListPlayerTest.java
index ab4bedb..1400048 100644
--- a/bindings/java/core/src/test/java/org/videolan/jvlc/internal/MediaListPlayerTest.java
+++ b/bindings/java/core/src/test/java/org/videolan/jvlc/internal/MediaListPlayerTest.java
@@ -200,12 +200,12 @@ public class MediaListPlayerTest
     }
 
     @Test
-    public void mediaListPlayerGetStateStopped()
+    public void mediaListPlayerGetStateEnded()
     {
         libvlc_exception_t exception = new libvlc_exception_t();
         LibVlcMediaListPlayer mediaListPlayer = libvlc.libvlc_media_list_player_new(libvlcInstance, exception);
         int state = libvlc.libvlc_media_list_player_get_state(mediaListPlayer, exception);
-        Assert.assertEquals(LibVlcState.libvlc_Stopped.ordinal(), state);
+        Assert.assertEquals(LibVlcState.libvlc_Ended.ordinal(), state);
         libvlc.libvlc_media_list_player_release(mediaListPlayer);
     }
 
@@ -331,7 +331,7 @@ public class MediaListPlayerTest
             }
             Thread.sleep(150);
         }
-        Assert.assertEquals(LibVlcState.libvlc_Stopped.ordinal(), libvlc.libvlc_media_list_player_get_state(
+        Assert.assertEquals(LibVlcState.libvlc_Ended.ordinal(), libvlc.libvlc_media_list_player_get_state(
             mediaListPlayer,
             exception));
         libvlc.libvlc_media_list_release(mediaList);




More information about the vlc-devel mailing list