get_media_devices: Add types for sound sequencer/timer
authorMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 29 May 2011 14:18:44 +0000 (11:18 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 29 May 2011 14:18:44 +0000 (11:18 -0300)
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
utils/libmedia_dev/get_media_devices.c
utils/libmedia_dev/get_media_devices.h

index 96cea45..c7749b3 100644 (file)
@@ -205,7 +205,13 @@ static int add_snd_class(struct media_device_entry *md)
        unsigned c = 65535, d = 65535;
        char *new;
 
-       if (strstr(md->node, "card")) {
+       if (strstr(md->node, "timer")) {
+               md->type = MEDIA_SND_TIMER;
+               return 0;
+       } else if (strstr(md->node, "seq")) {
+               md->type = MEDIA_SND_SEQ;
+               return 0;
+       } if (strstr(md->node, "card")) {
                sscanf(md->node, "card%u", &c);
                md->type = MEDIA_SND_CARD;
        } else if (strstr(md->node, "hw")) {
@@ -375,6 +381,10 @@ const char *media_device_type(enum device_type type)
                return  "mixer";
        case MEDIA_SND_HW:
                return  "sound hardware";
+       case MEDIA_SND_TIMER:
+               return  "sound timer";
+       case MEDIA_SND_SEQ:
+               return  "sound sequencer";
 
        default:
                return "unknown";
index 6ff1d59..4185037 100644 (file)
@@ -52,6 +52,8 @@ enum device_type {
        MEDIA_SND_OUT,
        MEDIA_SND_CONTROL,
        MEDIA_SND_HW,
+       MEDIA_SND_TIMER,
+       MEDIA_SND_SEQ,
        /*
         * FIXME: not all alsa devices were mapped. missing things like
         *      midi, midiC%iD%i and timer interfaces