examples/parse_args.h: only parse time format string once, warn if unknown
[aubio.git] / examples / aubioonset.c
index 458f1ad..8f30bad 100644 (file)
@@ -49,13 +49,8 @@ void process_block(fvec_t *ibuf, fvec_t *obuf)
 void process_print (void)
 {
   if ( is_onset ) {
-    if (strcmp (time_format, "samples") == 0) {
-      outmsg ("%d\n", aubio_onset_get_last (o) );
-    } else if (strcmp (time_format, "ms") == 0) {
-      outmsg ("%f\n", aubio_onset_get_last_ms (o) );
-    } else {
-      outmsg ("%f\n", aubio_onset_get_last_s (o) );
-    }
+    print_time(aubio_onset_get_last (o));
+    outmsg ("\n");
   }
 }