Changeset df7be43 for examples/utils.c


Ignore:
Timestamp:
Aug 12, 2015, 4:31:40 PM (9 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
3ff50e5
Parents:
340cb93
Message:

examples/parse_args.h: only parse time format string once, warn if unknown

File:
1 edited

Legend:

Unmodified
Added
Removed
  • examples/utils.c

    r340cb93 rdf7be43  
    4949smpl_t pitch_tolerance = 0.0; // will be set if != 0.
    5050// time stuff
    51 char_t * time_format = "seconds";
     51uint_t time_format = 0; // for "seconds", 1 for "ms", 2 for "samples"
    5252// tempo stuff
    5353char_t * tempo_method = "default";
     
    210210void print_time (uint_t time_in_samples) {
    211211  /* output times in selected format */
    212   if (strcmp (time_format, "samples") == 0) {
     212  if (time_format == 2) {
    213213    outmsg ("%d", time_in_samples);
    214   } else if (strcmp (time_format, "ms") == 0) {
     214  } else if (time_format == 1) {
    215215    outmsg ("%f", 1000. * time_in_samples / (float) samplerate);
    216216  } else {
Note: See TracChangeset for help on using the changeset viewer.