summaryrefslogtreecommitdiffstats
path: root/gtk/src/subtitlehandler.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2014-02-23 17:22:05 +0000
committerjstebbins <[email protected]>2014-02-23 17:22:05 +0000
commit99c113391ca80041d963f55ed66b3e902a5af032 (patch)
treee1d433d1132de362c420b7a94feaaa107a74e34a /gtk/src/subtitlehandler.c
parent3c843089925a96a5a291d547be768412a1741791 (diff)
LinGui: rework how hb titles are referenced from lingui
Provides a less cryptic interface to identifying and looking up hb titles. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6064 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src/subtitlehandler.c')
-rw-r--r--gtk/src/subtitlehandler.c39
1 files changed, 23 insertions, 16 deletions
diff --git a/gtk/src/subtitlehandler.c b/gtk/src/subtitlehandler.c
index 6065f5a4a..cba0cbf54 100644
--- a/gtk/src/subtitlehandler.c
+++ b/gtk/src/subtitlehandler.c
@@ -309,7 +309,7 @@ subtitle_set_track_description(GValue *subsettings)
static GValue* subtitle_add_track(
signal_user_data_t *ud,
GValue *settings,
- hb_title_t *title,
+ const hb_title_t *title,
int track,
int mux,
gboolean default_track,
@@ -400,7 +400,7 @@ ghb_subtitle_title_change(signal_user_data_t *ud, gboolean show)
}
void
-ghb_set_pref_subtitle_settings(signal_user_data_t *ud, hb_title_t *title, GValue *settings)
+ghb_set_pref_subtitle_settings(signal_user_data_t *ud, const hb_title_t *title, GValue *settings)
{
gint track;
gboolean *used;
@@ -532,14 +532,12 @@ ghb_set_pref_subtitle_settings(signal_user_data_t *ud, hb_title_t *title, GValue
}
void
-ghb_set_pref_subtitle(gint titleindex, signal_user_data_t *ud)
+ghb_set_pref_subtitle(const hb_title_t *title, signal_user_data_t *ud)
{
- hb_title_t *title;
int sub_count;
GtkWidget *widget;
ghb_clear_subtitle_list_ui(ud->builder);
- title = ghb_get_title_info(titleindex);
if (title == NULL)
{
return;
@@ -1050,9 +1048,11 @@ subtitle_add_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
gboolean one_burned;
gint track, mux;
- hb_title_t *title;
- int titleindex = ghb_settings_combo_int(ud->settings, "title");
- title = ghb_get_title_info(titleindex);
+ int title_id, titleindex;
+ const hb_title_t *title;
+
+ title_id = ghb_settings_get_int(ud->settings, "title");
+ title = ghb_lookup_title(title_id, &titleindex);
if (title == NULL)
{
return;
@@ -1110,9 +1110,10 @@ subtitle_add_all_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
gboolean one_burned = FALSE;
gint track, mux;
- hb_title_t *title;
- int titleindex = ghb_settings_combo_int(ud->settings, "title");
- title = ghb_get_title_info(titleindex);
+ const hb_title_t *title;
+ int title_id, titleindex;
+ title_id = ghb_settings_get_int(ud->settings, "title");
+ title = ghb_lookup_title(title_id, &titleindex);
if (title == NULL)
{
return;
@@ -1136,8 +1137,12 @@ subtitle_add_all_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
G_MODULE_EXPORT void
subtitle_reset_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
{
- int titleindex = ghb_settings_combo_int(ud->settings, "title");
- ghb_set_pref_subtitle(titleindex, ud);
+ int title_id, titleindex;
+ const hb_title_t *title;
+
+ title_id = ghb_settings_get_int(ud->settings, "title");
+ title = ghb_lookup_title(title_id, &titleindex);
+ ghb_set_pref_subtitle(title, ud);
}
void
@@ -1187,13 +1192,15 @@ ghb_reset_subtitles(signal_user_data_t *ud, GValue *settings)
GValue *slist;
GValue *subtitle;
gint count, ii;
- gint titleindex;
+ gint title_id, titleindex;
+ const hb_title_t *title;
g_debug("ghb_reset_subtitles");
ghb_clear_subtitle_list_settings(ud->settings);
ghb_clear_subtitle_list_ui(ud->builder);
- titleindex = ghb_settings_combo_int(ud->settings, "title");
- if (titleindex < 0)
+ title_id = ghb_settings_get_int(ud->settings, "title");
+ title = ghb_lookup_title(title_id, &titleindex);
+ if (title == NULL)
return;
slist = ghb_settings_get_value(settings, "subtitle_list");