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_SCANNING = 0x02,
35 GHB_STATE_SCANDONE = 0x04,
36 GHB_STATE_WORKING = 0x08,
37 GHB_STATE_WORKDONE = 0x10,
38 GHB_STATE_PAUSED = 0x20,
39 GHB_STATE_MUXING = 0x40,
44 gchar *current_dvd_device;
46 gboolean dont_clear_presets;
49 GSList *audio_settings;
52 GIOChannel *activity_log;
68 GSList *audio_settings;
82 GHashTable* ghb_settings_new();
83 void ghb_settings_set(GHashTable *settings, const gchar *key,
84 setting_value_t *value);
85 void ghb_settings_set_string(GHashTable *settings, const gchar *key, const gchar *str);
86 void ghb_settings_set_dbl(GHashTable *settings, const gchar *key, gdouble dvalue);
87 void ghb_settings_copy(GHashTable *settings, const gchar *key, const setting_value_t *value);
88 const setting_value_t* ghb_settings_get(GHashTable *settings, const gchar *key);
89 gboolean ghb_settings_get_bool(GHashTable *settings, const gchar *key);
90 gint ghb_settings_get_index(GHashTable *settings, const gchar *key);
91 gint ghb_settings_get_int(GHashTable *settings, const gchar *key);
92 gdouble ghb_settings_get_dbl(GHashTable *settings, const gchar *key);
93 setting_value_t* ghb_widget_value(GtkWidget *widget);
94 gchar* ghb_widget_short_opt(GtkWidget *widget);
95 gchar* ghb_widget_option(GtkWidget *widget);
96 gchar* ghb_widget_string(GtkWidget *widget);
97 gint ghb_widget_int(GtkWidget *widget);
98 gdouble ghb_widget_dbl(GtkWidget *widget);
99 gint ghb_widget_index(GtkWidget *widget);
101 const gchar* ghb_settings_get_string(GHashTable *settings, const gchar *key);
102 const gchar* ghb_settings_get_option(GHashTable *settings, const gchar *name);
103 const gchar* ghb_settings_get_short_opt(GHashTable *settings, const gchar *key);
104 GHashTable* ghb_settings_dup(GHashTable *settings);
105 void ghb_widget_to_setting(GHashTable *settings, GtkWidget *widget);
106 int ghb_ui_update(signal_user_data_t *ud, const gchar *key, const gchar *value);
107 int ghb_ui_update_int(signal_user_data_t *ud, const gchar *key, gint ivalue);
108 void ghb_settings_save(signal_user_data_t *ud, const gchar *name);
109 void ghb_presets_load(signal_user_data_t *ud);
110 void ghb_set_preset(signal_user_data_t *ud, const gchar *name);
111 void ghb_update_from_preset( signal_user_data_t *ud,
112 const gchar *name, const gchar *key);
113 gchar** ghb_presets_get_names();
114 gchar** ghb_presets_get_descriptions();
115 const gchar* ghb_presets_get_name(gint index);
116 gboolean ghb_presets_is_standard(const gchar *name);
117 gboolean ghb_presets_remove(GHashTable *settings, const gchar *name);
118 void ghb_presets_revert(signal_user_data_t *ud, const gchar *name);
119 GdkColor* ghb_presets_color(gboolean modified);
120 const gchar* ghb_presets_current_name();
121 gint ghb_presets_list_index(const gchar *name);
122 gint ghb_preset_flags(const gchar *name, gint *index);
123 void ghb_prefs_load(signal_user_data_t *ud);
124 void ghb_prefs_to_ui(signal_user_data_t *ud);
125 void ghb_prefs_save(GHashTable *settings);
126 void ghb_pref_save(GHashTable *settings, const gchar *key);
127 void ghb_set_preset_default(GHashTable *settings);
128 void ghb_x264_parse_options(signal_user_data_t *ud, const gchar *options);
129 void ghb_x264_opt_update(signal_user_data_t *ud, GtkWidget *widget);
130 gchar* ghb_sanitize_x264opts(signal_user_data_t *ud, const gchar *options);
131 gint ghb_pref_acount();
132 gint ghb_pref_acodec(gint index);
133 gint ghb_pref_bitrate(gint index);
134 gint ghb_pref_rate(gint index);
135 gint ghb_pref_mix(gint index);
136 gdouble ghb_pref_drc(gint index);
138 #endif // _SETTINGS_H_