prosperon/source/engine/sound/mix.h

30 lines
499 B
C
Raw Normal View History

2022-07-05 20:49:51 -05:00
#ifndef MIX_H
#define MIX_H
2022-07-06 17:17:06 -05:00
#include "dsp.h"
#include "sound.h"
2022-07-05 20:49:51 -05:00
struct bus {
2022-07-06 17:17:06 -05:00
struct dsp_filter in;
soundbyte buf[BUF_FRAMES*CHANNELS];
2022-07-12 15:43:02 -05:00
float gain;
2023-01-15 11:16:25 -06:00
int on;
int next; /* Next available bus */
int prev;
int id;
2022-07-11 23:21:57 -05:00
};
extern soundbyte *mastermix;
2022-07-05 20:49:51 -05:00
2023-01-15 11:16:25 -06:00
void mixer_init();
2022-07-06 17:17:06 -05:00
struct bus *first_free_bus(struct dsp_filter in);
void bus_fill_buffers(soundbyte *master, int n);
2023-01-15 11:16:25 -06:00
2023-01-17 15:09:14 -06:00
/* Set volume between 0 and 100% */
void mix_master_vol(float v);
2022-07-12 15:43:02 -05:00
void bus_free(struct bus *bus);
2022-07-05 20:49:51 -05:00
#endif