1 #define MIXF_MIXBUFLEN 4096
2 #define MIXF_MAXCHAN 255
3 
4 //#define MIXF_PLAYSTEREO 0     Floating point mixer doesn't support stereo samples, only mono to stereo output
5 #define MIXF_INTERPOLATE 2
6 #define MIXF_INTERPOLATEQ 4
7 #define MIXF_FILTER 8
8 #define MIXF_QUIET 16
9 #define MIXF_LOOPED 32
10 
11 #define MIXF_PLAYING 256
12 #define MIXF_MUTE 512
13 
14 #define MIXF_UNSIGNED 1
15 #define MIXF_16BITOUT 2
16 
17 #define MIXF_VOLRAMP  256
18 #define MIXF_DECLICK  512
19 
20 extern void mixer (void);
21 extern void prepare_mixer (void);
22 extern void getchanvol (int n, int len);
23 
24 #define MAXVOICES MIXF_MAXCHAN
25 
26 typedef struct
27 {
28 	float    *tempbuf;         /* ptr to 32 bit temp-buffer */
29 	void     *outbuf;          /* ptr to 16 bit mono-buffer */
30 	uint32_t  nsamples;        /* # of samples to generate */
31 	uint32_t  nvoices;         /* # of voices */
32 
33 	uint32_t  freqw[MIXF_MAXCHAN]; /* frequency (whole part) */
34 	uint32_t  freqf[MIXF_MAXCHAN]; /* frequency (fractional part) */
35 
36 	float    *smpposw[MIXF_MAXCHAN]; /* sample position (whole part (pointer!)) */
37 	uint32_t  smpposf[MIXF_MAXCHAN]; /* sample position (fractional part) */
38 
39 	float    *loopend[MIXF_MAXCHAN]; /* pointer to loop end */
40 	uint32_t  looplen[MIXF_MAXCHAN]; /* loop length in samples */
41 
42 	float   volleft[MIXF_MAXCHAN];   /* float: left volume (1.0=normal) */
43 	float   volright[MIXF_MAXCHAN];  /* float: right volume (1.0=normal) */
44 	float   rampleft[MIXF_MAXCHAN];  /* float: left volramp (dvol/sample) */
45 	float   rampright[MIXF_MAXCHAN]; /* float: right volramp (dvol/sample) */
46 
47 	uint32_t voiceflags[MIXF_MAXCHAN]; /* voice status flags */
48 
49 	float   ffreq[MIXF_MAXCHAN]; /* filter frequency (0<=x<=1) */
50 	float   freso[MIXF_MAXCHAN]; /* filter resonance (0<=x<1) */
51 
52 	float   fadeleft,faderight; /* temp holding register - TODO, check if they should be local for channel */
53 
54 	float   fl1[MIXF_MAXCHAN]; /* filter lp buffer */
55 	float   fb1[MIXF_MAXCHAN]; /* filter bp buffer */
56 
57 	int     isstereo;   /* flag for stereo output */
58 	int     outfmt;     /* output format */
59 	float   voll, volr; /* output volume */
60 
61 	float   ct0[256]; /* interpolation tab for s[-1] */
62 	float   ct1[256]; /* interpolation tab for s[0] */
63 	float   ct2[256]; /* interpolation tab for s[1] */
64 	float   ct3[256]; /* interpolation tab for s[2] */
65 
66 	uint32_t samprate;
67 
68 	struct mixfpostprocregstruct *postprocs; /* TODO */
69 
70 	/* private to mixer, used be dwmixfa_8087.c */
71 	float volrl; /* volume current left */
72 	float volrr; /* volume current right */
73 	uint16_t clipval;    /* used in clippers in order to transfer into register */
74 	uint32_t mixlooplen; /* lenght of loop in samples*/
75 	uint32_t looptype;  /* local version of voiceflags[N] */
76 	float magic1;  /* internal dumping variable for filters */
77 	float ffrq;
78 	float frez;
79 	float __fl1;
80 	float __fb1;
81 } dwmixfa_state_t;
82 
83 extern dwmixfa_state_t dwmixfa_state;
84 
85 
86 
87 #ifdef I386_ASM
88 
89 extern void start_dwmixfa(void);   /* these two are used to calculate memory remapping (self modifying code) */
90 extern void stop_dwmixfa(void);
91 
92 #endif
93