- Timestamp:
- Dec 8, 2013, 5:51:09 AM (11 years ago)
- 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:
- 664fd25
- Parents:
- a93dab3
- Location:
- examples
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
examples/parse_args.h
ra93dab3 r0a509c6 41 41 extern uint_t mix_input; 42 42 43 extern uint_t force_overwrite; 44 43 45 // functions defined in utils.c 44 46 extern void examples_common_init (int argc, char **argv); … … 79 81 #ifdef PROG_HAS_OUTPUT 80 82 " -m --mix-input mix input signal with output signal\n" 83 " -f --force-overwrite overwrite output file if\n" 81 84 #endif 82 85 #ifdef PROG_HAS_JACK … … 106 109 "p:u:l:" 107 110 #endif /* PROG_HAS_PITCH */ 108 "s:m ";111 "s:mf"; 109 112 int next_option; 110 113 struct option long_options[] = { … … 132 135 {"silence", 1, NULL, 's'}, 133 136 {"mix-input", 0, NULL, 'm'}, 137 {"force-overwrite", 0, NULL, 'f'}, 134 138 {NULL, 0, NULL, 0} 135 139 }; … … 156 160 case 'o': 157 161 sink_uri = optarg; 162 break; 163 case 'f': /* force_overwrite flag */ 164 force_overwrite = 1; 158 165 break; 159 166 case 'r': -
examples/utils.c
ra93dab3 r0a509c6 54 54 uint_t mix_input = 0; 55 55 56 uint_t force_overwrite = 0; 57 56 58 // 57 59 // internal memory stuff … … 89 91 } 90 92 if (sink_uri != NULL) { 93 uint_t sink_exists = (access(sink_uri, F_OK) == 0 ); 94 if (!force_overwrite && sink_exists) { 95 outmsg ("Output file %s already exists, use -f to overwrite.\n", 96 sink_uri); 97 exit (1); 98 } 91 99 this_sink = new_aubio_sink ((char_t*)sink_uri, samplerate); 92 100 if (this_sink == NULL) {
Note: See TracChangeset
for help on using the changeset viewer.