libvlc_events.h
上传用户:kjfoods
上传日期:2020-07-06
资源大小:29949k
文件大小:6k
源码类别:

midi

开发平台:

Unix_Linux

  1. /*****************************************************************************
  2.  * libvlc_events.h:  libvlc_events external API structure
  3.  *****************************************************************************
  4.  * Copyright (C) 1998-2008 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
  21.  * along with this program; if not, write to the Free Software
  22.  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  23.  *****************************************************************************/
  24. #ifndef LIBVLC_EVENTS_H
  25. #define LIBVLC_EVENTS_H 1
  26. /**
  27.  * file
  28.  * This file defines libvlc_event external API
  29.  */
  30. # ifdef __cplusplus
  31. extern "C" {
  32. # endif
  33. /*****************************************************************************
  34.  * Events handling
  35.  *****************************************************************************/
  36. /** defgroup libvlc_event libvlc_event
  37.  * ingroup libvlc_core
  38.  * LibVLC Available Events
  39.  * @{
  40.  */
  41. #ifdef __cplusplus
  42. enum libvlc_event_type_e {
  43. #else
  44. enum libvlc_event_type_t {
  45. #endif
  46.     /* Append new event types at the end.
  47.      * Do not remove, insert or re-order any entry. */
  48.     libvlc_MediaMetaChanged,
  49.     libvlc_MediaSubItemAdded,
  50.     libvlc_MediaDurationChanged,
  51.     libvlc_MediaPreparsedChanged,
  52.     libvlc_MediaFreed,
  53.     libvlc_MediaStateChanged,
  54.     libvlc_MediaPlayerNothingSpecial,
  55.     libvlc_MediaPlayerOpening,
  56.     libvlc_MediaPlayerBuffering,
  57.     libvlc_MediaPlayerPlaying,
  58.     libvlc_MediaPlayerPaused,
  59.     libvlc_MediaPlayerStopped,
  60.     libvlc_MediaPlayerForward,
  61.     libvlc_MediaPlayerBackward,
  62.     libvlc_MediaPlayerEndReached,
  63.     libvlc_MediaPlayerEncounteredError,
  64.     libvlc_MediaPlayerTimeChanged,
  65.     libvlc_MediaPlayerPositionChanged,
  66.     libvlc_MediaPlayerSeekableChanged,
  67.     libvlc_MediaPlayerPausableChanged,
  68.     libvlc_MediaListItemAdded,
  69.     libvlc_MediaListWillAddItem,
  70.     libvlc_MediaListItemDeleted,
  71.     libvlc_MediaListWillDeleteItem,
  72.     libvlc_MediaListViewItemAdded,
  73.     libvlc_MediaListViewWillAddItem,
  74.     libvlc_MediaListViewItemDeleted,
  75.     libvlc_MediaListViewWillDeleteItem,
  76.     libvlc_MediaListPlayerPlayed,
  77.     libvlc_MediaListPlayerNextItemSet,
  78.     libvlc_MediaListPlayerStopped,
  79.     libvlc_MediaDiscovererStarted,
  80.     libvlc_MediaDiscovererEnded,
  81.     libvlc_MediaPlayerTitleChanged,
  82.     libvlc_MediaPlayerSnapshotTaken,
  83.     /* New event types HERE */
  84. };
  85. /**
  86.  * An Event
  87.  * param type the even type
  88.  * param p_obj the sender object
  89.  * param u Event dependent content
  90.  */
  91. struct libvlc_event_t
  92. {
  93.     libvlc_event_type_t type;
  94.     void * p_obj;
  95.     union event_type_specific
  96.     {
  97.         /* media descriptor */
  98.         struct
  99.         {
  100.             libvlc_meta_t meta_type;
  101.         } media_meta_changed;
  102.         struct
  103.         {
  104.             libvlc_media_t * new_child;
  105.         } media_subitem_added;
  106.         struct
  107.         {
  108.             int64_t new_duration;
  109.         } media_duration_changed;
  110.         struct
  111.         {
  112.             int new_status;
  113.         } media_preparsed_changed;
  114.         struct
  115.         {
  116.             libvlc_media_t * md;
  117.         } media_freed;
  118.         struct
  119.         {
  120.             libvlc_state_t new_state;
  121.         } media_state_changed;
  122.         /* media instance */
  123.         struct
  124.         {
  125.             float new_position;
  126.         } media_player_position_changed;
  127.         struct
  128.         {
  129.             libvlc_time_t new_time;
  130.         } media_player_time_changed;
  131.         struct
  132.         {
  133.             int new_title;
  134.         } media_player_title_changed;
  135.         struct
  136.         {
  137.             uint64_t new_seekable; /* FIXME: that's a boolean! */
  138.         } media_player_seekable_changed;
  139.         struct
  140.         {
  141.             uint64_t new_pausable; /* FIXME: that's a BOOL!!! */
  142.         } media_player_pausable_changed;
  143.         /* media list */
  144.         struct
  145.         {
  146.             libvlc_media_t * item;
  147.             int index;
  148.         } media_list_item_added;
  149.         struct
  150.         {
  151.             libvlc_media_t * item;
  152.             int index;
  153.         } media_list_will_add_item;
  154.         struct
  155.         {
  156.             libvlc_media_t * item;
  157.             int index;
  158.         } media_list_item_deleted;
  159.         struct
  160.         {
  161.             libvlc_media_t * item;
  162.             int index;
  163.         } media_list_will_delete_item;
  164.         /* media list view */
  165.         struct
  166.         {
  167.             libvlc_media_t * item;
  168.             int index;
  169.         } media_list_view_item_added;
  170.         struct
  171.         {
  172.             libvlc_media_t * item;
  173.             int index;
  174.         } media_list_view_will_add_item;
  175.         struct
  176.         {
  177.             libvlc_media_t * item;
  178.             int index;
  179.         } media_list_view_item_deleted;
  180.         struct
  181.         {
  182.             libvlc_media_t * item;
  183.             int index;
  184.         } media_list_view_will_delete_item;
  185.         /* snapshot taken */
  186.         struct
  187.         {
  188.              char* psz_filename ;
  189.         } media_player_snapshot_taken ;
  190.     } u;
  191. };
  192. /**@} */
  193. # ifdef __cplusplus
  194. }
  195. # endif
  196. #endif /* _LIBVLC_EVENTS_H */