Remove the legacy QML API.

This means no version 4.0 (which was never released) and no
Qt.multimediakit alternative import.

Change-Id: Iaacf047b0d72381a4a8cd975e036135ed11ea383
Reviewed-by: Ling Hu <ling.hu@nokia.com>
This commit is contained in:
Michael Goddard
2012-06-08 10:57:15 +10:00
committed by Qt by Nokia
parent 4000a180dd
commit 342b8b9be5
14 changed files with 322 additions and 3507 deletions

View File

@@ -1,101 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/
**
** This file is part of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this
** file. Please review the following information to ensure the GNU Lesser
** General Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU General
** Public License version 3.0 as published by the Free Software Foundation
** and appearing in the file LICENSE.GPL included in the packaging of this
** file. Please review the following information to ensure the GNU General
** Public License version 3.0 requirements will be met:
** http://www.gnu.org/copyleft/gpl.html.
**
** 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$
**
****************************************************************************/
import QtQuick 2.0
import QtMultimedia 4.0
Item {
id: video
property alias fillMode: videoOut.fillMode
property alias orientation: videoOut.orientation
readonly property int stretch: VideoOutput.Stretch
readonly property int preserveAspectFit: VideoOutput.PreserveAspectFit
readonly property int preserveAspectCrop: VideoOutput.PreserveAspectCrop
property alias autoLoad: player.autoLoad
property alias bufferProgress: player.bufferProgress
property alias duration: player.duration
property alias error: player.error
property alias errorString: player.errorString
property alias hasAudio: player.hasAudio
property alias hasVideo: player.hasVideo
property alias metaData: player.metaData
property alias muted: player.muted
property alias paused: player.paused
property alias playbackRate: player.playbackRate
property alias playing: player.playing
property alias position: player.position
property alias seekable: player.seekable
property alias source: player.source
property alias status: player.status
property alias volume: player.volume
signal resumed
signal started
signal stopped
VideoOutput {
id: videoOut
anchors.fill: video
source: player
}
MediaPlayer {
id: player
onResumed: video.resumed()
onStarted: video.started()
onStopped: video.stopped()
}
function play() {
player.play();
}
function pause() {
player.pause();
}
function stop() {
player.stop();
}
}

View File

@@ -47,7 +47,6 @@
#include "qdeclarativemediametadata_p.h"
#include "qdeclarativeaudio_p.h"
#include "qdeclarativeaudio_p_4.h"
#include "qdeclarativevideooutput_p.h"
#include "qdeclarativeradio_p.h"
#include "qdeclarativeradiodata_p.h"
@@ -71,31 +70,8 @@ class QMultimediaDeclarativeModule : public QQmlExtensionPlugin
public:
virtual void registerTypes(const char *uri)
{
Q_ASSERT(QLatin1String(uri) == QLatin1String("QtMultimedia")
|| QLatin1String(uri) == QLatin1String("Qt.multimediakit"));
Q_ASSERT(QLatin1String(uri) == QLatin1String("QtMultimedia"));
qmlRegisterType<QSoundEffect>(uri, 4, 0, "SoundEffect");
qmlRegisterType<QDeclarativeAudio_4>(uri, 4, 0, "Audio");
qmlRegisterType<QDeclarativeAudio_4>(uri, 4, 0, "MediaPlayer");
qmlRegisterType<QDeclarativeVideoOutput>(uri, 4, 0, "VideoOutput");
qmlRegisterType<QDeclarativeRadio>(uri, 4, 0, "Radio");
qmlRegisterType<QDeclarativeRadioData>(uri, 4, 0, "RadioData");
qmlRegisterType<QDeclarativeCamera>(uri, 4, 0, "Camera");
qmlRegisterUncreatableType<QDeclarativeCameraCapture>(uri, 4, 0, "CameraCapture",
trUtf8("CameraCapture is provided by Camera"));
qmlRegisterUncreatableType<QDeclarativeCameraRecorder>(uri, 4, 0, "CameraRecorder",
trUtf8("CameraRecorder is provided by Camera"));
qmlRegisterUncreatableType<QDeclarativeCameraExposure>(uri, 4, 0, "CameraExposure",
trUtf8("CameraExposure is provided by Camera"));
qmlRegisterUncreatableType<QDeclarativeCameraFocus>(uri, 4, 0, "CameraFocus",
trUtf8("CameraFocus is provided by Camera"));
qmlRegisterUncreatableType<QDeclarativeCameraFlash>(uri, 4, 0, "CameraFlash",
trUtf8("CameraFlash is provided by Camera"));
qmlRegisterUncreatableType<QDeclarativeCameraImageProcessing>(uri, 4, 0, "CameraImageProcessing",
trUtf8("CameraImageProcessing is only provided by Camera type"));
// Introduced to help transition from QtMultimedia 4.0 to 5.0 (official for Qt 5)
// the 4.0 versioned types will be removed once all clients have made the transition.
qmlRegisterType<QSoundEffect>(uri, 5, 0, "SoundEffect");
qmlRegisterType<QDeclarativeAudio>(uri, 5, 0, "Audio");
qmlRegisterType<QDeclarativeAudio>(uri, 5, 0, "MediaPlayer");

View File

@@ -29,10 +29,7 @@ HEADERS += \
qdeclarativecamerafocus_p.h \
qdeclarativecameraimageprocessing_p.h \
qdeclarativecamerapreviewprovider_p.h \
qdeclarativetorch_p.h \
qdeclarativeaudio_p_4.h \
qdeclarativemediabase_p_4.h \
qdeclarativemediametadata_p_4.h
qdeclarativetorch_p.h
SOURCES += \
multimedia.cpp \
@@ -52,12 +49,9 @@ SOURCES += \
qdeclarativecamerafocus.cpp \
qdeclarativecameraimageprocessing.cpp \
qdeclarativecamerapreviewprovider.cpp \
qdeclarativetorch.cpp \
qdeclarativemediabase_4.cpp \
qdeclarativeaudio_4.cpp
qdeclarativetorch.cpp
OTHER_FILES += \
Video_4.qml \
Video.qml
# plugin.qmltypes is used by Qt Creator for syntax highlighting and the QML code model. It needs
@@ -82,19 +76,7 @@ QMAKE_EXTRA_TARGETS += qmltypes
# Tell qmake to create such makefile that qmldir, plugins.qmltypes and target
# (i.e. declarative_multimedia) are all copied to $$[QT_INSTALL_IMPORTS]/QtMultimedia directory,
qmldir.files += $$PWD/qmldir $$PWD/plugins.qmltypes $$PWD/Video.qml $$PWD/Video_4.qml
qmldir.files += $$PWD/qmldir $$PWD/plugins.qmltypes $$PWD/Video.qml
qmldir.path += $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
# another copy of the qmldir file so the old import works
OLDQMLDIRFILE = $${_PRO_FILE_PWD_}/qmldir.qtmultimediakit
oldcopy2build.input = OLDQMLDIRFILE
oldcopy2build.output = $$QT.multimedia.imports/Qt/multimediakit/qmldir
!contains(TEMPLATE_PREFIX, vc):oldcopy2build.variable_out = PRE_TARGETDEPS
oldcopy2build.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
oldcopy2build.name = COPY ${QMAKE_FILE_IN}
oldcopy2build.CONFIG += no_link
# `clean' should leave the build in a runnable state, which means it shouldn't delete qmldir
oldcopy2build.CONFIG += no_clean
QMAKE_EXTRA_COMPILERS += oldcopy2build
INSTALLS += target qmldir

File diff suppressed because it is too large Load Diff

View File

@@ -1,729 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/
**
** This file is part of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this
** file. Please review the following information to ensure the GNU Lesser
** General Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU General
** Public License version 3.0 as published by the Free Software Foundation
** and appearing in the file LICENSE.GPL included in the packaging of this
** file. Please review the following information to ensure the GNU General
** Public License version 3.0 requirements will be met:
** http://www.gnu.org/copyleft/gpl.html.
**
** 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$
**
****************************************************************************/
#include "qdeclarativeaudio_p_4.h"
#include <qmediaplayercontrol.h>
QT_BEGIN_NAMESPACE
/*
\qmlclass Audio QDeclarativeAudio
\brief The Audio element allows you to add audio playback to a scene.
\ingroup multimedia_qml
This element 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;
Audio {
id: playMusic
source: "music.wav"
}
MouseArea {
id: playArea
anchors.fill: parent
onPressed: { playMusic.play() }
}
}
\endqml
\sa Video
*/
/*
\internal
\class QDeclarativeAudio
\brief The QDeclarativeAudio class provides an audio item that you can add to a QQuickView.
*/
void QDeclarativeAudio_4::_q_error(int errorCode, const QString &errorString)
{
m_error = QMediaPlayer::Error(errorCode);
m_errorString = errorString;
emit error(Error(errorCode), errorString);
emit errorChanged();
}
QDeclarativeAudio_4::QDeclarativeAudio_4(QObject *parent)
: QObject(parent)
{
}
QDeclarativeAudio_4::~QDeclarativeAudio_4()
{
shutdown();
}
/*
\qmlmethod Audio::play()
Starts playback of the media.
Sets the \l playing property to true, and the \l paused property to false.
*/
void QDeclarativeAudio_4::play()
{
if (!m_complete)
return;
setPaused(false);
setPlaying(true);
}
/*
\qmlmethod Audio::pause()
Pauses playback of the media.
Sets the \l playing and \l paused properties to true.
*/
void QDeclarativeAudio_4::pause()
{
if (!m_complete)
return;
setPaused(true);
setPlaying(true);
}
/*
\qmlmethod Audio::stop()
Stops playback of the media.
Sets the \l playing and \l paused properties to false.
*/
void QDeclarativeAudio_4::stop()
{
if (!m_complete)
return;
setPlaying(false);
setPaused(false);
}
/*
\qmlproperty url Audio::source
This property holds the source URL of the media.
*/
/*
\qmlproperty url Audio::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.
*/
/*
\qmlproperty bool Audio::playing
This property holds whether the media is playing.
Defaults to false, and can be set to true to start playback.
*/
/*
\qmlproperty bool Audio::paused
This property holds whether the media is paused.
Defaults to false, and can be set to true to pause playback.
*/
/*
\qmlsignal Audio::onStarted()
This handler is called when playback is started.
*/
/*
\qmlsignal Audio::onResumed()
This handler is called when playback is resumed from the paused state.
*/
/*
\qmlsignal Audio::onPaused()
This handler is called when playback is paused.
*/
/*
\qmlsignal Audio::onStopped()
This handler is called when playback is stopped.
*/
/*
\qmlproperty enumeration Audio::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
*/
QDeclarativeAudio_4::Status QDeclarativeAudio_4::status() const
{
return Status(m_status);
}
/*
\qmlproperty int Audio::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 Audio::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 Audio::volume
This property holds the volume of the audio output, from 0.0 (silent) to 1.0 (maximum volume).
*/
/*
\qmlproperty bool Audio::muted
This property holds whether the audio output is muted.
*/
/*
\qmlproperty bool Audio::hasAudio
This property holds whether the media contains audio.
*/
bool QDeclarativeAudio_4::hasAudio() const
{
return !m_complete ? false : m_playerControl->isAudioAvailable();
}
/*
\qmlproperty bool Audio::hasVideo
This property holds whether the media contains video.
*/
bool QDeclarativeAudio_4::hasVideo() const
{
return !m_complete ? false : m_playerControl->isVideoAvailable();
}
/*
\qmlproperty real Audio::bufferProgress
This property holds how much of the data buffer is currently filled, from 0.0 (empty) to 1.0
(full).
*/
/*
\qmlproperty bool Audio::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 Audio::playbackRate
This property holds the rate at which audio is played at as a multiple of the normal rate.
*/
/*
\qmlproperty enumeration Audio::error
This property holds the error state of the audio. It can be one of:
\list
\li NoError - there is no current error.
\li ResourceError - the audio cannot be played due to a problem allocating resources.
\li FormatError - the audio format is not supported.
\li NetworkError - the audio cannot be played due to network issues.
\li AccessDenied - the audio cannot be played due to insufficient permissions.
\li ServiceMissing - the audio cannot be played because the media service could not be
instantiated.
\endlist
*/
QDeclarativeAudio_4::Error QDeclarativeAudio_4::error() const
{
return Error(m_error);
}
void QDeclarativeAudio_4::classBegin()
{
setObject(this);
if (m_mediaService) {
connect(m_playerControl, SIGNAL(audioAvailableChanged(bool)),
this, SIGNAL(hasAudioChanged()));
connect(m_playerControl, SIGNAL(videoAvailableChanged(bool)),
this, SIGNAL(hasVideoChanged()));
}
emit mediaObjectChanged();
}
void QDeclarativeAudio_4::componentComplete()
{
QDeclarativeMediaBase_4::componentComplete();
}
/*
\qmlproperty string Audio::errorString
This property holds a string describing the current error condition in more detail.
*/
/*
\qmlsignal Audio::onError(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 Audio::metaData.title
This property holds the tile of the media.
\sa {QtMultimedia::MetaData::Title}
*/
/*
\qmlproperty variant Audio::metaData.subTitle
This property holds the sub-title of the media.
\sa {QtMultimedia::MetaData::SubTitle}
*/
/*
\qmlproperty variant Audio::metaData.author
This property holds the author of the media.
\sa {QtMultimedia::MetaData::Author}
*/
/*
\qmlproperty variant Audio::metaData.comment
This property holds a user comment about the media.
\sa {QtMultimedia::MetaData::Comment}
*/
/*
\qmlproperty variant Audio::metaData.description
This property holds a description of the media.
\sa {QtMultimedia::MetaData::Description}
*/
/*
\qmlproperty variant Audio::metaData.category
This property holds the category of the media
\sa {QtMultimedia::MetaData::Category}
*/
/*
\qmlproperty variant Audio::metaData.genre
This property holds the genre of the media.
\sa {QtMultimedia::MetaData::Genre}
*/
/*
\qmlproperty variant Audio::metaData.year
This property holds the year of release of the media.
\sa {QtMultimedia::MetaData::Year}
*/
/*
\qmlproperty variant Audio::metaData.date
This property holds the date of the media.
\sa {QtMultimedia::MetaData::Date}
*/
/*
\qmlproperty variant Audio::metaData.userRating
This property holds a user rating of the media in the range of 0 to 100.
\sa {QtMultimedia::MetaData::UserRating}
*/
/*
\qmlproperty variant Audio::metaData.keywords
This property holds a list of keywords describing the media.
\sa {QtMultimedia::MetaData::Keywords}
*/
/*
\qmlproperty variant Audio::metaData.language
This property holds the language of the media, as an ISO 639-2 code.
\sa {QtMultimedia::MetaData::Language}
*/
/*
\qmlproperty variant Audio::metaData.publisher
This property holds the publisher of the media.
\sa {QtMultimedia::MetaData::Publisher}
*/
/*
\qmlproperty variant Audio::metaData.copyright
This property holds the media's copyright notice.
\sa {QtMultimedia::MetaData::Copyright}
*/
/*
\qmlproperty variant Audio::metaData.parentalRating
This property holds the parental rating of the media.
\sa {QtMultimedia::MetaData::ParentalRating}
*/
/*
\qmlproperty variant Audio::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 Audio::metaData.size
This property property holds the size of the media in bytes.
\sa {QtMultimedia::MetaData::Size}
*/
/*
\qmlproperty variant Audio::metaData.mediaType
This property holds the type of the media.
\sa {QtMultimedia::MetaData::MediaType}
*/
/*
\qmlproperty variant Audio::metaData.audioBitRate
This property holds the bit rate of the media's audio stream ni bits per
second.
\sa {QtMultimedia::MetaData::AudioBitRate}
*/
/*
\qmlproperty variant Audio::metaData.audioCodec
This property holds the encoding of the media audio stream.
\sa {QtMultimedia::MetaData::AudioCodec}
*/
/*
\qmlproperty variant Audio::metaData.averageLevel
This property holds the average volume level of the media.
\sa {QtMultimedia::MetaData::AverageLevel}
*/
/*
\qmlproperty variant Audio::metaData.channelCount
This property holds the number of channels in the media's audio stream.
\sa {QtMultimedia::MetaData::ChannelCount}
*/
/*
\qmlproperty variant Audio::metaData.peakValue
This property holds the peak volume of media's audio stream.
\sa {QtMultimedia::MetaData::PeakValue}
*/
/*
\qmlproperty variant Audio::metaData.sampleRate
This property holds the sample rate of the media's audio stream in hertz.
\sa {QtMultimedia::MetaData::SampleRate}
*/
/*
\qmlproperty variant Audio::metaData.albumTitle
This property holds the title of the album the media belongs to.
\sa {QtMultimedia::MetaData::AlbumTitle}
*/
/*
\qmlproperty variant Audio::metaData.albumArtist
This property holds the name of the principal artist of the album the media
belongs to.
\sa {QtMultimedia::MetaData::AlbumArtist}
*/
/*
\qmlproperty variant Audio::metaData.contributingArtist
This property holds the names of artists contributing to the media.
\sa {QtMultimedia::MetaData::ContributingArtist}
*/
/*
\qmlproperty variant Audio::metaData.composer
This property holds the composer of the media.
\sa {QtMultimedia::MetaData::Composer}
*/
/*
\qmlproperty variant Audio::metaData.conductor
This property holds the conductor of the media.
\sa {QtMultimedia::MetaData::Conductor}
*/
/*
\qmlproperty variant Audio::metaData.lyrics
This property holds the lyrics to the media.
\sa {QtMultimedia::MetaData::Lyrics}
*/
/*
\qmlproperty variant Audio::metaData.mood
This property holds the mood of the media.
\sa {QtMultimedia::MetaData::Mood}
*/
/*
\qmlproperty variant Audio::metaData.trackNumber
This property holds the track number of the media.
\sa {QtMultimedia::MetaData::TrackNumber}
*/
/*
\qmlproperty variant Audio::metaData.trackCount
This property holds the number of track on the album containing the media.
\sa {QtMultimedia::MetaData::TrackNumber}
*/
/*
\qmlproperty variant Audio::metaData.coverArtUrlSmall
This property holds the URL of a small cover art image.
\sa {QtMultimedia::MetaData::CoverArtUrlSmall}
*/
/*
\qmlproperty variant Audio::metaData.coverArtUrlLarge
This property holds the URL of a large cover art image.
\sa {QtMultimedia::MetaData::CoverArtUrlLarge}
*/
/*
\qmlproperty variant Audio::metaData.resolution
This property holds the dimension of an image or video.
\sa {QtMultimedia::MetaData::Resolution}
*/
/*
\qmlproperty variant Audio::metaData.pixelAspectRatio
This property holds the pixel aspect ratio of an image or video.
\sa {QtMultimedia::MetaData::PixelAspectRatio}
*/
/*
\qmlproperty variant Audio::metaData.videoFrameRate
This property holds the frame rate of the media's video stream.
\sa {QtMultimedia::MetaData::VideoFrameRate}
*/
/*
\qmlproperty variant Audio::metaData.videoBitRate
This property holds the bit rate of the media's video stream in bits per
second.
\sa {QtMultimedia::MetaData::VideoBitRate}
*/
/*
\qmlproperty variant Audio::metaData.videoCodec
This property holds the encoding of the media's video stream.
\sa {QtMultimedia::MetaData::VideoCodec}
*/
/*
\qmlproperty variant Audio::metaData.posterUrl
This property holds the URL of a poster image.
\sa {QtMultimedia::MetaData::PosterUrl}
*/
/*
\qmlproperty variant Audio::metaData.chapterNumber
This property holds the chapter number of the media.
\sa {QtMultimedia::MetaData::ChapterNumber}
*/
/*
\qmlproperty variant Audio::metaData.director
This property holds the director of the media.
\sa {QtMultimedia::MetaData::Director}
*/
/*
\qmlproperty variant Audio::metaData.leadPerformer
This property holds the lead performer in the media.
\sa {QtMultimedia::MetaData::LeadPerformer}
*/
/*
\qmlproperty variant Audio::metaData.writer
This property holds the writer of the media.
\sa {QtMultimedia::MetaData::Writer}
*/
QT_END_NAMESPACE
#include "moc_qdeclarativeaudio_p_4.cpp"

View File

@@ -1,190 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/
**
** This file is part of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this
** file. Please review the following information to ensure the GNU Lesser
** General Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU General
** Public License version 3.0 as published by the Free Software Foundation
** and appearing in the file LICENSE.GPL included in the packaging of this
** file. Please review the following information to ensure the GNU General
** Public License version 3.0 requirements will be met:
** http://www.gnu.org/copyleft/gpl.html.
**
** 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$
**
****************************************************************************/
#ifndef QDECLARATIVEAUDIO_4_P_H
#define QDECLARATIVEAUDIO_4_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of other Qt classes. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/qbasictimer.h>
#include <QtQml/qqmlparserstatus.h>
#include <QtQml/qqml.h>
#include "qdeclarativemediabase_p_4.h"
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
class QTimerEvent;
class QDeclarativeAudio_4 : public QObject, public QDeclarativeMediaBase_4, public QQmlParserStatus
{
Q_OBJECT
Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
Q_PROPERTY(bool autoLoad READ isAutoLoad WRITE setAutoLoad NOTIFY autoLoadChanged)
Q_PROPERTY(bool playing READ isPlaying WRITE setPlaying NOTIFY playingChanged)
Q_PROPERTY(int loops READ loopCount WRITE setLoopCount NOTIFY loopCountChanged)
Q_PROPERTY(bool paused READ isPaused WRITE setPaused NOTIFY pausedChanged)
Q_PROPERTY(Status status READ status NOTIFY statusChanged)
Q_PROPERTY(int duration READ duration NOTIFY durationChanged)
Q_PROPERTY(int position READ position WRITE setPosition NOTIFY positionChanged)
Q_PROPERTY(qreal volume READ volume WRITE setVolume NOTIFY volumeChanged)
Q_PROPERTY(bool muted READ isMuted WRITE setMuted NOTIFY mutedChanged)
Q_PROPERTY(bool hasAudio READ hasAudio NOTIFY hasAudioChanged)
Q_PROPERTY(bool hasVideo READ hasVideo NOTIFY hasVideoChanged)
Q_PROPERTY(int bufferProgress READ bufferProgress NOTIFY bufferProgressChanged)
Q_PROPERTY(bool seekable READ isSeekable NOTIFY seekableChanged)
Q_PROPERTY(qreal playbackRate READ playbackRate WRITE setPlaybackRate NOTIFY playbackRateChanged)
Q_PROPERTY(Error error READ error NOTIFY errorChanged)
Q_PROPERTY(QString errorString READ errorString NOTIFY errorChanged)
Q_PROPERTY(QDeclarativeMediaMetaData_4 *metaData READ metaData CONSTANT)
Q_PROPERTY(QObject *mediaObject READ mediaObject NOTIFY mediaObjectChanged SCRIPTABLE false DESIGNABLE false)
Q_ENUMS(Status)
Q_ENUMS(Error)
Q_ENUMS(Loop)
Q_INTERFACES(QQmlParserStatus)
public:
enum Status
{
UnknownStatus = QMediaPlayer::UnknownMediaStatus,
NoMedia = QMediaPlayer::NoMedia,
Loading = QMediaPlayer::LoadingMedia,
Loaded = QMediaPlayer::LoadedMedia,
Stalled = QMediaPlayer::StalledMedia,
Buffering = QMediaPlayer::BufferingMedia,
Buffered = QMediaPlayer::BufferedMedia,
EndOfMedia = QMediaPlayer::EndOfMedia,
InvalidMedia = QMediaPlayer::InvalidMedia
};
enum Error
{
NoError = QMediaPlayer::NoError,
ResourceError = QMediaPlayer::ResourceError,
FormatError = QMediaPlayer::FormatError,
NetworkError = QMediaPlayer::NetworkError,
AccessDenied = QMediaPlayer::AccessDeniedError,
ServiceMissing = QMediaPlayer::ServiceMissingError
};
enum Loop
{
Infinite = QDeclarativeMediaBase_4::INFINITE
};
QDeclarativeAudio_4(QObject *parent = 0);
~QDeclarativeAudio_4();
bool hasAudio() const;
bool hasVideo() const;
Status status() const;
Error error() const;
void classBegin();
void componentComplete();
QObject *mediaObject() { return m_mediaObject; }
public Q_SLOTS:
void play();
void pause();
void stop();
Q_SIGNALS:
void sourceChanged();
void autoLoadChanged();
void playingChanged();
void pausedChanged();
void loopCountChanged();
void started();
void resumed();
void paused();
void stopped();
void statusChanged();
void durationChanged();
void positionChanged();
void volumeChanged();
void mutedChanged();
void hasAudioChanged();
void hasVideoChanged();
void bufferProgressChanged();
void seekableChanged();
void playbackRateChanged();
void errorChanged();
void error(QDeclarativeAudio_4::Error error, const QString &errorString);
void mediaObjectChanged();
private Q_SLOTS:
void _q_error(int, const QString &);
private:
Q_DISABLE_COPY(QDeclarativeAudio_4)
Q_PRIVATE_SLOT(mediaBase(), void _q_statusChanged())
inline QDeclarativeMediaBase_4 *mediaBase() { return this; }
};
QT_END_NAMESPACE
QML_DECLARE_TYPE(QT_PREPEND_NAMESPACE(QDeclarativeAudio_4))
QT_END_HEADER
#endif

View File

@@ -1,567 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/
**
** This file is part of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this
** file. Please review the following information to ensure the GNU Lesser
** General Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU General
** Public License version 3.0 as published by the Free Software Foundation
** and appearing in the file LICENSE.GPL included in the packaging of this
** file. Please review the following information to ensure the GNU General
** Public License version 3.0 requirements will be met:
** http://www.gnu.org/copyleft/gpl.html.
**
** 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$
**
****************************************************************************/
#include "qdeclarativemediabase_p_4.h"
#include <QtCore/qcoreevent.h>
#include <QtCore/qurl.h>
#include <QtQml/qqmlinfo.h>
#include <qmediaplayercontrol.h>
#include <qmediaservice.h>
#include <private/qmediaserviceprovider_p.h>
#include <qmetadatareadercontrol.h>
#include "qdeclarativemediametadata_p_4.h"
QT_BEGIN_NAMESPACE
class QDeclarativeMediaBaseObject : public QMediaObject
{
public:
QDeclarativeMediaBaseObject(QMediaService *service)
: QMediaObject(0, service)
{
}
};
class QDeclarativeMediaBasePlayerControl : public QMediaPlayerControl
{
public:
QDeclarativeMediaBasePlayerControl(QObject *parent)
: QMediaPlayerControl(parent)
{
}
QMediaPlayer::State state() const { return QMediaPlayer::StoppedState; }
QMediaPlayer::MediaStatus mediaStatus() const { return QMediaPlayer::NoMedia; }
qint64 duration() const { return 0; }
qint64 position() const { return 0; }
void setPosition(qint64) {}
int volume() const { return 0; }
void setVolume(int) {}
bool isMuted() const { return false; }
void setMuted(bool) {}
int bufferStatus() const { return 0; }
bool isAudioAvailable() const { return false; }
bool isVideoAvailable() const { return false; }
bool isSeekable() const { return false; }
QMediaTimeRange availablePlaybackRanges() const { return QMediaTimeRange(); }
qreal playbackRate() const { return 1; }
void setPlaybackRate(qreal) {}
QMediaContent media() const { return QMediaContent(); }
const QIODevice *mediaStream() const { return 0; }
void setMedia(const QMediaContent &, QIODevice *) {}
void play() {}
void pause() {}
void stop() {}
};
class QDeclarativeMediaBaseMetaDataControl : public QMetaDataReaderControl
{
public:
QDeclarativeMediaBaseMetaDataControl(QObject *parent)
: QMetaDataReaderControl(parent)
{
}
bool isMetaDataAvailable() const { return false; }
QVariant metaData(const QString &) const { return QVariant(); }
QStringList availableMetaData() const { return QStringList(); }
};
class QDeclarativeMediaBaseAnimation : public QObject
{
public:
QDeclarativeMediaBaseAnimation(QDeclarativeMediaBase_4 *media)
: m_media(media)
{
}
void start() { if (!m_timer.isActive()) m_timer.start(500, this); }
void stop() { m_timer.stop(); }
protected:
void timerEvent(QTimerEvent *event)
{
if (event->timerId() == m_timer.timerId()) {
event->accept();
if (m_media->m_playing && !m_media->m_paused)
emit m_media->positionChanged();
if (m_media->m_status == QMediaPlayer::BufferingMedia || QMediaPlayer::StalledMedia)
emit m_media->bufferProgressChanged();
} else {
QObject::timerEvent(event);
}
}
private:
QDeclarativeMediaBase_4 *m_media;
QBasicTimer m_timer;
};
void QDeclarativeMediaBase_4::_q_statusChanged()
{
if (m_playerControl->mediaStatus() == QMediaPlayer::EndOfMedia && m_runningCount != 0) {
m_runningCount -= 1;
m_playerControl->play();
}
const QMediaPlayer::MediaStatus oldStatus = m_status;
const bool wasPlaying = m_playing;
const bool wasPaused = m_paused;
const QMediaPlayer::State state = m_playerControl->state();
m_status = m_playerControl->mediaStatus();
if (m_complete)
m_playing = state != QMediaPlayer::StoppedState;
if (state == QMediaPlayer::PausedState)
m_paused = true;
else if (state == QMediaPlayer::PlayingState)
m_paused = false;
if (m_status != oldStatus)
emit statusChanged();
switch (state) {
case QMediaPlayer::StoppedState:
if (wasPlaying) {
emit stopped();
if (!m_playing)
emit playingChanged();
}
break;
case QMediaPlayer::PausedState:
if (!wasPlaying) {
emit started();
if (m_playing)
emit playingChanged();
}
if ((!wasPaused || !wasPlaying) && m_paused)
emit paused();
if (!wasPaused && m_paused)
emit pausedChanged();
break;
case QMediaPlayer::PlayingState:
if (wasPaused && wasPlaying)
emit resumed();
else
emit started();
if (wasPaused && !m_paused)
emit pausedChanged();
if (!wasPlaying && m_playing)
emit playingChanged();
break;
}
// Check
if ((m_playing && !m_paused)
|| m_status == QMediaPlayer::BufferingMedia
|| m_status == QMediaPlayer::StalledMedia) {
m_animation->start();
}
else {
m_animation->stop();
}
}
QDeclarativeMediaBase_4::QDeclarativeMediaBase_4()
: m_paused(false)
, m_playing(false)
, m_autoLoad(true)
, m_loaded(false)
, m_muted(false)
, m_complete(false)
, m_loopCount(1)
, m_runningCount(0)
, m_position(0)
, m_vol(1.0)
, m_playbackRate(1.0)
, m_mediaService(0)
, m_playerControl(0)
, m_qmlObject(0)
, m_mediaObject(0)
, m_mediaProvider(0)
, m_metaDataControl(0)
, m_animation(0)
, m_status(QMediaPlayer::NoMedia)
, m_error(QMediaPlayer::ServiceMissingError)
{
}
QDeclarativeMediaBase_4::~QDeclarativeMediaBase_4()
{
}
void QDeclarativeMediaBase_4::shutdown()
{
delete m_mediaObject;
m_metaData.reset();
if (m_mediaProvider)
m_mediaProvider->releaseService(m_mediaService);
delete m_animation;
}
void QDeclarativeMediaBase_4::setObject(QObject *object, const QByteArray &type)
{
m_qmlObject = object;
if ((m_mediaProvider = QMediaServiceProvider::defaultServiceProvider()) != 0) {
m_mediaService = m_mediaProvider->requestService(type);
if (m_mediaService != 0) {
m_playerControl = qobject_cast<QMediaPlayerControl *>(
m_mediaService->requestControl(QMediaPlayerControl_iid));
m_metaDataControl = qobject_cast<QMetaDataReaderControl *>(
m_mediaService->requestControl(QMetaDataReaderControl_iid));
m_mediaObject = new QDeclarativeMediaBaseObject(m_mediaService);
}
}
if (m_playerControl) {
QObject::connect(m_playerControl, SIGNAL(stateChanged(QMediaPlayer::State)),
object, SLOT(_q_statusChanged()));
QObject::connect(m_playerControl, SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)),
object, SLOT(_q_statusChanged()));
QObject::connect(m_playerControl, SIGNAL(mediaChanged(QMediaContent)),
object, SIGNAL(sourceChanged()));
QObject::connect(m_playerControl, SIGNAL(durationChanged(qint64)),
object, SIGNAL(durationChanged()));
QObject::connect(m_playerControl, SIGNAL(positionChanged(qint64)),
object, SIGNAL(positionChanged()));
QObject::connect(m_playerControl, SIGNAL(volumeChanged(int)),
object, SIGNAL(volumeChanged()));
QObject::connect(m_playerControl, SIGNAL(mutedChanged(bool)),
object, SIGNAL(mutedChanged()));
QObject::connect(m_playerControl, SIGNAL(bufferStatusChanged(int)),
object, SIGNAL(bufferProgressChanged()));
QObject::connect(m_playerControl, SIGNAL(seekableChanged(bool)),
object, SIGNAL(seekableChanged()));
QObject::connect(m_playerControl, SIGNAL(playbackRateChanged(qreal)),
object, SIGNAL(playbackRateChanged()));
QObject::connect(m_playerControl, SIGNAL(error(int,QString)),
object, SLOT(_q_error(int,QString)));
m_animation = new QDeclarativeMediaBaseAnimation(this);
m_error = QMediaPlayer::NoError;
} else {
m_playerControl = new QDeclarativeMediaBasePlayerControl(object);
}
if (!m_metaDataControl)
m_metaDataControl = new QDeclarativeMediaBaseMetaDataControl(object);
m_metaData.reset(new QDeclarativeMediaMetaData_4(m_metaDataControl));
QObject::connect(m_metaDataControl, SIGNAL(metaDataChanged()),
m_metaData.data(), SIGNAL(metaDataChanged()));
}
void QDeclarativeMediaBase_4::componentComplete()
{
if (!qFuzzyCompare(m_vol, qreal(1.0)))
m_playerControl->setVolume(m_vol * 100);
if (m_muted)
m_playerControl->setMuted(m_muted);
if (!qFuzzyCompare(m_playbackRate, qreal(1.0)))
m_playerControl->setPlaybackRate(m_playbackRate);
if (!m_source.isEmpty() && (m_autoLoad || m_playing)) // Override autoLoad if playing set
m_playerControl->setMedia(m_source, 0);
m_complete = true;
if (m_playing) {
if (m_position > 0)
m_playerControl->setPosition(m_position);
if (m_source.isEmpty()) {
m_playing = false;
emit playingChanged();
} else if (m_paused) {
m_playerControl->pause();
} else {
m_playerControl->play();
}
}
}
// Properties
QUrl QDeclarativeMediaBase_4::source() const
{
return m_source;
}
void QDeclarativeMediaBase_4::setSource(const QUrl &url)
{
if (url == m_source)
return;
m_source = url;
m_loaded = false;
if (m_complete && (m_autoLoad || url.isEmpty())) {
if (m_error != QMediaPlayer::ServiceMissingError && m_error != QMediaPlayer::NoError) {
m_error = QMediaPlayer::NoError;
m_errorString = QString();
emit errorChanged();
}
m_playerControl->setMedia(m_source, 0);
m_loaded = true;
}
else
emit sourceChanged();
}
bool QDeclarativeMediaBase_4::isAutoLoad() const
{
return m_autoLoad;
}
void QDeclarativeMediaBase_4::setAutoLoad(bool autoLoad)
{
if (m_autoLoad == autoLoad)
return;
m_autoLoad = autoLoad;
emit autoLoadChanged();
}
int QDeclarativeMediaBase_4::loopCount() const
{
return m_loopCount;
}
void QDeclarativeMediaBase_4::setLoopCount(int loopCount)
{
if (loopCount == 0)
loopCount = 1;
else if (loopCount < -1)
loopCount = -1;
if (m_loopCount == loopCount) {
return;
}
m_loopCount = loopCount;
emit loopCountChanged();
}
bool QDeclarativeMediaBase_4::isPlaying() const
{
return m_playing;
}
void QDeclarativeMediaBase_4::setPlaying(bool playing)
{
if (playing == m_playing)
return;
if (m_complete) {
if (playing) {
if (!m_autoLoad && !m_loaded) {
m_playerControl->setMedia(m_source, 0);
m_playerControl->setPosition(m_position);
m_loaded = true;
}
m_runningCount = m_loopCount - 1;
if (!m_paused)
m_playerControl->play();
else
m_playerControl->pause();
} else {
m_playerControl->stop();
}
} else {
m_playing = playing;
emit playingChanged();
}
}
bool QDeclarativeMediaBase_4::isPaused() const
{
return m_paused;
}
void QDeclarativeMediaBase_4::setPaused(bool paused)
{
if (m_paused == paused)
return;
if (m_complete && m_playing) {
if (!m_autoLoad && !m_loaded) {
m_playerControl->setMedia(m_source, 0);
m_playerControl->setPosition(m_position);
m_loaded = true;
}
if (!paused)
m_playerControl->play();
else
m_playerControl->pause();
} else {
m_paused = paused;
emit pausedChanged();
}
}
int QDeclarativeMediaBase_4::duration() const
{
return !m_complete ? 0 : m_playerControl->duration();
}
int QDeclarativeMediaBase_4::position() const
{
return !m_complete ? m_position : m_playerControl->position();
}
void QDeclarativeMediaBase_4::setPosition(int position)
{
if (this->position() == position)
return;
m_position = position;
if (m_complete)
m_playerControl->setPosition(m_position);
else
emit positionChanged();
}
qreal QDeclarativeMediaBase_4::volume() const
{
return !m_complete ? m_vol : qreal(m_playerControl->volume()) / 100;
}
void QDeclarativeMediaBase_4::setVolume(qreal volume)
{
if (volume < 0 || volume > 1) {
qmlInfo(m_qmlObject) << m_qmlObject->tr("volume should be between 0.0 and 1.0");
return;
}
if (m_vol == volume)
return;
m_vol = volume;
if (m_complete)
m_playerControl->setVolume(qRound(volume * 100));
else
emit volumeChanged();
}
bool QDeclarativeMediaBase_4::isMuted() const
{
return !m_complete ? m_muted : m_playerControl->isMuted();
}
void QDeclarativeMediaBase_4::setMuted(bool muted)
{
if (m_muted == muted)
return;
m_muted = muted;
if (m_complete)
m_playerControl->setMuted(muted);
else
emit mutedChanged();
}
qreal QDeclarativeMediaBase_4::bufferProgress() const
{
return !m_complete ? 0 : qreal(m_playerControl->bufferStatus()) / 100;
}
bool QDeclarativeMediaBase_4::isSeekable() const
{
return !m_complete ? false : m_playerControl->isSeekable();
}
qreal QDeclarativeMediaBase_4::playbackRate() const
{
return m_playbackRate;
}
void QDeclarativeMediaBase_4::setPlaybackRate(qreal rate)
{
if (m_playbackRate == rate)
return;
m_playbackRate = rate;
if (m_complete)
m_playerControl->setPlaybackRate(m_playbackRate);
else
emit playbackRateChanged();
}
QString QDeclarativeMediaBase_4::errorString() const
{
return m_errorString;
}
QDeclarativeMediaMetaData_4 *QDeclarativeMediaBase_4::metaData() const
{
return m_metaData.data();
}
QT_END_NAMESPACE

View File

@@ -1,188 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/
**
** This file is part of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this
** file. Please review the following information to ensure the GNU Lesser
** General Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU General
** Public License version 3.0 as published by the Free Software Foundation
** and appearing in the file LICENSE.GPL included in the packaging of this
** file. Please review the following information to ensure the GNU General
** Public License version 3.0 requirements will be met:
** http://www.gnu.org/copyleft/gpl.html.
**
** 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$
**
****************************************************************************/
#ifndef QDECLARATIVEMEDIABASE_4_P_H
#define QDECLARATIVEMEDIABASE_4_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of other Qt classes. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/qbasictimer.h>
#include <qmediaplayer.h>
#include <private/qmediaserviceprovider_p.h>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
class QMediaPlayerControl;
class QMediaService;
class QMediaServiceProvider;
class QMetaDataReaderControl;
class QDeclarativeMediaBaseAnimation;
class QDeclarativeMediaMetaData_4;
class QDeclarativeMediaBase_4
{
public:
enum Loop {
INFINITE = -1
};
QDeclarativeMediaBase_4();
virtual ~QDeclarativeMediaBase_4();
QUrl source() const;
void setSource(const QUrl &url);
bool isAutoLoad() const;
void setAutoLoad(bool autoLoad);
int loopCount() const;
void setLoopCount(int loopCount);
bool isPlaying() const;
void setPlaying(bool playing);
bool isPaused() const;
void setPaused(bool paused);
int duration() const;
int position() const;
void setPosition(int position);
qreal volume() const;
void setVolume(qreal volume);
bool isMuted() const;
void setMuted(bool muted);
qreal bufferProgress() const;
bool isSeekable() const;
qreal playbackRate() const;
void setPlaybackRate(qreal rate);
QString errorString() const;
QDeclarativeMediaMetaData_4 *metaData() const;
void _q_statusChanged();
void _q_metaDataChanged();
void componentComplete();
protected:
void shutdown();
void setObject(QObject *object, const QByteArray &type = Q_MEDIASERVICE_MEDIAPLAYER);
virtual void sourceChanged() = 0;
virtual void autoLoadChanged() = 0;
virtual void playingChanged() = 0;
virtual void pausedChanged() = 0;
virtual void loopCountChanged() = 0;
virtual void started() = 0;
virtual void resumed() = 0;
virtual void paused() = 0;
virtual void stopped() = 0;
virtual void statusChanged() = 0;
virtual void durationChanged() = 0;
virtual void positionChanged() = 0;
virtual void volumeChanged() = 0;
virtual void mutedChanged() = 0;
virtual void bufferProgressChanged() = 0;
virtual void seekableChanged() = 0;
virtual void playbackRateChanged() = 0;
virtual void errorChanged() = 0;
bool m_paused;
bool m_playing;
bool m_autoLoad;
bool m_loaded;
bool m_muted;
bool m_complete;
int m_loopCount;
int m_runningCount;
int m_position;
qreal m_vol;
qreal m_playbackRate;
QMediaService *m_mediaService;
QMediaPlayerControl *m_playerControl;
QObject *m_qmlObject;
QMediaObject *m_mediaObject;
QMediaServiceProvider *m_mediaProvider;
QMetaDataReaderControl *m_metaDataControl;
QDeclarativeMediaBaseAnimation *m_animation;
QScopedPointer<QDeclarativeMediaMetaData_4> m_metaData;
QMediaPlayer::MediaStatus m_status;
QMediaPlayer::Error m_error;
QString m_errorString;
QUrl m_source;
friend class QDeclarativeMediaBaseAnimation;
};
QT_END_NAMESPACE
QT_END_HEADER
#endif

View File

@@ -1,187 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/
**
** This file is part of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this
** file. Please review the following information to ensure the GNU Lesser
** General Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU General
** Public License version 3.0 as published by the Free Software Foundation
** and appearing in the file LICENSE.GPL included in the packaging of this
** file. Please review the following information to ensure the GNU General
** Public License version 3.0 requirements will be met:
** http://www.gnu.org/copyleft/gpl.html.
**
** 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$
**
****************************************************************************/
#ifndef QDECLARATIVEMEDIAMETADATA_P_4_H
#define QDECLARATIVEMEDIAMETADATA_P_4_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of other Qt classes. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <qmetadatareadercontrol.h>
#include <QtQml/qqml.h>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
class QDeclarativeMediaMetaData_4 : public QObject
{
Q_OBJECT
Q_PROPERTY(QVariant title READ title NOTIFY metaDataChanged)
Q_PROPERTY(QVariant subTitle READ subTitle NOTIFY metaDataChanged)
Q_PROPERTY(QVariant author READ author NOTIFY metaDataChanged)
Q_PROPERTY(QVariant comment READ comment NOTIFY metaDataChanged)
Q_PROPERTY(QVariant description READ description NOTIFY metaDataChanged)
Q_PROPERTY(QVariant category READ category NOTIFY metaDataChanged)
Q_PROPERTY(QVariant genre READ genre NOTIFY metaDataChanged)
Q_PROPERTY(QVariant year READ year NOTIFY metaDataChanged)
Q_PROPERTY(QVariant date READ date NOTIFY metaDataChanged)
Q_PROPERTY(QVariant userRating READ userRating NOTIFY metaDataChanged)
Q_PROPERTY(QVariant keywords READ keywords NOTIFY metaDataChanged)
Q_PROPERTY(QVariant language READ language NOTIFY metaDataChanged)
Q_PROPERTY(QVariant publisher READ publisher NOTIFY metaDataChanged)
Q_PROPERTY(QVariant copyright READ copyright NOTIFY metaDataChanged)
Q_PROPERTY(QVariant parentalRating READ parentalRating NOTIFY metaDataChanged)
Q_PROPERTY(QVariant ratingOrganization READ ratingOrganization NOTIFY metaDataChanged)
Q_PROPERTY(QVariant size READ size NOTIFY metaDataChanged)
Q_PROPERTY(QVariant mediaType READ mediaType NOTIFY metaDataChanged)
Q_PROPERTY(QVariant duration READ duration NOTIFY metaDataChanged)
Q_PROPERTY(QVariant audioBitRate READ audioBitRate NOTIFY metaDataChanged)
Q_PROPERTY(QVariant audioCodec READ audioCodec NOTIFY metaDataChanged)
Q_PROPERTY(QVariant averageLevel READ averageLevel NOTIFY metaDataChanged)
Q_PROPERTY(QVariant channelCount READ channelCount NOTIFY metaDataChanged)
Q_PROPERTY(QVariant peakValue READ peakValue NOTIFY metaDataChanged)
Q_PROPERTY(QVariant sampleRate READ sampleRate NOTIFY metaDataChanged)
Q_PROPERTY(QVariant albumTitle READ albumTitle NOTIFY metaDataChanged)
Q_PROPERTY(QVariant albumArtist READ albumArtist NOTIFY metaDataChanged)
Q_PROPERTY(QVariant contributingArtist READ contributingArtist NOTIFY metaDataChanged)
Q_PROPERTY(QVariant composer READ composer NOTIFY metaDataChanged)
Q_PROPERTY(QVariant conductor READ conductor NOTIFY metaDataChanged)
Q_PROPERTY(QVariant lyrics READ lyrics NOTIFY metaDataChanged)
Q_PROPERTY(QVariant mood READ mood NOTIFY metaDataChanged)
Q_PROPERTY(QVariant trackNumber READ trackNumber NOTIFY metaDataChanged)
Q_PROPERTY(QVariant trackCount READ trackCount NOTIFY metaDataChanged)
Q_PROPERTY(QVariant coverArtUrlSmall READ coverArtUrlSmall NOTIFY metaDataChanged)
Q_PROPERTY(QVariant coverArtUrlLarge READ coverArtUrlLarge NOTIFY metaDataChanged)
Q_PROPERTY(QVariant resolution READ resolution NOTIFY metaDataChanged)
Q_PROPERTY(QVariant pixelAspectRatio READ pixelAspectRatio NOTIFY metaDataChanged)
Q_PROPERTY(QVariant videoFrameRate READ videoFrameRate NOTIFY metaDataChanged)
Q_PROPERTY(QVariant videoBitRate READ videoBitRate NOTIFY metaDataChanged)
Q_PROPERTY(QVariant videoCodec READ videoCodec NOTIFY metaDataChanged)
Q_PROPERTY(QVariant posterUrl READ posterUrl NOTIFY metaDataChanged)
Q_PROPERTY(QVariant chapterNumber READ chapterNumber NOTIFY metaDataChanged)
Q_PROPERTY(QVariant director READ director NOTIFY metaDataChanged)
Q_PROPERTY(QVariant leadPerformer READ leadPerformer NOTIFY metaDataChanged)
Q_PROPERTY(QVariant writer READ writer NOTIFY metaDataChanged)
public:
QDeclarativeMediaMetaData_4(QMetaDataReaderControl *control, QObject *parent = 0)
: QObject(parent)
, m_control(control)
{
}
QVariant title() const { return m_control->metaData(QtMultimedia::MetaData::Title); }
QVariant subTitle() const { return m_control->metaData(QtMultimedia::MetaData::SubTitle); }
QVariant author() const { return m_control->metaData(QtMultimedia::MetaData::Author); }
QVariant comment() const { return m_control->metaData(QtMultimedia::MetaData::Comment); }
QVariant description() const { return m_control->metaData(QtMultimedia::MetaData::Description); }
QVariant category() const { return m_control->metaData(QtMultimedia::MetaData::Category); }
QVariant genre() const { return m_control->metaData(QtMultimedia::MetaData::Genre); }
QVariant year() const { return m_control->metaData(QtMultimedia::MetaData::Year); }
QVariant date() const { return m_control->metaData(QtMultimedia::MetaData::Date); }
QVariant userRating() const { return m_control->metaData(QtMultimedia::MetaData::UserRating); }
QVariant keywords() const { return m_control->metaData(QtMultimedia::MetaData::Keywords); }
QVariant language() const { return m_control->metaData(QtMultimedia::MetaData::Language); }
QVariant publisher() const { return m_control->metaData(QtMultimedia::MetaData::Publisher); }
QVariant copyright() const { return m_control->metaData(QtMultimedia::MetaData::Copyright); }
QVariant parentalRating() const { return m_control->metaData(QtMultimedia::MetaData::ParentalRating); }
QVariant ratingOrganization() const {
return m_control->metaData(QtMultimedia::MetaData::RatingOrganization); }
QVariant size() const { return m_control->metaData(QtMultimedia::MetaData::Size); }
QVariant mediaType() const { return m_control->metaData(QtMultimedia::MetaData::MediaType); }
QVariant duration() const { return m_control->metaData(QtMultimedia::MetaData::Duration); }
QVariant audioBitRate() const { return m_control->metaData(QtMultimedia::MetaData::AudioBitRate); }
QVariant audioCodec() const { return m_control->metaData(QtMultimedia::MetaData::AudioCodec); }
QVariant averageLevel() const { return m_control->metaData(QtMultimedia::MetaData::AverageLevel); }
QVariant channelCount() const { return m_control->metaData(QtMultimedia::MetaData::ChannelCount); }
QVariant peakValue() const { return m_control->metaData(QtMultimedia::MetaData::PeakValue); }
QVariant sampleRate() const { return m_control->metaData(QtMultimedia::MetaData::SampleRate); }
QVariant albumTitle() const { return m_control->metaData(QtMultimedia::MetaData::AlbumTitle); }
QVariant albumArtist() const { return m_control->metaData(QtMultimedia::MetaData::AlbumArtist); }
QVariant contributingArtist() const {
return m_control->metaData(QtMultimedia::MetaData::ContributingArtist); }
QVariant composer() const { return m_control->metaData(QtMultimedia::MetaData::Composer); }
QVariant conductor() const { return m_control->metaData(QtMultimedia::MetaData::Conductor); }
QVariant lyrics() const { return m_control->metaData(QtMultimedia::MetaData::Lyrics); }
QVariant mood() const { return m_control->metaData(QtMultimedia::MetaData::Mood); }
QVariant trackNumber() const { return m_control->metaData(QtMultimedia::MetaData::TrackNumber); }
QVariant trackCount() const { return m_control->metaData(QtMultimedia::MetaData::TrackCount); }
QVariant coverArtUrlSmall() const {
return m_control->metaData(QtMultimedia::MetaData::CoverArtUrlSmall); }
QVariant coverArtUrlLarge() const {
return m_control->metaData(QtMultimedia::MetaData::CoverArtUrlLarge); }
QVariant resolution() const { return m_control->metaData(QtMultimedia::MetaData::Resolution); }
QVariant pixelAspectRatio() const {
return m_control->metaData(QtMultimedia::MetaData::PixelAspectRatio); }
QVariant videoFrameRate() const { return m_control->metaData(QtMultimedia::MetaData::VideoFrameRate); }
QVariant videoBitRate() const { return m_control->metaData(QtMultimedia::MetaData::VideoBitRate); }
QVariant videoCodec() const { return m_control->metaData(QtMultimedia::MetaData::VideoCodec); }
QVariant posterUrl() const { return m_control->metaData(QtMultimedia::MetaData::PosterUrl); }
QVariant chapterNumber() const { return m_control->metaData(QtMultimedia::MetaData::ChapterNumber); }
QVariant director() const { return m_control->metaData(QtMultimedia::MetaData::Director); }
QVariant leadPerformer() const { return m_control->metaData(QtMultimedia::MetaData::LeadPerformer); }
QVariant writer() const { return m_control->metaData(QtMultimedia::MetaData::Writer); }
Q_SIGNALS:
void metaDataChanged();
private:
QMetaDataReaderControl *m_control;
};
QT_END_NAMESPACE
QML_DECLARE_TYPE(QT_PREPEND_NAMESPACE(QDeclarativeMediaMetaData_4))
QT_END_HEADER
#endif // QDECLARATIVEMEDIAMETADATA_P_4_H

View File

@@ -1,4 +1,3 @@
plugin declarative_multimedia
typeinfo plugins.qmltypes
Video 5.0 Video.qml
Video 4.0 Video_4.qml

View File

@@ -1 +0,0 @@
plugin declarative_multimedia ../../QtMultimedia