OSDN Git Service

LinGui: Add queue save/restore
[handbrake-jp/handbrake-jp-git.git] / gtk / src / settings.h
1 /*
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.
6  * 
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.
11  * 
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
15  */
16 #if !defined(_SETTINGS_H_)
17 #define _SETTINGS_H_
18
19 #include <gtk/gtk.h>
20
21 #define PRESET_CUSTOM   1
22 #define PRESET_DEFAULT  2
23
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))
28
29 GObject* debug_get_object(GtkBuilder *b, const gchar *n);
30
31 enum
32 {
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,
40 };
41
42 typedef struct
43 {
44         gchar *current_dvd_device;
45         gboolean debug;
46         gboolean dont_clear_presets;
47         gboolean cancel_encode;
48         GtkBuilder *builder;
49         GValue *settings;
50         GValue *queue;
51         GValue *current_job;
52         GIOChannel *activity_log;
53 } signal_user_data_t;
54
55 enum
56 {
57         GHB_QUEUE_PENDING,
58         GHB_QUEUE_RUNNING,
59         GHB_QUEUE_CANCELED,
60         GHB_QUEUE_DONE,
61 };
62
63 GValue* ghb_settings_new(void);
64 void ghb_settings_take_value(
65         GValue *settings, const gchar *key, GValue *value);
66 void ghb_settings_set_value(
67         GValue *settings, const gchar *key, const GValue *value);
68 void ghb_settings_set_string(
69         GValue *settings, const gchar *key, const gchar *sval);
70 void ghb_settings_set_double(GValue *settings, const gchar *key, gdouble dval);
71 void ghb_settings_set_int64(GValue *settings, const gchar *key, gint64 ival);
72 void ghb_settings_set_int(GValue *settings, const gchar *key, gint ival);
73 void ghb_settings_set_boolean(
74         GValue *settings, const gchar *key, gboolean bval);
75 void ghb_settings_set_combo(
76         GValue *settings, const gchar *key, gint index, const gchar *option,
77         const gchar *shortOpt, const gchar *svalue, gint ivalue);
78 void ghb_settings_copy(
79         GValue *settings, const gchar *key, const GValue *value);
80 GValue* ghb_settings_get_value(GValue *settings, const gchar *key);
81 gboolean ghb_settings_get_boolean(GValue *settings, const gchar *key);
82 gint64 ghb_settings_get_int64(GValue *settings, const gchar *key);
83 gint ghb_settings_get_int(GValue *settings, const gchar *key);
84 gdouble ghb_settings_get_double(GValue *settings, const gchar *key);
85 gchar* ghb_settings_get_string(GValue *settings, const gchar *key);
86 gint ghb_settings_get_combo_index(GValue *settings, const gchar *key);
87 gchar* ghb_settings_get_combo_option(GValue *settings, const gchar *name);
88
89 GValue* ghb_widget_value(GtkWidget *widget);
90 gchar* ghb_widget_string(GtkWidget *widget);
91 gdouble ghb_widget_double(GtkWidget *widget);
92 gint64 ghb_widget_int64(GtkWidget *widget);
93 gint ghb_widget_int(GtkWidget *widget);
94 gint ghb_widget_index(GtkWidget *widget);
95
96 void ghb_widget_to_setting(GValue *settings, GtkWidget *widget);
97 int ghb_ui_update(
98         signal_user_data_t *ud, const gchar *name, const GValue *value);
99
100 void ghb_x264_parse_options(signal_user_data_t *ud, const gchar *options);
101 void ghb_x264_opt_update(signal_user_data_t *ud, GtkWidget *widget);
102 gchar* ghb_sanitize_x264opts(signal_user_data_t *ud, const gchar *options);
103
104 gint ghb_pref_acount(GValue *settings);
105 gint ghb_pref_acodec(GValue *settings, gint index);
106 gint ghb_pref_bitrate(GValue *settings, gint index);
107 gint ghb_pref_rate(GValue *settings, gint index);
108 gint ghb_pref_mix(GValue *settings, gint index);
109 gdouble ghb_pref_drc(GValue *settings, gint index);
110
111 #endif // _SETTINGS_H_