2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU Library General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
16 #if !defined(_SETTINGS_H_)
21 #define PRESET_CUSTOM 1
22 #define PRESET_DEFAULT 2
24 #define GHB_WIDGET(b,n) GTK_WIDGET(gtk_builder_get_object ((b), (n)))
25 //#define GHB_WIDGET(b,n) GTK_WIDGET(debug_get_object((b), (n)))
26 #define GHB_ACTION(b,n) GTK_ACTION(gtk_builder_get_object ((b), (n)))
27 #define GHB_OBJECT(b,n) gtk_builder_get_object ((b), (n))
29 GObject* debug_get_object(GtkBuilder *b, const gchar *n);
33 GHB_STATE_IDLE = 0x00,
34 GHB_STATE_START = 0x01,
35 GHB_STATE_SCANNING = 0x02,
36 GHB_STATE_WORKING = 0x04
42 gchar *current_dvd_device;
44 gboolean dont_clear_presets;
47 GSList *audio_settings;
50 GIOChannel *activity_log;
66 GSList *audio_settings;
80 GHashTable* ghb_settings_new();
81 void ghb_settings_set(GHashTable *settings, const gchar *key,
82 setting_value_t *value);
83 void ghb_settings_set_string(GHashTable *settings, const gchar *key, const gchar *str);
84 void ghb_settings_set_dbl(GHashTable *settings, const gchar *key, gdouble dvalue);
85 void ghb_settings_copy(GHashTable *settings, const gchar *key, const setting_value_t *value);
86 const setting_value_t* ghb_settings_get(GHashTable *settings, const gchar *key);
87 gboolean ghb_settings_get_bool(GHashTable *settings, const gchar *key);
88 gint ghb_settings_get_index(GHashTable *settings, const gchar *key);
89 gint ghb_settings_get_int(GHashTable *settings, const gchar *key);
90 gdouble ghb_settings_get_dbl(GHashTable *settings, const gchar *key);
91 setting_value_t* ghb_widget_value(GtkWidget *widget);
92 gchar* ghb_widget_short_opt(GtkWidget *widget);
93 gchar* ghb_widget_option(GtkWidget *widget);
94 gchar* ghb_widget_string(GtkWidget *widget);
95 gint ghb_widget_int(GtkWidget *widget);
96 gdouble ghb_widget_dbl(GtkWidget *widget);
97 gint ghb_widget_index(GtkWidget *widget);
99 const gchar* ghb_settings_get_string(GHashTable *settings, const gchar *key);
100 const gchar* ghb_settings_get_option(GHashTable *settings, const gchar *name);
101 const gchar* ghb_settings_get_short_opt(GHashTable *settings, const gchar *key);
102 GHashTable* ghb_settings_dup(GHashTable *settings);
103 void ghb_widget_to_setting(GHashTable *settings, GtkWidget *widget);
104 int ghb_ui_update(signal_user_data_t *ud, const gchar *key, const gchar *value);
105 int ghb_ui_update_int(signal_user_data_t *ud, const gchar *key, gint ivalue);
106 void ghb_settings_save(signal_user_data_t *ud, const gchar *name);
107 void ghb_presets_load(signal_user_data_t *ud);
108 void ghb_set_preset(signal_user_data_t *ud, const gchar *name);
109 void ghb_update_from_preset( signal_user_data_t *ud,
110 const gchar *name, const gchar *key);
111 gchar** ghb_presets_get_names();
112 gchar** ghb_presets_get_descriptions();
113 const gchar* ghb_presets_get_name(gint index);
114 gboolean ghb_presets_is_standard(const gchar *name);
115 gboolean ghb_presets_remove(GHashTable *settings, const gchar *name);
116 void ghb_presets_revert(signal_user_data_t *ud, const gchar *name);
117 GdkColor* ghb_presets_color(gboolean modified);
118 const gchar* ghb_presets_current_name();
119 gint ghb_presets_list_index(const gchar *name);
120 gint ghb_preset_flags(const gchar *name, gint *index);
121 void ghb_prefs_load(signal_user_data_t *ud);
122 void ghb_prefs_to_ui(signal_user_data_t *ud);
123 void ghb_prefs_save(GHashTable *settings);
124 void ghb_set_preset_default(GHashTable *settings);
126 #endif // _SETTINGS_H_