diff options
author | Takashi Iwai <tiwai@suse.de> | 2005-11-17 07:53:23 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-01-03 06:17:32 -0500 |
commit | 82e9bae6fd253af4aea9c690223c7800313632ad (patch) | |
tree | 7a45a6ed1d354318ca25e6bcc92a83b808c13dc9 /include | |
parent | 512bbd6a85230f16389f0dd51925472e72fc8a91 (diff) |
[ALSA] Remove xxx_t typedefs: Controls
Modules: Control Midlevel
Remove xxx_t typedefs from the core controls.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/sound/control.h | 94 |
1 files changed, 42 insertions, 52 deletions
diff --git a/include/sound/control.h b/include/sound/control.h index ef7903c7a327..2489b1eb0110 100644 --- a/include/sound/control.h +++ b/include/sound/control.h | |||
@@ -24,24 +24,14 @@ | |||
24 | 24 | ||
25 | #include <sound/asound.h> | 25 | #include <sound/asound.h> |
26 | 26 | ||
27 | typedef struct sndrv_aes_iec958 snd_aes_iec958_t; | ||
28 | typedef struct sndrv_ctl_card_info snd_ctl_card_info_t; | ||
29 | typedef enum sndrv_ctl_elem_type snd_ctl_elem_type_t; | ||
30 | typedef enum sndrv_ctl_elem_iface snd_ctl_elem_iface_t; | ||
31 | typedef struct sndrv_ctl_elem_id snd_ctl_elem_id_t; | ||
32 | typedef struct sndrv_ctl_elem_list snd_ctl_elem_list_t; | ||
33 | typedef struct sndrv_ctl_elem_info snd_ctl_elem_info_t; | ||
34 | typedef struct sndrv_ctl_elem_value snd_ctl_elem_value_t; | ||
35 | typedef enum sndrv_ctl_event_type snd_ctl_event_type_t; | ||
36 | typedef struct sndrv_ctl_event snd_ctl_event_t; | ||
37 | |||
38 | #define snd_kcontrol_chip(kcontrol) ((kcontrol)->private_data) | 27 | #define snd_kcontrol_chip(kcontrol) ((kcontrol)->private_data) |
39 | 28 | ||
40 | typedef int (snd_kcontrol_info_t) (snd_kcontrol_t * kcontrol, snd_ctl_elem_info_t * uinfo); | 29 | struct snd_kcontrol; |
41 | typedef int (snd_kcontrol_get_t) (snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol); | 30 | typedef int (snd_kcontrol_info_t) (struct snd_kcontrol * kcontrol, struct snd_ctl_elem_info * uinfo); |
42 | typedef int (snd_kcontrol_put_t) (snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol); | 31 | typedef int (snd_kcontrol_get_t) (struct snd_kcontrol * kcontrol, struct snd_ctl_elem_value * ucontrol); |
32 | typedef int (snd_kcontrol_put_t) (struct snd_kcontrol * kcontrol, struct snd_ctl_elem_value * ucontrol); | ||
43 | 33 | ||
44 | typedef struct _snd_kcontrol_new { | 34 | struct snd_kcontrol_new { |
45 | snd_ctl_elem_iface_t iface; /* interface identifier */ | 35 | snd_ctl_elem_iface_t iface; /* interface identifier */ |
46 | unsigned int device; /* device/client number */ | 36 | unsigned int device; /* device/client number */ |
47 | unsigned int subdevice; /* subdevice (substream) number */ | 37 | unsigned int subdevice; /* subdevice (substream) number */ |
@@ -53,40 +43,40 @@ typedef struct _snd_kcontrol_new { | |||
53 | snd_kcontrol_get_t *get; | 43 | snd_kcontrol_get_t *get; |
54 | snd_kcontrol_put_t *put; | 44 | snd_kcontrol_put_t *put; |
55 | unsigned long private_value; | 45 | unsigned long private_value; |
56 | } snd_kcontrol_new_t; | 46 | }; |
57 | 47 | ||
58 | typedef struct _snd_kcontrol_volatile { | 48 | struct snd_kcontrol_volatile { |
59 | snd_ctl_file_t *owner; /* locked */ | 49 | struct snd_ctl_file *owner; /* locked */ |
60 | pid_t owner_pid; | 50 | pid_t owner_pid; |
61 | unsigned int access; /* access rights */ | 51 | unsigned int access; /* access rights */ |
62 | } snd_kcontrol_volatile_t; | 52 | }; |
63 | 53 | ||
64 | struct _snd_kcontrol { | 54 | struct snd_kcontrol { |
65 | struct list_head list; /* list of controls */ | 55 | struct list_head list; /* list of controls */ |
66 | snd_ctl_elem_id_t id; | 56 | struct snd_ctl_elem_id id; |
67 | unsigned int count; /* count of same elements */ | 57 | unsigned int count; /* count of same elements */ |
68 | snd_kcontrol_info_t *info; | 58 | snd_kcontrol_info_t *info; |
69 | snd_kcontrol_get_t *get; | 59 | snd_kcontrol_get_t *get; |
70 | snd_kcontrol_put_t *put; | 60 | snd_kcontrol_put_t *put; |
71 | unsigned long private_value; | 61 | unsigned long private_value; |
72 | void *private_data; | 62 | void *private_data; |
73 | void (*private_free)(snd_kcontrol_t *kcontrol); | 63 | void (*private_free)(struct snd_kcontrol *kcontrol); |
74 | snd_kcontrol_volatile_t vd[0]; /* volatile data */ | 64 | struct snd_kcontrol_volatile vd[0]; /* volatile data */ |
75 | }; | 65 | }; |
76 | 66 | ||
77 | #define snd_kcontrol(n) list_entry(n, snd_kcontrol_t, list) | 67 | #define snd_kcontrol(n) list_entry(n, struct snd_kcontrol, list) |
78 | 68 | ||
79 | typedef struct _snd_kctl_event { | 69 | struct snd_kctl_event { |
80 | struct list_head list; /* list of events */ | 70 | struct list_head list; /* list of events */ |
81 | snd_ctl_elem_id_t id; | 71 | struct snd_ctl_elem_id id; |
82 | unsigned int mask; | 72 | unsigned int mask; |
83 | } snd_kctl_event_t; | 73 | }; |
84 | 74 | ||
85 | #define snd_kctl_event(n) list_entry(n, snd_kctl_event_t, list) | 75 | #define snd_kctl_event(n) list_entry(n, struct snd_kctl_event, list) |
86 | 76 | ||
87 | struct _snd_ctl_file { | 77 | struct snd_ctl_file { |
88 | struct list_head list; /* list of all control files */ | 78 | struct list_head list; /* list of all control files */ |
89 | snd_card_t *card; | 79 | struct snd_card *card; |
90 | pid_t pid; | 80 | pid_t pid; |
91 | int prefer_pcm_subdevice; | 81 | int prefer_pcm_subdevice; |
92 | int prefer_rawmidi_subdevice; | 82 | int prefer_rawmidi_subdevice; |
@@ -97,25 +87,25 @@ struct _snd_ctl_file { | |||
97 | struct list_head events; /* waiting events for read */ | 87 | struct list_head events; /* waiting events for read */ |
98 | }; | 88 | }; |
99 | 89 | ||
100 | #define snd_ctl_file(n) list_entry(n, snd_ctl_file_t, list) | 90 | #define snd_ctl_file(n) list_entry(n, struct snd_ctl_file, list) |
101 | 91 | ||
102 | typedef int (*snd_kctl_ioctl_func_t) (snd_card_t * card, | 92 | typedef int (*snd_kctl_ioctl_func_t) (struct snd_card * card, |
103 | snd_ctl_file_t * control, | 93 | struct snd_ctl_file * control, |
104 | unsigned int cmd, unsigned long arg); | 94 | unsigned int cmd, unsigned long arg); |
105 | 95 | ||
106 | void snd_ctl_notify(snd_card_t * card, unsigned int mask, snd_ctl_elem_id_t * id); | 96 | void snd_ctl_notify(struct snd_card * card, unsigned int mask, struct snd_ctl_elem_id * id); |
107 | 97 | ||
108 | snd_kcontrol_t *snd_ctl_new(snd_kcontrol_t * kcontrol, unsigned int access); | 98 | struct snd_kcontrol *snd_ctl_new(struct snd_kcontrol * kcontrol, unsigned int access); |
109 | snd_kcontrol_t *snd_ctl_new1(const snd_kcontrol_new_t * kcontrolnew, void * private_data); | 99 | struct snd_kcontrol *snd_ctl_new1(const struct snd_kcontrol_new * kcontrolnew, void * private_data); |
110 | void snd_ctl_free_one(snd_kcontrol_t * kcontrol); | 100 | void snd_ctl_free_one(struct snd_kcontrol * kcontrol); |
111 | int snd_ctl_add(snd_card_t * card, snd_kcontrol_t * kcontrol); | 101 | int snd_ctl_add(struct snd_card * card, struct snd_kcontrol * kcontrol); |
112 | int snd_ctl_remove(snd_card_t * card, snd_kcontrol_t * kcontrol); | 102 | int snd_ctl_remove(struct snd_card * card, struct snd_kcontrol * kcontrol); |
113 | int snd_ctl_remove_id(snd_card_t * card, snd_ctl_elem_id_t *id); | 103 | int snd_ctl_remove_id(struct snd_card * card, struct snd_ctl_elem_id *id); |
114 | int snd_ctl_rename_id(snd_card_t * card, snd_ctl_elem_id_t *src_id, snd_ctl_elem_id_t *dst_id); | 104 | int snd_ctl_rename_id(struct snd_card * card, struct snd_ctl_elem_id *src_id, struct snd_ctl_elem_id *dst_id); |
115 | snd_kcontrol_t *snd_ctl_find_numid(snd_card_t * card, unsigned int numid); | 105 | struct snd_kcontrol *snd_ctl_find_numid(struct snd_card * card, unsigned int numid); |
116 | snd_kcontrol_t *snd_ctl_find_id(snd_card_t * card, snd_ctl_elem_id_t *id); | 106 | struct snd_kcontrol *snd_ctl_find_id(struct snd_card * card, struct snd_ctl_elem_id *id); |
117 | 107 | ||
118 | int snd_ctl_create(snd_card_t *card); | 108 | int snd_ctl_create(struct snd_card *card); |
119 | 109 | ||
120 | int snd_ctl_register_ioctl(snd_kctl_ioctl_func_t fcn); | 110 | int snd_ctl_register_ioctl(snd_kctl_ioctl_func_t fcn); |
121 | int snd_ctl_unregister_ioctl(snd_kctl_ioctl_func_t fcn); | 111 | int snd_ctl_unregister_ioctl(snd_kctl_ioctl_func_t fcn); |
@@ -127,20 +117,20 @@ int snd_ctl_unregister_ioctl_compat(snd_kctl_ioctl_func_t fcn); | |||
127 | #define snd_ctl_unregister_ioctl_compat(fcn) | 117 | #define snd_ctl_unregister_ioctl_compat(fcn) |
128 | #endif | 118 | #endif |
129 | 119 | ||
130 | int snd_ctl_elem_read(snd_card_t *card, snd_ctl_elem_value_t *control); | 120 | int snd_ctl_elem_read(struct snd_card *card, struct snd_ctl_elem_value *control); |
131 | int snd_ctl_elem_write(snd_card_t *card, snd_ctl_file_t *file, snd_ctl_elem_value_t *control); | 121 | int snd_ctl_elem_write(struct snd_card *card, struct snd_ctl_file *file, struct snd_ctl_elem_value *control); |
132 | 122 | ||
133 | static inline unsigned int snd_ctl_get_ioffnum(snd_kcontrol_t *kctl, snd_ctl_elem_id_t *id) | 123 | static inline unsigned int snd_ctl_get_ioffnum(struct snd_kcontrol *kctl, struct snd_ctl_elem_id *id) |
134 | { | 124 | { |
135 | return id->numid - kctl->id.numid; | 125 | return id->numid - kctl->id.numid; |
136 | } | 126 | } |
137 | 127 | ||
138 | static inline unsigned int snd_ctl_get_ioffidx(snd_kcontrol_t *kctl, snd_ctl_elem_id_t *id) | 128 | static inline unsigned int snd_ctl_get_ioffidx(struct snd_kcontrol *kctl, struct snd_ctl_elem_id *id) |
139 | { | 129 | { |
140 | return id->index - kctl->id.index; | 130 | return id->index - kctl->id.index; |
141 | } | 131 | } |
142 | 132 | ||
143 | static inline unsigned int snd_ctl_get_ioff(snd_kcontrol_t *kctl, snd_ctl_elem_id_t *id) | 133 | static inline unsigned int snd_ctl_get_ioff(struct snd_kcontrol *kctl, struct snd_ctl_elem_id *id) |
144 | { | 134 | { |
145 | if (id->numid) { | 135 | if (id->numid) { |
146 | return snd_ctl_get_ioffnum(kctl, id); | 136 | return snd_ctl_get_ioffnum(kctl, id); |
@@ -149,8 +139,8 @@ static inline unsigned int snd_ctl_get_ioff(snd_kcontrol_t *kctl, snd_ctl_elem_i | |||
149 | } | 139 | } |
150 | } | 140 | } |
151 | 141 | ||
152 | static inline snd_ctl_elem_id_t *snd_ctl_build_ioff(snd_ctl_elem_id_t *dst_id, | 142 | static inline struct snd_ctl_elem_id *snd_ctl_build_ioff(struct snd_ctl_elem_id *dst_id, |
153 | snd_kcontrol_t *src_kctl, | 143 | struct snd_kcontrol *src_kctl, |
154 | unsigned int offset) | 144 | unsigned int offset) |
155 | { | 145 | { |
156 | *dst_id = src_kctl->id; | 146 | *dst_id = src_kctl->id; |