diff --git a/.gitignore b/.gitignore index 34f9704df336c2222756c7e209be8d22eeeaf8fc..e0d1a93d1092af97588365409ded449ea423ec08 100644 --- a/.gitignore +++ b/.gitignore @@ -73,7 +73,6 @@ bin/qttracereplay* bin/rcc* bin/uic* bin/patternist* -bin/phonon* bin/qcollectiongenerator* bin/qdbus* bin/qhelpconverter* diff --git a/demos/qtdemo/xml/examples.xml b/demos/qtdemo/xml/examples.xml index 2fde945a457634b39aeda1ac1e272f041c67c97b..6b2fed17492d0a990d74b88cc896b498b2a82fe8 100644 --- a/demos/qtdemo/xml/examples.xml +++ b/demos/qtdemo/xml/examples.xml @@ -175,9 +175,6 @@ <example filename="svgviewer" name="SVG Viewer" /> <example filename="transformations" name="Transformations" /> </category> - <category dirname="phonon" name="Phonon"> - <example filename="qmusicplayer" name="Music Player" /> - </category> <category dirname="multimedia" name="Multimedia"> <example filename="audiodevices" name="Audio Devices" /> <example filename="audiooutput" name="Audio Output" /> diff --git a/doc/config/modules/qtphonon.qdocconf b/doc/config/modules/qtphonon.qdocconf deleted file mode 100644 index df127ae4c66e1292940b468928798a0e6e4d2176..0000000000000000000000000000000000000000 --- a/doc/config/modules/qtphonon.qdocconf +++ /dev/null @@ -1,17 +0,0 @@ -headerdirs += $QT_PHONON_SOURCES/.. - -sourcedirs += $QT_PHONON_SOURCES/.. \ - $QT_PHONON_SOURCES/../../doc/src - -exampledirs += $QT_PHONON_SOURCES/../.. \ - $QT_PHONON_SOURCES/../../doc/src \ - $QT_PHONON_SOURCES/../../examples - -imagedirs += $QT_PHONON_SOURCES/../../doc/src/images \ - $QT_PHONON_SOURCES/../../examples - -excludedirs += $QT_PHONON_SOURCES/../ds9 \ - $QT_PHONON_SOURCES/../gstreamer \ - $QT_PHONON_SOURCES/../mmf \ - $QT_PHONON_SOURCES/../qt7 \ - $QT_PHONON_SOURCES/../waveout diff --git a/doc/config/qdeclarative.qdocconf b/doc/config/qdeclarative.qdocconf index 6f61329daaaaee98bd43880500dc55db5fe181c6..97058908a69fc797dc7b95acd635b1212b1055b6 100644 --- a/doc/config/qdeclarative.qdocconf +++ b/doc/config/qdeclarative.qdocconf @@ -13,7 +13,7 @@ edition.Console.modules = QtCore QtDBus QtNetwork QtScript QtSql QtXml \ QtXmlPatterns QtTest edition.Desktop.modules = QtCore QtDBus QtGui QtNetwork QtOpenGL QtScript QtSql QtSvg \ QtWebKit QtXml QtXmlPatterns QtHelp \ - QtDesigner QtAssistant QAxContainer Phonon \ + QtDesigner QtAssistant QAxContainer \ QAxServer QtUiTools QtTest QtDBus edition.DesktopLight.modules = QtCore QtDBus QtGui QtTest edition.DesktopLight.groups = -graphicsview-api diff --git a/doc/config/qt-build-docs_ja_JP.qdocconf b/doc/config/qt-build-docs_ja_JP.qdocconf index 3e005441e855318b30f78a2a581029da528ffd70..aaa8719657d393ee678349a0c213d255b144994d 100644 --- a/doc/config/qt-build-docs_ja_JP.qdocconf +++ b/doc/config/qt-build-docs_ja_JP.qdocconf @@ -88,12 +88,7 @@ excludedirs = $QT_SOURCE_TREE/src/3rdparty/clucene \ $QT_SOURCE_TREE/src/3rdparty/wintab \ $QT_SOURCE_TREE/src/3rdparty/zlib \ $QT_SOURCE_TREE/doc/src/snippets \ - $QT_SOURCE_TREE/doc/src/zh_CN \ - $QT_SOURCE_TREE/src/3rdparty/phonon/gstreamer \ - $QT_SOURCE_TREE/src/3rdparty/phonon/ds9 \ - $QT_SOURCE_TREE/src/3rdparty/phonon/qt7 \ - $QT_SOURCE_TREE/src/3rdparty/phonon/mmf \ - $QT_SOURCE_TREE/src/3rdparty/phonon/waveout + $QT_SOURCE_TREE/doc/src/zh_CN sources.fileextensions = "*.cpp *.qdoc *.mm" examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp *.css" diff --git a/doc/config/qt-build-docs_zh_CN.qdocconf b/doc/config/qt-build-docs_zh_CN.qdocconf index efd6ec7f4bf2790415af7188c9b60f74a232c0c2..9c4a0b1232e38d56898dcf571e9e4f308279abf2 100644 --- a/doc/config/qt-build-docs_zh_CN.qdocconf +++ b/doc/config/qt-build-docs_zh_CN.qdocconf @@ -88,12 +88,7 @@ excludedirs = $QT_SOURCE_TREE/src/3rdparty/clucene \ $QT_SOURCE_TREE/src/3rdparty/wintab \ $QT_SOURCE_TREE/src/3rdparty/zlib \ $QT_SOURCE_TREE/doc/src/snippets \ - $QT_SOURCE_TREE/doc/src/ja_JP \ - $QT_SOURCE_TREE/src/3rdparty/phonon/gstreamer \ - $QT_SOURCE_TREE/src/3rdparty/phonon/ds9 \ - $QT_SOURCE_TREE/src/3rdparty/phonon/qt7 \ - $QT_SOURCE_TREE/src/3rdparty/phonon/mmf \ - $QT_SOURCE_TREE/src/3rdparty/phonon/waveout + $QT_SOURCE_TREE/doc/src/ja_JP sources.fileextensions = "*.cpp *.qdoc *.mm" examples.fileextensions = "*.cpp *.h *.js *.xq *.svg *.xml *.ui *.qhp *.qhcp *.css" diff --git a/doc/config/qt-cpp-ignore.qdocconf b/doc/config/qt-cpp-ignore.qdocconf index b7e8ea5132e629a97277e11b128493da9a68f49e..1dfb1cccf8a9c3c592659735a7b6469e1e60b8bc 100644 --- a/doc/config/qt-cpp-ignore.qdocconf +++ b/doc/config/qt-cpp-ignore.qdocconf @@ -69,7 +69,6 @@ Cpp.ignoretokens = QAXFACTORY_EXPORT \ QT_BEGIN_INCLUDE_NAMESPACE \ QT_END_NAMESPACE \ QT_END_INCLUDE_NAMESPACE \ - PHONON_EXPORT \ Q_DECLARATIVE_EXPORT \ Q_GADGET \ QWEBKIT_EXPORT \ @@ -99,8 +98,6 @@ Cpp.ignoredirectives = Q_DECLARE_HANDLE \ Q_INTERFACES \ __attribute__ \ K_DECLARE_PRIVATE \ - PHONON_OBJECT \ - PHONON_HEIR \ Q_PRIVATE_PROPERTY \ Q_DECLARE_PRIVATE_D \ Q_CLASSINFO diff --git a/doc/config/qt-project.qdocconf b/doc/config/qt-project.qdocconf index ffb7e6209c25cc17ae53632722e684b43986cc27..c6c1f4b7d1f09c70db5ce8f6ff6a7a588bc8e3e8 100644 --- a/doc/config/qt-project.qdocconf +++ b/doc/config/qt-project.qdocconf @@ -56,7 +56,6 @@ include($QT_CORE_QDOCCONF) include($QT_DOC_QDOCCONF) include($QT_LOCATION_QDOCCONF) include($QT_MULTIMEDIA_QDOCCONF) -include($QT_PHONON_QDOCCONF) include($QT_PUBLISHSUBSCRIBE_QDOCCONF) include($QT_3D_QDOCCONF) include($QT_QML_QDOCCONF) diff --git a/doc/doc.pri b/doc/doc.pri index 976a0a99259beab3603c2c264d646c88adfed98f..d2f64ef46bab75afed9d94db6f5de52c6c5820f6 100644 --- a/doc/doc.pri +++ b/doc/doc.pri @@ -33,7 +33,6 @@ MODULES = activeqt \ clucene \ # help designer location \ multimedia \ - phonon \ publishsubscribe \ 3d \ qml \ diff --git a/doc/src/classes/phonon-api.qdoc b/doc/src/classes/phonon-api.qdoc deleted file mode 100644 index d4abee45d39980f758c69c962e3791f7810f23e4..0000000000000000000000000000000000000000 --- a/doc/src/classes/phonon-api.qdoc +++ /dev/null @@ -1,5145 +0,0 @@ -/* - This file is part of the KDE project - Copyright (C) 2005-2007 Matthias Kretz <kretz@kde.org> - Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). - Contact: http://www.qt-project.org/ - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - - -/*! - \enum Phonon::DiscType - Enum to identify the media discs supported by MediaObject. - - \value NoDisc - No disc was selected. This is only useful as a return value from - MediaSource::diskType(). - \value Cd Identifies Audio CDs. - \value Dvd Identifies DVDs (not arbitrary data DVDs, only movie DVDs). - \value Vcd Identifies Video CDs. - - \sa MediaSource, MediaObject -*/ - -/*! - \enum Phonon::MetaData - - Provided as keys for Phonon::MediaObject::metaData(). The enum - values matches strings defined in the Ogg Vorbis specification - - \value ArtistMetaData - \value AlbumMetaData - \value TitleMetaData - \value DateMetaData - \value GenreMetaData - \value TracknumberMetaData - \value DescriptionMetaData - \value MusicBrainzDiscIdMetaData -*/ - -/*! - \enum Phonon::State - \since 4.4 - - The state enum describes the different states a media object can - take. Several functions of \l{Phonon::}{MediaObject} are - asynchronous, so even if a you have requested a state change - through a function call, e.g., through - \l{Phonon::MediaObject::}{play()}, you cannot be sure that the - change has taken place before you receive the - \l{Phonon::MediaObject::}{stateChanged()} signal. - - A media object can at any time change into any state, regardless - of the state it previously had. \omit In the - \l{Phonon::}{MediaObject} class description explains the typical - state changes in the life of a media object. \endomit - - \value LoadingState - After construction it might take a while before the media object - is ready to \l{Phonon::MediaObject::}{play()}. This state is - commonly used by backends to initialize the \l{Phonon - Overview}{media graph} and loading the source. When - the object leaves the loading state, it will enter the - StoppedState unless an error occurred or another state is - requested through a function call, e.g., - \l{Phonon::}{MediaObject::play()}. - - \value StoppedState - In the stopped state, the media object is ready to play its - current media source. The current - \l{MediaObject::seek()}{position} in the media stream is then 0. - - \value PlayingState - The media object is playing back its media source. - - \value BufferingState - The Player is waiting for data to be able to start or continue - playing. This state is commonly used to wait for media data over a - network connection. - - \value PausedState - The media player has currently paused its playback, i.e., it - stops playing but keeps the current playback position in the - stream. - - \value ErrorState - When a media object enters the error state a problem with the - playback has occurred. The possible errors are grouped into - two categories by Phonon::ErrorType, and the type can be - queried through \l{Phonon::MediaObject::}{errorType()}. A - \l{Phonon::}{FatalError} implies that the playback - cannot continue, but one can still try with a new media - source. With a \l{Phonon::}{NormalError} it might - be possible to continue playback, and a media object may - therefore change state from the ErrorState. - - \sa MediaObject -*/ - -/*! - \enum Phonon::Category - - Sets the category your program should be listed in in the mixer. - - \value NoCategory - Will make use of the default device. - \value NotificationCategory - If the sounds produced are notifications (ping, beep and such) you - should use this category. - \value MusicCategory - If your application is a music player (like a jukebox or media player - playing an audio file). - \value VideoCategory - If the sound is the audio channel of a video. - \value CommunicationCategory - If your applications produces sounds from communication with somebody - else (VoIP, voice chat). - \value GameCategory - Sound produced by a computer game should go into this category. - \value AccessibilityCategory - Sounds produced for accessibility (e.g., Text-To-Speech) - \omitvalue LastCategory - Holds the largest value of categories. - \omitvalue AccessibilityCategory - - A Jukebox will set this to Music, a VoIP program to Communication, a - DVD player to video, and so on. - - \note These categories can also become useful for an application that - controls the volumes automatically, like turning down the music when a call - comes in, or turning down the notifications when the media player knows - it's playing classical music. -*/ - -/*! - \enum Phonon::ErrorType - - This enum describes the severity when an error has occurred during - playback. - - After a media object has entered the \l{Phonon::}{ErrorState}, one - can query the type of error from - \l{Phonon::}{MediaObject::errorType()}. Note that you should query - the error when receiving the - \l{Phonon::}{MediaObject::stateChanged()} signal, because the - error type will be lost if the media object leaves the error - state. - - \value NoError No error. MediaObject::errorType() returns this if - MediaObject::state() != Phonon::ErrorState. - - \value NormalError An error has occurred with the playback of the current - source. It might be possible to continue playback, for instance, if only the - audio stream in a video cannot be played back. The media object will then - leave the error state again. - - \value FatalError. Something important does not work. Your program cannot continue - the playback of the current source, but it might be possible to try another. - - \sa MediaObject::errorType() -*/ - -/*! - \fn QString Phonon::categoryToString(Category c) - - Returns a (translated) string to show to the user identifying the given - Category (\a c). -*/ - -/*! - \enum Phonon::ObjectDescriptionType - \relates Phonon::ObjectDescription - - This enum defines the type of information that is contained in a - \l{Phonon::}{ObjectDescription} object. - - \value AudioOutputDeviceType An audio output device (\l{Phonon::}{AudioOutputDevice}). - This can be soundcards (with different drivers), - sound servers, or other virtual outputs like playback on a different - computer on the network. - - \value EffectType An audio effect (\l{Phonon::}{EffectDescription}). - \omitvalue SubtitleType - \omitvalue AudioCaptureDeviceType - \omitvalue AudioChannelType -*/ - -/*! - \typedef Phonon::AudioOutputDevice - \relates Phonon::ObjectDescription - - This typedef of \l{Phonon::}{ObjectDescription} describes an audio output - device, such as soundcards (with different drivers), sound servers, or other - virtual outputs like playback on a different computer on the network. - - \omit - For Hardware devices the backend should use libkaudiodevicelist - (AudioDevice and AudioDeviceEnumerator) which will list removable - devices even when they are unplugged and provide a unique identifier - that can make backends use the same identifiers. - \endomit - - A list of available devices is given by the backend with - Backendcapabilities::availableAudioOutputDevices() - - \snippet doc/src/snippets/phononobjectdescription.cpp 1 - -*/ - -/*! - \fn Phonon::phononVersion() - \inmodule Phonon - \since 4.5 - - Returns the Phonon version. -*/ - -/*! - \class Phonon::ObjectDescription - \inmodule Phonon - \inheaderfile Phonon/ObjectDescription - \since 4.4 - \brief The ObjectDescription class provides information about Phonon objects. - - Phonon currently uses this class to describe audio effects and - audio output devices - using the typedefs AudioOutputDevice and - EffectDescription. The type of an ObjectDescription is also - described through the \l{Phonon::}{ObjectDescriptionType} enum. - Objects of the same \l{Phonon::ObjectDescriptionType}{type} are - uniquely identified by an index(). - - The class gives a description() and a name() of the object, both - of which are strings appropriate for end users of a Phonon - application. You can also check whether the device or effect - described is \l{isValid()}{valid}. This does not guarantee that - the device or effect functions as expected, but that the - ObjectDescription describes an existing device or effect. - - Audio output devices and effect descriptions are used to select - the audio output device to be used for playback and to create - effects; we show examples of this in the snippet below. The - available descriptions can be fetched with - \l{Phonon::BackendCapabilities::}{availableAudioOutputDevices()} - and \l{Phonon::BackendCapabilities::}{availableAudioEffects()} - static functions in the Phonon::BackendCapabilities namespace - - \snippet doc/src/snippets/phononobjectdescription.cpp 0 - - Other types of ObjectDescriptions might be possible in the future, - e.g., descriptions of audio capture devices, such as microphones. - - \omit Not implemented yet. - Need a new paragraph on that some descriptions 'belong - together', such as chained audio effects. - - Some parts give the end user choices, e.g. what source to capture - audio from. These choices are described by the name and - description methods of this class and identified with the id - method. Subclasses then define additional information like which - audio and video choices belong together. \endomit - - \sa Phonon::AudioOutputDevice, Phonon::EffectDescription, {Capabilities Example}, {Phonon Module} -*/ - -/*! - \fn Phonon::ObjectDescription::ObjectDescription() - \brief constructs a new object description. - \internal -*/ - -/*! - \fn Phonon::ObjectDescription::ObjectDescription (int index, const QHash<QByteArray, QVariant> & properties) - \internal -*/ - -/*! - \fn Phonon::ObjectDescription::ObjectDescription(const QExplicitlySharedDataPointer<ObjectDescriptionData> &dd) - \internal -*/ - -/*! - \fn static inline ObjectDescription<T> Phonon::ObjectDescription::fromIndex(int index) - \internal - - \omit Currently indices are not unique for all ObjectDescription types, making - the behavior of this function undefined. \endomit - - Returns a new description object that describes the - device/effect/codec/... with the given \a index. -*/ - -/*! - \fn inline bool Phonon::ObjectDescription::operator==(const ObjectDescription &otherDescription) const - - Returns \c true if this ObjectDescription describes the same - object as \a otherDescription; otherwise, returns \c false. -*/ - -/*! - \fn inline bool Phonon::ObjectDescription::operator!=(const ObjectDescription &otherDescription) const - Returns \c false if this ObjectDescription describes the same - as \a otherDescription; otherwise, returns \c true. -*/ - -/*! - \fn inline QString Phonon::ObjectDescription::name() const - - Returns a string appropriate for a user to select between - object descriptions, e.g., from a QComboBox. - - \sa description() -*/ - -/*! - \fn inline QString Phonon::ObjectDescription::description() const - - Returns a more extensive description than the name() function. - - For example, in the case of \l{Phonon::}{AudioOutputDevice}s, this - text should make clear which sound source is described; this is - sometimes hard to describe or understand from just the name. - - The text is appropriate to present to an end user in for example - tool tips of items, with the name()'s as text, in a QComboBox. - -*/ - -/*! - \fn inline QVariant Phonon::ObjectDescription::property(const char *name) const - - Returns the property named \a name. A property can be used for - extended information, such as the manufacturer of a sound card. The - information will usually be given as text. - - If the property is not set an invalid QVariant is returned. - - Qt's backends do not use properties at the time of this writing. - - \sa propertyNames() -*/ - -/*! - \fn inline QList<QByteArray> Phonon::ObjectDescription::propertyNames() const - - Properties can be used for extended information about a - ObjectDescription, e.g., a manufacturer of a sound card. The - information will usually be given text. - - This function returns all names that return valid data when - property() is called. - - Currently, Qt backends do not use properties for their object - descriptions. - - \sa property() -*/ - -/*! - \fn inline bool Phonon::ObjectDescription::isValid() const - - Returns true if the device or effect described exists. - - An ObjectDescription that is invalid, will also have an - index() of -1. - - \sa index() -*/ - -/*! - \fn inline int Phonon::ObjectDescription::index() const - - Returns a unique identifier for this ObjectDescription. Used - internally to distinguish between the descriptions. - - Notice that the identifiers are only unique to the type of - description, e.g., \l{Phonon::}{AudioOutputDevice} or - \l{Phonon::}{EffectDescription}. -*/ - -/*! - \class Phonon::ObjectDescriptionPrivate - \inmodule Phonon - \since 4.4 - \internal - -*/ - -/*! - \class Phonon::StreamInterface - \inmodule Phonon - \since 4.4 - \brief Backend interface to handle media streams (AbstractMediaStream). - \internal -*/ - -/*! - \fn virtual Phonon::StreamInterface::~StreamInterface() -*/ - -/*! - \fn virtual void Phonon::StreamInterface::writeData(const QByteArray &data) = 0 - \internal -*/ - -/*! - \fn virtual void Phonon::StreamInterface::endOfData() = 0 - \internal -*/ - -/*! - \fn virtual void Phonon::StreamInterface::setStreamSize(qint64 newSize) = 0 - \internal -*/ - -/*! - \fn virtual void Phonon::StreamInterface::setStreamSeekable(bool s) = 0 - \internal -*/ - -/*! - \fn void Phonon::StreamInterface::connectToSource(const MediaSource &mediaSource) - \internal -*/ - -/*! - \fn void Phonon::StreamInterface::needData() - \internal -*/ - -/*! - \fn void Phonon::StreamInterface::enoughData() - \internal -*/ - -/*! - \fn void Phonon::StreamInterface::seekStream(qint64) - \internal -*/ - -/*! - \fn void Phonon::StreamInterface::reset() - \internal -*/ - -/*! - \fn Phonon::StreamInterface::StreamInterface() - \internal - \omit - For subclasses. - \endomit -*/ - -/*! - \class StreamInterfacePrivate - \inmodule Phonon - \internal -*/ - -/*! - \class Phonon::AbstractVideoOutput - \inmodule Phonon - \internal - \since 4.4 - \brief The AbstractVideoOutput class is the common base class for all video output classes. - - \sa VideoWidget -*/ - -/*! - \namespace Phonon::Experimental - \internal -*/ - -/*! - \fn Phonon::AbstractVideoOutput::AbstractVideoOutput(AbstractVideoOutputPrivate &d) - \internal - - Constructor that is called from derived classes. - - \param parent Standard QObject parent. -*/ - -/*! - \class Phonon::AbstractVideoOutputPrivate - \inmodule Phonon - \internal - \since 4.4 -*/ - -/*! - \class Phonon::VolumeFaderEffect - \inmodule Phonon - \internal - \since 4.4 - - This effect differs from gradually changing the output volume in that - a dedicated effect can change the volume in the smallest possible - steps while every other volume control will make more or less - noticeable steps. - - \sa AudioOutput::volume() -*/ - -/*! - \property Phonon::VolumeFaderEffect::volume - - This is the current volume of the output as voltage factor. - Setting this property changes the volume immediately. - - 1.0 means 100%, 0.5 means 50% voltage/25% power, 0.0 means 0% - - \sa volumeDecibel -*/ - -/*! - \property Phonon::VolumeFaderEffect::volumeDecibel - - This is the current volume of the output in decibel. - Setting this property changes the volume immediately. - - 0 dB means no change in volume, -6dB means an attenuation of the - voltage to 50% and an attenuation of the power to 25%, -inf dB means - silence. - - \sa volume -*/ - -/*! - \property Phonon::VolumeFaderEffect::fadeCurve - - This property holds the fade curve to be used for the fadeIn(), fadeOut() - and fadeTo() slots. - - Defaults to Fade3Decibel. - - \sa FadeCurve -*/ - -/*! - \enum Phonon::VolumeFaderEffect::FadeCurve - Determines the curve of the volume change. - - \value Fade3Decibel Crossfade curve/fast fade out. - This is the default fade curve. - \value Fade6Decibel Linear fade out. - \value Fade9Decibel Slow fade out. - \value Fade12Decibel A more extreme version of the -9dB fade. - - \b{Notes:} - - \c Fade3Decibel is often the best fade for a crossfade, as after half - of the time the volume reached -3dB. This means that half the - possible power (which is proportional to the square of the - voltage) is reached. Summed, the maximum power of two audio - signals fading with a -3dB curve will always be equal. - - For fading in or out the -3dB curve is too abrupt in the end. - - With a -6dB fade curve, a volume of -6dB is reached after half of - the fading time. -6dB is equal to half of the voltage meaning - that the voltage multiplier changes linearly from the start - of the fade to the end. - - With the \c Fade9Decibel fade, a volume of -9dB is reached after - half of the fade time, so the fade is fast in the beginning and - slow at the end. This is a good fade for ending music. -*/ - -/*! - \fn void Phonon::VolumeFaderEffect::fadeIn(int fadeTime) - - Tells the Fader to change the volume from the current volume to 100% - in \a fadeTime milliseconds. - - Short for \c fadeTo(1.0, fadeTime). - - \param fadeTime the fade duration in milliseconds - - \sa fadeTo(), volume -*/ - -/*! - \fn void Phonon::VolumeFaderEffect::fadeOut(int fadeTime) - - Tells the Fader to change the volume from the current volume to 0% - in \a fadeTime milliseconds. - Short for \c fadeTo(0.0, fadeTime). - - \param fadeTime the fade duration in milliseconds - - \sa fadeTo -*/ - -/*! - \fn void Phonon::VolumeFaderEffect::fadeTo(float volume, int fadeTime) - - Tells the Fader to change the volume from the current value to - \a volume in \a fadeTime milliseconds. - - \sa fadeIn(), fadeOut() -*/ - -/*! - \class Phonon::VolumeFaderEffectPrivate - \inmodule Phonon - \since 4.4 - \internal -*/ - -/*! - \class Phonon::VolumeFaderInterface - \inmodule Phonon - \since 4.4 - \internal -*/ - -/*! - \fn virtual Phonon::VolumeFaderInterface::~VolumeFaderInterface() - \internal -*/ - -/*! - \fn virtual float Phonon::VolumeFaderInterface::volume() const - \internal -*/ - -/*! - \fn virtual void Phonon::VolumeFaderInterface::setVolume(float) - \internal -*/ - -/*! - \fn virtual Phonon::VolumeFaderEffect::FadeCurve Phonon::VolumeFaderInterface::fadeCurve() const - \internal -*/ - -/*! - \fn virtual void Phonon::VolumeFaderInterface::setFadeCurve(Phonon::VolumeFaderEffect::FadeCurve) - \internal -*/ - -/*! - \fn virtual void Phonon::VolumeFaderInterface::fadeTo(float, int) - \internal -*/ - -/*! - \class Phonon::AbstractMediaStream - \inmodule Phonon - \internal - \since 4.4 - \brief The AbstractMediaStream class is the base class for custom media data streams. - \inheaderfile Phonon/AbstractMediaStream - - This class is subclassed to provide custom data streams for - \l{Phonon::}{MediaSource}s. - - The \l{Phonon::}{MediaSource} knows how to handle the most common - media sources, such as files and CD. If you need to fetch - multimedia from other sources, you can reimplement this class, - which can be used by a \l{Phonon::}{MediaSource}. - - When a backend needs more data from the stream, needData() will be - called. You must then use writeData() to write the data to the - backend. You can either write one time and wait for a new - needData() call, or continue to write data until you receive an - enoughData() call. When the stream is at its end, call endOfData() - instead of writeData(). - - Before the custom stream is passed to a \l{Phonon::}{MediaSource}, - setStreamSize() needs to be called, and also setStreamSeekable() - (if the stream is seekable). A good place to do this work is in - the constructor. A seekable stream must also reimplement - seekStream(). - - We show two examples. The first writes data repeatedly until it - receives the enoughData() call, while the second only writes once - and waits for a new needData() call. - - Example where data is written repeatedly. - - \snippet doc/src/snippets/code/doc_src_phonon-api.cpp 0 - - Example where data is written once: - - \snippet doc/src/snippets/code/doc_src_phonon-api.cpp 1 - - \sa Phonon::MediaSource, Phonon::MediaObject - -*/ - -/*! - \fn Phonon::AbstractMediaStream::AbstractMediaStream(QObject *parent = 0) - \internal - - Constructs an AbstractMediaStream object with the given \a parent. - -*/ - -/*! - \fn qint64 Phonon::AbstractMediaStream::streamSize() const - - Returns the stream size that was set with setStreamSize(). - - A negative value means that the length of the stream cannot be known. - - Defaults to 0. - - \sa setStreamSize() -*/ - -/*! - \fn void Phonon::AbstractMediaStream::setStreamSize(qint64 size) - - Sets the \a size of the stream in number of bytes. - - A negative value means that the length of the stream cannot be known. - - Defaults to 0. - - This function has to be called. A backend will not call needData() - until the stream size is set. - - \sa streamSize() - -*/ - -/*! - \fn bool Phonon::AbstractMediaStream::streamSeekable() const - - Returns whether your data stream is set as seekable. - - Defaults to \c false. - - \sa setStreamSeekable() - -*/ - -/*! - \fn void Phonon::AbstractMediaStream::setStreamSeekable(bool s) - - Sets whether your data stream is seekable. \a s should be true if - the stream is seekable; otherwise false. - - Defaults to \c false. - - If you set this to \c true you have to implement the seekStream() - function. - - \sa streamSeekable() -*/ - -/*! - \fn void Phonon::AbstractMediaStream::writeData(const QByteArray &data) - - Sends the media \a data to the backend for decoding. - - Use this function to send data to the backend after needData() has - been called. - - If your stream is a push stream, data should be written until the - enoughData() function is called. For a pull stream, write data - once before the call to needData() function returns. - - If the data is depleted, call endOfData() instead of writeData(). - - \warning Don't call this function before the first needData() is emitted. - - \sa needData(), endOfData() - -*/ - -/*! - \fn void Phonon::AbstractMediaStream::endOfData() - - Tells the backend that the media data stream is at its end. - - \warning Don't call this function before the first needData() is emitted. - - \sa writeData(), needData() -*/ - -/*! - \fn void Phonon::AbstractMediaStream::error(Phonon::ErrorType errorType, const QString &errorString) - - If an I/O error occurs you should call this function to make - MediaObject go into ErrorState. \c errorType classifies the error, - while \a errorString is a textual description of the error suitable - for users of Phonon applications. - - \sa MediaObject::errorType(), MediaObject::errorString() -*/ - -/*! - \fn virtual void Phonon::AbstractMediaStream::reset() = 0 - - Reimplement this function to reset the stream. Subsequent calls to writeData should start - from the first position of the data unless a seek is requested. - - The function is necessary for the case where a non-seekable MediaStream is - played more than once. For a seekable stream the implementation can simply call - \snippet doc/src/snippets/code/doc_src_phonon-api.cpp 2 - - \sa writeData(), needData() -*/ - -/*! - \fn virtual void Phonon::AbstractMediaStream::needData() = 0 - - Reimplement this function to be notified when the backend needs data. - - When this function is called you should write data to the backend - (See writeData()). - - \sa writeData(), endOfData(), enoughData() -*/ - -/*! - \fn virtual void Phonon::AbstractMediaStream::enoughData() - - If your stream is a push stream, reimplement this function to be - notified when the backend has enough data and your stream object - may take a break. - - This method is important for pushing data to the backend in order - to not fill the backend buffer unnecessarily. - - \sa needData() -*/ - -/*! - \fn virtual void Phonon::AbstractMediaStream::seekStream(qint64 offset) - - Reimplement this function if your stream is seekable. - - When this function is called the next call to writeData has to be at the - requested \a offset. - - \warning Do not call the parent implementation. - - \sa setStreamSeekable(), streamSeekable(), needData() -*/ - -/*! - \class Phonon::BackendInterface - \inmodule Phonon - \since 4.4 - \brief Main Backend class interface - \internal - - This interface defines the main factory of the backend. The createObject() function creates all the - objects needed by the frontend. - - The objectDescriptionIndexes and objectDescriptionProperties functions return information about - available devices, effects and codecs. - - An implementation could look like this: - \snippet snippets/phonon/samplebackend/main.cpp snippet - -*/ - -/*! - \fn virtual Phonon::BackendInterface::~BackendInterface() - \internal - - Silence gcc's warning. -*/ - -/*! - \enum Phonon::BackendInterface::Class - \internal - - Classes that the createObject() function has to handle. - - \value MediaObjectClass Request to return a \c MediaObject object. - \value VolumeFaderEffectClass Request to return a \c VolumeFaderEffect - object. - \value AudioOutputClass Request to return an \c AudioOutput object. - \value AudioDataOutputClass Request to return an \c AudioDataOutput object. - \value VisualizationClass Request to return a \c Visualization object. - \value VideoDataOutputClass Request to return a \c VideoDataOutput object. - \value EffectClass Request to return a \c Effect object. - Takes an additional int that specifies the effect ID. - \value VideoWidgetClass Request to return a \c VideoWidget object. -*/ - -/*! - \fn virtual QObject *Phonon::BackendInterface::createObject(Class c, QObject *parent, const QList<QVariant> &args = QList<QVariant>()) = 0 - \internal - - Returns a new instance of the requested class. - - \param c The requested class. - \param parent The parent object. - \param args Additional arguments (documented in Class). -*/ - - -/*! - \fn virtual QList<int> Phonon::BackendInterface::objectDescriptionIndexes(ObjectDescriptionType type) const = 0 - \internal - - Returns the unique identifiers for the devices/effects/codecs of the given \a type. - - \param type see ObjectDescriptionType -*/ - -/*! - \fn virtual QHash<QByteArray, QVariant> Phonon::BackendInterface::objectDescriptionProperties(ObjectDescriptionType type, int index) const = 0 - \internal - - Given a unique identifier that was returned from objectDescriptionIndexes this function - returns a hash mapping property names to values. - - The property "name" must always be present. All other properties are optional. - - \table - \header \li Property \li Description - \row \li name \li The name of the device/effect/codec/... - \row \li description \li A text explaining what this device/effect/codec/... is/can do - \row \li icon \li An icon name (using the freedesktop naming scheme) or a QIcon for this - device/effect/codec/... - \row \li available \li A bool telling whether the device is present or unplugged. - \endtable - - \param type see ObjectDescriptionType - \param index The unique identifier that is returned from objectDescriptionIndexes -*/ - -/*! - \fn virtual bool Phonon::BackendInterface::startConnectionChange(QSet<QObject *>) = 0; - \internal - - When this function is called the nodes given in the parameter list should - not lose any signal data when connections are changed. -*/ - -/*! - \fn virtual bool Phonon::BackendInterface::connectNodes(QObject *, QObject *) = 0 - \internal - - Defines a signal connection between the two given nodes. -*/ - -/*! - \fn virtual bool Phonon::BackendInterface::disconnectNodes(QObject *, QObject *) = 0 - \internal - - Cuts a signal connection between the two given nodes. -*/ - -/*! - \fn virtual bool Phonon::BackendInterface::endConnectionChange(QSet<QObject *>) = 0 - \internal - - When this function is called the nodes given in the parameter list may lose - signal data when a port is not connected. -*/ - -/*! - \fn virtual QStringList Phonon::BackendInterface::availableMimeTypes() const = 0 - \internal - - Returns all available MIME types. -*/ - -/*! - \class Phonon::MediaSource - \inmodule Phonon - \inheaderfile Phonon/MediaSource - \since 4.4 - \brief The MediaSource class provides multimedia data for media objects. - - The MediaSource class manages a source of multimedia content, such - as a music or video file, of which data is given to a - \l{Phonon::}{MediaObject}. - - The media source knows how fetch its data from several sources, - e.g., from files, a QIODevice, or a CD. The possible source types - are described by the \l{MediaSource::}{Type} enum. The type of the - source is set by the media source itself, and is dependent on the - constructor used to create it. Note that it is possible to provide - data from any source by implementing a QIODevice. - - The class has several functions to acquire information about the - source it manages, e.g., fileName() and url(). The return from - these functions are dependent on the type() of the media source. - - Normally, a programmer does not need to be concerned with media - sources. It's constructors are implicit, so one can, for instance, - send an URL or filename directly to the constructors of the - \l{Phonon::}{MediaObject}. - - \snippet doc/src/snippets/code/doc_src_phonon-api.cpp 3 - - A MediaSource object cannot be reused for another multimedia - source. It is possible to play the same source again, and also - stop and start a non-seekable media source, such as a radio - stream, with the same MediaSource object. - - \section1 Qt Backends - - Currently, Qt's backends support files in local and remote - locations. Support for other sources, such as CD/DVD, are planned - for the future. - - \sa MediaObject, {Phonon Module} -*/ - -/*! - \enum Phonon::MediaSource::Type - - Identifies the type of media described by the MediaSource object. - - \value Invalid The MediaSource object does not describe any valid source. - \value LocalFile The MediaSource object describes a local file. - \value Url The MediaSource object describes an URL, which can be either a - local file or a file on the network. - \value Disc The MediaSource object describes a disc, e.g., a CD. - \value Stream The MediaSource object describes a data stream. - This is the type used for \l{QIODevice}s. Note - that a stream opened with a QUrl, will still be of the Url type. - \value Empty The media source doesn't have a source. - - \sa MediaSource::type() -*/ - -/*! - \fn Phonon::MediaSource::MediaSource() - \internal - - Creates an invalid MediaSource object. - - \sa Invalid -*/ - -/*! - \fn Phonon::MediaSource::MediaSource(const QString &fileName) - - Creates a MediaSource object for the file specified by \a - fileName. You can also use this constructor with \l{The Qt - Resource System}{Qt resources} - - \omit - \param fileName file name of a local media file or a Qt resource that was compiled in. - \endomit -*/ - -/*! - \fn Phonon::MediaSource::MediaSource(const QUrl &url) - - Creates a MediaSource object for a the URL specified by \a url. - - If the multimedia content you would like to play back is on a - remote network location, you should use this constructor; though, - it also possible to specify an URL to a local file. - - \sa QUrl -*/ - - -/*! - \fn Phonon::MediaSource::MediaSource(Phonon::DiscType discType, const QString &deviceName = QString()) - - Creates a MediaSource object for the type of disc specified by \a discType in the named - device referred to by \a deviceName. - - \note \a deviceName is a platform dependent device name. It can be useful to specify this - if the computer has more than one CD drive. On KDE, it is recommended to use the Solid - hardware discovery framework to retrieve the device name in a portable way. -*/ - -/*! - \fn Phonon::MediaSource::MediaSource(AbstractMediaStream *stream) - \internal - Creates a MediaSource object for a data stream. - - Your application can provide the media data by subclassing AbstractMediaStream and - passing a pointer to that object. Phonon will never delete the \a stream. - - \param stream The AbstractMediaStream subclass to provide the media data. - - \sa setAutoDelete -*/ - -/*! - \fn Phonon::MediaSource::MediaSource(QIODevice *ioDevice) - - Creates a MediaSource object for the QIODevice specified by \a ioDevice. - - This constructor can be very handy in the combination of - QByteArray and QBuffer. - - If you need to fetch multimedia data from a source that is not - supported by MediaSource, you should subclass QIODevice and use - this MediaSource constructor. It is important that you reimplement - QIODevice::isSequential(), as it is used by MediaSource to - determine if the media source is seekable. - - \a ioDevice is an arbitrary readable QIODevice subclass. If the device is not opened - MediaSource will open it as QIODevice::ReadOnly. - - \note Sequential devices can also be used, but MediaObject::isSeekable() will - return false as a result. - - \warning On Windows, we only support \l{QIODevice}s containing the - \c avi, \c mp3, or \c mpg formats. Use the constructor that takes - a file name to open files (the Qt backend does not use a QFile - internally). - - \sa setAutoDelete() -*/ - -/*! - \fn Phonon::MediaSource::MediaSource(MediaSourcePrivate &) - \internal -*/ - -/*! - \fn Phonon::MediaSource::~MediaSource() - - Destroys the MediaSource object. You should never delete a - MediaSource yourself, the MediaObject will handle this. - -*/ - -/*! - \fn Phonon::MediaSource::MediaSource(const MediaSource &other) - - Constructs a copy of the \a other media source. - - This constructor is fast thanks to explicit sharing. -*/ - -/*! - \fn MediaSource &Phonon::MediaSource::operator=(const MediaSource &other) - - Assigns the \a other media source to this media source and returns a - reference to it. - - This operation is fast thanks to explicit sharing. -*/ - -/*! - \fn bool Phonon::MediaSource::operator==(const MediaSource &other) const - - Returns true if this media source is equal to the \a other media source; - otherwise returns false. -*/ - -/*! - \fn void Phonon::MediaSource::setAutoDelete(bool enable) - - If \a enable is true, the media source will take ownership of the - object passed in the \l{Phonon::}{MediaSource}'s constructor - object that was passed in the constructor; otherwise, the - programmer is responsible for deletion of this object. - - This setting is false by default. If you enable it, you should - only access the stream or device as long as you keep the media - source object around. As long as you keep the media source - wrapping the stream or device, the object will not get deleted. - - \sa autoDelete() -*/ - -/*! - \fn bool Phonon::MediaSource::autoDelete() const - - Returns the setting of the auto-delete option. The default is - false. - - \sa setAutoDelete() -*/ - -/*! - \fn Type Phonon::MediaSource::type() const - - Returns the type of the MediaSource (depends on the constructor - that was used). - - \sa Type -*/ - -/*! - \fn QString Phonon::MediaSource::fileName() const - - Returns the file name of the MediaSource if type() == - LocalFile; otherwise, returns QString(). - - \sa type() -*/ - -/*! - \fn QUrl Phonon::MediaSource::url() const - Returns the URL of the MediaSource if type() == URL or type() == LocalFile; - otherwise returns QUrl(). - - \sa type() -*/ - -/*! - \fn Phonon::DiscType Phonon::MediaSource::discType() const - Returns the disc type of the MediaSource if type() == Disc; otherwise - returns NoDisc. - - \sa type() -*/ - -/*! - \fn QString Phonon::MediaSource::deviceName() const - - Returns the device name of the MediaSource if type() == Disc; otherwise - returns QString(). - - \sa type() -*/ - -/*! - \fn AbstractMediaStream *Phonon::MediaSource::stream() const - \internal - Returns the media stream of the MediaSource if type() == Stream; otherwise - returns 0. - QIODevices are handled as streams, too. -*/ - -/*! - \class Phonon::MediaSourcePrivate - \inmodule Phonon - \since 4.4 - \internal -*/ - -/*! - \class Phonon::SeekSlider - \inmodule Phonon - \inheaderfile Phonon/SeekSlider - \since 4.4 - \brief The SeekSlider class provides a slider for seeking to positions in media streams. - - The SeekSlider connects to a \l{Phonon::}{MediaObject}, and - controls the seek position in the object's media stream. - - The slider will connect to the necessary signals to keep track of - the sliders maximum, minimum, and current values. It will also - disable itself for non-seekable streams, and update the media - object when the current value of the slider changes. - - Here follows a typical example of SeekSlider usage: - - \snippet doc/src/snippets/seekslider.cpp 0 - - \sa Phonon::VolumeSlider, Phonon::VideoWidget, {Music Player Example}, {Phonon Module} - -*/ - -/*! - \property Phonon::SeekSlider::iconVisible - \brief whether the icon next to the slider is visible - - By default the icon is visible if the platform provides an icon; else - it's hidden. - -*/ - -/*! - \property Phonon::SeekSlider::tracking - \brief whether slider tracking is enabled - - If tracking is enabled (the default), the media seeks - while the slider is being dragged. If tracking is - disabled, the media seeks only when the user - releases the slider. -*/ - -/*! - \property Phonon::SeekSlider::pageStep - \brief the page step interval - - The larger of two natural steps that a slider provides and - typically corresponds to the user pressing PageUp or PageDown. - - Defaults to 5 seconds. -*/ - -/*! - \property Phonon::SeekSlider::singleStep - \brief the single step interval - - The smaller of two natural steps that a slider provides and - typically corresponds to the user pressing an arrow key. - - Defaults to 0.5 seconds. -*/ - -/*! - \property Phonon::SeekSlider::orientation - \brief the orientation of the slider - - The orientation must be Qt::Vertical or Qt::Horizontal (the default). -*/ - -/*! - \property Phonon::SeekSlider::iconSize - \brief the icon size used for the mute button/icon. - - The default size is defined by the GUI style. -*/ - -/*! - \fn explicit Phonon::SeekSlider::SeekSlider(QWidget *parent = 0) - - Constructs a seek slider widget with the given \a parent. -*/ - -/*! - \fn explicit Phonon::SeekSlider::SeekSlider(MediaObject *media, QWidget *parent = 0) - - Constructs a seek slider widget for the specified \a media with the - given \a parent. -*/ - -/*! - \fn Phonon::SeekSlider::~SeekSlider() - Destroys the seek slider. -*/ - -/*! - \fn Phonon::MediaObject *Phonon::SeekSlider::mediaObject() const - - Return the media object this SeekSlider controls. -*/ - -/*! - \class Phonon::SeekSliderPrivate - \inmodule Phonon - \since 4.4 - \internal -*/ - -/*! - \fn void Phonon::SeekSlider::setMediaObject(MediaObject *media) - - Sets the media object to be controlled by this slider to the \a media specified. -*/ - -/*! - \class Phonon::VideoPlayer - \inmodule Phonon - \inheaderfile Phonon/VideoPlayer - \since 4.4 - \brief The VideoPlayer widget is used to perform playback of video. - - With VideoPlayer you can get results quickly and easily. You can - do the standard playback tasks like play(), pause(), and stop(), - but also set a playback volume and seek - if the media and backend - supports seeking. - - VideoPlayer is provided for convenience and removes the need to - create a media graph with a \l{Phonon::}{MediaObject}, - \l{Phonon::}{AudioOutput}, and \l{Phonon::}{VideoWidget}. If - you need functionality not supported by the player, you can build - this \l{Building Graphs}{graph} yourself. - - Keep in mind that when the VideoPlayer instance is deleted the - playback will stop. - - 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 play() function. - - A play and forget code example: - \snippet doc/src/snippets/code/doc_src_phonon-api.cpp 4 - - \sa {Phonon Module}, MediaObject -*/ - -/*! - \fn Phonon::VideoPlayer::VideoPlayer(QWidget *parent = 0) - - Constructs a new video widget with a \a parent using - Phonon::VideoCategory as its category. - - \param parent The QObject parent. -*/ - -/*! - \fn Phonon::VideoPlayer::VideoPlayer(Phonon::Category category, QWidget *parent = 0) - - Constructs a new VideoPlayer instance with the specified \a - parent. - - \a category is the category used for the audio output device. -*/ - -/*! - \fn Phonon::VideoPlayer::~VideoPlayer() - - 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 - VideoPlayer but MediaObject, VideoPath and VideoOutput. -*/ - -/*! - \fn qint64 Phonon::VideoPlayer::totalTime() const - - Get the total time (in milliseconds) of the file currently being played. -*/ - -/*! - \fn qint64 Phonon::VideoPlayer::currentTime() const - - Get the current time (in milliseconds) of the file currently being played. -*/ - -/*! - \fn float Phonon::VideoPlayer::volume() const - - This is the current volume of the output as voltage factor. - - 1.0 means 100%, 0.5 means 50% voltage/25% power, 0.0 means 0% -*/ - -/*! - \fn bool Phonon::VideoPlayer::isPlaying() const - - Returns true if it is currently playing; otherwise returns false if it - is currently stopped or paused -*/ - -/*! - \fn bool Phonon::VideoPlayer::isPaused() const - - Returns true if it is currently paused; otherwise returns false if it - is currently playing or stopped. -*/ - -/*! - \fn void Phonon::VideoPlayer::load(const Phonon::MediaSource &source) - - Starts pre-loading the media data from the specified \a source and - filling audio buffers in the backend. - - When there's already a media playing (or paused) it will be stopped - (the finished signal will not be emitted). - - \sa MediaObject::setCurrentSource() -*/ - -/*! - \fn void Phonon::VideoPlayer::play(const Phonon::MediaSource &source) - - Plays the media from the given \a source. Starts playback as fast as - possible. - This can take a considerable time depending on the URL and the - backend. - - If you need low latency between calling play() and the sound actually - starting to play on your output device you need to use MediaObject - and be able to set the URL before calling play(). Note that - \snippet doc/src/snippets/code/doc_src_phonon-api.cpp 5 - 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. -*/ - -/*! - \fn void Phonon::VideoPlayer::play() - - Continues playback of paused media. Restarts playback of a stopped - (or newly loaded) media. - - \sa MediaObject::play(), play() -*/ - -/*! - \fn void Phonon::VideoPlayer::pause() - - Pauses the playback. - - \sa MediaObject::pause() -*/ - -/*! - \fn void Phonon::VideoPlayer::stop() - - Stops the playback. - - \sa MediaObject::stop() -*/ - -/*! - \fn void Phonon::VideoPlayer::seek(qint64 ms) - - 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 VideoPlayer. - - \snippet doc/src/snippets/videomedia.cpp 0 - - The \a ms parameter is the time in milliseconds from the start of - the media. - - The call is asynchronous, so currentTime() 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 SeekSlider. - - \sa MediaObject::seek(), MediaObject::isSeekable(), mediaObject() -*/ - -/*! - \fn void Phonon::VideoPlayer::setVolume(float volume) - - Sets the \a volume of the output as voltage factor. - - 1.0 means 100%, 0.5 means 50% voltage/25% power, 0.0 means 0% -*/ - -/*! - \fn MediaObject *Phonon::VideoPlayer::mediaObject() const - - Returns the media object being used by the player. - - The media object can be accessed directly instead of using the - \l{VideoPlayer}s convenience functions, e.g., play() and stop(). - It is also possible to give the object to other Phonon widgets, - e.g., a \l{Phonon::}{SeekSlider} or a \l{Phonon::}{VolumeSlider}. - - \sa Phonon::SeekSlider, Phonon::MediaObject -*/ - -/*! - \fn AudioOutput *Phonon::VideoPlayer::audioOutput() const - - Returns the audio output object being used by the player. - -*/ - -/*! - \fn VideoWidget *Phonon::VideoPlayer::videoWidget() const - - Returns the video widget being used by the player. -*/ - -/*! - \fn void Phonon::VideoPlayer::finished() - - This signal is emitted when the playback finished. - -*/ - -/*! - \class Phonon::VideoWidgetPrivate - \inmodule Phonon - \since 4.4 - \internal -*/ - -/*! - \class Phonon::MediaObject - \inmodule Phonon - \inheaderfile Phonon/MediaObject - \since 4.4 - \brief The MediaObject class provides an interface for media playback. - - The media object manages a \l{Phonon::}{MediaSource}, which - supplies the media object with multimedia content, e.g., from a - file. A playback in Phonon is always started by calling the - \l{Phonon::MediaObject::}{play()} function. - - The state of play (play, pause, stop, seek) is controlled by the - media object, and you can also query the current - \l{Phonon::MediaObject::}{state()}. It keeps track of the playback - position in the media stream, and emits the - \l{Phonon::MediaObject::}{tick()} signal when the current position - in the stream changes. - - Notice that most functions of this class are asynchronous, so you - cannot rely on that a state is entered after a function call - before you receive the \l{Phonon::MediaObject::}{stateChanged()} - signal. The description of the \l{Phonon::}{State} enum gives a - description of the different states. - - Before play() is called, the media object should be connected to - \l{Sinks}{output nodes}, which outputs the media to the - underlying hardware. The output nodes required are dependent on - the contents of the multimedia file that is played back. Phonon - has currently two output nodes: the \l{Phonon::}{AudioOutput} for - audio content and \l{Phonon::}{VideoWidget} for video content. If - a \l{Phonon::}{MediaSource} contains both audio and video, both - nodes need to be connected to the media object. - - \snippet snippets/phonon.cpp 4 - \snippet snippets/phonon.cpp 5 - - The media object can queue sources for playback. When it has - finished to play one source, it will start playing the next in the - queue; the new source is then removed from the queue. The - queue can be altered at any time. - - \snippet doc/src/snippets/code/doc_src_phonon-api.cpp 7 - - You can also make use of the - \l{Phonon::MediaObject::}{aboutToFinish()} signal, which is - guaranteed to be emitted in time for altering the queue. - - \snippet doc/src/snippets/code/doc_src_phonon-api.cpp 8 - - When playback is finishing, i.e., when a media source has been - played to the end and the queue is empty, several signals are - emitted. First, the media object will emit aboutToFinish() - - shortly before the playback has finished - and then finished(). - The stateChanged() signal will also be emitted with - \l{Phonon::}{PausedState}, which is the state the media object - takes when the playback is finished. If you wish to enter another - state, you can connect a slot to finished() and set a new state - there. - - The media object resolves the meta information, such as title, - artist, and album. The meta data is not resolved immediately after - a new source is provided, but will be resolved before the object - leaves the \l{Phonon::}{LoadingState}. The data is queried by - string keys - which should follow the Ogg Vorbis specification - \l http://xiph.org/vorbis/doc/v-comment.html - or by using the - \l{Phonon::}{MetaData} enum. The data available will depend on the - type and content of the individual media files. metaDataChanged() - will be emitted when the media object has resolved new meta data. - - Errors encountered during playback and loading of media sources - are reported by emitting a state changed signal with - \l{Phonon::}{ErrorState}. The severity of the error can be queried - by the \l{Phonon::}{ErrorType}. With a \l{Phonon::}{NormalError}, - it might be possible to continue the playback, for instance, if - only audio playback fails for a media source which also has video. - A \l{Phonon::}{FatalError} indicates that Phonon cannot continue - playback of the current source, but it is possible to try with a - different one. A user readable error message is given by - errorString(). - - \sa Phonon::MediaSource, Phonon::AudioOutput, VideoWidget, - {Music Player Example}, {Phonon Overview}, Phonon::VideoPlayer, - Phonon::createPlayer(), {Phonon Module} - -*/ - -/*! - \property Phonon::MediaObject::transitionTime - \brief Defines the time between playback of two media sources - in the media queue. - - A positive transition time defines a gap of silence between queued - media sources. - - A transition time of 0 ms requests gapless playback (i.e., the - next source in the media queue starts immediately after the - playback of the current source finishes). - - A negative transition time defines a crossfade between the queued - media sources. - - Defaults to 0 (gapless playback). - - \warning This feature might not work reliably with every - backend. -*/ - -/*! - \property Phonon::MediaObject::prefinishMark - \brief the time when the prefinishMarkReached signal is emitted before playback ends. - - This property specifies the time in milliseconds the - prefinishMarkReached() signal is emitted before the playback - finishes. A value of \c 0 disables the signal. The signal is only - emitted for the last source in the \l{queue()}{media queue}. - - Defaults to \c 0 (disabled). - - \warning For some media data the total time cannot be determined - accurately, therefore the accuracy of the prefinishMarkReached signal - can be bad sometimes. Still, it is better to use this method than to - look at totalTime() and currentTime() to emulate the behavior - because the backend might have more information available than your - application does through totalTime() and currentTime(). - - \sa prefinishMarkReached() -*/ - -/*! - \property Phonon::MediaObject::tickInterval - \brief The time interval in milliseconds between two ticks. - - The tick() signal is emitted continuously during playback. - The tick interval is the time that elapses between the emission of two tick signals. - If you set the interval to \c 0 the tick signal gets disabled. - - The tick() signal can, for instance, be used to update widgets - that show the current position in the playback of a media source. - - Defaults to \c 0 (disabled). - - \warning The back-end is free to choose a different tick interval close - to what you asked for. This means that the following code \c may fail: - \snippet doc/src/snippets/code/doc_src_phonon-api.cpp 9 - On the other hand the following is guaranteed: - \snippet doc/src/snippets/code/doc_src_phonon-api.cpp 10 - - \sa tick() -*/ - -/*! - \fn Phonon::MediaObject::~MediaObject() - - Destroys the MediaObject. -*/ - -/*! - \fn State Phonon::MediaObject::state() const - - Returns the current Phonon::State of the object. - - \sa Phonon::State, stateChanged() -*/ - -/*! - \fn bool Phonon::MediaObject::hasVideo() const - - Check whether the current media source includes a video stream. - - \warning This information is not resolved immediately after a - media object gets a new source. Listen to the hasVideoChanged() - signal instead. - - \snippet doc/src/snippets/code/doc_src_phonon-api.cpp 11 - - Returns \c true if the media contains video data; otherwise, - returns \c false. - - \sa hasVideoChanged() -*/ - -/*! - \fn bool Phonon::MediaObject::isSeekable() const - - Check whether it is possible to seek, i.e., change the - playback position in the media stream. - - \warning This information is not solved immediately after the - media object gets a new media source. The hasVideoChanged() signal - is emitted after this information is available. - - \snippet doc/src/snippets/code/doc_src_phonon-api.cpp 12 - - Returns \c true if the current media may be seeked; otherwise, - returns \c false. - - \sa seekableChanged() -*/ - -/*! - \fn QStringList Phonon::MediaObject::metaData(const QString &key) const - - Returns the strings associated with the given \a key. - - Backends should use the keys specified in the Ogg Vorbis - documentation: \l http://xiph.org/vorbis/doc/v-comment.html - - Therefore the following should work with every backend: - - Note that meta data is not resolved before the \c - metaDataChanged() signal is emitted. - - A typical usage looks like this: - - \snippet doc/src/snippets/code/doc_src_phonon-api.cpp 13 -*/ - -/*! - \fn QStringList Phonon::MediaObject::metaData(Phonon::MetaData key) const - - Returns the strings associated with the given \a key. - - Same as above except that the keys are defined in the - Phonon::MetaData enum. - - \sa metaDataChanged() -*/ - -/*! - \fn QMultiMap<QString, QString> Phonon::MediaObject::metaData() const - - Returns all meta data in a multi map. - - \sa metaDataChanged() -*/ - -/*! - \fn QString Phonon::MediaObject::errorString() const - - Returns a human-readable description of the last error that occurred. - The strings given may vary between backends. - - The error description can be used to give a message to the user - - and the developer - when the stateChanged() signal is emitted with - \l{Phonon::}{ErrorState}. - - \section1 Qt Backends - - On Windows, Qt fetches its error messages from the DirectShow - backend. This usually includes an error number, which can be - looked up in the DirectShow documentation: - \l{http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dx81_c/directx_cpp/htm/errorandsuccesscodes.asp}. - - On Linux and Mac, the error strings are not fetched directly from - the backend, but are created in the backend. - - \sa Phonon::ErrorState, stateChanged() -*/ - -/*! - \fn ErrorType Phonon::MediaObject::errorType() const - - Tells your program what to do about the last error that occurred. - Use this function after receiving a stateChanged() signal with - \l{Phonon::}{ErrorState}. - - \sa Phonon::ErrorType, Phonon::ErrorState, stateChanged() -*/ - -/*! - \fn MediaSource Phonon::MediaObject::currentSource() const - - Returns the current media source, i.e., the media source that is - being played back. The current source is either set with - setCurrentSource() or taken from the media queue() when a media - source has finished playing. - - \sa setCurrentSource() -*/ - -/*! - \fn void Phonon::MediaObject::setCurrentSource(const MediaSource &source) - - Set the media source the MediaObject should use. - - After the media object receives a new source, it will enter the - \l{Phonon::}{LoadingState}. When it is ready to play, it - enters the \l{Phonon::}{StoppedState} unless another state - has been requested, e.g., by calling play(). - - \a source is the MediaSource object to the media data. You can - just as well use a QUrl or QString (for a local file) here. - - We show an example: - - \snippet doc/src/snippets/code/doc_src_phonon-api.cpp 14 - - \sa currentSource(), MediaSource -*/ - -/*! - \fn QList<MediaSource> Phonon::MediaObject::queue() const - - Returns the queued media sources. - - This does list does not include the current source, - returned by currentSource(). - - \sa enqueue() -*/ - -/*! - \fn void Phonon::MediaObject::setQueue(const QList<MediaSource> &sources) - - Set the \a sources to play when the current source has finished. - - This function will overwrite the current queue. - - \sa clearQueue(), enqueue() -*/ - -/*! - \fn void Phonon::MediaObject::setQueue(const QList<QUrl> &urls) - - Set the \a urls to play when the current media has finished. - - This function overwrites the current queue. - - \sa clearQueue(), enqueue() -*/ - -/*! - \fn void Phonon::MediaObject::enqueue(const MediaSource &source) - - Appends \a source to the queue. - - You can use this function to provide the next source after the - aboutToFinish() signal has been emitted. - - \sa aboutToFinish(), setQueue(), clearQueue() -*/ - -/*! - \fn void Phonon::MediaObject::enqueue(const QList<MediaSource> &sources) - - Appends multiple \a sources to the queue. - - \sa setQueue(), clearQueue() -*/ - -/*! - \fn void Phonon::MediaObject::enqueue(const QList<QUrl> &urls) - - Appends the URLs in \a urls to the media source queue. - - The function will create \l{MediaSource}s from the \l{QUrl}s, and - append these to the queue. - - \sa setQueue(), clearQueue() -*/ - -/*! - \fn void Phonon::MediaObject::clearQueue() - - Clears the queue of media sources. - - \sa queue(), enqueue() -*/ - -/*! - \fn qint64 Phonon::MediaObject::currentTime() const - - Returns the current time (in milliseconds), i.e., position in the - media stream, of the file currently being played. - - \sa tick(), totalTime(), remainingTime() -*/ - -/*! - \fn qint64 Phonon::MediaObject::totalTime() const - - Get the total time (in milliseconds) of the file currently being played. - - Returns the total time in milliseconds. - - \warning The total time is not defined before the media object - enters the \l{Phonon::}{LoadingState}. - - \sa totalTimeChanged() -*/ - -/*! - \fn qint64 Phonon::MediaObject::remainingTime() const - - Get the remaining time (in milliseconds) of the file currently being played. - - Returns the remaining time in milliseconds. - - \sa totalTime(), currentTime(), totalTimeChanged() -*/ - -/*! - \fn void Phonon::MediaObject::play() - - Requests playback of the media data to start. - - Playback starts when the stateChanged() signal is emitted with - \l{Phonon::}{PlayingState}. - - If the media object is already in a - \l{Phonon::}{PlayingState}, nothing happens. - - \sa stop(), pause(), stateChanged() -*/ - -/*! - \fn void Phonon::MediaObject::pause() - - Requests playback to pause, and the media object to enter the - \l{Phonon::}{PausedState}. If it was paused already, nothing - changes. - - This function is asynchronous and the media might not be paused - immediately. - - \sa play(), stop(), stateChanged() -*/ - -/*! - \fn void Phonon::MediaObject::stop() - - Requests playback to stop, and the media object to enter the - \l{Phonon::}{StoppedState}. If it was stopped before - nothing changes. - - This function is asynchronous and the media might not be - stopped immediately. - - \sa play(), pause(), stateChanged() -*/ - -/*! - \fn void Phonon::MediaObject::seek(qint64 time) - - Requests a seek to the \a time indicated, specified in milliseconds. - - You can only seek if state() is PlayingState, BufferingState or PausedState. - - The call is asynchronous, so currentTime 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 SeekSlider. - - If the current source of the media object is not seekable, calls - to this functions do nothing. - - \sa SeekSlider, tick() -*/ - -/*! - \fn void Phonon::MediaObject::clear() - - Stops and removes all playing and enqueued media sources. - - \sa setCurrentSource() -*/ - - -/*! - \fn void Phonon::MediaObject::stateChanged(Phonon::State newstate, Phonon::State oldstate) - - This signal is emitted when the state of the MediaObject has changed. - The \a oldstate and \a newstate parameters indicate the previous - state and current state of the media object. - - If you are only interested in the new state of the media object, you can - connect this signal to a slot that accepts only one State argument. -*/ - -/*! - \fn void Phonon::MediaObject::tick(qint64 time) - - This signal is emitted in intervals defined by the - \l{tickInterval} property. The current position of the media - object in the stream is given by the \a time parameter. The \a - time is specified in milliseconds. - - \sa tickInterval -*/ - -/*! - \fn void Phonon::MediaObject::metaDataChanged() - - This signal is emitted when the media object has resolved new meta - data. This will happen before the media object leaves the - \l{Phonon::}{LoadingState} after a new source has been set. - - This signal is not emitted when the media object removes the - current data, i.e., when a new source is set or an error has - occurred. If you need to know this, you can listen for the - \l{Phonon::}{ErrorState}, and connect to the - \l{Phonon::MediaObject::}{currentSourceChanged()} signal. - - You can get the new meta data with the metaData methods. - - \sa metaData(), currentSourceChanged(), stateChanged(), Phonon::State -*/ - -/*! - \fn void Phonon::MediaObject::seekableChanged(bool isSeekable) - - This signal is emitted when the media object's ability to seek in - the media stream changes. \a isSeekable is true if it is possible - to seek(); otherwise, it is false. - - Change in the ability to seek in the stream usually happens when - the current source changes or when an error occurs. - - \omit Emitted whenever the return value of isSeekable() - changes. \endomit - - Normally you'll check isSeekable() after setting a new media - source, and then let this signal tell you when seeking is - possible. That way you don't have to poll isSeekable(). -*/ - -/*! - \fn void Phonon::MediaObject::hasVideoChanged(bool hasVideo) - - Emitted whenever the return value of hasVideo() changes, i.e., - the media source being played back contains video. - - Normally you'll check hasVideo() first and then let this signal - tell you whether video is available now or not. That way you - don't have to poll hasVideo(). - - \a hasVideo is true when the stream contains video and adding a - VideoWidget will show a video, and false if there is no video data - in the stream and adding a VideoWidget will show an empty (black) - VideoWidget. -*/ - -/*! - \fn void Phonon::MediaObject::bufferStatus(int percentFilled) - - Provides information about the status of the buffer. - - When a MediaObject is in the \l{Phonon::}{BufferingState}, it will - send this signal regularly. \a percentFilled is a number between 0 - and 100 telling you how much the buffer is filled. - - You can use this signal to show a progress bar to the user when - in BufferingState: - - \snippet doc/src/snippets/code/doc_src_phonon-api.cpp 15 - - Note that the \l{Phonon::}{BufferingState} is commonly used when - waiting for data over a network connection, but this might not be - true for all backends. -*/ - -/*! - \fn void Phonon::MediaObject::finished() - - Emitted when the object has finished playback. It is not emitted - if you call stop(), pause() or load(). It is emitted only when the - current media source has finished playing and the media queue() is - empty, or when a \l{Phonon::FatalError}{fatal error} occurs. - - \warning This signal is not emitted when the current source has - finished and there's another source in the queue. It is only - emitted when the queue is empty. - - \sa currentSourceChanged(), aboutToFinish(), prefinishMarkReached() -*/ - -/*! - \fn void Phonon::MediaObject::currentSourceChanged(const Phonon::MediaSource &newSource) - - Emitted when the MediaObject fetches a new MediaSource from the - queue() and before it enters the \l{Phonon::}{LoadingState} for - the new source. The media object will take a new source from the - queue() when it has finished the playback of the - \l{currentSource()}{current source}. - - \a newSource is the source that starts to play at the time the - signal is emitted. -*/ - -/*! - \fn void Phonon::MediaObject::aboutToFinish() - - Emitted before the playback of the whole queue ends. When this - signal is emitted you still have time to enqueue() a new - MediaSource, so that playback continues. - - If you need a signal to be emitted at a specific time before - playback is finished, you should use the prefinishMarkReached() - signal instead. - - \sa enqueue(), prefinishMark, prefinishMarkReached() -*/ - -/*! - \fn void Phonon::MediaObject::prefinishMarkReached(qint32 msecToEnd) - - Emitted when there are only \a msecToEnd milliseconds left - of playback. - - \warning This signal is not emitted when there is another source - in the queue. It is only emitted when the queue is empty. - - \sa setPrefinishMark(), prefinishMark(), aboutToFinish(), finished() -*/ - -/*! - \fn void Phonon::MediaObject::totalTimeChanged(qint64 newTotalTime) - - This signal is emitted as soon as the total time of the media file is - known or has changed. For most non-local media data the total - time of the media can only be known after some time. At that time the - totalTime function can not return useful information. You have - to wait for this signal to know the real total time. - - \a newTotalTime is the length of the media file in milliseconds. - - \sa totalTime() -*/ - -/*! - \fn MediaObject *Phonon::createPlayer(Phonon::Category category, const MediaSource &source = MediaSource()) - - Convenience function to create a MediaObject and AudioOutput - connected by a path. The \l{Phonon::}{MediaObject} return will - have \a source set as its current source and the specified \a - category. - -*/ - -/*! - \class Phonon::MediaObjectPrivate - \inmodule Phonon - \since 4.4 - \internal -*/ - -/*! - \namespace Phonon::BackendCapabilities - \inmodule Phonon - \since 4.4 - \brief The BackendCapabilities namespace contains functions to describe the capabilities of the multimedia backend. - -*/ - -/*! - \class Phonon::BackendCapabilitiesPrivate - \inmodule Phonon - \since 4.4 - \internal -*/ - -/*! - \class Phonon::BackendCapabilities::Notifier - \since 4.4 - \inmodule Phonon - \inheaderfile Phonon/BackendCapabilities - - Notifications about backend capabilities. -*/ - -/*! - \fn void Phonon::BackendCapabilities::Notifier::capabilitiesChanged() - - This signal is emitted if the capabilities have changed. This can - happen if the user has requested a backend change. -*/ - -/*! - \fn void Phonon::BackendCapabilities::Notifier::availableAudioOutputDevicesChanged() - - This signal is emitted when audio output devices were plugged or - unplugged. - - Check BackendCapabilities::availableAudioOutputDevices to get the - current list of available devices. -*/ - -/*! - \fn Notifier *Phonon::BackendCapabilities::notifier() - - Use this function to get a QObject pointer to connect to the capabilitiesChanged signal. - - \return a pointer to a QObject. - - The capabilitiesChanged signal is emitted if the capabilities have changed. This can - happen if the user has requested a backend change. - - To connect to this signal do the following: - \snippet doc/src/snippets/code/doc_src_phonon-api.cpp 16 - - \sa Notifier::capabilitiesChanged() -*/ - -/*! - \fn QStringList Phonon::BackendCapabilities::availableMimeTypes() - - Returns a list of mime types that the Backend can decode. - - \sa isMimeTypeAvailable() -*/ - -/*! - \fn bool Phonon::BackendCapabilities::isMimeTypeAvailable(const QString &mimeType) - - Often all you want to know is whether one given MIME type can be - decoded by the backend. Use this method in favor of - availableMimeTypes() as it can give you a negative answer without - having a backend loaded. - - Returns true if the given \a mimeType is supported by the backend; - otherwise, returns false. - - \sa availableMimeTypes() -*/ - -/*! - \fn QList<AudioOutputDevice> Phonon::BackendCapabilities::availableAudioOutputDevices() - - Returns the audio output devices the backend supports. - - \return A list of AudioOutputDevice objects that give a name and - description for every supported audio output device. -*/ - -/*! - \fn QList<EffectDescription> Phonon::BackendCapabilities::availableAudioEffects() - - Returns descriptions for the audio effects the backend supports. - - \return A list of AudioEffectDescription objects that give a name and - description for every supported audio effect. -*/ - -/*! - \internal - \class ObjectDescriptionModelData - \internal - \inmodule Phonon - \brief Data class for models for ObjectDescription objects. -*/ - -/*! - \typedef Phonon::EffectDescription - \relates Phonon::ObjectDescription - - EffectDescription gives a description of an \l{Processors}{audio - effect}. It is a typedef of the \l{Phonon::}{ObjectDescription} - class. Please see its class description for details. - - EffectDescription is used to create audio \l{Phonon::}{Effect}s, - which can be inserted into a media graph, altering an audio - stream. - - \sa Phonon::ObjectDescription, {Capabilities Example}, {Media - Player} - -*/ - -/*! - \class Phonon::ObjectDescriptionModel - \inmodule Phonon - \internal - \since 4.4 - \brief The ObjectDescriptionModel class provides a model from - a list of ObjectDescription objects. - - ObjectDescriptionModel is a read only model that supplies a list - using ObjectDescription::name() for the text and - ObjectDescription::description() for the tooltip. If set the properties - "icon" and "available" are used to set the decoration and disable the - item (disabled only visually, you can still select and drag it). - - It also provides the methods moveUp() and moveDown() to order the list. - Additionally drag and drop is possible so that - QAbstractItemView::InternalMove can be used. - The resulting order of the ObjectDescription::index() values can then be - retrieved using tupleIndexOrder(). - - An example use case would be to give the user a QComboBox to select - the output device: - \snippet doc/src/snippets/code/doc_src_phonon-api.cpp 17 - - And to retrieve the selected AudioOutputDevice: - \snippet doc/src/snippets/code/doc_src_phonon-api.cpp 18 - -*/ - -/*! - \fn inline int Phonon::ObjectDescriptionModel::rowCount(const QModelIndex &parent = QModelIndex()) const - - Returns the number of rows in the model. This value corresponds - to the size of the list passed through setModelData. - - \param parent The optional \a parent argument is used in most models to specify - the parent of the rows to be counted. Because this is a list if a - valid parent is specified the result will always be 0. - - Reimplemented from QAbstractItemModel. - - \sa QAbstractItemModel::rowCount() -*/ - -/*! - \fn inline QVariant Phonon::ObjectDescriptionModel::data(const QModelIndex &index, int role = Qt::DisplayRole) const - - Returns data from the item with the given \a index for the specified - \a role. - If the view requests an invalid index, an invalid variant is - returned. - - Reimplemented from QAbstractItemModel. - - \sa QAbstractItemModel::data(), Qt::ItemDataRole -*/ - -/*! - \fn inline Qt::ItemFlags Phonon::ObjectDescriptionModel::flags(const QModelIndex &index) const - \internal - - Reimplemented to show unavailable devices as disabled (but still - selectable). The \a index of the model index for which to return - flags. - -*/ - -/*! - \fn inline QList<int> Phonon::ObjectDescriptionModel::tupleIndexOrder() const - - Returns a list of indexes in the same order as they are in the - model. The indexes come from the ObjectDescription::index - method. - - This is useful to let the user define a list of preference. -*/ - -/*! - \fn inline int Phonon::ObjectDescriptionModel::tupleIndexAtPositionIndex(int positionIndex) const - - Returns the ObjectDescription::index for the tuple - at the given position \a positionIndex. For example a - QComboBox will give you the currentIndex as the - position in the list. But to select the according - AudioOutputDevice using AudioOutputDevice::fromIndex - you can use this method. - - \param positionIndex The position in the list. -*/ - -/*! - \class Phonon::ObjectDescriptionModelDataPrivate - \inmodule Phonon - \since 4.4 - \internal -*/ - -/*! - \fn inline QMimeData *Phonon::ObjectDescriptionModel::mimeData(const QModelIndexList &indexes) const - \internal - - Returns the MIME data that dropMimeData() can use to create new - items. -*/ - -/*! - \fn inline void Phonon::ObjectDescriptionModel::moveUp(const QModelIndex &index) - - Moves the item at the given \a index up. In the resulting list - the items at index.row() and index.row() - 1 are swapped. - - Connected views are updated automatically. -*/ - -/*! - \fn inline void Phonon::ObjectDescriptionModel::moveDown(const QModelIndex &index) - - Moves the item at the given \a index down. In the resulting list - the items at index.row() and index.row() + 1 are swapped. - - Connected views are updated automatically. -*/ - -/*! - \fn explicit inline Phonon::ObjectDescriptionModel::ObjectDescriptionModel(QObject *parent = 0) - - Constructs a ObjectDescription model with the - given \a parent. -*/ - -/*! - \fn explicit inline Phonon::ObjectDescriptionModel::ObjectDescriptionModel(const QList<ObjectDescription<type> > &data, QObject *parent = 0) - - Constructs a ObjectDescription model with the - given \a parent and the given \a data. -*/ - -/*! - \fn inline void Phonon::ObjectDescriptionModel::setModelData(const QList<ObjectDescription<type> > &data) - - Sets the model data using the list provided by \a data. - - All previous model data is cleared. -*/ - -/*! - \fn inline QList<ObjectDescription<type> > Phonon::ObjectDescriptionModel::modelData() const - - Returns the model data. - - As the order of the list might have changed this can be different - to what was set using setModelData(). -*/ - -/*! - \fn inline ObjectDescription<type> Phonon::ObjectDescriptionModel::modelData(const QModelIndex &index) const - - Returns one ObjectDescription of the model data for the given \a index. -*/ - -/*! - \fn inline Qt::DropActions Phonon::ObjectDescriptionModel::supportedDropActions() const - - This model supports drag and drop to copy or move - items. -*/ - -/*! - \fn inline bool Phonon::ObjectDescriptionModel::dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) - - Accept drops from other models of the same ObjectDescriptionType. - - The \a data is dropped at the given \a row and \a column; you - also receive the \a parent model index. - - If a valid \a parent is given the dropped items will be inserted - above that item. -*/ - -/*! - \fn inline bool Phonon::ObjectDescriptionModel::removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) - - Removes count rows starting with the given row. - - If a valid \a parent is given no rows are removed since this is a - list model. - - Returns true if the rows were successfully removed; otherwise returns false. -*/ - -/*! - \fn inline QStringList Phonon::ObjectDescriptionModel::mimeTypes() const - - Returns a list of supported drag and drop MIME types. Currently - it only supports one type used internally. -*/ - -/*! - \class Phonon::EffectInterface - \inmodule Phonon - \since 4.4 - \internal -*/ - -/*! - \class Phonon::Effect - \inmodule Phonon - \inheaderfile Phonon/Effect - \since 4.4 - \brief The Effect class is used to transform audio streams. - - An effect is a media node which is inserted into a path between a - \l{Phonon::}{MediaObject} and an audio output node, for instance, - an \l{Phonon::}{AudioOutput}. The Effect transforms the media - stream on that path. - - Examples may include simple modifiers, such as fading or pitch - shifting, and more complex mathematical transformations. You can - query the backend for available effects with - BackendCapabilities::availableAudioEffects(). Note that the - effects available is dependent on the underlying system - (DirectDraw, GStreamer, or QuickTime). - - In order to use an effect, insert it into the path as follows: - - \snippet doc/src/snippets/code/doc_src_phonon-api.cpp 19 - - The effect will immediately begin applying it's transformations on - the path. To stop it, remove the Effect from the path. - - To create an effect, you use the \l{Phonon::}{EffectDescription} - class, which you get from - \l{BackendCapabilities::}{availableAudioEffects()}. We give a code - example below. - - \snippet doc/src/snippets/audioeffects.cpp 0 - - An effect can have one or more parameters, which let you alter how - the effect works, for instance, by specifying the depth of a - reverb effect. See the EffectParameter class description for - details. - - Phonon also provides EffectWidget, which lets the user modify the - parameters of an effect an the fly; e.g., with combo boxes. - - \sa {Phonon Module}, EffectWidget -*/ - -/*! - \fn explicit Phonon::Effect::Effect(const EffectDescription &description, QObject *parent = 0) - - Constructs a new effect object with the given \a description and \a parent object. - - The EffectDescription object determines the type of the effect. - - \sa {Phonon::BackendCapabilities::availableAudioEffects()} -*/ - -/*! - \fn Phonon::Effect::Effect(EffectPrivate &dd, QObject *parent) - \internal -*/ - -/*! - \fn Phonon::Effect::~Effect() - \internal -*/ - -/*! - \fn QVariant Phonon::Effect::parameterValue(const EffectParameter ¶meter) const - - Returns the value of the given effect \a parameter. You can fetch - the available parameters for an effect with parameters(). - - \sa setParameterValue(), EffectParameter -*/ - -/*! - \fn void Phonon::Effect::setParameterValue(const EffectParameter ¶meter, const QVariant &value) - - Sets the given effect \a parameter to the specified \a value. - - Parameters for an effect are returned by parameters(). You can - check which QVariant::Type an EffectParameter takes with the - EffectParameter::type() function. - - \sa parameterValue(), EffectParameter -*/ - -/*! - \fn EffectDescription Phonon::Effect::description() const; - - Returns the description of this effect. This is the same - description that was passed to the constructor. -*/ - -/*! - \fn QList<EffectParameter> Phonon::Effect::parameters() const; - - Returns a list of parameters that this effect provides to control - its behavior. - - \sa EffectParameter, EffectWidget -*/ - -/*! - \class Phonon::EffectPrivate - \inmodule Phonon - \since 4.4 - \internal -*/ - -/*! - \class Phonon::AudioOutput - \inmodule Phonon - \inheaderfile Phonon/AudioOutput - \since 4.4 - \brief The AudioOutput class is used to send data to audio output devices. - - The AudioOutput class plays sound over a sound device. The audio - output needs to be connected to a \l{Phonon::}{MediaObject} using - \l{Phonon::}{createPath()}. To start playback, you call - \l{Phonon::MediaObject::}{play()} on the media object. - - \snippet snippets/phonon.cpp 2 - - The class supports changing the volume(). It is also possible to - mute the sound. - - To find out what \l{Phonon::}{AudioOutputDevice}s are available - for AudioOutput, you can call - BackendCapabilities::availableAudioOutputDevices(). A default device is - selected by the backend, but it is possible to set the device to - be used with setOutputDevice(). The outputDeviceChanged() signal - will be emitted if the device changes. - - If an error occurs with the playback, for instance, if no valid - output device is found, the media object will receive a - stateChanged() signal with the \l{Phonon::}{ErrorState}. - - Note that the default values of properties are dependent on the - backend. - - \sa Phonon::VolumeSlider, {Music Player Example}, BackendCapabilities, {Phonon Module} -*/ - -/*! - \property Phonon::AudioOutput::name - - This is the name that appears in Mixer applications that control - the volume of this output. - -*/ - -/*! - \property Phonon::AudioOutput::volume - - This is the current loudness of the output. \omit The volume is a - real value between 0.0 (minimum) and 1.0 (maximum). The volume - follows the sound device used, with 1.0 being the maximum volume - the device can produce. \endomit - - (it is using Stevens' law - to calculate the change in voltage internally). - - \sa volumeDecibel -*/ - -/*! - \property Phonon::AudioOutput::volumeDecibel - - This is the current volume of the output in decibel. - - 0 dB means no change in volume, -6dB means an attenuation of the - voltage to 50% and an attenuation of the power to 25%, -inf dB means - silence. - - \sa volume -*/ - -/*! - \property Phonon::AudioOutput::outputDevice - This property holds the (hardware) destination for the output. - - The default device is determined by the \l{Phonon::}{Category} and the global - configuration for that category. Normally you don't need - to override this setting - letting the user change the global - configuration is the right choice. You can still override the - device though, if you have good reasons to do so. - - \sa outputDeviceChanged() -*/ - -/*! - \property Phonon::AudioOutput::muted - This property tells whether the output is muted. - - Muting the output has the same effect as calling setVolume(0.0). -*/ - -/*! - \fn explicit Phonon::AudioOutput::AudioOutput(Phonon::Category category, QObject *parent = 0) - - Creates a new AudioOutput with the given \a parent that defines - output to a physical device. - - The \a category can be used by mixer applications to group volume - controls of applications into categories. That makes it easier for - the user to identify the programs. - The category is also used for the default output device that is - configured centrally. As an example: often users want to have the - audio signal of a VoIP application go to their USB headset while - all other sounds should go to the internal soundcard. - - \sa Phonon::categoryToString(), outputDevice -*/ - -/*! - \fn explicit Phonon::AudioOutput::AudioOutput(QObject *parent = 0) - - Creates a new AudioOutput that defines output to the system - default device with the \{Phonon::Category::}{NoCategory} category - - \sa Phonon::categoryToString(), outputDevice -*/ - -/*! - \fn Phonon::Category Phonon::AudioOutput::category() const - - Returns the category of this output. - - \sa Phonon::AudioOutput::AudioOutput() -*/ - -/*! - \fn void Phonon::AudioOutput::volumeChanged(qreal newVolume) - - This signal is emitted whenever the volume has changed. As the - volume can change without a call to setVolume (calls over dbus) - this is important to keep a widget showing the current volume up - to date. - - \a newVolume is the new volume level. - - \sa setVolume(), volume() -*/ - -/*! - \fn void Phonon::AudioOutput::mutedChanged(bool muted) - - This signal is emitted when the muted property has changed. The \a muted - value passed by the signal indicates the state of the muted property. - As this property can change by IPC (DBus) calls a UI element showing - the muted property should listen to this signal. -*/ - -/*! - \fn void Phonon::AudioOutput::outputDeviceChanged(const Phonon::AudioOutputDevice &newAudioOutputDevice) - - This signal is emitted when the (hardware) device for the output - has changed. \a newAudioOutputDevice is the new device. - - The change can happen either through setOutputDevice or if the - global configuration for the used category has changed. - - \sa outputDevice -*/ - -/*! - \class Phonon::AudioOutputPrivate - \inmodule Phonon - \since 4.4 - \internal -*/ - -/*! - \class Phonon::EffectParameter - \inmodule Phonon - \inheaderfile Phonon/EffectParameter - \since 4.4 - \brief The EffectParameter class describes one parameter of an effect. - - You fetch the parameters of an \l{Phonon::}{Effect} with - \l{Phonon::}{Effect::parameters()}. - - \snippet doc/src/snippets/phononeffectparameter.cpp 0 - - To describe itself, an effect parameter gives a name() and - possibly description() (depending on the backend used). These are - suited to present the effect parameter to the user of a Phonon - application. - - Note that effects are created by the backend, and that - their name and descriptions may vary. - - The value of an effect parameter is stored in a \l{QVariant}, - of which type() is usually \c int or \c double. - - The value is retrieved with \l{Phonon::}{Effect::parameterValue()} - and set with \l{Phonon::Effect::}{setParameterValue()} - both of - which takes the EffectParameter as argument. Note that not all - effect parameters support setting of their value. - - You get the values a parameter can take with possibleValues(); an - empty list is returned if the values are continuous. - - A parameter may also specify default(), minimum(), and maximum() - values. Values are returned as \l{QVariant}s. If the parameter - does not have the requested value, an \l{QVariant::Invalid} - invalid QVariant is returned from these functions. - - The \l{Phonon::}{EffectWidget} provides a widget with which one - can control the parameters of an \l{Phonon::}{Effect}. - - \snippet doc/src/snippets/phononeffectparameter.cpp 1 - - \sa Effect, EffectWidget, {Capabilities Example}, {Phonon Module} -*/ - -/*! - \fn Phonon::EffectParameter::EffectParameter() - \internal - - Creates an invalid effect parameter. -*/ - -/*! - \fn Phonon::EffectParameter::~EffectParameter() - - Destroys the effect parameter. -*/ - -/*! - \fn Phonon::EffectParameter::EffectParameter(const EffectParameter &other) - - Constructs a copy of the \a other effect parameter. -*/ - -/*! - \fn const QString &Phonon::EffectParameter::name() const - - The name of the parameter. Can be used as the label. - - \return A label for the parameter. -*/ - -/*! - \fn const QString &Phonon::EffectParameter::description() const - - The parameter may come with a description (LADSPA doesn't have a - field for this, so don't expect many effects to provide a - description). - - The description can be used for a tooltip or WhatsThis help. - - \return A text describing the parameter. -*/ - -/*! - \fn QVariant::Type Phonon::EffectParameter::type() const - - Returns the parameter type. - - Common types are QVariant::Int, QVariant::Double, QVariant::Bool and QVariant::String. When - QVariant::String is returned you get the possible values from possibleValues. -*/ - -/*! - \fn bool Phonon::EffectParameter::isLogarithmicControl() const - - Returns whether the parameter should be - displayed using a logarithmic scale. This is particularly useful for - frequencies and gains. -*/ - -/*! - \fn QVariant Phonon::EffectParameter::minimumValue() const - - The minimum value to be used for the control to edit the parameter. - - If the returned QVariant is invalid the value is not bounded from - below. -*/ - -/*! - \fn QVariant Phonon::EffectParameter::maximumValue() const - - The maximum value to be used for the control to edit the parameter. - - If the returned QVariant is invalid the value is not bounded from - above. -*/ - -/*! - \fn QVariant Phonon::EffectParameter::defaultValue() const - - The default value. -*/ - -/*! - \fn QVariantList Phonon::EffectParameter::possibleValues() const - - The possible values to be used for the control to edit the parameter. - - if the value of this parameter is to be picked from predefined values - this returns the list (otherwise it returns an empty QVariantList). -*/ - -/*! - \fn bool Phonon::EffectParameter::operator<(const EffectParameter &rhs) const - - \internal - compares the ids of the parameters -*/ - -/*! - \fn bool Phonon::EffectParameter::operator>(const EffectParameter &rhs) const - - \internal - compares the ids of the parameters -*/ - -/*! - \fn bool Phonon::EffectParameter::operator==(const EffectParameter &rhs) const - - \internal - compares the ids of the parameters -*/ - -/*! - \fn Phonon::EffectParameter &Phonon::EffectParameter::operator=(const EffectParameter &other) - - Assigns the \a other effect parameter to this parameter and returns - a reference to this parameter. -*/ - -/*! - \enum Phonon::EffectParameter::Hint - - Only for backend developers: - - Flags to set the return values of isToggleControl(), - isLogarithmicControl(), isIntegerControl(), isBoundedBelow() and - isBoundedAbove(). The values of the flags correspond to the values - used for LADSPA effects. - - \value ToggledHint - If this hint is set it means that - the control has only two states: zero and non-zero - (see isToggleControl()). - - \value LogarithmicHint - LADSPA's SAMPLE_RATE hint needs to be translated by the backend - to normal bounds, as the backend knows the sample rate - and the - frontend doesn't (see isLogarithmicControl()). - - \value IntegerHint See isIntegerControl(). -*/ - -/*! - \fn Phonon::EffectParameter::EffectParameter(int parameterId, - const QString &name, EffectParameter::Hints hints, - const QVariant &defaultValue, const QVariant &min = QVariant(), - const QVariant &max = QVariant(), const QVariantList &values = QVariantList(), - const QString &description = QString()) - - Only to be used by backend implementations: - - Creates a new effect parameter. - - \a parameterId This is a number to uniquely identify the - parameter. The id is used for value() and setValue(). - - \a name is the name/label for this parameter. - - \a hints sets the hints for the type of parameter. - - \a defaultValue The value that should be used as a default. - - \a min is the minimum value allowed for this parameter. You only - need to set this if the BoundedBelowHint is set. - - \a max is the maximum value allowed for this parameter. You only - need to set this if the BoundedAboveHint is set. - - The \a values parameter is the values that the effect parameter - can take (only applies if non-continuous) - - \a description is a descriptive text for the parameter - (explaining what it controls) to be used as a tooltip or - WhatsThis help. -*/ - -/*! - \fn int Phonon::EffectParameter::id() const - - \internal - - Returns the parameter's identifier. -*/ - -/*! - \typedef Phonon::AudioOutputInterface - \inmodule Phonon - \internal -*/ - -/*! - \class Phonon::AudioOutputInterface40 - \inmodule Phonon - \since 4.4 - \internal - \brief Interface for AudioOutput objects - -*/ - -/*! - \fn virtual Phonon::AudioOutputInterface40::~AudioOutputInterface40() - \internal -*/ - -/*! - \fn virtual qreal Phonon::AudioOutputInterface40::volume() const = 0 - \internal -*/ - -/*! - \fn virtual void Phonon::AudioOutputInterface40::setVolume(qreal) = 0 - \internal -*/ - -/*! - \fn virtual int Phonon::AudioOutputInterface40::outputDevice() const = 0 - \internal -*/ - -/*! - \fn virtual bool Phonon::AudioOutputInterface40::setOutputDevice(int) = 0 - \internal -*/ - -/*! - \class Phonon::Path - \inmodule Phonon - \inheaderfile Phonon/Path - \since 4.4 - \brief The Path class describes connections between media nodes. - - In a \l{Building Graphs}{media graph}, \l{Phonon::}{MediaNode}s - are connected by Paths. The multimedia travels in streams over - these paths. - - You create a path between two media nodes using the static - Phonon::createPath() function, which takes two nodes as arguments. - The first argument will send the media stream to the second. - Please refer to the class description of the individual media - nodes and the Phonon \l{Phonon Overview}{overview} to see which - nodes can be connected to each other. - - Paths are also used to insert audio \l{Phonon::}{Effect}s between - two media nodes. The effect will then alter the stream on the - path. Notice that \l{Phonon::}{Effect}s also are media nodes, but - that insertEffect() - instead of Phonon::createPath() - is used to - insert them into the media graph. - - The following code example shows how to create a path between two - media nodes and insert an effect on that path. - - \snippet doc/src/snippets/code/doc_src_phonon-api.cpp 20 - - \sa Phonon::MediaNode, Phonon::MediaObject, Phonon::AudioOutput, - Phonon::VideoWidget, {Phonon Module} -*/ - -/*! - \fn Phonon::Path::~Path(); - - Destroys this reference to the Path. If the path was valid the connection is not broken - as both the source and the sink MediaNodes still keep a reference to the Path. - - \sa disconnect() -*/ - -/*! - \fn Phonon::Path::Path(); - - Creates an invalid path. - - You can still make it a valid path by calling reconnect. It is - recommended to use the Phonon::createPath() function to create - paths. - - \sa Phonon::createPath(), isValid() -*/ - -/*! - \fn Phonon::Path::Path(const Path &path); - - Constructs a copy of the other \a path specified. - - This constructor is fast thanks to explicit sharing. -*/ - -/*! - \fn bool Phonon::Path::isValid() const; - - A path is considered valid if it is connected to two media nodes, - in which case this function returns true. If it is connected to - one or no media nodes, it is consider invalid, and this function - will then return false. -*/ - -/*! - \fn Effect *Phonon::Path::insertEffect(const EffectDescription &desc, Effect *insertBefore = 0); - - Creates and inserts an effect into the path. - - You may insert effects of the same class as often as you like, - but if you insert the same object, the call will fail. - - \a desc is the EffectDescription object for the effect to be inserted. - - If you already inserted an effect you can - tell with \a insertBefore in which order the data gets - processed. If this is \c 0 the effect is appended at the end of - the processing list. If the effect has not been inserted before - the method will do nothing and return \c false. - - Returns a pointer to the effect object if it could be inserted - at the specified position. If \c 0 is returned, the effect was not - inserted. - - Below is a code example for inserting an effect into a path: - - \snippet doc/src/snippets/audioeffects.cpp 0 - - \sa removeEffect(), effects() -*/ - -/*! - \fn bool Phonon::Path::insertEffect(Effect *effect, Effect *insertBefore = 0); - - Inserts the given \a effect into the path before the effect specified by \a insertBefore - and returns true if successful; otherwise returns false. - - If \a insertBefore is zero, the effect is appended to the processing list. - - You may insert effects of the same class as often as you like, but if you insert - the same object, the call will fail. - - \a effect will be inserted right before \a insertBefore. If - \a insertBefore is \c 0, the effect is appended at the end of the - processing list. If the effect has not been inserted before the - method will do nothing and return \c false. - - Returns whether the effect could be inserted at the specified - position. If \c false is returned the effect was not inserted. - - \sa removeEffect(), effects() -*/ - -/*! - \fn bool Phonon::Path::removeEffect(Effect *effect); - - Removes the given \a effect from the path and returns true; otherwise returns false. - - Removes an \a effect from the path. - - If the effect is deleted while it is still connected, the effect will be removed - automatically. - - \omit - \param effect The effect to be removed. - - \return Returns whether the call was successful. If it returns - \c false the effect could not be found in the path, meaning it - has not been inserted before. - \endomit - - \sa insertEffect(), effects() -*/ - -/*! - \fn QList<Effect *> Phonon::Path::effects() const; - - Returns a list of Effect objects that are currently - used as effects. The order in the list determines the order the - signal is sent through the effects. - - \return A list with all current effects. - - \sa insertEffect(), removeEffect() -*/ - -/*! - \fn bool Phonon::Path::reconnect(MediaNode *source, MediaNode *sink); - - Changes the media nodes the path is connected to by connecting the path - to the \a source and \a sink nodes specified. Returns true if successful; - otherwise returns false. - - If unsuccessful, the path remains connected to the same nodes as before. - - \sa Phonon::createPath(), {Phonon Overview} -*/ - -/*! - \fn bool Phonon::Path::disconnect(); - - Tries to disconnect the path from the MediaNodes it is connected to, returning - true if successful or false if unsuccessful. - - If successful, the path is invalidated: isValid() will returns false. -*/ - -/*! - \fn Path &Phonon::Path::operator=(const Path &p); - - Assigns \a p to this Path and returns a reference to this Path. - - This operation is fast thanks to explicit sharing. -*/ - -/*! - \fn bool Phonon::Path::operator==(const Path &p) const; - - Returns true if this Path is equal to \a p; otherwise returns false; -*/ - -/*! - \fn bool Phonon::Path::operator!=(const Path &p) const; - - Returns true if this Path is not equal to \a p; otherwise returns false. -*/ - -/*! - \fn MediaNode *Phonon::Path::source() const; - - Returns the source MediaNode used by the path. -*/ - -/*! - \fn MediaNode *Phonon::Path::sink() const; - - Returns the sink MediaNode used by the path. -*/ - -/*! - \fn Path Phonon::createPath(MediaNode *source, MediaNode *sink); - - \relates Phonon::Path - Creates a new Path connecting the two MediaNodes \a source and \a sink. - - The implementation will automatically select the right format and media type. E.g. connecting a - MediaObject and AudioOutput will create a Path object connecting the audio. This might be - represented as PCM or perhaps even AC3 depending on the AudioOutput object. - - \param source The MediaNode to connect an output from - \param sink The MediaNode to connect to. -*/ - -/*! - \class Phonon::PathPrivate - \inmodule Phonon - \since 4.4 - \internal -*/ - -/*! - \class Phonon::MediaObjectInterface - \inmodule Phonon - \since 4.4 - \internal - \brief Backend interface for media sources. - - The backend implementation has to provide two signals, that are not defined - in this interface: - \list - \li \target phonon_MediaObjectInterface_stateChanged - void stateChanged(Phonon::State newstate, Phonon::State oldstate) - - Emitted when the state of the MediaObject has changed. - In case you're not interested in the old state you can also - connect to a slot that only has one State argument. - - \param newstate The state the Player is in now. - \param oldstate The state the Player was in before. - - \li \target phonon_MediaObjectInterface_tick - void tick(qint64 time) - - This signal gets emitted every tickInterval milliseconds. - - \param time The position of the media file in milliseconds. - - \sa setTickInterval() - \sa tickInterval() - \endlist - - \sa MediaObject -*/ - -/*! - \fn virtual Phonon::MediaObjectInterface::~MediaObjectInterface() - \internal -*/ - -/*! - \fn virtual qint64 Phonon::MediaObjectInterface::remainingTime() const - \internal -*/ - -/*! - \fn virtual qint32 Phonon::MediaObjectInterface::prefinishMark() const = 0 - \internal -*/ - -/*! - \fn virtual void Phonon::MediaObjectInterface::setPrefinishMark(qint32) = 0 - \internal -*/ - -/*! - \fn virtual qint32 Phonon::MediaObjectInterface::transitionTime() const = 0 - \internal -*/ - -/*! - \fn virtual void Phonon::MediaObjectInterface::setTransitionTime(qint32) = 0 - \internal -*/ - -/*! - \fn virtual void Phonon::MediaObjectInterface::play() = 0 - \internal - - Requests the playback to start. - - This method is only called if the state transition to PlayingState is possible. - - The backend should react immediately - by either going into PlayingState or BufferingState if the - former is not possible. -*/ - -/*! - \fn virtual void Phonon::MediaObjectInterface::pause() = 0 - \internal - - Requests the playback to pause. - - This method is only called if the state transition to PausedState is possible. - - The backend should react as fast as possible. Go to PausedState - as soon as playback is paused. -*/ - -/*! - \fn virtual void Phonon::MediaObjectInterface::stop() = 0 - \internal - - Requests the playback to be stopped. - - This method is only called if the state transition to StoppedState is possible. - - The backend should react as fast as possible. Go to StoppedState - as soon as playback is stopped. - - A subsequent call to play() will start playback at the beginning of - the media. -*/ - -/*! - \fn virtual void Phonon::MediaObjectInterface::seek(qint64 milliseconds) = 0 - \internal - - Requests the playback to be seeked to the given time. - - The backend does not have to finish seeking while in this function - (i.e. the backend does not need to block the thread until the seek is - finished; even worse it might lead to deadlocks when using a - ByteStream which gets its data from the thread this function would - block). - - As soon as the seek is done the currentTime() function and - the tick() signal will report it. - - \param milliseconds The time where playback should seek to in - milliseconds. -*/ - -/*! - \fn virtual qint32 Phonon::MediaObjectInterface::tickInterval() const = 0 - \internal - - Return the time interval in milliseconds between two ticks. - - Returns the tick interval that it was set to (might not - be the same as you asked for). -*/ - -/*! - \fn virtual void Phonon::MediaObjectInterface::setTickInterval(qint32 interval) = 0 - \internal - - Change the interval the tick signal is emitted. Set \a interval to 0 to - disable the signal. - - \a interval tick interval in milliseconds - - Returns the tick interval that it was set to (might not be the same as you - asked for). - -*/ - -/*! - \fn virtual bool Phonon::MediaObjectInterface::hasVideo() const = 0 - \internal - - Check whether the media data includes a video stream. - - Returns true if the media contains video data. -*/ - -/*! - \fn virtual bool Phonon::MediaObjectInterface::isSeekable() const = 0 - \internal - - If the current media may be seeked this function returns true; - otherwise, false. - - Returns whether the current media may be seeked. -*/ - -/*! - \fn virtual qint64 Phonon::MediaObjectInterface::currentTime() const = 0 - \internal - - Get the current time (in milliseconds) of the file currently being played. -*/ - -/*! - \fn virtual Phonon::State Phonon::MediaObjectInterface::state() const = 0 - \internal - - Get the current state. -*/ - -/*! - \fn virtual QString Phonon::MediaObjectInterface::errorString() const = 0 - \internal - - A translated string describing the error. -*/ - -/*! - \fn virtual Phonon::ErrorType Phonon::MediaObjectInterface::errorType() const = 0 - \internal - - Tells your program what to do about the error. - - \sa Phonon::ErrorType -*/ - -/*! - \fn virtual qint64 Phonon::MediaObjectInterface::totalTime() const = 0 - \internal - - Returns the total time of the media in milliseconds. - - If the total time is not know return -1. Do not block until it is - known, instead emit the totalTimeChanged signal as soon as the total - time is known or changes. -*/ - -/*! - \fn virtual MediaSource Phonon::MediaObjectInterface::source() const = 0 - \internal - - Returns the current source. -*/ - -/*! - \fn virtual void Phonon::MediaObjectInterface::setSource(const MediaSource &) = 0 - \internal - - Sets the current source. When this function is called the MediaObject is - expected to stop all current activity and start loading the new - source (i.e. go into LoadingState). - - It is expected that the - backend now starts preloading the media data, filling the audio - and video buffers and making all media meta data available. It - will also trigger the totalTimeChanged signal. - - If the backend does not know how to handle the source it needs to - change state to Phonon::ErrorState. Don't bother about handling KIO - URLs. It is enough to handle AbstractMediaStream sources correctly. - - \warning Keep the MediaSource object around as long as the backend - uses the AbstractMediaStream returned by the MediaSource. In case - that no other reference to the MediaSource exists and it is set to - MediaSource::autoDelete, the AbstractMediaStream is deleted when the - last MediaSource ref is deleted. -*/ - -/*! - \fn virtual void Phonon::MediaObjectInterface::setNextSource(const MediaSource &source) = 0 - \internal - - Sets the next source to be used for transitions. When a next source - is set playback should continue with the new source. In that case - finished and prefinishMarkReached are not emitted. - - \param source The source to transition to (crossfade/gapless/gap). If - \a source is an invalid MediaSource object then the queue is empty - and the playback should stop normally. - - \warning Keep the MediaSource object around as long as the backend - uses the AbstractMediaStream returned by the MediaSource. In case - that no other reference to the MediaSource exists and it is set to - MediaSource::autoDelete, the AbstractMediaStream is deleted when the - last MediaSource ref is deleted. -*/ - -/*! - \class Phonon::EffectWidget effectwidget.h Phonon/EffectWidget - \inmodule Phonon - \inheaderfile Phonon/EffectWidget - \since 4.4 - \brief The EffectWidget class provides a widget to control the parameters of an Effect. - - The EffectWidget class provides a widget, with which an effects - parameters can be controlled. The widget does not have an API, - and is constructed with the \l{Phonon::}{Effect}, of which - parameters should be controlled. - - \snippet doc/src/snippets/audioeffects.cpp 1 - - The following image shows an example of an effect widget. - - \image effectwidget.png - - Note that some audio effects do not have parameters, and the - widget will then not \l{QWidget::}{show()} at all. - - \sa Effect, BackendCapabilities, EffectDescription, {Phonon Module} -*/ - -/*! - \class Phonon::AbstractAudioOutput - \inmodule Phonon - \internal - \brief Provides a common base class for all audio outputs. - - \sa AudioOutput -*/ - -/*! - \fn Phonon::AbstractAudioOutput::~AbstractAudioOutput() - \internal -*/ - -/*! - \class Phonon::AbstractAudioOutputPrivate - \inmodule Phonon - \since 4.4 - \internal -*/ - -/*! - \class AudioOutputAdaptor - \inmodule Phonon - \brief Provides an adaptor class for interface org.kde.Phonon.AudioOutput - \internal -*/ - -/*! - \class Phonon::VolumeSlider - \inmodule Phonon - \inheaderfile Phonon/VolumeSlider - \since 4.4 - \brief The VolumeSlider widget provides a slider that is used to control the volume of an audio output device. - - The slider also displays an icon indicating if the volume of the - \l{Phonon::}{AudioOutput} it is connected to is muted. The icon - can be removed with setMuteVisible(). - - It is possible to set the \l{maximumVolume}{maximum} value of the - slider. By default, the minimum and maximum values of the slider - are 0.0 (no sound) to 1.0 (the maximum volume the audio output can - produce). - - Here follows a code example: - - \snippet doc/src/snippets/volumeslider.cpp 0 - - \omit mention how to change the style of the slider. \endomit - - \sa {Phonon Module} -*/ - -/*! - \property Phonon::VolumeSlider::maximumVolume - - This property holds the maximum volume that can be set with this slider. - - By default the maximum value is 1.0 (100%). -*/ - -/*! - \property Phonon::VolumeSlider::orientation - This property holds the orientation of the slider. - - The orientation must be Qt::Vertical (the default) or Qt::Horizontal. -*/ - -/*! - \property Phonon::VolumeSlider::tracking - This property holds whether slider tracking is enabled. - - If tracking is enabled (the default), the volume changes - while the slider is being dragged. If tracking is - disabled, the volume changes only when the user - releases the slider. -*/ - -/*! - \property Phonon::VolumeSlider::pageStep - This property holds the page step. - - The larger of two natural steps that a slider provides and - typically corresponds to the user pressing PageUp or PageDown. - - Defaults to 5 (5% of the voltage). -*/ - -/*! - \property Phonon::VolumeSlider::singleStep - This property holds the single step. - - The smaller of two natural steps that a slider provides and - typically corresponds to the user pressing an arrow key. - - Defaults to 1 (1% of the voltage). -*/ - -/*! - \property Phonon::VolumeSlider::muteVisible - This property holds whether the mute button/icon next to the slider is visible. - - By default the mute button/icon is visible. -*/ - -/*! - \property Phonon::VolumeSlider::iconSize - \brief the icon size used for the mute button/icon. - - The default size is defined by the GUI style. -*/ - -/*! - \fn explicit Phonon::VolumeSlider::VolumeSlider(QWidget *parent = 0) - Constructs a new volume slider with the given \a parent. -*/ - -/*! - \fn explicit Phonon::VolumeSlider::VolumeSlider(AudioOutput *output, QWidget *parent = 0) - Constructs a new volume slider with the given \a output object and \a parent. -*/ - -/*! - \fn Phonon::VolumeSlider::~VolumeSlider() -*/ - -/*! - \fn AudioOutput *Phonon::VolumeSlider::audioOutput() const -*/ - -/*! - \fn void Phonon::VolumeSlider::setAudioOutput(Phonon::AudioOutput *output) - - Sets the audio output object to be controlled by this slider to the specified - \a output object. -*/ - -/*! - \class Phonon::VolumeSliderPrivate - \inmodule Phonon - \since 4.4 - \internal -*/ - -/*! - \class Phonon::MediaController - \inmodule Phonon - \inheaderfile Phonon/MediaController - \since 4.4 - \brief The MediaController class controls optional features of a media file/device. - - Some media sources have content that the \l{Phonon::}{MediaObject} - does not provide control over, for instance, chapters in a DVD - file. The functionality the media controller offers is - dependent on the type of media source that is played back. - Commonly, the media controller allows you to: - - \list - \li Navigate between \b chapters. - \li Navigate between \b titles. - \li Select between \b angles. - \endlist - - The \l{Phonon::MediaController::}{Feature} enum explains these - terms in more detail, and their context in playback of CD and DVD. - - The media controller keeps a \l{Phonon::}{MediaObject}, of which - \l{Phonon::MediaObject::currentSource()}{media source} is played - back. You can still call the media object's functions, e.g., - \l{Phonon::MediaObject::}{stop()}; this is all handled correctly - by the media controller. You have the option of letting the media - controller play all titles of a source in sequence by setting the - \l{autoplayTitles()}{autoplay titles} option. - - To start a playback using a media object, you call - \l{Phonon::MediaObject::}{play()} on the media object. To play a - specific title, use setCurrentTitle() and then call - \l{Phonon::MediaObject::}{play()}. - - \warning The Phonon::MediaController class is not yet supported by - Qt backends. - - \sa {Phonon Module} -*/ - -/*! - \fn int Phonon::MediaController::availableAudioChannels() const - \internal -*/ - -/*! - \fn void Phonon::MediaController::availableAudioChannelsChanged() - \internal -*/ - -/*! - \fn QList<SubtitleDescription> Phonon::MediaController::availableSubtitles() const - \internal -*/ - -/*! - \fn void Phonon::MediaController::availableSubtitlesChanged() - \internal -*/ - -/*! - \fn AudioChannelDescription Phonon::MediaController::currentAudioChannel() const - \internal -*/ - -/*! - \fn SubtitleDescription Phonon::MediaController::currentSubtitle() const - \internal -*/ - -/*! - \fn void Phonon::MediaController::setCurrentAudioChannel(const Phonon::AudioChannelDescription &stream) - \internal -*/ - -/*! - \fn void Phonon::MediaController::setCurrentSubtitle(const Phonon::SubtitleDescription &stream) - \internal -*/ - -/*! - \fn Phonon::BackendCapabilities::availableAudioCaptureDevices() - \internal -*/ - -/*! - \fn Phonon::BackendCapabilities::Notifier::availableAudioCaptureDevicesChanged() - \internal -*/ - -/*! - \enum Phonon::MediaController::Feature - - The values of this enum are interpreted differently depending on - the type of media source, e.g., DVD or CD. We give examples for - these sources. - - \value Angles In the VOB (DVD) format, it is possible to to give - several video streams of the same scene, each of which displays - the scene from a different angle. The DVD viewer can then change - between these angles. - - \value Chapters In the VOB format, chapters are points in a - single video stream that can be played and seeked to - separately. - - \value Titles On a CD, a title is a separate sound track. On DVD, - a title is a separate VOB file. - -*/ - -/*! - \fn Phonon::MediaController::MediaController(MediaObject *parent) - - Constructs a new MediaController with the media object (\a parent) - to be used by the media controller. - - \sa MediaObject, Feature -*/ - -/*! - \fn Phonon::MediaController::~MediaController() -*/ - -/*! - \fn Features Phonon::MediaController::supportedFeatures() const -*/ - -/*! - \fn int Phonon::MediaController::availableAngles() const - - Returns the available angles that is available for the current - media source. - - \sa Feature -*/ - -/*! - \fn int Phonon::MediaController::currentAngle() const - - Returns the angle that is currently used. - - \sa Feature -*/ - -/*! - \fn int Phonon::MediaController::availableChapters() const - - Returns the number of chapters the current media source - contains. - - \sa Feature -*/ - -/*! - \fn int Phonon::MediaController::currentChapter() const - - Returns the chapter that is currently being played back. - - \sa Feature -*/ - -/*! - \fn int Phonon::MediaController::availableTitles() const - - Returns the number of titles that the current media source - contains. - - \sa Feature -*/ - -/*! - \fn int Phonon::MediaController::currentTitle() const - - Returns the title that is currently played back. - - The current title is 0 (the first) by default. - - \sa Feature -*/ - -/*! - \fn bool Phonon::MediaController::autoplayTitles() const - - Returns true if titles will automatically be played when the media - is played; otherwise returns false. - - The media controller will play the titles of the media source in - sequence when the media object's \l{Phonon::MediaObject::}{play()} - function is called. If the autoplay option is disabled, the media - object will play the - \l{Phonon::}{MediaController::currentTitle()}{current title} and then - finish the playback. - - \sa setAutoplayTitles(), currentTitle() -*/ - -/*! - \fn void Phonon::MediaController::setAutoplayTitles(bool enable) - - Sets the titles to play automatically when the media is played if - \a enable is true; otherwise disables this option. - - The media controller will play the titles of the media source in - sequence when the media object's \l{Phonon::MediaObject::}{play()} - function is called. If the autoplay option is disabled, the media - object will play the - \l{Phonon::}{MediaController::currentTitle()}{current title} and then - finish the playback. - - \sa autoplayTitles(), currentTitle() -*/ - -/*! - \fn void Phonon::MediaController::setCurrentAngle(int angleNumber) - - Sets the current angle to the given \a angleNumber if the media - file or device supports navigation by angle number. - - \sa Feature -*/ - -/*! - \fn void Phonon::MediaController::setCurrentChapter(int chapterNumber) - - Sets the current chapter to the given \a chapterNumber if the media - file or device supports navigation by chapter number. - - \sa Feature -*/ - -/*! - \fn void Phonon::MediaController::setCurrentTitle(int titleNumber) - - Skips to the given title \a titleNumber. - - If it was playing before the title change it will start playback on the new title if - autoplayTitles is enabled. - - \sa Feature -*/ - -/*! - \fn void Phonon::MediaController::nextTitle() - - Skips to the next title. - - If it was playing before the title change it will start playback on the next title if - autoplayTitles is enabled. - - \sa Feature -*/ - -/*! - \fn void Phonon::MediaController::previousTitle() - - Skips to the previous title. - - If it was playing before the title change it will start playback on the previous title if - autoplayTitles is enabled. - - \sa Feature -*/ - -/*! - \fn void Phonon::MediaController::availableAnglesChanged(int availableAngles) - - This signal is emitted whenever the number of available angles changes. - The new number of available angles is given by \a availableAngles. - - \sa Feature -*/ - -/*! - \fn void Phonon::MediaController::angleChanged(int angleNumber) - - This signal is emitted whenever the current angle changes. - The new angle number is given by \a angleNumber. - - \sa Feature -*/ - -/*! - \fn void Phonon::MediaController::availableChaptersChanged(int availableChapters) - - This signal is emitted whenever the number of available chapters changes. - The new number of available chapters is given by \a availableChapters. - - \sa Feature -*/ - -/*! - \fn void Phonon::MediaController::chapterChanged(int chapterNumber) - - This signal is emitted whenever the current chapter changes. - The new chapter number is given by \a chapterNumber. - - \sa Feature -*/ - -/*! - \fn void Phonon::MediaController::availableTitlesChanged(int availableTitles) - - This signal is emitted whenever the number of available titles changes. - The new number of available titles is given by \a availableTitles. - - \sa Feature -*/ - -/*! - \fn void Phonon::MediaController::titleChanged(int titleNumber) - - This signal is emitted whenever the current title changes. - The new title number is given by \a titleNumber. - - \sa Feature -*/ - -/*! - \class Phonon::VideoWidget - \inmodule Phonon - \inheaderfile Phonon/VideoWidget - \since 4.4 - \ingroup advanced - \ingroup multimedia - \brief The VideoWidget class provides a widget that is used to display video. - - The VideoWidget class renders the video of a media stream on a - QWidget. It is connected to the \l{Phonon::}{MediaObject}, of - which video stream it should render. You connect the two objects - using the Phonon::createPath() function. - - The widget has some possibilities to manipulate the video - stream. You can change the brightness(), hue(), saturation(), - and contrast(). - - Resizing of the video is handled automatically, but you can affect - the way the video is resized with the aspectRatio and scaleMode - properties. By default, the widget will use the aspect ratio of - the video stream itself. - - The video widget takes the size of the video when it receives a new video - stream (i.e., when a new MediaSource is set on the MediaObject to which it is - connected). If you need to know the size of the video, you can call - \l{QWidget::}{sizeHint()} after the video has been loaded (i.e., after the - MediaObject leaves the \l{Phonon::}{LoadingState}). - - It is also possible to go to \l{fullScreen}{full screen} mode. - - A typical example of usage follows below: - - \snippet doc/src/snippets/code/doc_src_phonon-api.cpp 21 - - \sa {Phonon Module} -*/ - -/*! - \fn Phonon::VideoWidget::VideoWidget(QWidget *parent = 0) - - Constructs a new video widget with the specified \a parent. -*/ - -/*! - \fn Phonon::VideoWidget::VideoWidget(VideoWidgetPrivate &d, QWidget *parent) - \internal - - Constructs a new video widget with the specified \a parent. -*/ - -/*! - \fn bool Phonon::VideoWidget::event(QEvent *) - \reimp -*/ - -/*! - \fn void Phonon::VideoWidget::mouseMoveEvent(QMouseEvent *) - \reimp -*/ - -/*! - \fn Phonon::VideoWidget::snapshot() const - \since 4.7 - - Returns a snapshot of the current frame shown in the widget. -*/ - -/*! - \enum Phonon::VideoWidget::ScaleMode - - The ScaleMode enum describes how to treat aspect ratio during - resizing of video. - - \value FitInView The video will be fitted to fill the view - keeping aspect ratio. - \value ScaleAndCrop The video is scaled -*/ - -/*! - \property Phonon::VideoWidget::fullScreen - This property holds whether the video is shown using the complete - screen. - - The property differs from QWidget::fullScreen in that it is - writeable. - - By default the widget is not shown in fullScreen. - - \warning When switching to full screen mode using setFullScreen(), - the widget onto which the video is rendered is shown as a - top-level window. Key event forwarding is handled by VideoWidget, - but if you need to handle other events, e.g., mouse events, you - should handle fullscreen mode yourself. -*/ - -/*! - \property Phonon::VideoWidget::aspectRatio - Defaults to AspectRatioAuto. - - \sa AspectRatio -*/ - -/*! - \property Phonon::VideoWidget::scaleMode - - If the size of the widget and the size of the video are not equal. - The video will be zoomed to fit the widget. The smaller zoom - (AddBarsScaleMode) adds black bars at the left/right or top/bottom to - make all of the image visible (default). The bigger zoom (ExpandMode) - fills the widget completely, keeping all information in one direction - and leaving parts of the image outside of the widget in the other - direction. -*/ - -/*! - \property Phonon::VideoWidget::brightness - - This property holds brightness of the video. - - Default is 0. Acceptable values are in range of -1, 1. -*/ - -/*! - \property Phonon::VideoWidget::contrast - - This property holds the contrast of the video. - - Default is 0. Acceptable values are in range of -1, 1. -*/ - -/*! - \property Phonon::VideoWidget::hue - - This property holds the hue of the video. - - Default is 0. Acceptable values are in range of -1, 1. -*/ - -/*! - \property Phonon::VideoWidget::saturation - - This property holds saturation of the video. - - Default is 0. Acceptable values are in range of -1, 1. -*/ - -/*! - \enum Phonon::VideoWidget::AspectRatio - - Defines the width:height to be used for the video. - - \value AspectRatioAuto - Let the decoder find the aspect ratio automatically from the - media file (this is the default). - - \value AspectRatioWidget - Fits the video into the widget making the aspect ratio depend - solely on the size of the widget. This way the aspect ratio - is freely resizeable by the user. - - \value AspectRatio4_3 - Make width/height == 4/3, which is the old TV size and - monitor size (1024/768 == 4/3). (4:3) - - \value AspectRatio16_9 - Make width/height == 16/9, which is the size of most current - media. (16:9) -*/ - -/*! - \fn void Phonon::VideoWidget::exitFullScreen() - - Convenience slot, calling setFullScreen(false) -*/ - - -/*! - \fn void Phonon::VideoWidget::enterFullScreen() - - Convenience slot, calling setFullScreen(true) -*/ - -/*! - \class Phonon::VideoWidgetInterface - \inmodule Phonon - \since 4.4 - \internal -*/ - -/*! - \fn virtual Phonon::VideoWidgetInterface::~VideoWidgetInterface() -*/ - -/*! - \fn virtual Phonon::VideoWidget::AspectRatio Phonon::VideoWidgetInterface::aspectRatio() const = 0 - \internal -*/ - -/*! - \fn virtual void Phonon::VideoWidgetInterface::setAspectRatio(Phonon::VideoWidget::AspectRatio ratio) = 0 - \internal -*/ - -/*! - \fn virtual qreal Phonon::VideoWidgetInterface::brightness() const = 0 - \internal -*/ - -/*! - \fn virtual void Phonon::VideoWidgetInterface::setBrightness(qreal) = 0 - \internal -*/ - -/*! - \fn virtual Phonon::VideoWidget::ScaleMode Phonon::VideoWidgetInterface::scaleMode() const = 0 - \internal -*/ - -/*! - \fn virtual void Phonon::VideoWidgetInterface::setScaleMode(Phonon::VideoWidget::ScaleMode mode) = 0 - \internal -*/ - -/*! - \fn virtual qreal Phonon::VideoWidgetInterface::contrast() const = 0 - \internal -*/ - -/*! - \fn virtual void Phonon::VideoWidgetInterface::setContrast(qreal) = 0 - \internal -*/ - -/*! - \fn virtual qreal Phonon::VideoWidgetInterface::hue() const = 0 - \internal -*/ - -/*! - \fn virtual void Phonon::VideoWidgetInterface::setHue(qreal) = 0 - \internal -*/ - -/*! - \fn virtual qreal Phonon::VideoWidgetInterface::saturation() const = 0 - \internal -*/ - -/*! - \fn virtual void Phonon::VideoWidgetInterface::setSaturation(qreal) = 0 - \internal -*/ - -/*! - \fn virtual QWidget *Phonon::VideoWidgetInterface::widget() = 0 - \internal -*/ - -/*! - \class Phonon::VideoWidgetInterface44 - \inmodule Phonon - \since 4.7 -*/ - -/*! - \fn Phonon::VideoWidgetInterface44::snapshot() const -*/ - -/*! - \typedef Phonon::VideoWidgetInterfaceLatest - \inmodule Phonon - \since 4.7 -*/ - -/*! - \class Phonon::PlatformPlugin - \inmodule Phonon - \since 4.4 - \internal -*/ - -/*! - \fn virtual AbstractMediaStream *Phonon::PlatformPlugin::createMediaStream(const QUrl &url, QObject *parent) = 0 - - Creates a AbstractMediaStream object with the given \a parent that provides the data - for the given URL specified by \a url. - \omit - On KDE this uses KIO. - \endomit -*/ - -/*! - \fn virtual QIcon Phonon::PlatformPlugin::icon(const QString &name) const = 0 - - Returns the icon for the given icon name. -*/ - -/*! - \fn virtual void Phonon::PlatformPlugin::notification(const char *notificationName, const QString &text, - const QStringList &actions, QObject *receiver, const char *actionSlot) const = 0 - - Shows a notification pop-up with the given \a notificationName and \a text. - Each action in the associated list of \a actions is connected to the \a actionSlot - of the specified \a receiver object, which is expected to act on the actions as - they are triggered by the user. -*/ - -/*! - \fn virtual QString Phonon::PlatformPlugin::applicationName() const = 0 - - Returns the name of the application. For most Qt application this is - QCoreApplication::applicationName(), but for KDE this is overridden by KAboutData. -*/ - - -/*! - \fn virtual QObject *Phonon::PlatformPlugin::createBackend() = 0 - - Creates a backend object. This way the platform can decide the backend preference. -*/ - -/*! - \fn virtual QObject *Phonon::PlatformPlugin::createBackend(const QString &library, const QString &version) = 0 - - Using the library loader of the platform, loads a given backend provided the - specified \a library and \a version. -*/ - -/*! - \fn virtual bool Phonon::PlatformPlugin::isMimeTypeAvailable(const QString &mimeType) const = 0 - - Tries to check whether the default backend supports the MIME type specified by \a mimeType - without loading the actual backend library. - \omit - On KDE this reads the MIME type list from the .desktop file of - the backend. - \endomit -*/ - -/*! - \fn virtual void Phonon::PlatformPlugin::saveVolume(const QString &outputName, qreal volume) = 0 - - Saves the volume for the given output. -*/ - -/*! - \fn virtual qreal Phonon::PlatformPlugin::loadVolume(const QString &outputName) const = 0 - - Loads the volume for the given output. -*/ - -/*! - \class Phonon::MediaNode - \inmodule Phonon - \inheaderfile Phonon/MediaNode - \since 4.4 - \brief The MediaNode class is the base class for all nodes in a media graph. - - In all phonon applications, one builds a media graph consisting of - MediaNodes. The graph will take multimedia content, e.g., from a - file, as input. After its nodes have processed the multimedia, the - graph will output the media again, e.g., to a sound card. - - The multimedia content is streamed over \l{Phonon::}{Path}s - between the nodes in the graph. You can query the paths that are - connected to a media node with inputPaths() and outputPaths(). - - You can check whether the node is implemented by the current - backend by calling isValid(). This does not guarantee that an - instance of the class works as expected, but that the backend has - implemented functionality for the class. - - Currently, Phonon has four media nodes: \l{Phonon::}{MediaObject}, - \l{Phonon::}{AudioOutput}, \l{Phonon::}{VideoWidget}, and \l{Phonon::}{Effect}. - Please refer to their class descriptions for details about their usage, and to - find out which nodes can be connected to each other. See also \l{Building - Graphs} in Phonon's \l{Phonon Overview}{overview} document. - - Two nodes are connected to each other using the - Phonon::createPath() or \l{Phonon::}{Path::insertEffect()} - functions (only \l{Phonon::Effect}s use - \l{Phonon::Path::}{insertEffect()}). We show a code example below, - in which we build a media graph for video playback and then query - its media nodes for their \l{Phonon::}{Path}s: - - \snippet doc/src/snippets/medianodesnippet.cpp 0 - - When you create a Phonon application, you will likely build the - graph yourself. This makes isValid() the most useful function of - this class. The other two functions help navigate the graph, which - you do not need to do as you created the nodes yourself. - - \sa {Phonon Overview}, Phonon::MediaObject, - Phonon::AudioOutput, Phonon::VideoWidget, {Phonon Module} -*/ - -/*! - \fn virtual Phonon::MediaNode::~MediaNode() - - Destroys the media node and any paths connecting it to other - nodes. Any \l{Phonon::}{Effect}s connected to these paths will - also be deleted. -*/ - -/*! - \fn bool Phonon::MediaNode::isValid() const - - Returns true if the backend provides an implementation of this - class; otherwise returns false. - - This does not guarantee that instances of the class works as - expected, but that the backend has implemented the functionality - for this class. For instance, Qt's GStreamer backend will return - true for instances of the \l{Phonon::}{AudioOutput} class, even if - there is a problem with GStreamer and it could not play sound. - -*/ - -/*! - \fn QList<Path> Phonon::MediaNode::inputPaths() const - - Returns the paths that inputs multimedia to this media node. - - \sa outputPaths() -*/ - -/*! - \fn QList<Path> Phonon::MediaNode::outputPaths() const - - Returns the paths to which this media node outputs media. - - \sa inputPaths() -*/ - -/*! - \fn Phonon::MediaNode::MediaNode(MediaNodePrivate &dd) - \internal -*/ - -/*! - \class Phonon::GlobalConfig - \inmodule Phonon - \since 4.4 - \internal -*/ - -/*! - \fn Phonon::GlobalConfig::GlobalConfig() - \internal -*/ - -/*! - \fn Phonon::GlobalConfig::~GlobalConfig() - \internal -*/ - -/*! - \fn QList<int> Phonon::GlobalConfig::audioOutputDeviceListFor(Phonon::Category category, int override = AdvancedDevicesFromSettings) const - \internal -*/ - -/*! - \fn int Phonon::GlobalConfig::audioOutputDeviceFor(Phonon::Category category, int override = AdvancedDevicesFromSettings) const - \internal -*/ - -/*! - \class Phonon::ObjectDescriptionData - \inmodule Phonon - \since 4.4 - \internal - \brief Data class for objects describing devices or features of the backend. - - \sa Phonon::BackendCapabilities -*/ - -/*! - \fn bool Phonon::ObjectDescriptionData::operator==(const ObjectDescriptionData &otherDescription) const - - Returns \c true if this ObjectDescription describes the same - as \a otherDescription; otherwise returns \c false. -*/ - -/*! - \fn QString Phonon::ObjectDescriptionData::name() const - - Returns the name of the capture source. - - \return A string that should be presented to the user to - choose the capture source. -*/ - -/*! - \fn QString Phonon::ObjectDescriptionData::description() const - - Returns a description of the capture source. This text should - make clear what sound source this is, which is sometimes hard - to describe or understand from just the name. - - \return A string describing the capture source. -*/ - -/*! - \fn QVariant Phonon::ObjectDescriptionData::property(const char *name) const - - Returns a named property. - - If the property is not set an invalid value is returned. - - \sa propertyNames() -*/ - -/*! - \fn QList<QByteArray> Phonon::ObjectDescriptionData::propertyNames() const - - Returns all names that return valid data when property() is called. - - \sa property() -*/ - -/*! - \fn bool Phonon::ObjectDescriptionData::isValid() const - - Returns true if the Tuple is valid (index != -1); otherwise returns - false. -*/ - -/*! - \fn int Phonon::ObjectDescriptionData::index() const - - A unique identifier for this device/. Used internally - to distinguish between the devices/. - - \return An integer that uniquely identifies every device. -*/ - -/*! - \fn static ObjectDescriptionData *Phonon::ObjectDescriptionData::fromIndex(ObjectDescriptionType type, int index) - \internal -*/ - -/*! - \fn Phonon::ObjectDescriptionData::~ObjectDescriptionData() - \internal -*/ - -/*! - \fn Phonon::ObjectDescriptionData::ObjectDescriptionData(ObjectDescriptionPrivate * = 0) - \internal -*/ - -/*! - \class Phonon::AddonInterface - \inmodule Phonon - \since 4.4 - \internal - \brief Interface for Menu, Chapter, Angle and Title/Track control. -*/ - -/*! - \fn virtual Phonon::AddonInterface::~AddonInterface() - \internal -*/ - -/*! - \enum Phonon::AddonInterface::Interface - - This enum describes the type of interface represented by an AddonInterface object. - - \value NavigationInterface - \value ChapterInterface - \value AngleInterface - \value TitleInterface -*/ - -/*! - \enum Phonon::AddonInterface::NavigationCommand - \internal - \value Menu1Button -*/ - -/*! - \enum Phonon::AddonInterface::ChapterCommand - \internal - \value availableChapters - \value chapter - \value setChapter -*/ - -/*! - \enum Phonon::AddonInterface::AngleCommand - \internal - \value availableAngles - \value angle - \value setAngle -*/ - -/*! - \enum Phonon::AddonInterface::TitleCommand - \internal - \value availableTitles - \value title - \value setTitle - \value autoplayTitles - \value setAutoplayTitles -*/ - -/*! - \fn virtual bool Phonon::AddonInterface::hasInterface(Interface iface) const = 0 - \internal -*/ - -/*! - \fn virtual QVariant Phonon::AddonInterface::interfaceCall(Interface iface, int command, - const QList<QVariant> &arguments) = 0 - \internal -*/ - -/*! - \class Phonon::MediaNodePrivate - \inmodule Phonon - \since 4.4 - \internal -*/ - -/*! - \namespace Phonon::Factory - \inmodule Phonon - \internal -*/ - -/*! - \fn Sender *Phonon::Factory::sender() - - Returns a pointer to the object emitting the signals. - - \sa Sender::backendChanged() -*/ - -/*! - \fn QObject *Phonon::Factory::createMediaObject(QObject *parent = 0) - - Create a new backend object for a MediaObject. - - \return a pointer to the MediaObject the backend provides. -*/ - -/*! - \fn QObject *Phonon::Factory::createEffect(int effectId, QObject *parent = 0) - - Create a new backend object for a Effect. - - \return a pointer to the Effect the backend provides. -*/ - -/*! - \fn QObject *Phonon::Factory::createVolumeFaderEffect(QObject *parent = 0) - - Create a new backend object for a VolumeFaderEffect. - - \return a pointer to the VolumeFaderEffect the backend provides. -*/ - -/*! - \fn QObject *Phonon::Factory::createAudioOutput(QObject *parent = 0) - - Create a new backend object for a AudioOutput. - - \return a pointer to the AudioOutput the backend provides. -*/ - -/*! - \fn QObject *Phonon::Factory::createVideoWidget(QObject *parent = 0) - - Create a new backend object for a VideoWidget. - - \return a pointer to the VideoWidget the backend provides. -*/ - -/*! - \fn QObject *Phonon::Factory::backend(bool createWhenNull = true) - - \return a pointer to the backend interface. -*/ - -/*! - \fn QString Phonon::Factory::identifier() - - Unique identifier for the Backend. Can be used in configuration files - for example. -*/ - - -/*! - \fn QString Phonon::Factory::backendName() - - Get the name of the Backend. - \omit - It's the name from the .desktop file. - \endomit -*/ - -/*! - \fn QString Phonon::Factory::backendComment() - - Get the comment of the Backend. - \omit - It's the comment from the .desktop file. - \endomit -*/ - -/*! - \fn QString Phonon::Factory::backendVersion() - - Get the version of the Backend. - \omit - It's the version from the .desktop file. - \endomit - - The version is especially interesting if there are several versions - available for binary incompatible versions of the backend's media - framework. -*/ - -/*! - \fn QString Phonon::Factory::backendIcon() - - Get the icon (name) of the Backend. - \omit - It's the icon from the .desktop file. - \endomit -*/ - -/*! - \fn QString Phonon::Factory::backendWebsite() - - Get the website of the Backend. - \omit - It's the website from the .desktop file. - \endomit -*/ - -/*! - \fn QObject *Phonon::Factory::registerQObject(QObject *object) - - Registers the given backend \a object with the factory. -*/ - -/*! - \fn bool Phonon::Factory::isMimeTypeAvailable(const QString &mimeType) -*/ - -/*! - \fn void Phonon::Factory::registerFrontendObject(MediaNodePrivate *) - \internal -*/ - -/*! - \fn void Phonon::Factory::deregisterFrontendObject(MediaNodePrivate *) - \internal -*/ - -/*! - \fn void Phonon::Factory::setBackend(QObject *) -*/ - -/*! - \fn PlatformPlugin *Phonon::Factory::platformPlugin() -*/ - -/*! -/*! - \class Phonon::AbstractMediaStreamPrivate - \inmodule Phonon - \since 4.4 - \internal -*/ - -/*! - \class Phonon::FrontendInterfacePrivate - \inmodule Phonon - \since 4.4 - \internal -*/ - -/*! - \class Phonon::EffectWidgetPrivate - \inmodule Phonon - \since 4.4 - \internal -*/ - -/*! - \class Phonon::IODeviceStream - \inmodule Phonon - \since 4.4 - \internal -*/ - -/*! - \fn explicit Phonon::IODeviceStream::IODeviceStream(QIODevice *ioDevice, QObject *parent = 0) - \internal - - Creates a new IODeviceStream with the given \a ioDevice and \a - parent. - -*/ - -/*! - \fn Phonon::IODeviceStream::~IODeviceStream() - \internal -*/ - -/*! - \fn void Phonon::IODeviceStream::reset() - \internal -*/ - -/*! - \fn void Phonon::IODeviceStream::needData() - \internal -*/ - -/*! - \fn void Phonon::IODeviceStream::seekStream(qint64) - \internal -*/ - -/*! - \namespace Phonon::Platform - \inmodule Phonon - \internal -*/ - -/*! - \typedef Phonon::EffectDescriptionModel - \inmodule Phonon - \brief provides a item view model containing available audio effects. - -*/ - -/*! - \typedef Phonon::SubtitleDescription - \inmodule Phonon - \internal -*/ - -/*! - \typedef Phonon::SubtitleDescriptionModel - \inmodule Phonon - \internal -*/ - -/*! - \typedef Phonon::AudioChannelDescription - \inmodule Phonon - \internal -*/ - -/*! - \typedef Phonon::AudioChannelDescriptionModel - \inmodule Phonon - \internal -*/ - -/*! - \typedef Phonon::AudioCaptureDevice - \inmodule Phonon - \internal -*/ - -/*! - \typedef Phonon::AudioCaptureDeviceModel - \inmodule Phonon - \internal -*/ - -/*! - \typedef Phonon::CleanUpFunction - \inmodule Phonon - \internal -*/ - -/*! - \typedef Phonon::QObjectPair - \inmodule Phonon - \since 4.4 - \internal - -*/ - -/*! - \typedef Phonon::AudioOutputDeviceModel - \inmodule Phonon - \brief provides an item view model containing available audio output devices. - -*/ - -/*! - \fn uint Phonon::qHash(const Phonon::EffectParameter ¶m) - \internal - -*/ - -/*! - \fn Phonon::CleanUpGlobalStatic::~CleanUpGlobalStatic() - \internal -*/ - -/*! - \class Phonon::ConstIface - \inmodule Phonon - \since 4.4 - \internal -*/ - -/*! - \class Phonon::CleanUpGlobalStatic - \inmodule Phonon - \since 4.4 - \internal -*/ - -/*! - \class Phonon::EffectParameterPrivate - \inmodule Phonon - \since 4.4 - \internal - -*/ - -/*! - \class Phonon::QSettingsGroup - \inmodule Phonon - \since 4.4 - \internal - -*/ - -/*! - \class Phonon::MediaNodeDestructionHandler - \inmodule Phonon - \since 4.4 - \internal - -*/ - -/*! - \fn Phonon::MediaNodeDestructionHandler::~MediaNodeDestructionHandler() - \internal - Called from Base::~Base if this object was registered - using BasePrivate::addDestructionHandler(). -*/ - -/*! - \fn Phonon::MediaNodeDestructionHandler::phononObjectDestroyed(MediaNodePrivate *) - \internal -*/ - -/*! - \fn explicit Phonon::EffectWidget::EffectWidget(Effect *effect, QWidget *parent = 0) - \internal - - Constructs a new EffectWidget for the specified \a effect and with - the specified \a parent. -*/ - -/*! - \fn Phonon::EffectWidget::~EffectWidget() - \internal -*/ - -/*! - \fn QDebug Phonon::operator<<(QDebug s, const ObjectDescription<T> &o) - \internal -*/ - -/*! - \class Phonon::ListModelHelper - \inmodule Phonon - \since 4.4 - \internal -*/ - -/*! - \class AudioOutputInterface42 - \inmodule Phonon - \since 4.4 - \internal -*/ - -/*! - \class Phonon::PulseSupport - \inmodule Phonon - \since 4.7 - \internal -*/ - -/*! - \class Phonon::AudioDataOutput - \inmodule Phonon - \since 4.7 - - \brief The AudioDataOutput class provides access to audio data. - - This class is used to obtain audio data, typically for the purpose of - visualizing it. - - Although it is not designed for realtime performance, the latencies - associated with accessing the data should be low enough for applications - that provide visualizations of the data. This class can also be used to - save the audio data for further processing. -*/ - -/*! - \enum Phonon::AudioDataOutput::Channel - - This enum describes the channel audio data belongs to. - - \value LeftChannel - \value RightChannel - \value CenterChannel - \value LeftSurroundChannel - \value RightSurroundChannel - \value SubwooferChannel -*/ - -/*! - \property Phonon::AudioDataOutput::dataSize - \brief the number of samples passed via the dataReady() signal. -*/ - -/*! - \fn int Phonon::AudioDataOutput::sampleRate() const - - Returns the sample rate measured in Hertz, as reported by the backend. - If the backend is unavailable -1 is returned. -*/ - -/*! - \fn void Phonon::AudioDataOutput::endOfMedia(int remainingSamples) - - This signal is emitted before the final dataReady() signal is emitted for - a media. The \a remainingSamples value sent by the signal contains the - number of samples that will be sent in the final dataReady() signal for - the media. -*/ - -/*! - \fn Phonon::AudioDataOutput::dataReady(const QMap<Phonon::AudioDataOutput::Channel, QVector<qint16> > &data) - - This signal is emitted whenever there is data available to read. The - \a data sent by the signal is supplied in the form of a map that holds the - data for different output channels. -*/ - -/*! - \fn Phonon::AudioDataOutputPrivate::AudioDataOutputPrivate() - \internal -*/ - -/*! - \fn Phonon::AudioDataOutputInterface::~AudioDataOutputInterface() - - Destroys the data interface. -*/ - -/*! - \fn Phonon::AudioDataOutputInterface::frontendObject() const - \internal -*/ - -/*! - \fn Phonon::AudioDataOutputInterface::setFrontendObject(AudioDataOutput *) - \internal -*/ - -/*! - \fn Phonon::GlobalConfigPrivate::GlobalConfigPrivate() - \internal -*/ - -/*! - \fn Phonon::GlobalConfigPrivate::~GlobalConfigPrivate() - \internal -*/ - -/*! - \fn Phonon::SwiftSlider::~SwiftSlider() - \internal -*/ diff --git a/doc/src/classes/phonon-namespace.qdoc b/doc/src/classes/phonon-namespace.qdoc deleted file mode 100644 index 919dda8dea31771fea3b097139fbae447489194f..0000000000000000000000000000000000000000 --- a/doc/src/classes/phonon-namespace.qdoc +++ /dev/null @@ -1,40 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** GNU Free Documentation License -** 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. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms -** and conditions contained in a signed written agreement between you -** and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \namespace Phonon - \brief The Phonon namespace contains classes and functions for multimedia applications. - \since 4.4 - - This namespace contains classes to access multimedia functions for - audio and video playback. Those classes are not dependent on any specific - framework, but rather use exchangeable backends to do the work. - - See the \l{Phonon Module} page for general information about the - framework and the \l{Phonon Overview} for an introductory tour of its - features. -*/ diff --git a/doc/src/deployment/deployment.qdoc b/doc/src/deployment/deployment.qdoc index 69184dd4d4b0b137f3acf3f98818b5a38d502838..e243624dc936df67c1fb3d1918b089abd8ac4e52 100644 --- a/doc/src/deployment/deployment.qdoc +++ b/doc/src/deployment/deployment.qdoc @@ -92,8 +92,6 @@ \li \l {QtWebKit} \li \l {QtXml} \li \l {QtXmlPatterns} - \row - \li \l {Phonon Module}{Phonon} \endtable Since Qt is not a system library, it has to be redistributed along @@ -157,13 +155,6 @@ Please see \l{WebKit in Qt#License Information}{the QtWebKit module documentation} for more information. - \row \li \l{Phonon Module}{Phonon} \li Phonon - \li Phonon relies on the native multimedia engines on different platforms. - Phonon itself is licensed under the GNU LGPL version 2. Please see - \l{Phonon Module#License Information}{the Phonon module documentation} - for more information on licensing and the - \l{Phonon Overview#Backends}{Phonon Overview} for details of the backends - in use on different platforms. \endtable \section1 Platform-Specific Notes @@ -1395,7 +1386,6 @@ \li The Image format plugins are always deployed. \li SQL driver plugins are deployed if the application uses the QtSql module. \li Script plugins are deployed if the application uses the QtScript module. - \li The Phonon backend plugin is deployed if the application uses the \l{Phonon Module} {Phonon} module. \li The svg icon plugin is deployed if the application uses the QtSvg module. \li The accessibility plugin is always deployed. \endlist diff --git a/doc/src/development/qmake-manual.qdoc b/doc/src/development/qmake-manual.qdoc index f48765ae1b6bf860e15666233eb9d98bf4f05f9e..35128c46441807ea6b4046e21b42a103bd0daa35 100644 --- a/doc/src/development/qmake-manual.qdoc +++ b/doc/src/development/qmake-manual.qdoc @@ -2997,7 +2997,6 @@ \row \li gui (included by default) \li QtGui module \row \li network \li QtNetwork module \row \li opengl \li QtOpenGL module - \row \li phonon \li Phonon Multimedia Framework \row \li sql \li QtSql module \row \li svg \li QtSvg module \row \li xml \li QtXml module diff --git a/doc/src/examples/capabilitiesexample.qdoc b/doc/src/examples/capabilitiesexample.qdoc deleted file mode 100644 index e6ce1562d51d017d1c6c032a7b6c91644599eddc..0000000000000000000000000000000000000000 --- a/doc/src/examples/capabilitiesexample.qdoc +++ /dev/null @@ -1,157 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** GNU Free Documentation License -** 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. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms -** and conditions contained in a signed written agreement between you -** and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \example phonon/capabilities - \title Capabilities Example - - The Backend Capabilities example shows how to check which MIME - types, audio devices, and audio effects are available. - - \image capabilitiesexample.png - - Phonon does not implement the multimedia functionality itself, but - relies on a backend to manage this. The backends do not manage the - hardware directly, but use intermediate technologies: QuickTime on - Mac, GStreamer on Linux, and DirectShow (which requires DirectX) - on Windows. - - The user may add support for new MIME types and effects to these - systems, and the systems abilities may also be different. The - support for multimedia MIME types, and audio effects in Phonon - will therefore vary from system to system. - - Backends informs the programmer about current capabilities through - an implementation of the Phonon::BackendCapabilities namespace. - The backend reports which MIME types can be played back, which - audio effects are available, and which sound devices are available - on the system. When the capabilities of a backend changes, it will - emit the - \l{Phonon::BackendCapabilities::Notifier::}{capabilitiesChanged()} - signal. - - The example consists of one class, \c Window, which displays - capabilities information from the current backend used by Phonon. - - See the \l{Phonon Overview} for a high-level introduction to - Phonon. - - \section1 Window Class Definition - - The \c Window class queries the Phonon backend for its - capabilities. The results are presented in a GUI consisting of - standard Qt widgets. We will now take a tour of the Phonon related - parts of both the definition and implementation of the \c Window - class. - - \snippet examples/phonon/capabilities/window.h windowMembers - - We need the slot to notice changes in the backends capabilities. - - \c mimeListWidget and \c devicesListView lists MIME types and - audio devices. The \c effectsTreeWidget lists audio effects, and - expands to show their parameters. - - The \c setupUi() and \c setupBackendBox() private utility - functions create the widgets and lays them out. We skip these - functions while discussing the implementation because they do not - contain Phonon relevant code. - - \section1 Window Class Implementation - - Our examination starts with a look at the constructor: - - \snippet examples/phonon/capabilities/window.cpp constructor - - After creating the user interface, we call \c updateWidgets(), - which will fill the widgets with the information we get from the - backend. We then connect the slot to the - \l{Phonon::BackendCapabilities::Notifier::}{capabilitiesChanged()} - and - \l{Phonon::BackendCapabilities::Notifier::availableAudioOutputDevicesChanged()}{availableAudioOutputDevicesChanged()} - signals in case the backend's abilities changes while the example - is running. The signal is emitted by a - Phonon::BackendCapabilities::Notifier object, which listens for - changes in the backend. - - In the \c updateWidgets() function, we query the backend for - information it has about its abilities and present it in the GUI - of \c Window. We dissect it here: - - \snippet examples/phonon/capabilities/window.cpp outputDevices - - The - \l{Phonon::BackendCapabilities::Notifier::}{availableAudioOutputDevicesChanged()} - function is a member of the Phonon::BackendCapabilities namespace. - It returns a list of \l{Phonon::}{AudioOutputDevice}s, which gives - us information about a particular device, e.g., a sound card or a - USB headset. - - Note that \l{Phonon::}{AudioOutputDevice} and also - \l{Phonon::}{EffectDescription}, which is described shortly, are - typedefs of \l{Phonon::}{ObjectDescriptionType}. - - \omit - ### - The \l{Phonon::}{ObjectDescriptionModel} is a convenience - model that displays the names of the devices. Their - descriptions are shown as tooltips and disabled devices are - shown in gray. - \endomit - - \snippet examples/phonon/capabilities/window.cpp mimeTypes - - The MIME types supported are given as strings in a QStringList. We - can therefore create a list widget item with the string, and - append it to the \c mimeListWidget, which displays the available - MIME types. - - \snippet examples/phonon/capabilities/window.cpp effects - - As before we add the description and name to our widget, which in - this case is a QTreeWidget. A particular effect may also have - parameters, which are inserted in the tree as child nodes of their - effect. - - \snippet examples/phonon/capabilities/window.cpp effectsParameters - - The parameters are only accessible through an instance of the - \l{Phonon::}{Effect} class. Notice that an effect is created - with the effect description. - - The \l{Phonon::}{EffectParameter} contains information about one - of an effects parameters. We pick out some of the information to - describe the parameter in the tree widget. - - \section1 The main() function - - Because Phonon uses D-Bus on Linux, it is necessary to give the - application a name. You do this with - \l{QCoreApplication::}{setApplicationName()}. - - \snippet examples/phonon/capabilities/main.cpp everything -*/ diff --git a/doc/src/examples/mediaplayer.qdoc b/doc/src/examples/mediaplayer.qdoc deleted file mode 100644 index ec55efd902c1ff4ba11a6b993ad0403a10fa4519..0000000000000000000000000000000000000000 --- a/doc/src/examples/mediaplayer.qdoc +++ /dev/null @@ -1,36 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** GNU Free Documentation License -** 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. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms -** and conditions contained in a signed written agreement between you -** and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \example phonon/qmediaplayer - \title Media Player - - The Media Player example shows how \l{Phonon Module}{Phonon} - can be used in Qt applications to handle audio and video playback. - - \image qmediaplayer-demo.png -*/ diff --git a/doc/src/examples/musicplayerexample.qdoc b/doc/src/examples/musicplayerexample.qdoc deleted file mode 100644 index d5a89cf8c6156e23aa021b4b0538a61d60a9ce44..0000000000000000000000000000000000000000 --- a/doc/src/examples/musicplayerexample.qdoc +++ /dev/null @@ -1,234 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** GNU Free Documentation License -** 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. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms -** and conditions contained in a signed written agreement between you -** and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \example phonon/qmusicplayer - \title Music Player Example - - The Music Player Example shows how to use Phonon - the multimedia - framework that comes with Qt - to create a simple music player. - The player can play music files, and provides simple playback - control, such as pausing, stopping, and resuming the music. - - \image musicplayer.png - - The player has a button group with the play, pause, and stop - buttons familiar from most music players. The top-most slider - controls the position in the media stream, and the bottom slider - allows adjusting the sound volume. - - The user can use a file dialog to add music files to a table, - which displays meta information about the music - such as the - title, album, and artist. Each row contains information about a - single music file; to play it, the user selects that row and - presses the play button. Also, when a row is selected, the files - in the table are queued for playback. - - Phonon offers playback of sound using an available audio device, - e.g., a sound card or an USB headset. For the implementation, we - use two objects: a \l{Phonon::}{MediaObject}, which controls the - playback, and an \l{Phonon::}{AudioOutput}, which can output the - audio to a sound device. We will explain how they cooperate when - we encounter them in the code. For a high-level introduction to - Phonon, see its \l{Phonon Overview}{overview}. - - The API of Phonon is implemented through an intermediate - technology on each supported platform: DirectShow, QuickTime, and - GStreamer. The sound formats supported may therefore vary from - system to system. We do not in this example try to determine which - formats are supported, but let Phonon report an error if the user - tries to play an unsupported sound file. - - Our player consists of one class, \c MainWindow, which both - constructs the GUI and handles the playback. We will now go - through the parts of its definition and implementation that - concerns Phonon. - - \section1 MainWindow Class Definition - - Most of the API in \c MainWindow is private, as is often the case - for classes that represent self-contained windows. We list Phonon - objects and slots we connect to their signals; we take a closer - look at them when we walk through the \c MainWindow - implementation. - - \snippet examples/phonon/qmusicplayer/mainwindow.h 2 - - We use the \l{Phonon::}{SeekSlider} to move the current playback - position in the media stream, and the \l{Phonon::}{VolumeSlider} - controls the sound volume. Both of these widgets come ready made - with Phonon. We use another \l{Phonon::}{MediaObject}, - metaInformationProvider, to get the meta information from the - music files. More on this later. - - \snippet examples/phonon/qmusicplayer/mainwindow.h 1 - - The \l{Phonon::}{MediaObject} informs us of the state of the playback and - properties of the media it is playing back through a series of - signals. We connect the signals we need to slots in \c MainWindow. - The \c tableClicked() slot is connected to the table, so that we - know when the user requests playback of a new music file, by - clicking on the table. - - \section1 MainWindow Class Implementation - - The \c MainWindow class handles both the user interface and - Phonon. We will now take a look at the code relevant for Phonon. - The code required for setting up the GUI is explained elsewhere. - - We start with the constructor: - - \snippet examples/phonon/qmusicplayer/mainwindow.cpp 0 - - We start by instantiating our media and audio output objects. - As mentioned, the media object knows how to playback - multimedia (in our case sound files) while the audio output - can send it to a sound device. - - For the playback to work, the media and audio output objects need - to get in contact with each other, so that the media object can - send the sound to the audio output. Phonon is a graph based - framework, i.e., its objects are nodes that can be connected by - paths. Objects are connected using the \c createPath() function, - which is part of the Phonon namespace. - - \snippet examples/phonon/qmusicplayer/mainwindow.cpp 1 - - We also connect signals of the media object to slots in our \c - MainWindow. We will examine them shortly. - - \snippet examples/phonon/qmusicplayer/mainwindow.cpp 2 - - Finally, we call private helper functions to set up the GUI. - The \c setupUi() function contains code for setting up the seek - , and volume slider. We move on to \c setupUi(): - - \snippet examples/phonon/qmusicplayer/mainwindow.cpp 3 - \dots - \snippet examples/phonon/qmusicplayer/mainwindow.cpp 4 - - After creating the widgets, they must be supplied with the - \l{Phonon::}{MediaObject} and \l{Phonon::}{AudioOutput} objects - they should control. - - In the \c setupActions(), we connect the actions for the play, - pause, and stop tool buttons, to slots of the media object. - - \snippet examples/phonon/qmusicplayer/mainwindow.cpp 5 - - We move on to the slots of \c MainWindow, starting with \c - addFiles(): - - \snippet examples/phonon/qmusicplayer/mainwindow.cpp 6 - - In the \c addFiles() slot, we add files selected by the user to - the \c sources list. We then set the first source selected on the - \c metaInformationProvider \l{Phonon::}{MediaObject}, which will - send a state changed signal when the meta information is resolved; - we have this signal connected to the \c metaStateChanged() slot. - - The media object informs us of state changes by sending the \c - stateChanged() signal. The \c stateChanged() slot is connected - to this signal. - - \snippet examples/phonon/qmusicplayer/mainwindow.cpp 9 - - The \l{Phonon::MediaObject::}{errorString()} function gives a - description of the error that is suitable for users of a Phonon - application. The two values of the \l{Phonon::}{ErrorState} enum - helps us determine whether it is possible to try to play the same - file again. - - \snippet examples/phonon/qmusicplayer/mainwindow.cpp 10 - - We update the GUI when the playback state changes, i.e., when it - starts, pauses, stops, or resumes. - - The media object will report other state changes, as defined by the - \l{Phonon::}{State} enum. - - The \c tick() slot is connected to a \l{Phonon::}{MediaObject} signal which is - emitted when the playback position changes: - - \snippet examples/phonon/qmusicplayer/mainwindow.cpp 11 - - The \c time is given in milliseconds. - - When the table is clicked on with the mouse, \c tableClick() - is invoked: - - \snippet examples/phonon/qmusicplayer/mainwindow.cpp 12 - - Since we stop the media object, we first check whether it is - currently playing. \c row contains the row in the table that was - clicked upon; the indices of \c sources follows the table, so we - can simply use \c row to find the new source. - - \snippet examples/phonon/qmusicplayer/mainwindow.cpp 13 - - When the media source changes, we simply need to select the - corresponding row in the table. - - \snippet examples/phonon/qmusicplayer/mainwindow.cpp 14 - - When \c metaStateChanged() is invoked, \c - metaInformationProvider has resolved the meta data for its current - source. A \l{Phonon::}{MediaObject} will do this before - entering \l{Phonon::}{StoppedState}. Note that we could also - have used the \l{Phonon::MediaObject::}{metaDataChanged()} signal for - this purpose. - - Some of the meta data is then chosen to be displayed in the - music table. A file might not contain the meta data requested, - in which case an empty string is returned. - - \snippet examples/phonon/qmusicplayer/mainwindow.cpp 15 - - If we have media sources in \c sources of which meta information - is not resolved, we set a new source on the \c - metaInformationProvider, which will invoke \c metaStateChanged() - again. - - We move on to the \c aboutToFinish() slot: - - \snippet examples/phonon/qmusicplayer/mainwindow.cpp 16 - - When a file is finished playing, the Music Player will move on and - play the next file in the table. This slot is connected to the - \l{Phonon::}{MediaObject}'s - \l{Phonon::MediaObject::}{aboutToFinish()} signal, which is - guaranteed to be emitted while there is still time to enqueue - another file for playback. - - \section1 The main() function. - - Phonon requires that the application has a name; it is set with - \l{QCoreApplication::}{setApplicationName()}. This is because - D-Bus, which is used by Phonon on Linux systems, demands this. - - \snippet examples/phonon/qmusicplayer/main.cpp 1 -*/ diff --git a/doc/src/frameworks-technologies/phonon.qdoc b/doc/src/frameworks-technologies/phonon.qdoc deleted file mode 100644 index ca951545aed713f4950663cff0c022d50f751925..0000000000000000000000000000000000000000 --- a/doc/src/frameworks-technologies/phonon.qdoc +++ /dev/null @@ -1,528 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:FDL$ -** GNU Free Documentation License -** 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. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms -** and conditions contained in a signed written agreement between you -** and Nokia. -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -/*! - \page phonon-overview.html - \title Phonon multimedia framework - \brief Using the Phonon multimedia framework in Qt. - \ingroup technology-apis - \ingroup best-practices - - \tableofcontents - - \target Phonon Overview - \section1 Introduction - - Qt uses the Phonon multimedia framework to provide functionality - for playback of the most common multimedia formats. The media can - be read from files or streamed over a network, using a QURL to a - file. - - In this overview, we take a look at the main concepts of Phonon. - We also explain the architecture, examine the - core API classes, and show examples on how to use the classes - provided. - - \section1 Architecture - - Phonon has three basic concepts: media objects, sinks, and paths. - A media object manages a media source, for instance, a music file; - it provides simple playback control, such as starting, stopping, - and pausing the playback. A sink outputs the media from Phonon, - e.g., by rendering video on a widget, or by sending audio to a - sound card. Paths are used to connect Phonon objects, i.e., a - media object and a sink, in a graph - called a media graph in - Phonon. - - As an example, we show a media graph for an audio stream: - - \image conceptaudio.png - - The playback is started and managed by the media object, which - send the media stream to any sinks connected to it by a path. The - sink then plays the stream back, usually though a sound card. - - \omit Not sure if this goes here, or anywhere... - All nodes in the graph are synchronized by the framework, - meaning that if more than one sink is connected to the same - media object, the framework will handle the synchronization - between the sinks; this happens for instance when a media - source containing video with sound is played back. More on - this later. - \endomit - - \section2 Media Objects - - The media object, an instance of the \l{Phonon::}{MediaObject} - class, lets you start, pause, and stop the playback of a media - stream, i.e., it provided basic control over the playback. You may - think of the object as a simple media player. - - The media data is provided by a media source, which is - kept by the media object. The media source is a separate - object - an instance of \l{Phonon::}{MediaSource} - in Phonon, and - not part of the graph itself. The source will supply the media - object with raw data. The data can be read from files and streamed - over a network. The contents of the source will be interpreted by - the media object. - - A media object is always instantiated with the default constructor - and then supplied with a media source. Concrete code examples are - given later in this overview. - - As a complement to the media object, Phonon also provides - \l{Phonon::}{MediaController}, which provides control over - features that are optional for a given media. For instance, for - chapters, menus, and titles of a VOB (DVD) file will be features - managed by a \l{Phonon::}{MediaController}. - - \section2 Sinks - - A sink is a node that can output media from the graph, i.e., it - does not send its output to other nodes. A sink is usually a - rendering device. - - The input of sinks in a Phonon media graph comes from a - \l{Phonon::}{MediaObject}, though it might have been processed - through other nodes on the way. - - While the \l{Phonon::}{MediaObject} controls the playback, the - sink has basic controls for manipulation of the media. With an - audio sink, for instance, you can control the volume and mute the - sound, i.e., it represents a virtual audio device. Another example - is the \l{Phonon::}{VideoWidget}, which can render video on a - QWidget and alter the brightness, hue, and scaling of the video. - - As an example we give an image of a graph used for playing back a - video file with sound. - - \image conceptvideo.png - - \section2 Processors - - Phonon does not allow manipulation of media streams directly, - i.e., one cannot alter a media stream's bytes programmatically - after they have been given to a media object. We have other nodes - to help with this: processors, which are placed in the graph on - the path somewhere between the media object and its sinks. In - Phonon, processors are of the \l{Phonon::}{Effect} class. - - When inserted into the rendering process, the processor will - alter the media stream, and will be active as long as it is part - of the graph. To stop, it needs to be removed. - - \omit \image conceptprocessor.png \endomit - - The \c {Effect}s may also have controls that affect how the media - stream is manipulated. A processor applying a depth effect to - audio, for instance, can have a value controlling the amount of - depth. An \c Effect can be configured at any point in time. - - \section1 Playback - - In some common cases, it is not necessary to build a graph - yourself. - - Phonon has convenience functions for building common graphs. For - playing an audio file, you can use the - \l{Phonon::}{createPlayer()} function. This will set up the - necessary graph and return the media object node; the sound can - then be started by calling its \l{Phonon::MediaObject::}{play()} - function. - - \snippet snippets/phonon.cpp 0 - - We have a similar solution for playing video files, the - \l{Phonon::}{VideoPlayer}. - - \snippet snippets/phonon.cpp 1 - - The VideoPlayer is a widget onto which the video will be drawn. - - The \c .pro file for a project needs the following line to be added: - - \snippet doc/src/snippets/code/doc_src_phonon.pro 0 - - Phonon comes with several widgets that provide functionality - commonly associated with multimedia players - notably SeekSlider - for controlling the position of the stream, VolumeSlider for - controlling sound volume, and EffectWidget for controlling the - parameters of an effect. You can learn about them in the API - documentation. - - \section1 Building Graphs - - If you need more freedom than the convenience functions described - in the previous section offers you, you can build the graphs - yourself. We will now take a look at how some common graphs are - built. Starting a graph up is a matter of calling the - \l{Phonon::MediaObject::}{play()} function of the media object. - - If the media source contains several types of media, for instance, a - stream with both video and audio, the graph will contain two - output nodes: one for the video and one for the audio. - - We will now look at the code required to build the graphs discussed - previously in the \l{Architecture} section. - - \section2 Audio - - When playing back audio, you create the media object and connect - it to an audio output node - a node that inherits from - AbstractAudioOutput. Currently, AudioOutput, which outputs audio - to the sound card, is provided. - - The code to create the graph is straight forward: - - \snippet snippets/phonon.cpp 2 - - Notice that the type of media an input source has is resolved by - Phonon, so you need not be concerned with this. If a source - contains multiple media formats, this is also handled - automatically. - - The media object is always created using the default constructor - since it handles all multimedia formats. - - The setting of a Category, Phonon::MusicCategory in this case, - does not affect the actual playback; the category can be used by - KDE to control the playback through, for instance, the control - panel. - - \omit Not sure about this - Users of KDE can often also choose to send sound with the - CommunicationCategory, e.g., given to VoIP, to their headset, - while sound with MusicCategory is sent to the sound card. - \endomit - - The AudioOutput class outputs the audio media to a sound card, - that is, one of the audio devices of the operating system. An - audio device can be a sound card or a intermediate technology, - such as \c DirectShow on windows. A default device will be chosen - if one is not set with \l{Phonon::AudioOutput::}{setOutputDevice()}. - - The AudioOutput node will work with all audio formats supported by - the back end, so you don't need to know what format a specific - media source has. - - For a an extensive example of audio playback, see the \l{Music - Player Example}{Phonon Music Player}. - - \section3 Audio Effects - - Since a media stream cannot be manipulated directly, the backend - can produce nodes that can process the media streams. These nodes - are inserted into the graph between a media object and an output - node. - - Nodes that process media streams inherit from the Effect class. - The effects available depends on the underlying system. Most of - these effects will be supported by Phonon. See the \l{Querying - Backends for Support} section for information on how to resolve - the available effects on a particular system. - - We will now continue the example from above using the Path - variable \c path to add an effect. The code is again trivial: - - \snippet snippets/phonon.cpp 3 - - Here we simply take the first available effect on the system. - - The effect will start immediately after being inserted into the - graph if the media object is playing. To stop it, you have to - detach it again using \l{Phonon::Path::}{removeEffect()} of the Path. - - \section2 Video - - For playing video, VideoWidget is provided. This class functions - both as a node in the graph and as a widget upon which it draws - the video stream. The widget will automatically choose an available - device for playing the video, which is usually a technology - between the Qt application and the graphics card, such as \c - DirectShow on Windows. - - The video widget does not play the audio (if any) in the media - stream. If you want to play the audio as well, you will need - an AudioOutput node. You create and connect it to the graph as - shown in the previous section. - - The code for creating this graph is given below, after which - one can play the video with \l{Phonon::MediaObject::}{play()}. - - \snippet snippets/phonon.cpp 4 - - The VideoWidget does not need to be set to a Category, it is - automatically classified to \l{Phonon::}{VideoCategory}, we only - need to assure that the audio is also classified in the same - category. - - The media object will split files with different media content - into separate streams before sending them off to other nodes in - the graph. It is the media object that determines the type of - content appropriate for nodes that connect to it. - - \omit This section is from the future - - \section2 Multiple Audio Sources and Graph Outputs - - In this section, we take a look at a graph that contains multiple - audio sources in addition to video. We have a video camera with - some embarrassing home footage from last weekend's party, a - microphone with which we intend to add commentary, and an audio - music file to set the correct mood. It would be an advantage to - write the graph output to a file for later viewing, but since this - is not yet supported by Qt backends, we will play it back - directly. - - <image of party graph> - - <code> - - <code walkthrough> - - \endomit - - \section1 Backends - - The multimedia functionality is not implemented by Phonon itself, - but by a back end - often also referred to as an engine. This - includes connecting to, managing, and driving the underlying - hardware or intermediate technology. For the programmer, this - implies that the media nodes, e.g., media objects, processors, and - sinks, are produced by the back end. Also, it is responsible for - building the graph, i.e., connecting the nodes. - - The backends of Qt use the media systems DirectShow (which - requires DirectX) on Windows, QuickTime on Mac, and GStreamer on - Linux. The functionality provided on the different platforms are - dependent on these underlying systems and may vary somewhat, e.g., - in the media formats supported. - - Backends expose information about the underlying system. It can - tell which media formats are supported, e.g., \c AVI, \c mp3, or - \c OGG. - - A user can often add support for new formats and filters to the - underlying system, by, for instance, installing the DivX codex. We - can therefore not give an exact overview of which formats are - available with the Qt backends. - - \omit Not sure I want a separate section for this - \section2 Communication with the Backends - - We cooperate with backends through static functions in the - Phonon namespace. We have already seen some of these functions - in code examples. Their two main responsibilities are creating - graph nodes and supplying information about the capabilities - of the various nodes. The nodes uses the backend internally - when created, so it is only connecting them in the graph that - you need to use the backend directly. - - The main functions for graph building are: - - \list - \li createPath(): This function creates a path between to - nodes, which it takes as arguments. - \li - \endlist - - For more detailed information, please consult the API - documentation. - - \endomit - - \section2 Querying Backends for Support - - As mentioned, Phonon depends on the backend to provide its - functionality. Depending on the individual backend, full support - of the API may not be in place. Applications therefore need to - check with the backend if functionality they require is - implemented. In this section, we take look at how this is done. - - The backend provides the - \l{Phonon::BackendCapabilities::}{availableMimeTypes()} and - \l{Phonon::BackendCapabilities::}{isMimeTypeAvailable()} functions - to query which MIME types the backend can produce nodes for. The - types are listed as strings, which for any type is equal for any - backend or platform. - - The backend will emit a signal - - \l{Phonon::BackendCapabilities::}{Notifier::capabilitiesChanged()} - - if its abilities have changed. If the available audio devices - have changed, the - \l{Phonon::BackendCapabilities::}{Notifier::availableAudioOutputDevicesChanged()} - signal is emitted instead. - - To query the actual audio devices possible, we have the - \l{Phonon::BackendCapabilities::}{availableAudioOutputDevices()} as - mentioned in the \l{#Sinks}{Sinks} section. To query information - about the individual devices, you can examine its \c name(); this - string is dependent on the operating system, and the Qt backends - does not analyze the devices further. - - The sink for playback of video does not have a selection of - devices. For convenience, the \l{Phonon::}{VideoWidget} is both a - node in the graph and a widget on which the video output is - rendered. To query the various video formats available, use - \l{Phonon::BackendCapabilities::}{isMimeTypeAvailable()}. To add - it to a path, you can use the Phonon::createPath() as usual. After - creating a media object, it is also possible to call its - \l{Phonon::MediaObject::}{hasVideo()} function. - - See also the \l{Capabilities Example}. - - \section1 Installing Phonon - - When running the Qt configure script, you will be notified whether - Phonon support is available on your system. As mentioned - previously, to use develop and run Phonon applications, you also - need to link to a backend, which provides the multimedia - functionality. - - Note that Phonon applications will compile and run without a - working backend, but will, of course, not work as expected. - - The following sections explains requirements for each backend. - - \section2 Windows - - On Windows, building Phonon requires DirectX and DirectShow - version 9 or higher. You'll need additional SDKs you can download - from Microsoft. - - \section3 Windows XP and later Windows versions - - If you develop for Windows XP and up, you should download the Windows SDK - \l{http://www.microsoft.com/downloads/details.aspx?FamilyID=e6e1c3df-a74f-4207-8586-711ebe331cdc&DisplayLang=en}{here}. - Before building Qt, just call the script: \c {C:\Program Files\Microsoft SDKs\Windows\v6.1\Bin\setenv.cmd} - - \note Visual C++ 2008 already contains the Windows SDK and doesn't - need that package and has already the environment set up for a - smooth compilation of phonon. - - \section3 Earlier Windows versions than Windows XP - - If you want to support previous Windows versions, you should download and install the Platform SDK. You find it - \l{http://www.microsoft.com/downloads/details.aspx?FamilyId=0BAF2B35-C656-4969-ACE8-E4C0C0716ADB&displaylang=en}{here}. - - \note The platform SDK provided with Visual C++ is not - complete and - you'll need this one to have DirectShow 9.0 support. You can download the DirectX SDK - \l{http://www.microsoft.com/downloads/details.aspx?familyid=09F7578C-24AA-4E0A-BF91-5FEC24C8C7BF&displaylang=en}{here}. - - \section3 Setting up the environment - - Once the SDKs are installed, please make sure to set your - environment variables LIB and INCLUDE correctly. The paths to the - include and lib directory of the SDKs should appear first. - Typically, to setup your environment, you would execute the - following script: - - \code - Set DXSDK_DIR=C:\Program Files\Microsoft DirectX SDK (February 2007) - %DXSDK_DIR%\utilities\bin\dx_setenv.cmd - C:\program files\Microsoft Platform SDK\setenv.cmd - \endcode - - If your environment is setup correctly, executing configure.exe on - your Qt installation should automatically activate Phonon. - - \warning The MinGW version of Qt does not support building the - Qt backend. - - \section2 Linux - - The Qt backend on Linux uses GStreamer (minimum version is 0.10), - which must be installed on the system. At a minimum, you need the - GStreamer library and base plugins, which provides support for \c - .ogg files. The package names may vary between Linux - distributions; on Mandriva, they have the following names: - - \table - \header - \li Package - \li Description - \row - \li libgstreamer0.10_0.10 - \li The GStreamer base library. - \row - \li libgstreamer0.10_0.10-devel - \li Contains files for developing applications with - GStreamer. - \row - \li libgstreamer-plugins-base0.10 - \li Contains the basic plugins for audio and video - playback, and will enable support for \c ogg files. - \row - \li libgstreamer-plugins-base0.10-devel - \li Makes it possible to develop applications using the - base plugins. - \endtable - - \omit Should go in troubleshooting (in for example README) - alsasink backend for GStreamer - \table - \header - \li Variable - \li Description - \row - \li PHONON_GST_AUDIOSINK - \li Sets the audio sink to be used. Possible values are - ... alsasink. - \row - \li PHONON_GSTREAMER_DRIVER - \li Sets the driver for GStreamer. This driver will - usually be configured automatically when - installing. - \row - \li PHONON_GST_VIDEOWIDGET - \li This variable can be set to the name of a widget to - use as the video widget?? - \row - \li PHONON_GST_DEBUG - \li Phonon will give debug information while running if - this variable is set to a number between 1 and 3. - \row - \li PHONON_TESTURL - \li ... - \endtable - \endomit - - \section2 Mac OS X - - On Mac OS X, Qt uses QuickTime for its backend. The minimum - supported version is 7.0. - - \section1 Deploying Phonon Applications on Windows and Mac OS X - - On Windows and Mac OS X, the Qt backend makes use of the - \l{QtOpenGL Module}{QtOpenGL} module. You therefore need to deploy - the QtOpenGL shared library. If this is not what you want, it is - possible to configure Qt without OpenGL support. In that case, you - need to run \c configure with the \c -no-opengl option. -*/ - diff --git a/doc/src/getting-started/examples.qdoc b/doc/src/getting-started/examples.qdoc index b08b8623774cdeb88707743bf33c8962978cd4bd..9d6c6179fcf2a6bbccfc7d5355c02d4c75942b3d 100644 --- a/doc/src/getting-started/examples.qdoc +++ b/doc/src/getting-started/examples.qdoc @@ -587,9 +587,7 @@ \page examples-multimedia.html \ingroup all-examples \title Multimedia Examples - \brief Audio, video, and Phonon with Qt. - - \image phonon-examples.png + \brief Audio and Video with Qt. \section1 Multimedia @@ -616,19 +614,6 @@ \li \l{multimedia/videographicsitem}{Video Graphics Item} \endlist - \section1 Phonon - - The Phonon Multimedia Framework brings multimedia support to Qt applications. - - The examples and demonstrations provided show how to play music and movies - using the Phonon API. - - \list - \li \l{phonon/capabilities}{Capabilities}\raisedaster - \li \l{phonon/qmediaplayer}{Media Player} - \li \l{phonon/qmusicplayer}{Music Player}\raisedaster - \endlist - Examples marked with an asterisk (*) are fully documented. */ diff --git a/doc/src/getting-started/installation.qdoc b/doc/src/getting-started/installation.qdoc index 4c2e72f36692f35d75948a0f86b03a10dcf1f5e6..827d4eca46b705a8aac29f0cff7612794d43e562 100644 --- a/doc/src/getting-started/installation.qdoc +++ b/doc/src/getting-started/installation.qdoc @@ -627,8 +627,6 @@ in the \l{Qt for Windows CE Requirements} document. \li MinGW or \l{TDM-GCC} with g++ version 4.6 or higher (not supported for all modules). \endlist - Qt Phonon on Windows additionally requires the \l{Direct X SDK}. - For the most up to date information about QtWebKit dependencies, please refer to the \l{http://trac.webkit.org/wiki/BuildingQtOnWindows}{QtWebKit wiki for Windows}. @@ -808,13 +806,13 @@ in the \l{Qt for Windows CE Requirements} document. programming. If you're new to the subject a good starting point is \l{http://www.opengl.org/}. - \section1 Phonon Dependencies + \section1 Multimedia Dependencies - As described in the \l{Phonon Overview}, Phonon uses the GStreamer multimedia - framework as the backend for audio and video playback on X11. The minimum required + As described in the \l{Multimedia Overview}, Qt Multimedia uses the GStreamer multimedia + framework as the backend for audio and video playback on Linux. The minimum required version of GStreamer is 0.10. - To build Phonon, you need the GStreamer library, base plugins, and development + To build Qt Multimedia, you need the GStreamer library, base plugins, and development files for your system. The package names for GStreamer vary between Linux distributions; try searching for \c gstreamer or \c libgstreamer in your distribution's package repository to find suitable packages. @@ -833,7 +831,7 @@ in the \l{Qt for Windows CE Requirements} document. \li sqlite (development version) \li fontconfig (development version) \li xrender (development version) - \li phonon (development version) + \li gstreamer (development version) \endlist These should be available in most major Linux distributions, but the exact install instructions will vary. @@ -1156,14 +1154,6 @@ in the \l{Qt for Windows CE Requirements} document. If the evaluation succeeds, the feature is included. \row \li \c {-dbus-linked} \li Compile in D-Bus support and link to libdbus-1 \li - \row \li \c {-no-phonon} \li Do not compile in the Phonon module \li - \row \li \c {-phonon} \li Compile the Phonon module. \li Phonon is built if a - decent C++ compiler is used. This option denotes a default value and needs - to be evaluated. If the evaluation succeeds, the feature is included. - \row \li \c {-no-phonon-backend} \li Do not compile the platform-specific - Phonon backend-plugin \li - \row \li \c {-phonon-backend} \li Compile in the platform-specific Phonon - backend-plugin \li Default value. \row \li \c {-no-multimedia} \li Do not compile the multimedia module \li \row \li \c {-multimedia} \li Compile in multimedia module \li Default value. \row \li \c {-no-audio-backend} \li Do not compile in the platform audio @@ -1232,7 +1222,5 @@ in the \l{Qt for Windows CE Requirements} document. option denotes a default value and needs to be evaluated. If the evaluation succeeds, the feature is included. \row \li \c {-signature <file>} \li Use file for signing the target project \li - \row \li \c {-phonon-wince-ds9} \li Enable Phonon Direct Show 9 backend for - Windows CE \li Default value \endtable */ diff --git a/doc/src/modules.qdoc b/doc/src/modules.qdoc index a11adf84c1d470408e4dd03d843346642919fdab..101868eb50e6167576cbe3128572e2c7597ca9a9 100644 --- a/doc/src/modules.qdoc +++ b/doc/src/modules.qdoc @@ -63,8 +63,7 @@ \row \li \l{QtWidgets} \li Classes for widget development \row \li \l{QtXml} \li Classes for handling XML \row \li \l{QtXmlPatterns} \li An XQuery & XPath engine for XML and custom data models - \row \li \l{Qt 3D}\li Classes and elements for the 3D API. - \row \li \l{Phonon Module}{Phonon} \li Multimedia framework classes + \row \li \l{Qt3D Module}{Qt3D} \li Classes and elements for the 3D API. \header \li {2,1} \b{Modules for working with Qt's tools} \row \li \l{QtDesigner} \li Classes for extending \QD \row \li \l{QtHelp} \li Classes for online help @@ -277,74 +276,6 @@ \endlegalese */ -/*! - \page phonon-module.html - \module Phonon - \title Phonon Module - \ingroup modules - - \brief The Phonon module contains namespaces and classes for multimedia functionality. - - \generatelist{classesbymodule Phonon} - - Phonon is a cross-platform multimedia framework that enables the use of - audio and video content in Qt applications. The \l{Phonon Overview} - document provides an introduction to the architecture and features included - in Phonon. The \l{Phonon} namespace contains a list of all classes, functions - and namespaces provided by the module. - - Applications that use Phonon's classes need to - be configured to be built against the Phonon module. - The following declaration in a \c qmake project file ensures that - an application is compiled and linked appropriately: - - \snippet doc/src/snippets/code/doc_src_phonon.pro 0 - - \section1 Qt Backends - - Qt Backends are currently developed for Phonon version 4.1. The Phonon - project has moved on and introduced new features that the Qt Backends do not - implement. We have chosen not to document the part of Phonon that we do not - support. Any class or function not appearing in our documentation can be - considered unsupported. - - \section1 License Information - - Qt Commercial Edition licensees that wish to distribute applications that - use the Phonon module need to be aware of their obligations under the - GNU Lesser General Public License (LGPL). - - Developers using the Open Source Edition can choose to redistribute - the module under the appropriate version of the GNU LGPL; version 2.1 - for applications and libraries licensed under the GNU GPL version 2, - or version 3 for applications and libraries licensed under the GNU - GPL version 3. - - \legalese - This file is part of the KDE project - - Copyright (C) 2004-2009 Matthias Kretz <kretz@kde.org> \BR - Copyright (C) 2008 Ian Monroe <ian@monroe.nu> \BR - Copyright (C) 2007-2008 Trolltech ASA \BR - Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). \BR - Contact: http://www.qt-project.org/ - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - \endlegalese -*/ - /*! \module QtContacts \title QtContacts Module diff --git a/doc/src/platforms/platform-notes-rtos.qdoc b/doc/src/platforms/platform-notes-rtos.qdoc index 2b82296bdc3a5fb28ab35eb0042d9032105f53c9..3dc1011e2753b24384b6e378ba87ff6423daf90b 100644 --- a/doc/src/platforms/platform-notes-rtos.qdoc +++ b/doc/src/platforms/platform-notes-rtos.qdoc @@ -69,9 +69,6 @@ tightly coupled to one address space and process, while VxWorks only supports one global address space and has no concept of processes. - \row \li Phonon - \li There is no standard audio backend, which could be integrated into Phonon. - \endtable \section1 Build Instructions @@ -185,8 +182,6 @@ \li Not available - QNX doesn't support SYSV style system semaphores. \row \li QWS Multi Process \li QT_NO_QWS_MULTIPROCESS is always on due to missing shared memory support. - \row \li Phonon - \li There is no standard audio backend, which could be integrated into Phonon. \endtable \section1 Build Instructions @@ -285,8 +280,6 @@ \li Not available - INTEGRITY doesn't support SYSV style system semaphores. \row \li QWS Multi Process \li QT_NO_QWS_MULTIPROCESS is always on due to missing shared memory support. - \row \li Phonon - \li There is no standard audio backend. \row \li QtScript \li Not available - INTEGRITY's mmap() doesn't support allocating memory. \endtable diff --git a/doc/src/platforms/platform-notes.qdoc b/doc/src/platforms/platform-notes.qdoc index e052b00060aba98c9b85210b3cfb22a43256c6d0..a964c4c296e47d4da0ab50d39965b21d6afea3d6 100644 --- a/doc/src/platforms/platform-notes.qdoc +++ b/doc/src/platforms/platform-notes.qdoc @@ -76,16 +76,16 @@ \table \header \li Compiler \li{5,1} Features - \header \li \li Concurrent \li XmlPatterns \li WebKit(*) \li CLucene \li Phonon - \row \li g++ 3.3 \li \li \b{X} \li \li \b{X} \li \b{X} - \row \li g++ 3.4 and up \li \b{X} \li \b{X} \li \b{X} \li \b{X} \li \b{X} - \row \li SunCC 5.5 \li \li \li \li \b{X} \li \b{X} - \row \li aCC series 3 \li \li \li \li \b{X} \li \b{X} - \row \li aCC series 6 \li \b{X} \li \b{X} \li \b{X} \li \b{X} \li \b{X} - \row \li xlC 6 \li \li \li \li \b{X} \li \b{X} - \row \li Intel CC 10 \li \b{X} \li \b{X} \li \b{X} \li \b{X} \li \b{X} - \row \li MSVC 2003 \li \b{X} \li \b{X} \li \li \b{X} \li \b{X} - \row \li MSVC 2005 and up \li \b{X} \li \b{X} \li \b{X} \li \b{X} \li \b{X} + \header \li \li Concurrent \li XmlPatterns \li WebKit(*) \li CLucene + \row \li g++ 3.3 \li \li \b{X} \li \li \b{X} + \row \li g++ 3.4 and up \li \b{X} \li \b{X} \li \b{X} \li \b{X} + \row \li SunCC 5.5 \li \li \li \li \b{X} + \row \li aCC series 3 \li \li \li \li \b{X} + \row \li aCC series 6 \li \b{X} \li \b{X} \li \b{X} \li \b{X} + \row \li xlC 6 \li \li \li \li \b{X} + \row \li Intel CC 10 \li \b{X} \li \b{X} \li \b{X} \li \b{X} + \row \li MSVC 2003 \li \b{X} \li \b{X} \li \li \b{X} + \row \li MSVC 2005 and up \li \b{X} \li \b{X} \li \b{X} \li \b{X} \endtable * WebKit is only supported as a dynamically built library. Static linkage is not supported. diff --git a/doc/src/platforms/supported-platforms.qdoc b/doc/src/platforms/supported-platforms.qdoc index 1ada124e25433b65fb63b1bf1ab96ab1d78b1837..4f4768a68ec5d602349fb9c9c164a1918a37f8f8 100644 --- a/doc/src/platforms/supported-platforms.qdoc +++ b/doc/src/platforms/supported-platforms.qdoc @@ -69,8 +69,8 @@ \li Powerful \l{Thread Support in Qt}{multi-threading} features \li \l{Graphics View Framework}{2D graphics canvas} capable of handling millions of items - \li Integrated \l{Phonon multimedia framework}{Phonon multimedia - framework} + \li Multimedia support with \l{QtMultimedia module}{Qt Multimedia + module} \li \l{WebKit in Qt}{WebKit} integration \li \l{Network programming with Qt}{Networking}, \l{QtXml Module} {XML} and \l{SQL in Qt}{database} functionality @@ -179,8 +179,8 @@ \li Powerful \l{Thread Support in Qt}{multi-threading} features \li \l{Graphics View Framework}{2D graphics canvas} capable of handling millions of items - \li Integrated \l{Phonon multimedia framework}{Phonon multimedia - framework} + \li Support for Audio and Video through the \l{QtMultimedia module}{Qt Multimedia + module} \li \l{WebKit in Qt}{WebKit} integration \li \l{Network programming with Qt}{Networking}, \l{QtXml Module} {XML} and \l{SQL in Qt}{database} functionality @@ -264,8 +264,8 @@ \li Powerful \l{Thread Support in Qt}{multi-threading} features \li \l{Graphics View Framework}{2D graphics canvas} capable of handling millions of items - \li Integrated \l{Phonon multimedia framework}{Phonon multimedia - framework} + \li Support for Audio and Video through the \l{QtMultimedia module}{Qt Multimedia + module} \li \l{WebKit in Qt}{WebKit} integration \li \l{Network programming with Qt}{Networking}, \l{QtXml Module} {XML} and \l{SQL in Qt}{database} functionality diff --git a/doc/src/qt-features.qdoc b/doc/src/qt-features.qdoc index af880597550f743548917c36050f79b252477298..d962061779acec34f4dc90c3b6b82d56c0406a8b 100644 --- a/doc/src/qt-features.qdoc +++ b/doc/src/qt-features.qdoc @@ -145,11 +145,11 @@ \l{QMatrix4x4}{matrix multiplication}, \l{QQuaternion}{quaternions}, and an API for \l{QGLShader}{vertex and fragment shaders}. - Two APIs are provided for multimedia. The - \l{Phonon Overview}{Phonon Multimedia Framework} has traditionally been - used on desktop platforms. A set of - \l{QtMultimedia Module}{multimedia services} provides low-level access to - the system's audio system and is often used on mobile devices. + Audio and Video is supported through the + \l{QtMultimedia Module}{multimedia module}. The multimedia module offers a + comprehensive API to access the system's audio and video system, supports + low latency audio, the audio and video codecs installed on the system and + gives access to the camera. \clearfloat \section1 Infrastructure diff --git a/doc/src/snippets/audioeffects.cpp b/doc/src/snippets/audioeffects.cpp deleted file mode 100644 index 83a403fa16a9fceeacd6f0ddf3369444d866292b..0000000000000000000000000000000000000000 --- a/doc/src/snippets/audioeffects.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtGui> - -#include <phonon/audiooutput.h> -#include <phonon/mediaobject.h> -#include <phonon/backendcapabilities.h> -#include <phonon/effect.h> -#include <phonon/effectwidget.h> - -int main(int argv, char **args) -{ - QApplication app(argv, args); - app.setApplicationName("Audio effect tester"); - - Phonon::MediaObject *mediaObject = new Phonon::MediaObject; - mediaObject->setCurrentSource(QString("/home/gvatteka/Music/Lumme-Badloop.ogg")); - - Phonon::AudioOutput *audioOutput = - new Phonon::AudioOutput(Phonon::MusicCategory); - -//! [0] - QList<Phonon::EffectDescription> effectDescriptions = - Phonon::BackendCapabilities::availableAudioEffects(); - Phonon::EffectDescription effectDescription = effectDescriptions.at(4); - - Phonon::Path path = Phonon::createPath(mediaObject, audioOutput); - -//! [1] - Phonon::Effect *effect = new Phonon::Effect(effectDescription); - path.insertEffect(effect); -//! [0] - - Phonon::EffectWidget *effectWidget = new Phonon::EffectWidget(effect); - effectWidget->show(); -//! [1] - - mediaObject->play(); - - effectWidget->setWindowTitle("Effect Name: " + effectDescription.name()); - - app.exec(); -} diff --git a/doc/src/snippets/code/doc_src_deployment.qdoc b/doc/src/snippets/code/doc_src_deployment.qdoc index 8356bd02c1bbe09bbeff91631de347d64572f3a3..0803d8fe3b9f73f3c5dad70698cd687fa3957472 100644 --- a/doc/src/snippets/code/doc_src_deployment.qdoc +++ b/doc/src/snippets/code/doc_src_deployment.qdoc @@ -408,7 +408,6 @@ QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.6 //! [51a] install_name_tool -change /System/Library/Frameworks/CoreVideo.framework/ Versions/A/CoreVideo /System/Library/Frameworks/QuartzCore.framework/ -Versions/A/QuartzCore libphonon_qt7.dylib //! [51a] //! [51b] diff --git a/doc/src/snippets/code/doc_src_phonon-api.cpp b/doc/src/snippets/code/doc_src_phonon-api.cpp deleted file mode 100644 index 9d130afef5f728d741241b08fbcfa5221e741283..0000000000000000000000000000000000000000 --- a/doc/src/snippets/code/doc_src_phonon-api.cpp +++ /dev/null @@ -1,264 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -//! [0] -PushStream::PushStream(QObject *parent) - : AbstractMediaStream(parent), m_timer(new QTimer(this)) -{ - setStreamSize(getMediaStreamSize()); - - connect(m_timer, SIGNAL(timeout()), SLOT(moreData())); - m_timer->setInterval(0); -} - -void PushStream::moreData() -{ - const QByteArray data = getMediaData(); - if (data.isEmpty()) { - endOfData(); - } else { - writeData(data); - } -} - -void PushStream::needData() -{ - m_timer->start(); - moreData(); -} - -void PushStream::enoughData() -{ - m_timer->stop(); -} -//! [0] - - -//! [1] -PullStream::PullStream(QObject *parent) - : AbstractMediaStream(parent) -{ - setStreamSize(getMediaStreamSize()); -} - -void PullStream::needData() -{ - const QByteArray data = getMediaData(); - if (data.isEmpty()) { - endOfData(); - } else { - writeData(data); - } -} -//! [1] - - -//! [2] -seekStream(0); -//! [2] - - -//! [3] -MediaObject m; -QString fileName("/home/foo/bar.ogg"); -QUrl url("http://www.example.com/stream.mp3"); -QBuffer *someBuffer; -m.setCurrentSource(fileName); -m.setCurrentSource(url); -m.setCurrentSource(someBuffer); -m.setCurrentSource(Phonon::Cd); -//! [3] - - -//! [4] -VideoPlayer *player = new VideoPlayer(Phonon::VideoCategory, parentWidget); -connect(player, SIGNAL(finished()), player, SLOT(deleteLater())); -player->play(url); -//! [4] - - -//! [5] -audioPlayer->load(url); -audioPlayer->play(); -//! [5] - - -//! [6] -media = new MediaObject(this); -connect(media, SIGNAL(finished()), SLOT(slotFinished()); -media->setCurrentSource("/home/username/music/filename.ogg"); - -... - -media->play(); -//! [6] - - -//! [7] -media->setCurrentSource(":/sounds/startsound.ogg"); -media->enqueue("/home/username/music/song.mp3"); -media->enqueue(":/sounds/endsound.ogg"); -//! [7] - - -//! [8] - media->setCurrentSource(":/sounds/startsound.ogg"); - connect(media, SIGNAL(aboutToFinish()), SLOT(enqueueNextSource())); -} - -void enqueueNextSource() -{ - media->enqueue("/home/username/music/song.mp3"); -} -//! [8] - - -//! [9] -int x = 200; -media->setTickInterval(x); -Q_ASSERT(x == producer->tickInterval()); -//! [9] - - -//! [10] -int x = 200; -media->setTickInterval(x); -Q_ASSERT(x >= producer->tickInterval() && - x <= 2producer->tickInterval()); -//! [10] - - -//! [11] - connect(media, SIGNAL(hasVideoChanged(bool)), hasVideoChanged(bool)); - media->setCurrentSource("somevideo.avi"); - media->hasVideo(); // returns false; -} - -void hasVideoChanged(bool b) -{ - // b == true - media->hasVideo(); // returns true; -} -//! [11] - - -//! [12] - connect(media, SIGNAL(hasVideoChanged(bool)), hasVideoChanged(bool)); - media->setCurrentSource("somevideo.avi"); - media->hasVideo(); // returns false; -} - -void hasVideoChanged(bool b) -{ - // b == true - media->hasVideo(); // returns true; -} -//! [12] - - -//! [13] -setMetaArtist(media->metaData("ARTIST")); -setMetaAlbum(media->metaData("ALBUM")); -setMetaTitle(media->metaData("TITLE")); -setMetaDate(media->metaData("DATE")); -setMetaGenre(media->metaData("GENRE")); -setMetaTrack(media->metaData("TRACKNUMBER")); -setMetaComment(media->metaData("DESCRIPTION")); -//! [13] - - -//! [14] -QUrl url("http://www.example.com/music.ogg"); -media->setCurrentSource(url); -//! [14] - - -//! [15] -progressBar->setRange(0, 100); // this is the default -connect(media, SIGNAL(bufferStatus(int)), progressBar, SLOT(setValue(int))); -//! [15] - - -//! [16] -QObject::connect(BackendCapabilities::notifier(), SIGNAL(capabilitiesChanged()), ... -//! [16] - - -//! [17] -QComboBox *cb = new QComboBox(parentWidget); -ObjectDescriptionModel *model = new ObjectDescriptionModel(cb); -model->setModelData(BackendCapabilities::availableAudioOutputDevices()); -cb->setModel(model); -cb->setCurrentIndex(0); // select first entry -//! [17] - - -//! [18] -int cbIndex = cb->currentIndex(); -AudioOutputDevice selectedDevice = model->modelData(cbIndex); -//! [18] - - -//! [19] -Path path = Phonon::createPath(...); -Effect *effect = new Effect(this); -path.insertEffect(effect); -//! [19] - - -//! [20] -MediaObject *media = new MediaObject; -AudioOutput *output = new AudioOutput(Phonon::MusicCategory); -Path path = Phonon::createPath(media, output); -Q_ASSERT(path.isValid()); // for this simple case the path should always be - //valid - there are unit tests to ensure it -// insert an effect -QList<EffectDescription> effectList = BackendCapabilities::availableAudioEffects(); -if (!effectList.isEmpty()) { - Effect *effect = path.insertEffect(effectList.first()); -} -//! [20] - - -//! [21] -MediaObject *media = new MediaObject(parent); -VideoWidget *vwidget = new VideoWidget(parent); -Phonon::createPath(media, vwidget); -//! [21] diff --git a/doc/src/snippets/code/doc_src_phonon.pro b/doc/src/snippets/code/doc_src_phonon.pro deleted file mode 100644 index 262bfe146b79a6309474978f24bfe72692937aa7..0000000000000000000000000000000000000000 --- a/doc/src/snippets/code/doc_src_phonon.pro +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#! [0] -QT += phonon -#! [0] diff --git a/doc/src/snippets/medianodesnippet.cpp b/doc/src/snippets/medianodesnippet.cpp deleted file mode 100644 index fc49f9abd4ae8959a733b13114adb60b6ef39153..0000000000000000000000000000000000000000 --- a/doc/src/snippets/medianodesnippet.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtGui> - -#include <phonon/mediaobject.h> -#include <phonon/audiooutput.h> -#include <phonon/videowidget.h> -#include <phonon/medianode.h> -#include <phonon/path.h> - - -int main(int argv, char **args) -{ - QApplication app(argv, args); - -//![0] - Phonon::MediaObject *mediaObject = new Phonon::MediaObject; - Phonon::AudioOutput *audioOutput = new Phonon::AudioOutput; - Phonon::VideoWidget *videoWidget = new Phonon::VideoWidget; - - Phonon::createPath(mediaObject, audioOutput); - Phonon::createPath(mediaObject, videoWidget); - - QList<Phonon::Path> inputPaths = - audioOutput->inputPaths(); // inputPaths = [ mediaObject ] - QList<Phonon::Path> outputPaths = - mediaObject->outputPaths(); // outputPaths = [ audioOutput, videoWidget ] -//![0] - - return app.exec(); -} diff --git a/doc/src/snippets/phonon.cpp b/doc/src/snippets/phonon.cpp deleted file mode 100644 index 3eabb84aa9faa147d87ee766a994ab1024688a50..0000000000000000000000000000000000000000 --- a/doc/src/snippets/phonon.cpp +++ /dev/null @@ -1,95 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - - -Window::Window() -{ - { -//![0] - Phonon::MediaObject *music = - Phonon::createPlayer(Phonon::MusicCategory, - Phonon::MediaSource("/path/mysong.wav")); - music->play(); -//![0] - } - - { - QWidget *parentWidget = new QWidget; - QUrl url("Myfancymusic"); -//![1] - Phonon::VideoPlayer *player = - new Phonon::VideoPlayer(Phonon::VideoCategory, parentWidget); - player->play(url); -//![1] - } - - { -//![2] - Phonon::MediaObject *mediaObject = new Phonon::MediaObject(this); - mediaObject->setCurrentSource(Phonon::MediaSource("/mymusic/barbiegirl.wav")); - Phonon::AudioOutput *audioOutput = - new Phonon::AudioOutput(Phonon::MusicCategory, this); - Phonon::Path path = Phonon::createPath(mediaObject, audioOutput); -//![2] - -//![3] - Phonon::Effect *effect = - new Phonon::Effect( - Phonon::BackendCapabilities::availableAudioEffects()[0], this); - path.insertEffect(effect); -//![3] - } - - { -//![4] - Phonon::MediaObject *mediaObject = new Phonon::MediaObject(this); - - Phonon::VideoWidget *videoWidget = new Phonon::VideoWidget(this); - Phonon::createPath(mediaObject, videoWidget); - - Phonon::AudioOutput *audioOutput = - new Phonon::AudioOutput(Phonon::VideoCategory, this); - Phonon::createPath(mediaObject, audioOutput); -//![4] -//![5] - mediaObject->play(); -//![5] - } -} diff --git a/doc/src/snippets/phonon/samplebackend/main.cpp b/doc/src/snippets/phonon/samplebackend/main.cpp deleted file mode 100644 index 8048b3a4a292eb0ab8f1bcd217c0c0a97a6571ee..0000000000000000000000000000000000000000 --- a/doc/src/snippets/phonon/samplebackend/main.cpp +++ /dev/null @@ -1,155 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -//! [snippet] -QObject *Backend::createObject(BackendInterface::Class c, QObject *parent, const QList<QVariant> &args) -{ - switch (c) { - case MediaObjectClass: - return new MediaObject(parent); - case VolumeFaderEffectClass: - return new VolumeFaderEffect(parent); - case AudioOutputClass: - return new AudioOutput(parent); - case AudioDataOutputClass: - return new AudioDataOutput(parent); - case VisualizationClass: - return new Visualization(parent); - case VideoDataOutputClass: - return new VideoDataOutput(parent); - case EffectClass: - return new Effect(args[0].toInt(), parent); - case VideoWidgetClass: - return new VideoWidget(qobject_cast<QWidget *>(parent)); - } - return 0; -} - -QSet<int> Backend::objectDescriptionIndexes(ObjectDescriptionType type) const -{ - QSet<int> set; - switch(type) - { - case Phonon::AudioOutputDeviceType: - // use AudioDeviceEnumerator to list ALSA and OSS devices - set << 10000 << 10001; - break; - case Phonon::AudioCaptureDeviceType: - set << 20000 << 20001; - break; - case Phonon::VideoOutputDeviceType: - break; - case Phonon::VideoCaptureDeviceType: - set << 30000 << 30001; - break; - case Phonon::VisualizationType: - case Phonon::AudioCodecType: - case Phonon::VideoCodecType: - case Phonon::ContainerFormatType: - break; - case Phonon::EffectType: - set << 0x7F000001; - break; - } - return set; -} - -QHash<QByteArray, QVariant> Backend::objectDescriptionProperties(ObjectDescriptionType type, int index) const -{ - QHash<QByteArray, QVariant> ret; - switch (type) { - case Phonon::AudioOutputDeviceType: - switch (index) { - case 10000: - ret.insert("name", QLatin1String("internal Soundcard")); - break; - case 10001: - ret.insert("name", QLatin1String("USB Headset")); - ret.insert("icon", KIcon("usb-headset")); - ret.insert("available", false); - break; - } - break; - case Phonon::AudioCaptureDeviceType: - switch (index) { - case 20000: - ret.insert("name", QLatin1String("Soundcard")); - ret.insert("description", QLatin1String("first description")); - break; - case 20001: - ret.insert("name", QLatin1String("DV")); - ret.insert("description", QLatin1String("second description")); - break; - } - break; - case Phonon::VideoOutputDeviceType: - break; - case Phonon::VideoCaptureDeviceType: - switch (index) { - case 30000: - ret.insert("name", QLatin1String("USB Webcam")); - ret.insert("description", QLatin1String("first description")); - break; - case 30001: - ret.insert("name", QLatin1String("DV")); - ret.insert("description", QLatin1String("second description")); - break; - } - break; - case Phonon::VisualizationType: - break; - case Phonon::AudioCodecType: - break; - case Phonon::VideoCodecType: - break; - case Phonon::ContainerFormatType: - break; - case Phonon::EffectType: - switch (index) { - case 0x7F000001: - ret.insert("name", QLatin1String("Delay")); - ret.insert("description", QLatin1String("Simple delay effect with time, feedback and level controls.")); - break; - } - break; - } - return ret; -} -//! [snippet] diff --git a/doc/src/snippets/phononeffectparameter.cpp b/doc/src/snippets/phononeffectparameter.cpp deleted file mode 100644 index f6110e48d2db6467a8ad022ef1453e58b8b74186..0000000000000000000000000000000000000000 --- a/doc/src/snippets/phononeffectparameter.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtGui> - -#include <phonon/backendcapabilities.h> -#include <phonon/phononnamespace.h> -#include <phonon/effect.h> -#include <phonon/effectparameter.h> -#include <phonon/effectwidget.h> - - -int main(int argv, char **args) -{ - QApplication app(argv, args); - app.setApplicationName("effectsnippets"); - - QList<Phonon::EffectDescription> effects = - Phonon::BackendCapabilities::availableAudioEffects(); - - Phonon::Effect *effect = new Phonon::Effect(effects.at(3)); - -//![0] - QList<Phonon::EffectParameter> parameters = effect->parameters(); - - foreach(Phonon::EffectParameter parameter, parameters) { - // Do something with parameter - } -//![0] - -//![1] - Phonon::EffectWidget *effectWidget = new Phonon::EffectWidget(effect); -//![1] - - effectWidget->show(); - - return app.exec(); -} diff --git a/doc/src/snippets/phononobjectdescription.cpp b/doc/src/snippets/phononobjectdescription.cpp deleted file mode 100644 index 0d0f3a54f2c80c5a85d7be4c776d87c714249ab1..0000000000000000000000000000000000000000 --- a/doc/src/snippets/phononobjectdescription.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtGui> - -#include <phonon/phononnamespace.h> -#include <phonon/audiooutput.h> -#include <phonon/seekslider.h> -#include <phonon/mediaobject.h> -#include <phonon/volumeslider.h> -#include <phonon/backendcapabilities.h> -#include <phonon/effect.h> -#include <phonon/effectparameter.h> -#include <phonon/objectdescriptionmodel.h> -#include <QList> - -int main(int argv, char **args) -{ - QApplication app(argv, args); - -//![0] - QList<Phonon::EffectDescription> effectDescriptions = - Phonon::BackendCapabilities::availableAudioEffects(); - -//![1] - QList<Phonon::AudioOutputDevice> audioOutputDevices = - Phonon::BackendCapabilities::availableAudioOutputDevices(); - -//![1] - foreach (Phonon::EffectDescription effectDescription, effectDescriptions) { - Phonon::Effect *effect = new Phonon::Effect(effectDescription); - - // ... Do something with the effect, like insert it into a media graph - } - - Phonon::AudioOutput *audioOutput = new Phonon::AudioOutput; - - audioOutput->setOutputDevice(audioOutputDevices[0]); -//![0] - - return app.exec(); - -} diff --git a/doc/src/snippets/seekslider.cpp b/doc/src/snippets/seekslider.cpp deleted file mode 100644 index 9783e4504f74120f4387690020928cd0c798f2ca..0000000000000000000000000000000000000000 --- a/doc/src/snippets/seekslider.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtGui> - -#include <phonon/audiooutput.h> -#include <phonon/seekslider.h> -#include <phonon/mediaobject.h> -#include <phonon/audiooutput.h> - -int main(int argv, char **args) -{ - QApplication app(argv, args); - -//![0] - Phonon::MediaObject *moo = new Phonon::MediaObject;; - Phonon::AudioOutput *device = new Phonon::AudioOutput; - Phonon::createPath(moo, device); - moo->setCurrentSource(QString("/home/gvatteka/Music/Lumme-Badloop.ogg")); - - Phonon::SeekSlider *slider = new Phonon::SeekSlider; - slider->setMediaObject(moo); - - slider->show(); - moo->play(); -//![0] - - app.exec(); -} diff --git a/doc/src/snippets/videomedia.cpp b/doc/src/snippets/videomedia.cpp deleted file mode 100644 index e60f7deb8ae7550d0e7e9562f6e3b5242309a3a4..0000000000000000000000000000000000000000 --- a/doc/src/snippets/videomedia.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtGui> -#include <phonon> - -int main(int argv, char **args) -{ - QApplication app(argv, args); - - Phonon::VideoPlayer *player = new Phonon::VideoPlayer(Phonon::VideoCategory, 0); - -//![0] - player->mediaObject()->isSeekable(); -//![0] - - return app.exec(); -} - diff --git a/doc/src/snippets/volumeslider.cpp b/doc/src/snippets/volumeslider.cpp deleted file mode 100644 index 4bb8431cab55e27a2257b9a6cc93df282efa9982..0000000000000000000000000000000000000000 --- a/doc/src/snippets/volumeslider.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the documentation of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor -** the names of its contributors may be used to endorse or promote -** products derived from this software without specific prior written -** permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtGui> - -#include <phonon/audiooutput.h> -#include <phonon/mediaobject.h> -#include <phonon/volumeslider.h> - -int main(int argv, char **args) -{ - QApplication app(argv, args); - app.setApplicationName("Volume slider tester"); - - Phonon::MediaObject *mediaObject = new Phonon::MediaObject; - mediaObject->setCurrentSource(QString("/home/gvatteka/Music/Lumme-Badloop.ogg")); - -//! [0] - Phonon::AudioOutput *audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory); - Phonon::createPath(mediaObject, audioOutput); - - Phonon::VolumeSlider *volumeSlider = new Phonon::VolumeSlider; - volumeSlider->setAudioOutput(audioOutput); -//! [0] - - mediaObject->play(); - - volumeSlider->show(); - - return app.exec(); -} -