Mercurial > hg > audiodb
comparison audioDB.cpp @ 256:4dcb09f5fe85
Commit patch deprecating the --size argument, replacing it with
--ntracks, --datadims and --datasize.
These names are not ideal, but will serve for now.
author | mas01cr |
---|---|
date | Wed, 16 Apr 2008 09:59:43 +0000 |
parents | 5682c7d7444b |
children | 210b2f661b88 |
comparison
equal
deleted
inserted
replaced
254:fe922b9d87f8 | 256:4dcb09f5fe85 |
---|---|
134 verbosity = 1; | 134 verbosity = 1; |
135 } | 135 } |
136 } | 136 } |
137 | 137 |
138 if(args_info.size_given) { | 138 if(args_info.size_given) { |
139 if(args_info.datasize_given) { | |
140 error("both --size and --datasize given", ""); | |
141 } | |
142 if(args_info.ntracks_given) { | |
143 error("both --size and --ntracks given", ""); | |
144 } | |
145 if(args_info.datadim_given) { | |
146 error("both --size and --datadim given", ""); | |
147 } | |
139 if (args_info.size_arg < 50 || args_info.size_arg > 32000) { | 148 if (args_info.size_arg < 50 || args_info.size_arg > 32000) { |
140 error("Size out of range", ""); | 149 error("Size out of range", ""); |
141 } | 150 } |
142 size = (off_t) args_info.size_arg * 1000000; | 151 double ratio = (double) args_info.size_arg * 1000000 / ((double) O2_DEFAULTDBSIZE); |
152 /* FIXME: what's the safe way of doing this? */ | |
153 datasize = (unsigned int) ceil(datasize * ratio); | |
154 ntracks = (unsigned int) ceil(ntracks * ratio); | |
155 } else { | |
156 if(args_info.datasize_given) { | |
157 datasize = args_info.datasize_arg; | |
158 } | |
159 if(args_info.ntracks_given) { | |
160 ntracks = args_info.ntracks_arg; | |
161 } | |
162 if(args_info.datadim_given) { | |
163 datadim = args_info.datadim_arg; | |
164 } | |
143 } | 165 } |
144 | 166 |
145 if(args_info.radius_given) { | 167 if(args_info.radius_given) { |
146 radius = args_info.radius_arg; | 168 radius = args_info.radius_arg; |
147 if(radius <= 0 || radius > 1000000000) { | 169 if(radius <= 0 || radius > 1000000000) { |