summaryrefslogtreecommitdiffstats
path: root/src/multimedia/recording/qmediarecorder.cpp
diff options
context:
space:
mode:
authorDmytro Poplavskiy <dmytro.poplavskiy@nokia.com>2012-01-31 13:20:17 +1000
committerQt by Nokia <qt-info@nokia.com>2012-02-01 08:10:33 +0100
commitba37f73d44269920c904a3110f9090b8c091c118 (patch)
treee37895afcdd32c6603ac0b3c99b01680fa459a63 /src/multimedia/recording/qmediarecorder.cpp
parenta26bf6c8b6dbf91d0f556dfd41222db2775ba038 (diff)
Added QMediaRecorder::actualLocation property
To report the actual location file was written. Change-Id: Ibb56a720a258a1e5cedceaf0f9bcea73fb93bc96 Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
Diffstat (limited to 'src/multimedia/recording/qmediarecorder.cpp')
-rw-r--r--src/multimedia/recording/qmediarecorder.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/multimedia/recording/qmediarecorder.cpp b/src/multimedia/recording/qmediarecorder.cpp
index 879d584c5..2bdb50b74 100644
--- a/src/multimedia/recording/qmediarecorder.cpp
+++ b/src/multimedia/recording/qmediarecorder.cpp
@@ -145,6 +145,14 @@ void QMediaRecorderPrivate::_q_serviceDestroyed()
metaDataControl = 0;
}
+void QMediaRecorderPrivate::_q_updateActualLocation(const QUrl &location)
+{
+ if (actualLocation != location) {
+ actualLocation = location;
+ emit q_func()->actualLocationChanged(actualLocation);
+ }
+}
+
void QMediaRecorderPrivate::_q_notify()
{
emit q_func()->durationChanged(q_func()->duration());
@@ -257,6 +265,9 @@ bool QMediaRecorder::setMediaObject(QMediaObject *object)
disconnect(d->control, SIGNAL(durationChanged(qint64)),
this, SIGNAL(durationChanged(qint64)));
+ disconnect(d->control, SIGNAL(actualLocationChanged(QUrl)),
+ this, SLOT(_q_updateActualLocation(QUrl)));
+
disconnect(d->control, SIGNAL(error(int,QString)),
this, SLOT(_q_error(int,QString)));
}
@@ -338,6 +349,9 @@ bool QMediaRecorder::setMediaObject(QMediaObject *object)
connect(d->control, SIGNAL(durationChanged(qint64)),
this, SIGNAL(durationChanged(qint64)));
+ connect(d->control, SIGNAL(actualLocationChanged(QUrl)),
+ this, SLOT(_q_updateActualLocation(QUrl)));
+
connect(d->control, SIGNAL(error(int,QString)),
this, SLOT(_q_error(int,QString)));
@@ -372,6 +386,14 @@ bool QMediaRecorder::setMediaObject(QMediaObject *object)
*/
/*!
+ \property QMediaRecorder::actualLocation
+ \brief the actual location of the last media content.
+
+ The actual location is usually available after recording starts,
+ and reset when new location is set or new recording starts.
+*/
+
+/*!
Returns true if media recorder service ready to use.
*/
bool QMediaRecorder::isAvailable() const
@@ -401,9 +423,15 @@ QUrl QMediaRecorder::outputLocation() const
bool QMediaRecorder::setOutputLocation(const QUrl &location)
{
Q_D(QMediaRecorder);
+ d->actualLocation.clear();
return d->control ? d->control->setOutputLocation(location) : false;
}
+QUrl QMediaRecorder::actualLocation() const
+{
+ return d_func()->actualLocation;
+}
+
/*!
Returns the current media recorder state.
@@ -743,6 +771,8 @@ void QMediaRecorder::record()
{
Q_D(QMediaRecorder);
+ d->actualLocation.clear();
+
if (d->settingsChanged)
d->_q_applySettings();
@@ -805,6 +835,13 @@ void QMediaRecorder::stop()
*/
/*!
+ \fn QMediaRecorder::actualLocationChanged(const QUrl &location)
+
+ Signals that the actual \a location of the recorded media has changed.
+ This signal is usually emitted when recording starts.
+*/
+
+/*!
\fn QMediaRecorder::error(QMediaRecorder::Error error)
Signals that an \a error has occurred.