From 6b4994c265889db2058b7d5850b51ddfc5478754 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 5 Dec 2012 13:03:09 +0100 Subject: centralize and fixup example sources install targets This follows suit with aeb036e in qtbase. Change-Id: Ie8580d0a1f38ab9858b0e44c9f99bdc552a1752a Reviewed-by: Oswald Buddenhagen Reviewed-by: hjk --- .../multimediawidgets/player/doc/src/player.qdoc | 96 ++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 examples/multimediawidgets/player/doc/src/player.qdoc (limited to 'examples/multimediawidgets/player/doc') diff --git a/examples/multimediawidgets/player/doc/src/player.qdoc b/examples/multimediawidgets/player/doc/src/player.qdoc new file mode 100644 index 000000000..5e98b912c --- /dev/null +++ b/examples/multimediawidgets/player/doc/src/player.qdoc @@ -0,0 +1,96 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the documentation of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:FDL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: http://www.gnu.org/copyleft/fdl.html. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +/*! + \example player + \title Media Player Example + \ingroup video_examples + + + This example creates a simple multimedia player. We can play audio and + or video files using various codecs. + + The example uses a QMediaPlayer object passed into a QVideoWidget to + control the video output. To give the application playlist capability + we also use a QPlayList object. + + 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. + + \code + connect(controls, SIGNAL(play()), player, SLOT(play())); + connect(controls, SIGNAL(pause()), player, SLOT(pause())); + connect(controls, SIGNAL(stop()), player, SLOT(stop())); + \endcode + + We can get the volume (and set our user interface representation) + + \code + controls->setVolume(player->volume()); + \endcode + + and we can make widget 'volume' changes change the volume + + \code + connect(controls, SIGNAL(changeVolume(int)), player, SLOT(setVolume(int))); + \endcode + + The example also allows us to change various video properties by means + of the QVideoWidget 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 QVideoWidget object will update the other object. + + \code + connect(brightnessSlider, SIGNAL(sliderMoved(int)), videoWidget, + SLOT(setBrightness(int))); + connect(videoWidget, SIGNAL(brightnessChanged(int)), + brightnessSlider, SLOT(setValue(int))); + + connect(contrastSlider, SIGNAL(sliderMoved(int)), videoWidget, + SLOT(setContrast(int))); + connect(videoWidget, SIGNAL(contrastChanged(int)), contrastSlider, + SLOT(setValue(int))); + + connect(hueSlider, SIGNAL(sliderMoved(int)), videoWidget, + SLOT(setHue(int))); + connect(videoWidget, SIGNAL(hueChanged(int)), hueSlider, + SLOT(setValue(int))); + + connect(saturationSlider, SIGNAL(sliderMoved(int)), videoWidget, + SLOT(setSaturation(int))); + connect(videoWidget, SIGNAL(saturationChanged(int)), + saturationSlider, SLOT(setValue(int))); + \endcode + +*/ + -- cgit v1.2.3