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-2010 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  * \ingroup libvlc_event
00039  * @{
00040  */
00041 
00042 /**
00043  * Event types
00044  */
00045 enum libvlc_event_e {
00046     /* Append new event types at the end of a category.
00047      * Do not remove, insert or re-order any entry.
00048      * Keep this in sync with src/control/event.c:libvlc_event_type_name(). */
00049     libvlc_MediaMetaChanged=0,
00050     libvlc_MediaSubItemAdded,
00051     libvlc_MediaDurationChanged,
00052     libvlc_MediaParsedChanged,
00053     libvlc_MediaFreed,
00054     libvlc_MediaStateChanged,
00055 
00056     libvlc_MediaPlayerMediaChanged=0x100,
00057     libvlc_MediaPlayerNothingSpecial,
00058     libvlc_MediaPlayerOpening,
00059     libvlc_MediaPlayerBuffering,
00060     libvlc_MediaPlayerPlaying,
00061     libvlc_MediaPlayerPaused,
00062     libvlc_MediaPlayerStopped,
00063     libvlc_MediaPlayerForward,
00064     libvlc_MediaPlayerBackward,
00065     libvlc_MediaPlayerEndReached,
00066     libvlc_MediaPlayerEncounteredError,
00067     libvlc_MediaPlayerTimeChanged,
00068     libvlc_MediaPlayerPositionChanged,
00069     libvlc_MediaPlayerSeekableChanged,
00070     libvlc_MediaPlayerPausableChanged,
00071     libvlc_MediaPlayerTitleChanged,
00072     libvlc_MediaPlayerSnapshotTaken,
00073     libvlc_MediaPlayerLengthChanged,
00074 
00075     libvlc_MediaListItemAdded=0x200,
00076     libvlc_MediaListWillAddItem,
00077     libvlc_MediaListItemDeleted,
00078     libvlc_MediaListWillDeleteItem,
00079 
00080     libvlc_MediaListViewItemAdded=0x300,
00081     libvlc_MediaListViewWillAddItem,
00082     libvlc_MediaListViewItemDeleted,
00083     libvlc_MediaListViewWillDeleteItem,
00084 
00085     libvlc_MediaListPlayerPlayed=0x400,
00086     libvlc_MediaListPlayerNextItemSet,
00087     libvlc_MediaListPlayerStopped,
00088 
00089     libvlc_MediaDiscovererStarted=0x500,
00090     libvlc_MediaDiscovererEnded,
00091 
00092     libvlc_VlmMediaAdded=0x600,
00093     libvlc_VlmMediaRemoved,
00094     libvlc_VlmMediaChanged,
00095     libvlc_VlmMediaInstanceStarted,
00096     libvlc_VlmMediaInstanceStopped,
00097     libvlc_VlmMediaInstanceStatusInit,
00098     libvlc_VlmMediaInstanceStatusOpening,
00099     libvlc_VlmMediaInstanceStatusPlaying,
00100     libvlc_VlmMediaInstanceStatusPause,
00101     libvlc_VlmMediaInstanceStatusEnd,
00102     libvlc_VlmMediaInstanceStatusError,
00103 };
00104 
00105 /**
00106  * A LibVLC event
00107  */
00108 typedef struct libvlc_event_t
00109 {
00110     int   type; /**< Event type (see @ref libvlc_event_e) */
00111     void *p_obj; /**< Object emitting the event */
00112     union
00113     {
00114         /* media descriptor */
00115         struct
00116         {
00117             libvlc_meta_t meta_type;
00118         } media_meta_changed;
00119         struct
00120         {
00121             libvlc_media_t * new_child;
00122         } media_subitem_added;
00123         struct
00124         {
00125             int64_t new_duration;
00126         } media_duration_changed;
00127         struct
00128         {
00129             int new_status;
00130         } media_parsed_changed;
00131         struct
00132         {
00133             libvlc_media_t * md;
00134         } media_freed;
00135         struct
00136         {
00137             libvlc_state_t new_state;
00138         } media_state_changed;
00139 
00140         /* media instance */
00141         struct
00142         {
00143             float new_position;
00144         } media_player_position_changed;
00145         struct
00146         {
00147             libvlc_time_t new_time;
00148         } media_player_time_changed;
00149         struct
00150         {
00151             int new_title;
00152         } media_player_title_changed;
00153         struct
00154         {
00155             int new_seekable;
00156         } media_player_seekable_changed;
00157         struct
00158         {
00159             int new_pausable;
00160         } media_player_pausable_changed;
00161 
00162         /* media list */
00163         struct
00164         {
00165             libvlc_media_t * item;
00166             int index;
00167         } media_list_item_added;
00168         struct
00169         {
00170             libvlc_media_t * item;
00171             int index;
00172         } media_list_will_add_item;
00173         struct
00174         {
00175             libvlc_media_t * item;
00176             int index;
00177         } media_list_item_deleted;
00178         struct
00179         {
00180             libvlc_media_t * item;
00181             int index;
00182         } media_list_will_delete_item;
00183 
00184         /* media list player */
00185         struct
00186         {
00187             libvlc_media_t * item;
00188         } media_list_player_next_item_set;
00189 
00190         /* snapshot taken */
00191         struct
00192         {
00193              char* psz_filename ;
00194         } media_player_snapshot_taken ;
00195 
00196         /* Length changed */
00197         struct
00198         {
00199             libvlc_time_t   new_length;
00200         } media_player_length_changed;
00201 
00202         /* VLM media */
00203         struct
00204         {
00205             const char * psz_media_name;
00206             const char * psz_instance_name;
00207         } vlm_media_event;
00208 
00209         /* Extra MediaPlayer */
00210         struct
00211         {
00212             libvlc_media_t * new_media;
00213         } media_player_media_changed;
00214     } u; /**< Type-dependent event description */
00215 } libvlc_event_t;
00216 
00217 
00218 /**@} */
00219 
00220 # ifdef __cplusplus
00221 }
00222 # endif
00223 
00224 #endif /* _LIBVLC_EVENTS_H */

Generated on Mon Nov 22 07:55:19 2010 for VLC by  doxygen 1.5.6