aboutsummaryrefslogtreecommitdiff
path: root/include/pcm.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-09-04 17:26:43 +0200
committerTakashi Iwai <tiwai@suse.de>2012-09-13 08:24:58 +0200
commit9c1a0ce72d71e4728d45dcd3986dd0ef0201dd67 (patch)
treed445450be37f70e28f5bf728d3353dae06def40b /include/pcm.h
parent48c2c90f19f07d02082d9fb84fb36ac1fcfa84e1 (diff)
PCM: Introduce snd_pcm_chmap_t and snd_pcm_chmap_query_t
Instead of passing ambiguous integer array, define snd_pcm_chmap_t and snd_pcm_chmap_query_t so that user can understand more easily which element is for what. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'include/pcm.h')
-rw-r--r--include/pcm.h21
1 files changed, 17 insertions, 4 deletions
diff --git a/include/pcm.h b/include/pcm.h
index ee89a7ea..ba72a497 100644
--- a/include/pcm.h
+++ b/include/pcm.h
@@ -512,10 +512,23 @@ enum snd_pcm_chmap_position {
#define SND_CHMAP_PHASE_INVERSE (0x01 << 16) /* the channel is phase inverted */
#define SND_CHMAP_DRIVER_SPEC (0x02 << 16) /* non-standard channel value */
-int **snd_pcm_query_chmaps(snd_pcm_t *pcm);
-void snd_pcm_free_chmaps(int **maps);
-int *snd_pcm_get_chmap(snd_pcm_t *pcm);
-int snd_pcm_set_chmap(snd_pcm_t *pcm, const int *map);
+/** the channel map header */
+typedef struct snd_pcm_chmap {
+ unsigned int channels;
+ unsigned int pos[0];
+} snd_pcm_chmap_t;
+
+/** the header of array items returned from snd_pcm_query_chmaps() */
+typedef struct snd_pcm_chmap_query {
+ enum snd_pcm_chmap_type type;
+ snd_pcm_chmap_t map;
+} snd_pcm_chmap_query_t;
+
+
+snd_pcm_chmap_query_t **snd_pcm_query_chmaps(snd_pcm_t *pcm);
+void snd_pcm_free_chmaps(snd_pcm_chmap_query_t **maps);
+snd_pcm_chmap_t *snd_pcm_get_chmap(snd_pcm_t *pcm);
+int snd_pcm_set_chmap(snd_pcm_t *pcm, const snd_pcm_chmap_t *map);
//int snd_pcm_mixer_element(snd_pcm_t *pcm, snd_mixer_t *mixer, snd_mixer_elem_t **elem);