summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gtk/src/callbacks.c9
-rw-r--r--gtk/src/callbacks.h2
-rw-r--r--gtk/src/ghb3.ui60
-rw-r--r--gtk/src/ghb4.ui56
-rw-r--r--gtk/src/queuehandler.c54
5 files changed, 158 insertions, 23 deletions
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c
index 71db05b8f..5092fead6 100644
--- a/gtk/src/callbacks.c
+++ b/gtk/src/callbacks.c
@@ -1388,6 +1388,15 @@ source_dialog_extra_widgets(
gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 0);
}
+void ghb_break_pts_duration(gint64 ptsDuration, gint *hh, gint *mm, gdouble *ss)
+{
+ *hh = ptsDuration / (90000 * 60 * 60);
+ ptsDuration -= *hh * 90000 * 60 * 60;
+ *mm = ptsDuration / (90000 * 60);
+ ptsDuration -= *mm * 90000 * 60;
+ *ss = (gdouble)ptsDuration / 90000;
+}
+
void ghb_break_duration(gint64 duration, gint *hh, gint *mm, gint *ss)
{
*hh = duration / (60*60);
diff --git a/gtk/src/callbacks.h b/gtk/src/callbacks.h
index 110d1daaf..051c8e7ca 100644
--- a/gtk/src/callbacks.h
+++ b/gtk/src/callbacks.h
@@ -88,6 +88,8 @@ void ghb_scale_configure(signal_user_data_t *ud, char *name, double val,
void ghb_update_summary_info(signal_user_data_t *ud);
void ghb_set_title_settings(signal_user_data_t *ud, GhbValue *settings);
void ghb_browse_uri(signal_user_data_t *ud, const gchar *uri);
+void ghb_break_pts_duration(gint64 ptsDuration,
+ gint *hh, gint *mm, gdouble *ss);
void ghb_break_duration(gint64 duration, gint *hh, gint *mm, gint *ss);
#endif // _CALLBACKS_H_
diff --git a/gtk/src/ghb3.ui b/gtk/src/ghb3.ui
index e2c530b5a..c5363eb4f 100644
--- a/gtk/src/ghb3.ui
+++ b/gtk/src/ghb3.ui
@@ -808,6 +808,46 @@ Resets the queue job to pending and ready to run again.</property>
</packing>
</child>
<child>
+ <object class="GtkLabel" id="queue_summary_title_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="halign">start</property>
+ <property name="use_markup">True</property>
+ <property name="label" translatable="yes">Title:</property>
+ </object>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="left_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="queue_summary_title">
+ <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="halign">start</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="hexpand">False</property>
+ <property name="label" translatable="yes"></property>
+ <property name="width-chars">50</property>
+ <property name="lines">2</property>
+ <property name="wrap_mode">word-char</property>
+ <property name="ellipsize">middle</property>
+ <property name="selectable">True</property>
+ </object>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="left_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkLabel" id="queue_summary_dest_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -818,7 +858,7 @@ Resets the queue job to pending and ready to run again.</property>
<property name="label" translatable="yes">Destination:</property>
</object>
<packing>
- <property name="top_attach">2</property>
+ <property name="top_attach">3</property>
<property name="left_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
@@ -842,7 +882,7 @@ Resets the queue job to pending and ready to run again.</property>
<property name="margin-bottom">12</property>
</object>
<packing>
- <property name="top_attach">2</property>
+ <property name="top_attach">3</property>
<property name="left_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
@@ -859,7 +899,7 @@ Resets the queue job to pending and ready to run again.</property>
<property name="label" translatable="yes">Dimensions:</property>
</object>
<packing>
- <property name="top_attach">3</property>
+ <property name="top_attach">4</property>
<property name="left_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
@@ -878,7 +918,7 @@ Resets the queue job to pending and ready to run again.</property>
<property name="width-chars">50</property>
</object>
<packing>
- <property name="top_attach">3</property>
+ <property name="top_attach">4</property>
<property name="left_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
@@ -895,7 +935,7 @@ Resets the queue job to pending and ready to run again.</property>
<property name="label" translatable="yes">Video:</property>
</object>
<packing>
- <property name="top_attach">4</property>
+ <property name="top_attach">5</property>
<property name="left_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
@@ -914,7 +954,7 @@ Resets the queue job to pending and ready to run again.</property>
<property name="width-chars">50</property>
</object>
<packing>
- <property name="top_attach">4</property>
+ <property name="top_attach">5</property>
<property name="left_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
@@ -931,7 +971,7 @@ Resets the queue job to pending and ready to run again.</property>
<property name="label" translatable="yes">Audio:</property>
</object>
<packing>
- <property name="top_attach">5</property>
+ <property name="top_attach">6</property>
<property name="left_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
@@ -950,7 +990,7 @@ Resets the queue job to pending and ready to run again.</property>
<property name="width-chars">50</property>
</object>
<packing>
- <property name="top_attach">5</property>
+ <property name="top_attach">6</property>
<property name="left_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
@@ -967,7 +1007,7 @@ Resets the queue job to pending and ready to run again.</property>
<property name="label" translatable="yes">Subtitles:</property>
</object>
<packing>
- <property name="top_attach">6</property>
+ <property name="top_attach">7</property>
<property name="left_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
@@ -986,7 +1026,7 @@ Resets the queue job to pending and ready to run again.</property>
<property name="width-chars">50</property>
</object>
<packing>
- <property name="top_attach">6</property>
+ <property name="top_attach">7</property>
<property name="left_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
diff --git a/gtk/src/ghb4.ui b/gtk/src/ghb4.ui
index a04a2e3e6..113154d61 100644
--- a/gtk/src/ghb4.ui
+++ b/gtk/src/ghb4.ui
@@ -680,6 +680,42 @@ Resets the queue job to pending and ready to run again.</property>
</object>
</child>
<child>
+ <object class="GtkLabel" id="queue_summary_title_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="halign">start</property>
+ <property name="use_markup">True</property>
+ <property name="label" translatable="yes">Title:</property>
+ <layout>
+ <property name="top-attach">2</property>
+ <property name="left-attach">0</property>
+ </layout>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel" id="queue_summary_title">
+ <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="halign">start</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
+ <property name="hexpand">False</property>
+ <property name="label" translatable="yes"></property>
+ <property name="width-chars">50</property>
+ <property name="lines">2</property>
+ <property name="wrap_mode">word-char</property>
+ <property name="ellipsize">middle</property>
+ <property name="selectable">True</property>
+ <layout>
+ <property name="top-attach">2</property>
+ <property name="left-attach">1</property>
+ </layout>
+ </object>
+ </child>
+ <child>
<object class="GtkLabel" id="queue_summary_dest_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -689,7 +725,7 @@ Resets the queue job to pending and ready to run again.</property>
<property name="use_markup">True</property>
<property name="label" translatable="yes">Destination:</property>
<layout>
- <property name="top-attach">2</property>
+ <property name="top-attach">3</property>
<property name="left-attach">0</property>
</layout>
</object>
@@ -709,7 +745,7 @@ Resets the queue job to pending and ready to run again.</property>
<property name="selectable">True</property>
<property name="margin-bottom">12</property>
<layout>
- <property name="top-attach">2</property>
+ <property name="top-attach">3</property>
<property name="left-attach">1</property>
</layout>
</object>
@@ -724,7 +760,7 @@ Resets the queue job to pending and ready to run again.</property>
<property name="use_markup">True</property>
<property name="label" translatable="yes">Dimensions:</property>
<layout>
- <property name="top-attach">3</property>
+ <property name="top-attach">4</property>
<property name="left-attach">0</property>
</layout>
</object>
@@ -739,7 +775,7 @@ Resets the queue job to pending and ready to run again.</property>
<property name="label" translatable="yes"></property>
<property name="width-chars">50</property>
<layout>
- <property name="top-attach">3</property>
+ <property name="top-attach">4</property>
<property name="left-attach">1</property>
</layout>
</object>
@@ -754,7 +790,7 @@ Resets the queue job to pending and ready to run again.</property>
<property name="use_markup">True</property>
<property name="label" translatable="yes">Video:</property>
<layout>
- <property name="top-attach">4</property>
+ <property name="top-attach">5</property>
<property name="left-attach">0</property>
</layout>
</object>
@@ -769,7 +805,7 @@ Resets the queue job to pending and ready to run again.</property>
<property name="label" translatable="yes"></property>
<property name="width-chars">50</property>
<layout>
- <property name="top-attach">4</property>
+ <property name="top-attach">5</property>
<property name="left-attach">1</property>
</layout>
</object>
@@ -784,7 +820,7 @@ Resets the queue job to pending and ready to run again.</property>
<property name="use_markup">True</property>
<property name="label" translatable="yes">Audio:</property>
<layout>
- <property name="top-attach">5</property>
+ <property name="top-attach">6</property>
<property name="left-attach">0</property>
</layout>
</object>
@@ -799,7 +835,7 @@ Resets the queue job to pending and ready to run again.</property>
<property name="label" translatable="yes"></property>
<property name="width-chars">50</property>
<layout>
- <property name="top-attach">5</property>
+ <property name="top-attach">6</property>
<property name="left-attach">1</property>
</layout>
</object>
@@ -814,7 +850,7 @@ Resets the queue job to pending and ready to run again.</property>
<property name="use_markup">True</property>
<property name="label" translatable="yes">Subtitles:</property>
<layout>
- <property name="top-attach">6</property>
+ <property name="top-attach">7</property>
<property name="left-attach">0</property>
</layout>
</object>
@@ -829,7 +865,7 @@ Resets the queue job to pending and ready to run again.</property>
<property name="label" translatable="yes"></property>
<property name="width-chars">50</property>
<layout>
- <property name="top-attach">6</property>
+ <property name="top-attach">7</property>
<property name="left-attach">1</property>
</layout>
</object>
diff --git a/gtk/src/queuehandler.c b/gtk/src/queuehandler.c
index cf6c596ac..63fe4796b 100644
--- a/gtk/src/queuehandler.c
+++ b/gtk/src/queuehandler.c
@@ -151,12 +151,16 @@ queue_update_summary(GhbValue * queueDict, signal_user_data_t *ud)
const char * ctext;
const char * sep;
GtkWidget * widget;
- GhbValue * uiDict = NULL;
- GhbValue * titleDict = NULL;
+ GhbValue * uiDict = NULL;
+ GhbValue * jobDict = NULL;
+ GhbValue * sourceDict = NULL;
+ GhbValue * rangeDict = NULL;
+ GhbValue * titleDict = NULL;
if (queueDict != NULL)
{
uiDict = ghb_dict_get(queueDict, "uiSettings");
+ jobDict = ghb_dict_get(queueDict, "Job");
titleDict = ghb_dict_get(queueDict, "Title");
}
if (titleDict == NULL)
@@ -202,10 +206,54 @@ queue_update_summary(GhbValue * queueDict, signal_user_data_t *ud)
g_free(text);
// Source
- ctext = ghb_dict_get_string(titleDict, "Path");
+ sourceDict = ghb_dict_get(jobDict, "Source");
+ ctext = ghb_dict_get_string(sourceDict, "Path");
widget = GHB_WIDGET(ud->builder, "queue_summary_source");
gtk_label_set_text(GTK_LABEL(widget), ctext);
+ // Title
+ const char * rangeType;
+ int titleID;
+ int64_t rangeStart, rangeEnd;
+
+ titleID = ghb_dict_get_int(sourceDict, "Title");
+ rangeDict = ghb_dict_get(sourceDict, "Range");
+ rangeType = ghb_dict_get_string(rangeDict, "Type");
+ rangeStart = ghb_dict_get_int(rangeDict, "Start");
+ rangeEnd = ghb_dict_get_int(rangeDict, "End");
+
+ str = g_string_new("");
+ g_string_append_printf(str, "%-8d", titleID);
+ if (!strcmp(rangeType, "chapter"))
+ {
+ g_string_append_printf(str, "Chapters: %ld to %ld",
+ rangeStart, rangeEnd);
+ }
+ else if (!strcmp(rangeType, "time"))
+ {
+ int start_hh, start_mm;
+ double start_ss;
+ int end_hh, end_mm;
+ double end_ss;
+
+ ghb_break_pts_duration(rangeStart, &start_hh, &start_mm, &start_ss);
+ ghb_break_pts_duration(rangeEnd, &end_hh, &end_mm, &end_ss);
+ g_string_append_printf(str,
+ "Time: %02d:%02d:%05.2f to %02d:%02d:%05.2f",
+ start_hh, start_mm, start_ss,
+ end_hh, end_mm, end_ss);
+ }
+ else if (!strcmp(rangeType, "frame"))
+ {
+ g_string_append_printf(str, "Frames: %ld to %ld",
+ rangeStart, rangeEnd);
+ }
+ text = g_string_free(str, FALSE);
+ widget = GHB_WIDGET(ud->builder, "queue_summary_title");
+ gtk_label_set_text(GTK_LABEL(widget), text);
+ g_free(text);
+
+
// Destination
ctext = ghb_dict_get_string(uiDict, "destination");
str = g_string_new(ctext);