StreamSoundSource* SoundPlayerOpenAL::findStreamSoundSource() { // try to find a stopped source for(StreamSoundSources::iterator i = streamSources.begin(); i != streamSources.end(); ++i) { StreamSoundSource* source = *i; if(! source->playing()) { return source; } } // create a new source if(streamSources.size() >= params.strBufferCount) { throw std::runtime_error("Too many stream sounds played at once"); } StreamSoundSource* source = new StreamSoundSource(); streamSources.push_back(source); return source; }