settings cleanups
[tunertool] / src / settings.h
1 /* vim: set sts=2 sw=2 et: */
2 /*
3  * Copyright (C) 2008 Jari Tenhunen <jari.tenhunen@iki.fi>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18  * Boston, MA 02111-1307, USA.
19  */
20
21 #ifndef __SETTINGS_H__
22 #define __SETTINGS_H__
23
24 #include <gtk/gtkwindow.h>
25 #include <gconf/gconf-client.h>
26
27 #define GCONF_ROOT "/apps/tuner"
28 #define GCONF_KEY_ALGORITHM GCONF_ROOT "/algorithm"
29 #define GCONF_KEY_CALIBRATION GCONF_ROOT "/calibration"
30 #define GCONF_KEY_DISPLAY_KEEPALIVE GCONF_ROOT "/display_keepalive"
31
32 #define DEFAULT_ALGORITHM (0) /* GST_PITCH_ALGORITHM_FFT */
33 #define DEFAULT_DISPLAY_KEEPALIVE TRUE
34
35 enum
36 {
37   CALIB_MIN = 430,
38   CALIB_MAX = 450,
39   CALIB_DEFAULT = 440
40 };
41
42 gint settings_get_algorithm (gint default_value);
43 gint settings_get_calibration (gint default_value);
44 gboolean settings_get_display_keepalive (gboolean default_value);
45
46 gboolean settings_set_algorithm (gint value);
47 gboolean settings_set_calibration (gint value);
48 gboolean settings_set_display_keepalive (gboolean val);
49 gboolean settings_init (GConfClientNotifyFunc func, gpointer user_data);
50 #if HILDON == 1
51 void settings_dialog_show (GtkWindow * parent);
52 GtkWidget * calibration_editor_new (gint min, gint max);
53 #endif
54
55 #endif /* __SETTINGS_H__ */
56