/usr/share/qt5/doc/qtmultimediawidgets/qtmultimediawidgets-player-example.html is in qtmultimedia5-doc-html 5.2.1-0ubuntu5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- player.qdoc -->
<title>Media Player Example | QtMultimediaWidgets 5.2</title>
<link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
<div class="main">
<div class="main-rounded">
<div class="navigationbar">
<ul>
<li>Qt 5.2</li>
<li><a href="qtmultimediawidgets-index.html">Qt Multimedia Widgets</a></li>
<li>Media Player Example</li>
<li id="buildversion">
Qt 5.2.1 Reference Documentation</li>
</ul>
</div>
</div>
<div class="content">
<div class="line">
<div class="content mainContent">
<h1 class="title">Media Player Example</h1>
<span class="subtitle"></span>
<!-- $$$player-description -->
<div class="descr"> <a name="details"></a>
<p>Demonstrates the audio and video playback functionality<p>This example creates a simple multimedia player. We can play audio and or video files using various codecs.</p>
<p>The example uses a QMediaPlayer object passed into a <a href="qvideowidget.html">QVideoWidget</a> to control the video output. To give the application playlist capability we also use a QPlayList object.</p>
<p>To activate the various functions such as play and stop on the dialog we connect clicked() signals to slots that emit the play() and stop() signals and in turn which we connect to the play() and stop() slots in QMediaPlayer.</p>
<pre class="cpp">connect(controls<span class="operator">,</span> SIGNAL(play())<span class="operator">,</span> player<span class="operator">,</span> SLOT(play()));
connect(controls<span class="operator">,</span> SIGNAL(pause())<span class="operator">,</span> player<span class="operator">,</span> SLOT(pause()));
connect(controls<span class="operator">,</span> SIGNAL(stop())<span class="operator">,</span> player<span class="operator">,</span> SLOT(stop()));</pre>
<p>We can get the volume (and set our user interface representation)</p>
<pre class="cpp">controls<span class="operator">-</span><span class="operator">></span>setVolume(player<span class="operator">-</span><span class="operator">></span>volume());</pre>
<p>and we can make widget 'volume' changes change the volume</p>
<pre class="cpp">connect(controls<span class="operator">,</span> SIGNAL(changeVolume(<span class="type">int</span>))<span class="operator">,</span> player<span class="operator">,</span> SLOT(setVolume(<span class="type">int</span>)));</pre>
<p>The example also allows us to change various video properties by means of the <a href="qvideowidget.html">QVideoWidget</a> object. We can go to Full Screen mode with a single button click, and back again. Or if we press the "Color Options" dialog button we can have access to more subtle influences. The dialog has a set of sliders so that we can change the brightness, contrast, hue and saturation of the video being watched. The connect() statements are in pairs so that changes to either the user interface widget (the relevant slider) or the <a href="qvideowidget.html">QVideoWidget</a> object will update the other object.</p>
<pre class="cpp"> connect(brightnessSlider<span class="operator">,</span> SIGNAL(sliderMoved(<span class="type">int</span>))<span class="operator">,</span> videoWidget<span class="operator">,</span>
SLOT(setBrightness(<span class="type">int</span>)));
connect(videoWidget<span class="operator">,</span> SIGNAL(brightnessChanged(<span class="type">int</span>))<span class="operator">,</span>
brightnessSlider<span class="operator">,</span> SLOT(setValue(<span class="type">int</span>)));
connect(contrastSlider<span class="operator">,</span> SIGNAL(sliderMoved(<span class="type">int</span>))<span class="operator">,</span> videoWidget<span class="operator">,</span>
SLOT(setContrast(<span class="type">int</span>)));
connect(videoWidget<span class="operator">,</span> SIGNAL(contrastChanged(<span class="type">int</span>))<span class="operator">,</span> contrastSlider<span class="operator">,</span>
SLOT(setValue(<span class="type">int</span>)));
connect(hueSlider<span class="operator">,</span> SIGNAL(sliderMoved(<span class="type">int</span>))<span class="operator">,</span> videoWidget<span class="operator">,</span>
SLOT(setHue(<span class="type">int</span>)));
connect(videoWidget<span class="operator">,</span> SIGNAL(hueChanged(<span class="type">int</span>))<span class="operator">,</span> hueSlider<span class="operator">,</span>
SLOT(setValue(<span class="type">int</span>)));
connect(saturationSlider<span class="operator">,</span> SIGNAL(sliderMoved(<span class="type">int</span>))<span class="operator">,</span> videoWidget<span class="operator">,</span>
SLOT(setSaturation(<span class="type">int</span>)));
connect(videoWidget<span class="operator">,</span> SIGNAL(saturationChanged(<span class="type">int</span>))<span class="operator">,</span>
saturationSlider<span class="operator">,</span> SLOT(setValue(<span class="type">int</span>)));</pre>
<p>Files:</p>
<ul>
<li><a href="qtmultimediawidgets-player-histogramwidget-cpp.html">player/histogramwidget.cpp</a></li>
<li><a href="qtmultimediawidgets-player-histogramwidget-h.html">player/histogramwidget.h</a></li>
<li><a href="qtmultimediawidgets-player-player-cpp.html">player/player.cpp</a></li>
<li><a href="qtmultimediawidgets-player-player-h.html">player/player.h</a></li>
<li><a href="qtmultimediawidgets-player-playercontrols-cpp.html">player/playercontrols.cpp</a></li>
<li><a href="qtmultimediawidgets-player-playercontrols-h.html">player/playercontrols.h</a></li>
<li><a href="qtmultimediawidgets-player-playlistmodel-cpp.html">player/playlistmodel.cpp</a></li>
<li><a href="qtmultimediawidgets-player-playlistmodel-h.html">player/playlistmodel.h</a></li>
<li><a href="qtmultimediawidgets-player-videowidget-cpp.html">player/videowidget.cpp</a></li>
<li><a href="qtmultimediawidgets-player-videowidget-h.html">player/videowidget.h</a></li>
<li><a href="qtmultimediawidgets-player-main-cpp.html">player/main.cpp</a></li>
<li><a href="qtmultimediawidgets-player-player-pro.html">player/player.pro</a></li>
</ul>
</div>
<!-- @@@player -->
</div>
</div>
</div>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2013 Digia Plc and/or its
subsidiaries. Documentation contributions included herein are the copyrights of
their respective owners.<br> The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation.<br> Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners. </p>
</div>
</body>
</html>
|