Update of /cvsroot/alsa/alsa-kernel/core/seq
In directory sc8-pr-cvs1:/tmp/cvs-serv31525/core/seq
Modified Files:
seq_midi.c
Log Message:
- set more verbose name for the sequencer client of external midi
devices.
- retrieve the default name of mpu401_uart devices
from card's shortname.
Index: seq_midi.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/core/seq/seq_midi.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- seq_midi.c 19 Feb 2003 13:40:26 -0000 1.11
+++ seq_midi.c 25 Feb 2003 15:43:13 -0000 1.12
@@ -272,6 +272,21 @@
snd_midi_event_free(msynth->parser);
}
+/* set our client name */
+static int set_client_name(seq_midisynth_client_t *client, snd_card_t *card,
+ snd_rawmidi_info_t *rmidi)
+{
+ snd_seq_client_info_t cinfo;
+ const char *name;
+
+ memset(&cinfo, 0, sizeof(cinfo));
+ cinfo.client = client->seq_client;
+ cinfo.type = KERNEL_CLIENT;
+ name = rmidi->name[0] ? rmidi->name : "External MIDI";
+ snprintf(cinfo.name, sizeof(cinfo.name), "Rawmidi %d - %s", card->number,
name);
+ return snd_seq_kernel_client_ctl(client->seq_client,
SNDRV_SEQ_IOCTL_SET_CLIENT_INFO, &cinfo);
+}
+
/* register new midi synth port */
int
snd_seq_midisynth_register_port(snd_seq_device_t *dev)
@@ -284,7 +299,6 @@
unsigned int p, ports;
snd_seq_client_callback_t callbacks;
snd_seq_port_callback_t pcallbacks;
- snd_seq_client_info_t inf;
snd_card_t *card = dev->card;
int device = dev->device;
unsigned int input_count = 0, output_count = 0;
@@ -325,13 +339,9 @@
up(®ister_mutex);
return -ENOMEM;
}
- /* set our client name */
- memset(&inf,0,sizeof(snd_seq_client_info_t));
- inf.client = client->seq_client;
- inf.type = KERNEL_CLIENT;
- sprintf(inf.name, "External MIDI %i", card->number);
- snd_seq_kernel_client_ctl(client->seq_client,
SNDRV_SEQ_IOCTL_SET_CLIENT_INFO, &inf);
- }
+ set_client_name(client, card, &info);
+ } else if (device == 0)
+ set_client_name(client, card, &info); /* use the first device's name */
msynth = snd_kcalloc(sizeof(seq_midisynth_t) * ports, GFP_KERNEL);
if (msynth == NULL)
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog