libvlc_events.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * libvlc_events.h:  libvlc_events external API structure
00003  *****************************************************************************
00004  * Copyright (C) 1998-2007 the VideoLAN team
00005  * $Id $
00006  *
00007  * Authors: Filippo Carone <littlejohn@videolan.org>
00008  *          Pierre d'Herbemont <pdherbemont@videolan.org>
00009  *
00010  * This program is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2 of the License, or
00013  * (at your option) any later version.
00014  *
00015  * This program is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  * GNU General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU General Public License
00021  * along with this program; if not, write to the Free Software
00022  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
00023  *****************************************************************************/
00024 
00025 #ifndef LIBVLC_EVENTS_H
00026 #define LIBVLC_EVENTS_H 1
00027 
00028 # ifdef __cplusplus
00029 extern "C" {
00030 # endif
00031 
00032 /*****************************************************************************
00033  * Events handling
00034  *****************************************************************************/
00035 
00036 /** \defgroup libvlc_event libvlc_event
00037  * \ingroup libvlc_core
00038  * LibVLC Available Events
00039  * @{
00040  */
00041 
00042 typedef enum libvlc_event_type_t {
00043     libvlc_MediaMetaChanged,
00044     libvlc_MediaSubItemAdded,
00045     libvlc_MediaDurationChanged,
00046     libvlc_MediaPreparsedChanged,
00047     libvlc_MediaFreed,
00048     libvlc_MediaStateChanged,
00049 
00050     libvlc_MediaPlayerNothingSpecial,
00051     libvlc_MediaPlayerOpening,
00052     libvlc_MediaPlayerBuffering,
00053     libvlc_MediaPlayerPlaying,
00054     libvlc_MediaPlayerPaused,
00055     libvlc_MediaPlayerStopped,
00056     libvlc_MediaPlayerForward,
00057     libvlc_MediaPlayerBackward,
00058     libvlc_MediaPlayerEndReached,
00059     libvlc_MediaPlayerEncounteredError,
00060     libvlc_MediaPlayerTimeChanged,
00061     libvlc_MediaPlayerPositionChanged,
00062     libvlc_MediaPlayerSeekableChanged,
00063     libvlc_MediaPlayerPausableChanged,
00064 
00065     libvlc_MediaListItemAdded,
00066     libvlc_MediaListWillAddItem,
00067     libvlc_MediaListItemDeleted,
00068     libvlc_MediaListWillDeleteItem,
00069 
00070     libvlc_MediaListViewItemAdded,
00071     libvlc_MediaListViewWillAddItem,
00072     libvlc_MediaListViewItemDeleted,
00073     libvlc_MediaListViewWillDeleteItem,
00074 
00075     libvlc_MediaListPlayerPlayed,
00076     libvlc_MediaListPlayerNextItemSet,
00077     libvlc_MediaListPlayerStopped,
00078 
00079     libvlc_MediaDiscovererStarted,
00080     libvlc_MediaDiscovererEnded
00081 
00082 } libvlc_event_type_t;
00083 
00084 /**
00085  * An Event
00086  * \param type the even type
00087  * \param p_obj the sender object
00088  * \param u Event dependent content
00089  */
00090 
00091 typedef struct libvlc_event_t
00092 {
00093     libvlc_event_type_t type;
00094     void * p_obj;
00095     union event_type_specific
00096     {
00097         /* media descriptor */
00098         struct
00099         {
00100             libvlc_meta_t meta_type;
00101         } media_meta_changed;
00102         struct
00103         {
00104             libvlc_media_t * new_child;
00105         } media_subitem_added;
00106         struct
00107         {
00108             int64_t new_duration;
00109         } media_duration_changed;
00110         struct
00111         {
00112             int new_status;
00113         } media_preparsed_changed;
00114         struct
00115         {
00116             libvlc_media_t * md;
00117         } media_freed;
00118         struct
00119         {
00120             libvlc_state_t new_state;
00121         } media_state_changed;
00122 
00123         /* media instance */
00124         struct
00125         {
00126             float new_position;
00127         } media_player_position_changed;
00128         struct
00129         {
00130             libvlc_time_t new_time;
00131         } media_player_time_changed;
00132         struct
00133         {
00134             libvlc_time_t new_seekable;
00135         } media_player_seekable_changed;
00136         struct
00137         {
00138             libvlc_time_t new_pausable;
00139         } media_player_pausable_changed;
00140 
00141         /* media list */
00142         struct
00143         {
00144             libvlc_media_t * item;
00145             int index;
00146         } media_list_item_added;
00147         struct
00148         {
00149             libvlc_media_t * item;
00150             int index;
00151         } media_list_will_add_item;
00152         struct
00153         {
00154             libvlc_media_t * item;
00155             int index;
00156         } media_list_item_deleted;
00157         struct
00158         {
00159             libvlc_media_t * item;
00160             int index;
00161         } media_list_will_delete_item;
00162 
00163         /* media list view */
00164         struct
00165         {
00166             libvlc_media_t * item;
00167             int index;
00168         } media_list_view_item_added;
00169         struct
00170         {
00171             libvlc_media_t * item;
00172             int index;
00173         } media_list_view_will_add_item;
00174         struct
00175         {
00176             libvlc_media_t * item;
00177             int index;
00178         } media_list_view_item_deleted;
00179         struct
00180         {
00181             libvlc_media_t * item;
00182             int index;
00183         } media_list_view_will_delete_item;
00184 
00185         /* media discoverer */
00186         struct
00187         {
00188             void * unused;
00189         } media_media_discoverer_started;
00190         struct
00191         {
00192             void * unused;
00193         } media_media_discoverer_ended;
00194 
00195     } u;
00196 } libvlc_event_t;
00197 
00198 /**
00199  * Event manager that belongs to a libvlc object, and from whom events can
00200  * be received.
00201  */
00202 
00203 typedef struct libvlc_event_manager_t libvlc_event_manager_t;
00204 
00205 /**
00206  * Callback function notification
00207  * \param p_event the event triggering the callback
00208  */
00209 
00210 typedef void ( *libvlc_callback_t )( const libvlc_event_t *, void * );
00211 
00212 /**@} */
00213 
00214 # ifdef __cplusplus
00215 }
00216 # endif
00217 
00218 #endif /* _LIBVLC_EVENTS_H */

Generated on Wed Aug 13 08:02:37 2008 for VLC by  doxygen 1.5.1