示例#1
0
Sound* SoundSystem::PlayStreamingSound(SoundID soundID, int loopCount, float volumeLevel)
{
    Sound*		soundPicked = NULL;

    SoundMap ::iterator soundIDIter = m_soundMap.find(soundID);
    if(soundIDIter!= m_soundMap.end())
    {
        //bool playedSound = false;
        Sounds& sounds = soundIDIter->second;
        for (Sounds::iterator soundIter = sounds.begin(); soundIter != sounds.end(); ++soundIter)
        {
            Sound* sound = (*soundIter);
            if(sound->IsPlaying() &&sound->IsReady())
                continue;
            sound->Play(loopCount,volumeLevel);
            //	playedSound = true;
            soundPicked = sound;
            break;
        }
        /*
        	if(soundPicked)
        	{

        	}
        */
    }
    return soundPicked ;
}
bool
SoundCardD3D::Resume()
{
	AutoThreadSync a(sync);

	ListIter<Sound> iter = sounds;
	while (++iter) {
		Sound* s = iter.value();

		if (s->IsReady())
		s->Play();
	}

	return true;
}