prosperon/source/engine/sound/mix.h

31 lines
439 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"
2022-07-05 20:49:51 -05:00
struct sound;
struct bus {
2022-07-06 17:17:06 -05:00
struct dsp_filter in;
2022-07-05 20:49:51 -05:00
short 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
};
2022-07-05 20:49:51 -05:00
extern short mastermix[BUF_FRAMES*CHANNELS];
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(short *master, int n);
2023-01-15 11:16:25 -06:00
2022-07-12 15:43:02 -05:00
void bus_free(struct bus *bus);
2022-07-05 20:49:51 -05:00
#endif