00001 #ifndef foochannelmaphfoo
00002 #define foochannelmaphfoo
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include <pulse/sample.h>
00027 #include <pulse/cdecl.h>
00028 #include <pulse/gccmacro.h>
00029 #include <pulse/version.h>
00030
00073 PA_C_DECL_BEGIN
00074
00076 typedef enum pa_channel_position {
00077 PA_CHANNEL_POSITION_INVALID = -1,
00078 PA_CHANNEL_POSITION_MONO = 0,
00079
00080 PA_CHANNEL_POSITION_FRONT_LEFT,
00081 PA_CHANNEL_POSITION_FRONT_RIGHT,
00082 PA_CHANNEL_POSITION_FRONT_CENTER,
00083
00085 PA_CHANNEL_POSITION_LEFT = PA_CHANNEL_POSITION_FRONT_LEFT,
00086 PA_CHANNEL_POSITION_RIGHT = PA_CHANNEL_POSITION_FRONT_RIGHT,
00087 PA_CHANNEL_POSITION_CENTER = PA_CHANNEL_POSITION_FRONT_CENTER,
00090 PA_CHANNEL_POSITION_REAR_CENTER,
00091 PA_CHANNEL_POSITION_REAR_LEFT,
00092 PA_CHANNEL_POSITION_REAR_RIGHT,
00093
00094 PA_CHANNEL_POSITION_LFE,
00096 PA_CHANNEL_POSITION_SUBWOOFER = PA_CHANNEL_POSITION_LFE,
00099 PA_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER,
00100 PA_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER,
00101
00102 PA_CHANNEL_POSITION_SIDE_LEFT,
00103 PA_CHANNEL_POSITION_SIDE_RIGHT,
00104
00105 PA_CHANNEL_POSITION_AUX0,
00106 PA_CHANNEL_POSITION_AUX1,
00107 PA_CHANNEL_POSITION_AUX2,
00108 PA_CHANNEL_POSITION_AUX3,
00109 PA_CHANNEL_POSITION_AUX4,
00110 PA_CHANNEL_POSITION_AUX5,
00111 PA_CHANNEL_POSITION_AUX6,
00112 PA_CHANNEL_POSITION_AUX7,
00113 PA_CHANNEL_POSITION_AUX8,
00114 PA_CHANNEL_POSITION_AUX9,
00115 PA_CHANNEL_POSITION_AUX10,
00116 PA_CHANNEL_POSITION_AUX11,
00117 PA_CHANNEL_POSITION_AUX12,
00118 PA_CHANNEL_POSITION_AUX13,
00119 PA_CHANNEL_POSITION_AUX14,
00120 PA_CHANNEL_POSITION_AUX15,
00121 PA_CHANNEL_POSITION_AUX16,
00122 PA_CHANNEL_POSITION_AUX17,
00123 PA_CHANNEL_POSITION_AUX18,
00124 PA_CHANNEL_POSITION_AUX19,
00125 PA_CHANNEL_POSITION_AUX20,
00126 PA_CHANNEL_POSITION_AUX21,
00127 PA_CHANNEL_POSITION_AUX22,
00128 PA_CHANNEL_POSITION_AUX23,
00129 PA_CHANNEL_POSITION_AUX24,
00130 PA_CHANNEL_POSITION_AUX25,
00131 PA_CHANNEL_POSITION_AUX26,
00132 PA_CHANNEL_POSITION_AUX27,
00133 PA_CHANNEL_POSITION_AUX28,
00134 PA_CHANNEL_POSITION_AUX29,
00135 PA_CHANNEL_POSITION_AUX30,
00136 PA_CHANNEL_POSITION_AUX31,
00137
00138 PA_CHANNEL_POSITION_TOP_CENTER,
00139
00140 PA_CHANNEL_POSITION_TOP_FRONT_LEFT,
00141 PA_CHANNEL_POSITION_TOP_FRONT_RIGHT,
00142 PA_CHANNEL_POSITION_TOP_FRONT_CENTER,
00143
00144 PA_CHANNEL_POSITION_TOP_REAR_LEFT,
00145 PA_CHANNEL_POSITION_TOP_REAR_RIGHT,
00146 PA_CHANNEL_POSITION_TOP_REAR_CENTER,
00147
00148 PA_CHANNEL_POSITION_MAX
00149 } pa_channel_position_t;
00150
00152 #define PA_CHANNEL_POSITION_INVALID PA_CHANNEL_POSITION_INVALID
00153 #define PA_CHANNEL_POSITION_MONO PA_CHANNEL_POSITION_MONO
00154 #define PA_CHANNEL_POSITION_LEFT PA_CHANNEL_POSITION_LEFT
00155 #define PA_CHANNEL_POSITION_RIGHT PA_CHANNEL_POSITION_RIGHT
00156 #define PA_CHANNEL_POSITION_CENTER PA_CHANNEL_POSITION_CENTER
00157 #define PA_CHANNEL_POSITION_FRONT_LEFT PA_CHANNEL_POSITION_FRONT_LEFT
00158 #define PA_CHANNEL_POSITION_FRONT_RIGHT PA_CHANNEL_POSITION_FRONT_RIGHT
00159 #define PA_CHANNEL_POSITION_FRONT_CENTER PA_CHANNEL_POSITION_FRONT_CENTER
00160 #define PA_CHANNEL_POSITION_REAR_CENTER PA_CHANNEL_POSITION_REAR_CENTER
00161 #define PA_CHANNEL_POSITION_REAR_LEFT PA_CHANNEL_POSITION_REAR_LEFT
00162 #define PA_CHANNEL_POSITION_REAR_RIGHT PA_CHANNEL_POSITION_REAR_RIGHT
00163 #define PA_CHANNEL_POSITION_LFE PA_CHANNEL_POSITION_LFE
00164 #define PA_CHANNEL_POSITION_SUBWOOFER PA_CHANNEL_POSITION_SUBWOOFER
00165 #define PA_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER PA_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER
00166 #define PA_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER PA_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER
00167 #define PA_CHANNEL_POSITION_SIDE_LEFT PA_CHANNEL_POSITION_SIDE_LEFT
00168 #define PA_CHANNEL_POSITION_SIDE_RIGHT PA_CHANNEL_POSITION_SIDE_RIGHT
00169 #define PA_CHANNEL_POSITION_AUX0 PA_CHANNEL_POSITION_AUX0
00170 #define PA_CHANNEL_POSITION_AUX1 PA_CHANNEL_POSITION_AUX1
00171 #define PA_CHANNEL_POSITION_AUX2 PA_CHANNEL_POSITION_AUX2
00172 #define PA_CHANNEL_POSITION_AUX3 PA_CHANNEL_POSITION_AUX3
00173 #define PA_CHANNEL_POSITION_AUX4 PA_CHANNEL_POSITION_AUX4
00174 #define PA_CHANNEL_POSITION_AUX5 PA_CHANNEL_POSITION_AUX5
00175 #define PA_CHANNEL_POSITION_AUX6 PA_CHANNEL_POSITION_AUX6
00176 #define PA_CHANNEL_POSITION_AUX7 PA_CHANNEL_POSITION_AUX7
00177 #define PA_CHANNEL_POSITION_AUX8 PA_CHANNEL_POSITION_AUX8
00178 #define PA_CHANNEL_POSITION_AUX9 PA_CHANNEL_POSITION_AUX9
00179 #define PA_CHANNEL_POSITION_AUX10 PA_CHANNEL_POSITION_AUX10
00180 #define PA_CHANNEL_POSITION_AUX11 PA_CHANNEL_POSITION_AUX11
00181 #define PA_CHANNEL_POSITION_AUX12 PA_CHANNEL_POSITION_AUX12
00182 #define PA_CHANNEL_POSITION_AUX13 PA_CHANNEL_POSITION_AUX13
00183 #define PA_CHANNEL_POSITION_AUX14 PA_CHANNEL_POSITION_AUX14
00184 #define PA_CHANNEL_POSITION_AUX15 PA_CHANNEL_POSITION_AUX15
00185 #define PA_CHANNEL_POSITION_AUX16 PA_CHANNEL_POSITION_AUX16
00186 #define PA_CHANNEL_POSITION_AUX17 PA_CHANNEL_POSITION_AUX17
00187 #define PA_CHANNEL_POSITION_AUX18 PA_CHANNEL_POSITION_AUX18
00188 #define PA_CHANNEL_POSITION_AUX19 PA_CHANNEL_POSITION_AUX19
00189 #define PA_CHANNEL_POSITION_AUX20 PA_CHANNEL_POSITION_AUX20
00190 #define PA_CHANNEL_POSITION_AUX21 PA_CHANNEL_POSITION_AUX21
00191 #define PA_CHANNEL_POSITION_AUX22 PA_CHANNEL_POSITION_AUX22
00192 #define PA_CHANNEL_POSITION_AUX23 PA_CHANNEL_POSITION_AUX23
00193 #define PA_CHANNEL_POSITION_AUX24 PA_CHANNEL_POSITION_AUX24
00194 #define PA_CHANNEL_POSITION_AUX25 PA_CHANNEL_POSITION_AUX25
00195 #define PA_CHANNEL_POSITION_AUX26 PA_CHANNEL_POSITION_AUX26
00196 #define PA_CHANNEL_POSITION_AUX27 PA_CHANNEL_POSITION_AUX27
00197 #define PA_CHANNEL_POSITION_AUX28 PA_CHANNEL_POSITION_AUX28
00198 #define PA_CHANNEL_POSITION_AUX29 PA_CHANNEL_POSITION_AUX29
00199 #define PA_CHANNEL_POSITION_AUX30 PA_CHANNEL_POSITION_AUX30
00200 #define PA_CHANNEL_POSITION_AUX31 PA_CHANNEL_POSITION_AUX31
00201 #define PA_CHANNEL_POSITION_TOP_CENTER PA_CHANNEL_POSITION_TOP_CENTER
00202 #define PA_CHANNEL_POSITION_TOP_FRONT_LEFT PA_CHANNEL_POSITION_TOP_FRONT_LEFT
00203 #define PA_CHANNEL_POSITION_TOP_FRONT_RIGHT PA_CHANNEL_POSITION_TOP_FRONT_RIGHT
00204 #define PA_CHANNEL_POSITION_TOP_FRONT_CENTER PA_CHANNEL_POSITION_TOP_FRONT_CENTER
00205 #define PA_CHANNEL_POSITION_TOP_REAR_LEFT PA_CHANNEL_POSITION_TOP_REAR_LEFT
00206 #define PA_CHANNEL_POSITION_TOP_REAR_RIGHT PA_CHANNEL_POSITION_TOP_REAR_RIGHT
00207 #define PA_CHANNEL_POSITION_TOP_REAR_CENTER PA_CHANNEL_POSITION_TOP_REAR_CENTER
00208 #define PA_CHANNEL_POSITION_MAX PA_CHANNEL_POSITION_MAX
00209
00212 typedef uint64_t pa_channel_position_mask_t;
00213
00215 #define PA_CHANNEL_POSITION_MASK(f) ((pa_channel_position_mask_t) (1ULL << (f)))
00216
00218 typedef enum pa_channel_map_def {
00219 PA_CHANNEL_MAP_AIFF,
00223 PA_CHANNEL_MAP_ALSA,
00229 PA_CHANNEL_MAP_AUX,
00232 PA_CHANNEL_MAP_WAVEEX,
00237 PA_CHANNEL_MAP_OSS,
00245 PA_CHANNEL_MAP_DEF_MAX,
00246
00247 PA_CHANNEL_MAP_DEFAULT = PA_CHANNEL_MAP_AIFF
00249 } pa_channel_map_def_t;
00250
00252 #define PA_CHANNEL_MAP_AIFF PA_CHANNEL_MAP_AIFF
00253 #define PA_CHANNEL_MAP_ALSA PA_CHANNEL_MAP_ALSA
00254 #define PA_CHANNEL_MAP_AUX PA_CHANNEL_MAP_AUX
00255 #define PA_CHANNEL_MAP_WAVEEX PA_CHANNEL_MAP_WAVEEX
00256 #define PA_CHANNEL_MAP_OSS PA_CHANNEL_MAP_OSS
00257 #define PA_CHANNEL_MAP_DEF_MAX PA_CHANNEL_MAP_DEF_MAX
00258 #define PA_CHANNEL_MAP_DEFAULT PA_CHANNEL_MAP_DEFAULT
00259
00264 typedef struct pa_channel_map {
00265 uint8_t channels;
00268 pa_channel_position_t map[PA_CHANNELS_MAX];
00270 } pa_channel_map;
00271
00275 pa_channel_map* pa_channel_map_init(pa_channel_map *m);
00276
00278 pa_channel_map* pa_channel_map_init_mono(pa_channel_map *m);
00279
00281 pa_channel_map* pa_channel_map_init_stereo(pa_channel_map *m);
00282
00287 pa_channel_map* pa_channel_map_init_auto(pa_channel_map *m, unsigned channels, pa_channel_map_def_t def);
00288
00293 pa_channel_map* pa_channel_map_init_extend(pa_channel_map *m, unsigned channels, pa_channel_map_def_t def);
00294
00296 const char* pa_channel_position_to_string(pa_channel_position_t pos) PA_GCC_PURE;
00297
00299 pa_channel_position_t pa_channel_position_from_string(const char *s) PA_GCC_PURE;
00300
00302 const char* pa_channel_position_to_pretty_string(pa_channel_position_t pos);
00303
00309 #define PA_CHANNEL_MAP_SNPRINT_MAX 336
00310
00312 char* pa_channel_map_snprint(char *s, size_t l, const pa_channel_map *map);
00313
00318 pa_channel_map *pa_channel_map_parse(pa_channel_map *map, const char *s);
00319
00321 int pa_channel_map_equal(const pa_channel_map *a, const pa_channel_map *b) PA_GCC_PURE;
00322
00324 int pa_channel_map_valid(const pa_channel_map *map) PA_GCC_PURE;
00325
00328 int pa_channel_map_compatible(const pa_channel_map *map, const pa_sample_spec *ss) PA_GCC_PURE;
00329
00331 int pa_channel_map_superset(const pa_channel_map *a, const pa_channel_map *b) PA_GCC_PURE;
00332
00336 int pa_channel_map_can_balance(const pa_channel_map *map) PA_GCC_PURE;
00337
00341 int pa_channel_map_can_fade(const pa_channel_map *map) PA_GCC_PURE;
00342
00347 const char* pa_channel_map_to_name(const pa_channel_map *map) PA_GCC_PURE;
00348
00352 const char* pa_channel_map_to_pretty_name(const pa_channel_map *map) PA_GCC_PURE;
00353
00356 int pa_channel_map_has_position(const pa_channel_map *map, pa_channel_position_t p) PA_GCC_PURE;
00357
00359 pa_channel_position_mask_t pa_channel_map_mask(const pa_channel_map *map) PA_GCC_PURE;
00360
00361 PA_C_DECL_END
00362
00363 #endif