Commit 1479b918 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

Forgotten files from previous commit.

parent 5f9f9ea4
...@@ -103,13 +103,15 @@ struct vlc_event_listeners_group_t; ...@@ -103,13 +103,15 @@ struct vlc_event_listeners_group_t;
typedef struct vlc_event_manager_t typedef struct vlc_event_manager_t
{ {
void * p_obj; void * p_obj;
vlc_mutex_t object_lock;
DECL_ARRAY(struct vlc_event_listeners_group_t *) listeners_groups; DECL_ARRAY(struct vlc_event_listeners_group_t *) listeners_groups;
} vlc_event_manager_t; } vlc_event_manager_t;
/* List of event */ /* List of event */
typedef enum vlc_event_type_t { typedef enum vlc_event_type_t {
/* Input item events */
vlc_InputItemMetaChanged, vlc_InputItemMetaChanged,
vlc_InputItemSubItemAdded vlc_InputItemSubItemAdded,
} vlc_event_type_t; } vlc_event_type_t;
/* Event definition */ /* Event definition */
...@@ -119,6 +121,7 @@ typedef struct vlc_event_t ...@@ -119,6 +121,7 @@ typedef struct vlc_event_t
void * p_obj; /* Sender object, automatically filled by vlc_event_send() */ void * p_obj; /* Sender object, automatically filled by vlc_event_send() */
union vlc_event_type_specific union vlc_event_type_specific
{ {
/* Input item events */
struct vlc_input_item_meta_changed struct vlc_input_item_meta_changed
{ {
vlc_meta_type_t meta_type; vlc_meta_type_t meta_type;
...@@ -140,9 +143,10 @@ typedef void ( *vlc_event_callback_t )( const vlc_event_t *, void * ); ...@@ -140,9 +143,10 @@ typedef void ( *vlc_event_callback_t )( const vlc_event_t *, void * );
/* /*
* p_obj points to the object that owns the event manager, and from * p_obj points to the object that owns the event manager, and from
* which events are sent * which events are sent
* p_obj is here to give us a libvlc instance
*/ */
VLC_EXPORT(int, vlc_event_manager_init, ( vlc_event_manager_t * p_em, VLC_EXPORT(int, vlc_event_manager_init, ( vlc_event_manager_t * p_em,
void * p_obj )); void * p_obj, vlc_object_t * ));
/* /*
* Destroy * Destroy
...@@ -175,6 +179,6 @@ VLC_EXPORT(int, vlc_event_attach, ( vlc_event_manager_t * p_event_manager, ...@@ -175,6 +179,6 @@ VLC_EXPORT(int, vlc_event_attach, ( vlc_event_manager_t * p_event_manager,
VLC_EXPORT(int, vlc_event_detach, ( vlc_event_manager_t *p_event_manager, VLC_EXPORT(int, vlc_event_detach, ( vlc_event_manager_t *p_event_manager,
vlc_event_type_t event_type, vlc_event_type_t event_type,
vlc_event_callback_t pf_callback, vlc_event_callback_t pf_callback,
void *p_user_data )); void *p_user_data ));
#endif /* VLC_EVENTS_H */ #endif /* VLC_EVENTS_H */
...@@ -114,7 +114,7 @@ static inline void input_ItemInit( vlc_object_t *p_o, input_item_t *p_i ) ...@@ -114,7 +114,7 @@ static inline void input_ItemInit( vlc_object_t *p_o, input_item_t *p_i )
p_i->p_meta = NULL; p_i->p_meta = NULL;
vlc_mutex_init( p_o, &p_i->lock ); vlc_mutex_init( p_o, &p_i->lock );
vlc_event_manager_init( &p_i->event_manager, p_i ); vlc_event_manager_init( &p_i->event_manager, p_i, p_o );
vlc_event_manager_register_event_type( &p_i->event_manager, vlc_event_manager_register_event_type( &p_i->event_manager,
vlc_InputItemMetaChanged ); vlc_InputItemMetaChanged );
vlc_event_manager_register_event_type( &p_i->event_manager, vlc_event_manager_register_event_type( &p_i->event_manager,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment