Ratio const *
Ratio::from_id (string i)
{
+ /* We removed the ratio with id 137; replace it with 138 */
+ if (i == "137") {
+ i = "138";
+ }
+
vector<Ratio const *>::iterator j = _ratios.begin ();
while (j != _ratios.end() && (*j)->id() != i) {
++j;
return *j;
}
-
+
Ratio const *
Ratio::nearest_from_ratio (float r)
{
Ratio const * nearest = 0;
float distance = FLT_MAX;
-
+
for (vector<Ratio const *>::iterator i = _ratios.begin (); i != _ratios.end(); ++i) {
float const d = fabs ((*i)->ratio() - r);
if (d < distance) {