Mercurial > hg > audiodb
diff audioDB.cpp @ 659:536cfa209e7f
Sampling enhancements
Allow specification of a key with -k for doing sampling between a single
datum and the rest of the database. (The implementation is slightly
icky, as mentioned in the previous commit message; hopefully this
situation will not remain for too long).
While we're at it, allow -r/--resultlength as a synonym for --nsamples
(if --nsamples is not given) in order better to reflect the analogy
between querying and sampling.
author | mas01cr |
---|---|
date | Tue, 05 Jan 2010 16:44:06 +0000 |
parents | 2a97f3f9a6ac |
children | a35ca2d5f238 |
line wrap: on
line diff
--- a/audioDB.cpp Tue Jan 05 16:44:03 2010 +0000 +++ b/audioDB.cpp Tue Jan 05 16:44:06 2010 +0000 @@ -332,7 +332,19 @@ if(sequenceLength < 1 || sequenceLength > 1000) { error("seqlen out of range: 1 <= seqlen <= 1000"); } - nsamples = args_info.nsamples_arg; + if(args_info.nsamples_given) { + nsamples = args_info.nsamples_arg; + } else if(args_info.resultlength_given) { + nsamples = args_info.resultlength_arg; + } else { + nsamples = args_info.nsamples_arg; + } + if(args_info.key_given) { + query_from_key = true; + key = args_info.key_arg; + } + + return 0; }