~ubuntu-branches/ubuntu/maverick/alsa-lib/maverick-proposed

« back to all changes in this revision

Viewing changes to src/control/control_ext.c

  • Committer: Bazaar Package Importer
  • Author(s): Luke Yelavich
  • Date: 2009-05-26 08:57:32 UTC
  • mfrom: (1.1.11 upstream) (2.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20090526085732-wuuhzl1y30f1fnyd
Tags: 1.0.20-1ubuntu1
* Merge from debian unstable, remaining changes:
  - debian/rules:
    + Install into /usr/lib32/ on amd64 for the lib32asound2 package
    + Don't bail when removing include/alsa
  - debian/control: Add Vcs-Bzr URI
  - Add configuration files for bluetooth/bluez-alsa and pulseaudio
  - debian/libasound2.install: Ship smixer plugins for native and bi-arch
    packages
  - drop libcxxtools-dev build dependency, its in universe

Show diffs side-by-side

added added

removed removed

Lines of Context:
107
107
                ret = ext->callback->elem_list(ext, offset, ids);
108
108
                if (ret < 0)
109
109
                        return ret;
 
110
                ids->numid = offset + 1; /* fake number */
110
111
                list->used++;
111
112
                offset++;
112
113
                ids++;
114
115
        return 0;
115
116
}
116
117
 
 
118
static snd_ctl_ext_key_t get_elem(snd_ctl_ext_t *ext, snd_ctl_elem_id_t *id)
 
119
{
 
120
        int numid = id->numid;
 
121
        if (numid > 0) {
 
122
                ext->callback->elem_list(ext, numid - 1, id);
 
123
                id->numid = numid;
 
124
        } else
 
125
                id->numid = 0;
 
126
        return ext->callback->find_elem(ext, id);
 
127
}
 
128
 
117
129
static int snd_ctl_ext_elem_info(snd_ctl_t *handle, snd_ctl_elem_info_t *info)
118
130
{
119
131
        snd_ctl_ext_t *ext = handle->private_data;
120
132
        snd_ctl_ext_key_t key;
121
133
        int type, ret;
122
134
 
123
 
        key = ext->callback->find_elem(ext, &info->id);
 
135
        key = get_elem(ext, &info->id);
124
136
        if (key == SND_CTL_EXT_KEY_NOT_FOUND)
125
137
                return -ENOENT;
126
138
        ret = ext->callback->get_attribute(ext, key, &type, &info->access, &info->count);
200
212
        int type, ret;
201
213
        unsigned int access, count;
202
214
 
203
 
        key = ext->callback->find_elem(ext, &control->id);
 
215
        key = get_elem(ext, &control->id);
204
216
        if (key == SND_CTL_EXT_KEY_NOT_FOUND)
205
217
                return -ENOENT;
206
218
        ret = ext->callback->get_attribute(ext, key, &type, &access, &count);
254
266
        int type, ret;
255
267
        unsigned int access, count;
256
268
 
257
 
        key = ext->callback->find_elem(ext, &control->id);
 
269
        key = get_elem(ext, &control->id);
258
270
        if (key == SND_CTL_EXT_KEY_NOT_FOUND)
259
271
                return -ENOENT;
260
272
        ret = ext->callback->get_attribute(ext, key, &type, &access, &count);