aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2014-03-24 16:33:10 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-04-01 16:03:00 +0200
commitf1b0606590946ee09bbf293cddcf4e6f5b95e0b5 (patch)
treec14ff2c31f8dfc30aa097f6e14fdabeda50b9706 /examples
parent3e5756e9e72b53f496223088bc31c9fb93e864e5 (diff)
Maroon example: use multimedia for audio; mute when inactive
Task-number: QTBUG-37742 Change-Id: If1a6ded9ccdaa4cd6f5e6e405e2d5caa21710d4c Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/quick/demos/maroon/content/SoundEffect.qml3
-rw-r--r--examples/quick/demos/maroon/maroon.pro1
2 files changed, 2 insertions, 2 deletions
diff --git a/examples/quick/demos/maroon/content/SoundEffect.qml b/examples/quick/demos/maroon/content/SoundEffect.qml
index 05e8e94ab5..ef5e3febac 100644
--- a/examples/quick/demos/maroon/content/SoundEffect.qml
+++ b/examples/quick/demos/maroon/content/SoundEffect.qml
@@ -42,12 +42,11 @@ import QtQuick 2.0
//Proxies a SoundEffect if QtMultimedia is installed
Item {
id: container
- property QtObject effect: Qt.createQmlObject("import QtMultimedia 5.0; SoundEffect{ source: '" + container.source + "' }", container);
+ property QtObject effect: Qt.createQmlObject("import QtMultimedia 5.0; SoundEffect{ source: '" + container.source + "'; muted: !Qt.application.active }", container);
property url source: ""
onSourceChanged: if (effect != null) effect.source = source;
function play() {
if (effect != null)
effect.play();
}
-
}
diff --git a/examples/quick/demos/maroon/maroon.pro b/examples/quick/demos/maroon/maroon.pro
index 6ca0a2bf16..ada16d047a 100644
--- a/examples/quick/demos/maroon/maroon.pro
+++ b/examples/quick/demos/maroon/maroon.pro
@@ -1,6 +1,7 @@
TEMPLATE = app
QT += qml quick
+qtHaveModule(multimedia): QT += multimedia
SOURCES += main.cpp
RESOURCES += maroon.qrc