diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-07-25 15:05:15 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-09-11 11:34:50 +0200 |
commit | 3c4a22ea49a881cdbfe2d50eef94b17e38104734 (patch) | |
tree | 6c7faa47907ac3e2d166734e33364cdab93218c4 /include | |
parent | 1ef1c5cdb4301898499c0391cdfac2117c7d4684 (diff) |
Implement the channel mapping API
Added new channel-mapping API functions.
Not all plugins are covered, especially the route, multi and external
plugins don't work yet.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/control.h | 7 | ||||
-rw-r--r-- | include/pcm.h | 12 | ||||
-rw-r--r-- | include/sound/asound.h | 25 |
3 files changed, 44 insertions, 0 deletions
diff --git a/include/control.h b/include/control.h index 488629d9..e8408355 100644 --- a/include/control.h +++ b/include/control.h @@ -182,6 +182,13 @@ typedef enum _snd_ctl_event_type { /** Mute state */ #define SND_CTL_TLV_DB_GAIN_MUTE -9999999 +/** TLV type - fixed channel map positions */ +#define SND_CTL_TLVT_CHMAP_FIXED 0x00101 +/** TLV type - freely swappable channel map positions */ +#define SND_CTL_TLVT_CHMAP_VAR 0x00102 +/** TLV type - pair-wise swappable channel map positions */ +#define SND_CTL_TLVT_CHMAP_PAIRED 0x00103 + /** CTL type */ typedef enum _snd_ctl_type { /** Kernel level CTL */ diff --git a/include/pcm.h b/include/pcm.h index 49975570..c47717b8 100644 --- a/include/pcm.h +++ b/include/pcm.h @@ -474,6 +474,18 @@ int snd_pcm_wait(snd_pcm_t *pcm, int timeout); int snd_pcm_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2); int snd_pcm_unlink(snd_pcm_t *pcm); +enum { + SND_CHMAP_NONE = 0, /** unspecified channel position */ + SND_CHMAP_FIXED, /** fixed channel position */ + SND_CHMAP_VAR, /** freely swappable channel position */ + SND_CHMAP_PAIRED, /** pair-wise swappable channel position */ +}; + +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); + //int snd_pcm_mixer_element(snd_pcm_t *pcm, snd_mixer_t *mixer, snd_mixer_elem_t **elem); /* diff --git a/include/sound/asound.h b/include/sound/asound.h index 07c03faa..e635c99b 100644 --- a/include/sound/asound.h +++ b/include/sound/asound.h @@ -477,6 +477,31 @@ enum { SNDRV_PCM_TSTAMP_TYPE_LAST = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC, }; +/* channel positions */ +enum { + SNDRV_CHMAP_UNKNOWN = 0, + SNDRV_CHMAP_FL, /* front left */ + SNDRV_CHMAP_FC, /* front center */ + SNDRV_CHMAP_FR, /* front right */ + SNDRV_CHMAP_FLC, /* front left center */ + SNDRV_CHMAP_FRC, /* front right center */ + SNDRV_CHMAP_RL, /* rear left */ + SNDRV_CHMAP_RC, /* rear center */ + SNDRV_CHMAP_RR, /* rear right */ + SNDRV_CHMAP_RLC, /* rear left center */ + SNDRV_CHMAP_RRC, /* rear right center */ + SNDRV_CHMAP_SL, /* side left */ + SNDRV_CHMAP_SR, /* side right */ + SNDRV_CHMAP_LFE, /* LFE */ + SNDRV_CHMAP_FLW, /* front left wide */ + SNDRV_CHMAP_FRW, /* front right wide */ + SNDRV_CHMAP_FLH, /* front left high */ + SNDRV_CHMAP_FCH, /* front center high */ + SNDRV_CHMAP_FRH, /* front right high */ + SNDRV_CHMAP_TC, /* top center */ + SNDRV_CHMAP_LAST = SNDRV_CHMAP_TC, +}; + enum { SNDRV_PCM_IOCTL_PVERSION = _IOR('A', 0x00, int), SNDRV_PCM_IOCTL_INFO = _IOR('A', 0x01, struct sndrv_pcm_info), |