void SoundEngine::playGameMusic() { pauseChannel(loadingChannel_); pauseChannel(menuChannel_); pauseChannel(endChannel_); pauseChannel(gravityChannel_); if (gameChannel_) { bool paused; gameChannel_->getPaused(&paused); if (paused) { gameChannel_->setPaused(false); } return; } result_ = system_->playSound(gameMusic_, 0, false, &gameChannel_); }
void SoundManager::pauseChannel(ChannelHandle &handle, bool pause) { Common::StackLock lock(_mutex); Channel *channel = getChannel(handle); if (!channel || !channel->stream) throw Common::Exception("Invalid channel"); pauseChannel(channel, pause); }
void SoundManager::pauseAll(bool pause) { Common::StackLock lock(_mutex); for (uint16 i = 1; i < kChannelCount; i++) pauseChannel(_channels[i], pause); }