From ba37f73d44269920c904a3110f9090b8c091c118 Mon Sep 17 00:00:00 2001 From: Dmytro Poplavskiy Date: Tue, 31 Jan 2012 13:20:17 +1000 Subject: Added QMediaRecorder::actualLocation property To report the actual location file was written. Change-Id: Ibb56a720a258a1e5cedceaf0f9bcea73fb93bc96 Reviewed-by: Michael Goddard --- src/multimedia/recording/qmediarecorder.cpp | 37 +++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'src/multimedia/recording/qmediarecorder.cpp') 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))); @@ -371,6 +385,14 @@ bool QMediaRecorder::setMediaObject(QMediaObject *object) After recording has stated, QMediaRecorder::outputLocation() returns the actual output location. */ +/*! + \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. */ @@ -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(); @@ -804,6 +834,13 @@ void QMediaRecorder::stop() Signals that the \a duration of the recorded media has changed. */ +/*! + \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) -- cgit v1.2.3