]> granicus.if.org Git - handbrake/commitdiff
LinGui: more code refactoring
authorJohn Stebbins <jstebbins.hb@gmail.com>
Thu, 27 Jun 2019 21:36:39 +0000 (14:36 -0700)
committerJohn Stebbins <jstebbins.hb@gmail.com>
Thu, 27 Jun 2019 21:36:39 +0000 (14:36 -0700)
separate job and title dict functions into separate files

13 files changed:
gtk/src/Makefile.am
gtk/src/audiohandler.c
gtk/src/callbacks.c
gtk/src/hb-backend.c
gtk/src/jobdict.c [new file with mode: 0644]
gtk/src/jobdict.h [new file with mode: 0644]
gtk/src/preview.c
gtk/src/queuehandler.c
gtk/src/settings.c
gtk/src/settings.h
gtk/src/subtitlehandler.c
gtk/src/titledict.c [new file with mode: 0644]
gtk/src/titledict.h [new file with mode: 0644]

index f7ba85cd55ae86e2f19239a46e662102446aa174..e91c0cce8c26031ce19924bc2e1dd33b45661217 100644 (file)
@@ -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 \
index d5ad15c89ddaa9f7f5f8caa04c679b17e2191feb..c4dbac716ef22976d5fb40f28d389e5ebf0f8903 100644 (file)
@@ -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"
index 1383f7b9d7cae5320d54f24eecac5277f335ff1e..1304421ca4f42855c4fc0821e64b55b681705977 100644 (file)
@@ -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"
index 04072d4c2d38d350c817fb0fec427eb3a6b0a3a6..cee449852d9aff574979a26d41111af30b053dbd 100644 (file)
@@ -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"
diff --git a/gtk/src/jobdict.c b/gtk/src/jobdict.c
new file mode 100644 (file)
index 0000000..32438e7
--- /dev/null
@@ -0,0 +1,219 @@
+/* -*- 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;
+}
diff --git a/gtk/src/jobdict.h b/gtk/src/jobdict.h
new file mode 100644 (file)
index 0000000..66a39a6
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * 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_
index d7d2a4fc234fb19adbdc366892e0d5af78c7434e..edda8173f2262d74dcb655dc90963a01050d34fd 100644 (file)
@@ -36,6 +36,7 @@
 #endif
 
 #include "settings.h"
+#include "jobdict.h"
 #include "presets.h"
 #include "callbacks.h"
 #include "hb-backend.h"
index 1cc358756eb0d57df08fe0d25d5f74987c3cd0e7..3c810655c79e8ac1c7326a77a32e46ae51cbdd1c 100644 (file)
@@ -28,6 +28,7 @@
 #include <gio/gio.h>
 #include "hb.h"
 #include "settings.h"
+#include "jobdict.h"
 #include "hb-backend.h"
 #include "values.h"
 #include "callbacks.h"
index 856081c2a3f41e1a9f40ab3e5d15786922456e5b..91853a9404c1dfbcd23dfb53891dc4f38d1d4ef9 100644 (file)
@@ -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;
-}
-
-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;
-}
-
 // Map widget names to setting keys
 // Widgets that map to settings have names
 // of this format: s_<setting key>
index 1eb590e1e1d80b2c2127bb9d820858d6416e8771..b0a170a6a08890884a4a405c8faf3aeb4a505340 100644 (file)
@@ -91,27 +91,6 @@ enum
     GHB_QUEUE_DONE,
 };
 
-GhbValue* ghb_get_title_settings(GhbValue *settings);
-GhbValue* ghb_get_title_audio_list(GhbValue *settings);
-GhbValue* ghb_get_title_subtitle_list(GhbValue *settings);
-
-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);
-
 void ghb_settings_copy(
     GhbValue *settings, const gchar *key, const GhbValue *value);
 gint ghb_settings_combo_int(const GhbValue *settings, const gchar *key);
index 1afca2131607ab7a1b283c91df16e4b5d6c1b68e..fcf530cc78d98567c3dced68aa2f5654a14ae53a 100644 (file)
@@ -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"
diff --git a/gtk/src/titledict.c b/gtk/src/titledict.c
new file mode 100644 (file)
index 0000000..7ad87e6
--- /dev/null
@@ -0,0 +1,47 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
+/*
+ * titledict.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 "titledict.h"
+
+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;
+}
diff --git a/gtk/src/titledict.h b/gtk/src/titledict.h
new file mode 100644 (file)
index 0000000..59b5c55
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * titledict.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(_TITLEDICT_H_)
+#define _TITLEDICT_H_
+
+#include "values.h"
+
+GhbValue* ghb_get_title_settings(GhbValue *settings);
+GhbValue* ghb_get_title_audio_list(GhbValue *settings);
+GhbValue* ghb_get_title_subtitle_list(GhbValue *settings);
+
+#endif // _TITLEDICT_H_