]> code.delx.au - pulseaudio/blob - polyp/channelmap.h
add simple hardware auto detection module
[pulseaudio] / polyp / channelmap.h
1 #ifndef foochannelmaphfoo
2 #define foochannelmaphfoo
3
4 /* $Id$ */
5
6 /***
7 This file is part of polypaudio.
8
9 polypaudio is free software; you can redistribute it and/or modify
10 it under the terms of the GNU Lesser General Public License as published
11 by the Free Software Foundation; either version 2 of the License,
12 or (at your option) any later version.
13
14 polypaudio is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 General Public License for more details.
18
19 You should have received a copy of the GNU Lesser General Public License
20 along with polypaudio; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22 USA.
23 ***/
24
25 #include <polyp/sample.h>
26 #include <polyp/cdecl.h>
27
28 /** \file
29 * Constants and routines for channel mapping handling */
30
31 PA_C_DECL_BEGIN
32
33 typedef enum {
34 PA_CHANNEL_POSITION_INVALID = -1,
35 PA_CHANNEL_POSITION_MONO = 0,
36
37 PA_CHANNEL_POSITION_LEFT,
38 PA_CHANNEL_POSITION_RIGHT,
39
40 PA_CHANNEL_POSITION_FRONT_CENTER,
41 PA_CHANNEL_POSITION_FRONT_LEFT = PA_CHANNEL_POSITION_LEFT,
42 PA_CHANNEL_POSITION_FRONT_RIGHT = PA_CHANNEL_POSITION_RIGHT,
43
44 PA_CHANNEL_POSITION_REAR_CENTER,
45 PA_CHANNEL_POSITION_REAR_LEFT,
46 PA_CHANNEL_POSITION_REAR_RIGHT,
47
48 PA_CHANNEL_POSITION_LFE,
49 PA_CHANNEL_POSITION_SUBWOOFER = PA_CHANNEL_POSITION_LFE,
50
51 PA_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER,
52 PA_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER,
53
54 PA_CHANNEL_POSITION_SIDE_LEFT,
55 PA_CHANNEL_POSITION_SIDE_RIGHT,
56
57 PA_CHANNEL_POSITION_AUX0,
58 PA_CHANNEL_POSITION_AUX1,
59 PA_CHANNEL_POSITION_AUX2,
60 PA_CHANNEL_POSITION_AUX3,
61 PA_CHANNEL_POSITION_AUX4,
62 PA_CHANNEL_POSITION_AUX5,
63 PA_CHANNEL_POSITION_AUX6,
64 PA_CHANNEL_POSITION_AUX7,
65 PA_CHANNEL_POSITION_AUX8,
66 PA_CHANNEL_POSITION_AUX9,
67 PA_CHANNEL_POSITION_AUX10,
68 PA_CHANNEL_POSITION_AUX11,
69 PA_CHANNEL_POSITION_AUX12,
70 PA_CHANNEL_POSITION_AUX13,
71 PA_CHANNEL_POSITION_AUX14,
72 PA_CHANNEL_POSITION_AUX15,
73
74 PA_CHANNEL_POSITION_MAX
75 } pa_channel_position_t;
76
77 typedef struct pa_channel_map {
78 uint8_t channels;
79 pa_channel_position_t map[PA_CHANNELS_MAX];
80 } pa_channel_map;
81
82 pa_channel_map* pa_channel_map_init(pa_channel_map *m);
83 pa_channel_map* pa_channel_map_init_mono(pa_channel_map *m);
84 pa_channel_map* pa_channel_map_init_stereo(pa_channel_map *m);
85 pa_channel_map* pa_channel_map_init_auto(pa_channel_map *m, unsigned channels);
86
87 const char* pa_channel_position_to_string(pa_channel_position_t pos);
88
89 #define PA_CHANNEL_MAP_SNPRINT_MAX 64
90 char* pa_channel_map_snprint(char *s, size_t l, const pa_channel_map *map);
91
92 int pa_channel_map_equal(const pa_channel_map *a, const pa_channel_map *b);
93
94 int pa_channel_map_valid(const pa_channel_map *map);
95
96 PA_C_DECL_END
97
98 #endif