From: Abramo Bagnara Date: Thu, 29 Mar 2001 11:18:16 +0000 (+0000) Subject: Name cleaning for hwdep and timer API X-Git-Tag: v1.0.3~903 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=ee6d9f1bbdf175d248d749ec81831149295ac801;p=alsa-lib.git Name cleaning for hwdep and timer API --- diff --git a/include/hwdep.h b/include/hwdep.h index 2f97369a..4fc0128a 100644 --- a/include/hwdep.h +++ b/include/hwdep.h @@ -8,16 +8,16 @@ /** HwDep information container */ typedef struct _snd_hwdep_info snd_hwdep_info_t; -typedef enum _snd_hwdep_type { - SND_HWDEP_TYPE_OPL2 = SNDRV_HWDEP_TYPE_OPL2, - SND_HWDEP_TYPE_OPL3 = SNDRV_HWDEP_TYPE_OPL3, - SND_HWDEP_TYPE_OPL4 = SNDRV_HWDEP_TYPE_OPL4, - SND_HWDEP_TYPE_SB16CSP = SNDRV_HWDEP_TYPE_SB16CSP, - SND_HWDEP_TYPE_EMU10K1 = SNDRV_HWDEP_TYPE_EMU10K1, - SND_HWDEP_TYPE_YSS225 = SNDRV_HWDEP_TYPE_YSS225, - SND_HWDEP_TYPE_ICS2115 = SNDRV_HWDEP_TYPE_ICS2115, - SND_HWDEP_TYPE_LAST = SNDRV_HWDEP_TYPE_LAST, -} snd_hwdep_type_t; +typedef enum _snd_hwdep_iface { + SND_HWDEP_IFACE_OPL2 = SNDRV_HWDEP_IFACE_OPL2, + SND_HWDEP_IFACE_OPL3 = SNDRV_HWDEP_IFACE_OPL3, + SND_HWDEP_IFACE_OPL4 = SNDRV_HWDEP_IFACE_OPL4, + SND_HWDEP_IFACE_SB16CSP = SNDRV_HWDEP_IFACE_SB16CSP, + SND_HWDEP_IFACE_EMU10K1 = SNDRV_HWDEP_IFACE_EMU10K1, + SND_HWDEP_IFACE_YSS225 = SNDRV_HWDEP_IFACE_YSS225, + SND_HWDEP_IFACE_ICS2115 = SNDRV_HWDEP_IFACE_ICS2115, + SND_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_LAST, +} snd_hwdep_iface_t; #define SND_HWDEP_OPEN_READ (O_RDONLY) #define SND_HWDEP_OPEN_WRITE (O_WRONLY) diff --git a/include/hwdep_m4.h b/include/hwdep_m4.h index 129ff5db..8b08240f 100644 --- a/include/hwdep_m4.h +++ b/include/hwdep_m4.h @@ -16,7 +16,7 @@ const char *snd_hwdep_info_get_id(const snd_hwdep_info_t *obj); const char *snd_hwdep_info_get_name(const snd_hwdep_info_t *obj); -snd_hwdep_type_t snd_hwdep_info_get_type(const snd_hwdep_info_t *obj); +snd_hwdep_iface_t snd_hwdep_info_get_iface(const snd_hwdep_info_t *obj); void snd_hwdep_info_set_device(snd_hwdep_info_t *obj, unsigned int val); diff --git a/include/timer.h b/include/timer.h index aa80e4d2..c9b64958 100644 --- a/include/timer.h +++ b/include/timer.h @@ -12,22 +12,22 @@ typedef struct sndrv_timer_params snd_timer_params_t; typedef struct sndrv_timer_status snd_timer_status_t; typedef struct sndrv_timer_read snd_timer_read_t; -typedef enum _snd_timer_type { - SND_TIMER_TYPE_NONE = SNDRV_TIMER_TYPE_NONE, - SND_TIMER_TYPE_SLAVE = SNDRV_TIMER_TYPE_SLAVE, - SND_TIMER_TYPE_GLOBAL = SNDRV_TIMER_TYPE_GLOBAL, - SND_TIMER_TYPE_CARD = SNDRV_TIMER_TYPE_CARD, - SND_TIMER_TYPE_PCM = SNDRV_TIMER_TYPE_PCM, - SND_TIMER_TYPE_LAST = SNDRV_TIMER_TYPE_LAST, -} snd_timer_type_t; +typedef enum _snd_timer_class { + SND_TIMER_CLASS_NONE = SNDRV_TIMER_CLASS_NONE, + SND_TIMER_CLASS_SLAVE = SNDRV_TIMER_CLASS_SLAVE, + SND_TIMER_CLASS_GLOBAL = SNDRV_TIMER_CLASS_GLOBAL, + SND_TIMER_CLASS_CARD = SNDRV_TIMER_CLASS_CARD, + SND_TIMER_CLASS_PCM = SNDRV_TIMER_CLASS_PCM, + SND_TIMER_CLASS_LAST = SNDRV_TIMER_CLASS_LAST, +} snd_timer_class_t; -typedef enum _snd_timer_slave_type { - SND_TIMER_STYPE_NONE = SNDRV_TIMER_STYPE_NONE, - SND_TIMER_STYPE_APPLICATION = SNDRV_TIMER_STYPE_APPLICATION, - SND_TIMER_STYPE_SEQUENCER = SNDRV_TIMER_STYPE_SEQUENCER, - SND_TIMER_STYPE_OSS_SEQUENCER = SNDRV_TIMER_STYPE_OSS_SEQUENCER, - SND_TIMER_STYPE_LAST = SNDRV_TIMER_STYPE_LAST, -} snd_timer_slave_type_t; +typedef enum _snd_timer_slave_class { + SND_TIMER_SCLASS_NONE = SNDRV_TIMER_SCLASS_NONE, + SND_TIMER_SCLASS_APPLICATION = SNDRV_TIMER_SCLASS_APPLICATION, + SND_TIMER_SCLASS_SEQUENCER = SNDRV_TIMER_SCLASS_SEQUENCER, + SND_TIMER_SCLASS_OSS_SEQUENCER = SNDRV_TIMER_SCLASS_OSS_SEQUENCER, + SND_TIMER_SCLASS_LAST = SNDRV_TIMER_SCLASS_LAST, +} snd_timer_slave_class_t; #define SND_TIMER_GLOBAL_SYSTEM SNDRV_TIMER_GLOBAL_SYSTEM #define SND_TIMER_GLOBAL_RTC SNDRV_TIMER_GLOBAL_RTC diff --git a/src/hwdep/hwdep_m4.c b/src/hwdep/hwdep_m4.c index 8b5a223a..c161351c 100644 --- a/src/hwdep/hwdep_m4.c +++ b/src/hwdep/hwdep_m4.c @@ -70,10 +70,10 @@ const char *snd_hwdep_info_get_name(const snd_hwdep_info_t *obj) return obj->name; } -snd_hwdep_type_t snd_hwdep_info_get_type(const snd_hwdep_info_t *obj) +snd_hwdep_iface_t snd_hwdep_info_get_iface(const snd_hwdep_info_t *obj) { assert(obj); - return snd_int_to_enum(obj->type); + return snd_int_to_enum(obj->iface); } void snd_hwdep_info_set_device(snd_hwdep_info_t *obj, unsigned int val) diff --git a/test/timer.c b/test/timer.c index 4b2d2ea9..e39ff115 100644 --- a/test/timer.c +++ b/test/timer.c @@ -50,8 +50,8 @@ void read_loop(void *handle, int master_ticks, int timeout) int main(int argc, char *argv[]) { int idx, err; - int type = SND_TIMER_TYPE_GLOBAL; - int stype = SND_TIMER_TYPE_NONE; + int class = SND_TIMER_CLASS_GLOBAL; + int sclass = SND_TIMER_CLASS_NONE; int card = 0; int device = SND_TIMER_GLOBAL_SYSTEM; int subdevice = 0; @@ -63,10 +63,10 @@ int main(int argc, char *argv[]) idx = 1; while (idx < argc) { - if (!strncmp(argv[idx], "type=", 5)) { - type = atoi(argv[idx]+5); - } else if (!strncmp(argv[idx], "stype=", 6)) { - stype = atoi(argv[idx]+6); + if (!strncmp(argv[idx], "class=", 5)) { + class = atoi(argv[idx]+5); + } else if (!strncmp(argv[idx], "sclass=", 6)) { + sclass = atoi(argv[idx]+6); } else if (!strncmp(argv[idx], "card=", 5)) { card = atoi(argv[idx]+5); } else if (!strncmp(argv[idx], "device=", 7)) { @@ -78,8 +78,8 @@ int main(int argc, char *argv[]) } idx++; } - if (type == SND_TIMER_TYPE_SLAVE && stype == SND_TIMER_STYPE_NONE) { - fprintf(stderr, "sync_type is not set\n"); + if (class == SND_TIMER_CLASS_SLAVE && sclass == SND_TIMER_SCLASS_NONE) { + fprintf(stderr, "slave class is not set\n"); exit(0); } if ((err = snd_timer_open(&handle))<0) { @@ -88,22 +88,22 @@ int main(int argc, char *argv[]) } if (list) { bzero(&sel.id, sizeof(sel.id)); - sel.id.type = -1; + sel.id.class = -1; while (1) { if ((err = snd_timer_next_device(handle, &sel.id)) < 0) { fprintf(stderr, "timer next device error: %s\n", snd_strerror(err)); break; } - if (sel.id.type < 0) + if (sel.id.class < 0) break; - printf("Timer device: type %i, stype %i, card %i, device %i, subdevice %i\n", - sel.id.type, sel.id.stype, sel.id.card, sel.id.device, sel.id.subdevice); + printf("Timer device: class %i, sclass %i, card %i, device %i, subdevice %i\n", + sel.id.class, sel.id.sclass, sel.id.card, sel.id.device, sel.id.subdevice); } } - printf("Using timer type %i, slave type %i, card %i, device %i, subdevice %i\n", type, stype, card, device, subdevice); + printf("Using timer class %i, slave class %i, card %i, device %i, subdevice %i\n", class, sclass, card, device, subdevice); bzero(&sel, sizeof(sel)); - sel.id.type = type; - sel.id.stype = stype; + sel.id.class = class; + sel.id.sclass = sclass; sel.id.card = card; sel.id.device = device; sel.id.subdevice = subdevice; @@ -111,7 +111,7 @@ int main(int argc, char *argv[]) fprintf(stderr, "timer select %i (%s)\n", err, snd_strerror(err)); exit(0); } - if (type != SND_TIMER_TYPE_SLAVE) { + if (class != SND_TIMER_CLASS_SLAVE) { if ((err = snd_timer_info(handle, &info)) < 0) { fprintf(stderr, "timer info %i (%s)\n", err, snd_strerror(err)); exit(0); @@ -138,7 +138,7 @@ int main(int argc, char *argv[]) fprintf(stderr, "timer start %i (%s)\n", err, snd_strerror(err)); exit(0); } - read_loop(handle, 25, type == SND_TIMER_TYPE_SLAVE ? 10000 : 1); + read_loop(handle, 25, class == SND_TIMER_CLASS_SLAVE ? 10000 : 1); show_status(handle); snd_timer_close(handle); return 0;