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-2008 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 along
00021  * with this program; if not, write to the Free Software Foundation, Inc.,
00022  * 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 /**
00029  * \file
00030  * This file defines libvlc_event external API
00031  */
00032 
00033 # ifdef __cplusplus
00034 extern "C" {
00035 # endif
00036 
00037 /*****************************************************************************
00038  * Events handling
00039  *****************************************************************************/
00040 
00041 /** \defgroup libvlc_event libvlc_event
00042  * \ingroup libvlc_core
00043  * LibVLC Available Events
00044  * @{
00045  */
00046 
00047     /* Append new event types at the end. Do not remove, insert or
00048      * re-order any entry. The cpp will prepend libvlc_ to the symbols. */
00049 #define DEFINE_LIBVLC_EVENT_TYPES \
00050     DEF( MediaMetaChanged ), \
00051     DEF( MediaSubItemAdded ), \
00052     DEF( MediaDurationChanged ), \
00053     DEF( MediaPreparsedChanged ), \
00054     DEF( MediaFreed ), \
00055     DEF( MediaStateChanged ), \
00056     \
00057     DEF( MediaPlayerNothingSpecial ), \
00058     DEF( MediaPlayerOpening ), \
00059     DEF( MediaPlayerBuffering ), \
00060     DEF( MediaPlayerPlaying ), \
00061     DEF( MediaPlayerPaused ), \
00062     DEF( MediaPlayerStopped ), \
00063     DEF( MediaPlayerForward ), \
00064     DEF( MediaPlayerBackward ), \
00065     DEF( MediaPlayerEndReached ), \
00066     DEF( MediaPlayerEncounteredError ), \
00067     DEF( MediaPlayerTimeChanged ), \
00068     DEF( MediaPlayerPositionChanged ), \
00069     DEF( MediaPlayerSeekableChanged ), \
00070     DEF( MediaPlayerPausableChanged ), \
00071     \
00072     DEF( MediaListItemAdded ), \
00073     DEF( MediaListWillAddItem ), \
00074     DEF( MediaListItemDeleted ), \
00075     DEF( MediaListWillDeleteItem ), \
00076     \
00077     DEF( MediaListViewItemAdded ), \
00078     DEF( MediaListViewWillAddItem ), \
00079     DEF( MediaListViewItemDeleted ), \
00080     DEF( MediaListViewWillDeleteItem ), \
00081     \
00082     DEF( MediaListPlayerPlayed ), \
00083     DEF( MediaListPlayerNextItemSet ), \
00084     DEF( MediaListPlayerStopped ), \
00085     \
00086     DEF( MediaDiscovererStarted ), \
00087     DEF( MediaDiscovererEnded ), \
00088     \
00089     DEF( MediaPlayerTitleChanged ), \
00090     DEF( MediaPlayerSnapshotTaken ), \
00091     DEF( MediaPlayerLengthChanged ), \
00092     \
00093     DEF( VlmMediaAdded ), \
00094     DEF( VlmMediaRemoved ), \
00095     DEF( VlmMediaChanged ), \
00096     DEF( VlmMediaInstanceStarted ), \
00097     DEF( VlmMediaInstanceStopped ), \
00098     DEF( VlmMediaInstanceStatusInit ), \
00099     DEF( VlmMediaInstanceStatusOpening ), \
00100     DEF( VlmMediaInstanceStatusPlaying ), \
00101     DEF( VlmMediaInstanceStatusPause ), \
00102     DEF( VlmMediaInstanceStatusEnd ), \
00103     DEF( VlmMediaInstanceStatusError ), \
00104     /* New event types HERE */
00105 
00106 #ifdef __cplusplus
00107 enum libvlc_event_type_e {
00108 #else
00109 enum libvlc_event_type_t {
00110 #endif
00111 #define DEF(a) libvlc_##a
00112     DEFINE_LIBVLC_EVENT_TYPES
00113     libvlc_num_event_types
00114 #undef  DEF
00115 };
00116 
00117 /* Implementing libvlc_event_type_name() needs the definition too. */
00118 #ifndef LIBVLC_EVENT_TYPES_KEEP_DEFINE
00119 #undef  DEFINE_LIBVLC_EVENT_TYPES
00120 #endif
00121 
00122 /**
00123  * An Event
00124  * \param type the even type
00125  * \param p_obj the sender object
00126  * \param u Event dependent content
00127  */
00128 
00129 struct libvlc_event_t
00130 {
00131     libvlc_event_type_t type;
00132     void * p_obj;
00133     union event_type_specific
00134     {
00135         /* media descriptor */
00136         struct
00137         {
00138             libvlc_meta_t meta_type;
00139         } media_meta_changed;
00140         struct
00141         {
00142             libvlc_media_t * new_child;
00143         } media_subitem_added;
00144         struct
00145         {
00146             int64_t new_duration;
00147         } media_duration_changed;
00148         struct
00149         {
00150             int new_status;
00151         } media_preparsed_changed;
00152         struct
00153         {
00154             libvlc_media_t * md;
00155         } media_freed;
00156         struct
00157         {
00158             libvlc_state_t new_state;
00159         } media_state_changed;
00160 
00161         /* media instance */
00162         struct
00163         {
00164             float new_position;
00165         } media_player_position_changed;
00166         struct
00167         {
00168             libvlc_time_t new_time;
00169         } media_player_time_changed;
00170         struct
00171         {
00172             int new_title;
00173         } media_player_title_changed;
00174         struct
00175         {
00176             int new_seekable;
00177         } media_player_seekable_changed;
00178         struct
00179         {
00180             int new_pausable;
00181         } media_player_pausable_changed;
00182 
00183         /* media list */
00184         struct
00185         {
00186             libvlc_media_t * item;
00187             int index;
00188         } media_list_item_added;
00189         struct
00190         {
00191             libvlc_media_t * item;
00192             int index;
00193         } media_list_will_add_item;
00194         struct
00195         {
00196             libvlc_media_t * item;
00197             int index;
00198         } media_list_item_deleted;
00199         struct
00200         {
00201             libvlc_media_t * item;
00202             int index;
00203         } media_list_will_delete_item;
00204 
00205         /* media list view */
00206         struct
00207         {
00208             libvlc_media_t * item;
00209             int index;
00210         } media_list_view_item_added;
00211         struct
00212         {
00213             libvlc_media_t * item;
00214             int index;
00215         } media_list_view_will_add_item;
00216         struct
00217         {
00218             libvlc_media_t * item;
00219             int index;
00220         } media_list_view_item_deleted;
00221         struct
00222         {
00223             libvlc_media_t * item;
00224             int index;
00225         } media_list_view_will_delete_item;
00226 
00227         /* media list player */
00228         struct
00229         {
00230             libvlc_media_t * item;
00231         } media_list_player_next_item_set;
00232 
00233         /* snapshot taken */
00234         struct
00235         {
00236              char* psz_filename ;
00237         } media_player_snapshot_taken ;
00238 
00239         /* Length changed */
00240         struct
00241         {
00242             libvlc_time_t   new_length;
00243         } media_player_length_changed;
00244 
00245         /* VLM media */
00246         struct
00247         {
00248             const char * psz_media_name;
00249             const char * psz_instance_name;
00250         } vlm_media_event;
00251     } u;
00252 };
00253 
00254 
00255 /**@} */
00256 
00257 # ifdef __cplusplus
00258 }
00259 # endif
00260 
00261 #endif /* _LIBVLC_EVENTS_H */

Generated on Sat Nov 21 08:05:13 2009 for VLC by  doxygen 1.5.6