summaryrefslogtreecommitdiff
path: root/test/playmidi1.c
diff options
context:
space:
mode:
authorFrank van de Pol <fvdpol@home.nl>1999-08-06 19:31:15 +0000
committerFrank van de Pol <fvdpol@home.nl>1999-08-06 19:31:15 +0000
commit9218e21adbbe116c8db8f08f9ce958ea5b70f368 (patch)
treeac3f80727d99198bcfa2de2ab9dd51983fb42e96 /test/playmidi1.c
parentb998850dc22a2e5235b31549327f665a262d6949 (diff)
downloadalsa-lib-9218e21adbbe116c8db8f08f9ce958ea5b70f368.tar.gz
Enhanced timing accuracy for real-time timestamps.
Diffstat (limited to 'test/playmidi1.c')
-rw-r--r--test/playmidi1.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/test/playmidi1.c b/test/playmidi1.c
index ee2f3b44..73478098 100644
--- a/test/playmidi1.c
+++ b/test/playmidi1.c
@@ -73,6 +73,7 @@ static int source_channel = 0;
static int source_port = 0;
static int verbose = 0;
+static int slave = 0;
#define VERB_INFO 1
#define VERB_MUCH 2
@@ -188,14 +189,16 @@ static void do_header(int format, int ntracks, int division)
tempo.ppq = ppq;
if (snd_seq_set_queue_tempo(seq_handle, dest_queue, &tempo) < 0) {
perror("set_queue_tempo");
- exit(1);
+ if (!slave)
+ exit(1);
}
if (verbose >= VERB_INFO)
printf("ALSA Timer updated, PPQ = %d\n", tempo.ppq);
}
/* start playing... */
- alsa_start_timer();
+ if (!slave)
+ alsa_start_timer();
}
/* fill normal event header */
@@ -475,6 +478,8 @@ static void usage(void)
fprintf(stderr, " -v: verbose mode\n");
fprintf(stderr, " -a queue:client:port : set destination address (default=%d:%d:%d)\n",
DEST_QUEUE_NUMBER, DEST_CLIENT_NUMBER, DEST_PORT_NUMBER);
+ fprintf(stderr, " -s: slave mode (allow external clock synchronisation)\n");
+
}
/* parse destination address (-a option) */
@@ -500,7 +505,7 @@ int main(int argc, char *argv[])
int tmp;
int c;
- while ((c = getopt(argc, argv, "a:v")) != -1) {
+ while ((c = getopt(argc, argv, "sa:v")) != -1) {
switch (c) {
case 'v':
verbose++;
@@ -508,6 +513,9 @@ int main(int argc, char *argv[])
case 'a':
parse_address(optarg, &dest_queue, &dest_client, &dest_port);
break;
+ case 's':
+ slave = 1;
+ break;
default:
usage();
exit(1);