X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fcontrol%2Fevent.c;h=a98f23c7ab0e2266220625c601e93c5efce09521;hb=5ebacd11d10f9acc39afc0b3d41beb280eaac293;hp=57cfc6697f54abd52c5f42eb2642144700c0385c;hpb=6da90a1716250d282f16dc6bc9dacec5b9514caf;p=vlc diff --git a/src/control/event.c b/src/control/event.c index 57cfc6697f..a98f23c7ab 100644 --- a/src/control/event.c +++ b/src/control/event.c @@ -26,7 +26,6 @@ #include #include - /* * Private functions */ @@ -57,27 +56,6 @@ group_contains_listener( libvlc_event_listeners_group_t * group, * Internal libvlc functions */ -/************************************************************************** - * libvlc_event_init (internal) : - * - * initialization function. - **************************************************************************/ -void libvlc_event_init( libvlc_instance_t *p_instance, libvlc_exception_t *p_e ) -{ - (void)p_instance;(void)p_e; - /* Will certainly be used to install libvlc_instance event */ -} - -/************************************************************************** - * libvlc_event_fini (internal) : - * - * finalization function. - **************************************************************************/ -void libvlc_event_fini( libvlc_instance_t *p_instance ) -{ - (void)p_instance; -} - /************************************************************************** * libvlc_event_manager_init (internal) : * @@ -101,7 +79,7 @@ libvlc_event_manager_new( void * p_obj, libvlc_instance_t * p_libvlc_inst, libvlc_retain( p_libvlc_inst ); vlc_array_init( &p_em->listeners_groups ); vlc_mutex_init( &p_em->object_lock ); - vlc_mutex_init_recursive( p_libvlc_inst->p_libvlc_int, &p_em->event_sending_lock ); + vlc_mutex_init_recursive( &p_em->event_sending_lock ); return p_em; } @@ -123,7 +101,7 @@ void libvlc_event_manager_release( libvlc_event_manager_t * p_em ) p_lg = vlc_array_item_at_index( &p_em->listeners_groups, i ); for( j = 0; j < vlc_array_count(&p_lg->listeners); j++) - free( vlc_array_item_at_index( &p_em->listeners_groups, i ) ); + free( vlc_array_item_at_index( &p_lg->listeners, j ) ); vlc_array_clear( &p_lg->listeners ); free( p_lg ); @@ -233,7 +211,7 @@ void libvlc_event_send( libvlc_event_manager_t * p_em, continue; } } - + listener_cached->pf_callback( p_event, listener_cached->p_user_data ); listener_cached++; } @@ -251,7 +229,7 @@ void libvlc_event_send( libvlc_event_manager_t * p_em, * * Get the char * name of an event type. **************************************************************************/ -static const char * event_type_to_name[] = +static const char event_type_to_name[][35] = { #define EVENT(a) [a]=#a EVENT(libvlc_MediaMetaChanged), @@ -261,12 +239,19 @@ static const char * event_type_to_name[] = EVENT(libvlc_MediaFreed), EVENT(libvlc_MediaStateChanged), - EVENT(libvlc_MediaPlayerPlayed), + EVENT(libvlc_MediaPlayerNothingSpecial), + EVENT(libvlc_MediaPlayerOpening), + EVENT(libvlc_MediaPlayerBuffering), + EVENT(libvlc_MediaPlayerPlaying), EVENT(libvlc_MediaPlayerPaused), - EVENT(libvlc_MediaPlayerEndReached), EVENT(libvlc_MediaPlayerStopped), + EVENT(libvlc_MediaPlayerForward), + EVENT(libvlc_MediaPlayerBackward), + EVENT(libvlc_MediaPlayerEndReached), EVENT(libvlc_MediaPlayerTimeChanged), EVENT(libvlc_MediaPlayerPositionChanged), + EVENT(libvlc_MediaPlayerSeekableChanged), + EVENT(libvlc_MediaPlayerPausableChanged), EVENT(libvlc_MediaListItemAdded), EVENT(libvlc_MediaListWillAddItem), @@ -286,7 +271,8 @@ static const char * event_type_to_name[] = EVENT(libvlc_MediaDiscovererEnded) #undef EVENT }; -static const char * unkwown_event_name = "Unknown Event"; + +static const char unkwown_event_name[] = "Unknown Event"; const char * libvlc_event_type_name( libvlc_event_type_t event_type ) { @@ -316,7 +302,7 @@ void libvlc_event_attach( libvlc_event_manager_t * p_event_manager, libvlc_exception_raise( p_e, "No Memory left" ); return; } - + listener->event_type = event_type; listener->p_user_data = p_user_data; listener->pf_callback = pf_callback; @@ -370,7 +356,7 @@ void libvlc_event_detach( libvlc_event_manager_t *p_event_manager, listener->p_user_data == p_user_data ) { /* that's our listener */ - + /* Mark this group as edited so that libvlc_event_send * will recheck what listener to call */ listeners_group->b_sublistener_removed = false;