1 /*****************************************************************************
2 * media.hpp: represent a media
3 *****************************************************************************
4 * Copyright (C) 2010 the VideoLAN team
7 * Authors: RĂ©mi Duraffort <ivoire@videolan.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 #ifndef LIBVLCPP_MEDIA_HPP
25 #define LIBVLCPP_MEDIA_HPP
27 #include <vlc/libvlc.h>
28 #include <vlc/libvlc_media.h>
42 * @param libvlcInstance: instance of the libVLC class
43 * @param psz_mrl: MRL of the media
45 Media( libVLC &libvlcInstance, const char *psz_mrl );
49 * @param original: the instance to copy
51 Media( const Media& original );
53 /** \todo: node contructor */
59 * Add an option to the media
60 * @param ppsz_options: the options as a string
62 void addOption( const char *ppsz_options );
65 * Add an option to the media
66 * @param ppsz_options: the options as a string
67 * @param flag: the flag for the options
69 void addOption( const char *ppsz_options, libvlc_media_option_t flag );
73 * Get the duration of the media
74 * @return the duration
79 * Get preparsed status of the media
80 * @return true if the media has been preparsed, false otherwise
85 * Get the MRL of the media
86 * @return the MRL of the media
91 * Get the requiered meta
92 * @param e_meta: type of the meta
93 * @return the requiered meta
95 char *meta( libvlc_meta_t e_meta );
99 * @param e_meta: type of the meta
100 * @param psz_value: value of the meta
102 void setMeta( libvlc_meta_t e_meta, const char *psz_value );
105 * Save the meta to the file
106 * @return true if the operation was successfull
111 * Get the state of the media
112 * @return the state of the media
114 libvlc_state_t state();
117 * Get some statistics about this media
118 * @return the statistics
120 libvlc_media_stats_t *stats();
122 /**\todo: subItems */
123 /**\todo: eventManager */
126 * Set media descriptor's user data
127 * @param p_user_data: pointer to user data
129 void setUserData( void *p_user_data );
132 * Retrive user data specified by a call to setUserData
133 * @return the user data pointer
139 * Get the instance of the libvlc_media_t
140 * @return the pointer to libvlc_media_t
142 libvlc_media_t *instance();
145 libvlc_media_t *m_media;
147 /** Friend class that can access the instance */
148 friend class MediaPlayer;
154 #endif // LIBVLCPP_MEDIA_HPP