From 646c9849bc02c64398d5490b633132c0a3291441 Mon Sep 17 00:00:00 2001 From: manuel Date: Wed, 13 Apr 2011 03:49:23 +0200 Subject: adding google sounds --- pacman-c++/actor.cpp | 11 +++++++++-- pacman-c++/actor.h | 3 ++- pacman-c++/audio.cpp | 11 +++++++++++ pacman-c++/audio.h | 7 +++++-- pacman-c++/bonuspoint.cpp | 2 +- pacman-c++/mainwidget.cpp | 2 +- pacman-c++/pacman.qrc | 7 ++++--- pacman-c++/sound/ambient.ogg | Bin 0 -> 23243 bytes pacman-c++/sound/die.ogg | Bin 15120 -> 20271 bytes pacman-c++/sound/eating_cherry.ogg | Bin 7015 -> 0 bytes pacman-c++/sound/eating_fruit.ogg | Bin 0 -> 8118 bytes pacman-c++/sound/eating_ghost.ogg | Bin 0 -> 9238 bytes pacman-c++/sound/intermision.ogg | Bin 38875 -> 0 bytes pacman-c++/sound/intro.ogg | Bin 34469 -> 45705 bytes pacman-c++/sound/waka_waka.ogg | Bin 21874 -> 25855 bytes 15 files changed, 33 insertions(+), 10 deletions(-) create mode 100644 pacman-c++/sound/ambient.ogg delete mode 100644 pacman-c++/sound/eating_cherry.ogg create mode 100644 pacman-c++/sound/eating_fruit.ogg create mode 100644 pacman-c++/sound/eating_ghost.ogg delete mode 100644 pacman-c++/sound/intermision.ogg (limited to 'pacman-c++') diff --git a/pacman-c++/actor.cpp b/pacman-c++/actor.cpp index 6ca981c..f56407b 100644 --- a/pacman-c++/actor.cpp +++ b/pacman-c++/actor.cpp @@ -216,11 +216,18 @@ void Actor::die() AudioManager::self()->play(Sound::Die); } -void Actor::eatingCherry() +void Actor::eatingFruit() { if (!m_local) return; - AudioManager::self()->play(Sound::EatingCherry); + AudioManager::self()->play(Sound::EatingFruit); +} + +void Actor::eatingPacman() +{ + if (!m_local) + return; + AudioManager::self()->play(Sound::EatingGhost); } void Actor::startEating() diff --git a/pacman-c++/actor.h b/pacman-c++/actor.h index 794f00b..5ec1a59 100644 --- a/pacman-c++/actor.h +++ b/pacman-c++/actor.h @@ -33,7 +33,8 @@ public: void move(Movement direction); bool isMoving(); void die(); - void eatingCherry(); + void eatingFruit(); + void eatingPacman(); void startEating(); void stopEating(); diff --git a/pacman-c++/audio.cpp b/pacman-c++/audio.cpp index 8726899..6365a15 100644 --- a/pacman-c++/audio.cpp +++ b/pacman-c++/audio.cpp @@ -197,6 +197,17 @@ void AudioPlayer::setLoop(Sound::Type sound) setLoop(AudioManager::self()->sound(sound)); } +void AudioPlayer::play() +{ + Phonon::MediaObject::play(); +} + +void AudioPlayer::play(Sound::Type sound) +{ + setCurrentSource(Phonon::MediaSource(AudioManager::self()->sound(sound))); + play(); +} + /* this is a simple hack to check if phonon can actually play sounds.. */ void AudioPlayer::test(QFile *testsound) { diff --git a/pacman-c++/audio.h b/pacman-c++/audio.h index 2e14715..49d29a9 100644 --- a/pacman-c++/audio.h +++ b/pacman-c++/audio.h @@ -18,9 +18,10 @@ namespace Sound { Intro = 0, WakaWaka, - EatingCherry, + EatingFruit, + EatingGhost, Die, - Siren + Ambient }; }; @@ -47,6 +48,8 @@ public: bool isMuted() const; void setLoop(QFile *sound); void setLoop(Sound::Type sound); + void play(); + void play(Sound::Type sound); private: void test(QFile *testsound); diff --git a/pacman-c++/bonuspoint.cpp b/pacman-c++/bonuspoint.cpp index 221e32e..6e1c9d0 100644 --- a/pacman-c++/bonuspoint.cpp +++ b/pacman-c++/bonuspoint.cpp @@ -33,6 +33,6 @@ bool BonusPoint::enter(Actor* actor) void BonusPoint::onDie(Actor *actor) { - actor->eatingCherry(); + actor->eatingFruit(); } diff --git a/pacman-c++/mainwidget.cpp b/pacman-c++/mainwidget.cpp index 5ef37e3..e254dbc 100644 --- a/pacman-c++/mainwidget.cpp +++ b/pacman-c++/mainwidget.cpp @@ -12,7 +12,7 @@ MainWidget::MainWidget(QWidget *parent) m_sirenPlayer = new AudioPlayer(this); if (m_sirenPlayer->isWorking()) { - m_sirenPlayer->setLoop(Sound::Siren); + m_sirenPlayer->setLoop(Sound::Ambient); AudioManager::self()->registerAudioPlayer(m_sirenPlayer); } diff --git a/pacman-c++/pacman.qrc b/pacman-c++/pacman.qrc index c4b18e6..6654fd1 100644 --- a/pacman-c++/pacman.qrc +++ b/pacman-c++/pacman.qrc @@ -23,8 +23,9 @@ sound/intro.ogg sound/waka_waka.ogg - sound/eating_cherry.ogg - sound/die.ogg - sound/siren.ogg + sound/eating_fruit.ogg + sound/eating_ghost.ogg + sound/die.ogg + sound/ambient.ogg diff --git a/pacman-c++/sound/ambient.ogg b/pacman-c++/sound/ambient.ogg new file mode 100644 index 0000000..2919513 Binary files /dev/null and b/pacman-c++/sound/ambient.ogg differ diff --git a/pacman-c++/sound/die.ogg b/pacman-c++/sound/die.ogg index 1871e3a..f6af2e0 100644 Binary files a/pacman-c++/sound/die.ogg and b/pacman-c++/sound/die.ogg differ diff --git a/pacman-c++/sound/eating_cherry.ogg b/pacman-c++/sound/eating_cherry.ogg deleted file mode 100644 index e26c8ce..0000000 Binary files a/pacman-c++/sound/eating_cherry.ogg and /dev/null differ diff --git a/pacman-c++/sound/eating_fruit.ogg b/pacman-c++/sound/eating_fruit.ogg new file mode 100644 index 0000000..cf17164 Binary files /dev/null and b/pacman-c++/sound/eating_fruit.ogg differ diff --git a/pacman-c++/sound/eating_ghost.ogg b/pacman-c++/sound/eating_ghost.ogg new file mode 100644 index 0000000..a204a2c Binary files /dev/null and b/pacman-c++/sound/eating_ghost.ogg differ diff --git a/pacman-c++/sound/intermision.ogg b/pacman-c++/sound/intermision.ogg deleted file mode 100644 index 32c0cc2..0000000 Binary files a/pacman-c++/sound/intermision.ogg and /dev/null differ diff --git a/pacman-c++/sound/intro.ogg b/pacman-c++/sound/intro.ogg index fa8b3e1..d38f16b 100644 Binary files a/pacman-c++/sound/intro.ogg and b/pacman-c++/sound/intro.ogg differ diff --git a/pacman-c++/sound/waka_waka.ogg b/pacman-c++/sound/waka_waka.ogg index f499611..def0d96 100644 Binary files a/pacman-c++/sound/waka_waka.ogg and b/pacman-c++/sound/waka_waka.ogg differ -- cgit v1.2.3