OSDN Git Service

LinGui: address scott's complaint that the way i handle audio presets
[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
33         // SCANNING
34         gint title_count;
35         gint title_cur;
36
37         // WORKING
38         gint unique_id;
39         gint job_cur;
40         gint job_count;
41         gdouble progress;
42         gdouble rate_cur;
43         gdouble rate_avg;
44         gint hours;
45         gint minutes;
46         gint seconds;
47         gint error;
48 } ghb_status_t;
49
50 #define GHB_SCALE_KEEP_NONE 0
51 #define GHB_SCALE_KEEP_WIDTH 1
52 #define GHB_SCALE_KEEP_HEIGHT 2
53
54 typedef struct
55 {
56         gint width;
57         gint height;
58         gint crop[4];
59         gint num_chapters;
60         gint rate;
61         gint rate_base;
62         gint aspect_n;
63         gint aspect_d;
64         gint hours;
65         gint minutes;
66         gint seconds;
67         gint64 duration;
68 } ghb_title_info_t;
69
70 typedef struct
71 {
72         gint codec;
73         gint bitrate;
74         gint samplerate;
75 } ghb_audio_info_t;
76
77 #define GHB_AUDIO_SAMPLERATE 1
78 #define GHB_AUDIO_BITRATE 2
79 #define GHB_FRAMERATE 3
80
81 const gchar* ghb_version();
82 void ghb_vquality_range(signal_user_data_t *ud, gint *min, gint *max);
83 //const gchar* ghb_get_rate_string(gint rate, gint type);
84 void ghb_backend_init(GtkBuilder *builder, gint debug, gint update);
85 void ghb_add_job(job_settings_t *js, gint unique_id);
86 void ghb_remove_job(gint unique_id);
87 void ghb_start_queue();
88 void ghb_stop_queue();
89 void ghb_pause_queue();
90
91 gint ghb_get_state();
92 void ghb_clear_state(gint state);
93 void ghb_set_state(gint state);
94 void ghb_get_status(ghb_status_t *status);
95 void ghb_track_status();
96 void ghb_backend_scan(const gchar *path, gint titleindex);
97 gboolean ghb_get_title_info(ghb_title_info_t *tinfo, gint titleindex);
98 void ghb_set_scale(signal_user_data_t *ud, gint mode);
99 gchar ** ghb_get_chapters(gint titleindex);
100 gint ghb_get_best_mix(gint titleindex, gint track, gint acodec, gint mix);
101 gboolean ghb_ac3_in_audio_list(GSList *audio_list);
102 gboolean ghb_audio_is_passthru(gint acodec);
103 gint ghb_get_default_acodec();
104 gboolean ghb_get_audio_info(ghb_audio_info_t *ainfo, gint titleindex, gint audioindex);
105 gboolean ghb_set_passthru_rate_opts(GtkBuilder *builder, gint bitrate);
106 gboolean ghb_set_default_rate_opts(GtkBuilder *builder);
107 void ghb_grey_combo_options(GtkBuilder *builder);
108 void ghb_update_ui_combo_box(GtkBuilder *builder, const gchar *name, gint user_data, gboolean all);
109 gint ghb_find_audio_track(gint titleindex, const gchar *lang, gint index);
110 gint ghb_longest_title();
111 gchar* ghb_build_x264opts_string(GHashTable *settings);
112 GdkPixbuf* ghb_get_preview_image(gint titleindex, gint index, GHashTable *settings, gboolean borders);
113 gint ghb_calculate_target_bitrate(GHashTable *settings, gint titleindex);
114 gchar* ghb_dvd_volname(const gchar *device);
115
116 gint ghb_guess_bitrate(GHashTable *settings);
117 gboolean ghb_validate_container(signal_user_data_t *ud);
118 gboolean ghb_validate_vquality(GHashTable *settings);
119 gboolean ghb_validate_audio(signal_user_data_t *ud);
120 gboolean ghb_validate_video(signal_user_data_t *ud);
121 void ghb_hb_cleanup(gboolean partial);
122 gint ghb_lookup_acodec(const gchar *acodec);
123 gint ghb_lookup_bitrate(const gchar *bitrate);
124 gint ghb_lookup_rate(const gchar *rate);
125 gint ghb_lookup_mix(const gchar *mix);
126 gdouble ghb_lookup_drc(const gchar *drc);
127
128 #endif // _HBBACKEND_H_