summaryrefslogtreecommitdiffstats
path: root/src/imports/multimedia/qdeclarativeaudio.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/imports/multimedia/qdeclarativeaudio.cpp')
-rw-r--r--src/imports/multimedia/qdeclarativeaudio.cpp741
1 files changed, 674 insertions, 67 deletions
diff --git a/src/imports/multimedia/qdeclarativeaudio.cpp b/src/imports/multimedia/qdeclarativeaudio.cpp
index 6efdb1afa..347a49f99 100644
--- a/src/imports/multimedia/qdeclarativeaudio.cpp
+++ b/src/imports/multimedia/qdeclarativeaudio.cpp
@@ -57,67 +57,6 @@
QT_BEGIN_NAMESPACE
/*!
- \qmlclass MediaPlayer
- \brief The MediaPlayer type allows you to add media playback to a scene.
-
- \inqmlmodule QtMultimedia 5
- \ingroup multimedia_qml
- \ingroup multimedia_audio_qml
- \ingroup multimedia_video_qml
-
- MediaPlayer is part of the \b{QtMultimedia 5.0} module.
-
- \qml
- import QtQuick 2.0
- import QtMultimedia 5.0
-
- Text {
- text: "Click Me!";
- font.pointSize: 24;
- width: 150; height: 50;
-
- MediaPlayer {
- id: playMusic
- source: "music.wav"
- }
- MouseArea {
- id: playArea
- anchors.fill: parent
- onPressed: { playMusic.play() }
- }
- }
- \endqml
-
- You can use MediaPlayer by itself to play audio content (like \l Audio),
- or you can use it in conjunction with a \l VideoOutput for rendering video.
-
- \qml
- import QtQuick 2.0
- import QtMultimedia 5.0
-
- Item {
- MediaPlayer {
- id: mediaplayer
- source: "groovy_video.mp4"
- }
-
- VideoOutput {
- anchors: parent.fill
- source: mediaplayer
- }
-
- MouseArea {
- id: playArea
- anchors.fill: parent
- onPressed: mediaplayer.play();
- }
- }
- \endqml
-
- \sa VideoOutput
-*/
-
-/*!
\qmlclass Audio QDeclarativeAudio
\brief The Audio type allows you to add audio playback to a scene.
@@ -151,12 +90,6 @@ QT_BEGIN_NAMESPACE
\sa Video
*/
-/*!
- \internal
- \class QDeclarativeAudio
- \brief The QDeclarativeAudio class provides an audio item that you can add to a QQuickView.
-*/
-
void QDeclarativeAudio::_q_error(QMediaPlayer::Error errorCode)
{
m_error = errorCode;
@@ -1169,6 +1102,680 @@ void QDeclarativeAudio::_q_statusChanged()
\sa {QtMultimedia::MetaData::Writer}
*/
+///////////// MediaPlayer Docs /////////////
+
+/*!
+ \qmlclass MediaPlayer
+ \brief The MediaPlayer type allows you to add media playback to a scene.
+
+ \inqmlmodule QtMultimedia 5
+ \ingroup multimedia_qml
+ \ingroup multimedia_audio_qml
+ \ingroup multimedia_video_qml
+
+ MediaPlayer is part of the \b{QtMultimedia 5.0} module.
+
+ \qml
+ import QtQuick 2.0
+ import QtMultimedia 5.0
+
+ Text {
+ text: "Click Me!";
+ font.pointSize: 24;
+ width: 150; height: 50;
+
+ MediaPlayer {
+ id: playMusic
+ source: "music.wav"
+ }
+ MouseArea {
+ id: playArea
+ anchors.fill: parent
+ onPressed: { playMusic.play() }
+ }
+ }
+ \endqml
+
+ You can use MediaPlayer by itself to play audio content (like \l Audio),
+ or you can use it in conjunction with a \l VideoOutput for rendering video.
+
+ \qml
+ import QtQuick 2.0
+ import QtMultimedia 5.0
+
+ Item {
+ MediaPlayer {
+ id: mediaplayer
+ source: "groovy_video.mp4"
+ }
+
+ VideoOutput {
+ anchors: parent.fill
+ source: mediaplayer
+ }
+
+ MouseArea {
+ id: playArea
+ anchors.fill: parent
+ onPressed: mediaplayer.play();
+ }
+ }
+ \endqml
+
+ \sa VideoOutput
+*/
+
+/*!
+ \qmlproperty enumeration QtMultimedia5::MediaPlayer::availability
+
+ Returns the availability state of the media player.
+
+ This is one of:
+ \table
+ \header \li Value \li Description
+ \row \li Available
+ \li The media player is available to use.
+ \row \li Busy
+ \li The media player is usually available, but some other
+ process is utilizing the hardware necessary to play media.
+ \row \li Unavailable
+ \li There are no supported media playback facilities.
+ \row \li ResourceMissing
+ \li There is one or more resources missing, so the media player cannot
+ be used. It may be possible to try again at a later time.
+ \endtable
+ */
+
+/*!
+ \qmlproperty enumeration QtMultimedia5::MediaPlayer::availability
+
+ Returns the availability state of the media player.
+
+ This is one of:
+ \table
+ \header \li Value \li Description
+ \row \li Available
+ \li The media player is available to use.
+ \row \li Busy
+ \li The media player is usually available, but some other
+ process is utilizing the hardware necessary to play media.
+ \row \li Unavailable
+ \li There are no supported media playback facilities.
+ \row \li ResourceMissing
+ \li There is one or more resources missing, so the media player cannot
+ be used. It may be possible to try again at a later time.
+ \endtable
+ */
+
+/*!
+ \qmlmethod QtMultimedia5::MediaPlayer::play()
+
+ Starts playback of the media.
+
+ Sets the \l playbackState property to PlayingState.
+*/
+
+/*!
+ \qmlmethod QtMultimedia5::MediaPlayer::pause()
+
+ Pauses playback of the media.
+
+ Sets the \l playbackState property to PausedState.
+*/
+
+/*!
+ \qmlmethod QtMultimedia5::MediaPlayer::stop()
+
+ Stops playback of the media.
+
+ Sets the \l playbackState property to StoppedState.
+*/
+
+/*!
+ \qmlproperty url QtMultimedia5::MediaPlayer::source
+
+ This property holds the source URL of the media.
+*/
+
+/*!
+ \qmlproperty bool QtMultimedia5::MediaPlayer::autoLoad
+
+ This property indicates if loading of media should begin immediately.
+
+ Defaults to true, if false media will not be loaded until playback is started.
+*/
+
+/*!
+ \qmlsignal QtMultimedia5::MediaPlayer::playbackStateChanged()
+
+ This handler is called when the \l playbackState property is altered.
+*/
+
+
+/*!
+ \qmlsignal QtMultimedia5::MediaPlayer::paused()
+
+ This handler is called when playback is paused.
+*/
+
+/*!
+ \qmlsignal QtMultimedia5::MediaPlayer::stopped()
+
+ This handler is called when playback is stopped.
+*/
+
+/*!
+ \qmlsignal QtMultimedia5::MediaPlayer::playing()
+
+ This handler is called when playback is started or resumed.
+*/
+
+/*!
+ \qmlproperty enumeration QtMultimedia5::MediaPlayer::status
+
+ This property holds the status of media loading. It can be one of:
+
+ \list
+ \li NoMedia - no media has been set.
+ \li Loading - the media is currently being loaded.
+ \li Loaded - the media has been loaded.
+ \li Buffering - the media is buffering data.
+ \li Stalled - playback has been interrupted while the media is buffering data.
+ \li Buffered - the media has buffered data.
+ \li EndOfMedia - the media has played to the end.
+ \li InvalidMedia - the media cannot be played.
+ \li UnknownStatus - the status of the media is unknown.
+ \endlist
+*/
+
+/*!
+ \qmlproperty enumeration QtMultimedia5::MediaPlayer::playbackState
+
+ This property holds the state of media playback. It can be one of:
+
+ \list
+ \li PlayingState - the media is currently playing.
+ \li PausedState - playback of the media has been suspended.
+ \li StoppedState - playback of the media is yet to begin.
+ \endlist
+*/
+
+/*!
+ \qmlproperty bool QtMultimedia5::MediaPlayer::autoPlay
+
+ This property controls whether the media will begin to play on start up.
+
+ Defaults to false, if set true the value of autoLoad will be overwritten to true.
+*/
+
+/*!
+ \qmlproperty int QtMultimedia5::MediaPlayer::duration
+
+ This property holds the duration of the media in milliseconds.
+
+ If the media doesn't have a fixed duration (a live stream for example) this will be 0.
+*/
+
+/*!
+ \qmlproperty int QtMultimedia5::MediaPlayer::position
+
+ This property holds the current playback position in milliseconds.
+
+ If the \l seekable property is true, this property can be set to seek to a new position.
+*/
+
+/*!
+ \qmlproperty real QtMultimedia5::MediaPlayer::volume
+
+ This property holds the volume of the audio output, from 0.0 (silent) to 1.0 (maximum volume).
+
+ Defaults to 1.0.
+*/
+
+/*!
+ \qmlproperty bool QtMultimedia5::MediaPlayer::muted
+
+ This property holds whether the audio output is muted.
+
+ Defaults to false.
+*/
+
+/*!
+ \qmlproperty bool QtMultimedia5::MediaPlayer::hasAudio
+
+ This property holds whether the media contains audio.
+*/
+
+/*!
+ \qmlproperty bool QtMultimedia5::MediaPlayer::hasVideo
+
+ This property holds whether the media contains video.
+*/
+
+/*!
+ \qmlproperty real QtMultimedia5::MediaPlayer::bufferProgress
+
+ This property holds how much of the data buffer is currently filled, from 0.0 (empty) to 1.0
+ (full).
+*/
+
+/*!
+ \qmlproperty bool QtMultimedia5::MediaPlayer::seekable
+
+ This property holds whether position of the audio can be changed.
+
+ If true; setting a \l position value will cause playback to seek to the new position.
+*/
+
+/*!
+ \qmlproperty real QtMultimedia5::MediaPlayer::playbackRate
+
+ This property holds the rate at which audio is played at as a multiple of the normal rate.
+
+ Defaults to 1.0.
+*/
+
+/*!
+ \qmlproperty enumeration QtMultimedia5::MediaPlayer::error
+
+ This property holds the error state of the audio. It can be one of:
+
+ \table
+ \header \li Value \li Description
+ \row \li NoError
+ \li There is no current error.
+ \row \li ResourceError
+ \li The audio cannot be played due to a problem allocating resources.
+ \row \li FormatError
+ \li The audio format is not supported.
+ \row \li NetworkError
+ \li The audio cannot be played due to network issues.
+ \row \li AccessDenied
+ \li The audio cannot be played due to insufficient permissions.
+ \row \li ServiceMissing
+ \li The audio cannot be played because the media service could not be
+ instantiated.
+ \endtable
+*/
+
+/*!
+ \qmlproperty string QtMultimedia5::MediaPlayer::errorString
+
+ This property holds a string describing the current error condition in more detail.
+*/
+
+/*!
+ \qmlsignal QtMultimedia5::MediaPlayer::error(error, errorString)
+
+ This handler is called when an \l {QMediaPlayer::Error}{error} has
+ occurred. The errorString parameter may contain more detailed
+ information about the error.
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.title
+
+ This property holds the tile of the media.
+
+ \sa {QtMultimedia::MetaData::Title}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.subTitle
+
+ This property holds the sub-title of the media.
+
+ \sa {QtMultimedia::MetaData::SubTitle}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.author
+
+ This property holds the author of the media.
+
+ \sa {QtMultimedia::MetaData::Author}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.comment
+
+ This property holds a user comment about the media.
+
+ \sa {QtMultimedia::MetaData::Comment}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.description
+
+ This property holds a description of the media.
+
+ \sa {QtMultimedia::MetaData::Description}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.category
+
+ This property holds the category of the media
+
+ \sa {QtMultimedia::MetaData::Category}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.genre
+
+ This property holds the genre of the media.
+
+ \sa {QtMultimedia::MetaData::Genre}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.year
+
+ This property holds the year of release of the media.
+
+ \sa {QtMultimedia::MetaData::Year}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.date
+
+ This property holds the date of the media.
+
+ \sa {QtMultimedia::MetaData::Date}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.userRating
+
+ This property holds a user rating of the media in the range of 0 to 100.
+
+ \sa {QtMultimedia::MetaData::UserRating}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.keywords
+
+ This property holds a list of keywords describing the media.
+
+ \sa {QtMultimedia::MetaData::Keywords}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.language
+
+ This property holds the language of the media, as an ISO 639-2 code.
+
+ \sa {QtMultimedia::MetaData::Language}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.publisher
+
+ This property holds the publisher of the media.
+
+ \sa {QtMultimedia::MetaData::Publisher}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.copyright
+
+ This property holds the media's copyright notice.
+
+ \sa {QtMultimedia::MetaData::Copyright}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.parentalRating
+
+ This property holds the parental rating of the media.
+
+ \sa {QtMultimedia::MetaData::ParentalRating}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.ratingOrganization
+
+ This property holds the name of the rating organization responsible for the
+ parental rating of the media.
+
+ \sa {QtMultimedia::MetaData::RatingOrganization}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.size
+
+ This property property holds the size of the media in bytes.
+
+ \sa {QtMultimedia::MetaData::Size}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.mediaType
+
+ This property holds the type of the media.
+
+ \sa {QtMultimedia::MetaData::MediaType}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.audioBitRate
+
+ This property holds the bit rate of the media's audio stream in bits per
+ second.
+
+ \sa {QtMultimedia::MetaData::AudioBitRate}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.audioCodec
+
+ This property holds the encoding of the media audio stream.
+
+ \sa {QtMultimedia::MetaData::AudioCodec}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.averageLevel
+
+ This property holds the average volume level of the media.
+
+ \sa {QtMultimedia::MetaData::AverageLevel}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.channelCount
+
+ This property holds the number of channels in the media's audio stream.
+
+ \sa {QtMultimedia::MetaData::ChannelCount}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.peakValue
+
+ This property holds the peak volume of media's audio stream.
+
+ \sa {QtMultimedia::MetaData::PeakValue}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.sampleRate
+
+ This property holds the sample rate of the media's audio stream in hertz.
+
+ \sa {QtMultimedia::MetaData::SampleRate}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.albumTitle
+
+ This property holds the title of the album the media belongs to.
+
+ \sa {QtMultimedia::MetaData::AlbumTitle}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.albumArtist
+
+ This property holds the name of the principal artist of the album the media
+ belongs to.
+
+ \sa {QtMultimedia::MetaData::AlbumArtist}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.contributingArtist
+
+ This property holds the names of artists contributing to the media.
+
+ \sa {QtMultimedia::MetaData::ContributingArtist}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.composer
+
+ This property holds the composer of the media.
+
+ \sa {QtMultimedia::MetaData::Composer}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.conductor
+
+ This property holds the conductor of the media.
+
+ \sa {QtMultimedia::MetaData::Conductor}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.lyrics
+
+ This property holds the lyrics to the media.
+
+ \sa {QtMultimedia::MetaData::Lyrics}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.mood
+
+ This property holds the mood of the media.
+
+ \sa {QtMultimedia::MetaData::Mood}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.trackNumber
+
+ This property holds the track number of the media.
+
+ \sa {QtMultimedia::MetaData::TrackNumber}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.trackCount
+
+ This property holds the number of tracks on the album containing the media.
+
+ \sa {QtMultimedia::MetaData::TrackNumber}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.coverArtUrlSmall
+
+ This property holds the URL of a small cover art image.
+
+ \sa {QtMultimedia::MetaData::CoverArtUrlSmall}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.coverArtUrlLarge
+
+ This property holds the URL of a large cover art image.
+
+ \sa {QtMultimedia::MetaData::CoverArtUrlLarge}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.resolution
+
+ This property holds the dimension of an image or video.
+
+ \sa {QtMultimedia::MetaData::Resolution}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.pixelAspectRatio
+
+ This property holds the pixel aspect ratio of an image or video.
+
+ \sa {QtMultimedia::MetaData::PixelAspectRatio}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.videoFrameRate
+
+ This property holds the frame rate of the media's video stream.
+
+ \sa {QtMultimedia::MetaData::VideoFrameRate}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.videoBitRate
+
+ This property holds the bit rate of the media's video stream in bits per
+ second.
+
+ \sa {QtMultimedia::MetaData::VideoBitRate}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.videoCodec
+
+ This property holds the encoding of the media's video stream.
+
+ \sa {QtMultimedia::MetaData::VideoCodec}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.posterUrl
+
+ This property holds the URL of a poster image.
+
+ \sa {QtMultimedia::MetaData::PosterUrl}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.chapterNumber
+
+ This property holds the chapter number of the media.
+
+ \sa {QtMultimedia::MetaData::ChapterNumber}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.director
+
+ This property holds the director of the media.
+
+ \sa {QtMultimedia::MetaData::Director}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.leadPerformer
+
+ This property holds the lead performer in the media.
+
+ \sa {QtMultimedia::MetaData::LeadPerformer}
+*/
+
+/*!
+ \qmlproperty variant QtMultimedia5::MediaPlayer::metaData.writer
+
+ This property holds the writer of the media.
+
+ \sa {QtMultimedia::MetaData::Writer}
+*/
+
QT_END_NAMESPACE
#include "moc_qdeclarativeaudio_p.cpp"