1 /*
2  * lingot, a musical instrument tuner.
3  *
4  * Copyright (C) 2004-2018  Iban Cereijo.
5  * Copyright (C) 2004-2008  Jairo Chapela.
6 
7  *
8  * This file is part of lingot.
9  *
10  * lingot is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * lingot is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with lingot; if not, write to the Free Software
22  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23  */
24 
25 #ifndef __LINGOT_DEFS_H__
26 #define __LINGOT_DEFS_H__
27 
28 #include "../config.h"
29 
30 // floating point precission.
31 #define FLT                  double
32 
33 #define CONFIG_DIR_NAME           ".lingot/"
34 #define DEFAULT_CONFIG_FILE_NAME  "lingot.conf"
35 extern char CONFIG_FILE_NAME[];
36 
37 #define QUICK_MESSAGES
38 
39 #define GTK_EVENTS_RATE      20.0
40 #define GAUGE_RATE           60.0
41 #define ERROR_DISPATCH_RATE	 5.0
42 
43 #define MID_A_FREQUENCY		440.0
44 #define MID_C_FREQUENCY		261.625565
45 
46 /* object forward declaration */
47 typedef struct _LingotMainFrame LingotMainFrame;
48 
49 // optionally we can use the following libraries
50 //#define LIB_FFTW
51 //#define LIBSNDOBJ
52 
53 // simple try-catch simulation, do not use throw inside loops nor nest try-catch
54 // blocks
55 #define try exception = 0; do
56 #define throw(a) {exception = a;break;}
57 #define catch while (0); if (exception != 0)
58 
59 // this option allows us to throw exception from loops, it contains a goto
60 // statement, but totally controlled. It fails when trying to indent code.
61 //#define try exception = 0;do
62 //#define throw(a) {exception = a;goto catch_label;}
63 //#define catch while (0);catch_label: if (exception != 0)
64 
65 #endif
66