OSDN Git Service

LinGui: remove target file size option
[handbrake-jp/handbrake-jp-git.git] / gtk / src / hb-backend.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  
17 #if !defined(_HBBACKEND_H_)
18 #define _HBBACKEND_H_
19
20 #include "settings.h"
21 #include "hb.h"
22
23 enum
24 {
25         GHB_ERROR_NONE,
26         GHB_ERROR_CANCELED,
27         GHB_ERROR_FAIL,
28 };
29
30 typedef struct
31 {
32         gint state;
33
34         // SCANNING
35         gint title_count;
36         gint title_cur;
37
38         // WORKING
39         gint unique_id;
40         gint job_cur;
41         gint job_count;
42         gdouble progress;
43         gdouble rate_cur;
44         gdouble rate_avg;
45         gint hours;
46         gint minutes;
47         gint seconds;
48         gint error;
49 } ghb_instance_status_t;
50
51 typedef struct
52 {
53         ghb_instance_status_t scan;
54         ghb_instance_status_t queue;
55 } ghb_status_t;
56
57 #define GHB_PIC_KEEP_WIDTH          0x01
58 #define GHB_PIC_KEEP_HEIGHT         0x02
59 #define GHB_PIC_KEEP_DISPLAY_WIDTH  0x04
60 #define GHB_PIC_KEEP_DISPLAY_HEIGHT 0x08
61 #define GHB_PIC_KEEP_DAR            0x10
62 #define GHB_PIC_KEEP_PAR            0x20
63 #define GHB_PIC_USE_MAX             0x40
64
65 typedef struct
66 {
67         gchar *path;
68         gchar *name;
69         gint index;
70         gint type;
71         gint width;
72         gint height;
73         gint crop[4];
74         gint num_chapters;
75         gint rate;
76         gint rate_base;
77         gint interlaced;
78         gint aspect_n;
79         gint aspect_d;
80         gint hours;
81         gint minutes;
82         gint seconds;
83         gint64 duration;
84         gint angle_count;
85 } ghb_title_info_t;
86
87 #define GHB_AUDIO_SAMPLERATE 1
88 #define GHB_AUDIO_BITRATE 2
89 #define GHB_FRAMERATE 3
90
91 const gchar* ghb_version(void);
92 void ghb_vquality_range(
93         signal_user_data_t *ud, 
94         gdouble *min, 
95         gdouble *max,
96         gdouble *step,
97         gdouble *page,
98         gint *digits,
99         gboolean *inverted);
100 //const gchar* ghb_get_rate_string(gint rate, gint type);
101 void ghb_combo_init(signal_user_data_t *ud);
102 void ghb_backend_init(gint debug);
103 void ghb_backend_close(void);
104 void ghb_add_job(GValue *js, gint unique_id);
105 void ghb_remove_job(gint unique_id);
106 void ghb_start_queue(void);
107 void ghb_stop_queue(void);
108 void ghb_pause_queue(void);
109
110 void ghb_add_live_job(GValue *js, gint unique_id);
111 void ghb_start_live_encode();
112 void ghb_stop_live_encode();
113
114 void ghb_clear_scan_state(gint state);
115 void ghb_clear_queue_state(gint state);
116
117 void ghb_set_state(gint state);
118 gint ghb_get_scan_state();
119 gint ghb_get_queue_state();
120 void ghb_get_status(ghb_status_t *status);
121 void ghb_track_status(void);
122 void ghb_backend_scan(const gchar *path, gint titleindex, gint preview_count, guint64 min_duration);
123 void ghb_backend_scan_stop();
124 void ghb_backend_queue_scan(const gchar *path, gint titleindex);
125 gboolean ghb_get_title_info(ghb_title_info_t *tinfo, gint titleindex);
126 void ghb_par_init(signal_user_data_t *ud);
127 void ghb_set_scale(signal_user_data_t *ud, gint mode);
128 GValue* ghb_get_chapters(gint titleindex);
129 void ghb_get_chapter_duration(gint ti, gint ii, gint *hh, gint *mm, gint *ss);
130 void ghb_part_duration(gint tt, gint sc, gint ec, gint *hh, gint *mm, gint *ss);
131 gint ghb_get_best_mix(hb_audio_config_t *aconfig, gint acodec, gint mix);
132 gboolean ghb_ac3_in_audio_list(const GValue *audio_list);
133 gboolean ghb_audio_is_passthru(gint acodec);
134 gboolean ghb_audio_can_passthru(gint acodec);
135 gint ghb_get_default_acodec(void);
136 hb_audio_config_t* ghb_get_scan_audio_info(gint titleindex, gint audioindex);
137 void ghb_set_passthru_bitrate_opts(GtkBuilder *builder, gint bitrate);
138 void ghb_set_default_bitrate_opts(
139         GtkBuilder *builder, gint first_rate, gint last_rate);
140 void ghb_grey_combo_options(GtkBuilder *builder);
141 void ghb_update_ui_combo_box(
142         signal_user_data_t *ud, const gchar *name, gint user_data, gboolean all);
143 gchar* ghb_get_source_audio_lang(gint titleindex, gint track);
144 gint ghb_find_audio_track(
145         gint titleindex, const gchar *lang, gint acodec, 
146         gint fallback_acodec, GHashTable *track_indices);
147 void ghb_add_all_subtitles(signal_user_data_t *ud, gint titleindex);
148 gint ghb_find_pref_subtitle_track(const gchar *lang);
149 gint ghb_find_subtitle_track(
150         gint titleindex, const gchar *lang, gboolean burn, 
151         gboolean force, gint source, GHashTable *track_indices);
152 gint ghb_pick_subtitle_track(signal_user_data_t *ud);
153 gint ghb_find_cc_track(gint titleindex);
154 gint ghb_longest_title(void);
155 gchar* ghb_build_x264opts_string(GValue *settings);
156 GdkPixbuf* ghb_get_preview_image(
157         gint titleindex, gint index, signal_user_data_t *ud,
158         gint *width, gint *height);
159 gchar* ghb_dvd_volname(const gchar *device);
160 gint ghb_get_title_number(gint titleindex);
161 gint ghb_subtitle_track_source(signal_user_data_t *ud, gint track);
162 const char* ghb_subtitle_track_source_name(signal_user_data_t *ud, gint track);
163 const char* ghb_subtitle_source_name(gint source);
164 gchar* ghb_subtitle_track_lang(signal_user_data_t *ud, gint track);
165
166 gboolean ghb_validate_vquality(GValue *settings);
167 gboolean ghb_validate_audio(signal_user_data_t *ud);
168 gboolean ghb_validate_subtitles(signal_user_data_t *ud);
169 gboolean ghb_validate_video(signal_user_data_t *ud);
170 gboolean ghb_validate_filters(signal_user_data_t *ud);
171 gboolean ghb_validate_filter_string(const gchar *str, gint max_fields);
172 void ghb_hb_cleanup(gboolean partial);
173 gint ghb_lookup_combo_int(const gchar *name, const GValue *gval);
174 gdouble ghb_lookup_combo_double(const gchar *name, const GValue *gval);
175 const gchar* ghb_lookup_combo_option(const gchar *name, const GValue *gval);
176 const gchar* ghb_lookup_combo_string(const gchar *name, const GValue *gval);
177 gchar* ghb_get_tmp_dir();
178 gint ghb_select_audio_codec(GValue *settings, hb_audio_config_t *aconfig, gint acodec);
179 gint ghb_find_closest_audio_rate(gint rate);
180 GValue* ghb_lookup_acodec_value(gint val);
181
182 #endif // _HBBACKEND_H_