Example #1
0
void SDLCALL Mixer::Callback(void* arg, uint8* stream, int length)
{
	Mixer* mixer = (Mixer*)arg;
	memset(stream, 0, length);
	for (int i = 0; i < 10; i++) {
		mixer->MixChannel(mixer->channels[i], stream, length);
	}
}
Example #2
0
void SDLCALL Mixer::Callback(void* arg, uint8* stream, int length)
{
	Mixer* mixer = (Mixer*)arg;
	memset(stream, 0, length);
	std::list<Channel*>::iterator i = mixer->channels.begin();
	while (i != mixer->channels.end()) {
		mixer->MixChannel(*(*i), stream, length);
		if (((*i)->done && (*i)->deleteondone) || (*i)->stopping) {
			delete (*i);
			i = mixer->channels.erase(i);
		} else {
			i++;
		}
	}
}