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"
|
2023-08-29 17:11:36 -05:00
|
|
|
#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;
|
2023-08-29 17:11:36 -05:00
|
|
|
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
|
|
|
};
|
|
|
|
|
2023-09-13 07:31:00 -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);
|
2023-11-20 15:57:23 -06:00
|
|
|
void filter_to_bus(struct dsp_filter *f);
|
|
|
|
void unplug_filter(struct dsp_filter *f);
|
2023-08-29 17:11:36 -05:00
|
|
|
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
|
|
|
|
|
|
|
|
2022-11-25 07:12:31 -06:00
|
|
|
#endif
|