Sophie

Sophie

distrib > Mandriva > current > i586 > media > main-updates > by-pkgid > 8e6051afcdb111a0317a58fb64c2abf5 > files > 3240

qt4-doc-4.6.3-0.2mdv2010.2.i586.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- phonon-api.qdoc -->
<head>
  <title>Qt 4.6: VideoPlayer Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<a name="//apple_ref/cpp/cl/Phonon/VideoPlayer"></a>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://qt.nokia.com/"><img src="images/qt-logo.png" align="left" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">All&nbsp;Functions</font></a>&nbsp;&middot; <a href="overviews.html"><font color="#004faf">Overviews</font></a></td></tr></table><h1 class="title">VideoPlayer Class Reference<br /><span class="small-subtitle">(Phonon::VideoPlayer)<br />[<a href="phonon.html">Phonon</a> module]</span>
</h1>
<p>The VideoPlayer widget is used to perform playback of video. <a href="#details">More...</a></p>
<pre> #include &lt;Phonon/VideoPlayer&gt;</pre><p><b>This class is not part of the Qt GUI Framework Edition.</b></p>
<p>Inherits <a href="qwidget.html">QWidget</a>.</p>
<p>This class was introduced in Qt 4.4.</p>
<ul>
<li><a href="phonon-videoplayer-members.html">List of all members, including inherited members</a></li>
</ul>
<hr />
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="phonon-videoplayer.html#VideoPlayer">VideoPlayer</a></b> ( Phonon::Category <i>category</i>, QWidget * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="phonon-videoplayer.html#VideoPlayer-2">VideoPlayer</a></b> ( QWidget * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="phonon-videoplayer.html#dtor.VideoPlayer">~VideoPlayer</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">AudioOutput * </td><td class="memItemRight" valign="bottom"><b><a href="phonon-videoplayer.html#audioOutput">audioOutput</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">qint64 </td><td class="memItemRight" valign="bottom"><b><a href="phonon-videoplayer.html#currentTime">currentTime</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="phonon-videoplayer.html#isPaused">isPaused</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="phonon-videoplayer.html#isPlaying">isPlaying</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">MediaObject * </td><td class="memItemRight" valign="bottom"><b><a href="phonon-videoplayer.html#mediaObject">mediaObject</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">qint64 </td><td class="memItemRight" valign="bottom"><b><a href="phonon-videoplayer.html#totalTime">totalTime</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">VideoWidget * </td><td class="memItemRight" valign="bottom"><b><a href="phonon-videoplayer.html#videoWidgetx">videoWidget</a></b> () const</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">float </td><td class="memItemRight" valign="bottom"><b><a href="phonon-videoplayer.html#volume">volume</a></b> () const</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>217 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
<li><div bar="2" class="fn"></div>29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
<li><div bar="2" class="fn"></div>13 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li>
</ul>
<hr />
<a name="public-slots"></a>
<h2>Public Slots</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="phonon-videoplayer.html#load">load</a></b> ( const Phonon::MediaSource &amp; <i>source</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="phonon-videoplayer.html#pause">pause</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="phonon-videoplayer.html#play">play</a></b> ( const Phonon::MediaSource &amp; <i>source</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="phonon-videoplayer.html#play-2">play</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="phonon-videoplayer.html#seek">seek</a></b> ( qint64 <i>ms</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="phonon-videoplayer.html#setVolume">setVolume</a></b> ( float <i>volume</i> )</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="phonon-videoplayer.html#stop">stop</a></b> ()</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>19 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li>
<li><div bar="2" class="fn"></div>1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
</ul>
<hr />
<a name="signals"></a>
<h2>Signals</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="phonon-videoplayer.html#finished">finished</a></b> ()</td></tr>
</table>
<ul>
<li><div bar="2" class="fn"></div>1 signal inherited from <a href="qwidget.html#signals">QWidget</a></li>
<li><div bar="2" class="fn"></div>1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li><div class="fn"></div>58 properties inherited from <a href="qwidget.html#properties">QWidget</a></li>
<li><div class="fn"></div>1 property inherited from <a href="qobject.html#properties">QObject</a></li>
<li><div class="fn"></div>4 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li>
<li><div class="fn"></div>5 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
<li><div class="fn"></div>37 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
<li><div class="fn"></div>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
<li><div class="fn"></div>1 protected function inherited from <a href="qpaintdevice.html#protected-functions">QPaintDevice</a></li>
<li><div class="fn"></div>1 protected slot inherited from <a href="qwidget.html#protected-slots">QWidget</a></li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The VideoPlayer widget is used to perform playback of video.</p>
<p>With VideoPlayer you can get results quickly and easily. You can do the standard playback tasks like <a href="phonon-videoplayer.html#play">play</a>(), <a href="phonon-videoplayer.html#pause">pause</a>(), and <a href="phonon-videoplayer.html#stop">stop</a>(), but also set a playback volume and seek - if the media and backend supports seeking.</p>
<p>VideoPlayer is provided for convenience and removes the need to create a media graph with a <a href="phonon-mediaobject.html">MediaObject</a>, <a href="phonon-audiooutput.html">AudioOutput</a>, and <a href="phonon-videowidget.html">VideoWidget</a>. If you need functionality not supported by the player, you can build this <a href="phonon-overview.html#building-graphs">graph</a> yourself.</p>
<p>Keep in mind that when the VideoPlayer instance is deleted the playback will stop.</p>
<p>Note also that most of the functions in this class are asynchronous. For instance, a media source may not play immediately after you call the <a href="phonon-videoplayer.html#play">play</a>() function.</p>
<p>A play and forget code example:</p>
<pre> VideoPlayer *player = new VideoPlayer(Phonon::VideoCategory, parentWidget);
 connect(player, SIGNAL(finished()), player, SLOT(deleteLater()));
 player-&gt;play(url);</pre>
<p>See also <a href="phonon-module.html">Phonon Module</a> and <a href="phonon-mediaobject.html">MediaObject</a>.</p>
<hr />
<h2>Member Function Documentation</h2>
<a name="//apple_ref/cpp/instm/Phonon::VideoPlayer/VideoPlayer"></a>
<h3 class="fn"><a name="VideoPlayer"></a>VideoPlayer::VideoPlayer ( <a href="phonon.html#Category-enum">Phonon::Category</a> <i>category</i>, <a href="qwidget.html">QWidget</a> * <i>parent</i> = 0 )</h3>
<p>Constructs a new <a href="phonon-videoplayer.html">VideoPlayer</a> instance with the specified <i>parent</i>.</p>
<p><i>category</i> is the category used for the audio output device.</p>
<h3 class="fn"><a name="VideoPlayer-2"></a>VideoPlayer::VideoPlayer ( <a href="qwidget.html">QWidget</a> * <i>parent</i> = 0 )</h3>
<p>Constructs a new video widget with a <i>parent</i> using <a href="phonon.html#Category-enum">Phonon::VideoCategory</a> as its category.</p>
<p><i>parent</i> The <a href="qobject.html">QObject</a> parent.</p>
<a name="//apple_ref/cpp/instm/Phonon::VideoPlayer/~VideoPlayer"></a>
<h3 class="fn"><a name="dtor.VideoPlayer"></a>VideoPlayer::~VideoPlayer ()</h3>
<p>On destruction the playback is stopped, also the audio output is removed so that the desktop mixer will not show the application anymore. If you need a persistent audio output don't use <a href="phonon-videoplayer.html">VideoPlayer</a> but <a href="phonon-mediaobject.html">MediaObject</a>, VideoPath and VideoOutput.</p>
<a name="//apple_ref/cpp/instm/Phonon::VideoPlayer/audioOutput"></a>
<h3 class="fn"><a name="audioOutput"></a><a href="phonon-audiooutput.html">AudioOutput</a> * VideoPlayer::audioOutput () const</h3>
<p>Returns the audio output object being used by the player.</p>
<a name="//apple_ref/cpp/instm/Phonon::VideoPlayer/currentTime"></a>
<h3 class="fn"><a name="currentTime"></a><a href="qtglobal.html#qint64-typedef">qint64</a> VideoPlayer::currentTime () const</h3>
<p>Get the current time (in milliseconds) of the file currently being played.</p>
<a name="//apple_ref/cpp/instm/Phonon::VideoPlayer/finished"></a>
<h3 class="fn"><a name="finished"></a>void VideoPlayer::finished ()&nbsp;&nbsp;<tt> [signal]</tt></h3>
<p>This signal is emitted when the playback finished.</p>
<a name="//apple_ref/cpp/instm/Phonon::VideoPlayer/isPaused"></a>
<h3 class="fn"><a name="isPaused"></a>bool VideoPlayer::isPaused () const</h3>
<p>Returns true if it is currently paused; otherwise returns false if it is currently playing or stopped.</p>
<a name="//apple_ref/cpp/instm/Phonon::VideoPlayer/isPlaying"></a>
<h3 class="fn"><a name="isPlaying"></a>bool VideoPlayer::isPlaying () const</h3>
<p>Returns true if it is currently playing; otherwise returns false if it is currently stopped or paused</p>
<a name="//apple_ref/cpp/instm/Phonon::VideoPlayer/load"></a>
<h3 class="fn"><a name="load"></a>void VideoPlayer::load ( const <a href="phonon-mediasource.html">Phonon::MediaSource</a> &amp; <i>source</i> )&nbsp;&nbsp;<tt> [slot]</tt></h3>
<p>Starts pre-loading the media data from the specified <i>source</i> and filling audio buffers in the backend.</p>
<p>When there's already a media playing (or paused) it will be stopped (the finished signal will not be emitted).</p>
<p>See also <a href="phonon-mediaobject.html#setCurrentSource">MediaObject::setCurrentSource</a>().</p>
<a name="//apple_ref/cpp/instm/Phonon::VideoPlayer/mediaObject"></a>
<h3 class="fn"><a name="mediaObject"></a><a href="phonon-mediaobject.html">MediaObject</a> * VideoPlayer::mediaObject () const</h3>
<p>Returns the media object being used by the player.</p>
<p>The media object can be accessed directly instead of using the <a href="phonon-videoplayer.html">VideoPlayer</a>s convenience functions, e.g&#x2e;, <a href="phonon-videoplayer.html#play">play</a>() and <a href="phonon-videoplayer.html#stop">stop</a>(). It is also possible to give the object to other Phonon widgets, e.g&#x2e;, a <a href="phonon-seekslider.html">SeekSlider</a> or a <a href="phonon-volumeslider.html">VolumeSlider</a>.</p>
<p>See also <a href="phonon-seekslider.html">Phonon::SeekSlider</a> and <a href="phonon-mediaobject.html">Phonon::MediaObject</a>.</p>
<a name="//apple_ref/cpp/instm/Phonon::VideoPlayer/pause"></a>
<h3 class="fn"><a name="pause"></a>void VideoPlayer::pause ()&nbsp;&nbsp;<tt> [slot]</tt></h3>
<p>Pauses the playback.</p>
<p>See also <a href="phonon-mediaobject.html#pause">MediaObject::pause</a>().</p>
<a name="//apple_ref/cpp/instm/Phonon::VideoPlayer/play"></a>
<h3 class="fn"><a name="play"></a>void VideoPlayer::play ( const <a href="phonon-mediasource.html">Phonon::MediaSource</a> &amp; <i>source</i> )&nbsp;&nbsp;<tt> [slot]</tt></h3>
<p>Plays the media from the given <i>source</i>. Starts playback as fast as possible. This can take a considerable time depending on the URL and the backend.</p>
<p>If you need low latency between calling play() and the sound actually starting to play on your output device you need to use <a href="phonon-mediaobject.html">MediaObject</a> and be able to set the URL before calling play(). Note that</p>
<pre> audioPlayer-&gt;load(url);
 audioPlayer-&gt;play();</pre>
<p>doesn't make a difference: the application should be idle between the load and play calls so that the backend can start preloading the media and fill audio buffers.</p>
<h3 class="fn"><a name="play-2"></a>void VideoPlayer::play ()&nbsp;&nbsp;<tt> [slot]</tt></h3>
<p>Continues playback of paused media. Restarts playback of a stopped (or newly loaded) media.</p>
<p>See also <a href="phonon-mediaobject.html#play">MediaObject::play</a>() and <a href="phonon-videoplayer.html#play">play</a>().</p>
<a name="//apple_ref/cpp/instm/Phonon::VideoPlayer/seek"></a>
<h3 class="fn"><a name="seek"></a>void VideoPlayer::seek ( <a href="qtglobal.html#qint64-typedef">qint64</a> <i>ms</i> )&nbsp;&nbsp;<tt> [slot]</tt></h3>
<p>Seeks to the requested time. Note that the backend is free to ignore the seek request if the media source isn't seekable; you can check this by asking the media object of the <a href="phonon-videoplayer.html">VideoPlayer</a>.</p>
<pre>     player-&gt;mediaObject()-&gt;isSeekable();</pre>
<p>The <i>ms</i> parameter is the time in milliseconds from the start of the media.</p>
<p>The call is asynchronous, so <a href="phonon-videoplayer.html#currentTime">currentTime</a>() can still be the old value right after this method was called. If all you need is a slider that shows the current position and allows the user to seek, use the class <a href="phonon-seekslider.html">SeekSlider</a>.</p>
<p>See also <a href="phonon-mediaobject.html#seek">MediaObject::seek</a>(), <a href="phonon-mediaobject.html#isSeekable">MediaObject::isSeekable</a>(), and <a href="phonon-videoplayer.html#mediaObject">mediaObject</a>().</p>
<a name="//apple_ref/cpp/instm/Phonon::VideoPlayer/setVolume"></a>
<h3 class="fn"><a name="setVolume"></a>void VideoPlayer::setVolume ( float <i>volume</i> )&nbsp;&nbsp;<tt> [slot]</tt></h3>
<p>Sets the <i>volume</i> of the output as voltage factor.</p>
<p>1.0 means 100%, 0.5 means 50% voltage/25% power, 0.0 means 0%</p>
<p>See also <a href="phonon-videoplayer.html#volume">volume</a>().</p>
<a name="//apple_ref/cpp/instm/Phonon::VideoPlayer/stop"></a>
<h3 class="fn"><a name="stop"></a>void VideoPlayer::stop ()&nbsp;&nbsp;<tt> [slot]</tt></h3>
<p>Stops the playback.</p>
<p>See also <a href="phonon-mediaobject.html#stop">MediaObject::stop</a>().</p>
<a name="//apple_ref/cpp/instm/Phonon::VideoPlayer/totalTime"></a>
<h3 class="fn"><a name="totalTime"></a><a href="qtglobal.html#qint64-typedef">qint64</a> VideoPlayer::totalTime () const</h3>
<p>Get the total time (in milliseconds) of the file currently being played.</p>
<a name="//apple_ref/cpp/instm/Phonon::VideoPlayer/videoWidget"></a>
<h3 class="fn"><a name="videoWidgetx"></a><a href="phonon-videowidget.html">VideoWidget</a> * VideoPlayer::videoWidget () const</h3>
<p>Returns the video widget being used by the player.</p>
<a name="//apple_ref/cpp/instm/Phonon::VideoPlayer/volume"></a>
<h3 class="fn"><a name="volume"></a>float VideoPlayer::volume () const</h3>
<p>This is the current volume of the output as voltage factor.</p>
<p>1.0 means 100%, 0.5 means 50% voltage/25% power, 0.0 means 0%</p>
<p>See also <a href="phonon-videoplayer.html#setVolume">setVolume</a>().</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="40%" align="left">Copyright &copy; 2010 Nokia Corporation and/or its subsidiary(-ies)</td>
<td width="20%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="40%" align="right"><div align="right">Qt 4.6.3</div></td>
</tr></table></div></address></body>
</html>