~ubuntu-branches/ubuntu/quantal/alsa-utils/quantal

« back to all changes in this revision

Viewing changes to alsaucm/usecase.c

  • Committer: Package Import Robot
  • Author(s): Luke Yelavich
  • Date: 2012-02-16 13:44:24 UTC
  • mfrom: (1.2.16) (2.3.16 sid)
  • Revision ID: package-import@ubuntu.com-20120216134424-bolv9yy21p006jv2
Tags: 1.0.25-1ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Move alsactl to sbin
  - Move init script volume settings to new alsactl database:
    + Set sane level for 'Speaker' and 'Headphone', needed for Dell Mini 9
      and Dell E series
    + ute PC Beep on hda cards that support it during initial volume setup
    + Mute *Analog/Digital Control for Creative cards by default
    + Default Digital Input Source to be Digital Mic 1 so that users
      with digital mic will be able to use it out of the box
    + Mute "IEC958 Optical Raw" by default
    + Set sane level for headphone 1 for Dell Studio XPS with 2.6.30
    + Prefer built-in digital mics on newer Dells
    + Unmute 'Line HP Swap' for Dove boards
  - ship udev rules file in /lib/udev/rules.d
  - debian/README.init.cs4236: Include in /usr/share/doc/alsa-utils so that
    users of snd-cs4236 (e.g., ThinkPad 600) can have audible sound
  - debian/patches/unset_pulse_internal.patch: We don't want alsamixer to
    show the pulse mixer by default, since it can be controlled from
    pulseaudio itself
  - Use upstart jobs for storing/restoring card settings
  - Add udev rule to apply UCM profiles for panda and equivalent hardware
  - Install alsa udev rules, at the least they are needed for hotplugged
    devices
  - Add Vcs-Bzr field

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
        OM_RESET,
64
64
        OM_RELOAD,
65
65
        OM_LISTCARDS,
66
 
        OM_LIST,
 
66
        OM_LIST2,
 
67
        OM_LIST1,
67
68
 
68
69
        /* set/get */
69
70
        OM_SET,
87
88
        { OM_RESET, 0, 1, "reset" },
88
89
        { OM_RELOAD, 0, 1, "reload" },
89
90
        { OM_LISTCARDS, 0, 0, "listcards" },
90
 
        { OM_LIST, 1, 1, "list" },
 
91
        { OM_LIST1, 1, 1, "list1" },
 
92
        { OM_LIST2, 1, 1, "list" },
91
93
        { OM_SET, 2, 1, "set" },
92
94
        { OM_GET, 1, 1, "get" },
93
95
        { OM_GETI, 1, 1, "geti" },
172
174
{
173
175
        const char **list, *str;
174
176
        long lval;
175
 
        int err, i;
 
177
        int err, i, j, entries;
176
178
 
177
179
        if (cmd->opencard && context->uc_mgr == NULL) {
178
180
                fprintf(stderr, "%s: command '%s' requires an open card\n",
224
226
                                snd_strerror(err));
225
227
                        return err;
226
228
                }
227
 
                if (err == 0)
 
229
                if (err == 0) {
228
230
                        printf("  list is empty\n");
 
231
                        return 0;
 
232
                }
229
233
                for (i = 0; i < err / 2; i++) {
230
234
                        printf("  %i: %s\n", i, list[i*2]);
231
235
                        if (list[i*2+1])
233
237
                }
234
238
                snd_use_case_free_list(list, err);
235
239
                break;
236
 
        case OM_LIST:
 
240
        case OM_LIST1:
 
241
        case OM_LIST2:
 
242
                switch (cmd->code) {
 
243
                case OM_LIST1:
 
244
                    entries = 1;
 
245
                    break;
 
246
                case OM_LIST2:
 
247
                    entries = 2;
 
248
                    break;
 
249
                }
 
250
 
237
251
                err = snd_use_case_get_list(context->uc_mgr,
238
252
                                            argv[0],
239
253
                                            &list);
244
258
                                snd_strerror(err));
245
259
                        return err;
246
260
                }
247
 
                if (err == 0)
 
261
                if (err == 0) {
248
262
                        printf("  list is empty\n");
249
 
                for (i = 0; i < err / 2; i++) {
250
 
                        printf("  %i: %s\n", i, list[i*2]);
251
 
                        if (list[i*2+1])
252
 
                                printf("    %s\n", list[i*2+1]);
 
263
                        return 0;
 
264
                }
 
265
                for (i = 0; i < err / entries; i++) {
 
266
                        printf("  %i: %s\n", i, list[i*entries]);
 
267
                        for (j = 0; j < entries - 1; j++)
 
268
                                if (list[i*entries+j+1])
 
269
                                        printf("    %s\n", list[i*entries+j+1]);
253
270
                }
254
271
                snd_use_case_free_list(list, err);
255
272
                break;