Пример #1
0
 //added on 980905 by adb to make sound channel setting work
void digi_audio_set_max_channels(int n) {
	digi_max_channels	= n;

	if ( digi_max_channels < 1 )
		digi_max_channels = 1;
	if (digi_max_channels > MAX_SOUND_SLOTS)
		digi_max_channels = MAX_SOUND_SLOTS;

	if ( !digi_initialised ) return;

	digi_stop_all_channels();
}
Пример #2
0
void digi_init_sounds()
{
	int i;

	SoundQ_init();

	digi_stop_all_channels();

	digi_stop_looping_sound();
	for (i=0; i<MAX_SOUND_OBJECTS; i++ )	{
		SoundObjects[i].channel = -1;
		SoundObjects[i].flags = 0;	// Mark as dead, so some other sound can use this sound
	}
	N_active_sound_objects = 0;
	digi_sounds_initialized = 1;
}
Пример #3
0
void digi_stop_digi_sounds()
{
	int i;

	digi_stop_looping_sound();

	for (i=0; i<MAX_SOUND_OBJECTS; i++ )	{
		if ( SoundObjects[i].flags & SOF_USED )	{
			if ( SoundObjects[i].channel > -1 )	{
				digi_stop_sound( SoundObjects[i].channel );
				N_active_sound_objects--;
			}
			SoundObjects[i].flags = 0;	// Mark as dead, so some other sound can use this sound
		}
	}

	digi_stop_all_channels();
	SoundQ_init();
}
Пример #4
0
void digi_pause_digi_sounds()
{

	int i;

	digi_pause_looping_sound();

	for (i=0; i<MAX_SOUND_OBJECTS; i++ )	{
		if ( (SoundObjects[i].flags & SOF_USED) && (SoundObjects[i].channel>-1) )	{
			digi_stop_sound( SoundObjects[i].channel );
			if (! (SoundObjects[i].flags & SOF_PLAY_FOREVER))
				SoundObjects[i].flags = 0;	// Mark as dead, so some other sound can use this sound
			N_active_sound_objects--;
			SoundObjects[i].channel = -1;
		}
	}

	digi_stop_all_channels();
	SoundQ_pause();
}