Merge with git+ssh://sgc@fondialog1.hum.uva.nl/fro/git/sgc.git
[sgc.git] / sgc.h
blob6a0160982955c8c4547a8f64bbfcaf759e69eaef
1 #include <glib/gi18n.h>
2 #include <gtk/gtk.h>
3 #include <glade/glade.h>
4 #include <glib/gstdio.h>
5 #include <pango/pango-utils.h>
6 #include <unistd.h>
7 #include "Thing.h"
8 #include "PitchTier.h"
9 #include "Pitch.h"
11 /* Paths to files and directories */
12 #define DISTPATH "distfiles" /* This is the output direcory for new distfiles */
13 #define LOCALEDIR "locale" /* This is the directory for localizations */
14 #define PINYINPATH "pinyin" /* Here we store the common audioexamples */
15 #define PITCHPATH "PitchTiers" /* This is the temporary output for praatscripts */
16 #define RECORDPATH "records" /* Here we store the voice recordings */
17 #define GLADESOURCE "sgc.glade" /* Filename that stores the Glade GUI */
18 #define CONFIGFILE "sgc.ini" /* Filename that stores the configuration file */
19 #define SCRIPTPATH "SGC_ToneProt" /* This is the recognizer path for SGC */
20 #define WORDLISTS "wordlists" /* This is the directory with wordlists */
21 #define TESTFILE "tests.txt" /* If everything fails use this filename */
24 /* Hardcodec configs */
25 #define MAXTESTS 0 /* Maximum amount of word splits from a file */
27 #define RECORDTIME 3.5 /* Amount of time to record */
28 // #define LASTEXAMPLE 1 /* Play last example, instead of last recording */
30 /* Use our own PitchTier Parser, or use the one that was copied from praat.
31 * On windows we use this one because of compatibility issues
33 #define PITCHTIER 1
35 #define PRAATEXTERNAL 1
37 /* Which binary do we need to invoke in order to start a script */
38 #ifdef MINGW
39 #define PRAATBIN "praatcon.exe"
40 #elif PPC
41 #define PRAATBIN "./praat.ppc"
42 #else
43 #define PRAATBIN "./praat"
44 #endif
46 extern GladeXML *xml;
47 extern gdouble upperRegister;
49 gpointer sound_init(void *args);
50 gpointer play(void *args);
51 gpointer example(void *args);
52 gpointer record(void *args);
54 void drawPitchTier(cairo_t *cr, gchar *filename, gint width, gint height, gdouble top);
56 void on_buttonNext_clicked(GtkWidget *widget, gpointer user_data);
57 void on_treeview_edited (GtkCellRendererText *celltext, const gchar *string_path, const gchar *new_text, gpointer data);
58 void on_windowMain_realize(GtkWidget *widget, gpointer user_data);
61 void create_list_view();
63 void add_entry(gchar *txt);
65 void fileOpen(gchar *filename);
66 void fileSave(gchar *filename);
67 void fileClose();
68 void updateWidgets();
70 enum
72 COL_TEXT = 0,
73 NUM_COLS
77 GtkListStore *liststore;
78 GtkTreeIter mainIter;
79 gboolean treevalid;
80 gchar *base;
81 gchar *file;
83 void clear();
84 gboolean next(GtkWidget *next);
85 gboolean prev(GtkWidget *prev);
86 void removeRecordings();
87 void setBase(gchar *newbase);
88 void setFile(gchar *newfile);
90 void configOpen();
91 void configSave();
93 gboolean openSGC(gchar *oldfilename);
94 void saveSGC(gchar *dir, gchar *path);