xref: /haiku/src/add-ons/media/media-add-ons/multi_audio/MultiAudioUtility.h (revision 16d5c24e533eb14b7b8a99ee9f3ec9ba66335b1e)
1 /*
2  * Copyright 2008, Axel Dörfler, axeld@pinc-software.de.
3  * Copyright (c) 2002-2007, Jerome Duval (jerome.duval@free.fr)
4  *
5  * Distributed under the terms of the MIT License.
6  */
7 #ifndef MULTI_AUDIO_UTILITY_H
8 #define MULTI_AUDIO_UTILITY_H
9 
10 
11 #include "hmulti_audio.h"
12 
13 
14 namespace MultiAudio {
15 
16 // sample rate & format conversion
17 float convert_to_sample_rate(uint32 rate);
18 uint32 convert_from_sample_rate(float rate);
19 uint32 convert_to_media_format(uint32 format);
20 int16 convert_to_valid_bits(uint32 format);
21 uint32 convert_from_media_format(uint32 format);
22 uint32 select_sample_rate(uint32 rate);
23 uint32 select_format(uint32 format);
24 
25 // device driver interface
26 status_t get_description(int device, multi_description* description);
27 
28 status_t get_enabled_channels(int device, multi_channel_enable* enable);
29 status_t set_enabled_channels(int device, multi_channel_enable* enable);
30 
31 status_t get_global_format(int device, multi_format_info* info);
32 status_t set_global_format(int device, multi_format_info* info);
33 status_t get_buffers(int device, multi_buffer_list* list);
34 status_t buffer_exchange(int device, multi_buffer_info* info);
35 
36 status_t list_mix_controls(int device, multi_mix_control_info* info);
37 status_t get_mix(int device, multi_mix_value_info* info);
38 status_t set_mix(int device, multi_mix_value_info* info);
39 
40 }	// namespace MultiAudio
41 
42 #endif	// MULTI_AUDIO_UTILITY_H
43