mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-23 02:41:30 +00:00
[audio] Add optional on_update output function
on_update is for pull-model outpput targets to do periodic synchronous checks (eg, checking that the connection to the actual output device is still alive and reviving it if necessary)
This commit is contained in:
parent
db7e99d842
commit
02ff875cd6
2 changed files with 5 additions and 0 deletions
|
@ -37,6 +37,7 @@ typedef struct snd_output_funcs_s {
|
|||
void (*shutdown) (struct snd_s *snd);
|
||||
int (*get_dma_pos) (struct snd_s *snd);
|
||||
void (*submit) (struct snd_s *snd);
|
||||
void (*on_update) (struct snd_s *snd);
|
||||
void (*block_sound) (struct snd_s *snd);
|
||||
void (*unblock_sound) (struct snd_s *snd);
|
||||
} snd_output_funcs_t;
|
||||
|
|
|
@ -214,6 +214,10 @@ s_update (const vec3_t origin, const vec3_t forward, const vec3_t right,
|
|||
if (!sound_started || (snd_blocked > 0))
|
||||
return;
|
||||
|
||||
if (snd_output_funcs->on_update) {
|
||||
snd_output_funcs->on_update (&snd);
|
||||
}
|
||||
|
||||
SND_SetListener (&snd, origin, forward, right, up, ambient_sound_level);
|
||||
|
||||
if (snd_output_data->model == som_push) {
|
||||
|
|
Loading…
Reference in a new issue