OSDN Git Service

LinGui: make the progress bar behave better when scanning while encoding
[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_EVENT_NONE,
25         GHB_EVENT_SCAN_DONE,
26         GHB_EVENT_WORKING,
27         GHB_EVENT_PAUSED,
28         GHB_EVENT_WORK_DONE,
29         GHB_EVENT_WORK_CANCELED
30 };
31
32 typedef struct ghb_status_s
33 {
34         gint state;
35         gint title_count;
36         gint title_cur;
37         gint unique_id;
38         gint job_cur;
39         gint job_count;
40         gdouble progress;
41         gdouble rate_cur;
42         gdouble rate_avg;
43         gint hours;
44         gint minutes;
45         gint seconds;
46         gint error;
47 } ghb_status_t;
48
49 #define GHB_SCALE_KEEP_NONE 0
50 #define GHB_SCALE_KEEP_WIDTH 1
51 #define GHB_SCALE_KEEP_HEIGHT 2
52
53 typedef struct
54 {
55         gint width;
56         gint height;
57         gint crop[4];
58         gint num_chapters;
59         gint rate;
60         gint rate_base;
61         gint aspect_n;
62         gint aspect_d;
63         gint hours;
64         gint minutes;
65         gint seconds;
66 } ghb_title_info_t;
67
68 typedef struct
69 {
70         gint codec;
71         gint bitrate;
72         gint samplerate;
73 } ghb_audio_info_t;
74
75 #define GHB_AUDIO_SAMPLERATE 1
76 #define GHB_AUDIO_BITRATE 2
77 #define GHB_FRAMERATE 3
78
79 const gchar* ghb_version();
80 void ghb_vquality_range(signal_user_data_t *ud, gint *min, gint *max);
81 //const gchar* ghb_get_rate_string(gint rate, gint type);
82 void ghb_backend_init(GtkBuilder *builder, gint debug, gint update);
83 void ghb_add_job(job_settings_t *js, gint unique_id);
84 void ghb_remove_job(gint unique_id);
85 void ghb_start_queue();
86 void ghb_stop_queue();
87 void ghb_pause_queue();
88
89 gint ghb_backend_events(signal_user_data_t *ud, gint *unique_id);
90 void ghb_backend_scan(const gchar *path, gint titleindex);
91 gboolean ghb_get_title_info(ghb_title_info_t *tinfo, gint titleindex);
92 void ghb_set_scale(signal_user_data_t *ud, gint mode);
93 gchar ** ghb_get_chapters(gint titleindex);
94 gint ghb_get_best_mix(gint titleindex, gint track, gint acodec, gint mix);
95 gboolean ghb_audio_is_passthru(gint acodec);
96 gint ghb_get_default_acodec();
97 gboolean ghb_get_audio_info(ghb_audio_info_t *ainfo, gint titleindex, gint audioindex);
98 gboolean ghb_set_passthru_rate_opts(GtkBuilder *builder, gint bitrate);
99 gboolean ghb_set_default_rate_opts(GtkBuilder *builder);
100 void ghb_grey_combo_options(GtkBuilder *builder);
101 void ghb_update_ui_combo_box(GtkBuilder *builder, const gchar *name, gint user_data, gboolean all);
102 gint ghb_find_audio_track(gint titleindex, const gchar *lang, gint acodec);
103 gint ghb_longest_title();
104 gchar* ghb_build_x264opts_string(GHashTable *settings);
105 GdkPixbuf* ghb_get_preview_image(gint titleindex, gint index, GHashTable *settings, gboolean borders);
106 gint ghb_calculate_target_bitrate(GHashTable *settings, gint titleindex);
107 gchar* ghb_dvd_volname(const gchar *device);
108
109 gint ghb_guess_bitrate(GHashTable *settings);
110 gboolean ghb_validate_vquality(GHashTable *settings);
111 gboolean ghb_validate_audio(signal_user_data_t *ud);
112 gboolean ghb_validate_video(signal_user_data_t *ud);
113 void ghb_hb_cleanup(gboolean partial);
114
115 #endif // _HBBACKEND_H_