3 void drawPitchTier(cairo_t *cr, gchar *filename, gint width, gint height, gdouble top) {
7 g_debug("%s welcomes %s!", __func__, filename);
8 if (g_file_get_contents(filename, &contents, &length, &error) != TRUE) {
9 // g_warning("HET PROBLEEM ZIT IN HET INLEZEN VAN HET %s BESTAND!!!!!\n", filename);
10 g_warning("%s\n", error->message);
13 gdouble scalex = 0, scaley = 0;
24 if (contents[i] == '\n') {
25 gchar * this = g_strndup(&contents[m], i-m);
31 fromx = g_strtod(this, NULL);
35 endx = g_strtod(this, NULL);
36 scalex = width / endx;
37 scaley = height / top;
38 cairo_move_to(cr, fromx*scalex, 0);
44 middlex = g_strtod(this, NULL);
49 middley = g_strtod(this, NULL);
51 to = height - (middley*scaley);
53 if ((middlex - fromx) < 0.015 && fromy != -1 && middley != -1) {
54 cairo_line_to(cr, middlex*scalex, to);
56 cairo_move_to(cr, middlex*scalex, to);
70 g_debug("%s for %s done!\n", __func__, filename);