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>
42 * Create a media player without a media associated
43 * @param libvlcInstance: instance of the libVLC class
45 MediaPlayer( libVLC &libvlcInstance );
48 * Create a media player with a media associated
49 * @param media: the associated media (the media can be safely destroy afterward)
51 MediaPlayer( Media &media );
59 * Set the media associated with the player
60 * @param media: the media to associated with the player
62 void setMedia( Media &media );
65 * Get the media associated with the player
71 * Get the event manager associated to the media player
72 * @return the event manager
74 ///@todo eventManager()
77 * Is the player playing
78 * @return true if the player is playing, false overwise
99 * Set the NSView handler where the media player shoud render the video
100 * @param drawable: the NSView handler
102 void setNSObject( void *drawable );
105 * Get the NSView handler associated with the media player
106 * @return the NSView handler
111 * Set the agl handler where the media player shoud render the video
112 * @param drawable: the agl handler
114 void setAgl( uint32_t drawable );
117 * Get the agl handler associated with the media player
118 * @return the agl handler
123 * Set the X Window drawable where the media player shoud render the video
124 * @param drawable: the X Window drawable
126 void setXWindow( uint32_t drawable );
129 * Get the X Window drawable associated with the media player
130 * @return the X Window drawable
135 * Set the Win32/Win64 API window handle where the media player shoud
137 * @param drawable: the windows handle
139 void setHwnd( void *drawable );
142 * Get the Win32/Win64 API window handle associated with the media player
143 * @return the windows handle
149 * Get the movie lenght (in ms)
150 * @return the movie length
155 * Get the current movie time (in ms)
156 * @return the current movie time
161 * Set the movie time (in ms)
162 * @param new_time the movie time (in ms)
164 void setTime( int64_t new_time );
167 * Get the movie position (in percent)
168 * @return the movie position
173 * Set the movie position (in percent)
174 * @param position the movie position
176 void setPosition( float position );
179 * Get the current movie chapter
180 * @return the current chapter
185 * Get the movie chapter count
186 * @return the movie chapter count
191 * Get the number of chapter in the given title
192 * @param title: the title
193 * @return the number of chapter in title
195 int chapterCount( int title );
198 * Set the movie chapter
199 * @param chapter: the chapter to play
201 void setChapter( int chapter );
204 * Is the player going to play the media (not dead or dying)
205 * @return true if the player will play
210 * Get the current title
216 * Get the title count
217 * @return the number of title
223 * @param title: the title
225 void setTitle( int title );
229 * Move to the previous chapter
231 void previousChapter();
234 * Move to the next chapter
239 * Get the movie play rate
240 * @return the play rate
246 * @param rate: the rate
248 void setRate( float rate );
251 * Get the movie state
254 libvlc_state_t state();
258 * @return the movie fps
264 * Does the media player have a video output
265 * @return true if the media player has a video output
270 * Is the media player able to seek ?
271 * @return true if the media player can seek
276 * Can this media player be paused ?
277 * @return true if the media player can pause
282 * Display the next frame
288 * Toggle fullscreen status on a non-embedded video output
290 void toggleFullscreen();
293 * Enable fullscreen on a non-embedded video output
295 void enableFullscreen();
298 * Disable fullscreen on a non-embedded video output
300 void disableFullscreen();
303 * Get the fullscreen status
304 * @return true if the fullscreen is enable, false overwise
309 * Get the class that handle the Audio
310 * @return the instance of Audio associated with this MediaPlayer
315 /** The media player instance of libvlc */
316 libvlc_media_player_t *m_player;
318 /** The Audio part of the media player */
324 #endif // LIBVLCPP_MEDIA_PLAYER_HPP