diff options
author | Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com> | 2012-05-21 12:09:50 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-07-19 09:08:53 +0200 |
commit | 36ff2fe85e418e7cf82f6c6a67d49a2f16998853 (patch) | |
tree | 5d64120ddcffa9415149e1ebc3ebc7bbf86ac9bb /src/multimedia/recording/qmediarecorder.cpp | |
parent | 0d0e89b1e89589812a91ee8d202de2576d6ae89f (diff) |
Added volume property to QMediaRecorder
Change-Id: I19f727107651c9f640ca1c010a3764f05aef8820
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
Diffstat (limited to 'src/multimedia/recording/qmediarecorder.cpp')
-rw-r--r-- | src/multimedia/recording/qmediarecorder.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/multimedia/recording/qmediarecorder.cpp b/src/multimedia/recording/qmediarecorder.cpp index 12279c4bd..d876addee 100644 --- a/src/multimedia/recording/qmediarecorder.cpp +++ b/src/multimedia/recording/qmediarecorder.cpp @@ -285,6 +285,9 @@ bool QMediaRecorder::setMediaObject(QMediaObject *object) disconnect(d->control, SIGNAL(mutedChanged(bool)), this, SIGNAL(mutedChanged(bool))); + disconnect(d->control, SIGNAL(volumeChanged(qreal)), + this, SIGNAL(volumeChanged(qreal))); + disconnect(d->control, SIGNAL(durationChanged(qint64)), this, SIGNAL(durationChanged(qint64))); @@ -388,6 +391,9 @@ bool QMediaRecorder::setMediaObject(QMediaObject *object) connect(d->control, SIGNAL(mutedChanged(bool)), this, SIGNAL(mutedChanged(bool))); + connect(d->control, SIGNAL(volumeChanged(qreal)), + this, SIGNAL(volumeChanged(qreal))); + connect(d->control, SIGNAL(durationChanged(qint64)), this, SIGNAL(durationChanged(qint64))); @@ -553,6 +559,26 @@ void QMediaRecorder::setMuted(bool muted) } /*! + \property QMediaRecorder::volume + + \brief the linear audio gain of media recorder. +*/ + +qreal QMediaRecorder::volume() const +{ + return d_func()->control ? d_func()->control->volume() : 1.0; +} + + +void QMediaRecorder::setVolume(qreal volume) +{ + Q_D(QMediaRecorder); + + if (d->control) + d->control->setVolume(volume); +} + +/*! Returns a list of supported container formats. */ QStringList QMediaRecorder::supportedContainers() const |