3 void drawPitchTier(cairo_t *cr, gchar *filename, gint width, gint height, gdouble top) {
7 g_debug("%s welcomes %s!", __func__, filename);
9 if (g_access(path, F_OK) == 0) {
10 structMelderFile file;
11 Pitch melderPitchFromFile;
13 __declspec(dllimport) Pitch_Table classPitch;
15 Thing_recognizeClassesByName (classPitch, NULL);
16 Melder_pathToFile(path, & file);
17 melderPitchFromFile = Data_readFromTextFile (& file);
21 forget(melderPitchFromFile);
26 if (g_file_get_contents(filename, &contents, &length, &error) != TRUE) {
27 // g_warning("HET PROBLEEM ZIT IN HET INLEZEN VAN HET %s BESTAND!!!!!\n", filename);
28 g_warning("%s\n", error->message);
31 gdouble scalex = 0, scaley = 0;
42 if (contents[i] == '\n') {
43 gchar * this = g_strndup(&contents[m], i-m);
49 fromx = g_strtod(this, NULL);
53 endx = g_strtod(this, NULL);
54 scalex = width / endx;
55 scaley = height / top;
56 cairo_move_to(cr, fromx*scalex, 0);
62 middlex = g_strtod(this, NULL);
67 middley = g_strtod(this, NULL);
69 to = height - (middley*scaley);
71 if ((middlex - fromx) < 0.015 && fromy != -1 && middley != -1) {
72 cairo_line_to(cr, middlex*scalex, to);
74 cairo_move_to(cr, middlex*scalex, to);
88 g_debug("%s for %s done!\n", __func__, filename);