Commit 788413cf authored by Pierre d'Herbemont's avatar Pierre d'Herbemont
Browse files

input: Send vlc_InputItemInfoChanged, and vlc_InputItemNameChanged events.

parent 6db8b4dd
......@@ -120,6 +120,8 @@ typedef enum vlc_event_type_t {
vlc_InputItemSubItemAdded,
vlc_InputItemDurationChanged,
vlc_InputItemPreparsedChanged,
vlc_InputItemNameChanged,
vlc_InputItemInfoChanged,
/* Service Discovery event */
vlc_ServicesDiscoveryItemAdded,
......@@ -158,6 +160,14 @@ typedef struct vlc_event_t
{
int new_status;
} input_item_preparsed_changed;
struct vlc_input_item_name_changed
{
const char * new_name;
} input_item_name_changed;
struct vlc_input_item_info_changed
{
void * unused;
} input_item_info_changed;
/* Service discovery events */
struct vlc_services_discovery_item_added
......
......@@ -200,7 +200,12 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
vlc_mutex_unlock( &p_input->p->input.p_item->lock );
if( !p_input->b_preparsing )
{
NotifyPlaylist( p_input );
vlc_event_t event;
event.type = vlc_InputItemInfoChanged;
vlc_event_send( p_input->p->input.p_item, &event );
}
}
return VLC_SUCCESS;
......@@ -267,8 +272,12 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
vlc_mutex_unlock( &p_input->p->input.p_item->lock );
if( !p_input->b_preparsing )
{
NotifyPlaylist( p_input );
vlc_event_t event;
event.type = vlc_InputItemInfoChanged;
vlc_event_send( p_input->p->input.p_item, &event );
}
return VLC_SUCCESS;
}
......@@ -299,8 +308,13 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
vlc_mutex_unlock( &p_input->p->input.p_item->lock );
if( !p_input->b_preparsing )
{
NotifyPlaylist( p_input );
vlc_event_t event;
event.type = vlc_InputItemNameChanged;
event.u.input_item_name_changed.new_name = psz_name;
vlc_event_send( p_input->p->input.p_item, &event );
}
return VLC_SUCCESS;
}
......
......@@ -62,6 +62,10 @@ static inline void input_ItemInit( vlc_object_t *p_o, input_item_t *p_i )
vlc_InputItemDurationChanged );
vlc_event_manager_register_event_type( &p_i->event_manager,
vlc_InputItemPreparsedChanged );
vlc_event_manager_register_event_type( &p_i->event_manager,
vlc_InputItemNameChanged );
vlc_event_manager_register_event_type( &p_i->event_manager,
vlc_InputItemInfoChanged );
}
static inline void input_ItemClean( input_item_t *p_i )
......
......@@ -78,6 +78,8 @@ static const char ppsz_event_type_to_name[][33] =
[vlc_InputItemSubItemAdded] = "vlc_InputItemSubItemAdded",
[vlc_InputItemDurationChanged] = "vlc_InputItemDurationChanged",
[vlc_InputItemPreparsedChanged] = "vlc_InputItemPreparsedChanged",
[vlc_InputItemNameChanged] = "vlc_InputItemNameChanged",
[vlc_InputItemInfoChanged] = "vlc_InputItemInfoChanged",
[vlc_ServicesDiscoveryItemAdded] = "vlc_ServicesDiscoveryItemAdded",
[vlc_ServicesDiscoveryItemRemoved] = "vlc_ServicesDiscoveryItemRemoved"
......
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