summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKurt Korbatits <kurt.korbatits@nokia.com>2010-04-27 21:42:15 (GMT)
committerKurt Korbatits <kurt.korbatits@nokia.com>2010-04-27 21:42:15 (GMT)
commit6857fd7b99ba0c72c2f09cfc7ad38e9df4f0531c (patch)
tree1c695319c22417a406b298860c59fe507a012354
parent113fe7369e0eaeb6a77d97e3d73cedb062c21abb (diff)
downloadQt-6857fd7b99ba0c72c2f09cfc7ad38e9df4f0531c.zip
Qt-6857fd7b99ba0c72c2f09cfc7ad38e9df4f0531c.tar.gz
Qt-6857fd7b99ba0c72c2f09cfc7ad38e9df4f0531c.tar.bz2
update multimedia qml element doc samples
Reviewed-by:Derick Hawcroft
-rw-r--r--src/imports/multimedia/qdeclarativeaudio.cpp16
-rw-r--r--src/imports/multimedia/qdeclarativevideo.cpp19
-rw-r--r--src/multimedia/mediaservices/effects/qsoundeffect.cpp12
3 files changed, 40 insertions, 7 deletions
diff --git a/src/imports/multimedia/qdeclarativeaudio.cpp b/src/imports/multimedia/qdeclarativeaudio.cpp
index 896f9b7..a163b10 100644
--- a/src/imports/multimedia/qdeclarativeaudio.cpp
+++ b/src/imports/multimedia/qdeclarativeaudio.cpp
@@ -57,7 +57,21 @@ QT_BEGIN_NAMESPACE
import Qt 4.7
import Qt.multimedia 4.7
- Audio { source: "audio/song.mp3" }
+ Text {
+ text: "Click Me!";
+ font.pointSize: 24;
+ width: 150; height: 50;
+
+ Audio {
+ id: playMusic
+ source: "music.wav"
+ }
+ MouseArea {
+ id: playArea
+ anchors.fill: parent
+ onPressed: { playMusic.play() }
+ }
+ }
\endqml
\sa Video
diff --git a/src/imports/multimedia/qdeclarativevideo.cpp b/src/imports/multimedia/qdeclarativevideo.cpp
index 9b02795..1b51e2c 100644
--- a/src/imports/multimedia/qdeclarativevideo.cpp
+++ b/src/imports/multimedia/qdeclarativevideo.cpp
@@ -79,7 +79,24 @@ void QDeclarativeVideo::_q_error(int errorCode, const QString &errorString)
import Qt 4.7
import Qt.multimedia 4.7
- Video { source: "video/movie.mpg" }
+ Video {
+ id: video
+ width : 800
+ height : 600
+ source: "video.avi"
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: {
+ video.play()
+ }
+ }
+
+ focus: true
+ Keys.onSpacePressed: video.paused = !video.paused
+ Keys.onLeftPressed: video.position -= 5000
+ Keys.onRightPressed: video.position += 5000
+ }
\endqml
The Video item supports untransformed, stretched, and uniformly scaled video presentation.
diff --git a/src/multimedia/mediaservices/effects/qsoundeffect.cpp b/src/multimedia/mediaservices/effects/qsoundeffect.cpp
index 1992ee5..3537566 100644
--- a/src/multimedia/mediaservices/effects/qsoundeffect.cpp
+++ b/src/multimedia/mediaservices/effects/qsoundeffect.cpp
@@ -64,17 +64,19 @@ QT_BEGIN_NAMESPACE
import Qt 4.7
import Qt.multimedia 4.7
- Item {
+ Text {
+ text: "Click Me!";
+ font.pointSize: 24;
+ width: 150; height: 50;
+
SoundEffect {
id: playSound
- source: "test.wav"
+ source: "soundeffect.wav"
}
MouseArea {
id: playArea
anchors.fill: parent
- onPressed: {
- playSound.play()
- }
+ onPressed: { playSound.play() }
}
}
\endqml