libvlc_events.h 6 KB
Newer Older
1 2 3
/*****************************************************************************
 * libvlc_events.h:  libvlc_events external API structure
 *****************************************************************************
Jean-Baptiste Kempf's avatar
LGPL  
Jean-Baptiste Kempf committed
4
 * Copyright (C) 1998-2010 VLC authors and VideoLAN
5 6 7 8 9
 * $Id $
 *
 * Authors: Filippo Carone <littlejohn@videolan.org>
 *          Pierre d'Herbemont <pdherbemont@videolan.org>
 *
Jean-Baptiste Kempf's avatar
LGPL  
Jean-Baptiste Kempf committed
10 11 12
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2.1 of the License, or
13 14 15 16
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Jean-Baptiste Kempf's avatar
LGPL  
Jean-Baptiste Kempf committed
17 18
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Lesser General Public License for more details.
19
 *
Jean-Baptiste Kempf's avatar
LGPL  
Jean-Baptiste Kempf committed
20 21 22
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23 24
 *****************************************************************************/

25 26
#ifndef LIBVLC_EVENTS_H
#define LIBVLC_EVENTS_H 1
27

28 29 30 31 32
/**
 * \file
 * This file defines libvlc_event external API
 */

33 34 35 36
# ifdef __cplusplus
extern "C" {
# endif

37 38
/**
 * \ingroup libvlc_event
39 40 41
 * @{
 */

42 43 44 45
/**
 * Event types
 */
enum libvlc_event_e {
46 47
    /* Append new event types at the end of a category.
     * 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 51
    libvlc_MediaSubItemAdded,
    libvlc_MediaDurationChanged,
52
    libvlc_MediaParsedChanged,
53 54 55
    libvlc_MediaFreed,
    libvlc_MediaStateChanged,

56
    libvlc_MediaPlayerMediaChanged=0x100,
57 58 59 60 61 62 63 64 65 66 67 68 69 70
    libvlc_MediaPlayerNothingSpecial,
    libvlc_MediaPlayerOpening,
    libvlc_MediaPlayerBuffering,
    libvlc_MediaPlayerPlaying,
    libvlc_MediaPlayerPaused,
    libvlc_MediaPlayerStopped,
    libvlc_MediaPlayerForward,
    libvlc_MediaPlayerBackward,
    libvlc_MediaPlayerEndReached,
    libvlc_MediaPlayerEncounteredError,
    libvlc_MediaPlayerTimeChanged,
    libvlc_MediaPlayerPositionChanged,
    libvlc_MediaPlayerSeekableChanged,
    libvlc_MediaPlayerPausableChanged,
71 72 73
    libvlc_MediaPlayerTitleChanged,
    libvlc_MediaPlayerSnapshotTaken,
    libvlc_MediaPlayerLengthChanged,
74
    libvlc_MediaPlayerVout,
75

76
    libvlc_MediaListItemAdded=0x200,
77 78 79 80
    libvlc_MediaListWillAddItem,
    libvlc_MediaListItemDeleted,
    libvlc_MediaListWillDeleteItem,

81
    libvlc_MediaListViewItemAdded=0x300,
82 83 84 85
    libvlc_MediaListViewWillAddItem,
    libvlc_MediaListViewItemDeleted,
    libvlc_MediaListViewWillDeleteItem,

86
    libvlc_MediaListPlayerPlayed=0x400,
87 88 89
    libvlc_MediaListPlayerNextItemSet,
    libvlc_MediaListPlayerStopped,

90
    libvlc_MediaDiscovererStarted=0x500,
91 92
    libvlc_MediaDiscovererEnded,

93
    libvlc_VlmMediaAdded=0x600,
94 95 96 97 98 99 100 101 102
    libvlc_VlmMediaRemoved,
    libvlc_VlmMediaChanged,
    libvlc_VlmMediaInstanceStarted,
    libvlc_VlmMediaInstanceStopped,
    libvlc_VlmMediaInstanceStatusInit,
    libvlc_VlmMediaInstanceStatusOpening,
    libvlc_VlmMediaInstanceStatusPlaying,
    libvlc_VlmMediaInstanceStatusPause,
    libvlc_VlmMediaInstanceStatusEnd,
103
    libvlc_VlmMediaInstanceStatusError
104
};
105 106

/**
107
 * A LibVLC event
108
 */
109
typedef struct libvlc_event_t
110
{
111 112 113
    int   type; /**< Event type (see @ref libvlc_event_e) */
    void *p_obj; /**< Object emitting the event */
    union
114 115 116 117
    {
        /* media descriptor */
        struct
        {
118
            libvlc_meta_t meta_type;
119
        } media_meta_changed;
120 121
        struct
        {
122 123
            libvlc_media_t * new_child;
        } media_subitem_added;
124 125
        struct
        {
126
            int64_t new_duration;
127
        } media_duration_changed;
128 129 130
        struct
        {
            int new_status;
131
        } media_parsed_changed;
132 133
        struct
        {
134 135
            libvlc_media_t * md;
        } media_freed;
136 137
        struct
        {
138
            libvlc_state_t new_state;
139
        } media_state_changed;
140 141 142

        /* media instance */
        struct
143 144 145 146
        {
            float new_cache;
        } media_player_buffering;
        struct
147 148
        {
            float new_position;
149
        } media_player_position_changed;
150 151 152
        struct
        {
            libvlc_time_t new_time;
153
        } media_player_time_changed;
154
        struct
155 156 157 158
        {
            int new_title;
        } media_player_title_changed;
        struct
159
        {
160
            int new_seekable;
161
        } media_player_seekable_changed;
162 163
        struct
        {
164
            int new_pausable;
165
        } media_player_pausable_changed;
166 167 168 169
        struct
        {
            int new_count;
        } media_player_vout;
170 171 172 173

        /* media list */
        struct
        {
174
            libvlc_media_t * item;
175 176 177 178
            int index;
        } media_list_item_added;
        struct
        {
179
            libvlc_media_t * item;
180 181 182 183
            int index;
        } media_list_will_add_item;
        struct
        {
184
            libvlc_media_t * item;
185 186 187 188
            int index;
        } media_list_item_deleted;
        struct
        {
189
            libvlc_media_t * item;
190 191 192
            int index;
        } media_list_will_delete_item;

193 194 195 196 197
        /* media list player */
        struct
        {
            libvlc_media_t * item;
        } media_list_player_next_item_set;
198

199 200 201 202 203 204
        /* snapshot taken */
        struct
        {
             char* psz_filename ;
        } media_player_snapshot_taken ;

205 206 207 208 209
        /* Length changed */
        struct
        {
            libvlc_time_t   new_length;
        } media_player_length_changed;
sebastien's avatar
sebastien committed
210 211 212 213 214

        /* VLM media */
        struct
        {
            const char * psz_media_name;
sebastien's avatar
sebastien committed
215
            const char * psz_instance_name;
sebastien's avatar
sebastien committed
216
        } vlm_media_event;
217 218 219 220 221 222

        /* Extra MediaPlayer */
        struct
        {
            libvlc_media_t * new_media;
        } media_player_media_changed;
223 224
    } u; /**< Type-dependent event description */
} libvlc_event_t;
225 226 227 228 229 230 231 232 233


/**@} */

# ifdef __cplusplus
}
# endif

#endif /* _LIBVLC_EVENTS_H */