Changeset 982629c for examples


Ignore:
Timestamp:
Jan 31, 2019, 3:24:19 AM (6 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/cnn, feature/crepe, feature/crepe_org, fix/ffmpeg5, master
Children:
b1ed6ce
Parents:
65a4fb4
Message:

[examples] add quiet mode for performance measurements

Location:
examples
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • examples/parse_args.h

    r65a4fb4 r982629c  
    2626
    2727extern int verbose;
     28extern int quiet;
    2829// input / output
    2930extern int usejack;
     
    128129#endif /* defined(PROG_HAS_ONSET) && !defined(PROG_HAS_PITCH) */
    129130#endif /* defined(PROG_HAS_JACK) && defined(HAVE_JACK) */
     131      "       -q      --quiet            be quiet\n"
    130132      "       -v      --verbose          be verbose\n"
    131133      "       -h      --help             display this message\n"
     
    142144{
    143145#ifdef HAVE_GETOPT_H
    144   const char *options = "hv"
     146  const char *options = "hvq"
    145147    "i:r:B:H:"
    146148#ifdef PROG_HAS_JACK
     
    174176    {"help",                  0, NULL, 'h'},
    175177    {"verbose",               0, NULL, 'v'},
     178    {"quiet",                 0, NULL, 'q'},
    176179    {"input",                 1, NULL, 'i'},
    177180    {"samplerate",            1, NULL, 'r'},
     
    227230        verbose = 1;
    228231        break;
     232      case 'q':                /* quiet */
     233        quiet = 1;
     234        break;
    229235      case 'j':
    230236        usejack = 1;
  • examples/utils.c

    r65a4fb4 r982629c  
    3333
    3434int verbose = 0;
     35int quiet = 0;
    3536int usejack = 0;
    3637// input / output
     
    170171      process_func (input_buffer, output_buffer);
    171172      // print to console if verbose or no output given
    172       if (verbose || sink_uri == NULL) {
     173      if ((verbose || sink_uri == NULL) && !quiet) {
    173174        print();
    174175      }
Note: See TracChangeset for help on using the changeset viewer.