OSDN Git Service

LinGui: Add mp4 options to queue description
[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
22 enum
23 {
24         GHB_ERROR_NONE,
25         GHB_ERROR_CANCELED,
26         GHB_ERROR_FAIL,
27 };
28
29 typedef struct ghb_status_s
30 {
31         gint state;
32         gint queue_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_status_t;
50
51 #define GHB_SCALE_KEEP_NONE 0
52 #define GHB_SCALE_KEEP_WIDTH 1
53 #define GHB_SCALE_KEEP_HEIGHT 2
54
55 typedef struct
56 {
57         gint width;
58         gint height;
59         gint crop[4];
60         gint num_chapters;
61         gint rate;
62         gint rate_base;
63         gint aspect_n;
64         gint aspect_d;
65         gint hours;
66         gint minutes;
67         gint seconds;
68         gint64 duration;
69 } ghb_title_info_t;
70
71 typedef struct
72 {
73         gint codec;
74         gint bitrate;
75         gint samplerate;
76 } ghb_audio_info_t;
77
78 #define GHB_AUDIO_SAMPLERATE 1
79 #define GHB_AUDIO_BITRATE 2
80 #define GHB_FRAMERATE 3
81
82 const gchar* ghb_version(void);
83 void ghb_vquality_range(signal_user_data_t *ud, gint *min, gint *max);
84 //const gchar* ghb_get_rate_string(gint rate, gint type);
85 void ghb_backend_init(GtkBuilder *builder, gint debug, gint update);
86 void ghb_backend_close(void);
87 void ghb_add_job(GValue *js, gint unique_id);
88 void ghb_remove_job(gint unique_id);
89 void ghb_start_queue(void);
90 void ghb_stop_queue(void);
91 void ghb_pause_queue(void);
92
93 gint ghb_get_state(void);
94 void ghb_clear_state(gint state);
95 void ghb_clear_queue_state(gint state);
96
97 void ghb_set_state(gint state);
98 gint ghb_get_queue_state();
99 void ghb_get_status(ghb_status_t *status);
100 void ghb_track_status(void);
101 void ghb_backend_scan(const gchar *path, gint titleindex);
102 void ghb_backend_queue_scan(const gchar *path, gint titleindex);
103 gboolean ghb_get_title_info(ghb_title_info_t *tinfo, gint titleindex);
104 void ghb_set_scale(signal_user_data_t *ud, gint mode);
105 GValue* ghb_get_chapters(gint titleindex);
106 gint ghb_get_best_mix(gint titleindex, gint track, gint acodec, gint mix);
107 gboolean ghb_ac3_in_audio_list(const GValue *audio_list);
108 gboolean ghb_audio_is_passthru(gint acodec);
109 gint ghb_get_default_acodec(void);
110 gboolean ghb_get_audio_info(
111         ghb_audio_info_t *ainfo, gint titleindex, gint audioindex);
112 gboolean ghb_set_passthru_rate_opts(GtkBuilder *builder, gint bitrate);
113 gboolean ghb_set_default_rate_opts(GtkBuilder *builder);
114 void ghb_grey_combo_options(GtkBuilder *builder);
115 void ghb_update_ui_combo_box(
116         GtkBuilder *builder, const gchar *name, gint user_data, gboolean all);
117 gint ghb_find_audio_track(gint titleindex, const gchar *lang, gint index);
118 gint ghb_longest_title(void);
119 gchar* ghb_build_x264opts_string(GValue *settings);
120 GdkPixbuf* ghb_get_preview_image(
121         gint titleindex, gint index, GValue *settings, gboolean borders);
122 gint ghb_calculate_target_bitrate(GValue *settings, gint titleindex);
123 gchar* ghb_dvd_volname(const gchar *device);
124 gint ghb_get_title_number(gint titleindex);
125
126 gint ghb_guess_bitrate(GValue *settings);
127 gboolean ghb_validate_container(signal_user_data_t *ud);
128 gboolean ghb_validate_vquality(GValue *settings);
129 gboolean ghb_validate_audio(signal_user_data_t *ud);
130 gboolean ghb_validate_video(signal_user_data_t *ud);
131 gboolean ghb_validate_filters(signal_user_data_t *ud);
132 gboolean ghb_validate_filter_string(const gchar *str, gint max_fields);
133 void ghb_hb_cleanup(gboolean partial);
134 gint ghb_lookup_acodec(const GValue *acodec);
135 const gchar* ghb_lookup_acodec_option(const GValue *acodec);
136 gint ghb_lookup_mix(const GValue *mix);
137 const gchar* ghb_lookup_mix_option(const GValue *mix);
138 const gchar* ghb_lookup_container_option(const GValue *container);
139 gint ghb_lookup_container(const GValue *container);
140 const gchar* ghb_lookup_vcodec_option(const GValue *vcodec);
141 #if 0
142 gint ghb_lookup_bitrate(const gchar *bitrate);
143 gint ghb_lookup_rate(const gchar *rate);
144 gdouble ghb_lookup_drc(const gchar *drc);
145 #endif
146
147 #endif // _HBBACKEND_H_