diff options
| author | manuel <manuel@mausz.at> | 2011-04-04 18:52:02 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2011-04-04 18:52:02 +0200 |
| commit | f3f2cc63376019aaf9e8dd807ab674f92908123c (patch) | |
| tree | 0539cbfdd4449dd77a5fe8f1af192929e50ae5b5 /pacman-c++/main.cpp | |
| parent | b310b66be264330e271f4929065cd61f0b0d8bf4 (diff) | |
| download | foop-f3f2cc63376019aaf9e8dd807ab674f92908123c.tar.gz foop-f3f2cc63376019aaf9e8dd807ab674f92908123c.tar.bz2 foop-f3f2cc63376019aaf9e8dd807ab674f92908123c.zip | |
adding sound
Diffstat (limited to 'pacman-c++/main.cpp')
| -rw-r--r-- | pacman-c++/main.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/pacman-c++/main.cpp b/pacman-c++/main.cpp index 6f6e5df..ed347fe 100644 --- a/pacman-c++/main.cpp +++ b/pacman-c++/main.cpp | |||
| @@ -1,11 +1,14 @@ | |||
| 1 | #include "actor.h" | 1 | #include "actor.h" |
| 2 | #include "block.h" | 2 | #include "block.h" |
| 3 | |||
| 3 | #include <QtCore> | 4 | #include <QtCore> |
| 4 | #include <QtGui> | 5 | #include <QtGui> |
| 6 | #include <phonon/MediaObject> | ||
| 5 | 7 | ||
| 6 | int main(int argc, char **argv) | 8 | int main(int argc, char **argv) |
| 7 | { | 9 | { |
| 8 | QApplication app(argc, argv); | 10 | QApplication app(argc, argv); |
| 11 | app.setApplicationName("pacman"); | ||
| 9 | 12 | ||
| 10 | QGraphicsScene scene(0, 0, 500, 500); | 13 | QGraphicsScene scene(0, 0, 500, 500); |
| 11 | scene.setBackgroundBrush(Qt::black); | 14 | scene.setBackgroundBrush(Qt::black); |
| @@ -40,6 +43,10 @@ int main(int argc, char **argv) | |||
| 40 | mainWin.setCentralWidget(window); | 43 | mainWin.setCentralWidget(window); |
| 41 | mainWin.resize(500, 500); | 44 | mainWin.resize(500, 500); |
| 42 | mainWin.show(); | 45 | mainWin.show(); |
| 46 | |||
| 47 | Phonon::MediaObject *music = Phonon::createPlayer(Phonon::MusicCategory, | ||
| 48 | Phonon::MediaSource("/home/manuel/uni/foop/pacman-c++/sound/intro.wav")); | ||
| 49 | music->play(); | ||
| 43 | 50 | ||
| 44 | qsrand(QTime(0,0,0).secsTo(QTime::currentTime())); | 51 | qsrand(QTime(0,0,0).secsTo(QTime::currentTime())); |
| 45 | 52 | ||
