SLOT(updateRecorderError(QMediaRecorder::Error)));
connect(m_recorder, SIGNAL(mutedChanged(bool)), SIGNAL(mutedChanged(bool)));
connect(m_recorder, SIGNAL(durationChanged(qint64)), SIGNAL(durationChanged(qint64)));
+ connect(m_recorder, SIGNAL(actualLocationChanged(QUrl)),
+ SLOT(updateActualLocation(QUrl)));
+ connect(m_recorder, SIGNAL(metaDataChanged(QString,QVariant)),
+ SIGNAL(metaDataChanged(QString,QVariant)));
}
QDeclarativeCameraRecorder::~QDeclarativeCameraRecorder()
}
}
+/*!
+ \qmlproperty string CameraRecorder::outputLocation
+ \property QDeclarativeCameraRecorder::outputLocation
+
+ \brief the destination location of media content.
+
+ The location can be relative or empty;
+ in this case the recorder uses the system specific place and file naming scheme.
+*/
+
QString QDeclarativeCameraRecorder::outputLocation() const
{
return m_recorder->outputLocation().toString();
}
-void QDeclarativeCameraRecorder::setOutputLocation(const QUrl &location)
+/*!
+ \qmlproperty string CameraRecorder::actualLocation
+ \property QDeclarativeCameraRecorder::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.
+*/
+
+QString QDeclarativeCameraRecorder::actualLocation() const
{
- m_recorder->setOutputLocation(location);
+ return m_recorder->actualLocation().toString();
+}
+
+void QDeclarativeCameraRecorder::setOutputLocation(const QString &location)
+{
+ if (outputLocation() != location) {
+ m_recorder->setOutputLocation(location);
+ emit outputLocationChanged(outputLocation());
+ }
}
qint64 QDeclarativeCameraRecorder::duration() const
if (state == QMediaRecorder::PausedState)
state = QMediaRecorder::StoppedState;
- if (state == QMediaRecorder::StoppedState) {
- QString location = outputLocation();
- if (!location.isEmpty())
- emit outputLocationChanged(location);
- }
-
emit recorderStateChanged(RecorderState(state));
}
emit error(errorCode);
}
+void QDeclarativeCameraRecorder::updateActualLocation(const QUrl &url)
+{
+ emit actualLocationChanged(url.toString());
+}
+
QT_END_NAMESPACE
#include "moc_qdeclarativecamerarecorder_p.cpp"
Q_PROPERTY(qint64 duration READ duration NOTIFY durationChanged)
Q_PROPERTY(QString outputLocation READ outputLocation WRITE setOutputLocation NOTIFY outputLocationChanged)
+ Q_PROPERTY(QString actualLocation READ actualLocation NOTIFY actualLocationChanged)
Q_PROPERTY(bool muted READ isMuted WRITE setMuted NOTIFY mutedChanged)
Q_PROPERTY(QString errorString READ errorString NOTIFY error)
QSize captureResolution();
QString outputLocation() const;
+ QString actualLocation() const;
+
qint64 duration() const;
bool isMuted() const;
int audioSampleRate() const;
public Q_SLOTS:
- void setOutputLocation(const QUrl &location);
+ void setOutputLocation(const QString &location);
void record();
void stop();
void durationChanged(qint64 duration);
void mutedChanged(bool muted);
void outputLocationChanged(const QString &location);
+ void actualLocationChanged(const QString &location);
void error(QMediaRecorder::Error errorCode);
- void metaDataAvailableChanged(bool available);
- void metaDataWritableChanged(bool writable);
- void metaDataChanged();
+ void metaDataChanged(const QString &key, const QVariant &value);
void captureResolutionChanged(const QSize &);
void audioCodecChanged(const QString &codec);
private slots:
void updateRecorderState(QMediaRecorder::State);
void updateRecorderError(QMediaRecorder::Error);
+ void updateActualLocation(const QUrl&);
private:
friend class QDeclarativeCamera;