1 #ifndef __MCP_H
2 #define __MCP_H
3 
4 struct ocpfilehandle_t;
5 
6 struct sampleinfo
7 {
8 	int type;
9 	void *ptr;
10 	uint32_t length;
11 	uint32_t samprate;
12 	uint32_t loopstart;
13 	uint32_t loopend;
14 	uint32_t sloopstart;
15 	uint32_t sloopend;
16 };
17 
18 enum
19 {
20 	mcpSampUnsigned=1,
21 	mcpSampDelta=2,
22 	mcpSamp16Bit=4,
23 	mcpSampBigEndian=8,
24 	mcpSampLoop=16,
25 	mcpSampBiDi=32,
26 	mcpSampSLoop=64,
27 	mcpSampSBiDi=128,
28 	mcpSampStereo=256,
29 	mcpSampFloat=512,
30 	mcpSampRedBits=(int)0x80000000,
31 	mcpSampRedRate2=0x40000000,
32 	mcpSampRedRate4=0x20000000,
33 	mcpSampRedStereo=0x10000000
34 };
35 
36 enum
37 {
38 	mcpMasterVolume, mcpMasterPanning, mcpMasterBalance, mcpMasterSurround,
39 	mcpMasterSpeed, mcpMasterPitch, mcpMasterBass, mcpMasterTreble,
40 	mcpMasterReverb, mcpMasterChorus, mcpMasterPause, mcpMasterFilter,
41 	mcpMasterAmplify,
42 	mcpGSpeed,
43 	mcpCVolume, mcpCPanning, mcpCPanY, mcpCPanZ, mcpCSurround, mcpCPosition,
44 	mcpCPitch, mcpCPitchFix, mcpCPitch6848, mcpCStop, mcpCReset,
45 	mcpCBass, mcpCTreble, mcpCReverb, mcpCChorus, mcpCMute, mcpCStatus,
46 	mcpCInstrument, mcpCLoop, mcpCDirect, mcpCFilterFreq, mcpCFilterRez,
47 	mcpGTimer, mcpGCmdTimer,
48 	mcpGRestrict
49 };
50 
51 extern int mcpReduceSamples(struct sampleinfo *s, int n, long m, int o);
52 enum
53 {
54 	mcpRedAlways16Bit=1,
55 	mcpRedNoPingPong=2,
56 	mcpRedGUS=4,
57 	mcpRedToMono=8,
58 	mcpRedTo8Bit=16,
59 	mcpRedToFloat=32
60 };
61 
62 
63 enum
64 {
65 	mcpGetSampleStereo=1, mcpGetSampleHQ=2
66 };
67 
68 extern int mcpNChan;
69 
70 extern int (*mcpLoadSamples)(struct sampleinfo* si, int n);
71 extern int (*mcpOpenPlayer)(int, void (*p)(void), struct ocpfilehandle_t *source_file);
72 extern void (*mcpClosePlayer)(void);
73 extern void (*mcpSet)(int ch, int opt, int val);
74 extern int (*mcpGet)(int ch, int opt);
75 extern void (*mcpGetRealVolume)(int ch, int *l, int *r);
76 extern void (*mcpGetRealMasterVolume)(int *l, int *r);
77 extern void (*mcpGetMasterSample)(int16_t *s, unsigned int len, uint32_t rate, int opt);
78 extern int (*mcpGetChanSample)(unsigned int ch, int16_t *s, unsigned int len, uint32_t rate, int opt);
79 extern int (*mcpMixChanSamples)(unsigned int *ch, unsigned int n, int16_t *s, unsigned int len, uint32_t rate, int opt);
80 
81 extern unsigned int mcpMixMaxRate;
82 extern unsigned int mcpMixProcRate;
83 extern int mcpMixOpt;
84 extern unsigned int mcpMixBufSize;
85 
86 extern void (*mcpIdle)(void);
87 
88 extern int mcpGetFreq6848(int note);
89 extern int mcpGetFreq8363(int note);
90 extern int mcpGetNote6848(int freq);
91 extern int mcpGetNote8363(int freq);
92 
93 #endif
94