/* unuse callback - send ALL_SOUNDS_OFF and RESET_CONTROLLERS events to subscribers. Note: this callback is called only after all subscribers are removed.  */
static int dummy_unuse(void *private_data, struct snd_seq_port_subscribe *info)
/* unuse callback - send ALL_SOUNDS_OFF and RESET_CONTROLLERS events to subscribers. Note: this callback is called only after all subscribers are removed.  */
static int dummy_unuse(void *private_data, struct snd_seq_port_subscribe *info)
{
	struct snd_seq_dummy_port *p;
	int i;
	struct snd_seq_event ev;
	p = private_data;
	memset(&ev, 0, sizeof(ev));
	if (p->duplex)
		ev.source.port = p->connect;
	else
		ev.source.port = p->port;
	ev.dest.client = SNDRV_SEQ_ADDRESS_SUBSCRIBERS;
	ev.type = SNDRV_SEQ_EVENT_CONTROLLER;
	for (i = 0; i < 16; i++) {
		ev.data.control.channel = i;
		ev.data.control.param = MIDI_CTL_ALL_SOUNDS_OFF;
		snd_seq_kernel_client_dispatch(p->client, &ev, 0, 0);
		ev.data.control.param = MIDI_CTL_RESET_CONTROLLERS;
		snd_seq_kernel_client_dispatch(p->client, &ev, 0, 0);
	}
	return 0;
}