summaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2019-01-05 16:53:50 -0700
committerJohn Stebbins <[email protected]>2019-01-14 13:36:08 -0800
commit36a9a9f63aaf8dad0e84605354e5e9d4359429eb (patch)
tree84f26ffe3a82b6272e6fb205bddc35f26f8f8c3d /gtk
parent776c2d3d93c08c6cc12d9fc42bc290c3e57772ff (diff)
Add SSA subtitle import
Diffstat (limited to 'gtk')
-rw-r--r--gtk/src/ghb.m428
-rw-r--r--gtk/src/hb-backend.c12
-rw-r--r--gtk/src/internal_defaults.json6
-rw-r--r--gtk/src/queuehandler.c60
-rw-r--r--gtk/src/subtitlehandler.c163
5 files changed, 162 insertions, 107 deletions
diff --git a/gtk/src/ghb.m4 b/gtk/src/ghb.m4
index e4f80c39b..d1af69c13 100644
--- a/gtk/src/ghb.m4
+++ b/gtk/src/ghb.m4
@@ -8133,7 +8133,7 @@ filter_output([
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="icon_name">gtk-ok</property>
</object>
- <object class="GtkImage" id="srt_add_image">
+ <object class="GtkImage" id="import_add_image">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
@@ -8195,7 +8195,7 @@ filter_output([
</packing>
</child>
<child>
- <object class="GtkBox" id="subtitle_srt_switch_box">
+ <object class="GtkBox" id="subtitle_import_switch_box">
<property name="orientation">horizontal</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -8210,7 +8210,7 @@ filter_output([
<property name="tooltip_text" translatable="yes">Enable settings to import an SRT subtitle file</property>
<property name="halign">start</property>
<property name="draw_indicator">True</property>
- <signal name="toggled" handler="subtitle_srt_radio_toggled_cb" swapped="no"/>
+ <signal name="toggled" handler="subtitle_import_radio_toggled_cb" swapped="no"/>
</object>
<packing>
<property name="position">1</property>
@@ -8244,14 +8244,14 @@ filter_output([
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
- <object class="GtkGrid" id="subtitle_srt_grid">
+ <object class="GtkGrid" id="subtitle_import_grid">
<property name="visible">True</property>
<property name="row-spacing">2</property>
<property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="column_spacing">4</property>
<child>
- <object class="GtkLabel" id="srt_lang_label">
+ <object class="GtkLabel" id="import_lang_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
@@ -8279,7 +8279,7 @@ filter_output([
</packing>
</child>
<child>
- <object class="GtkLabel" id="srt_file_label">
+ <object class="GtkLabel" id="import_file_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
@@ -8294,7 +8294,7 @@ filter_output([
</packing>
</child>
<child>
- <object class="GtkLabel" id="srt_offset_label">
+ <object class="GtkLabel" id="import_offset_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
@@ -8308,14 +8308,14 @@ filter_output([
</packing>
</child>
<child>
- <object class="GtkComboBox" id="SrtLanguage">
+ <object class="GtkComboBox" id="ImportLanguage">
<property name="valign">GTK_ALIGN_CENTER</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="tooltip_text" translatable="yes">Set the language of this subtitle.
This value will be used by players in subtitle menus.</property>
- <signal name="changed" handler="srt_lang_changed_cb" swapped="no"/>
+ <signal name="changed" handler="import_lang_changed_cb" swapped="no"/>
</object>
<packing>
<property name="top_attach">1</property>
@@ -8352,14 +8352,14 @@ The source's character code is needed in order to perform this translation.</pro
</packing>
</child>
<child>
- <object class="GtkFileChooserButton" id="SrtFile">
+ <object class="GtkFileChooserButton" id="ImportFile">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">Select the SRT file to import.</property>
<property name="local_only">False</property>
<property name="hexpand">True</property>
- <property name="title" translatable="yes">Srt File</property>
- <signal name="selection-changed" handler="srt_file_changed_cb" swapped="no"/>
+ <property name="title" translatable="yes">Import File</property>
+ <signal name="selection-changed" handler="import_file_changed_cb" swapped="no"/>
</object>
<packing>
<property name="top_attach">2</property>
@@ -8369,14 +8369,14 @@ The source's character code is needed in order to perform this translation.</pro
</packing>
</child>
<child>
- <object class="GtkSpinButton" id="SrtOffset">
+ <object class="GtkSpinButton" id="ImportOffset">
<property name="width-chars">8</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="tooltip_text" translatable="yes">Adjust the offset in milliseconds between video and SRT timestamps</property>
<property name="adjustment">adjustment31</property>
- <signal name="value-changed" handler="srt_offset_changed_cb" swapped="no"/>
+ <signal name="value-changed" handler="import_offset_changed_cb" swapped="no"/>
</object>
<packing>
<property name="top_attach">1</property>
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c
index 19619e327..e433d50de 100644
--- a/gtk/src/hb-backend.c
+++ b/gtk/src/hb-backend.c
@@ -649,7 +649,7 @@ combo_name_map_t combo_name_map[] =
NULL
},
{
- "SrtLanguage",
+ "ImportLanguage",
NULL,
language_opts_set,
NULL
@@ -1067,7 +1067,7 @@ ghb_subtitle_track_source(GhbValue *settings, gint track)
const hb_title_t *title;
if (track == -2)
- return SRTSUB;
+ return IMPORTSRT;
if (track < 0)
return VOBSUB;
title_id = ghb_dict_get_int(settings, "title");
@@ -4336,7 +4336,7 @@ ghb_validate_subtitles(GhbValue *settings, GtkWindow *parent)
return FALSE;
}
- const GhbValue *slist, *subtitle, *srt;
+ const GhbValue *slist, *subtitle, *import;
gint count, ii, track;
gboolean burned, one_burned = FALSE;
@@ -4346,7 +4346,7 @@ ghb_validate_subtitles(GhbValue *settings, GtkWindow *parent)
{
subtitle = ghb_array_get(slist, ii);
track = ghb_dict_get_int(subtitle, "Track");
- srt = ghb_dict_get(subtitle, "SRT");
+ import = ghb_dict_get(subtitle, "Import");
burned = track != -1 && ghb_dict_get_bool(subtitle, "Burn");
if (burned && one_burned)
{
@@ -4369,11 +4369,11 @@ ghb_validate_subtitles(GhbValue *settings, GtkWindow *parent)
{
one_burned = TRUE;
}
- if (srt != NULL)
+ if (import != NULL)
{
const gchar *filename;
- filename = ghb_dict_get_string(srt, "Filename");
+ filename = ghb_dict_get_string(import, "Filename");
if (!g_file_test(filename, G_FILE_TEST_IS_REGULAR))
{
message = g_strdup_printf(
diff --git a/gtk/src/internal_defaults.json b/gtk/src/internal_defaults.json
index 5bc643eb1..4efec43ad 100644
--- a/gtk/src/internal_defaults.json
+++ b/gtk/src/internal_defaults.json
@@ -57,10 +57,10 @@
"chapter_list": [],
"vquality_type_bitrate": false,
"vquality_type_constant": false,
- "SrtLanguage": "und",
+ "ImportLanguage": "und",
"SrtCodeset": "ISO-8859-1",
- "SrtFile": "",
- "SrtOffset": 0,
+ "ImportFile": "",
+ "ImportOffset": 0,
"VideoFramerateCFR": false,
"VideoFrameratePFR": false,
"VideoFramerateVFR": true,
diff --git a/gtk/src/queuehandler.c b/gtk/src/queuehandler.c
index ccc811767..488c4d195 100644
--- a/gtk/src/queuehandler.c
+++ b/gtk/src/queuehandler.c
@@ -82,18 +82,20 @@ char *
ghb_subtitle_short_description(const GhbValue *subsource,
const GhbValue *subsettings)
{
- GhbValue *srt;
+ GhbValue *import;
char *desc = NULL;
- srt = ghb_dict_get(subsettings, "SRT");
- if (srt != NULL)
+ import = ghb_dict_get(subsettings, "Import");
+ if (import != NULL)
{
+ const gchar *format = "SRT";
const gchar *code;
const gchar *lang;
const iso639_lang_t *iso;
- lang = ghb_dict_get_string(srt, "Language");
- code = ghb_dict_get_string(srt, "Codeset");
+ format = ghb_dict_get_string(import, "Format");
+ lang = ghb_dict_get_string(import, "Language");
+ code = ghb_dict_get_string(import, "Codeset");
iso = lang_lookup(lang);
if (iso != NULL)
@@ -104,7 +106,14 @@ ghb_subtitle_short_description(const GhbValue *subsource,
lang = iso->eng_name;
}
- desc = g_strdup_printf("%s (%s)(SRT)", lang, code);
+ if (code != NULL)
+ {
+ desc = g_strdup_printf("%s (%s)(%s)", lang, code, format);
+ }
+ else
+ {
+ desc = g_strdup_printf("%s (%s)", lang, format);
+ }
}
else if (subsource == NULL)
{
@@ -123,19 +132,21 @@ static char *
subtitle_get_track_description(const GhbValue *subsource,
const GhbValue *subsettings)
{
- GhbValue *srt;
+ GhbValue *import;
char *desc = NULL;
- srt = ghb_dict_get(subsettings, "SRT");
- if (srt != NULL)
+ import = ghb_dict_get(subsettings, "Import");
+ if (import != NULL)
{
+ const gchar *format = "SRT";
const gchar *filename, *code;
const gchar *lang;
const iso639_lang_t *iso;
- lang = ghb_dict_get_string(srt, "Language");
- code = ghb_dict_get_string(srt, "Codeset");
- filename = ghb_dict_get_string(srt, "Filename");
+ format = ghb_dict_get_string(import, "Format");
+ lang = ghb_dict_get_string(import, "Language");
+ code = ghb_dict_get_string(import, "Codeset");
+ filename = ghb_dict_get_string(import, "Filename");
iso = lang_lookup(lang);
if (iso != NULL)
@@ -151,12 +162,27 @@ subtitle_get_track_description(const GhbValue *subsource,
gchar *basename;
basename = g_path_get_basename(filename);
- desc = g_strdup_printf("%s (%s)(SRT)(%s)", lang, code, basename);
+ if (code != NULL)
+ {
+ desc = g_strdup_printf("%s (%s)(%s)(%s)",
+ lang, code, format, basename);
+ }
+ else
+ {
+ desc = g_strdup_printf("%s (%s)(%s)", lang, format, basename);
+ }
g_free(basename);
}
else
{
- desc = g_strdup_printf("%s (%s)(SRT)", lang, code);
+ if (code != NULL)
+ {
+ desc = g_strdup_printf("%s (%s)(%s)", lang, code, format);
+ }
+ else
+ {
+ desc = g_strdup_printf("%s (%s)", lang, format);
+ }
}
}
else if (subsource == NULL)
@@ -745,7 +771,7 @@ add_to_queue_list(signal_user_data_t *ud, GhbValue *queueDict, GtkTreeIter *pite
}
for (ii = 0; ii < count; ii++)
{
- GhbValue *subsettings, *subsource, *srt;
+ GhbValue *subsettings, *subsource, *import;
int track;
gboolean force, burn, def;
char * desc;
@@ -754,14 +780,14 @@ add_to_queue_list(signal_user_data_t *ud, GhbValue *queueDict, GtkTreeIter *pite
track = ghb_dict_get_int(subsettings, "Track");
subsource = ghb_array_get(titleSubtitleList, track);
desc = subtitle_get_track_description(subsource, subsettings);
- srt = ghb_dict_get(subsettings, "SRT");
+ import = ghb_dict_get(subsettings, "Import");
force = ghb_dict_get_bool(subsettings, "Forced");
burn = ghb_dict_get_bool(subsettings, "Burn");
def = ghb_dict_get_bool(subsettings, "Default");
if (count + search > 1)
XPRINT("\t");
- if (srt == NULL)
+ if (import == NULL)
{
XPRINT("<small>%s%s%s%s</small>\n", desc,
force ? _(" (Forced Only)") : "",
diff --git a/gtk/src/subtitlehandler.c b/gtk/src/subtitlehandler.c
index a5a5be9e9..a4fd3314b 100644
--- a/gtk/src/subtitlehandler.c
+++ b/gtk/src/subtitlehandler.c
@@ -46,9 +46,17 @@ static void clear_subtitle_list_ui(GtkBuilder *builder);
static int get_sub_source(GhbValue *settings, GhbValue *subsettings)
{
- if (ghb_dict_get(subsettings, "SRT") != NULL)
+ GhbValue *import;
+
+ import = ghb_dict_get(subsettings, "Import");
+ if (import != NULL)
{
- return SRTSUB;
+ const char * format = ghb_dict_get_string(import, "Format");
+ if (format != NULL && !strcasecmp(format, "SSA"))
+ {
+ return IMPORTSSA;
+ }
+ return IMPORTSRT;
}
int title_id = ghb_dict_get_int(settings, "title");
@@ -91,7 +99,7 @@ subtitle_refresh_list_row_ui(
desc = subtitle_get_track_description(settings, subsettings);
info_src = g_strdup_printf("<small>%s</small>", desc);
g_free(desc);
- if (ghb_dict_get(subsettings, "SRT") != NULL)
+ if (ghb_dict_get(subsettings, "Import") != NULL)
{
gint offset;
offset = ghb_dict_get_int(subsettings, "Offset");
@@ -329,19 +337,21 @@ subtitle_add_to_settings(GhbValue *settings, GhbValue *subsettings)
static char *
subtitle_get_track_description(GhbValue *settings, GhbValue *subsettings)
{
- GhbValue *srt;
+ GhbValue * import;
char *desc = NULL;
- srt = ghb_dict_get(subsettings, "SRT");
- if (srt != NULL)
+ import = ghb_dict_get(subsettings, "Import");
+ if (import != NULL)
{
- const gchar *filename, *code;
- const gchar *lang;
- const iso639_lang_t *iso;
+ const gchar * format = "SRT";
+ const gchar * filename, * code;
+ const gchar * lang;
+ const iso639_lang_t * iso;
- lang = ghb_dict_get_string(srt, "Language");
- code = ghb_dict_get_string(srt, "Codeset");
- filename = ghb_dict_get_string(srt, "Filename");
+ format = ghb_dict_get_string(import, "Format");
+ filename = ghb_dict_get_string(import, "Filename");
+ lang = ghb_dict_get_string(import, "Language");
+ code = ghb_dict_get_string(import, "Codeset");
iso = lang_lookup(lang);
if (iso != NULL)
@@ -357,12 +367,27 @@ subtitle_get_track_description(GhbValue *settings, GhbValue *subsettings)
gchar *basename;
basename = g_path_get_basename(filename);
- desc = g_strdup_printf("%s (%s)(SRT)(%s)", lang, code, basename);
+ if (code != NULL)
+ {
+ desc = g_strdup_printf("%s (%s)(%s)(%s)",
+ lang, code, format, basename);
+ }
+ else
+ {
+ desc = g_strdup_printf("%s (%s)(%s)", lang, format, basename);
+ }
g_free(basename);
}
else
{
- desc = g_strdup_printf("%s (%s)(SRT)", lang, code);
+ if (code != NULL)
+ {
+ desc = g_strdup_printf("%s (%s)(%s)", lang, code, format);
+ }
+ else
+ {
+ desc = g_strdup_printf("%s (%s)", lang, format);
+ }
}
}
else
@@ -401,21 +426,16 @@ static GhbValue* subtitle_add_track(
int track,
int mux,
gboolean default_track,
- gboolean srt,
+ gboolean import,
+ int source,
gboolean burn,
gboolean *burned)
{
- int source = VOBSUB;
-
- if (track >= 0 && !srt)
+ if (track >= 0 && !import)
{
hb_subtitle_t *subtitle = hb_list_item(title->list_subtitle, track);
source = subtitle->source;
}
- else if (srt)
- {
- source = SRTSUB;
- }
burn |= !hb_subtitle_can_pass(source, mux);
@@ -426,23 +446,25 @@ static GhbValue* subtitle_add_track(
}
GhbValue *subsettings = ghb_dict_new();
- if (srt)
+ if (import)
{
// Set default SRT settings
- GhbValue *srt_dict;
+ GhbValue *import_dict;
const gchar *pref_lang, *dir;
gchar *filename;
- srt_dict = ghb_dict_new();
- hb_dict_set(subsettings, "SRT", srt_dict);
+ import_dict = ghb_dict_new();
+ hb_dict_set(subsettings, "Import", import_dict);
+ ghb_dict_set_string(import_dict, "Format",
+ source == IMPORTSRT ? "SRT" : "SSA");
pref_lang = ghb_dict_get_string(settings, "PreferredLanguage");
- ghb_dict_set_string(srt_dict, "Language", pref_lang);
- ghb_dict_set_string(srt_dict, "Codeset", "UTF-8");
+ ghb_dict_set_string(import_dict, "Language", pref_lang);
+ ghb_dict_set_string(import_dict, "Codeset", "UTF-8");
dir = ghb_dict_get_string(ud->prefs, "SrtDir");
filename = g_strdup_printf("%s/none", dir);
- ghb_dict_set_string(srt_dict, "Filename", filename);
+ ghb_dict_set_string(import_dict, "Filename", filename);
g_free(filename);
}
@@ -600,7 +622,7 @@ subtitle_update_dialog_widgets(signal_user_data_t *ud, GhbValue *subsettings)
if (subsettings != NULL)
{
// Update widgets with subsettings
- GhbValue *val, *srt;
+ GhbValue *val, *import;
gboolean burn, force, def;
int source;
@@ -610,7 +632,7 @@ subtitle_update_dialog_widgets(signal_user_data_t *ud, GhbValue *subsettings)
mux_id = ghb_dict_get_string(ud->settings, "FileFormat");
mux = ghb_lookup_container_by_name(mux_id);
- srt = ghb_dict_get(subsettings, "SRT");
+ import = ghb_dict_get(subsettings, "Import");
source = get_sub_source(ud->settings, subsettings);
val = ghb_dict_get(subsettings, "Track");
@@ -620,13 +642,18 @@ subtitle_update_dialog_widgets(signal_user_data_t *ud, GhbValue *subsettings)
// Hide regular subtitle widgets
widget = GHB_WIDGET(ud->builder, "subtitle_track_box");
- gtk_widget_set_visible(widget, srt == NULL);
-
- // Show SRT subitle widgets
- widget = GHB_WIDGET(ud->builder, "subtitle_srt_grid");
- gtk_widget_set_visible(widget, srt != NULL);
-
- widget = GHB_WIDGET(ud->builder, "subtitle_srt_switch_box");
+ gtk_widget_set_visible(widget, import == NULL);
+
+ // Show import subitle widgets
+ widget = GHB_WIDGET(ud->builder, "subtitle_import_grid");
+ gtk_widget_set_visible(widget, source == IMPORTSRT ||
+ source == IMPORTSSA);
+ widget = GHB_WIDGET(ud->builder, "srt_code_label");
+ gtk_widget_set_visible(widget, source == IMPORTSRT);
+ widget = GHB_WIDGET(ud->builder, "SrtCodeset");
+ gtk_widget_set_visible(widget, source == IMPORTSRT);
+
+ widget = GHB_WIDGET(ud->builder, "subtitle_import_switch_box");
gtk_widget_set_visible(widget, TRUE);
}
else
@@ -635,24 +662,24 @@ subtitle_update_dialog_widgets(signal_user_data_t *ud, GhbValue *subsettings)
widget = GHB_WIDGET(ud->builder, "subtitle_track_box");
gtk_widget_set_visible(widget, FALSE);
- widget = GHB_WIDGET(ud->builder, "subtitle_srt_grid");
+ widget = GHB_WIDGET(ud->builder, "subtitle_import_grid");
gtk_widget_set_visible(widget, FALSE);
- widget = GHB_WIDGET(ud->builder, "subtitle_srt_switch_box");
+ widget = GHB_WIDGET(ud->builder, "subtitle_import_switch_box");
gtk_widget_set_visible(widget, FALSE);
}
- if (srt != NULL)
+ if (import != NULL)
{
ghb_ui_update(ud, "SubtitleSrtEnable", ghb_boolean_value(TRUE));
- val = ghb_dict_get(srt, "Language");
- ghb_ui_update(ud, "SrtLanguage", val);
- val = ghb_dict_get(srt, "Codeset");
+ val = ghb_dict_get(import, "Language");
+ ghb_ui_update(ud, "ImportLanguage", val);
+ val = ghb_dict_get(import, "Codeset");
ghb_ui_update(ud, "SrtCodeset", val);
- val = ghb_dict_get(srt, "Filename");
- ghb_ui_update(ud, "SrtFile", val);
+ val = ghb_dict_get(import, "Filename");
+ ghb_ui_update(ud, "ImportFile", val);
val = ghb_dict_get(subsettings, "Offset");
- ghb_ui_update(ud, "SrtOffset", val);
+ ghb_ui_update(ud, "ImportOffset", val);
}
else
{
@@ -698,7 +725,7 @@ subtitle_update_dialog_widgets(signal_user_data_t *ud, GhbValue *subsettings)
else
{
// Hide SRT subitle widgets
- widget = GHB_WIDGET(ud->builder, "subtitle_srt_grid");
+ widget = GHB_WIDGET(ud->builder, "subtitle_import_grid");
gtk_widget_set_visible(widget, FALSE);
// Show regular subtitle widgets
@@ -793,7 +820,7 @@ subtitle_default_toggled_cb(GtkWidget *widget, signal_user_data_t *ud)
}
G_MODULE_EXPORT void
-subtitle_srt_radio_toggled_cb(GtkWidget *widget, signal_user_data_t *ud)
+subtitle_import_radio_toggled_cb(GtkWidget *widget, signal_user_data_t *ud)
{
GhbValue *subsettings;
@@ -807,7 +834,7 @@ subtitle_srt_radio_toggled_cb(GtkWidget *widget, signal_user_data_t *ud)
gchar *filename;
GhbValue *srt = ghb_dict_new();
- ghb_dict_set(subsettings, "SRT", srt);
+ ghb_dict_set(subsettings, "Import", srt);
pref_lang = ghb_dict_get_string(ud->settings, "PreferredLanguage");
ghb_dict_set_string(srt, "Language", pref_lang);
ghb_dict_set_string(srt, "Codeset", "UTF-8");
@@ -819,7 +846,7 @@ subtitle_srt_radio_toggled_cb(GtkWidget *widget, signal_user_data_t *ud)
}
else
{
- ghb_dict_remove(subsettings, "SRT");
+ ghb_dict_remove(subsettings, "Import");
}
subtitle_update_dialog_widgets(ud, subsettings);
subtitle_list_refresh_selected(ud, subsettings);
@@ -851,17 +878,17 @@ ghb_subtitle_list_refresh_all(signal_user_data_t *ud)
}
G_MODULE_EXPORT void
-srt_setting_update(GhbValue *val, const char *name, signal_user_data_t *ud)
+import_setting_update(GhbValue *val, const char *name, signal_user_data_t *ud)
{
GhbValue *subsettings;
subsettings = subtitle_get_selected_settings(ud, NULL);
if (subsettings != NULL)
{
- GhbValue *srt;
- srt = ghb_dict_get(subsettings, "SRT");
- if (srt != NULL)
+ GhbValue * import;
+ import = ghb_dict_get(subsettings, "Import");
+ if (import != NULL)
{
- ghb_dict_set(srt, name, val);
+ ghb_dict_set(import, name, val);
subtitle_list_refresh_selected(ud, subsettings);
ghb_update_summary_info(ud);
ghb_live_reset(ud);
@@ -878,7 +905,7 @@ srt_setting_update(GhbValue *val, const char *name, signal_user_data_t *ud)
}
G_MODULE_EXPORT void
-srt_offset_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
+import_offset_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
{
ghb_widget_to_setting(ud->settings, widget);
GhbValue *val = ghb_widget_value(widget);
@@ -894,17 +921,17 @@ srt_codeset_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
ghb_check_dependency(ud, widget, NULL);
GhbValue *val = ghb_dict_get(ud->settings, "SrtCodeset");
- srt_setting_update(ghb_value_dup(val), "Codeset", ud);
+ import_setting_update(ghb_value_dup(val), "Codeset", ud);
}
G_MODULE_EXPORT void
-srt_file_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
+import_file_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
{
ghb_widget_to_setting(ud->settings, widget);
ghb_check_dependency(ud, widget, NULL);
- GhbValue *val = ghb_dict_get(ud->settings, "SrtFile");
- srt_setting_update(ghb_value_dup(val), "Filename", ud);
+ GhbValue *val = ghb_dict_get(ud->settings, "ImportFile");
+ import_setting_update(ghb_value_dup(val), "Filename", ud);
// Update SrtDir preference
const gchar *filename;
@@ -925,13 +952,13 @@ srt_file_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
}
G_MODULE_EXPORT void
-srt_lang_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
+import_lang_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
{
ghb_widget_to_setting(ud->settings, widget);
ghb_check_dependency(ud, widget, NULL);
- GhbValue *val = ghb_dict_get(ud->settings, "SrtLanguage");
- srt_setting_update(ghb_value_dup(val), "Language", ud);
+ GhbValue *val = ghb_dict_get(ud->settings, "ImportLanguage");
+ import_setting_update(ghb_value_dup(val), "Language", ud);
}
static void
@@ -1074,12 +1101,14 @@ subtitle_add_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
subsettings == NULL && track < count; track++)
{
subsettings = subtitle_add_track(ud, ud->settings, title, track,
- mux->format, FALSE, FALSE, FALSE, &one_burned);
+ mux->format, FALSE, FALSE, VOBSUB,
+ FALSE, &one_burned);
}
if (subsettings == NULL)
{
subsettings = subtitle_add_track(ud, ud->settings, title, 0,
- mux->format, FALSE, TRUE, FALSE, &one_burned);
+ mux->format, FALSE, TRUE, IMPORTSRT,
+ FALSE, &one_burned);
}
if (subsettings != NULL)
{
@@ -1190,7 +1219,7 @@ subtitle_add_all_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
for (track = 0; track < count; track++)
{
subtitle_add_track(ud, ud->settings, title, track, mux->format,
- FALSE, FALSE, FALSE, &one_burned);
+ FALSE, FALSE, VOBSUB, FALSE, &one_burned);
}
subtitle_refresh_list_ui(ud);
ghb_update_summary_info(ud);