From 3c9d27c82dd1f51a900a45b4194306b008843295 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Tue, 11 Sep 2001 08:42:15 +0000 Subject: [PATCH] Added snd_pcm_sync_id_t --- include/pcm.h | 11 +++++++++++ src/pcm/pcm.c | 13 +++++++++++++ 2 files changed, 24 insertions(+) diff --git a/include/pcm.h b/include/pcm.h index a46bafd7..c0326374 100644 --- a/include/pcm.h +++ b/include/pcm.h @@ -304,6 +304,16 @@ typedef struct _snd_pcm_channel_area { unsigned int step; } snd_pcm_channel_area_t; +/* PCM synchronization ID */ +typedef union _snd_pcm_sync_id { + /** 8-bit ID */ + unsigned char id[16]; + /** 16-bit ID */ + unsigned short id16[8]; + /** 32-bit ID */ + unsigned int id32[4]; +} snd_pcm_sync_id_t; + /** #SND_PCM_TYPE_METER scope handle */ typedef struct _snd_pcm_scope snd_pcm_scope_t; @@ -743,6 +753,7 @@ snd_pcm_class_t snd_pcm_info_get_class(const snd_pcm_info_t *obj); snd_pcm_subclass_t snd_pcm_info_get_subclass(const snd_pcm_info_t *obj); unsigned int snd_pcm_info_get_subdevices_count(const snd_pcm_info_t *obj); unsigned int snd_pcm_info_get_subdevices_avail(const snd_pcm_info_t *obj); +snd_pcm_sync_id_t snd_pcm_info_get_sync(const snd_pcm_info_t *obj); void snd_pcm_info_set_device(snd_pcm_info_t *obj, unsigned int val); void snd_pcm_info_set_subdevice(snd_pcm_info_t *obj, unsigned int val); void snd_pcm_info_set_stream(snd_pcm_info_t *obj, snd_pcm_stream_t val); diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c index 2a53b234..1c79b766 100644 --- a/src/pcm/pcm.c +++ b/src/pcm/pcm.c @@ -4204,6 +4204,19 @@ unsigned int snd_pcm_info_get_subdevices_avail(const snd_pcm_info_t *obj) return obj->subdevices_avail; } +/** + * \brief Get hardware synchronization ID from a PCM info container + * \param obj PCM info container + * \return hardware synchronization ID + */ +snd_pcm_sync_id_t snd_pcm_info_get_sync(const snd_pcm_info_t *obj) +{ + snd_pcm_sync_id_t res; + assert(obj); + memcpy(&res, &obj->sync, sizeof(res)); + return res; +} + /** * \brief Set wanted device inside a PCM info container (see #snd_ctl_pcm_info) * \param obj PCM info container -- 2.47.1