1 | /* $Id: voicemgr.h 142 2000-04-23 14:55:46Z ktk $ */
|
---|
2 |
|
---|
3 | /*
|
---|
4 | **********************************************************************
|
---|
5 | * sblive_voice.h -- EMU Voice Resource Manager header file
|
---|
6 | * Copyright 1999, 2000 Creative Labs, Inc.
|
---|
7 | *
|
---|
8 | **********************************************************************
|
---|
9 | *
|
---|
10 | * Date Author Summary of changes
|
---|
11 | * ---- ------ ------------------
|
---|
12 | * October 20, 1999 Bertrand Lee base code release
|
---|
13 | *
|
---|
14 | **********************************************************************
|
---|
15 | *
|
---|
16 | * This program is free software; you can redistribute it and/or
|
---|
17 | * modify it under the terms of the GNU General Public License as
|
---|
18 | * published by the Free Software Foundation; either version 2 of
|
---|
19 | * the License, or (at your option) any later version.
|
---|
20 | *
|
---|
21 | * This program is distributed in the hope that it will be useful,
|
---|
22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
24 | * GNU General Public License for more details.
|
---|
25 | *
|
---|
26 | * You should have received a copy of the GNU General Public
|
---|
27 | * License along with this program; if not, write to the Free
|
---|
28 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
|
---|
29 | * USA.
|
---|
30 | *
|
---|
31 | **********************************************************************
|
---|
32 | */
|
---|
33 |
|
---|
34 | #ifndef _VOICEMGR_H
|
---|
35 | #define _VOICEMGR_H
|
---|
36 | /* struct emu_voice.usage flags */
|
---|
37 | #define VOICEMGR_USAGE_FREE 0x00000000
|
---|
38 | #define VOICEMGR_USAGE_MIDI 0x00000001
|
---|
39 | #define VOICEMGR_USAGE_PLAYBACK 0x00000002
|
---|
40 |
|
---|
41 | /* struct emu_voice.flags flags */
|
---|
42 | #define VOICEMGR_FLAGS_MONO 0x00000002
|
---|
43 | #define VOICEMGR_FLAGS_16BIT 0x00000004
|
---|
44 | #define VOICEMGR_FLAGS_STEREOSLAVE 0x00000008
|
---|
45 | #define VOICEMGR_FLAGS_VOICEMASTER 0x80000000
|
---|
46 | #define VOICEMGR_FLAGS_FXRT2 0x00000010
|
---|
47 |
|
---|
48 | struct voice_param
|
---|
49 | {
|
---|
50 | /* Sound engine */
|
---|
51 | u32 start;
|
---|
52 | u32 startloop;
|
---|
53 | u32 endloop;
|
---|
54 | u32 end;
|
---|
55 |
|
---|
56 | u16 current_pitch;
|
---|
57 | u16 pitch_target;
|
---|
58 |
|
---|
59 | u16 current_volume;
|
---|
60 | u16 volume_target;
|
---|
61 |
|
---|
62 | u16 current_FC;
|
---|
63 | u16 FC_target;
|
---|
64 |
|
---|
65 | u8 pan_target;
|
---|
66 | u8 aux_target;
|
---|
67 |
|
---|
68 | /* FX bus amount send */
|
---|
69 |
|
---|
70 | u32 send_a;
|
---|
71 | u32 send_b;
|
---|
72 | u32 send_c;
|
---|
73 | u32 send_d;
|
---|
74 |
|
---|
75 | /* Envelope engine */
|
---|
76 | u16 ampl_env_delay;
|
---|
77 | u8 byampl_env_attack;
|
---|
78 | u8 byampl_env_hold;
|
---|
79 | u8 byampl_env_decay;
|
---|
80 | u8 byampl_env_sustain;
|
---|
81 | u8 byampl_env_release;
|
---|
82 |
|
---|
83 | u16 aux_env_delay;
|
---|
84 | u8 byaux_env_attack;
|
---|
85 | u8 byaux_env_hold;
|
---|
86 | u8 byaux_env_decay;
|
---|
87 | u8 byaux_env_sustain;
|
---|
88 | u8 byaux_env_release;
|
---|
89 |
|
---|
90 | u16 mod_LFO_delay; /* LFO1 */
|
---|
91 | u16 vib_LFO_delay; /* LFO2 */
|
---|
92 | u8 mod_LFO_freq; /* LFO1 */
|
---|
93 | u8 vib_LFO_freq; /* LFO2 */
|
---|
94 |
|
---|
95 | s8 aux_env_to_pitch;
|
---|
96 | s8 aux_env_to_FC;
|
---|
97 | s8 mod_LFO_to_pitch;
|
---|
98 | s8 vib_LFO_to_pitch;
|
---|
99 | s8 mod_LFO_to_FC;
|
---|
100 | s8 mod_LFO_to_volume;
|
---|
101 |
|
---|
102 | u16 sample_pitch;
|
---|
103 | u16 initial_pitch;
|
---|
104 | u8 initial_attn;
|
---|
105 | u8 initial_FC;
|
---|
106 | };
|
---|
107 |
|
---|
108 | struct voice_allocdesc
|
---|
109 | {
|
---|
110 | u32 usage; /* playback, Midi */
|
---|
111 | u32 flags; /* stereo/mono rec/playback 8/16 bit*/
|
---|
112 | };
|
---|
113 |
|
---|
114 | struct emu_voice
|
---|
115 | {
|
---|
116 | struct list_head list;
|
---|
117 |
|
---|
118 | struct emu10k1_card *card;
|
---|
119 | u32 usage; /* Free, MIDI, playback */
|
---|
120 | u32 num; /* Voice ID */
|
---|
121 | u32 flags; /* Stereo/mono, rec/playback, 8/16 bit */
|
---|
122 |
|
---|
123 | struct voice_param params;
|
---|
124 |
|
---|
125 | struct emu_voice *linked_voice; /*for stereo voice*/
|
---|
126 |
|
---|
127 | u32 sendhandle[NUM_FXSENDS];
|
---|
128 | };
|
---|
129 |
|
---|
130 | struct voice_manager
|
---|
131 | {
|
---|
132 | struct emu10k1_card *card;
|
---|
133 | spinlock_t lock;
|
---|
134 |
|
---|
135 | struct emu_voice voice[NUM_G];
|
---|
136 | };
|
---|
137 |
|
---|
138 | struct voice_cntlset
|
---|
139 | {
|
---|
140 | u32 paramID;
|
---|
141 | u32 value;
|
---|
142 | };
|
---|
143 |
|
---|
144 | struct emu_voice *emu10k1_voice_alloc(struct voice_manager *, struct voice_allocdesc *);
|
---|
145 | void emu10k1_voice_free(struct voice_manager *, struct emu_voice *);
|
---|
146 | void emu10k1_voice_playback_setup(struct emu_voice *);
|
---|
147 | void emu10k1_voice_start(struct emu_voice *);
|
---|
148 | void emu10k1_voice_stop(struct emu_voice *);
|
---|
149 | void emu10k1_voice_setcontrol(struct emu_voice *, struct voice_cntlset *, u32);
|
---|
150 | void emu10k1_voice_getcontrol(struct emu_voice *, u32, u32 *);
|
---|
151 |
|
---|
152 | #endif /* _VOICEMGR_H */
|
---|