From 2c1c79748ca0eb51c23c94bf876d3918ac847f8a Mon Sep 17 00:00:00 2001 From: manuel Date: Sat, 9 Apr 2011 01:25:33 +0200 Subject: fix + test --- pacman-c++/actor.cpp | 7 ++++++- pacman-c++/audioplayer.cpp | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'pacman-c++') diff --git a/pacman-c++/actor.cpp b/pacman-c++/actor.cpp index a52be15..cd59c1e 100644 --- a/pacman-c++/actor.cpp +++ b/pacman-c++/actor.cpp @@ -47,7 +47,7 @@ Actor::Actor(Color::Color color, bool local, QGraphicsItem *parent) m_eating.append(setupEatingAnimation(Actor::Down)); /* setup player */ - connect(AudioPlayer::self(), SIGNAL(finished()), this, SLOT(enqueue())); + connect(AudioPlayer::self(), SIGNAL(aboutToFinish()), this, SLOT(enqueue())); /* make the picture showing the current direction visible */ m_images[m_direction]->setVisible(true); @@ -155,7 +155,9 @@ void Actor::move(Actor::Movement direction) if (direction == Actor::None) m_images[m_direction]->setVisible(true); else + { m_eating[direction]->start(); + } m_direction = direction; } @@ -163,7 +165,10 @@ void Actor::move(Actor::Movement direction) { m_moving->start(); if (m_local && AudioPlayer::self()->state() != Phonon::PlayingState) + { AudioPlayer::self()->play(AudioPlayer::WakaWaka); + AudioPlayer::self()->enqueue(AudioPlayer::WakaWaka); + } } } diff --git a/pacman-c++/audioplayer.cpp b/pacman-c++/audioplayer.cpp index 15a29ca..5e9ede7 100644 --- a/pacman-c++/audioplayer.cpp +++ b/pacman-c++/audioplayer.cpp @@ -75,7 +75,7 @@ void AudioPlayer::play(AudioPlayer::Sound sound) void AudioPlayer::enqueue(AudioPlayer::Sound sound) { if (!m_working) - return + return; m_player->enqueue(Phonon::MediaSource(m_sounds[sound])); } -- cgit v1.2.3