for (vector<int>::const_iterator j = points.begin(); j != points.end(); ++j) {
+ gint pos;
+
float fraction = 0;
switch (*i) {
case DataType::AUDIO:
fraction = log_meter (*j);
+ pos = height - (gint) floor (height * fraction);
break;
case DataType::MIDI:
fraction = *j / 127.0;
+ pos = 1 + height - (gint) floor (height * fraction);
break;
}
- gint const pos = 1 + height - (gint) floor (height * fraction);
float const linepos = min((float) height, (float)(pos + .5f));
cairo_set_line_width (cr, 1.0);
}
fraction = log_meter (j->first);
snprintf (buf, sizeof (buf), "%+2d", j->first);
- pos = 1 + height - (gint) floor (height * fraction);
+ pos = height - (gint) floor (height * fraction);
cairo_move_to(cr, width-2.5, pos + .5);
cairo_line_to(cr, width, pos + .5);
cairo_stroke (cr);
cairo_set_source_rgb (cr, c.get_red_p(), c.get_green_p(), c.get_blue_p());
}
fraction = log_meter (j->first);
- pos = 1 + height - (gint) floor (height * fraction);
+ pos = height - (gint) floor (height * fraction);
cairo_move_to(cr, 0, pos + .5);
cairo_line_to(cr, 3, pos + .5);
cairo_stroke (cr);