hal: Branch 'master'
Danny Kukawka
dkukawka at kemper.freedesktop.org
Mon Mar 19 06:54:01 PDT 2007
doc/spec/hal-spec-properties.xml | 10 ++++++++++
hald/linux/device.c | 15 ++++++++++-----
2 files changed, 20 insertions(+), 5 deletions(-)
New commits:
diff-tree a0af30e5d063ca863713d365b54bb0ca45814341 (from f3dec3b59503d773e65226b2546bded210df98f3)
Author: Danny Kukawka <danny.kukawka at web.de>
Date: Mon Mar 19 14:53:24 2007 +0100
added support for ALSA MIDI devices
Added support for ALSA MIDI devices (/sys/class/sound/midiC*). Updated
SPEC for alsa.type property.
diff --git a/doc/spec/hal-spec-properties.xml b/doc/spec/hal-spec-properties.xml
index aacf370..6b88ccf 100644
--- a/doc/spec/hal-spec-properties.xml
+++ b/doc/spec/hal-spec-properties.xml
@@ -4300,6 +4300,16 @@
<row>
<entry></entry>
<entry>
+ <literal>midi</literal>
+ </entry>
+ <entry></entry>
+ <entry>
+ Stream is MIDI device.
+ </entry>
+ </row>
+ <row>
+ <entry></entry>
+ <entry>
<literal>playback</literal>
</entry>
<entry></entry>
diff --git a/hald/linux/device.c b/hald/linux/device.c
index 74e440b..29630e6 100644
--- a/hald/linux/device.c
+++ b/hald/linux/device.c
@@ -953,7 +953,8 @@ sound_add (const gchar *sysfs_path, cons
} else
hal_device_property_set_string (d, "info.product", "ALSA Device");
}
- } else if (sscanf (device, "hwC%dD%d", &cardnum, &devicenum) == 2) {
+ } else if ((sscanf (device, "hwC%dD%d", &cardnum, &devicenum) == 2) ||
+ (sscanf (device, "midiC%dD%d", &cardnum, &devicenum) == 2)) {
hal_device_property_set_string (d, "info.category", "alsa");
hal_device_add_capability (d, "alsa");
@@ -966,9 +967,13 @@ sound_add (const gchar *sysfs_path, cons
asound_card_id_set (cardnum, d, "alsa.card_id");
- hal_device_property_set_string (d, "alsa.type", "hw_specific");
-
- snprintf (buf, sizeof (buf), "%s ALSA hardware specific Device", hal_device_property_get_string (d, "alsa.card_id"));
+ if (!strncmp (device, "hwC", 3)) {
+ hal_device_property_set_string (d, "alsa.type", "hw_specific");
+ snprintf (buf, sizeof (buf), "%s ALSA hardware specific Device", hal_device_property_get_string (d, "alsa.card_id"));
+ } else if (!strncmp (device, "midiC", 5)) {
+ hal_device_property_set_string (d, "alsa.type", "midi");
+ snprintf (buf, sizeof (buf), "%s ALSA MIDI Device", hal_device_property_get_string (d, "alsa.card_id"));
+ }
hal_device_property_set_string (d, "info.product", buf);
} else if (!strncmp (device, "dsp", 3) || !strncmp (device, "adsp", 4) ||
@@ -1100,7 +1105,7 @@ sound_compute_udi (HalDevice *d)
hal_device_property_get_string (d, "oss.type"),
hal_device_property_get_int (d, "oss.device"));
} else if (hal_device_has_property(d, "alsa.type")) {
- /* handle global ALAS devices */
+ /* handle global ALSA devices */
hal_util_compute_udi (hald_get_gdl (), udi, sizeof (udi),
"%s_alsa_%s",
hal_device_property_get_string (d, "info.parent"),
More information about the hal-commit
mailing list