input: Register vlc_InputStateChanged event.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Sat, 14 Jun 2008 11:37:02 +0000 (13:37 +0200)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Sat, 14 Jun 2008 11:37:02 +0000 (13:37 +0200)
include/vlc_events.h
src/input/input.c
src/misc/events.c

index 01baa94..42329a6 100644 (file)
@@ -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
         {
index f4c906c..2786b14 100644 (file)
@@ -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;
index 3b539cc..a558fd7 100644 (file)
@@ -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