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 VLC authors and VideoLAN
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 it
00011  * under the terms of the GNU Lesser General Public License as published by
00012  * the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU Lesser General Public License
00021  * along with this program; if not, write to the Free Software Foundation,
00022  * 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 /**
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 lib/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     libvlc_MediaPlayerVout,
00075 
00076     libvlc_MediaListItemAdded=0x200,
00077     libvlc_MediaListWillAddItem,
00078     libvlc_MediaListItemDeleted,
00079     libvlc_MediaListWillDeleteItem,
00080 
00081     libvlc_MediaListViewItemAdded=0x300,
00082     libvlc_MediaListViewWillAddItem,
00083     libvlc_MediaListViewItemDeleted,
00084     libvlc_MediaListViewWillDeleteItem,
00085 
00086     libvlc_MediaListPlayerPlayed=0x400,
00087     libvlc_MediaListPlayerNextItemSet,
00088     libvlc_MediaListPlayerStopped,
00089 
00090     libvlc_MediaDiscovererStarted=0x500,
00091     libvlc_MediaDiscovererEnded,
00092 
00093     libvlc_VlmMediaAdded=0x600,
00094     libvlc_VlmMediaRemoved,
00095     libvlc_VlmMediaChanged,
00096     libvlc_VlmMediaInstanceStarted,
00097     libvlc_VlmMediaInstanceStopped,
00098     libvlc_VlmMediaInstanceStatusInit,
00099     libvlc_VlmMediaInstanceStatusOpening,
00100     libvlc_VlmMediaInstanceStatusPlaying,
00101     libvlc_VlmMediaInstanceStatusPause,
00102     libvlc_VlmMediaInstanceStatusEnd,
00103     libvlc_VlmMediaInstanceStatusError
00104 };
00105 
00106 /**
00107  * A LibVLC event
00108  */
00109 typedef struct libvlc_event_t
00110 {
00111     int   type; /**< Event type (see @ref libvlc_event_e) */
00112     void *p_obj; /**< Object emitting the event */
00113     union
00114     {
00115         /* media descriptor */
00116         struct
00117         {
00118             libvlc_meta_t meta_type;
00119         } media_meta_changed;
00120         struct
00121         {
00122             libvlc_media_t * new_child;
00123         } media_subitem_added;
00124         struct
00125         {
00126             int64_t new_duration;
00127         } media_duration_changed;
00128         struct
00129         {
00130             int new_status;
00131         } media_parsed_changed;
00132         struct
00133         {
00134             libvlc_media_t * md;
00135         } media_freed;
00136         struct
00137         {
00138             libvlc_state_t new_state;
00139         } media_state_changed;
00140 
00141         /* media instance */
00142         struct
00143         {
00144             float new_cache;
00145         } media_player_buffering;
00146         struct
00147         {
00148             float new_position;
00149         } media_player_position_changed;
00150         struct
00151         {
00152             libvlc_time_t new_time;
00153         } media_player_time_changed;
00154         struct
00155         {
00156             int new_title;
00157         } media_player_title_changed;
00158         struct
00159         {
00160             int new_seekable;
00161         } media_player_seekable_changed;
00162         struct
00163         {
00164             int new_pausable;
00165         } media_player_pausable_changed;
00166         struct
00167         {
00168             int new_count;
00169         } media_player_vout;
00170 
00171         /* media list */
00172         struct
00173         {
00174             libvlc_media_t * item;
00175             int index;
00176         } media_list_item_added;
00177         struct
00178         {
00179             libvlc_media_t * item;
00180             int index;
00181         } media_list_will_add_item;
00182         struct
00183         {
00184             libvlc_media_t * item;
00185             int index;
00186         } media_list_item_deleted;
00187         struct
00188         {
00189             libvlc_media_t * item;
00190             int index;
00191         } media_list_will_delete_item;
00192 
00193         /* media list player */
00194         struct
00195         {
00196             libvlc_media_t * item;
00197         } media_list_player_next_item_set;
00198 
00199         /* snapshot taken */
00200         struct
00201         {
00202              char* psz_filename ;
00203         } media_player_snapshot_taken ;
00204 
00205         /* Length changed */
00206         struct
00207         {
00208             libvlc_time_t   new_length;
00209         } media_player_length_changed;
00210 
00211         /* VLM media */
00212         struct
00213         {
00214             const char * psz_media_name;
00215             const char * psz_instance_name;
00216         } vlm_media_event;
00217 
00218         /* Extra MediaPlayer */
00219         struct
00220         {
00221             libvlc_media_t * new_media;
00222         } media_player_media_changed;
00223     } u; /**< Type-dependent event description */
00224 } libvlc_event_t;
00225 
00226 
00227 /**@} */
00228 
00229 # ifdef __cplusplus
00230 }
00231 # endif
00232 
00233 #endif /* _LIBVLC_EVENTS_H */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines