]> code.delx.au - pulseaudio/blob - src/polyp/channelmap.h
* drop polylib prefix from #define
[pulseaudio] / src / 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 PA_CHANNEL_POSITION_CENTER,
40
41 PA_CHANNEL_POSITION_FRONT_LEFT = PA_CHANNEL_POSITION_LEFT,
42 PA_CHANNEL_POSITION_FRONT_RIGHT = PA_CHANNEL_POSITION_RIGHT,
43 PA_CHANNEL_POSITION_FRONT_CENTER = PA_CHANNEL_POSITION_CENTER,
44
45 PA_CHANNEL_POSITION_REAR_CENTER,
46 PA_CHANNEL_POSITION_REAR_LEFT,
47 PA_CHANNEL_POSITION_REAR_RIGHT,
48
49 PA_CHANNEL_POSITION_LFE,
50 PA_CHANNEL_POSITION_SUBWOOFER = PA_CHANNEL_POSITION_LFE,
51
52 PA_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER,
53 PA_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER,
54
55 PA_CHANNEL_POSITION_SIDE_LEFT,
56 PA_CHANNEL_POSITION_SIDE_RIGHT,
57
58 PA_CHANNEL_POSITION_AUX0,
59 PA_CHANNEL_POSITION_AUX1,
60 PA_CHANNEL_POSITION_AUX2,
61 PA_CHANNEL_POSITION_AUX3,
62 PA_CHANNEL_POSITION_AUX4,
63 PA_CHANNEL_POSITION_AUX5,
64 PA_CHANNEL_POSITION_AUX6,
65 PA_CHANNEL_POSITION_AUX7,
66 PA_CHANNEL_POSITION_AUX8,
67 PA_CHANNEL_POSITION_AUX9,
68 PA_CHANNEL_POSITION_AUX10,
69 PA_CHANNEL_POSITION_AUX11,
70 PA_CHANNEL_POSITION_AUX12,
71 PA_CHANNEL_POSITION_AUX13,
72 PA_CHANNEL_POSITION_AUX14,
73 PA_CHANNEL_POSITION_AUX15,
74
75 PA_CHANNEL_POSITION_MAX
76 } pa_channel_position_t;
77
78 typedef struct pa_channel_map {
79 uint8_t channels;
80 pa_channel_position_t map[PA_CHANNELS_MAX];
81 } pa_channel_map;
82
83 pa_channel_map* pa_channel_map_init(pa_channel_map *m);
84 pa_channel_map* pa_channel_map_init_mono(pa_channel_map *m);
85 pa_channel_map* pa_channel_map_init_stereo(pa_channel_map *m);
86 pa_channel_map* pa_channel_map_init_auto(pa_channel_map *m, unsigned channels);
87
88 const char* pa_channel_position_to_string(pa_channel_position_t pos);
89
90 #define PA_CHANNEL_MAP_SNPRINT_MAX 64
91 char* pa_channel_map_snprint(char *s, size_t l, const pa_channel_map *map);
92
93 int pa_channel_map_equal(const pa_channel_map *a, const pa_channel_map *b);
94
95 int pa_channel_map_valid(const pa_channel_map *map);
96
97 PA_C_DECL_END
98
99 #endif