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
00070 PA_C_DECL_BEGIN
00071
00073 typedef enum pa_channel_position {
00074 PA_CHANNEL_POSITION_INVALID = -1,
00075 PA_CHANNEL_POSITION_MONO = 0,
00076
00077 PA_CHANNEL_POSITION_LEFT,
00078 PA_CHANNEL_POSITION_RIGHT,
00079 PA_CHANNEL_POSITION_CENTER,
00080
00081 PA_CHANNEL_POSITION_FRONT_LEFT = PA_CHANNEL_POSITION_LEFT,
00082 PA_CHANNEL_POSITION_FRONT_RIGHT = PA_CHANNEL_POSITION_RIGHT,
00083 PA_CHANNEL_POSITION_FRONT_CENTER = PA_CHANNEL_POSITION_CENTER,
00084
00085 PA_CHANNEL_POSITION_REAR_CENTER,
00086 PA_CHANNEL_POSITION_REAR_LEFT,
00087 PA_CHANNEL_POSITION_REAR_RIGHT,
00088
00089 PA_CHANNEL_POSITION_LFE,
00090 PA_CHANNEL_POSITION_SUBWOOFER = PA_CHANNEL_POSITION_LFE,
00091
00092 PA_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER,
00093 PA_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER,
00094
00095 PA_CHANNEL_POSITION_SIDE_LEFT,
00096 PA_CHANNEL_POSITION_SIDE_RIGHT,
00097
00098 PA_CHANNEL_POSITION_AUX0,
00099 PA_CHANNEL_POSITION_AUX1,
00100 PA_CHANNEL_POSITION_AUX2,
00101 PA_CHANNEL_POSITION_AUX3,
00102 PA_CHANNEL_POSITION_AUX4,
00103 PA_CHANNEL_POSITION_AUX5,
00104 PA_CHANNEL_POSITION_AUX6,
00105 PA_CHANNEL_POSITION_AUX7,
00106 PA_CHANNEL_POSITION_AUX8,
00107 PA_CHANNEL_POSITION_AUX9,
00108 PA_CHANNEL_POSITION_AUX10,
00109 PA_CHANNEL_POSITION_AUX11,
00110 PA_CHANNEL_POSITION_AUX12,
00111 PA_CHANNEL_POSITION_AUX13,
00112 PA_CHANNEL_POSITION_AUX14,
00113 PA_CHANNEL_POSITION_AUX15,
00114 PA_CHANNEL_POSITION_AUX16,
00115 PA_CHANNEL_POSITION_AUX17,
00116 PA_CHANNEL_POSITION_AUX18,
00117 PA_CHANNEL_POSITION_AUX19,
00118 PA_CHANNEL_POSITION_AUX20,
00119 PA_CHANNEL_POSITION_AUX21,
00120 PA_CHANNEL_POSITION_AUX22,
00121 PA_CHANNEL_POSITION_AUX23,
00122 PA_CHANNEL_POSITION_AUX24,
00123 PA_CHANNEL_POSITION_AUX25,
00124 PA_CHANNEL_POSITION_AUX26,
00125 PA_CHANNEL_POSITION_AUX27,
00126 PA_CHANNEL_POSITION_AUX28,
00127 PA_CHANNEL_POSITION_AUX29,
00128 PA_CHANNEL_POSITION_AUX30,
00129 PA_CHANNEL_POSITION_AUX31,
00130
00131 PA_CHANNEL_POSITION_TOP_CENTER,
00132
00133 PA_CHANNEL_POSITION_TOP_FRONT_LEFT,
00134 PA_CHANNEL_POSITION_TOP_FRONT_RIGHT,
00135 PA_CHANNEL_POSITION_TOP_FRONT_CENTER,
00136
00137 PA_CHANNEL_POSITION_TOP_REAR_LEFT,
00138 PA_CHANNEL_POSITION_TOP_REAR_RIGHT,
00139 PA_CHANNEL_POSITION_TOP_REAR_CENTER,
00140
00141 PA_CHANNEL_POSITION_MAX
00142 } pa_channel_position_t;
00143
00145 #define PA_CHANNEL_POSITION_INVALID PA_CHANNEL_POSITION_INVALID
00146 #define PA_CHANNEL_POSITION_MONO PA_CHANNEL_POSITION_MONO
00147 #define PA_CHANNEL_POSITION_LEFT PA_CHANNEL_POSITION_LEFT
00148 #define PA_CHANNEL_POSITION_RIGHT PA_CHANNEL_POSITION_RIGHT
00149 #define PA_CHANNEL_POSITION_CENTER PA_CHANNEL_POSITION_CENTER
00150 #define PA_CHANNEL_POSITION_FRONT_LEFT PA_CHANNEL_POSITION_FRONT_LEFT
00151 #define PA_CHANNEL_POSITION_FRONT_RIGHT PA_CHANNEL_POSITION_FRONT_RIGHT
00152 #define PA_CHANNEL_POSITION_FRONT_CENTER PA_CHANNEL_POSITION_FRONT_CENTER
00153 #define PA_CHANNEL_POSITION_REAR_CENTER PA_CHANNEL_POSITION_REAR_CENTER
00154 #define PA_CHANNEL_POSITION_REAR_LEFT PA_CHANNEL_POSITION_REAR_LEFT
00155 #define PA_CHANNEL_POSITION_REAR_RIGHT PA_CHANNEL_POSITION_REAR_RIGHT
00156 #define PA_CHANNEL_POSITION_LFE PA_CHANNEL_POSITION_LFE
00157 #define PA_CHANNEL_POSITION_SUBWOOFER PA_CHANNEL_POSITION_SUBWOOFER
00158 #define PA_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER PA_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER
00159 #define PA_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER PA_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER
00160 #define PA_CHANNEL_POSITION_SIDE_LEFT PA_CHANNEL_POSITION_SIDE_LEFT
00161 #define PA_CHANNEL_POSITION_SIDE_RIGHT PA_CHANNEL_POSITION_SIDE_RIGHT
00162 #define PA_CHANNEL_POSITION_AUX0 PA_CHANNEL_POSITION_AUX0
00163 #define PA_CHANNEL_POSITION_AUX1 PA_CHANNEL_POSITION_AUX1
00164 #define PA_CHANNEL_POSITION_AUX2 PA_CHANNEL_POSITION_AUX2
00165 #define PA_CHANNEL_POSITION_AUX3 PA_CHANNEL_POSITION_AUX3
00166 #define PA_CHANNEL_POSITION_AUX4 PA_CHANNEL_POSITION_AUX4
00167 #define PA_CHANNEL_POSITION_AUX5 PA_CHANNEL_POSITION_AUX5
00168 #define PA_CHANNEL_POSITION_AUX6 PA_CHANNEL_POSITION_AUX6
00169 #define PA_CHANNEL_POSITION_AUX7 PA_CHANNEL_POSITION_AUX7
00170 #define PA_CHANNEL_POSITION_AUX8 PA_CHANNEL_POSITION_AUX8
00171 #define PA_CHANNEL_POSITION_AUX9 PA_CHANNEL_POSITION_AUX9
00172 #define PA_CHANNEL_POSITION_AUX10 PA_CHANNEL_POSITION_AUX10
00173 #define PA_CHANNEL_POSITION_AUX11 PA_CHANNEL_POSITION_AUX11
00174 #define PA_CHANNEL_POSITION_AUX12 PA_CHANNEL_POSITION_AUX12
00175 #define PA_CHANNEL_POSITION_AUX13 PA_CHANNEL_POSITION_AUX13
00176 #define PA_CHANNEL_POSITION_AUX14 PA_CHANNEL_POSITION_AUX14
00177 #define PA_CHANNEL_POSITION_AUX15 PA_CHANNEL_POSITION_AUX15
00178 #define PA_CHANNEL_POSITION_AUX16 PA_CHANNEL_POSITION_AUX16
00179 #define PA_CHANNEL_POSITION_AUX17 PA_CHANNEL_POSITION_AUX17
00180 #define PA_CHANNEL_POSITION_AUX18 PA_CHANNEL_POSITION_AUX18
00181 #define PA_CHANNEL_POSITION_AUX19 PA_CHANNEL_POSITION_AUX19
00182 #define PA_CHANNEL_POSITION_AUX20 PA_CHANNEL_POSITION_AUX20
00183 #define PA_CHANNEL_POSITION_AUX21 PA_CHANNEL_POSITION_AUX21
00184 #define PA_CHANNEL_POSITION_AUX22 PA_CHANNEL_POSITION_AUX22
00185 #define PA_CHANNEL_POSITION_AUX23 PA_CHANNEL_POSITION_AUX23
00186 #define PA_CHANNEL_POSITION_AUX24 PA_CHANNEL_POSITION_AUX24
00187 #define PA_CHANNEL_POSITION_AUX25 PA_CHANNEL_POSITION_AUX25
00188 #define PA_CHANNEL_POSITION_AUX26 PA_CHANNEL_POSITION_AUX26
00189 #define PA_CHANNEL_POSITION_AUX27 PA_CHANNEL_POSITION_AUX27
00190 #define PA_CHANNEL_POSITION_AUX28 PA_CHANNEL_POSITION_AUX28
00191 #define PA_CHANNEL_POSITION_AUX29 PA_CHANNEL_POSITION_AUX29
00192 #define PA_CHANNEL_POSITION_AUX30 PA_CHANNEL_POSITION_AUX30
00193 #define PA_CHANNEL_POSITION_AUX31 PA_CHANNEL_POSITION_AUX31
00194 #define PA_CHANNEL_POSITION_TOP_CENTER PA_CHANNEL_POSITION_TOP_CENTER
00195 #define PA_CHANNEL_POSITION_TOP_FRONT_LEFT PA_CHANNEL_POSITION_TOP_FRONT_LEFT
00196 #define PA_CHANNEL_POSITION_TOP_FRONT_RIGHT PA_CHANNEL_POSITION_TOP_FRONT_RIGHT
00197 #define PA_CHANNEL_POSITION_TOP_FRONT_CENTER PA_CHANNEL_POSITION_TOP_FRONT_CENTER
00198 #define PA_CHANNEL_POSITION_TOP_REAR_LEFT PA_CHANNEL_POSITION_TOP_REAR_LEFT
00199 #define PA_CHANNEL_POSITION_TOP_REAR_RIGHT PA_CHANNEL_POSITION_TOP_REAR_RIGHT
00200 #define PA_CHANNEL_POSITION_TOP_REAR_CENTER PA_CHANNEL_POSITION_TOP_REAR_CENTER
00201 #define PA_CHANNEL_POSITION_MAX PA_CHANNEL_POSITION_MAX
00202
00205 typedef enum pa_channel_map_def {
00206 PA_CHANNEL_MAP_AIFF,
00209 PA_CHANNEL_MAP_ALSA,
00212 PA_CHANNEL_MAP_AUX,
00215 PA_CHANNEL_MAP_WAVEEX,
00218 PA_CHANNEL_MAP_OSS,
00222 PA_CHANNEL_MAP_DEF_MAX,
00223
00224 PA_CHANNEL_MAP_DEFAULT = PA_CHANNEL_MAP_AIFF
00226 } pa_channel_map_def_t;
00227
00229 #define PA_CHANNEL_MAP_AIFF PA_CHANNEL_MAP_AIFF
00230 #define PA_CHANNEL_MAP_ALSA PA_CHANNEL_MAP_ALSA
00231 #define PA_CHANNEL_MAP_AUX PA_CHANNEL_MAP_AUX
00232 #define PA_CHANNEL_MAP_WAVEEX PA_CHANNEL_MAP_WAVEEX
00233 #define PA_CHANNEL_MAP_OSS PA_CHANNEL_MAP_OSS
00234 #define PA_CHANNEL_MAP_DEF_MAX PA_CHANNEL_MAP_DEF_MAX
00235 #define PA_CHANNEL_MAP_DEFAULT PA_CHANNEL_MAP_DEFAULT
00236
00241 typedef struct pa_channel_map {
00242 uint8_t channels;
00245 pa_channel_position_t map[PA_CHANNELS_MAX];
00247 } pa_channel_map;
00248
00252 pa_channel_map* pa_channel_map_init(pa_channel_map *m);
00253
00255 pa_channel_map* pa_channel_map_init_mono(pa_channel_map *m);
00256
00258 pa_channel_map* pa_channel_map_init_stereo(pa_channel_map *m);
00259
00264 pa_channel_map* pa_channel_map_init_auto(pa_channel_map *m, unsigned channels, pa_channel_map_def_t def);
00265
00270 pa_channel_map* pa_channel_map_init_extend(pa_channel_map *m, unsigned channels, pa_channel_map_def_t def);
00271
00273 const char* pa_channel_position_to_string(pa_channel_position_t pos) PA_GCC_PURE;
00274
00276 const char* pa_channel_position_to_pretty_string(pa_channel_position_t pos);
00277
00283 #define PA_CHANNEL_MAP_SNPRINT_MAX 336
00284
00286 char* pa_channel_map_snprint(char *s, size_t l, const pa_channel_map *map);
00287
00292 pa_channel_map *pa_channel_map_parse(pa_channel_map *map, const char *s);
00293
00295 int pa_channel_map_equal(const pa_channel_map *a, const pa_channel_map *b) PA_GCC_PURE;
00296
00298 int pa_channel_map_valid(const pa_channel_map *map) PA_GCC_PURE;
00299
00302 int pa_channel_map_compatible(const pa_channel_map *map, const pa_sample_spec *ss) PA_GCC_PURE;
00303
00305 int pa_channel_map_superset(const pa_channel_map *a, const pa_channel_map *b) PA_GCC_PURE;
00306
00310 int pa_channel_map_can_balance(const pa_channel_map *map) PA_GCC_PURE;
00311
00315 int pa_channel_map_can_fade(const pa_channel_map *map) PA_GCC_PURE;
00316
00321 const char* pa_channel_map_to_name(const pa_channel_map *map) PA_GCC_PURE;
00322
00326 const char* pa_channel_map_to_pretty_name(const pa_channel_map *map) PA_GCC_PURE;
00327
00328 PA_C_DECL_END
00329
00330 #endif