1 #ifndef foochannelmaphfoo
2 #define foochannelmaphfoo
7 This file is part of polypaudio.
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.
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.
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
25 #include <polyp/sample.h>
26 #include <polyp/cdecl.h>
29 * Constants and routines for channel mapping handling */
34 PA_CHANNEL_POSITION_INVALID
= -1,
35 PA_CHANNEL_POSITION_MONO
= 0,
37 PA_CHANNEL_POSITION_LEFT
,
38 PA_CHANNEL_POSITION_RIGHT
,
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
,
44 PA_CHANNEL_POSITION_REAR_CENTER
,
45 PA_CHANNEL_POSITION_REAR_LEFT
,
46 PA_CHANNEL_POSITION_REAR_RIGHT
,
48 PA_CHANNEL_POSITION_LFE
,
49 PA_CHANNEL_POSITION_SUBWOOFER
= PA_CHANNEL_POSITION_LFE
,
51 PA_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER
,
52 PA_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER
,
54 PA_CHANNEL_POSITION_SIDE_LEFT
,
55 PA_CHANNEL_POSITION_SIDE_RIGHT
,
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
,
74 PA_CHANNEL_POSITION_MAX
75 } pa_channel_position_t
;
77 typedef struct pa_channel_map
{
79 pa_channel_position_t map
[PA_CHANNELS_MAX
];
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
);
87 const char* pa_channel_position_to_string(pa_channel_position_t pos
);
89 #define PA_CHANNEL_MAP_SNPRINT_MAX 64
90 char* pa_channel_map_snprint(char *s
, size_t l
, const pa_channel_map
*map
);
92 int pa_channel_map_equal(const pa_channel_map
*a
, const pa_channel_map
*b
);
94 int pa_channel_map_valid(const pa_channel_map
*map
);