mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
channelmap: add pa_channel_map_has_position()
This commit is contained in:
parent
44e566ade8
commit
a714861cc1
2 changed files with 17 additions and 0 deletions
|
|
@ -839,3 +839,16 @@ const char* pa_channel_map_to_pretty_name(const pa_channel_map *map) {
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int pa_channel_map_has_position(const pa_channel_map *map, pa_channel_position_t p) {
|
||||||
|
unsigned c;
|
||||||
|
|
||||||
|
pa_return_val_if_fail(pa_channel_map_valid(map), 0);
|
||||||
|
pa_return_val_if_fail(p < PA_CHANNEL_POSITION_MAX, 0);
|
||||||
|
|
||||||
|
for (c = 0; c < map->channels; c++)
|
||||||
|
if (map->map[c] == p)
|
||||||
|
return 1;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -325,6 +325,10 @@ mapping. I.e. "Stereo", "Surround 7.1" and so on. If the channel
|
||||||
mapping is unknown NULL will be returned. \since 0.9.15 */
|
mapping is unknown NULL will be returned. \since 0.9.15 */
|
||||||
const char* pa_channel_map_to_pretty_name(const pa_channel_map *map) PA_GCC_PURE;
|
const char* pa_channel_map_to_pretty_name(const pa_channel_map *map) PA_GCC_PURE;
|
||||||
|
|
||||||
|
/** Returns TRUE if the specified channel position is available at
|
||||||
|
* least once in the channel map. \since 0.9.16 */
|
||||||
|
int pa_channel_map_has_position(const pa_channel_map *map, pa_channel_position_t p) PA_GCC_PURE;
|
||||||
|
|
||||||
PA_C_DECL_END
|
PA_C_DECL_END
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue