Subversion Repositories eduke32

Rev

Rev 8561 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
6158 hendricks2 1
#ifndef LIBXMP_MIXER_H
2
#define LIBXMP_MIXER_H
3
 
4
#define C4_PERIOD       428.0
5
 
6
#define SMIX_NUMVOC     128     /* default number of softmixer voices */
7
#define SMIX_SHIFT      16
8
#define SMIX_MASK       0xffff
9
 
10
#define FILTER_SHIFT    16
11
#define ANTICLICK_SHIFT 3
12
 
13
#ifdef LIBXMP_PAULA_SIMULATOR
14
#include "paula.h"
15
#endif
16
 
17
#define MIXER(f) void libxmp_mix_##f(struct mixer_voice *vi, int *buffer, \
18
        int count, int vl, int vr, int step, int ramp, int delta_l, int delta_r)
19
 
20
struct mixer_voice {
21
        int chn;                /* channel number */
22
        int root;               /* */
23
        int note;               /* */
24
#define PAN_SURROUND 0x8000
25
        int pan;                /* */
26
        int vol;                /* */
27
        double period;          /* current period */
28
        double pos;             /* position in sample */
29
        int pos0;               /* position in sample before mixing */
30
        int fidx;               /* mixer function index */
31
        int ins;                /* instrument number */
32
        int smp;                /* sample number */
33
        int end;                /* loop end */
34
        int act;                /* nna info & status of voice */
35
        int old_vl;             /* previous volume, left channel */
36
        int old_vr;             /* previous volume, right channel */
37
        int sleft;              /* last left sample output, in 32bit */
38
        int sright;             /* last right sample output, in 32bit */
39
#define VOICE_RELEASE   (1 << 0)
40
#define ANTICLICK       (1 << 1)        
41
#define SAMPLE_LOOP     (1 << 2)
42
        int flags;              /* flags */
43
        void *sptr;             /* sample pointer */
44
#ifdef LIBXMP_PAULA_SIMULATOR
45
        struct paula_state *paula; /* paula simulation state */
46
#endif
47
 
48
#ifndef LIBXMP_CORE_DISABLE_IT
49
        struct {
50
                int r1;         /* filter variables */
51
                int r2;
52
                int l1;
53
                int l2;
54
                int a0;
55
                int b0;
56
                int b1;
57
                int cutoff;
58
                int resonance;
59
        } filter;
60
#endif
61
};
62
 
63
int     libxmp_mixer_on         (struct context_data *, int, int, int);
64
void    libxmp_mixer_off        (struct context_data *);
65
void    libxmp_mixer_setvol     (struct context_data *, int, int);
66
void    libxmp_mixer_seteffect  (struct context_data *, int, int, int);
67
void    libxmp_mixer_setpan     (struct context_data *, int, int);
68
int     libxmp_mixer_numvoices  (struct context_data *, int);
69
void    libxmp_mixer_softmixer  (struct context_data *);
70
void    libxmp_mixer_reset      (struct context_data *);
71
void    libxmp_mixer_setpatch   (struct context_data *, int, int, int);
72
void    libxmp_mixer_voicepos   (struct context_data *, int, double, int);
73
double  libxmp_mixer_getvoicepos(struct context_data *, int);
74
void    libxmp_mixer_setnote    (struct context_data *, int, int);
75
void    libxmp_mixer_setperiod  (struct context_data *, int, double);
76
void    libxmp_mixer_release    (struct context_data *, int, int);
77
 
78
#endif /* LIBXMP_MIXER_H */