Commit 35e4bca3 authored by GitLab CI's avatar GitLab CI

Merge remote-tracking branch 'upstream/master' into master-build

* upstream/master:
  LinGui: more code refactoring
  LinGui: refactor some code
  LinGui: add options to open encode log and log directory
  LinGui: don't hide queue stats and activity tabs
  LinGui: minor layout and window label tweaks
  Fix "hardening features" log message
  LinGui: improve text of current encode pass in queue stats
  LinGui: update queue stats during queue scan
  LinGui: set file size stats to "Not Available" when stat fails
  reader: update hb_status_t eta_seconds during FAS
parents 49a16560 edeffe2f
Pipeline #68435389 failed with stages
in 53 minutes and 29 seconds
......@@ -76,6 +76,10 @@ ghb_SOURCES = \
subtitlehandler.c \
subtitlehandler.h \
main.c \
jobdict.c \
jobdict.h \
titledict.c \
titledict.h \
settings.c \
settings.h \
resources.c \
......
......@@ -26,6 +26,7 @@
#include "ghbcompat.h"
#include "hb.h"
#include "settings.h"
#include "jobdict.h"
#include "hb-backend.h"
#include "values.h"
#include "callbacks.h"
......
......@@ -78,6 +78,7 @@
#include "subtitlehandler.h"
#include "resources.h"
#include "settings.h"
#include "jobdict.h"
#include "presets.h"
#include "preview.h"
#include "values.h"
......@@ -1389,52 +1390,59 @@ void ghb_break_duration(gint64 duration, gint *hh, gint *mm, gint *ss)
*ss = duration % 60;
}
static void
update_title_duration(signal_user_data_t *ud)
gint64
ghb_title_range_get_duration(GhbValue * settings, const hb_title_t * title)
{
gint hh, mm, ss, start, end;
gchar *text;
GtkWidget *widget;
int title_id, titleindex;
const hb_title_t *title;
title_id = ghb_dict_get_int(ud->settings, "title");
title = ghb_lookup_title(title_id, &titleindex);
widget = GHB_WIDGET (ud->builder, "title_duration");
gint64 start, end;
if (ghb_settings_combo_int(ud->settings, "PtoPType") == 0)
if (ghb_settings_combo_int(settings, "PtoPType") == 0)
{
start = ghb_dict_get_int(ud->settings, "start_point");
end = ghb_dict_get_int(ud->settings, "end_point");
ghb_part_duration(title, start, end, &hh, &mm, &ss);
start = ghb_dict_get_int(settings, "start_point");
end = ghb_dict_get_int(settings, "end_point");
return ghb_chapter_range_get_duration(title, start, end) / 90000;
}
else if (ghb_settings_combo_int(ud->settings, "PtoPType") == 1)
else if (ghb_settings_combo_int(settings, "PtoPType") == 1)
{
gint duration;
start = ghb_dict_get_int(ud->settings, "start_point");
end = ghb_dict_get_int(ud->settings, "end_point");
duration = end - start;
ghb_break_duration(duration, &hh, &mm, &ss);
start = ghb_dict_get_int(settings, "start_point");
end = ghb_dict_get_int(settings, "end_point");
return end - start;
}
else if (ghb_settings_combo_int(ud->settings, "PtoPType") == 2)
else if (ghb_settings_combo_int(settings, "PtoPType") == 2)
{
if (title != NULL)
{
gint64 frames;
gint duration;
start = ghb_dict_get_int(ud->settings, "start_point");
end = ghb_dict_get_int(ud->settings, "end_point");
start = ghb_dict_get_int(settings, "start_point");
end = ghb_dict_get_int(settings, "end_point");
frames = end - start + 1;
duration = frames * title->vrate.den / title->vrate.num;
ghb_break_duration(duration, &hh, &mm, &ss);
return frames * title->vrate.den / title->vrate.num;
}
else
{
hh = mm = ss = 0;
return 0;
}
}
return 0;
}
static void
update_title_duration(signal_user_data_t *ud)
{
gint hh, mm, ss;
gint64 duration;
gchar *text;
GtkWidget *widget;
int title_id, titleindex;
const hb_title_t *title;
title_id = ghb_dict_get_int(ud->settings, "title");
title = ghb_lookup_title(title_id, &titleindex);
widget = GHB_WIDGET (ud->builder, "title_duration");
duration = ghb_title_range_get_duration(ud->settings, title);
ghb_break_duration(duration, &hh, &mm, &ss);
text = g_strdup_printf("%02d:%02d:%02d", hh, mm, ss);
gtk_label_set_text(GTK_LABEL(widget), text);
g_free(text);
......@@ -4145,6 +4153,7 @@ ghb_backend_events(signal_user_data_t *ud)
// happens fast enough that it can be missed
gtk_label_set_text(work_status, _("Scanning ..."));
gtk_progress_bar_set_fraction(progress, status.queue.progress);
ghb_queue_update_live_stats(ud, index, &status.queue);
ghb_queue_progress_set_fraction(ud, index, status.queue.progress);
}
else if (status.queue.state & GHB_STATE_SCANDONE)
......
......@@ -101,6 +101,14 @@ conjunction with the "Forced" option.</property>
<attribute name="label" translatable="yes">Open Destination Directory</attribute>
<attribute name="action">app.queue-open-dest</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Open Encode Log Directory</attribute>
<attribute name="action">app.queue-open-log-dir</attribute>
</item>
<item>
<attribute name="label" translatable="yes">Open Encode Log</attribute>
<attribute name="action">app.queue-open-log</attribute>
</item>
</section>
</menu>
......@@ -134,6 +142,7 @@ conjunction with the "Forced" option.</property>
</menu>
<object class="GtkWindow" id="presets_window">
<property name="title" translatable="yes">HandBrake Presets</property>
<property name="visible">False</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>
......@@ -316,6 +325,7 @@ conjunction with the "Forced" option.</property>
</object>
<object class="GtkWindow" id="queue_window">
<property name="title" translatable="yes">HandBrake Queue</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="resizable">True</property>
......@@ -324,6 +334,7 @@ conjunction with the "Forced" option.</property>
<property name="skip_taskbar_hint">True</property>
<property name="skip_pager_hint">True</property>
<property name="transient_for">hb_window</property>
<property name="default_width">1024</property>
<signal name="delete-event" handler="queue_window_delete_cb" swapped="no"/>
<child>
<object class="GtkBox" id="queue_tab">
......@@ -378,6 +389,7 @@ conjunction with the "Forced" option.</property>
<object class="GtkPaned" id="queue_box1">
<property name="orientation">horizontal</property>
<property name="visible">True</property>
<property name="position">500</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>
<child>
......@@ -512,7 +524,6 @@ conjunction with the "Forced" option.</property>
<property name="can_focus">True</property>
<property name="vexpand">True</property>
<property name="hexpand">True</property>
<property name="width_request">500</property>
<property name="selection_mode">single</property>
<property name="activate_on_single_click">False</property>
<signal name="row-selected" handler="queue_list_selection_changed_cb" swapped="no"/>
......@@ -1034,7 +1045,7 @@ Resets the queue job to pending and ready to run again.</property>
<property name="row-spacing">12</property>
<child>
<object class="GtkLabel" id="queue_stats_pass_label">
<property name="visible">True</property>
<property name="visible">False</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
......@@ -1051,7 +1062,7 @@ Resets the queue job to pending and ready to run again.</property>
</child>
<child>
<object class="GtkLabel" id="queue_stats_pass">
<property name="visible">True</property>
<property name="visible">False</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>
......@@ -1309,7 +1320,7 @@ Resets the queue job to pending and ready to run again.</property>
<child>
<object class="GtkBox" id="queue_log_tab">
<property name="orientation">vertical</property>
<property name="visible">False</property>
<property name="visible">True</property>
<property name="expand">True</property>
<property name="margin-top">12</property>
<property name="can_focus">False</property>
......@@ -1343,6 +1354,7 @@ Resets the queue job to pending and ready to run again.</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="shadow_type">in</property>
<property name="vexpand">True</property>
<property name="margin-bottom">6</property>
<property name="valign">GTK_ALIGN_FILL</property>
<child>
<object class="GtkTextView" id="queue_activity_view">
......@@ -1390,6 +1402,7 @@ Resets the queue job to pending and ready to run again.</property>
</object>
<object class="GtkWindow" id="activity_window">
<property name="title" translatable="yes">HandBrake Activity Log</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="default_width">800</property>
......@@ -8711,9 +8724,9 @@ Setting this to 0 means there is no maximum height.</property>
<property name="page_increment">10</property>
</object>
<object class="GtkWindow" id="preview_window">
<property name="title" translatable="yes">HandBrake Preview</property>
<property name="can_focus">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_STRUCTURE_MASK</property>
<property name="title" translatable="yes">Preview</property>
<property name="resizable">True</property>
<property name="window_position">center</property>
<property name="type_hint">normal</property>
......
......@@ -31,6 +31,7 @@
#include <glib/gi18n.h>
#include "hb-backend.h"
#include "settings.h"
#include "jobdict.h"
#include "callbacks.h"
#include "subtitlehandler.h"
#include "audiohandler.h"
......@@ -3139,26 +3140,23 @@ init_ui_combo_boxes(GtkBuilder *builder)
}
}
void
ghb_part_duration(const hb_title_t *title, gint sc, gint ec, gint *hh, gint *mm, gint *ss)
gint64
ghb_chapter_range_get_duration(const hb_title_t *title, gint sc, gint ec)
{
hb_chapter_t * chapter;
gint count, c;
gint64 duration;
*hh = *mm = *ss = 0;
if (title == NULL) return;
if (title == NULL) return 0;
*hh = title->hours;
*mm = title->minutes;
*ss = title->seconds;
duration = title->duration;
count = hb_list_count(title->list_chapter);
if (sc > count) sc = count;
if (ec > count) ec = count;
if (sc == 1 && ec == count)
return;
return duration;
duration = 0;
for (c = sc; c <= ec; c++)
......@@ -3166,10 +3164,7 @@ ghb_part_duration(const hb_title_t *title, gint sc, gint ec, gint *hh, gint *mm,
chapter = hb_list_item(title->list_chapter, c-1);
duration += chapter->duration;
}
*hh = duration / 90000 / 3600;
*mm = ((duration / 90000) % 3600) / 60;
*ss = (duration / 90000) % 60;
return duration;
}
gint64
......
......@@ -131,8 +131,8 @@ void ghb_set_scale_settings(GhbValue *settings, gint mode);
void ghb_picture_settings_deps(signal_user_data_t *ud);
gint64 ghb_get_chapter_duration(const hb_title_t *title, gint chap);
gint64 ghb_get_chapter_start(const hb_title_t *title, gint chap);
void ghb_part_duration(
const hb_title_t *title, gint sc, gint ec, gint *hh, gint *mm, gint *ss);
gint64 ghb_chapter_range_get_duration(const hb_title_t *title,
gint sc, gint ec);
gint ghb_get_best_mix(hb_audio_config_t *aconfig, gint acodec, gint mix);
gboolean ghb_audio_is_passthru(gint acodec);
gboolean ghb_audio_can_passthru(gint acodec);
......
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
* jobdict.c
* Copyright (C) John Stebbins 2008-2019 <stebbins@stebbins>
*
* settings.c is free software.
*
* You may redistribute it and/or modify it under the terms of the
* GNU General Public License, as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* settings.c is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with main.c. If not, write to:
* The Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301, USA.
*/
#include "values.h"
#include "jobdict.h"
GhbValue *ghb_get_job_settings(GhbValue *settings)
{
GhbValue *job;
job = ghb_dict_get(settings, "Job");
if (job == NULL)
{
job = ghb_dict_new();
ghb_dict_set(settings, "Job", job);
}
return job;
}
GhbValue* ghb_get_job_dest_settings(GhbValue *settings)
{
GhbValue *job = ghb_get_job_settings(settings);
GhbValue *dest = ghb_dict_get(job, "Destination");
if (dest == NULL)
{
dest = ghb_dict_new();
ghb_dict_set(job, "Destination", dest);
}
return dest;
}
GhbValue* ghb_get_job_chapter_list(GhbValue *settings)
{
GhbValue *dest = ghb_get_job_dest_settings(settings);
GhbValue *chapters = ghb_dict_get(dest, "ChapterList");
if (chapters == NULL)
{
chapters = ghb_array_new();
ghb_dict_set(dest, "ChapterList", chapters);
}
return chapters;
}
GhbValue* ghb_get_job_mp4_settings(GhbValue *settings)
{
GhbValue *dest = ghb_get_job_dest_settings(settings);
GhbValue *mp4 = ghb_dict_get(dest, "Mp4Options");
if (mp4 == NULL)
{
mp4 = ghb_dict_new();
ghb_dict_set(dest, "Mp4Options", mp4);
}
return mp4;
}
GhbValue* ghb_get_job_source_settings(GhbValue *settings)
{
GhbValue *job = ghb_get_job_settings(settings);
GhbValue *source = ghb_dict_get(job, "Source");
if (source == NULL)
{
source = ghb_dict_new();
ghb_dict_set(job, "Source", source);
}
return source;
}
GhbValue* ghb_get_job_range_settings(GhbValue *settings)
{
GhbValue *source = ghb_get_job_source_settings(settings);
GhbValue *range = ghb_dict_get(source, "Range");
if (range == NULL)
{
range = ghb_dict_new();
ghb_dict_set(source, "Range", range);
}
return range;
}
GhbValue* ghb_get_job_par_settings(GhbValue *settings)
{
GhbValue *job = ghb_get_job_settings(settings);
GhbValue *par = ghb_dict_get(job, "PAR");
if (par == NULL)
{
par = ghb_dict_new();
ghb_dict_set(job, "PAR", par);
}
return par;
}
GhbValue* ghb_get_job_video_settings(GhbValue *settings)
{
GhbValue *job = ghb_get_job_settings(settings);
GhbValue *video = ghb_dict_get(job, "Video");
if (video == NULL)
{
video = ghb_dict_new();
ghb_dict_set(job, "Video", video);
}
return video;
}
GhbValue *ghb_get_job_audio_settings(GhbValue *settings)
{
GhbValue *job = ghb_get_job_settings(settings);
GhbValue *audio = ghb_dict_get(job, "Audio");
if (audio == NULL)
{
audio = ghb_dict_new();
ghb_dict_set(job, "Audio", audio);
}
return audio;
}
GhbValue *ghb_get_job_audio_list(GhbValue *settings)
{
GhbValue *audio_dict = ghb_get_job_audio_settings(settings);
GhbValue *audio_list = ghb_dict_get(audio_dict, "AudioList");
if (audio_list == NULL)
{
audio_list = ghb_array_new();
ghb_dict_set(audio_dict, "AudioList", audio_list);
}
return audio_list;
}
GhbValue *ghb_get_job_subtitle_settings(GhbValue *settings)
{
GhbValue *job = ghb_get_job_settings(settings);
GhbValue *sub = ghb_dict_get(job, "Subtitle");
if (sub == NULL)
{
sub = ghb_dict_new();
ghb_dict_set(job, "Subtitle", sub);
}
return sub;
}
GhbValue *ghb_get_job_subtitle_list(GhbValue *settings)
{
GhbValue *sub_dict = ghb_get_job_subtitle_settings(settings);
GhbValue *sub_list = ghb_dict_get(sub_dict, "SubtitleList");
if (sub_list == NULL)
{
sub_list = ghb_array_new();
ghb_dict_set(sub_dict, "SubtitleList", sub_list);
}
return sub_list;
}
GhbValue *ghb_get_job_subtitle_search(GhbValue *settings)
{
GhbValue *sub_dict = ghb_get_job_subtitle_settings(settings);
GhbValue *sub_search = ghb_dict_get(sub_dict, "Search");
if (sub_search == NULL)
{
sub_search = ghb_dict_new();
ghb_dict_set(sub_dict, "Search", sub_search);
ghb_dict_set_bool(sub_search, "Enable", 0);
}
return sub_search;
}
GhbValue* ghb_get_job_metadata_settings(GhbValue *settings)
{
GhbValue *job = ghb_get_job_settings(settings);
GhbValue *meta = ghb_dict_get(job, "Metadata");
if (meta == NULL)
{
meta = ghb_dict_new();
ghb_dict_set(job, "Metadata", meta);
}
return meta;
}
GhbValue* ghb_get_job_filter_settings(GhbValue *settings)
{
GhbValue *job = ghb_get_job_settings(settings);
GhbValue *filter = ghb_dict_get(job, "Filters");
if (filter == NULL)
{
filter = ghb_dict_new();
ghb_dict_set(job, "Filters", filter);
}
return filter;
}
GhbValue* ghb_get_job_filter_list(GhbValue *settings)
{
GhbValue *filter = ghb_get_job_filter_settings(settings);
GhbValue *list = ghb_dict_get(filter, "FilterList");
if (list == NULL)
{
list = ghb_dict_new();
ghb_dict_set(filter, "FilterList", list);
}
return list;
}
/*
* settings.h
* Copyright (C) John Stebbins 2008-2019 <stebbins@stebbins>
*
* settings.h is free software.
*
* You may redistribute it and/or modify it under the terms of the
* GNU General Public License, as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* settings.h is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with callbacks.h. If not, write to:
* The Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301, USA.
*/
#if !defined(_JOBDICT_H_)
#define _JOBDICT_H_
#include "values.h"
GhbValue* ghb_get_job_settings(GhbValue *settings);
GhbValue* ghb_get_job_source_settings(GhbValue *settings);
GhbValue* ghb_get_job_range_settings(GhbValue *settings);
GhbValue* ghb_get_job_par_settings(GhbValue *settings);
GhbValue* ghb_get_job_dest_settings(GhbValue *settings);
GhbValue* ghb_get_job_video_settings(GhbValue *settings);
GhbValue* ghb_get_job_metadata_settings(GhbValue *settings);
GhbValue* ghb_get_job_chapter_list(GhbValue *settings);
GhbValue* ghb_get_job_mp4_settings(GhbValue *settings);
GhbValue* ghb_get_job_audio_settings(GhbValue *settings);
GhbValue* ghb_get_job_audio_list(GhbValue *settings);
GhbValue* ghb_get_job_subtitle_settings(GhbValue *settings);
GhbValue* ghb_get_job_subtitle_list(GhbValue *settings);
GhbValue* ghb_get_job_subtitle_search(GhbValue *settings);
GhbValue* ghb_get_job_filter_settings(GhbValue *settings);
GhbValue* ghb_get_job_filter_list(GhbValue *settings);
#endif // _JOBDICT_H_
......@@ -828,6 +828,10 @@ queue_open_source_action_cb(GSimpleAction *action, GVariant *param, gpointer ud)
G_MODULE_EXPORT void
queue_open_dest_action_cb(GSimpleAction *action, GVariant *param, gpointer ud);
G_MODULE_EXPORT void
queue_open_log_dir_action_cb(GSimpleAction *action, GVariant *param, gpointer ud);
G_MODULE_EXPORT void
queue_open_log_action_cb(GSimpleAction *action, GVariant *param, gpointer ud);
G_MODULE_EXPORT void
queue_delete_all_action_cb(GSimpleAction *action, GVariant *param,
gpointer ud);
G_MODULE_EXPORT void
......@@ -895,6 +899,8 @@ static void map_actions(GApplication * app, signal_user_data_t * ud)
{ "queue-pause", queue_pause_action_cb },
{ "queue-open-source", queue_open_source_action_cb },
{ "queue-open-dest", queue_open_dest_action_cb },
{ "queue-open-log-dir", queue_open_log_dir_action_cb },
{ "queue-open-log", queue_open_log_action_cb },
{ "queue-reset-fail", queue_reset_fail_action_cb },
{ "queue-reset-all", queue_reset_all_action_cb },
{ "queue-reset", queue_reset_action_cb },
......@@ -1024,9 +1030,9 @@ ghb_activate_cb(GApplication * app, signal_user_data_t * ud)
ud->activity_buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(widget));
g_object_ref(ud->activity_buffer);
widget = GHB_WIDGET(ud->builder, "queue_activity_view");
ud->queue_activity_buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(widget));
g_object_ref(ud->queue_activity_buffer);
ud->extra_activity_buffer = gtk_text_buffer_new(NULL);
ud->extra_activity_buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(widget));
g_object_ref(ud->extra_activity_buffer);
ud->queue_activity_buffer = gtk_text_buffer_new(NULL);
// Must set the names of the widgets that I want to modify
// style for.
......
......@@ -36,6 +36,7 @@
#endif
#include "settings.h"
#include "jobdict.h"
#include "presets.h"
#include "callbacks.h"
#include "hb-backend.h"
......
This diff is collapsed.
......@@ -60,220 +60,6 @@ ghb_settings_combo_option(const GhbValue *settings, const gchar *key)
return ghb_lookup_combo_option(key, ghb_dict_get_value(settings, key));
}
GhbValue *ghb_get_title_settings(GhbValue *settings)
{
GhbValue *title;
title = ghb_dict_get(settings, "Title");
return title;
}
GhbValue *ghb_get_title_audio_list(GhbValue *settings)
{
GhbValue *title_dict = ghb_get_title_settings(settings);
GhbValue *audio_list = ghb_dict_get(title_dict, "AudioList");
return audio_list;
}
GhbValue *ghb_get_title_subtitle_list(GhbValue *settings)
{
GhbValue *title_dict = ghb_get_title_settings(settings);
GhbValue *subtitle_list = ghb_dict_get(title_dict, "SubtitleList");
return subtitle_list;
}
GhbValue *ghb_get_job_settings(GhbValue *settings)
{
GhbValue *job;
job = ghb_dict_get(settings, "Job");
if (job == NULL)
{
job = ghb_dict_new();
ghb_dict_set(settings, "Job", job);
}
return job;
}
GhbValue* ghb_get_job_dest_settings(GhbValue *settings)
{
GhbValue *job = ghb_get_job_settings(settings);
GhbValue *dest = ghb_dict_get(job, "Destination");
if (dest == NULL)
{
dest = ghb_dict_new();
ghb_dict_set(job, "Destination", dest);
}
return dest;
}
GhbValue* ghb_get_job_chapter_list(GhbValue *settings)
{
GhbValue *dest = ghb_get_job_dest_settings(settings);
GhbValue *chapters = ghb_dict_get(dest, "ChapterList");
if (chapters == NULL)
{
chapters = ghb_array_new();
ghb_dict_set(dest, "ChapterList", chapters);
}
return chapters;
}
GhbValue* ghb_get_job_mp4_settings(GhbValue *settings)
{
GhbValue *dest = ghb_get_job_dest_settings(settings);
GhbValue *mp4 = ghb_dict_get(dest, "Mp4Options");
if (mp4 == NULL)
{
mp4 = ghb_dict_new();
ghb_dict_set(dest, "Mp4Options", mp4);
}
return mp4;
}
GhbValue* ghb_get_job_source_settings(GhbValue *settings)
{
GhbValue *job = ghb_get_job_settings(settings);
GhbValue *source = ghb_dict_get(job, "Source");
if (source == NULL)
{
source = ghb_dict_new();
ghb_dict_set(job, "Source", source);
}
return source;
}
GhbValue* ghb_get_job_range_settings(GhbValue *settings)
{
GhbValue *source = ghb_get_job_source_settings(settings);
GhbValue *range = ghb_dict_get(source, "Range");
if (range == NULL)
{
range = ghb_dict_new();
ghb_dict_set(source, "Range", range);
}
return range;
}
GhbValue* ghb_get_job_par_settings(GhbValue *settings)
{
GhbValue *job = ghb_get_job_settings(settings);
GhbValue *par = ghb_dict_get(job, "PAR");
if (par == NULL)
{
par = ghb_dict_new();
ghb_dict_set(job, "PAR", par);
}
return par;
}
GhbValue* ghb_get_job_video_settings(GhbValue *settings)
{
GhbValue *job = ghb_get_job_settings(settings);
GhbValue *video = ghb_dict_get(job, "Video");
if (video == NULL)
{
video = ghb_dict_new();
ghb_dict_set(job, "Video", video);
}
return video;
}
GhbValue *ghb_get_job_audio_settings(GhbValue *settings)
{
GhbValue *job = ghb_get_job_settings(settings);
GhbValue *audio = ghb_dict_get(job, "Audio");
if (audio == NULL)
{
audio = ghb_dict_new();
ghb_dict_set(job, "Audio", audio);
}
return audio;
}