X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=include%2Fvlc_events.h;h=9e37f7f5753243d52a4fba2616d958598083a53f;hb=bce10e7649067b4b214f5fa4eed32e46ed6d2ddf;hp=42329a681cc0b6a915cdd5c8698ddc4485277d22;hpb=6a938c3c6d2c933cba002cb93c286865def8ba40;p=vlc diff --git a/include/vlc_events.h b/include/vlc_events.h index 42329a681c..9e37f7f575 100644 --- a/include/vlc_events.h +++ b/include/vlc_events.h @@ -1,25 +1,25 @@ /***************************************************************************** - * events.h: events definitions + * vlc_events.h: events definitions * Interface used to send events. ***************************************************************************** - * Copyright (C) 2007 the VideoLAN team + * Copyright (C) 2007 VLC authors and VideoLAN * $Id$ * * Authors: Pierre d'Herbemont * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ #ifndef VLC_EVENTS_H @@ -105,25 +105,29 @@ typedef struct vlc_event_manager_t void * p_obj; vlc_mutex_t object_lock; vlc_mutex_t event_sending_lock; - vlc_object_t *p_parent_object; DECL_ARRAY(struct vlc_event_listeners_group_t *) listeners_groups; } vlc_event_manager_t; /* List of event */ -/* Be sure to keep sync-ed with misc/events.c debug name table */ typedef enum vlc_event_type_t { /* Input (thread) events */ vlc_InputStateChanged, + vlc_InputSelectedStreamChanged, /* Input item events */ vlc_InputItemMetaChanged, vlc_InputItemSubItemAdded, + vlc_InputItemSubItemTreeAdded, vlc_InputItemDurationChanged, vlc_InputItemPreparsedChanged, + vlc_InputItemNameChanged, + vlc_InputItemInfoChanged, + vlc_InputItemErrorWhenReadingChanged, /* Service Discovery event */ vlc_ServicesDiscoveryItemAdded, vlc_ServicesDiscoveryItemRemoved, + vlc_ServicesDiscoveryItemRemoveAll, vlc_ServicesDiscoveryStarted, vlc_ServicesDiscoveryEnded } vlc_event_type_t; @@ -139,7 +143,11 @@ typedef struct vlc_event_t struct vlc_input_state_changed { int new_state; - } vlc_input_state_changed; + } input_state_changed; + struct vlc_input_selected_stream_changed + { + void * unused; + } input_selected_stream_changed; /* Input item events */ struct vlc_input_item_meta_changed @@ -150,6 +158,10 @@ typedef struct vlc_event_t { input_item_t * p_new_child; } input_item_subitem_added; + struct vlc_input_item_subitem_tree_added + { + input_item_node_t * p_root; + } input_item_subitem_tree_added; struct vlc_input_item_duration_changed { mtime_t new_duration; @@ -158,6 +170,18 @@ 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; + struct input_item_error_when_reading_changed + { + bool new_value; + } input_item_error_when_reading_changed; /* Service discovery events */ struct vlc_services_discovery_item_added @@ -191,49 +215,39 @@ typedef void ( *vlc_event_callback_t )( const vlc_event_t *, void * ); /* * p_obj points to the object that owns the event manager, and from * which events are sent - * p_obj is here to give us a libvlc instance */ -#define vlc_event_manager_init_with_vlc_object(a,b) \ - vlc_event_manager_init( a, b, b ) - -#define vlc_event_manager_init(a,b,c) \ - __vlc_event_manager_init(a, b, VLC_OBJECT(c)) -VLC_EXPORT(int, __vlc_event_manager_init, ( vlc_event_manager_t * p_em, - void * p_obj, vlc_object_t * )); +VLC_API int vlc_event_manager_init( vlc_event_manager_t * p_em, void * p_obj ); /* * Destroy */ -VLC_EXPORT(void, vlc_event_manager_fini, ( vlc_event_manager_t * p_em )); +VLC_API void vlc_event_manager_fini( vlc_event_manager_t * p_em ); /* * Tells a specific event manager that it will handle event_type object */ -VLC_EXPORT(int, vlc_event_manager_register_event_type, - ( vlc_event_manager_t * p_em, vlc_event_type_t event_type )); +VLC_API int vlc_event_manager_register_event_type( vlc_event_manager_t * p_em, + vlc_event_type_t ); /* * Send an event to the listener attached to this p_em. */ -VLC_EXPORT(void, vlc_event_send, ( vlc_event_manager_t * p_em, - vlc_event_t * p_event )); +VLC_API void vlc_event_send( vlc_event_manager_t * p_em, vlc_event_t * ); /* * Add a callback for an event. */ -#define vlc_event_attach(a, b, c, d) __vlc_event_attach(a, b, c, d, #c) -VLC_EXPORT(int, __vlc_event_attach, ( vlc_event_manager_t * p_event_manager, - vlc_event_type_t event_type, - vlc_event_callback_t pf_callback, - void *p_user_data, - const char * psz_debug_name )); +VLC_API int vlc_event_attach( vlc_event_manager_t * p_event_manager, + vlc_event_type_t event_type, + vlc_event_callback_t pf_callback, + void *p_user_data ); /* * Remove a callback for an event. */ -VLC_EXPORT(int, vlc_event_detach, ( vlc_event_manager_t *p_event_manager, - vlc_event_type_t event_type, - vlc_event_callback_t pf_callback, - void *p_user_data )); +VLC_API void vlc_event_detach( vlc_event_manager_t *p_event_manager, + vlc_event_type_t event_type, + vlc_event_callback_t pf_callback, + void *p_user_data ); #endif /* VLC_EVENTS_H */