Mingw32 makefile update
[sgc.git] / sgc.h
blob4fabe79ad21c6a0c39abc3887f6d05a3b74e4902
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 */
23 #ifdef MINGW
24 #define STORAGE "APPDATA"
25 #define STOREAS "sgc"
26 #else
27 #define STORAGE "HOME"
28 #define STOREAS ".sgc"
29 #endif
31 /* Hardcodec configs */
32 #define MAXTESTS 0 /* Maximum amount of word splits from a file */
34 #define RECORDTIME 3.5 /* Amount of time to record */
35 // #define LASTEXAMPLE 1 /* Play last example, instead of last recording */
37 /* Use our own PitchTier Parser, or use the one that was copied from praat.
38 * On windows we use this one because of compatibility issues
40 #define PITCHTIER 1
42 #define PRAATEXTERNAL 1
44 /* Which binary do we need to invoke in order to start a script */
45 #ifdef MINGW
46 #define PRAATBIN "praatcon.exe"
47 #elif PPC
48 #define PRAATBIN "./praat.ppc"
49 #else
50 #define PRAATBIN "./praat"
51 #endif
53 extern GladeXML *xml;
54 extern gdouble upperRegister;
56 gpointer sound_init(void *args);
57 gpointer play(void *args);
58 gpointer example(void *args);
59 gpointer record(void *args);
61 void drawPitchTier(cairo_t *cr, gchar *filename, gint width, gint height, gdouble top);
63 void on_buttonNext_clicked(GtkWidget *widget, gpointer user_data);
64 void on_treeview_edited (GtkCellRendererText *celltext, const gchar *string_path, const gchar *new_text, gpointer data);
65 void on_windowMain_realize(GtkWidget *widget, gpointer user_data);
66 void on_treeviewWords_cursor_changed(GtkTreeView *treeview, gpointer user_data);
67 void on_buttonAddAdd_clicked (GtkWidget *entry, gpointer data);
68 void on_buttonSave_clicked(GtkWidget *filechooser, gpointer data);
69 void on_buttonOpen_clicked(GtkWidget *filechooser, gpointer data);
70 void on_buttonSaveDistribution_clicked(GtkWidget *entry, gpointer data);
71 void on_buttonSaveNew_clicked(GtkWidget *entry, gpointer data);
72 void on_filechooserdialog_realize(GtkWidget *widget, gpointer user_data);
73 gboolean on_treeother();
74 void remove_entry (GtkWidget *treeview, gpointer data);
75 void on_menuWordlists_realize(GtkWidget *menu, gpointer user_data);
77 void create_list_view();
79 void add_entry(gchar *txt);
81 void fileOpen(gchar *filename);
82 void fileSave(gchar *filename);
83 void fileClose();
84 void updateWidgets();
86 enum
88 COL_TEXT = 0,
89 NUM_COLS
93 GtkListStore *liststore;
94 GtkTreeIter mainIter;
95 gboolean treevalid;
96 gchar *base;
97 gchar *file;
99 void clear();
100 gboolean next(GtkWidget *next);
101 gboolean prev(GtkWidget *prev);
102 void removeRecordings();
103 void setBase(gchar *newbase);
104 void setFile(gchar *newfile);
106 void configOpen();
107 void configSave();
109 gboolean openSGC(gchar *oldfilename);
110 void saveSGC(const gchar *dir, gchar *path);