]> git.sesse.net Git - vlc/commitdiff
Improve Doxygen documentation, deobfuscate event types
authorRémi Denis-Courmont <remi@remlab.net>
Sat, 20 Feb 2010 11:04:33 +0000 (13:04 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Sat, 20 Feb 2010 11:46:51 +0000 (13:46 +0200)
12 files changed:
include/vlc/deprecated.h
include/vlc/libvlc.h
include/vlc/libvlc_events.h
include/vlc/libvlc_media.h
include/vlc/libvlc_media_discoverer.h
include/vlc/libvlc_media_library.h
include/vlc/libvlc_media_list.h
include/vlc/libvlc_media_list_player.h
include/vlc/libvlc_media_player.h
include/vlc/libvlc_vlm.h
src/control/event.c
src/libvlc.sym

index 16406f34519b127243ec69751c938ec8ad692eef..216b1caba458403370a2aad252bcd63a6f5ca33d 100644 (file)
@@ -37,10 +37,9 @@ extern "C" {
 /*****************************************************************************
  * Playlist (Deprecated)
  *****************************************************************************/
-/** \defgroup libvlc_playlist libvlc_playlist (Deprecated)
+/** \defgroup libvlc_playlist LibVLC playlist (legacy)
  * \ingroup libvlc
- * LibVLC Playlist handling (Deprecated)
- * @deprecated Use media_list
+ * @deprecated Use @ref libvlc_media_list instead.
  * @{
  */
 
index 51bb78f4c2f55a3520b207caa0730891347a7a4e..4ccbfeb238d517e0652657f27fecf4339d394926 100644 (file)
@@ -29,9 +29,9 @@
  */
 
 /**
- * \defgroup libvlc libvlc
- * This is libvlc, the base library of the VLC program.
- *
+ * \defgroup libvlc LibVLC
+ * LibVLC is the external programming interface of the VLC media player.
+ * It is used to embed VLC into other applications or frameworks.
  * @{
  */
 
@@ -61,12 +61,19 @@ extern "C" {
 #include <stdarg.h>
 #include <vlc/libvlc_structures.h>
 
-/*****************************************************************************
- * Error handling
- *****************************************************************************/
-/** \defgroup libvlc_error libvlc_error
- * \ingroup libvlc_core
- * LibVLC error handling
+/** \defgroup libvlc_core LibVLC core
+ * \ingroup libvlc
+ * Before it can do anything useful, LibVLC must be initialized.
+ * You can create one (or more) instance(s) of LibVLC in a given process,
+ * with libvlc_new() and destroy them with libvlc_release().
+ *
+ * \version This documents LibVLC version 1.1.
+ * Earlier versions (0.9 and 1.0) are <b>not</b> compatible.
+ * @{
+ */
+
+/** \defgroup libvlc_error LibVLC error handling
+ * \ingroup libvlc_error
  * @{
  */
 
@@ -103,17 +110,6 @@ const char *libvlc_printerr (const char *fmt, ...);
 
 /**@} */
 
-
-/*****************************************************************************
- * Core handling
- *****************************************************************************/
-
-/** \defgroup libvlc_core libvlc_core
- * \ingroup libvlc
- * LibVLC Core
- * @{
- */
-
 /**
  * Create and initialize a libvlc instance.
  *
@@ -162,7 +158,7 @@ void libvlc_wait( libvlc_instance_t *p_instance );
 /**
  * Retrieve libvlc version.
  *
- * Example: "0.9.0-git Grishenko"
+ * Example: "1.1.0-git The Luggage"
  *
  * \return a string containing the libvlc version
  */
@@ -186,17 +182,15 @@ VLC_PUBLIC_API const char * libvlc_get_compiler(void);
  */
 VLC_PUBLIC_API const char * libvlc_get_changeset(void);
 
-struct vlc_object_t;
-
-/** @}*/
-
-/*****************************************************************************
- * Event handling
- *****************************************************************************/
 
-/** \defgroup libvlc_event libvlc_event
- * \ingroup libvlc_core
- * LibVLC Events
+/** \defgroup libvlc_event LibVLC asynchronous events
+ * LibVLC emits asynchronous events.
+ *
+ * Several LibVLC objects (such @ref libvlc_instance_t as
+ * @ref libvlc_media_player_t) generate events asynchronously. Each of them
+ * provides @ref libvlc_event_manager_t event manager. You can subscribe to
+ * events with libvlc_event_attach() and unsubscribe with
+ * libvlc_event_detach().
  * @{
  */
 
@@ -204,17 +198,20 @@ struct vlc_object_t;
  * Event manager that belongs to a libvlc object, and from whom events can
  * be received.
  */
-
 typedef struct libvlc_event_manager_t libvlc_event_manager_t;
-typedef struct libvlc_event_t libvlc_event_t;
-typedef uint32_t libvlc_event_type_t;
-    
+
+struct libvlc_event_t;
+
+/**
+ * Type of a LibVLC event.
+ */
+typedef int libvlc_event_type_t;
+
 /**
  * Callback function notification
  * \param p_event the event triggering the callback
  */
-
-typedef void ( *libvlc_callback_t )( const libvlc_event_t *, void * );
+typedef void ( *libvlc_callback_t )( const struct libvlc_event_t *, void * );
     
 /**
  * Register for an event notification.
@@ -245,22 +242,11 @@ VLC_PUBLIC_API void libvlc_event_detach( libvlc_event_manager_t *p_event_manager
                                          libvlc_callback_t f_callback,
                                          void *p_user_data );
 
-/**
- * Get an event's type name.
- *
- * \param event_type the desired event
- */
-VLC_PUBLIC_API const char * libvlc_event_type_name( libvlc_event_type_t event_type );
-
 /** @} */
 
-/*****************************************************************************
- * Message log handling
- *****************************************************************************/
-
-/** \defgroup libvlc_log libvlc_log
- * \ingroup libvlc_core
- * LibVLC Message Logging
+/** \defgroup libvlc_log LibVLC logging
+ * libvlc_log_* functions provide access to the LibVLC messages log.
+ * This is used for debugging or by advanced users.
  * @{
  */
 
@@ -349,11 +335,11 @@ VLC_PUBLIC_API libvlc_log_message_t *libvlc_log_iterator_next( libvlc_log_iterat
                                                                libvlc_log_message_t *p_buffer );
 
 /** @} */
+/** @} */
+/** @} */
 
 # ifdef __cplusplus
 }
 # endif
 
 #endif /* <vlc/libvlc.h> */
-
-/** @} */
index afb4064b99c3d7dee2c072f400d262f7639a17fa..02278e4e097a3f65a6264637530086937fc54817 100644 (file)
 extern "C" {
 # endif
 
-/*****************************************************************************
- * Events handling
- *****************************************************************************/
-
-/** \defgroup libvlc_event libvlc_event
- * \ingroup libvlc_core
- * LibVLC Available Events
+/**
+ * \ingroup libvlc_event
  * @{
  */
 
+/**
+ * Event types
+ */
+enum libvlc_event_e {
     /* Append new event types at the end. Do not remove, insert or
      * re-order any entry. The cpp will prepend libvlc_ to the symbols. */
-#define DEFINE_LIBVLC_EVENT_TYPES \
-    DEF( MediaMetaChanged ), \
-    DEF( MediaSubItemAdded ), \
-    DEF( MediaDurationChanged ), \
-    DEF( MediaPreparsedChanged ), \
-    DEF( MediaFreed ), \
-    DEF( MediaStateChanged ), \
-    \
-    DEF( MediaPlayerNothingSpecial ), \
-    DEF( MediaPlayerOpening ), \
-    DEF( MediaPlayerBuffering ), \
-    DEF( MediaPlayerPlaying ), \
-    DEF( MediaPlayerPaused ), \
-    DEF( MediaPlayerStopped ), \
-    DEF( MediaPlayerForward ), \
-    DEF( MediaPlayerBackward ), \
-    DEF( MediaPlayerEndReached ), \
-    DEF( MediaPlayerEncounteredError ), \
-    DEF( MediaPlayerTimeChanged ), \
-    DEF( MediaPlayerPositionChanged ), \
-    DEF( MediaPlayerSeekableChanged ), \
-    DEF( MediaPlayerPausableChanged ), \
-    \
-    DEF( MediaListItemAdded ), \
-    DEF( MediaListWillAddItem ), \
-    DEF( MediaListItemDeleted ), \
-    DEF( MediaListWillDeleteItem ), \
-    \
-    DEF( MediaListViewItemAdded ), \
-    DEF( MediaListViewWillAddItem ), \
-    DEF( MediaListViewItemDeleted ), \
-    DEF( MediaListViewWillDeleteItem ), \
-    \
-    DEF( MediaListPlayerPlayed ), \
-    DEF( MediaListPlayerNextItemSet ), \
-    DEF( MediaListPlayerStopped ), \
-    \
-    DEF( MediaDiscovererStarted ), \
-    DEF( MediaDiscovererEnded ), \
-    \
-    DEF( MediaPlayerTitleChanged ), \
-    DEF( MediaPlayerSnapshotTaken ), \
-    DEF( MediaPlayerLengthChanged ), \
-    \
-    DEF( VlmMediaAdded ), \
-    DEF( VlmMediaRemoved ), \
-    DEF( VlmMediaChanged ), \
-    DEF( VlmMediaInstanceStarted ), \
-    DEF( VlmMediaInstanceStopped ), \
-    DEF( VlmMediaInstanceStatusInit ), \
-    DEF( VlmMediaInstanceStatusOpening ), \
-    DEF( VlmMediaInstanceStatusPlaying ), \
-    DEF( VlmMediaInstanceStatusPause ), \
-    DEF( VlmMediaInstanceStatusEnd ), \
-    DEF( VlmMediaInstanceStatusError ), \
-    \
-    DEF( MediaPlayerMediaChanged ), \
-/* New event types HERE */
-
-#ifdef __cplusplus
-enum libvlc_event_type_e {
-#else
-enum libvlc_event_type_t {
-#endif
-#define DEF(a) libvlc_##a
-    DEFINE_LIBVLC_EVENT_TYPES
+    libvlc_MediaMetaChanged,
+    libvlc_MediaSubItemAdded,
+    libvlc_MediaDurationChanged,
+    libvlc_MediaPreparsedChanged,
+    libvlc_MediaFreed,
+    libvlc_MediaStateChanged,
+
+    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,
+
+    libvlc_MediaListItemAdded,
+    libvlc_MediaListWillAddItem,
+    libvlc_MediaListItemDeleted,
+    libvlc_MediaListWillDeleteItem,
+
+    libvlc_MediaListViewItemAdded,
+    libvlc_MediaListViewWillAddItem,
+    libvlc_MediaListViewItemDeleted,
+    libvlc_MediaListViewWillDeleteItem,
+
+    libvlc_MediaListPlayerPlayed,
+    libvlc_MediaListPlayerNextItemSet,
+    libvlc_MediaListPlayerStopped,
+
+    libvlc_MediaDiscovererStarted,
+    libvlc_MediaDiscovererEnded,
+
+    libvlc_MediaPlayerTitleChanged,
+    libvlc_MediaPlayerSnapshotTaken,
+    libvlc_MediaPlayerLengthChanged,
+
+    libvlc_VlmMediaAdded,
+    libvlc_VlmMediaRemoved,
+    libvlc_VlmMediaChanged,
+    libvlc_VlmMediaInstanceStarted,
+    libvlc_VlmMediaInstanceStopped,
+    libvlc_VlmMediaInstanceStatusInit,
+    libvlc_VlmMediaInstanceStatusOpening,
+    libvlc_VlmMediaInstanceStatusPlaying,
+    libvlc_VlmMediaInstanceStatusPause,
+    libvlc_VlmMediaInstanceStatusEnd,
+    libvlc_VlmMediaInstanceStatusError,
+
+    libvlc_MediaPlayerMediaChanged,
+    /* New event types HERE */
     libvlc_num_event_types
-#undef  DEF
 };
 
-/* Implementing libvlc_event_type_name() needs the definition too. */
-#ifndef LIBVLC_EVENT_TYPES_KEEP_DEFINE
-#undef  DEFINE_LIBVLC_EVENT_TYPES
-#endif
-
 /**
- * An Event
- * \param type the even type
- * \param p_obj the sender object
- * \param u Event dependent content
+ * A LibVLC event
  */
-
-struct libvlc_event_t
+typedef struct libvlc_event_t
 {
-    libvlc_event_type_t type;
-    void * p_obj;
-    union event_type_specific
+    int   type; /**< Event type (see @ref libvlc_event_e) */
+    void *p_obj; /**< Object emitting the event */
+    union
     {
         /* media descriptor */
         struct
@@ -234,8 +214,8 @@ struct libvlc_event_t
         {
             libvlc_media_t * new_media;
         } media_player_media_changed;
-    } u;
-};
+    } u; /**< Type-dependent event description */
+} libvlc_event_t;
 
 
 /**@} */
index a2222864c9c7ec6e6aff3a4e913a7ffd16502509..075a1c670f32db3c7bcd16080a1f0b7a37eb1cb5 100644 (file)
 extern "C" {
 # endif
 
-/*****************************************************************************
- * media
- *****************************************************************************/
-/** \defgroup libvlc_media libvlc_media
+/** \defgroup libvlc_media LibVLC media
  * \ingroup libvlc
- * LibVLC Media
+ * @ref libvlc_media_t is an abstract representation of a playable media.
+ * It consists of a media location and various optional meta data.
  * @{
  */
 
 typedef struct libvlc_media_t libvlc_media_t;
 
-/* Meta Handling */
-/** defgroup libvlc_meta libvlc_meta
+/** defgroup libvlc_meta LibVLC meta data
  * \ingroup libvlc_media
- * LibVLC Media Meta
  * @{
  */
 
+/** Meta data types */
 typedef enum libvlc_meta_t {
     libvlc_meta_Title,
     libvlc_meta_Artist,
@@ -111,9 +108,8 @@ typedef enum libvlc_es_type_t
     libvlc_es_text      = 2,
 } libvlc_es_type_t;
 
-/** defgroup libvlc_media_stats_t libvlc_media_stats_t
+/** defgroup libvlc_media_stats_t LibVLC media statistics
  * \ingroup libvlc_media
- * LibVLC Media statistics
  * @{
  */
 typedef struct libvlc_media_stats_t
index f6aee418cbd5f43cae4460f3b3f1ae047895b9fa..2552d6b39b311a3d35d72b7eebf0e180ff3d54aa 100644 (file)
 extern "C" {
 # endif
 
-/*****************************************************************************
- * Services/Media Discovery
- *****************************************************************************/
-/** \defgroup libvlc_media_discoverer libvlc_media_discoverer
+/** \defgroup libvlc_media_discoverer LibVLC media discovery
  * \ingroup libvlc
- * LibVLC Media Discoverer
+ * LibVLC media discovery finds available media via various means.
+ * This corresponds to the service discovery functionality in VLC media player.
+ * Different plugins find potential medias locally (e.g. user media directory),
+ * from peripherals (e.g. video capture device), on the local network
+ * (e.g. SAP) or on the Internet (e.g. Internet radios).
  * @{
  */
 
index 570f9a7c3850c2e56ab94e4e574bd24b6e91c9bb..76b5b161e6853479324ff23e86fa3b4a39f0036b 100644 (file)
 extern "C" {
 # endif
 
-/*****************************************************************************
- * Media Library
- *****************************************************************************/
-/** \defgroup libvlc_media_library libvlc_media_library
+/** \defgroup libvlc_media_library LibVLC media library
  * \ingroup libvlc
- * LibVLC Media Library
  * @{
  */
 
index 23cfeae13b1d5501a054d4b35151fe64b86b3f69..32304ee4304c2fb3272a922947123884a1f59f07 100644 (file)
 extern "C" {
 # endif
 
-/*****************************************************************************
- * Media List
- *****************************************************************************/
-/** \defgroup libvlc_media_list libvlc_media_list
+/** \defgroup libvlc_media_list LibVLC media list
  * \ingroup libvlc
- * LibVLC Media List, a media list holds multiple media descriptors
+ * A LibVLC media list holds multiple @ref libvlc_media_t media descriptors.
  * @{
  */
 
index e8d39aafdec02ef862ca9583ad89bc1a854baf40..3a1f913b6a538cef5d86e620744ff21ebb44803e 100644 (file)
@@ -36,10 +36,13 @@ extern "C" {
 /*****************************************************************************
  * Media List Player
  *****************************************************************************/
-/** \defgroup libvlc_media_list_player libvlc_media_list_player
+/** \defgroup libvlc_media_list_player LibVLC media list player
  * \ingroup libvlc
- * LibVLC Media List Player, play a media_list. You can see that as a media
- * instance subclass
+ * The LibVLC media list player plays a @ref libvlc_media_list_t list of media,
+ * in a certain order.
+ * This is required to especially support playlist files.
+ * The normal @ref libvlc_media_player_t LibVLC media player can only play a
+ * single media, and does not handle playlist files properly.
  * @{
  */
 
index 3ae78730317542e6f51a193582b807dfe5c1ba83..3bbb6b9b489e206a07ef4f2b6ad84e210ab68c68 100644 (file)
@@ -38,10 +38,9 @@ extern "C" {
 /*****************************************************************************
  * Media Player
  *****************************************************************************/
-/** \defgroup libvlc_media_player libvlc_media_player
+/** \defgroup libvlc_media_player LibVLC media player
  * \ingroup libvlc
- * LibVLC Media Player, object that let you play a media
- * in a custom drawable
+ * A LibVLC media player plays one media (usually in a custom drawable).
  * @{
  */
 
@@ -197,10 +196,12 @@ VLC_PUBLIC_API void libvlc_media_player_stop ( libvlc_media_player_t *p_mi );
  * The object minimal_macosx expects is of kind NSObject and should
  * respect the protocol:
  *
- * @protocol VLCOpenGLVideoViewEmbedding <NSObject>
+ * @begincode
+ * \@protocol VLCOpenGLVideoViewEmbedding <NSObject>
  * - (void)addVoutSubview:(NSView *)view;
  * - (void)removeVoutSubview:(NSView *)view;
- * @end
+ * \@end
+ * @endcode
  *
  * You can find a live example in VLCVideoView in VLCKit.framework.
  *
@@ -484,9 +485,7 @@ VLC_PUBLIC_API void libvlc_media_player_next_frame( libvlc_media_player_t *p_mi
  */
 VLC_PUBLIC_API void libvlc_track_description_release( libvlc_track_description_t *p_track_description );
 
-/** \defgroup libvlc_video libvlc_video
- * \ingroup libvlc_media_player
- * LibVLC Video handling
+/** \defgroup libvlc_video LibVLC video controls
  * @{
  */
 
@@ -909,9 +908,7 @@ VLC_PUBLIC_API void libvlc_video_set_logo_string( libvlc_media_player_t *p_mi,
 
 /** @} video */
 
-/** \defgroup libvlc_audio libvlc_audio
- * \ingroup libvlc_media_player
- * LibVLC Audio handling
+/** \defgroup libvlc_audio LibVLC audio controls
  * @{
  */
 
index 016d20745ca76f2d5dab4786d1bfb4a0108aaa85..f09dbe506ef2f21b2d894e9086d91e11672bf2b9 100644 (file)
@@ -37,9 +37,8 @@ extern "C" {
 /*****************************************************************************
  * VLM
  *****************************************************************************/
-/** \defgroup libvlc_vlm libvlc_vlm
+/** \defgroup libvlc_vlm LibVLC VLM
  * \ingroup libvlc
- * LibVLC VLM
  * @{
  */
 
index af3f043c9af2a3222734360daa49d4685494d88d..2fb9c35ca046a34ca9e9dbb1d7cab6e83f2221e6 100644 (file)
@@ -240,27 +240,6 @@ void libvlc_event_send( libvlc_event_manager_t * p_em,
  * Public libvlc functions
  */
 
-/**************************************************************************
- *       libvlc_event_type_name (public) :
- *
- * Get the char * name of an event type.
- **************************************************************************/
-static const char event_type_to_name[][libvlc_num_event_types] =
-{
-#define DEF(a) [libvlc_##a]=#a
-    DEFINE_LIBVLC_EVENT_TYPES
-#undef  DEF
-};
-
-static const char unknown_event_name[] = "Unknown Event";
-
-const char * libvlc_event_type_name( libvlc_event_type_t event_type )
-{
-    if( event_type >= libvlc_num_event_types )
-        return unknown_event_name;
-    return event_type_to_name[event_type];
-}
-
 /**************************************************************************
  *       event_attach (internal) :
  *
@@ -299,8 +278,7 @@ int event_attach( libvlc_event_manager_t * p_event_manager,
     vlc_mutex_unlock( &p_event_manager->object_lock );
     
     free(listener);
-    fprintf( stderr, "This object event manager doesn't know about '%s' events",
-             libvlc_event_type_name(event_type) );
+    fprintf( stderr, "Unknown event type %d", event_type );
     assert(0);
     return -1;
 }
index b38ec0175502da797971e9cb902c0850456a19bf..ac3a64d9af9af8e526d51133d0eccc2bb95163a0 100644 (file)
@@ -29,7 +29,6 @@ libvlc_event_manager_new
 libvlc_event_manager_register_event_type
 libvlc_event_manager_release
 libvlc_event_send
-libvlc_event_type_name
 libvlc_get_changeset
 libvlc_get_compiler
 libvlc_get_fullscreen