Esempio n. 1
0
void SoundGen2GS::play(int resnum) {
	AgiSoundEmuType type;

	_playingSound = resnum;

	type = (AgiSoundEmuType)_vm->_game.sounds[resnum]->type();

	assert (type == AGI_SOUND_SAMPLE || type == AGI_SOUND_MIDI);

	switch (type) {
	case AGI_SOUND_SAMPLE: {
		IIgsSample *sampleRes = (IIgsSample *) _vm->_game.sounds[_playingSound];
		playSampleSound(sampleRes->getHeader(), sampleRes->getSample());
		break;
	}
	case AGI_SOUND_MIDI:
		((IIgsMidi *) _vm->_game.sounds[_playingSound])->rewind();
		break;
	default:
		break;
	}
}