]> git.sesse.net Git - vlc/commitdiff
Move events to a separate file
authorRémi Denis-Courmont <rdenis@simphalempin.com>
Mon, 23 Feb 2009 18:34:04 +0000 (20:34 +0200)
committerRémi Denis-Courmont <rdenis@simphalempin.com>
Mon, 23 Feb 2009 19:13:29 +0000 (21:13 +0200)
bindings/cil/src/Makefile.am
bindings/cil/src/event.cs [new file with mode: 0644]
bindings/cil/src/libvlc.cs

index 280d6d34ba8999f6aff4b26fa7ee5cc34823f66f..8392f3a7d06e31fb1bce919183a2eed0354eeff5 100644 (file)
@@ -6,6 +6,7 @@ pkglib_SCRIPTS = VideoLAN.LibVLC.dll
 SOURCES_dll = \
        ustring.cs \
        exception.cs \
+       event.cs \
        marshal.cs \
        instance.cs \
        media.cs \
diff --git a/bindings/cil/src/event.cs b/bindings/cil/src/event.cs
new file mode 100644 (file)
index 0000000..e549c11
--- /dev/null
@@ -0,0 +1,120 @@
+/**
+ * @file event.cs
+ * @brief Unmanaged LibVLC events
+ * @ingroup Internals
+ */
+
+/**********************************************************************
+ *  Copyright (C) 2009 Rémi Denis-Courmont.                           *
+ *  This program is free software; you can redistribute and/or modify *
+ *  it under the terms of the GNU General Public License as published *
+ *  by the Free Software Foundation; version 2 of the license, or (at *
+ *  your option) any later version.                                   *
+ *                                                                    *
+ *  This program is distributed in the hope that it will be useful,   *
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of    *
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.              *
+ *  See the GNU General Public License for more details.              *
+ *                                                                    *
+ *  You should have received a copy of the GNU General Public License *
+ *  along with this program; if not, you can get it from:             *
+ *  http://www.gnu.org/copyleft/gpl.html                              *
+ **********************************************************************/
+
+using System;
+using System.Runtime.InteropServices;
+
+namespace VideoLAN.LibVLC
+{
+    /**
+     * @ingroup Internals
+     * @{
+     */
+
+    /**
+     * @brief EventType: LibVLC event types
+     */
+    internal enum EventType
+    {
+        MediaMetaChanged,
+        MediaSubItemAdded,
+        MediaDurationChanged,
+        MediaPreparsedChanged,
+        MediaFreed,
+        MediaStateChanged,
+
+        PlayerNothingSpecial,
+        PlayerOpening,
+        PlayerBuffering,
+        PlayerPlaying,
+        PlayerPaused,
+        PlayerStopped,
+        PlayerForward,
+        PlayerBackward,
+        PlayerEndReached,
+        PlayerEncounteredError,
+        PlayerTimeChanged,
+        PlayerPositionChanged,
+        PlayerSeekableChanged,
+        PlayerPausableChanged,
+
+        ListItemAdded,
+        ListWillAddItem,
+        ListItemDeleted,
+        ListWillDeleteItem,
+
+        ListViewItemAdded,
+        ListViewWillAddItem,
+        ListViewItemDeleted,
+        ListViewWillDeleteItem,
+
+        ListPlayerPlayed,
+        ListPlayerNextItemSet,
+        ListPlayerStopped,
+
+        DiscovererStarted,
+        DiscovererEnded,
+
+        PlayerTitleChanged,
+    };
+
+    [StructLayout (LayoutKind.Sequential)]
+    internal class GenericEvent
+    {
+        public EventType type;
+        public IntPtr    obj;
+    };
+    internal delegate void GenericCallback (GenericEvent e, IntPtr d);
+
+    /* Player events */
+    [StructLayout (LayoutKind.Sequential)]
+    internal sealed class PlayerPositionEvent : GenericEvent
+    {
+        float     position;
+    };
+
+    [StructLayout (LayoutKind.Sequential)]
+    internal sealed class PlayerTimeEvent : GenericEvent
+    {
+        long      time;
+    };
+
+    [StructLayout (LayoutKind.Sequential)]
+    internal sealed class PlayerTitleEvent : GenericEvent
+    {
+        int       title;
+    };
+
+    [StructLayout (LayoutKind.Sequential)]
+    internal sealed class PlayerSeekableEvent : GenericEvent
+    {
+        long      seekable;
+    };
+
+    [StructLayout (LayoutKind.Sequential)]
+    internal sealed class PlayerPausableChangedEvent : GenericEvent
+    {
+        long      pausable;
+    };
+    /** @} */
+};
\ No newline at end of file
index 5e81f8461a1101c83e8353d6d87e3b9ac70b0a48..4cf488e13a3155d5df21800db50d2ed0dd7db6d8 100644 (file)
@@ -359,58 +359,4 @@ namespace VideoLAN.LibVLC
 
         /* libvlc_event_type_name */
     };
-
-    /**
-     * @brief EventCallback: LibVLC event handler
-     * @ingroup Internals
-     */
-    internal delegate void EventCallback (IntPtr ev, IntPtr data);
-
-    /**
-     * @brief EventType: LibVLC event types
-     * @ingroup Internals
-     */
-    internal enum EventType
-    {
-        MediaMetaChanged,
-        MediaSubItemAdded,
-        MediaDurationChanged,
-        MediaPreparsedChanged,
-        MediaFreed,
-        MediaStateChanged,
-
-        PlayerNothingSpecial,
-        PlayerOpening,
-        PlayerBuffering,
-        PlayerPlaying,
-        PlayerPaused,
-        PlayerStopped,
-        PlayerForward,
-        PlayerBackward,
-        PlayerEndReached,
-        PlayerEncounteredError,
-        PlayerTimeChanged,
-        PlayerPositionChanged,
-        PlayerSeekableChanged,
-        PlayerPausableChanged,
-
-        ListItemAdded,
-        ListWillAddItem,
-        ListItemDeleted,
-        ListWillDeleteItem,
-
-        ListViewItemAdded,
-        ListViewWillAddItem,
-        ListViewItemDeleted,
-        ListViewWillDeleteItem,
-
-        ListPlayerPlayed,
-        ListPlayerNextItemSet,
-        ListPlayerStopped,
-
-        DiscovererStarted,
-        DiscovererEnded,
-
-        PlayerTitleChanged,
-    };
 };