[specimen] PATCH: client name in ALSA

Ken Restivo ken at restivo.org
Sun Jul 15 21:50:18 CDT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Makes the ALSA connection tools like QJackCtl, aconnect, patchage, etc, respect the -n argument given to specimen, to set the client name. Previously, only the JACK section did, and all instances of specimen showed up as "specimen" in ALSA.

This is against 0.5.2.rc3.

Apologies for the cut-and-paste hacking, and also apologies if this has already been done by someone else.

- -ken

- ----------------

- --- specimen-0.5.2.rc3.orig/src/specimen.c
+++ specimen-0.5.2.rc3/src/specimen.c
@@ -73,8 +73,8 @@
      }
 
      /* start */
- -     midi_start();
+     midi_start(client_name);
      driver_start(0, client_name);
 #ifdef HAVE_LASH
      lashdriver_start();
- --- specimen-0.5.2.rc3.orig/src/midi.c
+++ specimen-0.5.2.rc3/src/midi.c
@@ -129,9 +129,10 @@
 }
 
 
- -static int open_seq (snd_seq_t** handle)
+static int open_seq (snd_seq_t** handle, char* forced_instancename)
 {
      int portid;
+	 char* instancename;
 
      if (snd_seq_open (handle, "default", SND_SEQ_OPEN_INPUT, 0) < 0)
      {
@@ -139,8 +140,18 @@
 	  return MIDI_ERR_SEQ;
      }
 
- -     snd_seq_set_client_name (*handle, "specimen");
- -     if ((portid = snd_seq_create_simple_port (*handle, "Specimen Sampler",
+     if(forced_instancename)
+     {
+     	 instancename = strdup(forced_instancename);
+     }
+     else
+     {
+         instancename = strdup(DEFAULT_INSTANCE_NAME);
+     }
+
+
+     snd_seq_set_client_name (*handle, instancename);
+     if ((portid = snd_seq_create_simple_port (*handle, "specimen",
 					       SND_SEQ_PORT_CAP_WRITE |
 					       SND_SEQ_PORT_CAP_SUBS_WRITE,
 					       SND_SEQ_PORT_TYPE_APPLICATION))
@@ -154,7 +165,7 @@
 }
 
 
- -int midi_start ( )
+int midi_start (char* client_name )
 {
      int err;
      snd_seq_t* handle;
@@ -166,7 +177,7 @@
      }
 
      debug ("Starting MIDI\n");
- -     if ((err = open_seq (&handle)) < 0)
+     if ((err = open_seq (&handle, client_name)) < 0)
 	  return err;
 
      running = 1;

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGmtzqe8HF+6xeOIcRAjX7AJ927VS5zjdMj4xX5cgdc4QngXzmqwCgpVsL
3SksWyLocI4h2ZdipNW8rCc=
=51s2
-----END PGP SIGNATURE-----

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.




More information about the Specimen mailing list