xref: /haiku/src/add-ons/media/media-add-ons/multi_audio/MultiAudioDevice.h (revision cda5b8808fd0262f0fac472f6cfa809f846a83cf)
1 /*
2  * Copyright (c) 2002-2007, Jerome Duval (jerome.duval@free.fr)
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef MULTI_AUDIO_DEVICE_H
6 #define MULTI_AUDIO_DEVICE_H
7 
8 
9 #include "hmulti_audio.h"
10 
11 
12 #define MAX_CONTROLS	128
13 #define MAX_CHANNELS	32
14 #define MAX_BUFFERS		32
15 
16 
17 class MultiAudioDevice {
18 public:
19 						MultiAudioDevice(const char* name, const char* path);
20 						~MultiAudioDevice();
21 
22 	status_t			InitCheck() const;
23 
24 	const multi_description& Description() const { return fDescription; }
25 	const multi_format_info& FormatInfo() const { return fFormatInfo; }
26 	const multi_buffer_list& BufferList() const { return fBufferList; }
27 	const multi_mix_control_info& MixControlInfo() const
28 							{ return fMixControlInfo; }
29 
30 	status_t			BufferExchange(multi_buffer_info* bufferInfo);
31 	status_t			SetMix(multi_mix_value_info* mixValueInfo);
32 	status_t			GetMix(multi_mix_value_info* mixValueInfo);
33 
34 private:
35 	status_t			_InitDriver();
36 
37 	status_t 			fInitStatus;
38 	int					fDevice;
39 	char				fPath[B_PATH_NAME_LENGTH];
40 
41 	multi_description	fDescription;
42 	multi_channel_info	fChannelInfo[MAX_CHANNELS];
43 	multi_format_info 	fFormatInfo;
44 	multi_buffer_list 	fBufferList;
45 
46 	multi_mix_control_info fMixControlInfo;
47 	multi_mix_control	fMixControl[MAX_CONTROLS];
48 
49 	buffer_desc			fPlayBufferList[MAX_BUFFERS * MAX_CHANNELS];
50 	buffer_desc			fRecordBufferList[MAX_BUFFERS * MAX_CHANNELS];
51 	buffer_desc*		fPlayBuffers[MAX_BUFFERS];
52 	buffer_desc*		fRecordBuffers[MAX_BUFFERS];
53 };
54 
55 #endif	// MULTI_AUDIO_DEVICE_H
56