[vlc-devel] commit: input: Register vlc_InputStateChanged event. (Pierre d'Herbemont )

git version control git at videolan.org
Sat Jun 14 15:16:59 CEST 2008


vlc | branch: master | Pierre d'Herbemont <pdherbemont at videolan.org> | Sat Jun 14 13:37:02 2008 +0200| [6a938c3c6d2c933cba002cb93c286865def8ba40]

input: Register vlc_InputStateChanged event.

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

 include/vlc_events.h |    9 +++++++++
 src/input/input.c    |    5 +++--
 src/misc/events.c    |    7 +++++++
 3 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/include/vlc_events.h b/include/vlc_events.h
index 01baa94..42329a6 100644
--- a/include/vlc_events.h
+++ b/include/vlc_events.h
@@ -112,6 +112,9 @@ typedef struct vlc_event_manager_t
 /* List of event */
 /* Be sure to keep sync-ed with misc/events.c debug name table */
 typedef enum vlc_event_type_t {
+    /* Input (thread) events */
+    vlc_InputStateChanged,
+
     /* Input item events */
     vlc_InputItemMetaChanged,
     vlc_InputItemSubItemAdded,
@@ -132,6 +135,12 @@ typedef struct vlc_event_t
     void * p_obj; /* Sender object, automatically filled by vlc_event_send() */
     union vlc_event_type_specific
     {
+        /* Input (thread) events */
+        struct vlc_input_state_changed
+        {
+            int new_state;
+        } vlc_input_state_changed;
+
         /* Input item events */
         struct vlc_input_item_meta_changed
         {
diff --git a/src/input/input.c b/src/input/input.c
index f4c906c..2786b14 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -167,8 +167,9 @@ static input_thread_t *Create( vlc_object_t *p_parent, input_item_t *p_item,
     p_input->psz_header = psz_header ? strdup( psz_header ) : NULL;
 
     /* Init events */
-    vlc_event_manager_init_with_vlc_object(
-        &p_input->p->event_manager, p_input );
+    vlc_event_manager_t * p_em = &p_input->p->event_manager;
+    vlc_event_manager_init_with_vlc_object( p_em, p_input );
+    vlc_event_manager_register_event_type( p_em, vlc_InputStateChanged );
 
     /* Init Common fields */
     p_input->b_eof = false;
diff --git a/src/misc/events.c b/src/misc/events.c
index 3b539cc..a558fd7 100644
--- a/src/misc/events.c
+++ b/src/misc/events.c
@@ -72,10 +72,17 @@ typedef struct vlc_event_listeners_group_t
 #ifdef DEBUG_EVENT
 static const char ppsz_event_type_to_name[][33] =
 {
+    [vlc_InputStateChanged]             = "vlc_InputStateChanged",
+
     [vlc_InputItemMetaChanged]          = "vlc_InputItemMetaChanged",
     [vlc_InputItemSubItemAdded]         = "vlc_InputItemSubItemAdded",
+    [vlc_InputItemDurationChanged]      = "vlc_InputItemDurationChanged",
+    [vlc_InputItemPreparsedChanged]     = "vlc_InputItemPreparsedChanged",
+
     [vlc_ServicesDiscoveryItemAdded]    = "vlc_ServicesDiscoveryItemAdded",
     [vlc_ServicesDiscoveryItemRemoved]  = "vlc_ServicesDiscoveryItemRemoved"
+    [vlc_ServicesDiscoveryStarted]      = "vlc_ServicesDiscoveryStarted"
+    [vlc_ServicesDiscoveryEnded]        = "vlc_ServicesDiscoveryEnded"
 };
 #endif
 




More information about the vlc-devel mailing list