]> git.sesse.net Git - vlc/blob - include/vlc/libvlc_events.h
Update the lua README.
[vlc] / include / vlc / libvlc_events.h
1 /*****************************************************************************
2  * libvlc_events.h:  libvlc_events external API structure
3  *****************************************************************************
4  * Copyright (C) 1998-2010 the VideoLAN team
5  * $Id $
6  *
7  * Authors: Filippo Carone <littlejohn@videolan.org>
8  *          Pierre d'Herbemont <pdherbemont@videolan.org>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License along
21  * with this program; if not, write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23  *****************************************************************************/
24
25 #ifndef LIBVLC_EVENTS_H
26 #define LIBVLC_EVENTS_H 1
27
28 /**
29  * \file
30  * This file defines libvlc_event external API
31  */
32
33 # ifdef __cplusplus
34 extern "C" {
35 # endif
36
37 /**
38  * \ingroup libvlc_event
39  * @{
40  */
41
42 /**
43  * Event types
44  */
45 enum libvlc_event_e {
46     /* Append new event types at the end of a category.
47      * Do not remove, insert or re-order any entry.
48      * Keep this in sync with src/control/event.c:libvlc_event_type_name(). */
49     libvlc_MediaMetaChanged=0,
50     libvlc_MediaSubItemAdded,
51     libvlc_MediaDurationChanged,
52     libvlc_MediaParsedChanged,
53     libvlc_MediaFreed,
54     libvlc_MediaStateChanged,
55
56     libvlc_MediaPlayerMediaChanged=0x100,
57     libvlc_MediaPlayerNothingSpecial,
58     libvlc_MediaPlayerOpening,
59     libvlc_MediaPlayerBuffering,
60     libvlc_MediaPlayerPlaying,
61     libvlc_MediaPlayerPaused,
62     libvlc_MediaPlayerStopped,
63     libvlc_MediaPlayerForward,
64     libvlc_MediaPlayerBackward,
65     libvlc_MediaPlayerEndReached,
66     libvlc_MediaPlayerEncounteredError,
67     libvlc_MediaPlayerTimeChanged,
68     libvlc_MediaPlayerPositionChanged,
69     libvlc_MediaPlayerSeekableChanged,
70     libvlc_MediaPlayerPausableChanged,
71     libvlc_MediaPlayerTitleChanged,
72     libvlc_MediaPlayerSnapshotTaken,
73     libvlc_MediaPlayerLengthChanged,
74
75     libvlc_MediaListItemAdded=0x200,
76     libvlc_MediaListWillAddItem,
77     libvlc_MediaListItemDeleted,
78     libvlc_MediaListWillDeleteItem,
79
80     libvlc_MediaListViewItemAdded=0x300,
81     libvlc_MediaListViewWillAddItem,
82     libvlc_MediaListViewItemDeleted,
83     libvlc_MediaListViewWillDeleteItem,
84
85     libvlc_MediaListPlayerPlayed=0x400,
86     libvlc_MediaListPlayerNextItemSet,
87     libvlc_MediaListPlayerStopped,
88
89     libvlc_MediaDiscovererStarted=0x500,
90     libvlc_MediaDiscovererEnded,
91
92     libvlc_VlmMediaAdded=0x600,
93     libvlc_VlmMediaRemoved,
94     libvlc_VlmMediaChanged,
95     libvlc_VlmMediaInstanceStarted,
96     libvlc_VlmMediaInstanceStopped,
97     libvlc_VlmMediaInstanceStatusInit,
98     libvlc_VlmMediaInstanceStatusOpening,
99     libvlc_VlmMediaInstanceStatusPlaying,
100     libvlc_VlmMediaInstanceStatusPause,
101     libvlc_VlmMediaInstanceStatusEnd,
102     libvlc_VlmMediaInstanceStatusError,
103 };
104
105 /**
106  * A LibVLC event
107  */
108 typedef struct libvlc_event_t
109 {
110     int   type; /**< Event type (see @ref libvlc_event_e) */
111     void *p_obj; /**< Object emitting the event */
112     union
113     {
114         /* media descriptor */
115         struct
116         {
117             libvlc_meta_t meta_type;
118         } media_meta_changed;
119         struct
120         {
121             libvlc_media_t * new_child;
122         } media_subitem_added;
123         struct
124         {
125             int64_t new_duration;
126         } media_duration_changed;
127         struct
128         {
129             int new_status;
130         } media_parsed_changed;
131         struct
132         {
133             libvlc_media_t * md;
134         } media_freed;
135         struct
136         {
137             libvlc_state_t new_state;
138         } media_state_changed;
139
140         /* media instance */
141         struct
142         {
143             float new_position;
144         } media_player_position_changed;
145         struct
146         {
147             libvlc_time_t new_time;
148         } media_player_time_changed;
149         struct
150         {
151             int new_title;
152         } media_player_title_changed;
153         struct
154         {
155             int new_seekable;
156         } media_player_seekable_changed;
157         struct
158         {
159             int new_pausable;
160         } media_player_pausable_changed;
161
162         /* media list */
163         struct
164         {
165             libvlc_media_t * item;
166             int index;
167         } media_list_item_added;
168         struct
169         {
170             libvlc_media_t * item;
171             int index;
172         } media_list_will_add_item;
173         struct
174         {
175             libvlc_media_t * item;
176             int index;
177         } media_list_item_deleted;
178         struct
179         {
180             libvlc_media_t * item;
181             int index;
182         } media_list_will_delete_item;
183
184         /* media list player */
185         struct
186         {
187             libvlc_media_t * item;
188         } media_list_player_next_item_set;
189
190         /* snapshot taken */
191         struct
192         {
193              char* psz_filename ;
194         } media_player_snapshot_taken ;
195
196         /* Length changed */
197         struct
198         {
199             libvlc_time_t   new_length;
200         } media_player_length_changed;
201
202         /* VLM media */
203         struct
204         {
205             const char * psz_media_name;
206             const char * psz_instance_name;
207         } vlm_media_event;
208
209         /* Extra MediaPlayer */
210         struct
211         {
212             libvlc_media_t * new_media;
213         } media_player_media_changed;
214     } u; /**< Type-dependent event description */
215 } libvlc_event_t;
216
217
218 /**@} */
219
220 # ifdef __cplusplus
221 }
222 # endif
223
224 #endif /* _LIBVLC_EVENTS_H */