playlist/services_discovery.c: Send service discover started and ended events, to...
authorPierre d'Herbemont <pdherbemont@videolan.org>
Tue, 25 Dec 2007 20:54:18 +0000 (20:54 +0000)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Tue, 25 Dec 2007 20:54:18 +0000 (20:54 +0000)
include/vlc_events.h
src/playlist/services_discovery.c

index 4cf6599..28fa302 100644 (file)
@@ -119,7 +119,9 @@ typedef enum vlc_event_type_t {
 
     /* Service Discovery event */
     vlc_ServicesDiscoveryItemAdded,
-    vlc_ServicesDiscoveryItemRemoved
+    vlc_ServicesDiscoveryItemRemoved,
+    vlc_ServicesDiscoveryStarted,
+    vlc_ServicesDiscoveryEnded
 } vlc_event_type_t;
 
 /* Event definition */
@@ -157,6 +159,14 @@ typedef struct vlc_event_t
         {
             input_item_t * p_item;
         } services_discovery_item_removed;
+        struct vlc_services_discovery_started
+        {
+            void * unused;
+        } services_discovery_started;
+        struct vlc_services_discovery_ended
+        {
+            void * unused;
+        } services_discovery_ended;
 
     } u;
 } vlc_event_t;
index 0f4d72d..b57716d 100644 (file)
@@ -62,6 +62,10 @@ services_discovery_Create ( vlc_object_t * p_super, const char * psz_module_name
             vlc_ServicesDiscoveryItemAdded );
     vlc_event_manager_register_event_type( &p_sd->event_manager,
             vlc_ServicesDiscoveryItemRemoved );
+    vlc_event_manager_register_event_type( &p_sd->event_manager,
+            vlc_ServicesDiscoveryStarted );
+    vlc_event_manager_register_event_type( &p_sd->event_manager,
+            vlc_ServicesDiscoveryEnded );
 
     p_sd->p_module = module_Need( p_sd, "services_discovery", psz_module_name, VLC_TRUE );
 
@@ -180,7 +184,15 @@ services_discovery_RemoveItem ( services_discovery_t * p_sd, input_item_t * p_it
  ***********************************************************************/
 static void RunSD( services_discovery_t *p_sd )
 {
+    vlc_event_t event;
+
+    event.type = vlc_ServicesDiscoveryStarted;
+    vlc_event_send( &p_sd->event_manager, &event );
+
     p_sd->pf_run( p_sd );
+
+    event.type = vlc_ServicesDiscoveryEnded;
+    vlc_event_send( &p_sd->event_manager, &event );
     return;
 }