1 /*****************************************************************************
2 * media_player.hpp: Media player
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_PLAYER_HPP
25 #define LIBVLCPP_MEDIA_PLAYER_HPP
27 #include <vlc/libvlc.h>
28 #include <vlc/libvlc_media.h>
29 #include <vlc/libvlc_media_player.h>
41 * Create a media player without a media associated
42 * @param libvlcInstance: instance of the libVLC class
44 MediaPlayer( libVLC &libvlcInstance );
47 * Create a media player with a media associated
48 * @param media: the associated media (the media can be safely destroy afterward)
50 MediaPlayer( Media &media);
58 * Set the media associated with the player
59 * @param media: the media to associated with the player
61 void setMedia( Media &media );
64 * Get the media associated with the player
70 * Get the event manager associated to the media player
71 * @return the event manager
73 ///@todo eventManager()
76 * Is the player playing
77 * @return true if the player is playing, false overwise
98 * Set the NSView handler where the media player shoud render the video
99 * @param drawable: the NSView handler
101 void setNSObject( void *drawable );
104 * Get the NSView handler associated with the media player
105 * @return the NSView handler
110 * Set the agl handler where the media player shoud render the video
111 * @param drawable: the agl handler
113 void setAgl( uint32_t drawable );
116 * Get the agl handler associated with the media player
117 * @return the agl handler
122 * Set the X Window drawable where the media player shoud render the video
123 * @param drawable: the X Window drawable
125 void setXWindow( uint32_t drawable );
128 * Get the X Window drawable associated with the media player
129 * @return the X Window drawable
134 * Set the Win32/Win64 API window handle where the media player shoud
136 * @param drawable: the windows handle
138 void setHwnd( void *drawable );
141 * Get the Win32/Win64 API window handle associated with the media player
142 * @return the windows handle
148 * Get the movie lenght (in ms)
149 * @return the movie length
154 * Get the current movie time (in ms)
155 * @return the current movie time
160 * Set the movie time (in ms)
161 * @param the movie time (in ms)
163 void setTime( int64_t new_time );
166 * Get the movie position (in percent)
167 * @return the movie position
172 * Set the movie position (in percent)
173 * @param the movie position
175 void setPosition( float position );
178 * Get the current movie chapter
179 * @return the current chapter
184 * Get the movie chapter count
185 * @return the movie chapter count
190 * Is the player going to play the media (not dead or dying)
191 * @return true if the player will play
196 libvlc_media_player_t *m_player;
201 #endif // LIBVLCPP_MEDIA_PLAYER_HPP