byte first (like Motorola and SPARC, unlike Intel and VAX). */
#undef WORDS_BIGENDIAN
-/* Package name */
-#undef PACKAGE
-
/* Package version */
#undef VERSION
/* Define if you have the <linux/asound.h> header file. */
#undef HAVE_LINUX_ASOUND_H
+
+/* Name of package */
+#undef PACKAGE
+
+/* Version number of package */
+#undef VERSION
+
int snd_seq_set_port_info(void *handle, int port, snd_seq_port_info_t *info);
int snd_seq_subscribe_port(void *handle, snd_seq_port_subscribe_t *sub);
int snd_seq_unsubscribe_port(void *handle, snd_seq_port_subscribe_t *sub);
-int snd_seq_get_queue_info(void *handle, int q, snd_seq_queue_info_t *queue);
-int snd_seq_set_queue_info(void *handle, int q, snd_seq_queue_info_t *queue);
+int snd_seq_get_queue_status(void *handle, int q, snd_seq_queue_status_t *status);
+int snd_seq_get_queue_tempo(void *handle, int q, snd_seq_queue_tempo_t *tempo);
+int snd_seq_set_queue_tempo(void *handle, int q, snd_seq_queue_tempo_t *tempo);
+int snd_seq_get_queue_owner(void *handle, int q, snd_seq_queue_owner_t *owner);
+int snd_seq_set_queue_owner(void *handle, int q, snd_seq_queue_owner_t *owner);
+int snd_seq_get_queue_timer(void *handle, int q, snd_seq_queue_timer_t *timer);
+int snd_seq_set_queue_timer(void *handle, int q, snd_seq_queue_timer_t *timer);
+int snd_seq_get_queue_sync(void *handle, int q, snd_seq_queue_sync_t *sync);
+int snd_seq_set_queue_sync(void *handle, int q, snd_seq_queue_sync_t *sync);
int snd_seq_get_queue_client(void *handle, int q, snd_seq_queue_client_t *queue);
int snd_seq_set_queue_client(void *handle, int q, snd_seq_queue_client_t *queue);
-int snd_seq_alloc_queue(void *handle, snd_seq_queue_info_t *queue);
+int snd_seq_alloc_queue(void *handle);
int snd_seq_free_queue(void *handle, int q);
/* event routines */
snd_seq_event_t *snd_seq_create_event(void);
return 0;
}
-int snd_seq_get_queue_info(void *handle, int q, snd_seq_queue_info_t * info)
+int snd_seq_get_queue_status(void *handle, int q, snd_seq_queue_status_t * status)
{
snd_seq_t *seq;
seq = (snd_seq_t *) handle;
- if (!seq || !info)
+ if (!seq || !status)
return -EINVAL;
- bzero(info, sizeof(snd_seq_queue_info_t));
- info->queue = q;
- if (ioctl(seq->fd, SND_SEQ_IOCTL_GET_QUEUE_INFO, info) < 0)
+ bzero(status, sizeof(snd_seq_queue_status_t));
+ status->queue = q;
+ if (ioctl(seq->fd, SND_SEQ_IOCTL_GET_QUEUE_STATUS, status) < 0)
return -errno;
return 0;
}
-int snd_seq_set_queue_info(void *handle, int q, snd_seq_queue_info_t * info)
+int snd_seq_get_queue_tempo(void *handle, int q, snd_seq_queue_tempo_t * tempo)
{
snd_seq_t *seq;
seq = (snd_seq_t *) handle;
- if (!seq || !info)
+ if (!seq || !tempo)
return -EINVAL;
- info->queue = q;
- if (ioctl(seq->fd, SND_SEQ_IOCTL_SET_QUEUE_INFO, info) < 0)
+ bzero(tempo, sizeof(snd_seq_queue_tempo_t));
+ tempo->queue = q;
+ if (ioctl(seq->fd, SND_SEQ_IOCTL_GET_QUEUE_TEMPO, tempo) < 0)
+ return -errno;
+ return 0;
+}
+
+int snd_seq_set_queue_tempo(void *handle, int q, snd_seq_queue_tempo_t * tempo)
+{
+ snd_seq_t *seq;
+
+ seq = (snd_seq_t *) handle;
+ if (!seq || !tempo)
+ return -EINVAL;
+ tempo->queue = q;
+ if (ioctl(seq->fd, SND_SEQ_IOCTL_SET_QUEUE_TEMPO, tempo) < 0)
+ return -errno;
+ return 0;
+}
+
+int snd_seq_get_queue_owner(void *handle, int q, snd_seq_queue_owner_t * owner)
+{
+ snd_seq_t *seq;
+
+ seq = (snd_seq_t *) handle;
+ if (!seq || !owner)
+ return -EINVAL;
+ bzero(owner, sizeof(snd_seq_queue_owner_t));
+ owner->queue = q;
+ if (ioctl(seq->fd, SND_SEQ_IOCTL_GET_QUEUE_OWNER, owner) < 0)
+ return -errno;
+ return 0;
+}
+
+int snd_seq_set_queue_owner(void *handle, int q, snd_seq_queue_owner_t * owner)
+{
+ snd_seq_t *seq;
+
+ seq = (snd_seq_t *) handle;
+ if (!seq || !owner)
+ return -EINVAL;
+ owner->queue = q;
+ if (ioctl(seq->fd, SND_SEQ_IOCTL_SET_QUEUE_OWNER, owner) < 0)
+ return -errno;
+ return 0;
+}
+
+int snd_seq_get_queue_timer(void *handle, int q, snd_seq_queue_timer_t * timer)
+{
+ snd_seq_t *seq;
+
+ seq = (snd_seq_t *) handle;
+ if (!seq || !timer)
+ return -EINVAL;
+ bzero(timer, sizeof(snd_seq_queue_timer_t));
+ timer->queue = q;
+ if (ioctl(seq->fd, SND_SEQ_IOCTL_GET_QUEUE_TIMER, timer) < 0)
+ return -errno;
+ return 0;
+}
+
+int snd_seq_set_queue_timer(void *handle, int q, snd_seq_queue_timer_t * timer)
+{
+ snd_seq_t *seq;
+
+ seq = (snd_seq_t *) handle;
+ if (!seq || !timer)
+ return -EINVAL;
+ timer->queue = q;
+ if (ioctl(seq->fd, SND_SEQ_IOCTL_SET_QUEUE_TIMER, timer) < 0)
+ return -errno;
+ return 0;
+}
+
+int snd_seq_get_queue_sync(void *handle, int q, snd_seq_queue_sync_t * sync)
+{
+ snd_seq_t *seq;
+
+ seq = (snd_seq_t *) handle;
+ if (!seq || !sync)
+ return -EINVAL;
+ bzero(sync, sizeof(snd_seq_queue_sync_t));
+ sync->queue = q;
+ if (ioctl(seq->fd, SND_SEQ_IOCTL_GET_QUEUE_SYNC, sync) < 0)
+ return -errno;
+ return 0;
+}
+
+int snd_seq_set_queue_sync(void *handle, int q, snd_seq_queue_sync_t * sync)
+{
+ snd_seq_t *seq;
+
+ seq = (snd_seq_t *) handle;
+ if (!seq || !sync)
+ return -EINVAL;
+ sync->queue = q;
+ if (ioctl(seq->fd, SND_SEQ_IOCTL_SET_QUEUE_SYNC, sync) < 0)
return -errno;
return 0;
}
return 0;
}
-int snd_seq_alloc_queue(void *handle, snd_seq_queue_info_t *info)
+int snd_seq_alloc_queue(void *handle)
{
int i, err;
snd_seq_system_info_t sysinfo;
- snd_seq_queue_info_t inf;
+ snd_seq_queue_owner_t owner;
snd_seq_t *seq;
seq = (snd_seq_t *) handle;
if ((err = snd_seq_system_info(handle, &sysinfo))<0)
return err;
for (i = 0; i < sysinfo.queues; i++) {
- if ((err = snd_seq_get_queue_info(handle, i, &inf))<0)
+ if ((err = snd_seq_get_queue_owner(handle, i, &owner))<0)
continue;
- if (inf.locked)
+ if (owner.locked)
continue;
- inf.locked = 1;
- inf.owner = seq->client;
- if ((err = snd_seq_set_queue_info(handle, i, &inf))<0)
+ owner.locked = 1;
+ owner.owner = seq->client;
+ if ((err = snd_seq_set_queue_owner(handle, i, &owner))<0)
continue;
- if (info)
- memcpy(info, &inf, sizeof(snd_seq_queue_info_t));
return i;
}
return -EBUSY;
{
int err;
snd_seq_t *seq;
- snd_seq_queue_info_t inf;
+ snd_seq_queue_owner_t owner;
seq = (snd_seq_t *) handle;
if (!seq)
return -EINVAL;
- if ((err = snd_seq_get_queue_info(handle, q, &inf))<0)
+ if ((err = snd_seq_get_queue_owner(handle, q, &owner))<0)
return err;
- if (inf.locked && inf.owner == seq->client) {
- inf.locked = 0;
- inf.owner = -1;
- if ((err = snd_seq_set_queue_info(handle, q, &inf))<0)
+ if (owner.locked && owner.owner == seq->client) {
+ owner.locked = 0;
+ owner.owner = -1;
+ if ((err = snd_seq_set_queue_owner(handle, q, &owner))<0)
return err;
}
return 0;
return;
}
printf("Client ID = %i\n", client);
- if ((queue = snd_seq_alloc_queue(handle, NULL))<0) {
+ if ((queue = snd_seq_alloc_queue(handle))<0) {
fprintf(stderr, "Cannot allocate queue: %s\n", snd_strerror(queue));
return;
}
return;
}
printf("Client ID = %i\n", client);
- if ((queue = snd_seq_alloc_queue(handle, NULL))<0) {
+ if ((queue = snd_seq_alloc_queue(handle))<0) {
fprintf(stderr, "Cannot allocate queue: %s\n", snd_strerror(queue));
return;
}
printf(" Max ports : %i\n", sysinfo.ports);
}
-void show_queue_info(void *handle, int queue)
+void show_queue_status(void *handle, int queue)
{
int err, idx, min, max;
- snd_seq_queue_info_t info;
+ snd_seq_queue_status_t status;
min = queue < 0 ? 0 : queue;
max = queue < 0 ? sysinfo.queues : queue + 1;
for (idx = min; idx < max; idx++) {
- if ((err = snd_seq_get_queue_info(handle, idx, &info))<0) {
+ if ((err = snd_seq_get_queue_status(handle, idx, &status))<0) {
if (err == -ENOENT)
continue;
fprintf(stderr, "Client %i info error: %s\n", idx, snd_strerror(err));
exit(0);
}
- printf("Queue %i info\n", info.queue);
- printf(" Tick : %u\n", info.tick);
- printf(" Realtime : %i.%i\n", info.time.tv_sec, info.time.tv_nsec);
- printf(" Running : %i\n", info.running);
- printf(" Tempo : %i\n", info.tempo);
- printf(" PPQ : %i\n", info.ppq);
- printf(" Flags : 0x%x\n", info.flags);
- printf(" Owner : %i\n", info.owner);
- printf(" Locked : %i\n", info.locked);
+ printf("Queue %i info\n", status.queue);
+ printf(" Tick : %u\n", status.tick);
+ printf(" Realtime : %li.%li\n", status.time.tv_sec, status.time.tv_nsec);
+ printf(" Flags : 0x%x\n", status.flags);
}
}
printf(" Type : 0x%x\n", info.type);
printf(" Midi channels : %i\n", info.midi_channels);
printf(" Synth voices : %i\n", info.synth_voices);
- printf(" Subscribers : %i\n", info.subscribers);
- printf(" Use : %i\n", info.use);
+ printf(" Output subs : %i\n", info.out_use);
+ printf(" Input subs : %i\n", info.in_use);
}
}
show_system_info(handle);
} else if (!strcmp(argv[optind], "queue")) {
arg = argc - optind > 1 ? atoi(argv[optind + 1]) : -1;
- show_queue_info(handle, arg);
+ show_queue_status(handle, arg);
} else if (!strcmp(argv[optind], "client")) {
arg = argc - optind > 1 ? atoi(argv[optind + 1]) : -1;
show_client_info(handle, arg);