Commit 11104cb5 authored by Sergey Radionov's avatar Sergey Radionov Committed by Rémi Denis-Courmont

libvlc: libvlc_MediaSubItemTreeAdded event type added

Signed-off-by: default avatarRémi Denis-Courmont <remi@remlab.net>
parent 5ad7967e
......@@ -52,6 +52,7 @@ enum libvlc_event_e {
libvlc_MediaParsedChanged,
libvlc_MediaFreed,
libvlc_MediaStateChanged,
libvlc_MediaSubItemTreeAdded,
libvlc_MediaPlayerMediaChanged=0x100,
libvlc_MediaPlayerNothingSpecial,
......@@ -137,6 +138,10 @@ typedef struct libvlc_event_t
{
libvlc_state_t new_state;
} media_state_changed;
struct
{
libvlc_media_t * item;
} media_subitemtree_added;
/* media instance */
struct
......
......@@ -259,6 +259,7 @@ static const event_name_t event_list[] = {
DEF(MediaParsedChanged)
DEF(MediaFreed)
DEF(MediaStateChanged)
DEF(MediaSubItemTreeAdded)
DEF(MediaPlayerMediaChanged)
DEF(MediaPlayerNothingSpecial)
......
......@@ -119,6 +119,23 @@ static void input_item_subitem_added( const vlc_event_t *p_event,
libvlc_media_release( p_md_child );
}
/**************************************************************************
* input_item_subitemtree_added (Private) (vlc event Callback)
**************************************************************************/
static void input_item_subitemtree_added( const vlc_event_t * p_event,
void * user_data )
{
libvlc_media_t * p_md = user_data;
libvlc_event_t event;
/* Construct the event */
event.type = libvlc_MediaSubItemTreeAdded;
event.u.media_subitemtree_added.item = p_md;
/* Send the event */
libvlc_event_send( p_md->p_event_manager, &event );
}
/**************************************************************************
* input_item_meta_changed (Private) (vlc event Callback)
**************************************************************************/
......@@ -201,6 +218,10 @@ static void install_input_item_observer( libvlc_media_t *p_md )
vlc_InputItemPreparsedChanged,
input_item_preparsed_changed,
p_md );
vlc_event_attach( &p_md->p_input_item->event_manager,
vlc_InputItemSubItemTreeAdded,
input_item_subitemtree_added,
p_md );
}
/**************************************************************************
......@@ -224,6 +245,10 @@ static void uninstall_input_item_observer( libvlc_media_t *p_md )
vlc_InputItemPreparsedChanged,
input_item_preparsed_changed,
p_md );
vlc_event_detach( &p_md->p_input_item->event_manager,
vlc_InputItemSubItemTreeAdded,
input_item_subitemtree_added,
p_md );
}
/**************************************************************************
......@@ -277,6 +302,7 @@ libvlc_media_t * libvlc_media_new_from_input_item(
libvlc_event_manager_register_event_type(em, libvlc_MediaDurationChanged);
libvlc_event_manager_register_event_type(em, libvlc_MediaStateChanged);
libvlc_event_manager_register_event_type(em, libvlc_MediaParsedChanged);
libvlc_event_manager_register_event_type(em, libvlc_MediaSubItemTreeAdded);
vlc_gc_incref( p_md->p_input_item );
......
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