summaryrefslogtreecommitdiffstats
path: root/src/multimedia
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den-exter@nokia.com>2010-02-05 01:02:11 (GMT)
committerAndrew den Exter <andrew.den-exter@nokia.com>2010-02-05 01:02:11 (GMT)
commit10888061f86eef9a73fff548b6dc325471cbb809 (patch)
treeefdea90785a5790635724dceffbf6e29adf6a636 /src/multimedia
parent623fa99d781a5cc2ddbd330f949764333fcd7ab1 (diff)
downloadQt-10888061f86eef9a73fff548b6dc325471cbb809.zip
Qt-10888061f86eef9a73fff548b6dc325471cbb809.tar.gz
Qt-10888061f86eef9a73fff548b6dc325471cbb809.tar.bz2
Round off volume when converting from real to int.
And return a volume of 0 if there's no player control.
Diffstat (limited to 'src/multimedia')
-rw-r--r--src/multimedia/qml/qmlmediabase.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/multimedia/qml/qmlmediabase.cpp b/src/multimedia/qml/qmlmediabase.cpp
index 0f0f1e4..e2a1832 100644
--- a/src/multimedia/qml/qmlmediabase.cpp
+++ b/src/multimedia/qml/qmlmediabase.cpp
@@ -78,7 +78,7 @@ public:
qint64 duration() const { return 0; }
qint64 position() const { return 0; }
void setPosition(qint64) {}
- int volume() const { return 100; }
+ int volume() const { return 0; }
void setVolume(int) {}
bool isMuted() const { return false; }
void setMuted(bool) {}
@@ -267,6 +267,8 @@ void QmlMediaBase::setObject(QObject *object)
m_animation = new QmlMediaBaseAnimation(this);
} else {
+ m_error = QMediaPlayer::ServiceMissingError;
+
m_playerControl = new QmlMediaBasePlayerControl(object);
}
@@ -337,7 +339,7 @@ qreal QmlMediaBase::volume() const
void QmlMediaBase::setVolume(qreal volume)
{
- m_playerControl->setVolume(volume * 100);
+ m_playerControl->setVolume(qRound(volume * 100));
}
bool QmlMediaBase::isMuted() const