]> git.sesse.net Git - vlc/blob - include/vlc/libvlc_events.h
upnp: change item b_net and i_type
[vlc] / include / vlc / libvlc_events.h
1 /*****************************************************************************
2  * libvlc_events.h:  libvlc_events external API structure
3  *****************************************************************************
4  * Copyright (C) 1998-2010 VLC authors and VideoLAN
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 it
11  * under the terms of the GNU Lesser General Public License as published by
12  * the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * along with this program; if not, write to the Free Software Foundation,
22  * Inc., 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 lib/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     libvlc_MediaSubItemTreeAdded,
56
57     libvlc_MediaPlayerMediaChanged=0x100,
58     libvlc_MediaPlayerNothingSpecial,
59     libvlc_MediaPlayerOpening,
60     libvlc_MediaPlayerBuffering,
61     libvlc_MediaPlayerPlaying,
62     libvlc_MediaPlayerPaused,
63     libvlc_MediaPlayerStopped,
64     libvlc_MediaPlayerForward,
65     libvlc_MediaPlayerBackward,
66     libvlc_MediaPlayerEndReached,
67     libvlc_MediaPlayerEncounteredError,
68     libvlc_MediaPlayerTimeChanged,
69     libvlc_MediaPlayerPositionChanged,
70     libvlc_MediaPlayerSeekableChanged,
71     libvlc_MediaPlayerPausableChanged,
72     libvlc_MediaPlayerTitleChanged,
73     libvlc_MediaPlayerSnapshotTaken,
74     libvlc_MediaPlayerLengthChanged,
75     libvlc_MediaPlayerVout,
76     libvlc_MediaPlayerScrambledChanged,
77     libvlc_MediaPlayerESAdded,
78     libvlc_MediaPlayerESDeleted,
79     libvlc_MediaPlayerESSelected,
80
81     libvlc_MediaListItemAdded=0x200,
82     libvlc_MediaListWillAddItem,
83     libvlc_MediaListItemDeleted,
84     libvlc_MediaListWillDeleteItem,
85     libvlc_MediaListEndReached,
86
87     libvlc_MediaListViewItemAdded=0x300,
88     libvlc_MediaListViewWillAddItem,
89     libvlc_MediaListViewItemDeleted,
90     libvlc_MediaListViewWillDeleteItem,
91
92     libvlc_MediaListPlayerPlayed=0x400,
93     libvlc_MediaListPlayerNextItemSet,
94     libvlc_MediaListPlayerStopped,
95
96     libvlc_MediaDiscovererStarted=0x500,
97     libvlc_MediaDiscovererEnded,
98
99     libvlc_VlmMediaAdded=0x600,
100     libvlc_VlmMediaRemoved,
101     libvlc_VlmMediaChanged,
102     libvlc_VlmMediaInstanceStarted,
103     libvlc_VlmMediaInstanceStopped,
104     libvlc_VlmMediaInstanceStatusInit,
105     libvlc_VlmMediaInstanceStatusOpening,
106     libvlc_VlmMediaInstanceStatusPlaying,
107     libvlc_VlmMediaInstanceStatusPause,
108     libvlc_VlmMediaInstanceStatusEnd,
109     libvlc_VlmMediaInstanceStatusError
110 };
111
112 /**
113  * A LibVLC event
114  */
115 typedef struct libvlc_event_t
116 {
117     int   type; /**< Event type (see @ref libvlc_event_e) */
118     void *p_obj; /**< Object emitting the event */
119     union
120     {
121         /* media descriptor */
122         struct
123         {
124             libvlc_meta_t meta_type;
125         } media_meta_changed;
126         struct
127         {
128             libvlc_media_t * new_child;
129         } media_subitem_added;
130         struct
131         {
132             int64_t new_duration;
133         } media_duration_changed;
134         struct
135         {
136             int new_status;
137         } media_parsed_changed;
138         struct
139         {
140             libvlc_media_t * md;
141         } media_freed;
142         struct
143         {
144             libvlc_state_t new_state;
145         } media_state_changed;
146         struct
147         {
148             libvlc_media_t * item;
149         } media_subitemtree_added;
150
151         /* media instance */
152         struct
153         {
154             float new_cache;
155         } media_player_buffering;
156         struct
157         {
158             float new_position;
159         } media_player_position_changed;
160         struct
161         {
162             libvlc_time_t new_time;
163         } media_player_time_changed;
164         struct
165         {
166             int new_title;
167         } media_player_title_changed;
168         struct
169         {
170             int new_seekable;
171         } media_player_seekable_changed;
172         struct
173         {
174             int new_pausable;
175         } media_player_pausable_changed;
176         struct
177         {
178             int new_scrambled;
179         } media_player_scrambled_changed;
180         struct
181         {
182             int new_count;
183         } media_player_vout;
184
185         /* media list */
186         struct
187         {
188             libvlc_media_t * item;
189             int index;
190         } media_list_item_added;
191         struct
192         {
193             libvlc_media_t * item;
194             int index;
195         } media_list_will_add_item;
196         struct
197         {
198             libvlc_media_t * item;
199             int index;
200         } media_list_item_deleted;
201         struct
202         {
203             libvlc_media_t * item;
204             int index;
205         } media_list_will_delete_item;
206
207         /* media list player */
208         struct
209         {
210             libvlc_media_t * item;
211         } media_list_player_next_item_set;
212
213         /* snapshot taken */
214         struct
215         {
216              char* psz_filename ;
217         } media_player_snapshot_taken ;
218
219         /* Length changed */
220         struct
221         {
222             libvlc_time_t   new_length;
223         } media_player_length_changed;
224
225         /* VLM media */
226         struct
227         {
228             const char * psz_media_name;
229             const char * psz_instance_name;
230         } vlm_media_event;
231
232         /* Extra MediaPlayer */
233         struct
234         {
235             libvlc_media_t * new_media;
236         } media_player_media_changed;
237
238         struct
239         {
240             libvlc_track_type_t i_type;
241             int                 i_id;
242         } media_player_es_changed;
243     } u; /**< Type-dependent event description */
244 } libvlc_event_t;
245
246
247 /**@} */
248
249 # ifdef __cplusplus
250 }
251 # endif
252
253 #endif /* _LIBVLC_EVENTS_H */