xref: /haiku/src/add-ons/kernel/drivers/audio/emuxki/multi.h (revision 93aeb8c3bc3f13cb1f282e3e749258a23790d947)
1 /*
2  * BeOS Driver for Creative Labs SBLive! series
3  *
4  * Copyright (c) 2002, Jerome Duval (jerome.duval@free.fr)
5  *
6  * Original code : BeOS Driver for Intel ICH AC'97 Link interface
7  * Copyright (c) 2002, Marcus Overhagen <marcus@overhagen.de>
8  *
9  * All rights reserved.
10  * Redistribution and use in source and binary forms, with or without modification,
11  * are permitted provided that the following conditions are met:
12  *
13  * - Redistributions of source code must retain the above copyright notice,
14  *   this list of conditions and the following disclaimer.
15  * - Redistributions in binary form must reproduce the above copyright notice,
16  *   this list of conditions and the following disclaimer in the documentation
17  *   and/or other materials provided with the distribution.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
23  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
25  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
28  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  *
30  */
31 #ifndef _MULTI_H_
32 #define _MULTI_H_
33 
34 #define BUFFER_FRAMES	512
35 //#define BUFFER_FRAMES	32	// this is the minimum which works
36 #define BUFFER_COUNT	2
37 
38 typedef struct _multi_mixer_control {
39 	struct _multi_dev 	*multi;
40 	void	(*get) (void *card, const void *cookie, int32 type, float *values);
41 	void	(*set) (void *card, const void *cookie, int32 type, float *values);
42 	const void    *cookie;
43 	int32 type;
44 	multi_mix_control	mix_control;
45 } multi_mixer_control;
46 
47 #define EMU_MULTI_CONTROL_FIRSTID	1024
48 #define EMU_MULTI_CONTROL_MASTERID	0
49 
50 typedef struct _multi_dev {
51 	void	*card;
52 #define EMU_MULTICONTROLSNUM 64
53 	multi_mixer_control controls[EMU_MULTICONTROLSNUM];
54 	uint32 control_count;
55 
56 #define EMU_MULTICHANNUM 64
57 	multi_channel_info chans[EMU_MULTICHANNUM];
58 	uint32 output_channel_count;
59 	uint32 input_channel_count;
60 	uint32 output_bus_channel_count;
61 	uint32 input_bus_channel_count;
62 	uint32 aux_bus_channel_count;
63 } multi_dev;
64 
65 #endif
66