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);
19 if (melderPitchFromFile != NULL) {
20 forget(melderPitchFromFile);
28 if (g_file_get_contents(filename, &contents, &length, &error) != TRUE) {
29 // g_warning("HET PROBLEEM ZIT IN HET INLEZEN VAN HET %s BESTAND!!!!!\n", filename);
30 g_warning("%s\n", error->message);
33 gdouble scalex = 0, scaley = 0;
44 if (contents[i] == '\n') {
45 gchar * this = g_strndup(&contents[m], i-m);
51 fromx = g_strtod(this, NULL);
55 endx = g_strtod(this, NULL);
56 scalex = width / endx;
57 scaley = height / top;
58 cairo_move_to(cr, fromx*scalex, 0);
64 middlex = g_strtod(this, NULL);
69 middley = g_strtod(this, NULL);
71 to = height - (middley*scaley);
73 if ((middlex - fromx) < 0.015 && fromy != -1 && middley != -1) {
74 cairo_line_to(cr, middlex*scalex, to);
76 cairo_move_to(cr, middlex*scalex, to);
90 g_debug("%s for %s done!\n", __func__, filename);