summaryrefslogtreecommitdiffstats
path: root/gtk/src
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2014-02-19 00:06:26 +0000
committerjstebbins <[email protected]>2014-02-19 00:06:26 +0000
commit79b05392677602129f4ec0119ba0782d62e4b7fe (patch)
treebaa5e016ef05927a166191882598000ed6598141 /gtk/src
parentdcfe8545b8bf8a9a32be87f847959137c0a251d2 (diff)
LinGui: rework title list
Title list is now linked to a settings list. There is one settings dict per title. The settings list is populated when scan completes. As you change titles, the settings for that title populate the UI. Changes made are saved in the settings and restored if you go to another title and then return. This is preparation for improvements to "Add All to Queue" feature. Settings for each title can be customized before adding to the queue. All titles don't have to use the same preset or settings. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6046 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src')
-rw-r--r--gtk/src/appcast.c34
-rw-r--r--gtk/src/appcast.h4
-rw-r--r--gtk/src/audiohandler.c94
-rw-r--r--gtk/src/audiohandler.h12
-rw-r--r--gtk/src/callbacks.c1574
-rw-r--r--gtk/src/callbacks.h17
-rw-r--r--gtk/src/create_resources.c40
-rw-r--r--gtk/src/ghb-dvd.c36
-rw-r--r--gtk/src/ghb-dvd.h4
-rw-r--r--gtk/src/ghb.ui12
-rw-r--r--gtk/src/ghbcellrenderertext.c190
-rw-r--r--gtk/src/ghbcellrenderertext.h8
-rw-r--r--gtk/src/ghbcompat.h2
-rw-r--r--gtk/src/ghbcompositor.c30
-rw-r--r--gtk/src/ghbcompositor.h2
-rw-r--r--gtk/src/hb-backend.c672
-rw-r--r--gtk/src/hb-backend.h15
-rw-r--r--gtk/src/icon_tools.c6
-rw-r--r--gtk/src/icon_tools.h4
-rw-r--r--gtk/src/icons.h4
-rw-r--r--gtk/src/internal_defaults.xml34
-rw-r--r--gtk/src/main.c81
-rw-r--r--gtk/src/makedeps.py1
-rw-r--r--gtk/src/plist.c28
-rw-r--r--gtk/src/preset_xlat.c22
-rw-r--r--gtk/src/presets.c702
-rw-r--r--gtk/src/presets.h21
-rw-r--r--gtk/src/preview.c137
-rw-r--r--gtk/src/preview.h4
-rw-r--r--gtk/src/queuehandler.c92
-rw-r--r--gtk/src/queuehandler.h8
-rw-r--r--gtk/src/resources.c6
-rw-r--r--gtk/src/resources.h4
-rw-r--r--gtk/src/settings.c67
-rw-r--r--gtk/src/settings.h12
-rw-r--r--gtk/src/subtitlehandler.c94
-rw-r--r--gtk/src/subtitlehandler.h12
-rw-r--r--gtk/src/values.c24
-rw-r--r--gtk/src/values.h4
-rw-r--r--gtk/src/x264handler.c55
-rw-r--r--gtk/src/x264handler.h8
41 files changed, 1994 insertions, 2182 deletions
diff --git a/gtk/src/appcast.c b/gtk/src/appcast.c
index b89530d71..d3a9acf03 100644
--- a/gtk/src/appcast.c
+++ b/gtk/src/appcast.c
@@ -2,9 +2,9 @@
/*
* appcast.c
* Copyright (C) John Stebbins 2008-2013 <stebbins@stebbins>
- *
+ *
* appcast.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)
@@ -55,8 +55,8 @@ typedef struct
static const gchar*
lookup_attr_value(
- const gchar *name,
- const gchar **attr_names,
+ const gchar *name,
+ const gchar **attr_names,
const gchar **attr_values)
{
gint ii;
@@ -69,18 +69,18 @@ lookup_attr_value(
}
return NULL;
}
-
+
static void
start_element(
- GMarkupParseContext *ctx,
- const gchar *tag,
+ GMarkupParseContext *ctx,
+ const gchar *tag,
const gchar **attr_names,
const gchar **attr_values,
gpointer ud,
GError **error)
{
parse_data_t *pd = (parse_data_t*)ud;
- union
+ union
{
gint id;
gpointer pid;
@@ -124,14 +124,14 @@ start_element(
static void
end_element(
- GMarkupParseContext *ctx,
- const gchar *tag,
+ GMarkupParseContext *ctx,
+ const gchar *tag,
gpointer ud,
GError **error)
{
parse_data_t *pd = (parse_data_t*)ud;
gint id;
- union
+ union
{
gint id;
gpointer pid;
@@ -169,14 +169,14 @@ end_element(
static void
text_data(
- GMarkupParseContext *ctx,
- const gchar *text,
+ GMarkupParseContext *ctx,
+ const gchar *text,
gsize len,
gpointer ud,
GError **error)
{
parse_data_t *pd = (parse_data_t*)ud;
- union
+ union
{
gint id;
gpointer pid;
@@ -202,8 +202,8 @@ text_data(
static void
passthrough(
- GMarkupParseContext *ctx,
- const gchar *text,
+ GMarkupParseContext *ctx,
+ const gchar *text,
gsize len,
gpointer ud,
GError **error)
@@ -220,7 +220,7 @@ parse_error(GMarkupParseContext *ctx, GError *error, gpointer ud)
}
// This is required or the parser crashes
-static void
+static void
destroy_notify(gpointer data)
{ // Do nothing
//g_debug("destroy parser");
diff --git a/gtk/src/appcast.h b/gtk/src/appcast.h
index d4f5eea55..06e54fa03 100644
--- a/gtk/src/appcast.h
+++ b/gtk/src/appcast.h
@@ -3,12 +3,12 @@
* 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.
- *
+ *
* This program 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 Library General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
diff --git a/gtk/src/audiohandler.c b/gtk/src/audiohandler.c
index f30b5ee87..eeeabd904 100644
--- a/gtk/src/audiohandler.c
+++ b/gtk/src/audiohandler.c
@@ -60,7 +60,7 @@ static void audio_deps(signal_user_data_t *ud, GValue *asettings, GtkWidget *wid
if (asettings != NULL)
{
- track = ghb_settings_combo_int(asettings, "AudioTrack");
+ track = ghb_settings_get_int(asettings, "AudioTrack");
encoder = ghb_settings_combo_int(asettings, "AudioEncoder");
aconfig = ghb_get_scan_audio_info(titleindex, track);
}
@@ -207,7 +207,7 @@ audio_sanitize_settings(GValue *settings, GValue *asettings)
g_debug("ghb_santiize_audio ()");
mux = ghb_settings_combo_int(settings, "FileFormat");
titleindex = ghb_settings_get_int(settings, "title_no");
- track = ghb_settings_combo_int(asettings, "AudioTrack");
+ track = ghb_settings_get_int(asettings, "AudioTrack");
acodec = ghb_settings_combo_int(asettings, "AudioEncoder");
mix = ghb_settings_combo_int(asettings, "AudioMixdown");
bitrate = ghb_settings_combo_int(asettings, "AudioBitrate");
@@ -680,25 +680,6 @@ ghb_set_pref_audio_settings(gint titleindex, GValue *settings)
g_hash_table_destroy(track_used);
}
-void
-ghb_set_pref_audio_from_settings(signal_user_data_t *ud, GValue *settings)
-{
- const GValue *audio_list, *audio;
- gint count, ii;
-
- // Clear the audio list
- ghb_clear_audio_list_ui(ud->builder);
-
- audio_list = ghb_settings_get_value(settings, "audio_list");
- count = ghb_array_len(audio_list);
- for (ii = 0; ii < count; ii++)
- {
- audio = ghb_array_get_nth(audio_list, ii);
- ghb_add_audio_to_ui(ud, audio);
- ghb_adjust_audio_rate_combos(ud);
- }
-}
-
static GValue*
audio_get_selected_settings(signal_user_data_t *ud, int *index)
{
@@ -757,7 +738,7 @@ audio_refresh_list_row_ui(
int titleindex, track, sr, codec;
titleindex = ghb_settings_combo_int(ud->settings, "title");
- track = ghb_settings_combo_int(settings, "AudioTrack");
+ track = ghb_settings_get_int(settings, "AudioTrack");
aconfig = ghb_get_scan_audio_info(titleindex, track);
if (aconfig == NULL)
{
@@ -991,7 +972,7 @@ audio_codec_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
}
titleindex = ghb_settings_combo_int(ud->settings, "title");
- track = ghb_settings_combo_int(ud->settings, "AudioTrack");
+ track = ghb_settings_get_int(ud->settings, "AudioTrack");
if (sr)
{
sr = ghb_find_closest_audio_samplerate(sr);
@@ -1442,13 +1423,13 @@ audio_add_all_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
asettings = audio_select_and_add_track(title, ud->settings,
pref_audio, "und", ii,
track);
- ghb_add_audio_to_ui(ud, asettings);
if (asettings != NULL)
{
- track = ghb_settings_combo_int(asettings, "AudioTrack") + 1;
+ track = ghb_settings_get_int(asettings, "AudioTrack") + 1;
}
} while (asettings != NULL);
}
+ audio_refresh_list_ui(ud);
}
G_MODULE_EXPORT void
@@ -1562,60 +1543,7 @@ audio_reset_clicked_cb(GtkWidget *widget, signal_user_data_t *ud)
{
int titleindex = ghb_settings_combo_int(ud->settings, "title");
ghb_set_pref_audio_settings(titleindex, ud->settings);
- ghb_set_pref_audio_from_settings(ud, ud->settings);
-}
-
-void
-ghb_set_audio(signal_user_data_t *ud, GValue *settings)
-{
- gint acodec_code;
-
- GValue *alist;
- GValue *track, *audio, *acodec, *bitrate, *rate,
- *mix, *drc, *gain, *quality, *enable_quality;
- gint count, ii;
-
- g_debug("set_audio");
- // Clear the audio list
- ghb_clear_audio_list_settings(ud->settings);
- ghb_clear_audio_list_ui(ud->builder);
- alist = ghb_settings_get_value(settings, "audio_list");
-
- count = ghb_array_len(alist);
- for (ii = 0; ii < count; ii++)
- {
- audio = ghb_array_get_nth(alist, ii);
- track = ghb_settings_get_value(audio, "AudioTrack");
- acodec = ghb_settings_get_value(audio, "AudioEncoder");
- enable_quality = ghb_settings_get_value(audio, "AudioTrackQualityEnable");
- quality = ghb_settings_get_value(audio, "AudioTrackQuality");
- bitrate = ghb_settings_get_value(audio, "AudioBitrate");
- rate = ghb_settings_get_value(audio, "AudioSamplerate");
- mix = ghb_settings_get_value(audio, "AudioMixdown");
- gain = ghb_settings_get_value(audio, "AudioTrackGain");
- drc = ghb_settings_get_value(audio, "AudioTrackDRCSlider");
- acodec_code = ghb_lookup_combo_int("AudioEncoder", acodec);
-
- if (acodec_code != 0)
- {
- GValue *asettings = ghb_dict_value_new();
- ghb_settings_set_value(asettings, "AudioTrack", track);
- ghb_settings_set_value(asettings, "AudioEncoder", acodec);
- ghb_settings_set_value(asettings, "AudioTrackQualityEnable", enable_quality);
- ghb_settings_set_value(asettings, "AudioTrackQuality", quality);
-
- // This gets set autimatically if the codec is passthru
- ghb_settings_set_value(asettings, "AudioBitrate", bitrate);
- ghb_settings_set_value(asettings, "AudioSamplerate", rate);
- ghb_settings_set_value(asettings, "AudioMixdown", mix);
- ghb_settings_set_value(asettings, "AudioTrackGain", gain);
- ghb_settings_set_value(asettings, "AudioTrackDRCSlider", drc);
-
- audio_add_to_settings(ud->settings, asettings);
- ghb_add_audio_to_ui(ud, asettings);
- ghb_adjust_audio_rate_combos(ud);
- }
- }
+ audio_refresh_list_ui(ud);
}
static GtkWidget *find_widget(GtkWidget *widget, gchar *name)
@@ -2393,7 +2321,8 @@ static void audio_def_lang_list_clear_cb(GtkWidget *row, gpointer data)
gtk_list_box_insert(avail, label, idx);
}
-static void audio_def_selected_lang_list_clear(signal_user_data_t *ud)
+static void
+audio_def_selected_lang_list_clear(signal_user_data_t *ud)
{
GtkListBox *avail, *selected;
avail = GTK_LIST_BOX(GHB_WIDGET(ud->builder, "audio_avail_lang"));
@@ -2402,7 +2331,8 @@ static void audio_def_selected_lang_list_clear(signal_user_data_t *ud)
audio_def_lang_list_clear_cb, (gpointer)avail);
}
-static void audio_def_lang_list_init(signal_user_data_t *ud)
+static void
+audio_def_lang_list_init(signal_user_data_t *ud)
{
GValue *lang_list;
@@ -2447,7 +2377,7 @@ static void audio_def_lang_list_init(signal_user_data_t *ud)
}
}
-void ghb_audio_def_settings_init(signal_user_data_t *ud)
+void ghb_audio_defaults_to_ui(signal_user_data_t *ud)
{
GtkListBox *list_box;
GValue *alist;
diff --git a/gtk/src/audiohandler.h b/gtk/src/audiohandler.h
index f1c7e8072..8af2e2497 100644
--- a/gtk/src/audiohandler.h
+++ b/gtk/src/audiohandler.h
@@ -2,19 +2,19 @@
/*
* audiohandler.h
* Copyright (C) John Stebbins 2008-2013 <stebbins@stebbins>
- *
+ *
* audiohandler.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.
- *
+ *
* callbacks.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.,
@@ -29,8 +29,6 @@
void ghb_adjust_audio_rate_combos(signal_user_data_t *ud);
void ghb_set_pref_audio_settings(gint titleindex, GValue *settings);
-void ghb_set_pref_audio_from_settings(signal_user_data_t *ud, GValue *settings);
-void ghb_set_audio(signal_user_data_t *ud, GValue *settings);
const gchar* ghb_get_user_audio_lang(GValue *settings, hb_title_t *title, gint track);
void ghb_audio_list_refresh_selected(signal_user_data_t *ud);
gint ghb_select_audio_codec(gint mux, hb_audio_config_t *aconfig, gint acodec, gint fallback_acodec, gint copy_mask);
@@ -39,7 +37,7 @@ int ghb_get_copy_mask(GValue *settings);
void ghb_audio_list_refresh_all(signal_user_data_t *ud);
char * ghb_format_quality( const char *prefix, int codec, double quality );
void ghb_init_audio_defaults_ui(signal_user_data_t *ud);
-void ghb_audio_def_settings_init(signal_user_data_t *ud);
+void ghb_audio_defaults_to_ui(signal_user_data_t *ud);
GtkListBoxRow* ghb_find_lang_row(GtkListBox *list_box, int lang_idx);
void ghb_audio_title_change(signal_user_data_t *ud, gboolean title_valid);
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c
index 9d2253431..32a1e5b9e 100644
--- a/gtk/src/callbacks.c
+++ b/gtk/src/callbacks.c
@@ -2,9 +2,9 @@
/*
* callbacks.c
* Copyright (C) John Stebbins 2008-2013 <stebbins@stebbins>
- *
+ *
* callbacks.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)
@@ -81,8 +81,7 @@
#include "ghbcellrenderertext.h"
#include "x264handler.h"
-static void reset_chapter_list(signal_user_data_t *ud, GValue *settings);
-static void update_chapter_list_from_settings(GtkBuilder *builder, GValue *settings);
+static void load_all_titles(signal_user_data_t *ud, int titleindex);
static void update_chapter_list_settings(GValue *settings);
static GList* dvd_device_list();
static void prune_logs(signal_user_data_t *ud);
@@ -121,7 +120,7 @@ dep_check(signal_user_data_t *ud, const gchar *name, gboolean *out_hide)
gboolean result = TRUE;
GValue *array, *data;
gchar *widget_name;
-
+
g_debug("dep_check () %s", name);
if (rev_map == NULL) return TRUE;
@@ -203,8 +202,8 @@ dep_check(signal_user_data_t *ud, const gchar *name, gboolean *out_hide)
void
ghb_check_dependency(
- signal_user_data_t *ud,
- GtkWidget *widget,
+ signal_user_data_t *ud,
+ GtkWidget *widget,
const char *alt_name)
{
GObject *dep_object;
@@ -352,7 +351,7 @@ void
camel_convert(gchar *str)
{
gint state = CAMEL_OTHER;
-
+
if (str == NULL) return;
while (*str)
{
@@ -365,7 +364,7 @@ camel_convert(gchar *str)
state = CAMEL_FIRST_UPPER;
else
state = CAMEL_OTHER;
-
+
} break;
case CAMEL_FIRST_UPPER:
{
@@ -530,7 +529,7 @@ ghb_cache_volnames(signal_user_data_t *ud)
if (name != NULL)
g_free(name);
}
-
+
free_drive(link->data);
link = link->next;
}
@@ -544,14 +543,14 @@ ghb_cache_volnames(signal_user_data_t *ud)
}
static const gchar*
-get_extension(GValue *settings)
+get_extension(signal_user_data_t *ud, GValue *settings)
{
int container;
const gchar *extension;
container = ghb_settings_combo_int(settings, "FileFormat");
if ((container & HB_MUX_MASK_MP4) &&
- ghb_settings_get_boolean(settings, "UseM4v"))
+ ghb_settings_get_boolean(ud->prefs, "UseM4v"))
{
return "m4v";
}
@@ -562,36 +561,37 @@ get_extension(GValue *settings)
}
static void
-set_destination_settings(GValue *settings)
+set_destination_settings(signal_user_data_t *ud, GValue *settings)
{
+ const gchar *extension;
+ gchar *filename;
+
+ extension = get_extension(ud, settings);
+
g_debug("set_destination_settings");
- if (ghb_settings_get_boolean(settings, "use_source_name"))
+ if (ghb_settings_get_boolean(ud->prefs, "use_source_name"))
{
GString *str = g_string_new("");
gchar *vol_name;
- const gchar *extension;
- gchar *new_name;
gint title;
-
- extension = get_extension(settings);
+
vol_name = ghb_settings_get_string(settings, "volume_label");
g_string_append_printf(str, "%s", vol_name);
title = ghb_settings_get_int(settings, "title_no");
if (title >= 0)
{
- if (ghb_settings_get_boolean(settings, "title_no_in_destination"))
+ if (ghb_settings_get_boolean(ud->prefs, "title_no_in_destination"))
{
g_string_append_printf(str, " - %d", title+1);
}
- if (ghb_settings_combo_int(settings, "PtoPType") == 0 &&
- ghb_settings_get_boolean(
- settings, "chapters_in_destination"))
+ if (ghb_settings_combo_int(settings, "PtoPType") == 0 &&
+ ghb_settings_get_boolean(ud->prefs, "chapters_in_destination"))
{
gint start, end;
if (!ghb_settings_get_boolean(
- settings, "title_no_in_destination"))
+ ud->prefs, "title_no_in_destination"))
{
g_string_append_printf(str, " -");
}
@@ -604,18 +604,24 @@ set_destination_settings(GValue *settings)
}
}
g_string_append_printf(str, ".%s", extension);
- new_name = g_string_free(str, FALSE);
- ghb_settings_set_string(settings, "dest_file", new_name);
+ filename = g_string_free(str, FALSE);
+ ghb_settings_set_string(settings, "dest_file", filename);
g_free(vol_name);
- g_free(new_name);
+ g_free(filename);
+ }
+ else
+ {
+ filename = g_strdup_printf("new_video.%s", extension);
+ ghb_settings_set_string(settings, "dest_file", filename);
+ g_free(filename);
}
}
static void
set_destination(signal_user_data_t *ud)
{
- set_destination_settings(ud->settings);
- ghb_ui_update(ud, "dest_file",
+ set_destination_settings(ud, ud->settings);
+ ghb_ui_update(ud, "dest_file",
ghb_settings_get_value(ud->settings, "dest_file"));
}
@@ -652,7 +658,7 @@ resolve_drive_name(gchar *filename)
if (dtype == DRIVE_CDROM)
{
gchar vname[51], fsname[51];
- GetVolumeInformation(drive, vname, 50, NULL,
+ GetVolumeInformation(drive, vname, 50, NULL,
NULL, NULL, fsname, 50);
name = g_strdup(vname);
return name;
@@ -665,14 +671,14 @@ resolve_drive_name(gchar *filename)
}
static gboolean
-update_source_label(signal_user_data_t *ud, const gchar *source, gboolean update_dest)
+update_source_label(signal_user_data_t *ud, const gchar *source)
{
gchar *label = NULL;
gint len;
gchar **path;
gchar *start;
gchar *filename = g_strdup(source);
-
+
g_debug("update_source_label()");
len = strlen(filename);
if (g_file_test(filename, G_FILE_TEST_IS_DIR))
@@ -698,7 +704,7 @@ update_source_label(signal_user_data_t *ud, const gchar *source, gboolean update
start++;
else
start = filename;
-
+
path = g_strsplit(start, G_DIR_SEPARATOR_S, -1);
len = g_strv_length (path);
if ((len > 1) && (strcmp("VIDEO_TS", path[len-1]) == 0))
@@ -745,14 +751,12 @@ update_source_label(signal_user_data_t *ud, const gchar *source, gboolean update
}
}
g_free(filename);
- GtkWidget *widget = GHB_WIDGET (ud->builder, "source_title");
+ GtkWidget *widget = GHB_WIDGET (ud->builder, "volume_label");
if (label != NULL)
{
gtk_label_set_text (GTK_LABEL(widget), label);
ghb_settings_set_string(ud->settings, "volume_label", label);
g_free(label);
- if (update_dest)
- set_destination(ud);
}
else
{
@@ -773,7 +777,7 @@ chooser_file_selected_cb(GtkFileChooser *dialog, signal_user_data_t *ud)
const gchar *device;
gboolean foundit = FALSE;
GtkComboBox *combo;
-
+
g_debug("chooser_file_selected_cb ()");
if (name == NULL) return;
@@ -833,7 +837,7 @@ source_dialog_extra_widgets(
{
GtkComboBoxText *combo;
GList *drives, *link;
-
+
g_debug("source_dialog_extra_widgets ()");
combo = GTK_COMBO_BOX_TEXT(GHB_WIDGET(ud->builder, "source_device"));
gtk_list_store_clear(GTK_LIST_STORE(
@@ -853,10 +857,231 @@ source_dialog_extra_widgets(
gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 0);
}
-extern GValue *ghb_queue_edit_settings;
-static gchar *last_scan_file = NULL;
+static void break_duration(gint64 duration, gint *hh, gint *mm, gint *ss)
+{
+ *hh = duration / (60*60);
+ *mm = (duration / 60) % 60;
+ *ss = duration % 60;
+}
+
+static void
+update_title_duration(signal_user_data_t *ud)
+{
+ gint ti;
+ gint hh, mm, ss, start, end;
+ gchar *text;
+ GtkWidget *widget;
+
+ ti = ghb_settings_combo_int(ud->settings, "title");
+ widget = GHB_WIDGET (ud->builder, "title_duration");
+
+ if (ghb_settings_combo_int(ud->settings, "PtoPType") == 0)
+ {
+ start = ghb_settings_get_int(ud->settings, "start_point");
+ end = ghb_settings_get_int(ud->settings, "end_point");
+ ghb_part_duration(ti, start, end, &hh, &mm, &ss);
+ }
+ else if (ghb_settings_combo_int(ud->settings, "PtoPType") == 1)
+ {
+ gint duration;
+
+ start = ghb_settings_get_int(ud->settings, "start_point");
+ end = ghb_settings_get_int(ud->settings, "end_point");
+ duration = end - start;
+ break_duration(duration, &hh, &mm, &ss);
+ }
+ else if (ghb_settings_combo_int(ud->settings, "PtoPType") == 2)
+ {
+ hb_title_t * title = ghb_get_title_info (ti);
+ if (title != NULL)
+ {
+ gint64 frames;
+ gint duration;
+
+ start = ghb_settings_get_int(ud->settings, "start_point");
+ end = ghb_settings_get_int(ud->settings, "end_point");
+ frames = end - start + 1;
+ duration = frames * title->rate_base / title->rate;
+ break_duration(duration, &hh, &mm, &ss);
+ }
+ else
+ {
+ hh = mm = ss = 0;
+ }
+ }
+ text = g_strdup_printf("%02d:%02d:%02d", hh, mm, ss);
+ gtk_label_set_text(GTK_LABEL(widget), text);
+ g_free(text);
+}
+
+static void show_container_options(signal_user_data_t *ud)
+{
+ GtkWidget *w1, *w2, *w3;
+ w1 = GHB_WIDGET(ud->builder, "Mp4LargeFile");
+ w2 = GHB_WIDGET(ud->builder, "Mp4HttpOptimize");
+ w3 = GHB_WIDGET(ud->builder, "Mp4iPodCompatible");
+
+ gint mux = ghb_settings_combo_int(ud->settings, "FileFormat");
+ gint enc = ghb_settings_combo_int(ud->settings, "VideoEncoder");
+
+ gtk_widget_set_visible(w1, (mux == HB_MUX_MP4V2));
+ gtk_widget_set_visible(w2, (mux & HB_MUX_MASK_MP4));
+ gtk_widget_set_visible(w3, (mux & HB_MUX_MASK_MP4) && (enc == HB_VCODEC_X264));
+}
+
+void
+ghb_set_widget_ranges(signal_user_data_t *ud, GValue *settings)
+{
+ GtkWidget *widget;
+ int titleindex = ghb_settings_combo_int(settings, "title");
+ hb_title_t * title = ghb_get_title_info(titleindex);
+
+ // Reconfigure the UI combo boxes
+ ghb_update_ui_combo_box(ud, "AudioTrack", titleindex, FALSE);
+ ghb_update_ui_combo_box(ud, "SubtitleTrack", titleindex, FALSE);
+
+ if (title != NULL)
+ {
+ // Set the limits of cropping. hb_set_anamorphic_size crashes if
+ // you pass it a cropped width or height == 0.
+ gint bound;
+ bound = title->height / 2 - 8;
+ widget = GHB_WIDGET(ud->builder, "PictureTopCrop");
+ gtk_spin_button_set_range(GTK_SPIN_BUTTON(widget), 0, bound);
+ widget = GHB_WIDGET(ud->builder, "PictureBottomCrop");
+ gtk_spin_button_set_range(GTK_SPIN_BUTTON(widget), 0, bound);
+ bound = title->width / 2 - 8;
+ widget = GHB_WIDGET(ud->builder, "PictureLeftCrop");
+ gtk_spin_button_set_range(GTK_SPIN_BUTTON(widget), 0, bound);
+ widget = GHB_WIDGET(ud->builder, "PictureRightCrop");
+ gtk_spin_button_set_range(GTK_SPIN_BUTTON(widget), 0, bound);
+
+ gint duration = title->duration / 90000;
+
+ gint num_chapters = hb_list_count(title->list_chapter);
+ if (ghb_settings_combo_int(ud->settings, "PtoPType") == 0)
+ {
+ widget = GHB_WIDGET(ud->builder, "start_point");
+ gtk_spin_button_set_range(GTK_SPIN_BUTTON(widget), 1, num_chapters);
+ widget = GHB_WIDGET(ud->builder, "end_point");
+ gtk_spin_button_set_range(GTK_SPIN_BUTTON(widget), 1, num_chapters);
+ }
+ else if (ghb_settings_combo_int(ud->settings, "PtoPType") == 1)
+ {
+
+ widget = GHB_WIDGET (ud->builder, "start_point");
+ gtk_spin_button_set_range(GTK_SPIN_BUTTON(widget), 0, duration-1);
+ widget = GHB_WIDGET (ud->builder, "end_point");
+ gtk_spin_button_set_range(GTK_SPIN_BUTTON(widget), 1, duration);
+ }
+ else if (ghb_settings_combo_int(ud->settings, "PtoPType") == 2)
+ {
+ gdouble max_frames = (gdouble)duration * title->rate / title->rate_base;
+ widget = GHB_WIDGET(ud->builder, "start_point");
+ gtk_spin_button_set_range(GTK_SPIN_BUTTON(widget), 1, max_frames);
+ widget = GHB_WIDGET(ud->builder, "end_point");
+ gtk_spin_button_set_range(GTK_SPIN_BUTTON(widget), 1, max_frames);
+ }
+
+ widget = GHB_WIDGET (ud->builder, "angle");
+ gtk_spin_button_set_range(GTK_SPIN_BUTTON(widget), 1, title->angle_count);
+ }
+
+ gdouble vqmin, vqmax, step, page;
+ gboolean inverted;
+ gint digits;
+
+ ghb_vquality_range(ud, &vqmin, &vqmax, &step, &page, &digits, &inverted);
+ GtkWidget *qp = GHB_WIDGET(ud->builder, "VideoQualitySlider");
+ gtk_range_set_range (GTK_RANGE(qp), vqmin, vqmax);
+ gtk_range_set_increments (GTK_RANGE(qp), step, page);
+ gtk_scale_set_digits(GTK_SCALE(qp), digits);
+ gtk_range_set_inverted (GTK_RANGE(qp), inverted);
+}
-static void
+static void
+check_chapter_markers(signal_user_data_t *ud)
+{
+ GtkWidget *widget;
+ gint start, end;
+
+ if (ghb_settings_combo_int(ud->settings, "PtoPType") == 0)
+ {
+ start = ghb_settings_get_int(ud->settings, "start_point");
+ end = ghb_settings_get_int(ud->settings, "end_point");
+ widget = GHB_WIDGET (ud->builder, "ChapterMarkers");
+ gtk_widget_set_sensitive(widget, end > start);
+ }
+}
+
+#if 0
+void
+show_settings(GValue *settings)
+{
+ GHashTableIter iter;
+ gchar *key;
+ GValue *gval;
+
+ ghb_dict_iter_init(&iter, settings);
+ // middle (void*) cast prevents gcc warning "defreferencing type-punned
+ // pointer will break strict-aliasing rules"
+ while (g_hash_table_iter_next(
+ &iter, (gpointer*)(void*)&key, (gpointer*)(void*)&gval))
+ {
+ char *str = ghb_value_string(gval);
+ printf("show key %s val %s\n", key, str);
+ g_free(str);
+ }
+}
+#endif
+
+void
+ghb_load_settings(signal_user_data_t * ud)
+{
+ GValue *preset;
+ gboolean preset_modified;
+ static gboolean busy = FALSE;
+
+ if (busy)
+ return;
+ busy = TRUE;
+
+ preset = ghb_settings_get_value(ud->settings, "preset");
+ preset_modified = ghb_settings_get_boolean(ud->settings, "preset_modified");
+ if (preset_modified)
+ {
+ ghb_clear_presets_selection(ud);
+ }
+ else
+ {
+ ghb_settings_set_boolean(ud->settings, "preset_reload", TRUE);
+ ghb_select_preset(ud->builder, preset);
+ ghb_settings_set_boolean(ud->settings, "preset_reload", FALSE);
+ }
+
+ ghb_set_widget_ranges(ud, ud->settings);
+ ghb_check_all_depencencies(ud);
+ show_container_options(ud);
+ check_chapter_markers(ud);
+
+ ud->dont_clear_presets = TRUE;
+ ud->scale_busy = TRUE;
+
+ ghb_settings_to_ui(ud, ud->settings);
+ ghb_audio_defaults_to_ui(ud);
+ ghb_subtitle_defaults_to_ui(ud);
+ ghb_audio_list_refresh_all(ud);
+ ghb_subtitle_list_refresh_all(ud);
+ ghb_chapter_list_refresh_all(ud);
+ update_title_duration(ud);
+ ghb_update_title_info(ud);
+
+ ud->dont_clear_presets = FALSE;
+ ud->scale_busy = FALSE;
+ busy = FALSE;
+}
+
+static void
show_scan_progress(signal_user_data_t *ud)
{
GtkProgressBar *progress;
@@ -866,15 +1091,15 @@ show_scan_progress(signal_user_data_t *ud)
gtk_progress_bar_set_fraction (progress, 0);
gtk_widget_show(GTK_WIDGET(progress));
- label = GTK_LABEL(GHB_WIDGET(ud->builder, "source_title"));
+ label = GTK_LABEL(GHB_WIDGET(ud->builder, "volume_label"));
gtk_label_set_text( label, _("Scanning ...") );
}
static void
start_scan(
- signal_user_data_t *ud,
- const gchar *path,
- gint titlenum,
+ signal_user_data_t *ud,
+ const gchar *path,
+ gint titlenum,
gint preview_count)
{
GtkWidget *widget;
@@ -893,40 +1118,47 @@ start_scan(
gtk_widget_set_sensitive(widget, FALSE);
widget = GHB_WIDGET(ud->builder, "source_title_open");
gtk_widget_set_sensitive(widget, FALSE);
- ghb_backend_scan(path, titlenum, preview_count,
- 90000L * ghb_settings_get_int64(ud->settings, "MinTitleDuration"));
+ ghb_backend_scan(path, titlenum, preview_count,
+ 90000L * ghb_settings_get_int64(ud->prefs, "MinTitleDuration"));
}
gboolean
ghb_idle_scan(signal_user_data_t *ud)
{
gchar *path;
- path = ghb_settings_get_string( ud->settings, "scan_source");
+ path = ghb_settings_get_string(ud->globals, "scan_source");
ghb_do_scan(ud, path, 0, TRUE);
g_free(path);
return FALSE;
}
+extern GValue *ghb_queue_edit_settings;
+static gchar *last_scan_file = NULL;
+
void
ghb_do_scan(
- signal_user_data_t *ud,
- const gchar *filename,
- gint titlenum,
+ signal_user_data_t *ud,
+ const gchar *filename,
+ gint titlenum,
gboolean force)
{
g_debug("ghb_do_scan()");
if (!force && last_scan_file != NULL &&
strcmp(last_scan_file, filename) == 0)
{
- if (ghb_queue_edit_settings)
+ if (ghb_queue_edit_settings != NULL)
{
- ghb_settings_to_ui(ud, ghb_queue_edit_settings);
- ghb_set_audio(ud, ghb_queue_edit_settings);
- ghb_reset_subtitles(ud, ghb_queue_edit_settings);
- reset_chapter_list(ud, ghb_queue_edit_settings);
- ghb_value_free(ghb_queue_edit_settings);
+ int titleindex = ghb_settings_get_int(ghb_queue_edit_settings, "title_no");
+ ghb_array_replace(ud->settings_array, titleindex, ghb_queue_edit_settings);
+ ud->settings = ghb_queue_edit_settings;
+ ghb_load_settings(ud);
ghb_queue_edit_settings = NULL;
}
+ else
+ {
+ int titleindex = ghb_settings_get_int(ud->settings, "title_no");
+ load_all_titles(ud, titleindex);
+ }
return;
}
if (last_scan_file != NULL)
@@ -935,17 +1167,17 @@ ghb_do_scan(
if (filename != NULL)
{
last_scan_file = g_strdup(filename);
- ghb_settings_set_string(ud->settings, "scan_source", filename);
- if (update_source_label(ud, filename, TRUE))
+ ghb_settings_set_string(ud->globals, "scan_source", filename);
+ if (update_source_label(ud, filename))
{
gchar *path;
gint preview_count;
show_scan_progress(ud);
- path = ghb_settings_get_string( ud->settings, "scan_source");
+ path = ghb_settings_get_string(ud->globals, "scan_source");
prune_logs(ud);
- preview_count = ghb_settings_get_int(ud->settings, "preview_count");
+ preview_count = ghb_settings_get_int(ud->prefs, "preview_count");
start_scan(ud, path, titlenum, preview_count);
g_free(path);
}
@@ -964,7 +1196,7 @@ do_source_dialog(GtkButton *button, gboolean single, signal_user_data_t *ud)
gint response;
g_debug("source_browse_clicked_cb ()");
- sourcename = ghb_settings_get_string(ud->settings, "scan_source");
+ sourcename = ghb_settings_get_string(ud->globals, "scan_source");
GtkWidget *widget;
widget = GHB_WIDGET(ud->builder, "single_title_box");
if (single)
@@ -1007,10 +1239,9 @@ do_source_dialog(GtkButton *button, gboolean single, signal_user_data_t *ud)
ghb_do_scan(ud, filename, titlenum, TRUE);
if (strcmp(sourcename, filename) != 0)
{
- ghb_settings_set_string (ud->settings,
- "default_source", filename);
- ghb_pref_save (ud->settings, "default_source");
- ghb_dvd_set_current (filename, ud);
+ ghb_settings_set_string(ud->prefs, "default_source", filename);
+ ghb_pref_save(ud->prefs, "default_source");
+ ghb_dvd_set_current(filename, ud);
}
g_free(filename);
}
@@ -1045,14 +1276,14 @@ dvd_source_activate_cb(GtkWidget *widget, signal_user_data_t *ud)
const gchar *filename;
gchar *sourcename;
- sourcename = ghb_settings_get_string(ud->settings, "scan_source");
+ sourcename = ghb_settings_get_string(ud->globals, "scan_source");
filename = gtk_buildable_get_name(GTK_BUILDABLE(widget));
ghb_do_scan(ud, filename, 0, TRUE);
if (strcmp(sourcename, filename) != 0)
{
- ghb_settings_set_string (ud->settings, "default_source", filename);
- ghb_pref_save (ud->settings, "default_source");
- ghb_dvd_set_current (filename, ud);
+ ghb_settings_set_string(ud->prefs, "default_source", filename);
+ ghb_pref_save(ud->prefs, "default_source");
+ ghb_dvd_set_current(filename, ud);
}
g_free(sourcename);
}
@@ -1074,7 +1305,7 @@ ghb_update_destination_extension(signal_user_data_t *ud)
if (busy)
return;
busy = TRUE;
- extension = get_extension(ud->settings);
+ extension = get_extension(ud, ud->settings);
entry = GTK_ENTRY(GHB_WIDGET(ud->builder, "dest_file"));
filename = g_strdup(gtk_entry_get_text(entry));
for (ii = 0; containers[ii] != NULL; ii++)
@@ -1083,7 +1314,7 @@ ghb_update_destination_extension(signal_user_data_t *ud)
{
gchar *pos;
gchar *new_name;
-
+
pos = g_strrstr( filename, "." );
if (pos == NULL)
{
@@ -1096,7 +1327,7 @@ ghb_update_destination_extension(signal_user_data_t *ud)
// Extension is already correct
break;
}
- new_name = g_strjoin(".", filename, extension, NULL);
+ new_name = g_strjoin(".", filename, extension, NULL);
ghb_ui_update(ud, "dest_file", ghb_string_value(new_name));
g_free(new_name);
break;
@@ -1137,7 +1368,7 @@ destination_select_title(GtkEntry *entry)
G_MODULE_EXPORT gboolean
destination_grab_cb(
- GtkEntry *entry,
+ GtkEntry *entry,
signal_user_data_t *ud)
{
destination_select_title(entry);
@@ -1150,7 +1381,7 @@ G_MODULE_EXPORT void
dest_dir_set_cb(GtkFileChooserButton *dest_chooser, signal_user_data_t *ud)
{
gchar *dest_file, *dest_dir, *dest;
-
+
g_debug("dest_dir_set_cb ()");
ghb_widget_to_setting(ud->settings, (GtkWidget*)dest_chooser);
dest_file = ghb_settings_get_string(ud->settings, "dest_file");
@@ -1167,7 +1398,7 @@ G_MODULE_EXPORT void
dest_file_changed_cb(GtkEntry *entry, signal_user_data_t *ud)
{
gchar *dest_file, *dest_dir, *dest;
-
+
g_debug("dest_file_changed_cb ()");
ghb_update_destination_extension(ud);
ghb_widget_to_setting(ud->settings, (GtkWidget*)entry);
@@ -1208,7 +1439,7 @@ destination_browse_clicked_cb(GtkButton *button, signal_user_data_t *ud)
{
char *filename, *dirname;
GtkFileChooser *dest_chooser;
-
+
filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
basename = g_path_get_basename(filename);
dirname = g_path_get_dirname(filename);
@@ -1262,34 +1493,6 @@ update_acodec(signal_user_data_t *ud)
ghb_grey_combo_options (ud);
}
-static void
-set_visible(GtkWidget *widget, gboolean visible)
-{
- if (visible)
- {
- gtk_widget_show_now(widget);
- }
- else
- {
- gtk_widget_hide(widget);
- }
-}
-
-static void show_container_options(signal_user_data_t *ud)
-{
- GtkWidget *w1, *w2, *w3;
- w1 = GHB_WIDGET(ud->builder, "Mp4LargeFile");
- w2 = GHB_WIDGET(ud->builder, "Mp4HttpOptimize");
- w3 = GHB_WIDGET(ud->builder, "Mp4iPodCompatible");
-
- gint mux = ghb_settings_combo_int(ud->settings, "FileFormat");
- gint enc = ghb_settings_combo_int(ud->settings, "VideoEncoder");
-
- set_visible(w1, (mux == HB_MUX_MP4V2));
- set_visible(w2, (mux & HB_MUX_MASK_MP4));
- set_visible(w3, (mux & HB_MUX_MASK_MP4) && (enc == HB_VCODEC_X264));
-}
-
G_MODULE_EXPORT void
container_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
{
@@ -1333,100 +1536,110 @@ get_rate_string(gint rate_base, gint rate)
return rate_s;
}
-static void break_duration(gint64 duration, gint *hh, gint *mm, gint *ss)
-{
- *hh = duration / (60*60);
- *mm = (duration / 60) % 60;
- *ss = duration % 60;
-}
-
static void
-update_title_duration(signal_user_data_t *ud)
+update_aspect_info(signal_user_data_t *ud)
{
- gint ti;
- gint hh, mm, ss, start, end;
- gchar *text;
GtkWidget *widget;
+ gchar *text;
- ti = ghb_settings_combo_int(ud->settings, "title");
- widget = GHB_WIDGET (ud->builder, "title_duration");
-
- if (ghb_settings_combo_int(ud->settings, "PtoPType") == 0)
+ text = ghb_settings_get_boolean(ud->settings, "PictureAutoCrop") ? _("On") : _("Off");
+ widget = GHB_WIDGET(ud->builder, "crop_auto");
+ gtk_label_set_text(GTK_LABEL(widget), text);
+ text = ghb_settings_get_boolean(ud->settings, "autoscale") ? _("On") : _("Off");
+ widget = GHB_WIDGET(ud->builder, "scale_auto");
+ gtk_label_set_text(GTK_LABEL(widget), text);
+ switch (ghb_settings_combo_int(ud->settings, "PicturePAR"))
{
- start = ghb_settings_get_int(ud->settings, "start_point");
- end = ghb_settings_get_int(ud->settings, "end_point");
- ghb_part_duration(ti, start, end, &hh, &mm, &ss);
+ case 0:
+ text = _("Off");
+ break;
+ case 1:
+ text = _("Strict");
+ break;
+ case 2:
+ text = _("Loose");
+ break;
+ case 3:
+ text = _("Custom");
+ break;
+ default:
+ text = _("Unknown");
+ break;
}
- else if (ghb_settings_combo_int(ud->settings, "PtoPType") == 1)
- {
- gint duration;
+ widget = GHB_WIDGET(ud->builder, "scale_anamorphic");
+ gtk_label_set_text(GTK_LABEL(widget), text);
+}
- start = ghb_settings_get_int(ud->settings, "start_point");
- end = ghb_settings_get_int(ud->settings, "end_point");
- duration = end - start;
- break_duration(duration, &hh, &mm, &ss);
- }
- else if (ghb_settings_combo_int(ud->settings, "PtoPType") == 2)
- {
- hb_title_t * title = ghb_get_title_info (ti);
- if (title != NULL)
- {
- gint64 frames;
- gint duration;
+static void
+update_crop_info(signal_user_data_t *ud)
+{
+ GtkWidget *widget;
+ gchar *text;
+ gint width, height, crop[4];
+ gint titleindex;
+ hb_title_t *title;
- start = ghb_settings_get_int(ud->settings, "start_point");
- end = ghb_settings_get_int(ud->settings, "end_point");
- frames = end - start + 1;
- duration = frames * title->rate_base / title->rate;
- break_duration(duration, &hh, &mm, &ss);
- }
- else
- {
- hh = mm = ss = 0;
- }
+ titleindex = ghb_settings_combo_int(ud->settings, "title");
+ title = ghb_get_title_info(titleindex);
+ if (title != NULL)
+ {
+ crop[0] = ghb_settings_get_int(ud->settings, "PictureTopCrop");
+ crop[1] = ghb_settings_get_int(ud->settings, "PictureBottomCrop");
+ crop[2] = ghb_settings_get_int(ud->settings, "PictureLeftCrop");
+ crop[3] = ghb_settings_get_int(ud->settings, "PictureRightCrop");
+ width = title->width - crop[2] - crop[3];
+ height = title->height - crop[0] - crop[1];
+ widget = GHB_WIDGET(ud->builder, "crop_dimensions");
+ text = g_strdup_printf ("%d x %d", width, height);
+ gtk_label_set_text(GTK_LABEL(widget), text);
+ widget = GHB_WIDGET(ud->builder, "crop_dimensions2");
+ gtk_label_set_text(GTK_LABEL(widget), text);
+ g_free(text);
}
- text = g_strdup_printf("%02d:%02d:%02d", hh, mm, ss);
+ widget = GHB_WIDGET (ud->builder, "crop_values");
+ text = g_strdup_printf ("%d:%d:%d:%d", crop[0], crop[1], crop[2], crop[3]);
gtk_label_set_text (GTK_LABEL(widget), text);
g_free(text);
}
static void
-show_title_info(signal_user_data_t *ud, hb_title_t *title)
+update_scale_info(signal_user_data_t *ud)
{
GtkWidget *widget;
gchar *text;
- ghb_settings_set_string(ud->settings, "source", title->path);
- if (title->type == HB_STREAM_TYPE || title->type == HB_FF_STREAM_TYPE)
- {
- GtkWidget *widget = GHB_WIDGET (ud->builder, "source_title");
- if (title->name != NULL && title->name[0] != 0)
- {
- gtk_label_set_text (GTK_LABEL(widget), title->name);
- ghb_settings_set_string(ud->settings, "volume_label", title->name);
- set_destination(ud);
- }
- else
- {
- gchar *label = _("No Title Found");
- gtk_label_set_text (GTK_LABEL(widget), label);
- ghb_settings_set_string(ud->settings, "volume_label", label);
- }
- }
- ud->dont_clear_presets = TRUE;
- ud->scale_busy = TRUE;
+ gint width = ghb_settings_get_int(ud->settings, "scale_width");
+ gint height = ghb_settings_get_int(ud->settings, "scale_height");
+ widget = GHB_WIDGET(ud->builder, "scale_dimensions");
+ text = g_strdup_printf("%d x %d", width, height);
+ gtk_label_set_text(GTK_LABEL(widget), text);
+ g_free(text);
+}
+
+void
+ghb_update_title_info(signal_user_data_t *ud)
+{
+ GtkWidget *widget;
+ gchar *text;
+
+ int titleindex = ghb_settings_get_int(ud->settings, "title_no");
+ hb_title_t * title = ghb_get_title_info(titleindex);
+ if (title == NULL)
+ return;
+
update_title_duration(ud);
- widget = GHB_WIDGET (ud->builder, "source_codec");
+
+ widget = GHB_WIDGET (ud->builder, "source_video_codec");
if ( title->video_codec_name )
gtk_label_set_text (GTK_LABEL(widget), title->video_codec_name);
else
gtk_label_set_text (GTK_LABEL(widget), "Unknown");
+
widget = GHB_WIDGET (ud->builder, "source_dimensions");
text = g_strdup_printf ("%d x %d", title->width, title->height);
gtk_label_set_text (GTK_LABEL(widget), text);
- ghb_settings_set_int(ud->settings, "source_width", title->width);
- ghb_settings_set_int(ud->settings, "source_height", title->height);
g_free(text);
+
widget = GHB_WIDGET (ud->builder, "source_aspect");
gint aspect_n, aspect_d;
hb_reduce(&aspect_n, &aspect_d,
@@ -1444,128 +1657,15 @@ show_title_info(signal_user_data_t *ud, hb_title_t *title)
//widget = GHB_WIDGET (ud->builder, "source_interlaced");
//gtk_label_set_text (GTK_LABEL(widget), title->interlaced ? "Yes" : "No");
- ghb_ui_update(ud, "scale_width",
- ghb_int64_value(title->width - title->crop[2] - title->crop[3]));
- // If anamorphic or keep_aspect, the hight will be automatically calculated
- gboolean keep_aspect;
- gint pic_par;
- keep_aspect = ghb_settings_get_boolean(ud->settings, "PictureKeepRatio");
- pic_par = ghb_settings_combo_int(ud->settings, "PicturePAR");
- if (!(keep_aspect || pic_par) || pic_par == 3)
- {
- ghb_ui_update(ud, "scale_height",
- ghb_int64_value(title->height - title->crop[0] - title->crop[1]));
- }
-
- // Set the limits of cropping. hb_set_anamorphic_size crashes if
- // you pass it a cropped width or height == 0.
- gint bound;
- bound = title->height / 2 - 8;
- widget = GHB_WIDGET (ud->builder, "PictureTopCrop");
- gtk_spin_button_set_range (GTK_SPIN_BUTTON(widget), 0, bound);
- widget = GHB_WIDGET (ud->builder, "PictureBottomCrop");
- gtk_spin_button_set_range (GTK_SPIN_BUTTON(widget), 0, bound);
- bound = title->width / 2 - 8;
- widget = GHB_WIDGET (ud->builder, "PictureLeftCrop");
- gtk_spin_button_set_range (GTK_SPIN_BUTTON(widget), 0, bound);
- widget = GHB_WIDGET (ud->builder, "PictureRightCrop");
- gtk_spin_button_set_range (GTK_SPIN_BUTTON(widget), 0, bound);
- if (ghb_settings_get_boolean(ud->settings, "PictureAutoCrop"))
- {
- ghb_ui_update(ud, "PictureTopCrop", ghb_int64_value(title->crop[0]));
- ghb_ui_update(ud, "PictureBottomCrop", ghb_int64_value(title->crop[1]));
- ghb_ui_update(ud, "PictureLeftCrop", ghb_int64_value(title->crop[2]));
- ghb_ui_update(ud, "PictureRightCrop", ghb_int64_value(title->crop[3]));
- }
- ud->scale_busy = FALSE;
- ghb_set_scale (ud, GHB_PIC_KEEP_PAR|GHB_PIC_USE_MAX);
- gint width, height, crop[4];
- crop[0] = ghb_settings_get_int(ud->settings, "PictureTopCrop");
- crop[1] = ghb_settings_get_int(ud->settings, "PictureBottomCrop");
- crop[2] = ghb_settings_get_int(ud->settings, "PictureLeftCrop");
- crop[3] = ghb_settings_get_int(ud->settings, "PictureRightCrop");
- width = title->width - crop[2] - crop[3];
- height = title->height - crop[0] - crop[1];
- widget = GHB_WIDGET (ud->builder, "crop_dimensions");
- text = g_strdup_printf ("%d x %d", width, height);
- gtk_label_set_text (GTK_LABEL(widget), text);
- g_free(text);
-
-
- gint duration = title->duration / 90000;
-
- gint num_chapters = hb_list_count(title->list_chapter);
- if (ghb_settings_combo_int(ud->settings, "PtoPType") == 0)
- {
- widget = GHB_WIDGET (ud->builder, "start_point");
- gtk_spin_button_set_range (GTK_SPIN_BUTTON(widget), 1, num_chapters);
- gtk_spin_button_set_value (GTK_SPIN_BUTTON(widget), 1);
-
- widget = GHB_WIDGET (ud->builder, "end_point");
- gtk_spin_button_set_range (GTK_SPIN_BUTTON(widget), 1, num_chapters);
- gtk_spin_button_set_value (GTK_SPIN_BUTTON(widget), num_chapters);
- }
- else if (ghb_settings_combo_int(ud->settings, "PtoPType") == 1)
- {
-
- widget = GHB_WIDGET (ud->builder, "start_point");
- gtk_spin_button_set_range (GTK_SPIN_BUTTON(widget), 0, duration-1);
- gtk_spin_button_set_value (GTK_SPIN_BUTTON(widget), 0);
+ ghb_update_display_aspect_label(ud);
- widget = GHB_WIDGET (ud->builder, "end_point");
- gtk_spin_button_set_range (GTK_SPIN_BUTTON(widget), 1, duration);
- gtk_spin_button_set_value (GTK_SPIN_BUTTON(widget), duration);
- }
- else if (ghb_settings_combo_int(ud->settings, "PtoPType") == 2)
- {
- gdouble max_frames = (gdouble)duration * title->rate / title->rate_base;
- widget = GHB_WIDGET (ud->builder, "start_point");
- gtk_spin_button_set_range (GTK_SPIN_BUTTON(widget), 1, max_frames);
- gtk_spin_button_set_value (GTK_SPIN_BUTTON(widget), 1);
-
- widget = GHB_WIDGET (ud->builder, "end_point");
- gtk_spin_button_set_range (GTK_SPIN_BUTTON(widget), 1, max_frames);
- gtk_spin_button_set_value (GTK_SPIN_BUTTON(widget), max_frames);
- }
-
- widget = GHB_WIDGET (ud->builder, "angle");
- gtk_spin_button_set_value (GTK_SPIN_BUTTON(widget), 1);
- gtk_spin_button_set_range (GTK_SPIN_BUTTON(widget), 1, title->angle_count);
- ghb_settings_set_int(ud->settings, "angle_count", title->angle_count);
- ud->dont_clear_presets = FALSE;
- // Set default metadata name
- ghb_ui_update(ud, "MetaName", ghb_string_value(title->name));
- if (title->metadata)
- {
- if (title->metadata->name)
- {
- ghb_ui_update(ud, "MetaName",
- ghb_string_value(title->metadata->name));
- }
- ghb_ui_update(ud, "MetaArtist",
- ghb_string_value(title->metadata->artist));
- ghb_ui_update(ud, "MetaReleaseDate",
- ghb_string_value(title->metadata->release_date));
- ghb_ui_update(ud, "MetaComment",
- ghb_string_value(title->metadata->comment));
- if (!title->metadata->name && title->metadata->album)
- {
- ghb_ui_update(ud, "MetaName",
- ghb_string_value(title->metadata->album));
- }
- ghb_ui_update(ud, "MetaAlbumArtist",
- ghb_string_value(title->metadata->album_artist));
- ghb_ui_update(ud, "MetaGenre",
- ghb_string_value(title->metadata->genre));
- ghb_ui_update(ud, "MetaDescription",
- ghb_string_value(title->metadata->description));
- ghb_ui_update(ud, "MetaLongDescription",
- ghb_string_value(title->metadata->long_description));
- }
+ update_crop_info(ud);
+ update_aspect_info(ud);
+ update_scale_info(ud);
}
void
-set_title_settings(GValue *settings, gint titleindex)
+set_title_settings(signal_user_data_t *ud, GValue *settings, gint titleindex)
{
ghb_settings_set_int(settings, "title", titleindex);
ghb_settings_set_int(settings, "title_no", titleindex);
@@ -1575,6 +1675,7 @@ set_title_settings(GValue *settings, gint titleindex)
{
gint num_chapters = hb_list_count(title->list_chapter);
+ ghb_settings_set_int(settings, "angle", 1);
ghb_settings_set_int(settings, "PtoPType", 0);
ghb_settings_set_int(settings, "start_point", 1);
ghb_settings_set_int(settings, "end_point", num_chapters);
@@ -1593,10 +1694,15 @@ set_title_settings(GValue *settings, gint titleindex)
ghb_settings_set_string(settings, "volume_label", label);
}
}
+ else
+ {
+ ghb_settings_set_value(settings, "volume_label",
+ ghb_settings_get_value(ud->settings, "volume_label"));
+ }
ghb_settings_set_int(settings, "scale_width",
title->width - title->crop[2] - title->crop[3]);
- // If anamorphic or keep_aspect, the hight will
+ // If anamorphic or keep_aspect, the hight will
// be automatically calculated
gboolean keep_aspect;
gint pic_par;
@@ -1639,11 +1745,14 @@ set_title_settings(GValue *settings, gint titleindex)
ghb_settings_set_string(settings, "MetaLongDescription",
title->metadata->long_description);
}
- ghb_set_pref_subtitle_settings(title, settings);
+ ghb_set_pref_subtitle_settings(ud, title, settings);
}
update_chapter_list_settings(settings);
ghb_set_pref_audio_settings(titleindex, settings);
- set_destination_settings(settings);
+
+ set_destination_settings(ud, settings);
+ ghb_settings_set_value(settings, "dest_dir",
+ ghb_settings_get_value(ud->prefs, "destination_dir"));
char *dest_file, *dest_dir, *dest;
dest_file = ghb_settings_get_string(settings, "dest_file");
@@ -1653,29 +1762,66 @@ set_title_settings(GValue *settings, gint titleindex)
g_free(dest_file);
g_free(dest_dir);
g_free(dest);
+
+ ghb_settings_set_int(settings, "preview_frame", 2);
+}
+
+void
+ghb_set_current_title_settings(signal_user_data_t *ud)
+{
+ int titleindex = ghb_settings_get_int(ud->settings, "title_no");
+ set_title_settings(ud, ud->settings, titleindex);
+}
+
+static void
+load_all_titles(signal_user_data_t *ud, int titleindex)
+{
+ gint ii, count;
+ GValue *preset, *preset_path;
+ GValue *settings_array;
+
+ hb_list_t *list = ghb_get_title_list();
+ count = hb_list_count(list);
+
+ if (count == 0)
+ count = 1;
+
+ settings_array = ghb_array_value_new(count);
+
+ preset = ghb_get_current_preset(ud);
+ preset_path = ghb_get_current_preset_path(ud);
+ for (ii = 0; ii < count; ii++)
+ {
+ GValue *settings = ghb_settings_new();
+
+ ghb_settings_init(settings, "Initialization");
+ ghb_settings_init(settings, "Presets");
+ ghb_preset_to_settings(settings, preset);
+ ghb_settings_set_value(settings, "preset", preset_path);
+ set_title_settings(ud, settings, ii);
+ ghb_array_append(settings_array, settings);
+ }
+ if (titleindex < 0 || titleindex >= count)
+ {
+ titleindex = 0;
+ }
+ ghb_value_free(ud->settings_array);
+ ud->settings_array = settings_array;
+ ud->settings = ghb_array_get_nth(ud->settings_array, titleindex);
}
void
ghb_add_all_titles(signal_user_data_t *ud)
{
gint ii;
- gint count = ghb_get_title_count();
+ gint count;
+ count = ghb_array_len(ud->settings_array);
for (ii = 0; ii < count; ii++)
{
- GValue *settings = ghb_value_dup(ud->settings);
- ghb_settings_set_boolean(settings, "use_source_name", TRUE);
- hb_title_t * title = ghb_get_title_info(ii);
- if (title != NULL)
- {
- if (title->type == HB_DVD_TYPE ||
- title->type == HB_BD_TYPE)
- {
- ghb_settings_set_boolean(settings,
- "title_no_in_destination", TRUE);
- }
- }
- set_title_settings(settings, ii);
+ GValue *settings;
+
+ settings = ghb_value_dup(ghb_array_get_nth(ud->settings_array, ii));
ghb_queue_add(ud, settings, ii);
}
}
@@ -1685,59 +1831,29 @@ static gboolean update_preview = FALSE;
G_MODULE_EXPORT void
title_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
{
- gint titleindex;
+ gint titleindex, count;
+ GValue *wval;
g_debug("title_changed_cb ()");
- ghb_widget_to_setting(ud->settings, widget);
- titleindex = ghb_settings_combo_int(ud->settings, "title");
- ghb_settings_set_int(ud->settings, "title_no", titleindex);
- ghb_update_ui_combo_box (ud, "AudioTrack", titleindex, FALSE);
- ghb_update_ui_combo_box (ud, "SubtitleTrack", titleindex, FALSE);
+ wval = ghb_widget_value(widget);
+ titleindex = ghb_lookup_combo_int("title", wval);
+ ghb_value_free(wval);
+
+ count = ghb_array_len(ud->settings_array);
+ int idx = (titleindex >= 0 && titleindex < count) ? titleindex : 0;
+ ud->settings = ghb_array_get_nth(ud->settings_array, idx);
+ ghb_load_settings(ud);
hb_title_t * title = ghb_get_title_info(titleindex);
- if (title != NULL)
- {
- show_title_info(ud, title);
- }
- ghb_check_dependency(ud, widget, NULL);
- update_chapter_list_settings(ud->settings);
- update_chapter_list_from_settings(ud->builder, ud->settings);
ghb_audio_title_change(ud, title != NULL);
- ghb_set_pref_audio_settings(titleindex, ud->settings);
- ghb_set_pref_audio_from_settings(ud, ud->settings);
ghb_subtitle_title_change(ud, title != NULL);
- ghb_set_pref_subtitle(titleindex, ud);
- ghb_grey_combo_options (ud);
+ ghb_grey_combo_options(ud);
- // Unfortunately, there is no way to query how many frames were
- // actually generated during the scan.
- // If I knew how many were generated, I would adjust the spin
- // control range here.
- // I do know how many were asked for.
- gint preview_count;
- preview_count = ghb_settings_get_int(ud->settings, "preview_count");
- widget = GHB_WIDGET(ud->builder, "preview_frame");
- gtk_range_set_range (GTK_RANGE(widget), 1, preview_count);
- ghb_ui_update(ud, "preview_frame", ghb_int64_value(2));
-
- ghb_set_preview_image (ud);
- if (ghb_settings_get_boolean(ud->settings, "title_no_in_destination"))
- {
- set_destination(ud);
- }
- ghb_preview_set_visible(ud);
-
- gint end;
- widget = GHB_WIDGET (ud->builder, "ChapterMarkers");
- end = ghb_settings_get_int(ud->settings, "end_point");
- if (1 == end)
- {
- gtk_widget_set_sensitive(widget, FALSE);
- }
- else
+ if (title != NULL)
{
- gtk_widget_set_sensitive(widget, TRUE);
+ ghb_set_preview_image(ud);
+ ghb_preview_set_visible(ud);
}
}
@@ -1823,7 +1939,7 @@ setting_widget_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
}
G_MODULE_EXPORT gboolean
-meta_focus_out_cb(GtkWidget *widget, GdkEventFocus *event,
+meta_focus_out_cb(GtkWidget *widget, GdkEventFocus *event,
signal_user_data_t *ud)
{
ghb_widget_to_setting(ud->settings, widget);
@@ -1863,8 +1979,7 @@ vquality_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
gdouble step;
if (vcodec == HB_VCODEC_X264)
{
- step = ghb_settings_combo_double(ud->settings,
- "VideoQualityGranularity");
+ step = ghb_settings_combo_double(ud->prefs, "VideoQualityGranularity");
}
else
{
@@ -1921,21 +2036,14 @@ start_point_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
if (start > end)
ghb_ui_update(ud, "end_point", ghb_int_value(start));
ghb_check_dependency(ud, widget, NULL);
- if (ghb_settings_get_boolean(ud->settings, "chapters_in_destination"))
+ if (ghb_settings_get_boolean(ud->prefs, "chapters_in_destination"))
{
set_destination(ud);
}
widget = GHB_WIDGET (ud->builder, "ChapterMarkers");
// End may have been changed above, get it again
end = ghb_settings_get_int(ud->settings, "end_point");
- if (start == end)
- {
- gtk_widget_set_sensitive(widget, FALSE);
- }
- else
- {
- gtk_widget_set_sensitive(widget, TRUE);
- }
+ gtk_widget_set_sensitive(widget, end > start);
update_title_duration(ud);
}
else if (ghb_settings_combo_int(ud->settings, "PtoPType") == 1)
@@ -1973,21 +2081,14 @@ end_point_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
if (start > end)
ghb_ui_update(ud, "start_point", ghb_int_value(end));
ghb_check_dependency(ud, widget, NULL);
- if (ghb_settings_get_boolean(ud->settings, "chapters_in_destination"))
+ if (ghb_settings_get_boolean(ud->prefs, "chapters_in_destination"))
{
set_destination(ud);
}
widget = GHB_WIDGET (ud->builder, "ChapterMarkers");
// Start may have been changed above, get it again
start = ghb_settings_get_int(ud->settings, "start_point");
- if (start == end)
- {
- gtk_widget_set_sensitive(widget, FALSE);
- }
- else
- {
- gtk_widget_set_sensitive(widget, TRUE);
- }
+ gtk_widget_set_sensitive(widget, end > start);
update_title_duration(ud);
}
else if (ghb_settings_combo_int(ud->settings, "PtoPType") == 1)
@@ -2018,16 +2119,11 @@ scale_width_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
ghb_check_dependency(ud, widget, NULL);
ghb_clear_presets_selection(ud);
if (gtk_widget_is_sensitive(widget))
- ghb_set_scale (ud, GHB_PIC_KEEP_WIDTH);
+ ghb_set_scale(ud, GHB_PIC_KEEP_WIDTH);
update_preview = TRUE;
- gchar *text;
- gint width = ghb_settings_get_int(ud->settings, "scale_width");
- gint height = ghb_settings_get_int(ud->settings, "scale_height");
- widget = GHB_WIDGET (ud->builder, "scale_dimensions");
- text = g_strdup_printf ("%d x %d", width, height);
- gtk_label_set_text (GTK_LABEL(widget), text);
- g_free(text);
ghb_live_reset(ud);
+
+ update_scale_info(ud);
}
G_MODULE_EXPORT void
@@ -2038,57 +2134,26 @@ scale_height_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
ghb_check_dependency(ud, widget, NULL);
ghb_clear_presets_selection(ud);
if (gtk_widget_is_sensitive(widget))
- ghb_set_scale (ud, GHB_PIC_KEEP_HEIGHT);
+ ghb_set_scale(ud, GHB_PIC_KEEP_HEIGHT);
update_preview = TRUE;
- gchar *text;
- gint width = ghb_settings_get_int(ud->settings, "scale_width");
- gint height = ghb_settings_get_int(ud->settings, "scale_height");
- widget = GHB_WIDGET (ud->builder, "scale_dimensions");
- text = g_strdup_printf ("%d x %d", width, height);
- gtk_label_set_text (GTK_LABEL(widget), text);
- g_free(text);
ghb_live_reset(ud);
+
+ update_scale_info(ud);
}
G_MODULE_EXPORT void
crop_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
{
- gint titleindex, crop[4];
-
g_debug("crop_changed_cb ()");
ghb_widget_to_setting(ud->settings, widget);
ghb_check_dependency(ud, widget, NULL);
ghb_clear_presets_selection(ud);
if (gtk_widget_is_sensitive(widget))
- ghb_set_scale (ud, 0);
-
- crop[0] = ghb_settings_get_int(ud->settings, "PictureTopCrop");
- crop[1] = ghb_settings_get_int(ud->settings, "PictureBottomCrop");
- crop[2] = ghb_settings_get_int(ud->settings, "PictureLeftCrop");
- crop[3] = ghb_settings_get_int(ud->settings, "PictureRightCrop");
- titleindex = ghb_settings_combo_int(ud->settings, "title");
- hb_title_t * title = ghb_get_title_info(titleindex);
- if (title != NULL)
- {
- gint width, height;
- gchar *text;
-
- width = title->width - crop[2] - crop[3];
- height = title->height - crop[0] - crop[1];
- widget = GHB_WIDGET (ud->builder, "crop_dimensions");
- text = g_strdup_printf ("%d x %d", width, height);
- gtk_label_set_text (GTK_LABEL(widget), text);
- widget = GHB_WIDGET (ud->builder, "crop_dimensions2");
- gtk_label_set_text (GTK_LABEL(widget), text);
- g_free(text);
- }
- gchar *text;
- widget = GHB_WIDGET (ud->builder, "crop_values");
- text = g_strdup_printf ("%d:%d:%d:%d", crop[0], crop[1], crop[2], crop[3]);
- gtk_label_set_text (GTK_LABEL(widget), text);
- g_free(text);
+ ghb_set_scale(ud, 0);
update_preview = TRUE;
ghb_live_reset(ud);
+
+ update_crop_info(ud);
}
G_MODULE_EXPORT void
@@ -2100,7 +2165,7 @@ display_width_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
ghb_clear_presets_selection(ud);
ghb_live_reset(ud);
if (gtk_widget_is_sensitive(widget))
- ghb_set_scale (ud, GHB_PIC_KEEP_DISPLAY_WIDTH);
+ ghb_set_scale(ud, GHB_PIC_KEEP_DISPLAY_WIDTH);
update_preview = TRUE;
}
@@ -2114,7 +2179,7 @@ display_height_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
ghb_clear_presets_selection(ud);
ghb_live_reset(ud);
if (gtk_widget_is_sensitive(widget))
- ghb_set_scale (ud, GHB_PIC_KEEP_DISPLAY_HEIGHT);
+ ghb_set_scale(ud, GHB_PIC_KEEP_DISPLAY_HEIGHT);
update_preview = TRUE;
}
@@ -2128,7 +2193,7 @@ par_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
ghb_clear_presets_selection(ud);
ghb_live_reset(ud);
if (gtk_widget_is_sensitive(widget))
- ghb_set_scale (ud, GHB_PIC_KEEP_PAR);
+ ghb_set_scale(ud, GHB_PIC_KEEP_PAR);
update_preview = TRUE;
}
@@ -2142,48 +2207,22 @@ scale_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
ghb_clear_presets_selection(ud);
ghb_live_reset(ud);
if (gtk_widget_is_sensitive(widget))
- ghb_set_scale (ud, 0);
+ ghb_set_scale(ud, 0);
update_preview = TRUE;
-
- gchar *text;
-
- text = ghb_settings_get_boolean(ud->settings, "PictureAutoCrop") ? _("On") : _("Off");
- widget = GHB_WIDGET (ud->builder, "crop_auto");
- gtk_label_set_text (GTK_LABEL(widget), text);
- text = ghb_settings_get_boolean(ud->settings, "autoscale") ? _("On") : _("Off");
- widget = GHB_WIDGET (ud->builder, "scale_auto");
- gtk_label_set_text (GTK_LABEL(widget), text);
- switch (ghb_settings_combo_int(ud->settings, "PicturePAR"))
- {
- case 0:
- text = _("Off");
- break;
- case 1:
- text = _("Strict");
- break;
- case 2:
- text = _("Loose");
- break;
- case 3:
- text = _("Custom");
- break;
- default:
- text = _("Unknown");
- break;
- }
- widget = GHB_WIDGET (ud->builder, "scale_anamorphic");
- gtk_label_set_text (GTK_LABEL(widget), text);
+
+ update_aspect_info(ud);
}
G_MODULE_EXPORT void
show_crop_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
{
g_debug("show_crop_changed_cb ()");
- ghb_widget_to_setting(ud->settings, widget);
+ ghb_widget_to_setting(ud->prefs, widget);
ghb_check_dependency(ud, widget, NULL);
ghb_live_reset(ud);
if (gtk_widget_is_sensitive(widget))
- ghb_set_scale (ud, 0);
+ ghb_set_scale(ud, 0);
+ ghb_pref_save (ud->prefs, "preview_show_crop");
update_preview = TRUE;
}
@@ -2239,7 +2278,7 @@ quit_cb(countdown_t *cd)
gtk_main_quit();
return FALSE;
}
- str = g_strdup_printf(_("%s\n\n%s in %d seconds ..."),
+ str = g_strdup_printf(_("%s\n\n%s in %d seconds ..."),
cd->msg, cd->action, cd->timeout);
gtk_message_dialog_set_markup(cd->dlg, str);
g_free(str);
@@ -2261,7 +2300,7 @@ shutdown_cb(countdown_t *cd)
gtk_main_quit();
return FALSE;
}
- str = g_strdup_printf(_("%s\n\n%s in %d seconds ..."),
+ str = g_strdup_printf(_("%s\n\n%s in %d seconds ..."),
cd->msg, cd->action, cd->timeout);
gtk_message_dialog_set_markup(cd->dlg, str);
g_free(str);
@@ -2280,7 +2319,7 @@ suspend_cb(countdown_t *cd)
ghb_suspend_gpm();
return FALSE;
}
- str = g_strdup_printf(_("%s\n\n%s in %d seconds ..."),
+ str = g_strdup_printf(_("%s\n\n%s in %d seconds ..."),
cd->msg, cd->action, cd->timeout);
gtk_message_dialog_set_markup(cd->dlg, str);
g_free(str);
@@ -2289,10 +2328,10 @@ suspend_cb(countdown_t *cd)
void
ghb_countdown_dialog(
- GtkMessageType type,
- const gchar *message,
- const gchar *action,
- const gchar *cancel,
+ GtkMessageType type,
+ const gchar *message,
+ const gchar *action,
+ const gchar *cancel,
GSourceFunc action_func,
signal_user_data_t *ud,
gint timeout)
@@ -2301,7 +2340,7 @@ ghb_countdown_dialog(
GtkResponseType response;
guint timeout_id;
countdown_t cd;
-
+
cd.msg = message;
cd.action = action;
cd.timeout = timeout;
@@ -2310,9 +2349,9 @@ ghb_countdown_dialog(
// Toss up a warning dialog
dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL,
type, GTK_BUTTONS_NONE,
- _("%s\n\n%s in %d seconds ..."),
+ _("%s\n\n%s in %d seconds ..."),
message, action, timeout);
- gtk_dialog_add_buttons( GTK_DIALOG(dialog),
+ gtk_dialog_add_buttons( GTK_DIALOG(dialog),
cancel, GTK_RESPONSE_CANCEL,
NULL);
@@ -2337,12 +2376,12 @@ ghb_message_dialog(GtkMessageType type, const gchar *message, const gchar *no, c
{
GtkWidget *dialog;
GtkResponseType response;
-
+
// Toss up a warning dialog
dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL,
type, GTK_BUTTONS_NONE,
"%s", message);
- gtk_dialog_add_buttons( GTK_DIALOG(dialog),
+ gtk_dialog_add_buttons( GTK_DIALOG(dialog),
no, GTK_RESPONSE_NO,
yes, GTK_RESPONSE_YES, NULL);
response = gtk_dialog_run(GTK_DIALOG(dialog));
@@ -2363,7 +2402,7 @@ ghb_error_dialog(GtkMessageType type, const gchar *message, const gchar *cancel)
dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL,
type, GTK_BUTTONS_NONE,
"%s", message);
- gtk_dialog_add_buttons( GTK_DIALOG(dialog),
+ gtk_dialog_add_buttons( GTK_DIALOG(dialog),
cancel, GTK_RESPONSE_CANCEL, NULL);
gtk_dialog_run(GTK_DIALOG(dialog));
gtk_widget_destroy (dialog);
@@ -2374,14 +2413,14 @@ ghb_cancel_encode(signal_user_data_t *ud, const gchar *extra_msg)
{
GtkWidget *dialog;
GtkResponseType response;
-
+
if (extra_msg == NULL) extra_msg = "";
// Toss up a warning dialog
dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL,
GTK_MESSAGE_WARNING, GTK_BUTTONS_NONE,
_("%sYour movie will be lost if you don't continue encoding."),
extra_msg);
- gtk_dialog_add_buttons( GTK_DIALOG(dialog),
+ gtk_dialog_add_buttons( GTK_DIALOG(dialog),
_("Cancel Current and Stop"), 1,
_("Cancel Current, Start Next"), 2,
_("Finish Current, then Stop"), 3,
@@ -2414,14 +2453,14 @@ ghb_cancel_encode2(signal_user_data_t *ud, const gchar *extra_msg)
{
GtkWidget *dialog;
GtkResponseType response;
-
+
if (extra_msg == NULL) extra_msg = "";
// Toss up a warning dialog
dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL,
GTK_MESSAGE_WARNING, GTK_BUTTONS_NONE,
_("%sYour movie will be lost if you don't continue encoding."),
extra_msg);
- gtk_dialog_add_buttons( GTK_DIALOG(dialog),
+ gtk_dialog_add_buttons( GTK_DIALOG(dialog),
_("Cancel Current and Stop"), 1,
_("Continue Encoding"), 4,
NULL);
@@ -2472,7 +2511,7 @@ prune_logs(signal_user_data_t *ud)
gint days;
// Only prune logs stored in the default config dir location
- days = ghb_settings_combo_int(ud->settings, "LogLongevity");
+ days = ghb_settings_combo_int(ud->prefs, "LogLongevity");
if (days > 365)
return;
@@ -2481,7 +2520,7 @@ prune_logs(signal_user_data_t *ud)
{
const gchar *file;
gint duration = days * 24 * 60 * 60;
-
+
GDir *gdir = g_dir_open(dest_dir, 0, NULL);
time_t now;
@@ -2520,7 +2559,7 @@ queue_scan(signal_user_data_t *ud, GValue *js)
now = localtime(&_now);
destname = ghb_settings_get_string(js, "destination");
basename = g_path_get_basename(destname);
- if (ghb_settings_get_boolean(ud->settings, "EncodeLogLocation"))
+ if (ghb_settings_get_boolean(ud->prefs, "EncodeLogLocation"))
{
dest_dir = g_path_get_dirname (destname);
}
@@ -2548,9 +2587,9 @@ queue_scan(signal_user_data_t *ud, GValue *js)
{
gchar *ver_str;
- ver_str = g_strdup_printf("Handbrake Version: %s (%d)\n",
+ ver_str = g_strdup_printf("Handbrake Version: %s (%d)\n",
hb_get_version(NULL), hb_get_build(NULL));
- g_io_channel_write_chars (ud->job_activity_log, ver_str,
+ g_io_channel_write_chars (ud->job_activity_log, ver_str,
-1, NULL, NULL);
g_free(ver_str);
}
@@ -2598,7 +2637,7 @@ ghb_update_pending(signal_user_data_t *ud)
g_free(str);
}
-GValue*
+GValue*
ghb_start_next_job(signal_user_data_t *ud, gboolean find_first)
{
static gint current = 0;
@@ -2685,7 +2724,7 @@ find_queue_job(GValue *queue, gint unique_id, GValue **job)
GValue *js;
gint ii, count;
gint job_unique_id;
-
+
*job = NULL;
g_debug("find_queue_job");
if (unique_id == 0) // Invalid Id
@@ -2732,12 +2771,12 @@ working_status_string(signal_user_data_t *ud, ghb_instance_status_t *status)
{
if (status->job_cur == 1 && subtitle_scan)
{
- task_str = g_strdup_printf(_("pass %d (subtitle scan) of %d, "),
+ task_str = g_strdup_printf(_("pass %d (subtitle scan) of %d, "),
status->job_cur, status->job_count);
}
else
{
- task_str = g_strdup_printf(_("pass %d of %d, "),
+ task_str = g_strdup_printf(_("pass %d of %d, "),
status->job_cur, status->job_count);
}
}
@@ -2754,7 +2793,7 @@ working_status_string(signal_user_data_t *ud, ghb_instance_status_t *status)
" (%.2f fps, avg %.2f fps, ETA %02dh%02dm%02ds)"),
job_str, task_str,
100.0 * status->progress,
- status->rate_cur, status->rate_avg, status->hours,
+ status->rate_cur, status->rate_avg, status->hours,
status->minutes, status->seconds );
}
else
@@ -2834,7 +2873,7 @@ ghb_backend_events(signal_user_data_t *ud)
GtkTreeIter iter;
static gint prev_scan_state = 0;
static gint prev_queue_state = 0;
-
+
ghb_track_status();
ghb_get_status(&status);
if (prev_scan_state != status.scan.state ||
@@ -2846,11 +2885,11 @@ ghb_backend_events(signal_user_data_t *ud)
}
progress = GTK_PROGRESS_BAR(GHB_WIDGET (ud->builder, "progressbar"));
work_status = GTK_LABEL(GHB_WIDGET (ud->builder, "work_status"));
- if (status.scan.state == GHB_STATE_IDLE &&
+ if (status.scan.state == GHB_STATE_IDLE &&
status.queue.state == GHB_STATE_IDLE)
{
static gboolean prev_dvdnav;
- gboolean dvdnav = ghb_settings_get_boolean(ud->settings, "use_dvdnav");
+ gboolean dvdnav = ghb_settings_get_boolean(ud->prefs, "use_dvdnav");
if (dvdnav != prev_dvdnav)
{
hb_dvd_set_dvdnav(dvdnav);
@@ -2865,7 +2904,7 @@ ghb_backend_events(signal_user_data_t *ud)
GtkLabel *label;
scan_prog = GTK_PROGRESS_BAR(GHB_WIDGET (ud->builder, "scan_prog"));
- label = GTK_LABEL(GHB_WIDGET (ud->builder, "source_title"));
+ label = GTK_LABEL(GHB_WIDGET (ud->builder, "volume_label"));
if (status.scan.title_cur == 0)
{
@@ -2908,37 +2947,41 @@ ghb_backend_events(signal_user_data_t *ud)
widget = GHB_WIDGET(ud->builder, "source_title_open");
gtk_widget_set_sensitive(widget, TRUE);
- source = ghb_settings_get_string(ud->settings, "scan_source");
- update_source_label(ud, source, FALSE);
+ source = ghb_settings_get_string(ud->globals, "scan_source");
+ update_source_label(ud, source);
scan_prog = GTK_PROGRESS_BAR(GHB_WIDGET (ud->builder, "scan_prog"));
gtk_progress_bar_set_fraction (scan_prog, 1.0);
gtk_widget_hide(GTK_WIDGET(scan_prog));
- if (!ghb_settings_get_boolean(ud->settings, "preset_modified"))
- {
- ghb_refresh_preset(ud);
- }
-
ghb_update_ui_combo_box(ud, "title", 0, FALSE);
+
titleindex = ghb_longest_title();
- ghb_ui_update(ud, "title", ghb_int64_value(titleindex));
+ load_all_titles(ud, titleindex);
- label = GTK_LABEL(GHB_WIDGET (ud->builder, "source_title"));
+ label = GTK_LABEL(GHB_WIDGET (ud->builder, "volume_label"));
// Are there really any titles.
hb_title_t * title = ghb_get_title_info(titleindex);
if (title == NULL)
{
- gtk_label_set_text(label, _("None"));
+ gtk_label_set_text(label, _("No Title Found"));
}
ghb_clear_scan_state(GHB_STATE_SCANDONE);
- if (ghb_queue_edit_settings)
+
+ ghb_ui_update(ud, "title", ghb_int64_value(titleindex));
+
+ if (ghb_queue_edit_settings != NULL)
{
- ghb_settings_to_ui(ud, ghb_queue_edit_settings);
- ghb_set_audio(ud, ghb_queue_edit_settings);
- ghb_reset_subtitles(ud, ghb_queue_edit_settings);
- reset_chapter_list(ud, ghb_queue_edit_settings);
- ghb_value_free(ghb_queue_edit_settings);
+ // Switch to the correct title in the list
+ ghb_ui_update(ud, "title",
+ ghb_settings_get_value(ghb_queue_edit_settings, "title"));
+
+ // The above should cause the current title index to update
+ int titleindex = ghb_settings_get_int(ud->settings, "title_no");
+ ghb_array_replace(ud->settings_array, titleindex,
+ ghb_queue_edit_settings);
+ ud->settings = ghb_queue_edit_settings;
+ ghb_load_settings(ud);
ghb_queue_edit_settings = NULL;
}
}
@@ -2989,7 +3032,7 @@ ghb_backend_events(signal_user_data_t *ud)
status_str = searching_status_string(ud, &status.queue);
label = GTK_LABEL(GHB_WIDGET(ud->builder, "queue_status"));
gtk_label_set_text (label, status_str);
- if (ghb_settings_get_boolean(ud->settings, "show_status"))
+ if (ghb_settings_get_boolean(ud->prefs, "show_status"))
{
#if !GTK_CHECK_VERSION(2, 16, 0)
GtkStatusIcon *si;
@@ -3037,7 +3080,7 @@ ghb_backend_events(signal_user_data_t *ud)
status_str = working_status_string(ud, &status.queue);
label = GTK_LABEL(GHB_WIDGET(ud->builder, "queue_status"));
gtk_label_set_text (label, status_str);
- if (ghb_settings_get_boolean(ud->settings, "show_status"))
+ if (ghb_settings_get_boolean(ud->prefs, "show_status"))
{
#if defined(_USE_APP_IND)
char * ai_status_str= g_strdup_printf(
@@ -3065,7 +3108,7 @@ ghb_backend_events(signal_user_data_t *ud)
index = find_queue_job(ud->queue, status.queue.unique_id, &js);
treeview = GTK_TREE_VIEW(GHB_WIDGET(ud->builder, "queue_list"));
store = GTK_TREE_STORE(gtk_tree_view_get_model(treeview));
- if (ud->cancel_encode == GHB_CANCEL_ALL ||
+ if (ud->cancel_encode == GHB_CANCEL_ALL ||
ud->cancel_encode == GHB_CANCEL_CURRENT)
status.queue.error = GHB_ERROR_CANCELED;
switch( status.queue.error )
@@ -3217,11 +3260,11 @@ ghb_timer_cb(gpointer data)
gchar *dest, *dest_dir, *def_dest;
dest = ghb_settings_get_string(ud->settings, "destination");
dest_dir = g_path_get_dirname (dest);
- def_dest = ghb_settings_get_string(ud->settings, "destination_dir");
+ def_dest = ghb_settings_get_string(ud->prefs, "destination_dir");
if (strcmp(dest_dir, def_dest) != 0)
{
- ghb_settings_set_string (ud->settings, "destination_dir", dest_dir);
- ghb_pref_save (ud->settings, "destination_dir");
+ ghb_settings_set_string (ud->prefs, "destination_dir", dest_dir);
+ ghb_pref_save (ud->prefs, "destination_dir");
}
g_free(dest);
g_free(dest_dir);
@@ -3239,7 +3282,7 @@ ghb_timer_cb(gpointer data)
if (!appcast_busy)
{
gchar *updates;
- updates = ghb_settings_get_string(ud->settings, "check_updates");
+ updates = ghb_settings_get_string(ud->prefs, "check_updates");
gint64 duration = 0;
if (strcmp(updates, "daily") == 0)
duration = 60 * 60 * 24;
@@ -3254,13 +3297,13 @@ ghb_timer_cb(gpointer data)
gint64 last;
time_t tt;
- last = ghb_settings_get_int64(ud->settings, "last_update_check");
+ last = ghb_settings_get_int64(ud->prefs, "last_update_check");
time(&tt);
if (last + duration < tt)
{
- ghb_settings_set_int64(ud->settings,
+ ghb_settings_set_int64(ud->prefs,
"last_update_check", tt);
- ghb_pref_save(ud->settings, "last_update_check");
+ ghb_pref_save(ud->prefs, "last_update_check");
GHB_THREAD_NEW("Update Check", (GThreadFunc)ghb_check_update, ud);
}
}
@@ -3280,7 +3323,7 @@ ghb_log_cb(GIOChannel *source, GIOCondition cond, gpointer data)
GtkTextMark *mark;
GError *gerror = NULL;
GIOStatus status;
-
+
signal_user_data_t *ud = (signal_user_data_t*)data;
status = g_io_channel_read_line (source, &text, &length, NULL, &gerror);
@@ -3299,15 +3342,15 @@ ghb_log_cb(GIOChannel *source, GIOCondition cond, gpointer data)
textview = GTK_TEXT_VIEW(GHB_WIDGET (ud->builder, "activity_view"));
buffer = gtk_text_view_get_buffer (textview);
// I would like to auto-scroll the window when the scrollbar
- // is at the bottom,
+ // is at the bottom,
// must determine whether the insert point is at
- // the bottom of the window
+ // the bottom of the window
window = gtk_text_view_get_window(textview, GTK_TEXT_WINDOW_TEXT);
if (window != NULL)
{
width = gdk_window_get_width(window);
height = gdk_window_get_height(window);
- gtk_text_view_window_to_buffer_coords(textview,
+ gtk_text_view_window_to_buffer_coords(textview,
GTK_TEXT_WINDOW_TEXT, width, height, &x, &y);
gtk_text_view_get_iter_at_location(textview, &iter, x, y);
if (gtk_text_iter_is_end(&iter))
@@ -3337,19 +3380,19 @@ ghb_log_cb(GIOChannel *source, GIOCondition cond, gpointer data)
gsize one = 1;
utf8_text[length-1] = '\r';
#endif
- g_io_channel_write_chars (ud->activity_log, utf8_text,
+ g_io_channel_write_chars (ud->activity_log, utf8_text,
length, &outlength, NULL);
#if defined(_WIN32)
- g_io_channel_write_chars (ud->activity_log, "\n",
+ g_io_channel_write_chars (ud->activity_log, "\n",
one, &one, NULL);
#endif
g_io_channel_flush(ud->activity_log, NULL);
if (ud->job_activity_log)
{
- g_io_channel_write_chars (ud->job_activity_log, utf8_text,
+ g_io_channel_write_chars (ud->job_activity_log, utf8_text,
length, &outlength, NULL);
#if defined(_WIN32)
- g_io_channel_write_chars (ud->activity_log, "\n",
+ g_io_channel_write_chars (ud->activity_log, "\n",
one, &outlength, NULL);
#endif
g_io_channel_flush(ud->job_activity_log, NULL);
@@ -3381,7 +3424,7 @@ G_MODULE_EXPORT void
show_activity_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
{
GtkWidget *widget = GHB_WIDGET (ud->builder, "activity_window");
- set_visible(widget, gtk_toggle_tool_button_get_active(
+ gtk_widget_set_visible(widget, gtk_toggle_tool_button_get_active(
GTK_TOGGLE_TOOL_BUTTON(xwidget)));
}
@@ -3389,7 +3432,7 @@ G_MODULE_EXPORT void
show_activity_menu_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
{
GtkWidget *widget = GHB_WIDGET (ud->builder, "activity_window");
- set_visible(widget, TRUE);
+ gtk_widget_set_visible(widget, TRUE);
widget = GHB_WIDGET (ud->builder, "show_activity");
gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(widget), TRUE);
}
@@ -3397,7 +3440,7 @@ show_activity_menu_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
G_MODULE_EXPORT gboolean
activity_window_delete_cb(GtkWidget *xwidget, GdkEvent *event, signal_user_data_t *ud)
{
- set_visible(xwidget, FALSE);
+ gtk_widget_set_visible(xwidget, FALSE);
GtkWidget *widget = GHB_WIDGET (ud->builder, "show_activity");
gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(widget), FALSE);
return TRUE;
@@ -3413,7 +3456,7 @@ ghb_log(gchar *log, ...)
_now = time(NULL);
now = localtime( &_now );
- snprintf(fmt, 362, "[%02d:%02d:%02d] gtkgui: %s\n",
+ snprintf(fmt, 362, "[%02d:%02d:%02d] gtkgui: %s\n",
now->tm_hour, now->tm_min, now->tm_sec, log);
va_start(args, log);
vfprintf(stderr, fmt, args);
@@ -3427,7 +3470,7 @@ browse_url(const gchar *url)
ShellExecute(NULL, "open", url, NULL, NULL, SW_SHOWNORMAL);
#else
gboolean result;
- char *argv[] =
+ char *argv[] =
{"xdg-open",NULL,NULL,NULL};
argv[1] = (gchar*)url;
result = g_spawn_async(NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL,
@@ -3476,9 +3519,9 @@ about_activate_cb(GtkWidget *xwidget, signal_user_data_t *ud)
#endif
gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(widget), ver);
g_free(ver);
- gtk_about_dialog_set_website(GTK_ABOUT_DIALOG(widget),
+ gtk_about_dialog_set_website(GTK_ABOUT_DIALOG(widget),
HB_PROJECT_URL_WEBSITE);
- gtk_about_dialog_set_website_label(GTK_ABOUT_DIALOG(widget),
+ gtk_about_dialog_set_website_label(GTK_ABOUT_DIALOG(widget),
HB_PROJECT_URL_WEBSITE);
gtk_widget_show (widget);
}
@@ -3499,7 +3542,7 @@ G_MODULE_EXPORT void
show_queue_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
{
GtkWidget *widget = GHB_WIDGET (ud->builder, "queue_window");
- set_visible(widget, gtk_toggle_tool_button_get_active(
+ gtk_widget_set_visible(widget, gtk_toggle_tool_button_get_active(
GTK_TOGGLE_TOOL_BUTTON(xwidget)));
}
@@ -3507,7 +3550,7 @@ G_MODULE_EXPORT void
show_queue_menu_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
{
GtkWidget *widget = GHB_WIDGET (ud->builder, "queue_window");
- set_visible(widget, TRUE);
+ gtk_widget_set_visible(widget, TRUE);
widget = GHB_WIDGET (ud->builder, "show_queue");
gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(widget), TRUE);
}
@@ -3515,132 +3558,123 @@ show_queue_menu_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
G_MODULE_EXPORT gboolean
queue_window_delete_cb(GtkWidget *xwidget, GdkEvent *event, signal_user_data_t *ud)
{
- set_visible(xwidget, FALSE);
+ gtk_widget_set_visible(xwidget, FALSE);
GtkWidget *widget = GHB_WIDGET (ud->builder, "show_queue");
gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(widget), FALSE);
return TRUE;
}
G_MODULE_EXPORT void
-show_presets_toggled_cb(GtkWidget *action, signal_user_data_t *ud)
+show_presets_toggled_cb(GtkWidget *widget, signal_user_data_t *ud)
{
- GtkWidget *widget;
+ GtkWidget *frame;
GtkWindow *hb_window;
-
+
g_debug("show_presets_clicked_cb ()");
- widget = GHB_WIDGET (ud->builder, "presets_frame");
- ghb_widget_to_setting(ud->settings, action);
- if (ghb_settings_get_boolean(ud->settings, "show_presets"))
+ frame = GHB_WIDGET (ud->builder, "presets_frame");
+ ghb_widget_to_setting(ud->prefs, widget);
+ if (ghb_settings_get_boolean(ud->prefs, "show_presets"))
{
- gtk_widget_show_now(widget);
+ gtk_widget_show_now(frame);
}
else
{
- gtk_widget_hide(widget);
+ gtk_widget_hide(frame);
hb_window = GTK_WINDOW(GHB_WIDGET (ud->builder, "hb_window"));
gtk_window_resize(hb_window, 16, 16);
}
- ghb_pref_save(ud->settings, "show_presets");
+ ghb_pref_save(ud->prefs, "show_presets");
}
static void
-reset_chapter_list(signal_user_data_t *ud, GValue *settings)
+chapter_refresh_list_row_ui(
+ GtkTreeModel *tm,
+ GtkTreeIter *ti,
+ GValue *chapter_list,
+ int titleindex,
+ int index)
+{
+ gchar *chapter, *s_duration, *s_start;
+ gint hh, mm, ss;
+ gint64 duration, start;
+
+ // Update row with settings data
+ g_debug("Updating chapter row ui");
+ chapter = ghb_value_string(ghb_array_get_nth(chapter_list, index));
+ duration = ghb_get_chapter_duration(titleindex, index) / 90000;
+ break_duration(duration, &hh, &mm, &ss);
+ s_duration = g_strdup_printf("%02d:%02d:%02d", hh, mm, ss);
+ start = ghb_get_chapter_start(titleindex, index) / 90000;
+ break_duration(start, &hh, &mm, &ss);
+ s_start = g_strdup_printf("%02d:%02d:%02d", hh, mm, ss);
+ gtk_list_store_set(GTK_LIST_STORE(tm), ti,
+ 0, index+1,
+ 1, s_start,
+ 2, s_duration,
+ 3, chapter,
+ 4, TRUE,
+ -1);
+ g_free(chapter);
+ g_free(s_duration);
+ g_free(s_start);
+}
+
+static void
+ghb_clear_chapter_list_ui(GtkBuilder *builder)
{
- GtkTreeView *treeview;
- GtkTreeIter iter;
- GtkListStore *store;
- gboolean done;
- GValue *chapters;
- gint titleindex, ii;
- gint count;
- gint64 ch_start = 0;
-
- g_debug("reset_chapter_list ()");
- chapters = ghb_value_dup(ghb_settings_get_value(settings, "chapter_list"));
- count = ghb_array_len(chapters);
- ghb_settings_set_value(ud->settings, "chapter_list", chapters);
+ GtkTreeView *tv;
+ GtkListStore *ts;
+
+ tv = GTK_TREE_VIEW(GHB_WIDGET(builder, "chapters_list"));
+ ts = GTK_LIST_STORE(gtk_tree_view_get_model(tv));
+ gtk_list_store_clear(ts);
+}
+
+static void
+chapter_refresh_list_ui(signal_user_data_t *ud)
+{
+ GValue *chapter_list;
+ gint ii, count, tm_count;
+ GtkTreeView *tv;
+ GtkTreeModel *tm;
+ GtkTreeIter ti;
+ int titleindex;
+
+ tv = GTK_TREE_VIEW(GHB_WIDGET(ud->builder, "chapters_list"));
+ tm = gtk_tree_view_get_model(tv);
+
+ tm_count = gtk_tree_model_iter_n_children(tm, NULL);
+
titleindex = ghb_settings_combo_int(ud->settings, "title");
-
- treeview = GTK_TREE_VIEW(GHB_WIDGET(ud->builder, "chapters_list"));
- store = GTK_LIST_STORE(gtk_tree_view_get_model(treeview));
- ii = 0;
- if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(store), &iter))
+ chapter_list = ghb_settings_get_value(ud->settings, "chapter_list");
+ count = ghb_array_len(chapter_list);
+ if (count != tm_count)
{
- do
+ ghb_clear_chapter_list_ui(ud->builder);
+ for (ii = 0; ii < count; ii++)
{
-
- if (ii < count)
- {
- gchar *chapter, *duration, *start;
- gint hh, mm, ss;
- gint64 dur;
-
- // Update row with settings data
- g_debug("Updating row");
- chapter = ghb_value_string(ghb_array_get_nth(chapters, ii));
- ghb_get_chapter_duration(titleindex, ii, &dur);
- dur /= 90000;
- break_duration(dur, &hh, &mm, &ss);
- duration = g_strdup_printf("%02d:%02d:%02d", hh, mm, ss);
- break_duration(ch_start, &hh, &mm, &ss);
- start = g_strdup_printf("%02d:%02d:%02d", hh, mm, ss);
- ch_start += dur;
- gtk_list_store_set(store, &iter,
- 0, ii+1,
- 1, start,
- 2, duration,
- 3, chapter,
- 4, TRUE,
- -1);
- g_free(chapter);
- g_free(duration);
- ii++;
- done = !gtk_tree_model_iter_next(GTK_TREE_MODEL(store), &iter);
- }
- else
- {
- // No more settings data, remove row
- g_debug("Removing row");
- done = !gtk_list_store_remove(store, &iter);
- }
- } while (!done);
- }
- while (ii < count)
- {
- gchar *chapter, *duration, *start;
- gint hh, mm, ss;
- gint64 dur;
-
- // Additional settings, add row
- g_debug("Adding row");
- chapter = ghb_value_string(ghb_array_get_nth(chapters, ii));
- ghb_get_chapter_duration(titleindex, ii, &dur);
- dur /= 90000;
- break_duration(dur, &hh, &mm, &ss);
- duration = g_strdup_printf("%02d:%02d:%02d", hh, mm, ss);
- break_duration(ch_start, &hh, &mm, &ss);
- start = g_strdup_printf("%02d:%02d:%02d", hh, mm, ss);
- ch_start += dur;
- gtk_list_store_append(store, &iter);
- gtk_list_store_set(store, &iter,
- 0, ii+1,
- 1, start,
- 2, duration,
- 3, chapter,
- 4, TRUE,
- -1);
- g_free(chapter);
- g_free(duration);
- ii++;
+ gtk_list_store_append(GTK_LIST_STORE(tm), &ti);
+ }
+ }
+ for (ii = 0; ii < count; ii++)
+ {
+ gtk_tree_model_iter_nth_child(tm, &ti, NULL, ii);
+ chapter_refresh_list_row_ui(tm, &ti, chapter_list, titleindex, ii);
}
}
+void
+ghb_chapter_list_refresh_all(signal_user_data_t *ud)
+{
+ chapter_refresh_list_ui(ud);
+}
+
static void
update_chapter_list_settings(GValue *settings)
{
GValue *chapters;
gint titleindex;
-
+
g_debug("update_chapter_list_settings ()");
titleindex = ghb_settings_get_int(settings, "title_no");
chapters = ghb_get_chapters(titleindex);
@@ -3648,97 +3682,6 @@ update_chapter_list_settings(GValue *settings)
ghb_settings_set_value(settings, "chapter_list", chapters);
}
-static void
-update_chapter_list_from_settings(GtkBuilder *builder, GValue *settings)
-{
- GtkTreeView *treeview;
- GtkTreeIter iter;
- GtkListStore *store;
- gboolean done;
- GValue *chapters;
- gint titleindex, ii;
- gint count;
- gint64 ch_start = 0;
-
- g_debug("update_chapter_list ()");
- titleindex = ghb_settings_get_int(settings, "title_no");
- chapters = ghb_settings_get_value(settings, "chapter_list");
- count = ghb_array_len(chapters);
-
- treeview = GTK_TREE_VIEW(GHB_WIDGET(builder, "chapters_list"));
- store = GTK_LIST_STORE(gtk_tree_view_get_model(treeview));
- ii = 0;
- if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(store), &iter))
- {
- do
- {
-
- if (ii < count)
- {
- gchar *chapter, *duration, *start;
- gint hh, mm, ss;
- gint64 dur;
-
- // Update row with settings data
- g_debug("Updating row");
- chapter = ghb_value_string(ghb_array_get_nth(chapters, ii));
- ghb_get_chapter_duration(titleindex, ii, &dur);
- dur /= 90000;
- break_duration(dur, &hh, &mm, &ss);
- duration = g_strdup_printf("%02d:%02d:%02d", hh, mm, ss);
- break_duration(ch_start, &hh, &mm, &ss);
- start = g_strdup_printf("%02d:%02d:%02d", hh, mm, ss);
- ch_start += dur;
- gtk_list_store_set(store, &iter,
- 0, ii+1,
- 1, start,
- 2, duration,
- 3, chapter,
- 4, TRUE,
- -1);
- g_free(chapter);
- g_free(duration);
- ii++;
- done = !gtk_tree_model_iter_next(GTK_TREE_MODEL(store), &iter);
- }
- else
- {
- // No more settings data, remove row
- g_debug("Removing row");
- done = !gtk_list_store_remove(store, &iter);
- }
- } while (!done);
- }
- while (ii < count)
- {
- gchar *chapter, *duration, *start;
- gint hh, mm, ss;
- gint64 dur;
-
- // Additional settings, add row
- g_debug("Adding row");
- chapter = ghb_value_string(ghb_array_get_nth(chapters, ii));
- ghb_get_chapter_duration(titleindex, ii, &dur);
- dur /= 90000;
- break_duration(dur, &hh, &mm, &ss);
- duration = g_strdup_printf("%02d:%02d:%02d", hh, mm, ss);
- break_duration(ch_start, &hh, &mm, &ss);
- start = g_strdup_printf("%02d:%02d:%02d", hh, mm, ss);
- ch_start += dur;
- gtk_list_store_append(store, &iter);
- gtk_list_store_set(store, &iter,
- 0, ii+1,
- 1, start,
- 2, duration,
- 3, chapter,
- 4, TRUE,
- -1);
- g_free(chapter);
- g_free(duration);
- ii++;
- }
-}
-
static gint chapter_edit_key = 0;
G_MODULE_EXPORT gboolean
@@ -3753,9 +3696,9 @@ chapter_keypress_cb(
G_MODULE_EXPORT void
chapter_edited_cb(
- GhbCellRendererText *cell,
- gchar *path,
- gchar *text,
+ GhbCellRendererText *cell,
+ gchar *path,
+ gchar *text,
signal_user_data_t *ud)
{
GtkTreePath *treepath;
@@ -3765,7 +3708,7 @@ chapter_edited_cb(
gint index;
gint *pi;
gint row;
-
+
g_debug("chapter_edited_cb ()");
g_debug("path (%s)", path);
g_debug("text (%s)", text);
@@ -3775,7 +3718,7 @@ chapter_edited_cb(
pi = gtk_tree_path_get_indices(treepath);
row = pi[0];
gtk_tree_model_get_iter(GTK_TREE_MODEL(store), &iter, treepath);
- gtk_list_store_set(store, &iter,
+ gtk_list_store_set(store, &iter,
3, text,
4, TRUE,
-1);
@@ -3806,7 +3749,7 @@ chapter_edited_cb(
//
// Now, you might be asking why I don't catch the keypress
// event and determine what action to take based on that.
- // The Gtk developers in their infinite wisdom have made the
+ // The Gtk developers in their infinite wisdom have made the
// actual GtkEdit widget being used a private member of
// GtkCellRendererText, so it can not be accessed to hang a
// signal handler off of. And they also do not propagate the
@@ -3834,7 +3777,7 @@ void
debug_log_handler(const gchar *domain, GLogLevelFlags flags, const gchar *msg, gpointer data)
{
signal_user_data_t *ud = (signal_user_data_t*)data;
-
+
if (ud->debug)
{
printf("%s: %s\n", domain, msg);
@@ -3853,24 +3796,24 @@ ghb_hbfd(signal_user_data_t *ud, gboolean hbfd)
GtkWidget *widget;
g_debug("ghb_hbfd");
widget = GHB_WIDGET(ud->builder, "queue_pause1");
- set_visible(widget, !hbfd);
+ gtk_widget_set_visible(widget, !hbfd);
widget = GHB_WIDGET(ud->builder, "queue_add");
- set_visible(widget, !hbfd);
+ gtk_widget_set_visible(widget, !hbfd);
widget = GHB_WIDGET(ud->builder, "show_queue");
- set_visible(widget, !hbfd);
+ gtk_widget_set_visible(widget, !hbfd);
widget = GHB_WIDGET(ud->builder, "show_activity");
- set_visible(widget, !hbfd);
+ gtk_widget_set_visible(widget, !hbfd);
widget = GHB_WIDGET(ud->builder, "chapter_box");
- set_visible(widget, !hbfd);
+ gtk_widget_set_visible(widget, !hbfd);
widget = GHB_WIDGET(ud->builder, "container_box");
- set_visible(widget, !hbfd);
+ gtk_widget_set_visible(widget, !hbfd);
widget = GHB_WIDGET(ud->builder, "SettingsNotebook");
- set_visible(widget, !hbfd);
+ gtk_widget_set_visible(widget, !hbfd);
widget = GHB_WIDGET(ud->builder, "presets_save");
- set_visible(widget, !hbfd);
+ gtk_widget_set_visible(widget, !hbfd);
widget = GHB_WIDGET(ud->builder, "presets_remove");
- set_visible(widget, !hbfd);
+ gtk_widget_set_visible(widget, !hbfd);
widget = GHB_WIDGET (ud->builder, "hb_window");
gtk_window_resize(GTK_WINDOW(widget), 16, 16);
@@ -3880,51 +3823,46 @@ G_MODULE_EXPORT void
hbfd_toggled_cb(GtkWidget *widget, signal_user_data_t *ud)
{
g_debug("hbfd_toggled_cb");
- ghb_widget_to_setting (ud->settings, widget);
- gboolean hbfd = ghb_settings_get_boolean(ud->settings, "hbfd");
+ ghb_widget_to_setting(ud->prefs, widget);
+ gboolean hbfd = ghb_settings_get_boolean(ud->prefs, "hbfd");
ghb_hbfd(ud, hbfd);
- ghb_pref_save(ud->settings, "hbfd");
-}
-
-G_MODULE_EXPORT void
-advanced_audio_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
-{
- g_debug("advanced_audio_changed_cb");
- ghb_widget_to_setting (ud->settings, widget);
- ghb_check_dependency(ud, widget, NULL);
- const gchar *name = ghb_get_setting_key(widget);
- ghb_pref_save(ud->settings, name);
+ ghb_pref_save(ud->prefs, "hbfd");
}
G_MODULE_EXPORT void
advanced_video_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
{
g_debug("advanced_video_changed_cb");
- ghb_widget_to_setting (ud->settings, widget);
- ghb_check_dependency(ud, widget, NULL);
+ ghb_widget_to_setting(ud->prefs, widget);
const gchar *name = ghb_get_setting_key(widget);
- ghb_pref_save(ud->settings, name);
- ghb_show_hide_advanced_video( ud );
+ ghb_pref_save(ud->prefs, name);
+ ghb_show_hide_advanced_video(ud);
}
G_MODULE_EXPORT void
pref_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
{
g_debug("pref_changed_cb");
- ghb_widget_to_setting (ud->settings, widget);
+ ghb_widget_to_setting (ud->prefs, widget);
+// FIXME?
ghb_check_dependency(ud, widget, NULL);
const gchar *name = ghb_get_setting_key(widget);
- ghb_pref_save(ud->settings, name);
+ ghb_pref_save(ud->prefs, name);
+
+ gint preview_count;
+ preview_count = ghb_settings_get_int(ud->prefs, "preview_count");
+ widget = GHB_WIDGET(ud->builder, "preview_frame");
+ gtk_range_set_range(GTK_RANGE(widget), 1, preview_count);
}
G_MODULE_EXPORT void
use_m4v_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
{
g_debug("use_m4v_changed_cb");
- ghb_widget_to_setting (ud->settings, widget);
+ ghb_widget_to_setting (ud->prefs, widget);
ghb_check_dependency(ud, widget, NULL);
const gchar *name = ghb_get_setting_key(widget);
- ghb_pref_save(ud->settings, name);
+ ghb_pref_save(ud->prefs, name);
ghb_update_destination_extension(ud);
}
@@ -3932,15 +3870,15 @@ G_MODULE_EXPORT void
show_status_cb(GtkWidget *widget, signal_user_data_t *ud)
{
g_debug("show_status_cb");
- ghb_widget_to_setting (ud->settings, widget);
+ ghb_widget_to_setting (ud->prefs, widget);
ghb_check_dependency(ud, widget, NULL);
const gchar *name = ghb_get_setting_key(widget);
- ghb_pref_save(ud->settings, name);
+ ghb_pref_save(ud->prefs, name);
#if defined(_USE_APP_IND)
if (ud->ai)
{
- if (ghb_settings_get_boolean(ud->settings, "show_status"))
+ if (ghb_settings_get_boolean(ud->prefs, "show_status"))
{
app_indicator_set_status(ud->ai, APP_INDICATOR_STATUS_ACTIVE);
}
@@ -3954,7 +3892,7 @@ show_status_cb(GtkWidget *widget, signal_user_data_t *ud)
si = GTK_STATUS_ICON(GHB_OBJECT (ud->builder, "hb_status"));
gtk_status_icon_set_visible(si,
- ghb_settings_get_boolean(ud->settings, "show_status"));
+ ghb_settings_get_boolean(ud->prefs, "show_status"));
#endif
}
@@ -3962,11 +3900,11 @@ G_MODULE_EXPORT void
vqual_granularity_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
{
g_debug("vqual_granularity_changed_cb");
- ghb_widget_to_setting (ud->settings, widget);
+ ghb_widget_to_setting (ud->prefs, widget);
ghb_check_dependency(ud, widget, NULL);
const gchar *name = ghb_get_setting_key(widget);
- ghb_pref_save(ud->settings, name);
+ ghb_pref_save(ud->prefs, name);
gdouble vqmin, vqmax, step, page;
gboolean inverted;
@@ -3982,25 +3920,25 @@ G_MODULE_EXPORT void
tweaks_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
{
g_debug("tweaks_changed_cb");
- ghb_widget_to_setting (ud->settings, widget);
+ ghb_widget_to_setting (ud->prefs, widget);
const gchar *name = ghb_get_setting_key(widget);
- ghb_pref_save(ud->settings, name);
+ ghb_pref_save(ud->prefs, name);
}
G_MODULE_EXPORT void
hbfd_feature_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
{
g_debug("hbfd_feature_changed_cb");
- ghb_widget_to_setting (ud->settings, widget);
+ ghb_widget_to_setting (ud->prefs, widget);
const gchar *name = ghb_get_setting_key(widget);
- ghb_pref_save(ud->settings, name);
+ ghb_pref_save(ud->prefs, name);
- gboolean hbfd = ghb_settings_get_boolean(ud->settings, "hbfd_feature");
+ gboolean hbfd = ghb_settings_get_boolean(ud->prefs, "hbfd_feature");
if (hbfd)
{
const GValue *val;
- val = ghb_settings_get_value(ud->settings, "hbfd");
- ghb_ui_update(ud, "hbfd", val);
+ val = ghb_settings_get_value(ud->prefs, "hbfd");
+ ghb_ui_settings_update(ud, ud->prefs, "hbfd", val);
}
widget = GHB_WIDGET (ud->builder, "hbfd");
gtk_widget_set_visible(widget, hbfd);
@@ -4042,7 +3980,7 @@ ghb_file_menu_add_dvd(signal_user_data_t *ud)
GtkWidget *widget;
gchar *drive = get_dvd_device_name(link->data);
gchar *name = get_dvd_volume_name(link->data);
-
+
widget = gtk_menu_item_new_with_label(name);
gtk_buildable_set_name(GTK_BUILDABLE(widget), drive);
gtk_widget_set_tooltip_text(widget, _("Scan this DVD source"));
@@ -4053,7 +3991,7 @@ ghb_file_menu_add_dvd(signal_user_data_t *ud)
gtk_widget_set_visible(widget, TRUE);
// Connect signal to action (menu item)
- g_signal_connect(widget, "activate",
+ g_signal_connect(widget, "activate",
(GCallback)dvd_source_activate_cb, ud);
g_free(name);
g_free(drive);
@@ -4090,7 +4028,7 @@ dvd_device_list()
dtype = GetDriveType(drive);
if (dtype == DRIVE_CDROM)
{
- dvd_devices = g_list_append(dvd_devices,
+ dvd_devices = g_list_append(dvd_devices,
(gpointer)g_strdup(drive));
}
}
@@ -4099,14 +4037,14 @@ dvd_device_list()
#else
GVolumeMonitor *gvm;
GList *drives, *link;
-
+
gvm = g_volume_monitor_get ();
drives = g_volume_monitor_get_connected_drives (gvm);
link = drives;
while (link != NULL)
{
GDrive *gd;
-
+
gd = (GDrive*)link->data;
if (ghb_is_cd(gd))
{
@@ -4190,15 +4128,15 @@ handle_media_change(const gchar *device, gboolean insert, signal_user_data_t *ud
{
GHB_THREAD_NEW("Cache Volume Names",
(GThreadFunc)ghb_cache_volnames, ud);
- if (ghb_settings_get_boolean(ud->settings, "AutoScan") &&
+ if (ghb_settings_get_boolean(ud->prefs, "AutoScan") &&
ud->current_dvd_device != NULL &&
strcmp(device, ud->current_dvd_device) == 0)
{
show_scan_progress(ud);
- update_source_label(ud, device, TRUE);
+ update_source_label(ud, device);
gint preview_count;
- preview_count = ghb_settings_get_int(ud->settings, "preview_count");
- ghb_settings_set_string(ud->settings, "scan_source", device);
+ preview_count = ghb_settings_get_int(ud->prefs, "preview_count");
+ ghb_settings_set_string(ud->globals, "scan_source", device);
start_scan(ud, device, 0, preview_count);
}
}
@@ -4216,7 +4154,7 @@ handle_media_change(const gchar *device, gboolean insert, signal_user_data_t *ud
{
ghb_hb_cleanup(TRUE);
prune_logs(ud);
- ghb_settings_set_string(ud->settings, "scan_source", "/dev/null");
+ ghb_settings_set_string(ud->globals, "scan_source", "/dev/null");
start_scan(ud, "/dev/null", 0, 1);
}
}
@@ -4297,13 +4235,13 @@ drive_changed_cb(GVolumeMonitor *gvm, GDrive *gd, signal_user_data_t *ud)
}
if (g_drive_has_media(gd))
{
- if (ghb_settings_get_boolean(ud->settings, "AutoScan"))
+ if (ghb_settings_get_boolean(ud->prefs, "AutoScan"))
{
show_scan_progress(ud);
- update_source_label(ud, device, TRUE);
+ update_source_label(ud, device);
gint preview_count;
- preview_count = ghb_settings_get_int(ud->settings, "preview_count");
- ghb_settings_set_string(ud->settings, "scan_source", device);
+ preview_count = ghb_settings_get_int(ud->prefs, "preview_count");
+ ghb_settings_set_string(ud->globals, "scan_source", device);
start_scan(ud, device, 0, preview_count);
}
}
@@ -4311,7 +4249,7 @@ drive_changed_cb(GVolumeMonitor *gvm, GDrive *gd, signal_user_data_t *ud)
{
ghb_hb_cleanup(TRUE);
prune_logs(ud);
- ghb_settings_set_string(ud->settings, "scan_source", "/dev/null");
+ ghb_settings_set_string(ud->globals, "scan_source", "/dev/null");
start_scan(ud, "/dev/null", 0, 1);
}
}
@@ -4322,7 +4260,7 @@ drive_changed_cb(GVolumeMonitor *gvm, GDrive *gd, signal_user_data_t *ud)
#define GPM_DBUS_PM_PATH "/org/freedesktop/PowerManagement"
#define GPM_DBUS_PM_INTERFACE "org.freedesktop.PowerManagement"
#define GPM_DBUS_INHIBIT_PATH "/org/freedesktop/PowerManagement/Inhibit"
-#define GPM_DBUS_INHIBIT_INTERFACE "org.freedesktop.PowerManagement.Inhibit"
+#define GPM_DBUS_INHIBIT_INTERFACE "org.freedesktop.PowerManagement.Inhibit"
static gboolean gpm_inhibited = FALSE;
static guint gpm_cookie = -1;
#endif
@@ -4336,7 +4274,7 @@ ghb_can_suspend_gpm()
DBusGProxy *proxy;
GError *error = NULL;
gboolean res;
-
+
g_debug("ghb_can_suspend_gpm()");
conn = dbus_g_bus_get(DBUS_BUS_SESSION, &error);
@@ -4384,7 +4322,7 @@ ghb_suspend_gpm()
DBusGProxy *proxy;
GError *error = NULL;
gboolean res;
-
+
g_debug("ghb_suspend_gpm()");
conn = dbus_g_bus_get(DBUS_BUS_SESSION, &error);
@@ -4429,7 +4367,7 @@ ghb_can_shutdown_gpm()
DBusGProxy *proxy;
GError *error = NULL;
gboolean res;
-
+
g_debug("ghb_can_shutdown_gpm()");
conn = dbus_g_bus_get(DBUS_BUS_SESSION, &error);
@@ -4477,7 +4415,7 @@ ghb_shutdown_gpm()
DBusGProxy *proxy;
GError *error = NULL;
gboolean res;
-
+
g_debug("ghb_shutdown_gpm()");
conn = dbus_g_bus_get(DBUS_BUS_SESSION, &error);
@@ -4521,7 +4459,7 @@ ghb_inhibit_gpm()
DBusGProxy *proxy;
GError *error = NULL;
gboolean res;
-
+
if (gpm_inhibited)
{
@@ -4577,7 +4515,7 @@ ghb_uninhibit_gpm()
DBusGProxy *proxy;
GError *error = NULL;
gboolean res;
-
+
g_debug("ghb_uninhibit_gpm() gpm_cookie %u", gpm_cookie);
if (!gpm_inhibited)
@@ -4638,7 +4576,7 @@ ghb_can_shutdown_gsm()
DBusGProxy *proxy;
GError *error = NULL;
gboolean res;
-
+
g_debug("ghb_can_shutdown_gpm()");
conn = dbus_g_bus_get(DBUS_BUS_SESSION, &error);
@@ -4685,7 +4623,7 @@ ghb_shutdown_gsm()
DBusGProxy *proxy;
GError *error = NULL;
gboolean res;
-
+
g_debug("ghb_shutdown_gpm()");
conn = dbus_g_bus_get(DBUS_BUS_SESSION, &error);
@@ -4730,7 +4668,7 @@ ghb_inhibit_gsm(signal_user_data_t *ud)
gboolean res;
guint xid;
GtkWidget *widget;
-
+
if (gpm_inhibited)
{
@@ -4789,7 +4727,7 @@ ghb_uninhibit_gsm()
DBusGProxy *proxy;
GError *error = NULL;
gboolean res;
-
+
g_debug("ghb_uninhibit_gsm() gpm_cookie %u", gpm_cookie);
if (!gpm_inhibited)
@@ -4830,10 +4768,10 @@ ghb_uninhibit_gsm()
#endif
}
-G_MODULE_EXPORT gboolean
+G_MODULE_EXPORT gboolean
tweak_setting_cb(
- GtkWidget *widget,
- GdkEventButton *event,
+ GtkWidget *widget,
+ GdkEventButton *event,
signal_user_data_t *ud)
{
const gchar *name;
@@ -4842,7 +4780,7 @@ tweak_setting_cb(
gboolean allow_tweaks;
g_debug("press %d %d", event->type, event->button);
- allow_tweaks = ghb_settings_get_boolean(ud->settings, "allow_tweaks");
+ allow_tweaks = ghb_settings_get_boolean(ud->prefs, "allow_tweaks");
if (allow_tweaks && event->type == GDK_BUTTON_PRESS && event->button == 3)
{ // Its a right mouse click
GtkWidget *dialog;
@@ -4892,10 +4830,10 @@ tweak_setting_cb(
return ret;
}
-G_MODULE_EXPORT gboolean
+G_MODULE_EXPORT gboolean
easter_egg_cb(
- GtkWidget *widget,
- GdkEventButton *event,
+ GtkWidget *widget,
+ GdkEventButton *event,
signal_user_data_t *ud)
{
g_debug("press %d %d", event->type, event->button);
@@ -4978,7 +4916,7 @@ process_appcast(signal_user_data_t *ud)
GtkWidget *dialog, *label;
gint response, ibuild = 0, skip;
- if (ud->appcast == NULL || ud->appcast_len < 15 ||
+ if (ud->appcast == NULL || ud->appcast_len < 15 ||
strncmp(&(ud->appcast[9]), "200 OK", 6))
{
goto done;
@@ -4986,8 +4924,8 @@ process_appcast(signal_user_data_t *ud)
ghb_appcast_parse(ud->appcast, &description, &build, &version);
if (build)
ibuild = g_strtod(build, NULL);
- skip = ghb_settings_get_int(ud->settings, "update_skip_version");
- if (description == NULL || build == NULL || version == NULL
+ skip = ghb_settings_get_int(ud->prefs, "update_skip_version");
+ if (description == NULL || build == NULL || version == NULL
|| ibuild <= hb_get_build(NULL) || skip == ibuild)
{
goto done;
@@ -5015,8 +4953,8 @@ process_appcast(signal_user_data_t *ud)
if (response == GTK_RESPONSE_OK)
{
// Skip
- ghb_settings_set_int(ud->settings, "update_skip_version", ibuild);
- ghb_pref_save(ud->settings, "update_skip_version");
+ ghb_settings_set_int(ud->prefs, "update_skip_version", ibuild);
+ ghb_pref_save(ud->prefs, "update_skip_version");
}
g_free(msg);
@@ -5049,7 +4987,7 @@ ghb_net_recv_cb(GIOChannel *ioc, GIOCondition cond, gpointer data)
gsize len;
GError *gerror = NULL;
GIOStatus status;
-
+
g_debug("ghb_net_recv_cb");
signal_user_data_t *ud = (signal_user_data_t*)data;
@@ -5165,8 +5103,8 @@ free_resources:
G_MODULE_EXPORT gboolean
hb_visibility_event_cb(
- GtkWidget *widget,
- GdkEventVisibility *vs,
+ GtkWidget *widget,
+ GdkEventVisibility *vs,
signal_user_data_t *ud)
{
ud->hb_visibility = vs->state;
@@ -5227,7 +5165,7 @@ void
ghb_notify_done(signal_user_data_t *ud)
{
- if (ghb_settings_combo_int(ud->settings, "WhenComplete") == 0)
+ if (ghb_settings_combo_int(ud->prefs, "WhenComplete") == 0)
return;
#if !defined(_WIN32)
@@ -5253,31 +5191,31 @@ ghb_notify_done(signal_user_data_t *ud)
g_object_unref(G_OBJECT(pb));
#endif
- if (ghb_settings_combo_int(ud->settings, "WhenComplete") == 3)
+ if (ghb_settings_combo_int(ud->prefs, "WhenComplete") == 3)
{
if (ghb_can_shutdown_gsm())
{
- ghb_countdown_dialog(GTK_MESSAGE_WARNING,
+ ghb_countdown_dialog(GTK_MESSAGE_WARNING,
_("Your encode is complete."),
- _("Shutting down the computer"),
+ _("Shutting down the computer"),
_("Cancel"), (GSourceFunc)shutdown_cb, ud, 60);
}
}
- if (ghb_settings_combo_int(ud->settings, "WhenComplete") == 2)
+ if (ghb_settings_combo_int(ud->prefs, "WhenComplete") == 2)
{
if (ghb_can_suspend_gpm())
{
- ghb_countdown_dialog(GTK_MESSAGE_WARNING,
+ ghb_countdown_dialog(GTK_MESSAGE_WARNING,
_("Your encode is complete."),
- _("Putting computer to sleep"),
+ _("Putting computer to sleep"),
_("Cancel"), (GSourceFunc)suspend_cb, ud, 60);
}
}
- if (ghb_settings_combo_int(ud->settings, "WhenComplete") == 4)
+ if (ghb_settings_combo_int(ud->prefs, "WhenComplete") == 4)
{
- ghb_countdown_dialog(GTK_MESSAGE_WARNING,
+ ghb_countdown_dialog(GTK_MESSAGE_WARNING,
_("Your encode is complete."),
- _("Quiting Handbrake"),
+ _("Quiting Handbrake"),
_("Cancel"), (GSourceFunc)quit_cb, ud, 60);
}
}
@@ -5292,15 +5230,15 @@ window_configure_cb(
if (gtk_widget_get_visible(widget))
{
gint w, h;
- w = ghb_settings_get_int(ud->settings, "window_width");
- h = ghb_settings_get_int(ud->settings, "window_height");
+ w = ghb_settings_get_int(ud->prefs, "window_width");
+ h = ghb_settings_get_int(ud->prefs, "window_height");
if ( w != event->width || h != event->height )
{
- ghb_settings_set_int(ud->settings, "window_width", event->width);
- ghb_settings_set_int(ud->settings, "window_height", event->height);
- ghb_pref_set(ud->settings, "window_width");
- ghb_pref_set(ud->settings, "window_height");
+ ghb_settings_set_int(ud->prefs, "window_width", event->width);
+ ghb_settings_set_int(ud->prefs, "window_height", event->height);
+ ghb_pref_set(ud->prefs, "window_width");
+ ghb_pref_set(ud->prefs, "window_height");
ghb_prefs_store();
}
}
diff --git a/gtk/src/callbacks.h b/gtk/src/callbacks.h
index 83ece43ba..9b794294c 100644
--- a/gtk/src/callbacks.h
+++ b/gtk/src/callbacks.h
@@ -2,19 +2,19 @@
/*
* callbacks.h
* Copyright (C) John Stebbins 2008-2013 <stebbins@stebbins>
- *
+ *
* callbacks.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.
- *
+ *
* callbacks.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.,
@@ -30,6 +30,7 @@
#endif
#include <gtk/gtk.h>
+#include "hb.h"
#include "settings.h"
#if GLIB_CHECK_VERSION(2, 32, 0)
@@ -51,7 +52,7 @@ void ghb_hbfd(signal_user_data_t *ud, gboolean hbfd);
gboolean ghb_file_menu_add_dvd(signal_user_data_t *ud);
void ghb_udev_init(void);
gboolean ghb_message_dialog(
- GtkMessageType type, const gchar *message,
+ GtkMessageType type, const gchar *message,
const gchar *no, const gchar *yes);
void ghb_error_dialog(
GtkMessageType type, const gchar *message, const gchar *cancel);
@@ -61,7 +62,7 @@ gboolean ghb_cancel_encode2(signal_user_data_t *ud, const gchar *extra_msg);
GValue* ghb_start_next_job(signal_user_data_t *ud, gboolean find_first);
void ghb_check_dependency(
signal_user_data_t *ud, GtkWidget *widget, const gchar *alt_name);
-void ghb_do_scan( signal_user_data_t *ud, const gchar *filename,
+void ghb_do_scan( signal_user_data_t *ud, const gchar *filename,
gint titlenum, gboolean force);
void ghb_log(gchar *log, ...);
gpointer ghb_check_update(signal_user_data_t *ud);
@@ -76,6 +77,10 @@ void ghb_update_destination_extension(signal_user_data_t *ud);
void ghb_update_pending(signal_user_data_t *ud);
gboolean ghb_idle_scan(signal_user_data_t *ud);
void ghb_add_all_titles(signal_user_data_t *ud);
+void ghb_update_title_info(signal_user_data_t *ud);
+void ghb_chapter_list_refresh_all(signal_user_data_t *ud);
+void ghb_load_settings(signal_user_data_t * ud);
+void ghb_set_current_title_settings(signal_user_data_t *ud);
#endif // _CALLBACKS_H_
diff --git a/gtk/src/create_resources.c b/gtk/src/create_resources.c
index 61521ef4d..518cf47ae 100644
--- a/gtk/src/create_resources.c
+++ b/gtk/src/create_resources.c
@@ -76,8 +76,8 @@ find_file(GList *list, const gchar *name)
static const gchar*
lookup_attr_value(
- const gchar *name,
- const gchar **attr_names,
+ const gchar *name,
+ const gchar **attr_names,
const gchar **attr_values)
{
gint ii;
@@ -90,7 +90,7 @@ lookup_attr_value(
}
return NULL;
}
-
+
static GValue*
read_string_from_file(const gchar *filename)
{
@@ -116,15 +116,15 @@ read_string_from_file(const gchar *filename)
static void
start_element(
- GMarkupParseContext *ctx,
- const gchar *tag,
+ GMarkupParseContext *ctx,
+ const gchar *tag,
const gchar **attr_names,
const gchar **attr_values,
gpointer ud,
GError **error)
{
parse_data_t *pd = (parse_data_t*)ud;
- union
+ union
{
gint id;
gpointer pid;
@@ -196,17 +196,17 @@ start_element(
int bps = gdk_pixbuf_get_bits_per_sample(pb);
int rowstride = gdk_pixbuf_get_rowstride(pb);
- ghb_dict_insert(gval, g_strdup("colorspace"),
+ ghb_dict_insert(gval, g_strdup("colorspace"),
ghb_int_value_new(colorspace));
- ghb_dict_insert(gval, g_strdup("alpha"),
+ ghb_dict_insert(gval, g_strdup("alpha"),
ghb_boolean_value_new(alpha));
- ghb_dict_insert(gval, g_strdup("width"),
+ ghb_dict_insert(gval, g_strdup("width"),
ghb_int_value_new(width));
- ghb_dict_insert(gval, g_strdup("height"),
+ ghb_dict_insert(gval, g_strdup("height"),
ghb_int_value_new(height));
- ghb_dict_insert(gval, g_strdup("bps"),
+ ghb_dict_insert(gval, g_strdup("bps"),
ghb_int_value_new(bps));
- ghb_dict_insert(gval, g_strdup("rowstride"),
+ ghb_dict_insert(gval, g_strdup("rowstride"),
ghb_int_value_new(rowstride));
rd = g_malloc(sizeof(ghb_rawdata_t));
@@ -302,14 +302,14 @@ start_element(
static void
end_element(
- GMarkupParseContext *ctx,
- const gchar *name,
+ GMarkupParseContext *ctx,
+ const gchar *name,
gpointer ud,
GError **error)
{
parse_data_t *pd = (parse_data_t*)ud;
gint id;
- union
+ union
{
gint id;
gpointer pid;
@@ -386,8 +386,8 @@ end_element(
static void
text_data(
- GMarkupParseContext *ctx,
- const gchar *text,
+ GMarkupParseContext *ctx,
+ const gchar *text,
gsize len,
gpointer ud,
GError **error)
@@ -399,8 +399,8 @@ text_data(
static void
passthrough(
- GMarkupParseContext *ctx,
- const gchar *text,
+ GMarkupParseContext *ctx,
+ const gchar *text,
gsize len,
gpointer ud,
GError **error)
@@ -417,7 +417,7 @@ parse_error(GMarkupParseContext *ctx, GError *error, gpointer ud)
}
// This is required or the parser crashes
-static void
+static void
destroy_notify(gpointer data)
{ // Do nothing
//g_debug("destroy parser");
diff --git a/gtk/src/ghb-dvd.c b/gtk/src/ghb-dvd.c
index d92373798..bcd7e1311 100644
--- a/gtk/src/ghb-dvd.c
+++ b/gtk/src/ghb-dvd.c
@@ -11,17 +11,17 @@
* 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.
- *
+ *
* This program 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 Library General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
*/
-
+
// Well, I waisted a bit of time on this. It seems libhb has a function for
// this that I hadn't discovered yet. hb_dvd_name().
@@ -89,7 +89,7 @@ struct volume_structure_descriptor {
} PACKED;
#define VOLUME_ID_LABEL_SIZE 64
-typedef struct
+typedef struct
{
gint fd;
gchar label[VOLUME_ID_LABEL_SIZE+1];
@@ -128,14 +128,14 @@ static guint8*
get_buffer(int fd, guint64 off, gsize len)
{
gint buf_len;
-
- if (lseek(fd, off, SEEK_SET) < 0)
+
+ if (lseek(fd, off, SEEK_SET) < 0)
{
return NULL;
}
guint8 *buffer = g_malloc(len);
buf_len = read(fd, buffer, len);
- if (buf_len < 0)
+ if (buf_len < 0)
{
g_free(buffer);
return NULL;
@@ -143,7 +143,7 @@ get_buffer(int fd, guint64 off, gsize len)
return buffer;
}
-static gint
+static gint
set_unicode16(guint8 *str, gsize len, const guint8 *buf, gint endianess, gsize count)
{
gint ii, jj;
@@ -179,25 +179,25 @@ set_unicode16(guint8 *str, gsize len, const guint8 *buf, gint endianess, gsize c
return jj;
}
-static void
+static void
set_label_string(guint8 *str, const guint8 *buf, gsize count)
{
gint ii;
memcpy(str, buf, count);
str[count] = 0;
-
+
/* remove trailing whitespace */
ii = strlen((gchar*)str);
- while (ii--)
+ while (ii--)
{
if (!g_ascii_isspace(str[ii]))
break;
}
str[ii+1] = 0;
}
-
-static gint
+
+static gint
probe_udf(udf_info_t *id)
{
struct volume_descriptor *vd;
@@ -327,7 +327,7 @@ ghb_resolve_symlink(const gchar *name)
GFile *gfile;
gfile = g_file_new_for_path(name);
- info = g_file_query_info(gfile,
+ info = g_file_query_info(gfile,
G_FILE_ATTRIBUTE_STANDARD_NAME ","
G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET ","
G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK,
@@ -344,7 +344,7 @@ ghb_resolve_symlink(const gchar *name)
g_object_unref(parent);
g_object_unref(info);
- info = g_file_query_info(gfile,
+ info = g_file_query_info(gfile,
G_FILE_ATTRIBUTE_STANDARD_NAME ","
G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET ","
G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK,
@@ -377,15 +377,15 @@ ghb_dvd_set_current(const gchar *name, signal_user_data_t *ud)
ud->current_dvd_device = NULL;
}
gfile = g_file_new_for_path(resolved);
- info = g_file_query_info(gfile,
+ info = g_file_query_info(gfile,
G_FILE_ATTRIBUTE_STANDARD_TYPE,
G_FILE_QUERY_INFO_NONE, NULL, NULL);
if (info != NULL)
{
if (g_file_info_get_file_type(info) == G_FILE_TYPE_SPECIAL)
{
- // I could go through the trouble to scan the connected drives and
- // verify that this device is connected and is a DVD. But I don't
+ // I could go through the trouble to scan the connected drives and
+ // verify that this device is connected and is a DVD. But I don't
// think its neccessary.
ud->current_dvd_device = resolved;
}
diff --git a/gtk/src/ghb-dvd.h b/gtk/src/ghb-dvd.h
index b939872ca..f556d01d6 100644
--- a/gtk/src/ghb-dvd.h
+++ b/gtk/src/ghb-dvd.h
@@ -3,12 +3,12 @@
* 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.
- *
+ *
* This program 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 Library General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
diff --git a/gtk/src/ghb.ui b/gtk/src/ghb.ui
index 6fda5cea4..f00805616 100644
--- a/gtk/src/ghb.ui
+++ b/gtk/src/ghb.ui
@@ -1014,7 +1014,7 @@ Here you can adjust cropping, resolution, aspect ratio, and filters.</property>
</packing>
</child>
<child>
- <object class="GtkLabel" id="source_title">
+ <object class="GtkLabel" id="volume_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>
@@ -1605,7 +1605,7 @@ This allows a player to initiate playback before downloading the entire file.</p
</packing>
</child>
<child>
- <object class="GtkLabel" id="source_codec">
+ <object class="GtkLabel" id="source_video_codec">
<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>
@@ -7288,7 +7288,7 @@ Setting this to 0 means there is no maximum height.</property>
<property name="receives_default">False</property>
<property name="tooltip_text" translatable="yes">Show Cropped area of the preview</property>
<property name="xalign">0</property>
- <property name="draw_indicator">False</property>
+ <property name="draw_indicator">True</property>
<signal name="toggled" handler="show_crop_changed_cb" swapped="no"/>
</object>
<packing>
@@ -7551,8 +7551,9 @@ Setting this to 0 means there is no maximum height.</property>
<property name="receives_default">False</property>
<property name="tooltip_text" translatable="yes">Open Preview Window</property>
<property name="hexpand">False</property>
- <property name="xalign">0</property>
- <property name="draw_indicator">False</property>
+ <property name="halign">start</property>
+ <property name="margin_left">12</property>
+ <property name="draw_indicator">True</property>
<signal name="toggled" handler="preview_button_clicked_cb" swapped="no"/>
</object>
<packing>
@@ -8809,6 +8810,7 @@ Frames that are not interlaced will suffer some quality degradation.</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
<property name="group">PictureDecombDeinterlace</property>
+ <signal name="toggled" handler="setting_widget_changed_cb" swapped="no"/>
</object>
<packing>
<property name="top_attach">2</property>
diff --git a/gtk/src/ghbcellrenderertext.c b/gtk/src/ghbcellrenderertext.c
index 133923f3a..3f8dcf5e8 100644
--- a/gtk/src/ghbcellrenderertext.c
+++ b/gtk/src/ghbcellrenderertext.c
@@ -103,7 +103,7 @@ enum {
PROP_WIDTH_CHARS,
PROP_WRAP_WIDTH,
PROP_ALIGN,
-
+
/* Style args */
PROP_BACKGROUND,
PROP_FOREGROUND,
@@ -126,7 +126,7 @@ enum {
PROP_LANGUAGE,
PROP_ELLIPSIZE,
PROP_WRAP_MODE,
-
+
/* Whether-a-style-arg-is-set args */
PROP_BACKGROUND_SET,
PROP_FOREGROUND_SET,
@@ -160,20 +160,20 @@ struct _GhbCellRendererTextPrivate
guint markup_set : 1;
guint ellipsize_set : 1;
guint align_set : 1;
-
+
gulong focus_out_id;
PangoLanguage *language;
PangoEllipsizeMode ellipsize;
PangoWrapMode wrap_mode;
PangoAlignment align;
-
+
gulong populate_popup_id;
gulong entry_menu_popdown_timeout;
gboolean in_entry_menu;
-
+
gint width_chars;
gint wrap_width;
-
+
GtkWidget *entry;
};
@@ -208,7 +208,7 @@ ghb_cell_renderer_text_class_init (GhbCellRendererTextClass *class)
GtkCellRendererClass *cell_class = GTK_CELL_RENDERER_CLASS (class);
object_class->finalize = ghb_cell_renderer_text_finalize;
-
+
object_class->get_property = ghb_cell_renderer_text_get_property;
object_class->set_property = ghb_cell_renderer_text_set_property;
@@ -223,7 +223,7 @@ ghb_cell_renderer_text_class_init (GhbCellRendererTextClass *class)
P_("Text to render"),
NULL,
GTK_PARAM_READWRITE));
-
+
g_object_class_install_property (object_class,
PROP_MARKUP,
g_param_spec_string ("markup",
@@ -248,7 +248,7 @@ ghb_cell_renderer_text_class_init (GhbCellRendererTextClass *class)
FALSE,
GTK_PARAM_READWRITE));
-
+
g_object_class_install_property (object_class,
PROP_BACKGROUND,
g_param_spec_string ("background",
@@ -263,7 +263,7 @@ ghb_cell_renderer_text_class_init (GhbCellRendererTextClass *class)
P_("Background color"),
P_("Background color as a GdkColor"),
GDK_TYPE_COLOR,
- GTK_PARAM_READWRITE));
+ GTK_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_FOREGROUND,
@@ -306,7 +306,7 @@ ghb_cell_renderer_text_class_init (GhbCellRendererTextClass *class)
PANGO_TYPE_FONT_DESCRIPTION,
GTK_PARAM_READWRITE));
-
+
g_object_class_install_property (object_class,
PROP_FAMILY,
g_param_spec_string ("family",
@@ -332,7 +332,7 @@ ghb_cell_renderer_text_class_init (GhbCellRendererTextClass *class)
PANGO_TYPE_VARIANT,
PANGO_VARIANT_NORMAL,
GTK_PARAM_READWRITE));
-
+
g_object_class_install_property (object_class,
PROP_WEIGHT,
g_param_spec_int ("weight",
@@ -351,7 +351,7 @@ ghb_cell_renderer_text_class_init (GhbCellRendererTextClass *class)
PANGO_TYPE_STRETCH,
PANGO_STRETCH_NORMAL,
GTK_PARAM_READWRITE));
-
+
g_object_class_install_property (object_class,
PROP_SIZE,
g_param_spec_int ("size",
@@ -370,7 +370,7 @@ ghb_cell_renderer_text_class_init (GhbCellRendererTextClass *class)
0.0,
G_MAXDOUBLE,
0.0,
- GTK_PARAM_READWRITE));
+ GTK_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_SCALE,
@@ -381,7 +381,7 @@ ghb_cell_renderer_text_class_init (GhbCellRendererTextClass *class)
G_MAXDOUBLE,
1.0,
GTK_PARAM_READWRITE));
-
+
g_object_class_install_property (object_class,
PROP_RISE,
g_param_spec_int ("rise",
@@ -401,7 +401,7 @@ ghb_cell_renderer_text_class_init (GhbCellRendererTextClass *class)
P_("Whether to strike through the text"),
FALSE,
GTK_PARAM_READWRITE));
-
+
g_object_class_install_property (object_class,
PROP_UNDERLINE,
g_param_spec_enum ("underline",
@@ -425,8 +425,8 @@ ghb_cell_renderer_text_class_init (GhbCellRendererTextClass *class)
/**
* GhbCellRendererText:ellipsize:
*
- * Specifies the preferred place to ellipsize the string, if the cell renderer
- * does not have enough room to display the entire string. Setting it to
+ * Specifies the preferred place to ellipsize the string, if the cell renderer
+ * does not have enough room to display the entire string. Setting it to
* %PANGO_ELLIPSIZE_NONE turns off ellipsizing. See the wrap-width property
* for another way of making the text fit into a given width.
*
@@ -445,11 +445,11 @@ ghb_cell_renderer_text_class_init (GhbCellRendererTextClass *class)
/**
* GhbCellRendererText:width-chars:
- *
+ *
* The desired width of the cell, in characters. If this property is set to
* -1, the width will be calculated automatically, otherwise the cell will
* request either 3 characters or the property value, whichever is greater.
- *
+ *
* Since: 2.6
**/
g_object_class_install_property (object_class,
@@ -461,12 +461,12 @@ ghb_cell_renderer_text_class_init (GhbCellRendererTextClass *class)
G_MAXINT,
-1,
GTK_PARAM_READWRITE));
-
+
/**
* GhbCellRendererText:wrap-mode:
*
- * Specifies how to break the string into multiple lines, if the cell
- * renderer does not have enough room to display the entire string.
+ * Specifies how to break the string into multiple lines, if the cell
+ * renderer does not have enough room to display the entire string.
* This property has no effect unless the wrap-width property is set.
*
* Since: 2.8
@@ -485,7 +485,7 @@ ghb_cell_renderer_text_class_init (GhbCellRendererTextClass *class)
/**
* GhbCellRendererText:wrap-width:
*
- * Specifies the width at which the text is wrapped. The wrap-mode property can
+ * Specifies the width at which the text is wrapped. The wrap-mode property can
* be used to influence at what character positions the line breaks can be placed.
* Setting wrap-width to -1 turns wrapping off.
*
@@ -504,10 +504,10 @@ ghb_cell_renderer_text_class_init (GhbCellRendererTextClass *class)
/**
* GhbCellRendererText:alignment:
*
- * Specifies how to align the lines of text with respect to each other.
+ * Specifies how to align the lines of text with respect to each other.
*
- * Note that this property describes how to align the lines of text in
- * case there are several of them. The "xalign" property of #GtkCellRenderer,
+ * Note that this property describes how to align the lines of text in
+ * case there are several of them. The "xalign" property of #GtkCellRenderer,
* on the other hand, sets the horizontal alignment of the whole text.
*
* Since: 2.10
@@ -520,7 +520,7 @@ ghb_cell_renderer_text_class_init (GhbCellRendererTextClass *class)
PANGO_TYPE_ALIGNMENT,
PANGO_ALIGN_LEFT,
GTK_PARAM_READWRITE));
-
+
/* Style props are set or not */
#define ADD_SET_PROP(propname, propval, nick, blurb) g_object_class_install_property (object_class, propval, g_param_spec_boolean (propname, nick, blurb, FALSE, GTK_PARAM_READWRITE))
@@ -532,14 +532,14 @@ ghb_cell_renderer_text_class_init (GhbCellRendererTextClass *class)
ADD_SET_PROP ("foreground-set", PROP_FOREGROUND_SET,
P_("Foreground set"),
P_("Whether this tag affects the foreground color"));
-
+
ADD_SET_PROP ("editable-set", PROP_EDITABLE_SET,
P_("Editability set"),
P_("Whether this tag affects text editability"));
ADD_SET_PROP ("family-set", PROP_FAMILY_SET,
P_("Font family set"),
- P_("Whether this tag affects the font family"));
+ P_("Whether this tag affects the font family"));
ADD_SET_PROP ("style-set", PROP_STYLE_SET,
P_("Font style set"),
@@ -564,7 +564,7 @@ ghb_cell_renderer_text_class_init (GhbCellRendererTextClass *class)
ADD_SET_PROP ("scale-set", PROP_SCALE_SET,
P_("Font scale set"),
P_("Whether this tag scales the font size by a factor"));
-
+
ADD_SET_PROP ("rise-set", PROP_RISE_SET,
P_("Rise set"),
P_("Whether this tag affects the rise"));
@@ -695,11 +695,11 @@ ghb_cell_renderer_text_get_property (GObject *object,
case PROP_BACKGROUND_GDK:
{
GdkColor color;
-
+
color.red = celltext->background.red;
color.green = celltext->background.green;
color.blue = celltext->background.blue;
-
+
g_value_set_boxed (value, &color);
}
break;
@@ -707,11 +707,11 @@ ghb_cell_renderer_text_get_property (GObject *object,
case PROP_FOREGROUND_GDK:
{
GdkColor color;
-
+
color.red = celltext->foreground.red;
color.green = celltext->foreground.green;
color.blue = celltext->foreground.blue;
-
+
g_value_set_boxed (value, &color);
}
break;
@@ -719,7 +719,7 @@ ghb_cell_renderer_text_get_property (GObject *object,
case PROP_FONT:
g_value_take_string (value, pango_font_description_to_string (celltext->font));
break;
-
+
case PROP_FONT_DESC:
g_value_set_boxed (value, celltext->font);
break;
@@ -755,7 +755,7 @@ ghb_cell_renderer_text_get_property (GObject *object,
case PROP_SCALE:
g_value_set_double (value, celltext->font_scale);
break;
-
+
case PROP_EDITABLE:
g_value_set_boolean (value, celltext->editable);
break;
@@ -770,7 +770,7 @@ ghb_cell_renderer_text_get_property (GObject *object,
case PROP_RISE:
g_value_set_int (value, celltext->rise);
- break;
+ break;
case PROP_LANGUAGE:
g_value_set_static_string (value, pango_language_to_string (priv->language));
@@ -779,7 +779,7 @@ ghb_cell_renderer_text_get_property (GObject *object,
case PROP_ELLIPSIZE:
g_value_set_enum (value, priv->ellipsize);
break;
-
+
case PROP_WRAP_MODE:
g_value_set_enum (value, priv->wrap_mode);
break;
@@ -787,7 +787,7 @@ ghb_cell_renderer_text_get_property (GObject *object,
case PROP_WRAP_WIDTH:
g_value_set_int (value, priv->wrap_width);
break;
-
+
case PROP_ALIGN:
g_value_set_enum (value, priv->align);
break;
@@ -809,14 +809,14 @@ ghb_cell_renderer_text_get_property (GObject *object,
{
PangoFontMask mask = get_property_font_set_mask (param_id);
g_value_set_boolean (value, (pango_font_description_get_set_fields (celltext->font) & mask) != 0);
-
+
break;
}
case PROP_SCALE_SET:
g_value_set_boolean (value, celltext->scale_set);
break;
-
+
case PROP_EDITABLE_SET:
g_value_set_boolean (value, celltext->editable_set);
break;
@@ -844,10 +844,10 @@ ghb_cell_renderer_text_get_property (GObject *object,
case PROP_ALIGN_SET:
g_value_set_boolean (value, priv->align_set);
break;
-
+
case PROP_WIDTH_CHARS:
g_value_set_int (value, priv->width_chars);
- break;
+ break;
case PROP_BACKGROUND:
case PROP_FOREGROUND:
@@ -870,7 +870,7 @@ set_bg_color (GhbCellRendererText *celltext,
celltext->background_set = TRUE;
g_object_notify (G_OBJECT (celltext), "background-set");
}
-
+
celltext->background.red = color->red;
celltext->background.green = color->green;
celltext->background.blue = color->blue;
@@ -897,7 +897,7 @@ set_fg_color (GhbCellRendererText *celltext,
celltext->foreground_set = TRUE;
g_object_notify (G_OBJECT (celltext), "foreground-set");
}
-
+
celltext->foreground.red = color->red;
celltext->foreground.green = color->green;
celltext->foreground.blue = color->blue;
@@ -917,7 +917,7 @@ set_font_desc_fields (PangoFontDescription *desc,
PangoFontMask to_set)
{
PangoFontMask changed_mask = 0;
-
+
if (to_set & PANGO_FONT_MASK_FAMILY)
{
const char *family = pango_font_description_get_family (desc);
@@ -945,7 +945,7 @@ set_font_desc_fields (PangoFontDescription *desc,
size = 10 * PANGO_SCALE;
changed_mask |= PANGO_FONT_MASK_SIZE;
}
-
+
pango_font_description_set_size (desc, size);
}
@@ -995,7 +995,7 @@ set_font_description (GhbCellRendererText *celltext,
GObject *object = G_OBJECT (celltext);
PangoFontDescription *new_font_desc;
PangoFontMask old_mask, new_mask, changed_mask, set_changed_mask;
-
+
if (font_desc)
new_font_desc = pango_font_description_copy (font_desc);
else
@@ -1009,12 +1009,12 @@ set_font_description (GhbCellRendererText *celltext,
pango_font_description_free (celltext->font);
celltext->font = new_font_desc;
-
+
g_object_freeze_notify (object);
g_object_notify (object, "font-desc");
g_object_notify (object, "font");
-
+
if (changed_mask & PANGO_FONT_MASK_FAMILY)
g_object_notify (object, "family");
if (changed_mask & PANGO_FONT_MASK_STYLE)
@@ -1032,7 +1032,7 @@ set_font_description (GhbCellRendererText *celltext,
}
notify_set_changed (object, set_changed_mask);
-
+
g_object_thaw_notify (object);
}
@@ -1108,7 +1108,7 @@ ghb_cell_renderer_text_set_property (GObject *object,
case PROP_SINGLE_PARAGRAPH_MODE:
priv->single_paragraph = g_value_get_boolean (value);
break;
-
+
case PROP_BACKGROUND:
{
GdkColor color;
@@ -1123,7 +1123,7 @@ ghb_cell_renderer_text_set_property (GObject *object,
g_object_notify (object, "background-gdk");
}
break;
-
+
case PROP_FOREGROUND:
{
GdkColor color;
@@ -1162,7 +1162,7 @@ ghb_cell_renderer_text_set_property (GObject *object,
set_font_description (celltext, font_desc);
pango_font_description_free (font_desc);
-
+
if (celltext->fixed_height_rows != -1)
celltext->calc_fixed_height = TRUE;
}
@@ -1170,7 +1170,7 @@ ghb_cell_renderer_text_set_property (GObject *object,
case PROP_FONT_DESC:
set_font_description (celltext, g_value_get_boxed (value));
-
+
if (celltext->fixed_height_rows != -1)
celltext->calc_fixed_height = TRUE;
break;
@@ -1184,7 +1184,7 @@ ghb_cell_renderer_text_set_property (GObject *object,
case PROP_SIZE_POINTS:
{
PangoFontMask old_set_mask = pango_font_description_get_set_fields (celltext->font);
-
+
switch (param_id)
{
case PROP_FAMILY:
@@ -1218,17 +1218,17 @@ ghb_cell_renderer_text_set_property (GObject *object,
g_object_notify (object, "size");
break;
}
-
+
if (celltext->fixed_height_rows != -1)
celltext->calc_fixed_height = TRUE;
-
+
notify_set_changed (object, old_set_mask & pango_font_description_get_set_fields (celltext->font));
g_object_notify (object, "font-desc");
g_object_notify (object, "font");
break;
}
-
+
case PROP_SCALE:
celltext->font_scale = g_value_get_double (value);
celltext->scale_set = TRUE;
@@ -1236,7 +1236,7 @@ ghb_cell_renderer_text_set_property (GObject *object,
celltext->calc_fixed_height = TRUE;
g_object_notify (object, "scale-set");
break;
-
+
case PROP_EDITABLE:
celltext->editable = g_value_get_boolean (value);
celltext->editable_set = TRUE;
@@ -1257,7 +1257,7 @@ ghb_cell_renderer_text_set_property (GObject *object,
celltext->underline_style = g_value_get_enum (value);
celltext->underline_set = TRUE;
g_object_notify (object, "underline-set");
-
+
break;
case PROP_RISE:
@@ -1266,7 +1266,7 @@ ghb_cell_renderer_text_set_property (GObject *object,
g_object_notify (object, "rise-set");
if (celltext->fixed_height_rows != -1)
celltext->calc_fixed_height = TRUE;
- break;
+ break;
case PROP_LANGUAGE:
priv->language_set = TRUE;
@@ -1281,18 +1281,18 @@ ghb_cell_renderer_text_set_property (GObject *object,
priv->ellipsize_set = TRUE;
g_object_notify (object, "ellipsize-set");
break;
-
+
case PROP_WRAP_MODE:
priv->wrap_mode = g_value_get_enum (value);
break;
-
+
case PROP_WRAP_WIDTH:
priv->wrap_width = g_value_get_int (value);
break;
-
+
case PROP_WIDTH_CHARS:
priv->width_chars = g_value_get_int (value);
- break;
+ break;
case PROP_ALIGN:
priv->align = g_value_get_enum (value);
@@ -1322,7 +1322,7 @@ ghb_cell_renderer_text_set_property (GObject *object,
else
{
PangoFontMask changed_mask;
-
+
changed_mask = set_font_desc_fields (celltext->font,
get_property_font_set_mask (param_id));
notify_fields_changed (G_OBJECT (celltext), changed_mask);
@@ -1332,7 +1332,7 @@ ghb_cell_renderer_text_set_property (GObject *object,
case PROP_SCALE_SET:
celltext->scale_set = g_value_get_boolean (value);
break;
-
+
case PROP_EDITABLE_SET:
celltext->editable_set = g_value_get_boolean (value);
break;
@@ -1360,7 +1360,7 @@ ghb_cell_renderer_text_set_property (GObject *object,
case PROP_ALIGN_SET:
priv->align_set = g_value_get_boolean (value);
break;
-
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
break;
@@ -1369,7 +1369,7 @@ ghb_cell_renderer_text_set_property (GObject *object,
/**
* ghb_cell_renderer_text_new:
- *
+ *
* Creates a new #GhbCellRendererText. Adjust how text is drawn using
* object properties. Object properties can be
* set globally (with g_object_set()). Also, with #GtkTreeViewColumn,
@@ -1377,7 +1377,7 @@ ghb_cell_renderer_text_set_property (GObject *object,
* you can bind the "text" property on the cell renderer to a string
* value in the model, thus rendering a different string in each row
* of the #GtkTreeView
- *
+ *
* Return value: the new cell renderer
**/
GtkCellRenderer *
@@ -1392,7 +1392,7 @@ add_attr (PangoAttrList *attr_list,
{
attr->start_index = 0;
attr->end_index = G_MAXINT;
-
+
pango_attr_list_insert (attr_list, attr);
}
@@ -1408,7 +1408,7 @@ get_layout (GhbCellRendererText *celltext,
GhbCellRendererTextPrivate *priv;
priv = GHB_CELL_RENDERER_TEXT_GET_PRIVATE (celltext);
-
+
layout = gtk_widget_create_pango_layout (widget, celltext->text);
if (celltext->extra_attrs)
@@ -1421,18 +1421,18 @@ get_layout (GhbCellRendererText *celltext,
if (will_render)
{
/* Add options that affect appearance but not size */
-
+
/* note that background doesn't go here, since it affects
* background_area not the PangoLayout area
*/
-
+
if (celltext->foreground_set
&& (flags & GTK_CELL_RENDERER_SELECTED) == 0)
{
PangoColor color;
color = celltext->foreground;
-
+
add_attr (attr_list,
pango_attr_foreground_new (color.red, color.green, color.blue));
}
@@ -1447,7 +1447,7 @@ get_layout (GhbCellRendererText *celltext,
if (celltext->scale_set &&
celltext->font_scale != 1.0)
add_attr (attr_list, pango_attr_scale_new (celltext->font_scale));
-
+
if (celltext->underline_set)
uline = celltext->underline_style;
else
@@ -1455,7 +1455,7 @@ get_layout (GhbCellRendererText *celltext,
if (priv->language_set)
add_attr (attr_list, pango_attr_language_new (priv->language));
-
+
if ((flags & GTK_CELL_RENDERER_PRELIT) == GTK_CELL_RENDERER_PRELIT)
{
switch (uline)
@@ -1512,7 +1512,7 @@ get_layout (GhbCellRendererText *celltext,
pango_layout_set_attributes (layout, attr_list);
pango_attr_list_unref (attr_list);
-
+
return layout;
}
@@ -1567,7 +1567,7 @@ get_size (GtkCellRenderer *cell,
gtk_cell_renderer_set_fixed_size (cell,
cell_width, 2*cell_ypad +
celltext->fixed_height_rows * PANGO_PIXELS (row_height));
-
+
if (height)
{
*height = cell_height;
@@ -1577,7 +1577,7 @@ get_size (GtkCellRenderer *cell,
if (width == NULL)
return;
}
-
+
if (layout)
g_object_ref (layout);
else
@@ -1594,7 +1594,7 @@ get_size (GtkCellRenderer *cell,
{
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
*x_offset = (1.0 - cell_xalign) * (cell_area->width - (2 * cell_xpad));
- else
+ else
*x_offset = cell_xalign * (cell_area->width - (2 * cell_xpad));
if ((priv->ellipsize_set && priv->ellipsize != PANGO_ELLIPSIZE_NONE) || priv->wrap_width != -1)
@@ -1661,7 +1661,7 @@ static void ghb_cell_renderer_text_render(
gboolean sensitive;
sensitive = gtk_cell_renderer_get_sensitive(cell);
- if (!sensitive)
+ if (!sensitive)
{
state = GTK_STATE_INSENSITIVE;
}
@@ -1688,7 +1688,7 @@ static void ghb_cell_renderer_text_render(
gtk_cell_renderer_get_padding(cell, &xpad, &ypad);
- if (celltext->background_set &&
+ if (celltext->background_set &&
(flags & GTK_CELL_RENDERER_SELECTED) == 0)
{
gdk_cairo_rectangle (cr, background_area);
@@ -1700,7 +1700,7 @@ static void ghb_cell_renderer_text_render(
}
if (priv->ellipsize_set && priv->ellipsize != PANGO_ELLIPSIZE_NONE)
- pango_layout_set_width (layout,
+ pango_layout_set_width (layout,
(cell_area->width - x_offset - 2 * xpad) * PANGO_SCALE);
else if (priv->wrap_width == -1)
pango_layout_set_width (layout, -1);
@@ -1738,7 +1738,7 @@ static void ghb_cell_renderer_text_render (GtkCellRenderer *cell,
gint xpad, ypad;
sensitive = gtk_cell_renderer_get_sensitive(cell);
- if (!sensitive)
+ if (!sensitive)
{
state = GTK_STATE_INSENSITIVE;
}
@@ -1764,7 +1764,7 @@ static void ghb_cell_renderer_text_render (GtkCellRenderer *cell,
gtk_cell_renderer_get_padding(cell, &xpad, &ypad);
- if (celltext->background_set &&
+ if (celltext->background_set &&
(flags & GTK_CELL_RENDERER_SELECTED) == 0)
{
cairo_t *cr = gdk_cairo_create (window);
@@ -1781,12 +1781,12 @@ static void ghb_cell_renderer_text_render (GtkCellRenderer *cell,
celltext->background.green / 65535.,
celltext->background.blue / 65535.);
cairo_fill (cr);
-
+
cairo_destroy (cr);
}
if (priv->ellipsize_set && priv->ellipsize != PANGO_ELLIPSIZE_NONE)
- pango_layout_set_width (layout,
+ pango_layout_set_width (layout,
(cell_area->width - x_offset - 2 * xpad) * PANGO_SCALE);
else if (priv->wrap_width == -1)
pango_layout_set_width (layout, -1);
@@ -1850,7 +1850,7 @@ ghb_cell_renderer_text_editing_done (GtkCellEditable *entry,
gboolean editing_canceled;
g_object_get(entry, "editing-canceled", &editing_canceled, NULL);
- gtk_cell_renderer_stop_editing (GTK_CELL_RENDERER (data),
+ gtk_cell_renderer_stop_editing (GTK_CELL_RENDERER (data),
editing_canceled);
if (editing_canceled)
return;
@@ -1965,9 +1965,9 @@ ghb_cell_renderer_text_start_editing (GtkCellRenderer *cell,
g_object_set_data_full (G_OBJECT (priv->entry),
I_(GHB_CELL_RENDERER_TEXT_PATH), g_strdup (path), g_free);
-
+
gtk_editable_select_region (GTK_EDITABLE (priv->entry), 0, -1);
-
+
#if 0
GtkRequisition min_size, size;
@@ -2023,7 +2023,7 @@ ghb_cell_renderer_text_start_editing (GtkCellRenderer *cell,
priv->populate_popup_id = g_signal_connect (priv->entry, "populate_popup",
G_CALLBACK (ghb_cell_renderer_text_populate_popup),
celltext);
-
+
gtk_widget_show (priv->entry);
return GTK_CELL_EDITABLE (priv->entry);
@@ -2033,7 +2033,7 @@ ghb_cell_renderer_text_start_editing (GtkCellRenderer *cell,
* ghb_cell_renderer_text_set_fixed_height_from_font:
* @renderer: A #GhbCellRendererText
* @number_of_rows: Number of rows of text each cell renderer is allocated, or -1
- *
+ *
* Sets the height of a renderer to explicitly be determined by the "font" and
* "y_pad" property set on it. Further changes in these properties do not
* affect the height, so they must be accompanied by a subsequent call to this
diff --git a/gtk/src/ghbcellrenderertext.h b/gtk/src/ghbcellrenderertext.h
index d93c2a48f..4d6176f8c 100644
--- a/gtk/src/ghbcellrenderertext.h
+++ b/gtk/src/ghbcellrenderertext.h
@@ -47,7 +47,7 @@ struct _GhbCellRendererText
gdouble font_scale;
PangoColor foreground;
PangoColor background;
-
+
PangoAttrList *extra_attrs;
PangoUnderline underline_style;
@@ -60,14 +60,14 @@ struct _GhbCellRendererText
guint editable : 1;
guint scale_set : 1;
-
+
guint foreground_set : 1;
guint background_set : 1;
-
+
guint underline_set : 1;
guint rise_set : 1;
-
+
guint strikethrough_set : 1;
guint editable_set : 1;
diff --git a/gtk/src/ghbcompat.h b/gtk/src/ghbcompat.h
index 47d97fdd6..fa9e10bec 100644
--- a/gtk/src/ghbcompat.h
+++ b/gtk/src/ghbcompat.h
@@ -50,7 +50,7 @@ static inline PangoFontDescription* ghb_widget_get_font(GtkWidget *widget)
#endif
return font;
-}
+}
#if !GTK_CHECK_VERSION(3, 0, 0)
#define gtk_widget_override_font gtk_widget_modify_font
diff --git a/gtk/src/ghbcompositor.c b/gtk/src/ghbcompositor.c
index 92f8fe2e8..24d5a72f8 100644
--- a/gtk/src/ghbcompositor.c
+++ b/gtk/src/ghbcompositor.c
@@ -148,7 +148,7 @@ ghb_compositor_child_type(GtkContainer *container)
return GTK_TYPE_WIDGET;
}
-static void
+static void
ghb_compositor_get_property (
GObject *object,
guint prop_id,
@@ -163,7 +163,7 @@ ghb_compositor_get_property (
}
}
-static void
+static void
ghb_compositor_set_property (
GObject *object,
guint prop_id,
@@ -189,7 +189,7 @@ zsort(gconstpointer a, gconstpointer b)
return (cca->z_pos - ccb->z_pos);
}
-static void
+static void
ghb_compositor_set_child_property(
GtkContainer *container,
GtkWidget *child,
@@ -231,7 +231,7 @@ ghb_compositor_set_child_property(
break;
}
- if (gtk_widget_get_visible (child) &&
+ if (gtk_widget_get_visible (child) &&
gtk_widget_get_visible (GTK_WIDGET(compositor)))
{
gtk_widget_queue_resize (child);
@@ -239,7 +239,7 @@ ghb_compositor_set_child_property(
}
-static void
+static void
ghb_compositor_get_child_property(
GtkContainer *container,
GtkWidget *child,
@@ -345,13 +345,13 @@ find_drawables(GtkWidget *widget, gpointer data)
* Insert in the given position of the zlist in the compositor.
* All children in the zlist must have associated GdkDrawable's
* This means they must be GtkDrawingArea or GtkEventBox
- *
+ *
**/
void
ghb_compositor_zlist_insert (
GhbCompositor *compositor,
- GtkWidget *child,
- gint z_pos,
+ GtkWidget *child,
+ gint z_pos,
gdouble opacity)
{
GhbCompositorChild *cc;
@@ -529,7 +529,7 @@ ghb_compositor_realize (GtkWidget *widget)
gtk_widget_style_attach(widget);
if (visible_window)
- gtk_style_set_background(widget->style, window,
+ gtk_style_set_background(widget->style, window,
GTK_STATE_NORMAL);
#endif
}
@@ -635,9 +635,9 @@ ghb_compositor_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
if (!gtk_widget_get_has_window(widget))
{
- child_allocation.x = allocation->x +
+ child_allocation.x = allocation->x +
gtk_container_get_border_width(GTK_CONTAINER(widget));
- child_allocation.y = allocation->y +
+ child_allocation.y = allocation->y +
gtk_container_get_border_width(GTK_CONTAINER(widget));
}
else
@@ -646,9 +646,9 @@ ghb_compositor_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
child_allocation.y = 0;
}
- child_allocation.width = MAX (allocation->width -
+ child_allocation.width = MAX (allocation->width -
gtk_container_get_border_width(GTK_CONTAINER (widget)) * 2, 0);
- child_allocation.height = MAX (allocation->height -
+ child_allocation.height = MAX (allocation->height -
gtk_container_get_border_width(GTK_CONTAINER (widget)) * 2, 0);
if (gtk_widget_get_realized(widget))
@@ -712,7 +712,7 @@ ghb_compositor_blend (GtkWidget *widget, cairo_t *cr)
if (
//!gtk_cairo_should_draw_window(cr, gtk_widget_get_window(child)) ||
- !gtk_widget_get_visible(cc->widget) ||
+ !gtk_widget_get_visible(cc->widget) ||
!gtk_widget_get_visible(child))
continue;
@@ -776,7 +776,7 @@ ghb_compositor_blend (GtkWidget *widget, GdkEventExpose *event)
{
/* get our child */
child = GTK_WIDGET(draw->data);
- if (!gtk_widget_get_visible(cc->widget) ||
+ if (!gtk_widget_get_visible(cc->widget) ||
!gtk_widget_get_visible(child))
continue;
diff --git a/gtk/src/ghbcompositor.h b/gtk/src/ghbcompositor.h
index 19d7fd6e5..7f6914e93 100644
--- a/gtk/src/ghbcompositor.h
+++ b/gtk/src/ghbcompositor.h
@@ -66,7 +66,7 @@ struct _GhbCompositorChild
GType ghb_compositor_get_type (void) G_GNUC_CONST;
GtkWidget* ghb_compositor_new (void);
void ghb_compositor_zlist_insert (GhbCompositor *compositor,
- GtkWidget *child,
+ GtkWidget *child,
gint z_pos, gdouble opacity);
G_END_DECLS
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c
index c857884e4..8244e9b2c 100644
--- a/gtk/src/hb-backend.c
+++ b/gtk/src/hb-backend.c
@@ -11,12 +11,12 @@
* 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.
- *
+ *
* This program 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 Library General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
@@ -55,7 +55,7 @@ typedef struct
static gchar **index_str = NULL;
static gint index_str_size = 0;
-static void
+static void
index_str_init(gint max_index)
{
gint ii;
@@ -470,7 +470,7 @@ typedef struct iso639_lang_t
#endif
const iso639_lang_t ghb_language_table[] =
-{
+{
{ "Any", "", "zz", "und" },
{ "Afar", "", "aa", "aar" },
{ "Abkhazian", "", "ab", "abk" },
@@ -698,8 +698,8 @@ ghb_version()
void
ghb_vquality_range(
- signal_user_data_t *ud,
- gdouble *min,
+ signal_user_data_t *ud,
+ gdouble *min,
gdouble *max,
gdouble *step,
gdouble *page,
@@ -715,7 +715,7 @@ ghb_vquality_range(
{
*min = 0;
*max = 51;
- *step = ghb_settings_combo_double(ud->settings,
+ *step = ghb_settings_combo_double(ud->prefs,
"VideoQualityGranularity");
if (*step == 0.2 || *step == 0.5)
*digits = 1;
@@ -1425,7 +1425,7 @@ ghb_subtitle_track_source(GValue *settings, gint track)
hb_title_t * title;
hb_subtitle_t * sub;
-
+
if (h_scan == NULL) return VOBSUB;
title = ghb_get_title_info( titleindex );
if (title == NULL) return VOBSUB; // Bad titleindex
@@ -1466,7 +1466,7 @@ gint
ghb_get_title_number(gint titleindex)
{
hb_title_t * title;
-
+
title = ghb_get_title_info( titleindex );
if (title == NULL) return 1; // Bad titleindex
return title->index;
@@ -1478,7 +1478,7 @@ get_hb_audio(hb_handle_t *h, gint titleindex, gint track)
hb_list_t * list;
hb_title_t * title;
hb_audio_config_t *audio = NULL;
-
+
if (h == NULL) return NULL;
list = hb_get_titles( h );
if( !hb_list_count( list ) )
@@ -1516,12 +1516,12 @@ grey_combo_box_item(GtkComboBox *combo, gint value, gboolean grey)
{
GtkListStore *store;
GtkTreeIter iter;
-
+
store = GTK_LIST_STORE(gtk_combo_box_get_model (combo));
if (find_combo_item_by_int(GTK_TREE_MODEL(store), value, &iter))
{
- gtk_list_store_set(store, &iter,
- 1, !grey,
+ gtk_list_store_set(store, &iter,
+ 1, !grey,
-1);
}
}
@@ -1591,14 +1591,14 @@ ghb_grey_combo_options(signal_user_data_t *ud)
{
if (!(mux & enc->muxers))
{
- grey_builder_combo_box_item(ud->builder, "AudioEncoder",
+ grey_builder_combo_box_item(ud->builder, "AudioEncoder",
enc->codec, TRUE);
grey_builder_combo_box_item(ud->builder, "AudioEncoderFallback",
enc->codec, TRUE);
}
else
{
- grey_builder_combo_box_item(ud->builder, "AudioEncoder",
+ grey_builder_combo_box_item(ud->builder, "AudioEncoder",
enc->codec, FALSE);
grey_builder_combo_box_item(ud->builder, "AudioEncoderFallback",
enc->codec, FALSE);
@@ -1609,12 +1609,12 @@ ghb_grey_combo_options(signal_user_data_t *ud)
{
if (!(mux & enc->muxers))
{
- grey_builder_combo_box_item(ud->builder, "VideoEncoder",
+ grey_builder_combo_box_item(ud->builder, "VideoEncoder",
enc->codec, TRUE);
}
else
{
- grey_builder_combo_box_item(ud->builder, "VideoEncoder",
+ grey_builder_combo_box_item(ud->builder, "VideoEncoder",
enc->codec, FALSE);
}
}
@@ -1660,7 +1660,7 @@ ghb_get_best_mix(hb_audio_config_t *aconfig, gint acodec, gint mix)
if (mix == HB_AMIXDOWN_NONE)
mix = HB_INVALID_AMIXDOWN;
-
+
return hb_mixdown_get_best( acodec, layout, mix );
}
@@ -1681,7 +1681,7 @@ ghb_init_combo_box(GtkComboBox *combo)
// 3 - String that is used for presets
// 4 - Int value determined by backend
// 5 - String value determined by backend
- store = gtk_list_store_new(5, G_TYPE_STRING, G_TYPE_BOOLEAN,
+ store = gtk_list_store_new(5, G_TYPE_STRING, G_TYPE_BOOLEAN,
G_TYPE_STRING, G_TYPE_DOUBLE, G_TYPE_STRING);
gtk_combo_box_set_model(combo, GTK_TREE_MODEL(store));
@@ -1697,7 +1697,7 @@ ghb_init_combo_box(GtkComboBox *combo)
{ // Combo box entry
gtk_combo_box_set_entry_text_column(GTK_COMBO_BOX(combo), 0);
}
-}
+}
// Set up the model for the combo box
static void
@@ -1709,7 +1709,7 @@ init_combo_box(GtkBuilder *builder, const gchar *name)
// First modify the combobox model to allow greying out of options
combo = GTK_COMBO_BOX(GHB_WIDGET(builder, name));
ghb_init_combo_box(combo);
-}
+}
void
ghb_audio_samplerate_opts_set(GtkComboBox *combo)
@@ -1717,19 +1717,19 @@ ghb_audio_samplerate_opts_set(GtkComboBox *combo)
GtkTreeIter iter;
GtkListStore *store;
gchar *str;
-
+
g_debug("audio_samplerate_opts_set ()\n");
store = GTK_LIST_STORE(gtk_combo_box_get_model (combo));
gtk_list_store_clear(store);
// Add an item for "Same As Source"
gtk_list_store_append(store, &iter);
str = g_strdup_printf("<small>%s</small>", _("Same as source"));
- gtk_list_store_set(store, &iter,
+ gtk_list_store_set(store, &iter,
0, str,
- 1, TRUE,
- 2, "source",
- 3, 0.0,
- 4, "source",
+ 1, TRUE,
+ 2, "source",
+ 3, 0.0,
+ 4, "source",
-1);
g_free(str);
@@ -1739,11 +1739,11 @@ ghb_audio_samplerate_opts_set(GtkComboBox *combo)
{
gtk_list_store_append(store, &iter);
str = g_strdup_printf("<small>%s</small>", rate->name);
- gtk_list_store_set(store, &iter,
+ gtk_list_store_set(store, &iter,
0, str,
- 1, TRUE,
- 2, rate->name,
- 3, (gdouble)rate->rate,
+ 1, TRUE,
+ 2, rate->name,
+ 3, (gdouble)rate->rate,
4, rate->name,
-1);
g_free(str);
@@ -1763,19 +1763,19 @@ video_framerate_opts_set(GtkBuilder *builder, const gchar *name)
{
GtkTreeIter iter;
GtkListStore *store;
-
+
g_debug("video_framerate_opts_set ()\n");
GtkComboBox *combo = GTK_COMBO_BOX(GHB_WIDGET(builder, name));
store = GTK_LIST_STORE(gtk_combo_box_get_model (combo));
gtk_list_store_clear(store);
// Add an item for "Same As Source"
gtk_list_store_append(store, &iter);
- gtk_list_store_set(store, &iter,
- 0, _("Same as source"),
- 1, TRUE,
- 2, "source",
- 3, 0.0,
- 4, "source",
+ gtk_list_store_set(store, &iter,
+ 0, _("Same as source"),
+ 1, TRUE,
+ 2, "source",
+ 3, 0.0,
+ 4, "source",
-1);
const hb_rate_t *rate;
@@ -1798,12 +1798,12 @@ video_framerate_opts_set(GtkBuilder *builder, const gchar *name)
}
option = g_strdup_printf ("%s %s", rate->name, desc);
gtk_list_store_append(store, &iter);
- gtk_list_store_set(store, &iter,
- 0, option,
- 1, TRUE,
- 2, rate->name,
- 3, (gdouble)rate->rate,
- 4, rate->name,
+ gtk_list_store_set(store, &iter,
+ 0, option,
+ 1, TRUE,
+ 2, rate->name,
+ 3, (gdouble)rate->rate,
+ 4, rate->name,
-1);
g_free(option);
}
@@ -1817,7 +1817,7 @@ video_encoder_opts_set(
GtkTreeIter iter;
GtkListStore *store;
gchar *str;
-
+
g_debug("video_encoder_opts_set ()\n");
GtkComboBox *combo = GTK_COMBO_BOX(GHB_WIDGET(builder, name));
store = GTK_LIST_STORE(gtk_combo_box_get_model (combo));
@@ -1829,12 +1829,12 @@ video_encoder_opts_set(
{
gtk_list_store_append(store, &iter);
str = g_strdup_printf("<small>%s</small>", enc->name);
- gtk_list_store_set(store, &iter,
+ gtk_list_store_set(store, &iter,
0, str,
- 1, TRUE,
- 2, enc->short_name,
+ 1, TRUE,
+ 2, enc->short_name,
3, (gdouble)enc->codec,
- 4, enc->short_name,
+ 4, enc->short_name,
-1);
g_free(str);
}
@@ -1849,7 +1849,7 @@ ghb_audio_encoder_opts_set_with_mask(
GtkTreeIter iter;
GtkListStore *store;
gchar *str;
-
+
g_debug("ghb_audio_encoder_opts_set_with_mask()\n");
store = GTK_LIST_STORE(gtk_combo_box_get_model (combo));
gtk_list_store_clear(store);
@@ -1862,12 +1862,12 @@ ghb_audio_encoder_opts_set_with_mask(
{
gtk_list_store_append(store, &iter);
str = g_strdup_printf("<small>%s</small>", enc->name);
- gtk_list_store_set(store, &iter,
+ gtk_list_store_set(store, &iter,
0, str,
- 1, TRUE,
- 2, enc->short_name,
+ 1, TRUE,
+ 2, enc->short_name,
3, (gdouble)enc->codec,
- 4, enc->short_name,
+ 4, enc->short_name,
-1);
g_free(str);
}
@@ -1900,7 +1900,7 @@ audio_encoder_opts_set(
GtkTreeIter iter;
GtkListStore *store;
gchar *str;
-
+
GtkComboBox *combo = GTK_COMBO_BOX(GHB_WIDGET(builder, name));
store = GTK_LIST_STORE(gtk_combo_box_get_model (combo));
gtk_list_store_clear(store);
@@ -1913,12 +1913,12 @@ audio_encoder_opts_set(
{
gtk_list_store_append(store, &iter);
str = g_strdup_printf("<small>%s</small>", enc->name);
- gtk_list_store_set(store, &iter,
+ gtk_list_store_set(store, &iter,
0, str,
- 1, TRUE,
- 2, enc->short_name,
+ 1, TRUE,
+ 2, enc->short_name,
3, (gdouble)enc->codec,
- 4, enc->short_name,
+ 4, enc->short_name,
-1);
g_free(str);
}
@@ -1937,7 +1937,7 @@ ghb_mix_opts_set(GtkComboBox *combo)
GtkTreeIter iter;
GtkListStore *store;
gchar *str;
-
+
g_debug("mix_opts_set ()\n");
store = GTK_LIST_STORE(gtk_combo_box_get_model (combo));
gtk_list_store_clear(store);
@@ -1948,12 +1948,12 @@ ghb_mix_opts_set(GtkComboBox *combo)
{
gtk_list_store_append(store, &iter);
str = g_strdup_printf("<small>%s</small>", mix->name);
- gtk_list_store_set(store, &iter,
+ gtk_list_store_set(store, &iter,
0, str,
- 1, TRUE,
- 2, mix->short_name,
- 3, (gdouble)mix->amixdown,
- 4, mix->short_name,
+ 1, TRUE,
+ 2, mix->short_name,
+ 3, (gdouble)mix->amixdown,
+ 4, mix->short_name,
-1);
g_free(str);
}
@@ -1975,7 +1975,7 @@ container_opts_set(
GtkTreeIter iter;
GtkListStore *store;
gchar *str;
-
+
g_debug("hb_container_opts_set ()\n");
GtkComboBox *combo = GTK_COMBO_BOX(GHB_WIDGET(builder, name));
store = GTK_LIST_STORE(gtk_combo_box_get_model (combo));
@@ -1987,12 +1987,12 @@ container_opts_set(
{
gtk_list_store_append(store, &iter);
str = g_strdup_printf("<small>%s</small>", mux->name);
- gtk_list_store_set(store, &iter,
+ gtk_list_store_set(store, &iter,
0, str,
- 1, TRUE,
- 2, mux->short_name,
+ 1, TRUE,
+ 2, mux->short_name,
3, (gdouble)mux->format,
- 4, mux->short_name,
+ 4, mux->short_name,
-1);
g_free(str);
}
@@ -2004,7 +2004,7 @@ srt_codeset_opts_set(GtkBuilder *builder, const gchar *name)
GtkTreeIter iter;
GtkListStore *store;
gint ii;
-
+
g_debug("srt_codeset_opts_set ()\n");
GtkComboBox *combo = GTK_COMBO_BOX(GHB_WIDGET(builder, name));
store = GTK_LIST_STORE(gtk_combo_box_get_model (combo));
@@ -2012,11 +2012,11 @@ srt_codeset_opts_set(GtkBuilder *builder, const gchar *name)
for (ii = 0; ii < SRT_TABLE_SIZE; ii++)
{
gtk_list_store_append(store, &iter);
- gtk_list_store_set(store, &iter,
+ gtk_list_store_set(store, &iter,
0, srt_codeset_table[ii],
- 1, TRUE,
+ 1, TRUE,
2, srt_codeset_table[ii],
- 3, (gdouble)ii,
+ 3, (gdouble)ii,
4, srt_codeset_table[ii],
-1);
}
@@ -2028,7 +2028,7 @@ language_opts_set(GtkBuilder *builder, const gchar *name)
GtkTreeIter iter;
GtkListStore *store;
gint ii;
-
+
g_debug("language_opts_set ()\n");
GtkComboBox *combo = GTK_COMBO_BOX(GHB_WIDGET(builder, name));
store = GTK_LIST_STORE(gtk_combo_box_get_model (combo));
@@ -2041,14 +2041,14 @@ language_opts_set(GtkBuilder *builder, const gchar *name)
lang = ghb_language_table[ii].native_name;
else
lang = ghb_language_table[ii].eng_name;
-
+
gtk_list_store_append(store, &iter);
- gtk_list_store_set(store, &iter,
+ gtk_list_store_set(store, &iter,
0, lang,
- 1, TRUE,
- 2, ghb_language_table[ii].iso639_2,
- 3, (gdouble)ii,
- 4, ghb_language_table[ii].iso639_1,
+ 1, TRUE,
+ 2, ghb_language_table[ii].iso639_2,
+ 3, (gdouble)ii,
+ 4, ghb_language_table[ii].iso639_1,
-1);
}
}
@@ -2064,7 +2064,7 @@ title_opts_set(GtkBuilder *builder, const gchar *name)
hb_title_t * title = NULL;
gint ii;
gint count = 0;
-
+
g_debug("title_opts_set ()\n");
GtkComboBox *combo = GTK_COMBO_BOX(GHB_WIDGET(builder, name));
store = GTK_LIST_STORE(gtk_combo_box_get_model (combo));
@@ -2092,12 +2092,12 @@ title_opts_set(GtkBuilder *builder, const gchar *name)
{
// No titles. Fill in a default.
gtk_list_store_append(store, &iter);
- gtk_list_store_set(store, &iter,
- 0, _("No Titles"),
- 1, TRUE,
- 2, "none",
- 3, -1.0,
- 4, "none",
+ gtk_list_store_set(store, &iter,
+ 0, _("No Titles"),
+ 1, TRUE,
+ 2, "none",
+ 3, -1.0,
+ 4, "none",
-1);
title_opts.map[0].option = "No Titles";
title_opts.map[0].shortOpt = "none";
@@ -2114,7 +2114,7 @@ title_opts_set(GtkBuilder *builder, const gchar *name)
{
char *tmp;
tmp = g_strdup_printf ("%d - %02dh%02dm%02ds - %s",
- title->index, title->hours, title->minutes, title->seconds,
+ title->index, title->hours, title->minutes, title->seconds,
title->name);
titles[ii] = g_markup_escape_text(tmp, -1);
g_free(tmp);
@@ -2122,7 +2122,7 @@ title_opts_set(GtkBuilder *builder, const gchar *name)
else
{
char *tmp;
- tmp = g_strdup_printf ("%d - %s",
+ tmp = g_strdup_printf ("%d - %s",
title->index, title->name);
titles[ii] = g_markup_escape_text(tmp, -1);
g_free(tmp);
@@ -2133,7 +2133,7 @@ title_opts_set(GtkBuilder *builder, const gchar *name)
if (title->duration != 0)
{
titles[ii] = g_strdup_printf("%d (%05d.MPLS) - %02dh%02dm%02ds",
- title->index, title->playlist, title->hours,
+ title->index, title->playlist, title->hours,
title->minutes, title->seconds);
}
else
@@ -2156,12 +2156,12 @@ title_opts_set(GtkBuilder *builder, const gchar *name)
}
}
gtk_list_store_append(store, &iter);
- gtk_list_store_set(store, &iter,
- 0, titles[ii],
- 1, TRUE,
- 2, titles[ii],
- 3, (gdouble)ii,
- 4, titles[ii],
+ gtk_list_store_set(store, &iter,
+ 0, titles[ii],
+ 1, TRUE,
+ 2, titles[ii],
+ 3, (gdouble)ii,
+ 4, titles[ii],
-1);
title_opts.map[ii].option = titles[ii];
title_opts.map[ii].shortOpt = titles[ii];
@@ -2188,11 +2188,11 @@ x264_tune_opts_set(GtkBuilder *builder, const gchar *name)
gtk_list_store_clear(store);
gtk_list_store_append(store, &iter);
- gtk_list_store_set(store, &iter,
+ gtk_list_store_set(store, &iter,
0, _("None"),
- 1, TRUE,
+ 1, TRUE,
2, "none",
- 3, (gdouble)0,
+ 3, (gdouble)0,
4, "none",
-1);
@@ -2201,9 +2201,9 @@ x264_tune_opts_set(GtkBuilder *builder, const gchar *name)
if (strcmp(tunes[ii], "fastdecode") && strcmp(tunes[ii], "zerolatency"))
{
gtk_list_store_append(store, &iter);
- gtk_list_store_set(store, &iter,
+ gtk_list_store_set(store, &iter,
0, tunes[ii],
- 1, TRUE,
+ 1, TRUE,
2, tunes[ii],
3, (gdouble)ii + 1,
4, tunes[ii],
@@ -2231,9 +2231,9 @@ h264_profile_opts_set(GtkBuilder *builder, const gchar *name)
for (ii = 0; ii < count; ii++)
{
gtk_list_store_append(store, &iter);
- gtk_list_store_set(store, &iter,
+ gtk_list_store_set(store, &iter,
0, profiles[ii],
- 1, TRUE,
+ 1, TRUE,
2, profiles[ii],
3, (gdouble)ii,
4, profiles[ii],
@@ -2260,9 +2260,9 @@ h264_level_opts_set(GtkBuilder *builder, const gchar *name)
for (ii = 0; ii < count; ii++)
{
gtk_list_store_append(store, &iter);
- gtk_list_store_set(store, &iter,
+ gtk_list_store_set(store, &iter,
0, levels[ii],
- 1, TRUE,
+ 1, TRUE,
2, levels[ii],
3, (gdouble)ii,
4, levels[ii],
@@ -2281,7 +2281,7 @@ find_combo_item_by_int(GtkTreeModel *store, gint value, GtkTreeIter *iter)
{
gdouble ivalue;
gboolean foundit = FALSE;
-
+
if (gtk_tree_model_get_iter_first (store, iter))
{
do
@@ -2307,7 +2307,7 @@ audio_track_opts_set(GtkBuilder *builder, const gchar *name, gint titleindex)
gint ii;
gint count = 0;
gchar *str;
-
+
g_debug("audio_track_opts_set ()\n");
GtkComboBox *combo = GTK_COMBO_BOX(GHB_WIDGET(builder, name));
store = GTK_LIST_STORE(gtk_combo_box_get_model (combo));
@@ -2342,12 +2342,12 @@ audio_track_opts_set(GtkBuilder *builder, const gchar *name, gint titleindex)
// No audio. set some default
gtk_list_store_append(store, &iter);
str = g_strdup_printf("<small>%s</small>", _("No Audio"));
- gtk_list_store_set(store, &iter,
+ gtk_list_store_set(store, &iter,
0, str,
- 1, TRUE,
- 2, "none",
- 3, -1.0,
- 4, "none",
+ 1, TRUE,
+ 2, "none",
+ 3, -1.0,
+ 4, "none",
-1);
g_free(str);
audio_track_opts.map[0].option = g_strdup("No Audio");
@@ -2363,12 +2363,12 @@ audio_track_opts_set(GtkBuilder *builder, const gchar *name, gint titleindex)
gtk_list_store_append(store, &iter);
char *tmp = g_strdup_printf("%d - %s", ii + 1, audio->lang.description);
str = g_strdup_printf("<small>%s</small>", tmp);
- gtk_list_store_set(store, &iter,
+ gtk_list_store_set(store, &iter,
0, str,
- 1, TRUE,
- 2, index_str[ii],
- 3, (gdouble)ii,
- 4, index_str[ii],
+ 1, TRUE,
+ 2, index_str[ii],
+ 3, (gdouble)ii,
+ 4, index_str[ii],
-1);
g_free(str);
audio_track_opts.map[ii].option = g_strdup(tmp);
@@ -2386,7 +2386,7 @@ ghb_audio_track_description(gint track, int titleindex)
hb_title_t * title = NULL;
hb_audio_config_t * audio;
gchar * desc = "Unknown";
-
+
g_debug("ghb_audio_track_description ()\n");
title = ghb_get_title_info( titleindex );
@@ -2407,7 +2407,7 @@ subtitle_track_opts_set(GtkBuilder *builder, const gchar *name, gint titleindex)
hb_subtitle_t * subtitle;
gint ii, count = 0;
static char ** options = NULL;
-
+
g_debug("subtitle_track_opts_set ()\n");
GtkComboBox *combo = GTK_COMBO_BOX(GHB_WIDGET(builder, name));
store = GTK_LIST_STORE(gtk_combo_box_get_model (combo));
@@ -2425,12 +2425,12 @@ subtitle_track_opts_set(GtkBuilder *builder, const gchar *name, gint titleindex)
if (count > 0)
{
gtk_list_store_append(store, &iter);
- gtk_list_store_set(store, &iter,
- 0, _("Foreign Audio Search"),
- 1, TRUE,
- 2, "-1",
- 3, -1.0,
- 4, "auto",
+ gtk_list_store_set(store, &iter,
+ 0, _("Foreign Audio Search"),
+ 1, TRUE,
+ 2, "-1",
+ 3, -1.0,
+ 4, "auto",
-1);
subtitle_opts.map[0].option = "Foreign Audio Search";
subtitle_opts.map[0].shortOpt = "-1";
@@ -2444,20 +2444,20 @@ subtitle_track_opts_set(GtkBuilder *builder, const gchar *name, gint titleindex)
for (ii = 0; ii < count; ii++)
{
subtitle = (hb_subtitle_t *)hb_list_item(title->list_subtitle, ii);
- options[ii] = g_strdup_printf("%d - %s (%s)", ii+1,
- subtitle->lang,
+ options[ii] = g_strdup_printf("%d - %s (%s)", ii+1,
+ subtitle->lang,
hb_subsource_name(subtitle->source));
subtitle_opts.map[ii+1].option = options[ii];
subtitle_opts.map[ii+1].shortOpt = index_str[ii];
subtitle_opts.map[ii+1].ivalue = ii;
subtitle_opts.map[ii+1].svalue = subtitle->iso639_2;
gtk_list_store_append(store, &iter);
- gtk_list_store_set(store, &iter,
- 0, options[ii],
- 1, TRUE,
- 2, index_str[ii],
- 3, (gdouble)ii,
- 4, subtitle->iso639_2,
+ gtk_list_store_set(store, &iter,
+ 0, options[ii],
+ 1, TRUE,
+ 2, index_str[ii],
+ 3, (gdouble)ii,
+ 4, subtitle->iso639_2,
-1);
}
options[count] = NULL;
@@ -2465,12 +2465,12 @@ subtitle_track_opts_set(GtkBuilder *builder, const gchar *name, gint titleindex)
else
{
gtk_list_store_append(store, &iter);
- gtk_list_store_set(store, &iter,
- 0, _("None"),
- 1, TRUE,
- 2, "0",
- 3, 0.0,
- 4, "none",
+ gtk_list_store_set(store, &iter,
+ 0, _("None"),
+ 1, TRUE,
+ 2, "0",
+ 3, 0.0,
+ 4, "none",
-1);
subtitle_opts.map[0].option = "None";
subtitle_opts.map[0].shortOpt = "0";
@@ -2488,7 +2488,7 @@ ghb_longest_title()
gint ii;
gint count = 0;
gint feature;
-
+
g_debug("ghb_longest_title ()\n");
if (h_scan == NULL) return 0;
title_set = hb_get_title_set( h_scan );
@@ -2512,7 +2512,7 @@ ghb_get_source_audio_lang(hb_title_t *title, gint track)
{
hb_audio_config_t * audio;
const gchar *lang = "und";
-
+
g_debug("ghb_lookup_1st_audio_lang ()\n");
if (title == NULL)
return lang;
@@ -2591,7 +2591,7 @@ generic_opts_set(GtkBuilder *builder, const gchar *name, combo_opts_t *opts)
GtkTreeIter iter;
GtkListStore *store;
gint ii;
-
+
g_debug("generic_opts_set ()\n");
if (name == NULL || opts == NULL) return;
GtkComboBox *combo = GTK_COMBO_BOX(GHB_WIDGET(builder, name));
@@ -2600,12 +2600,12 @@ generic_opts_set(GtkBuilder *builder, const gchar *name, combo_opts_t *opts)
for (ii = 0; ii < opts->count; ii++)
{
gtk_list_store_append(store, &iter);
- gtk_list_store_set(store, &iter,
- 0, gettext(opts->map[ii].option),
- 1, TRUE,
- 2, opts->map[ii].shortOpt,
- 3, opts->map[ii].ivalue,
- 4, opts->map[ii].svalue,
+ gtk_list_store_set(store, &iter,
+ 0, gettext(opts->map[ii].option),
+ 1, TRUE,
+ 2, opts->map[ii].shortOpt,
+ 3, opts->map[ii].ivalue,
+ 4, opts->map[ii].svalue,
-1);
}
}
@@ -2617,7 +2617,7 @@ small_opts_set(GtkBuilder *builder, const gchar *name, combo_opts_t *opts)
GtkListStore *store;
gint ii;
gchar *str;
-
+
g_debug("small_opts_set ()\n");
if (name == NULL || opts == NULL) return;
GtkComboBox *combo = GTK_COMBO_BOX(GHB_WIDGET(builder, name));
@@ -2628,12 +2628,12 @@ small_opts_set(GtkBuilder *builder, const gchar *name, combo_opts_t *opts)
gtk_list_store_append(store, &iter);
str = g_strdup_printf("<small>%s</small>",
gettext(opts->map[ii].option));
- gtk_list_store_set(store, &iter,
+ gtk_list_store_set(store, &iter,
0, str,
- 1, TRUE,
- 2, opts->map[ii].shortOpt,
- 3, opts->map[ii].ivalue,
- 4, opts->map[ii].svalue,
+ 1, TRUE,
+ 2, opts->map[ii].shortOpt,
+ 3, opts->map[ii].ivalue,
+ 4, opts->map[ii].svalue,
-1);
g_free(str);
}
@@ -2851,9 +2851,9 @@ void ghb_init_lang_list_box(GtkListBox *list_box)
void
ghb_update_ui_combo_box(
- signal_user_data_t *ud,
- const gchar *name,
- gint user_data,
+ signal_user_data_t *ud,
+ const gchar *name,
+ gint user_data,
gboolean all)
{
GtkComboBox *combo = NULL;
@@ -2861,7 +2861,7 @@ ghb_update_ui_combo_box(
gint handler_id = 0;
if (name != NULL)
- {
+ {
g_debug("ghb_update_ui_combo_box() %s\n", name);
// Clearing a combo box causes a rash of "changed" events, even when
// the active item is -1 (inactive). To control things, I'm disabling
@@ -2871,7 +2871,7 @@ ghb_update_ui_combo_box(
if (signal_id > 0)
{
// Valid signal id found. This should always succeed.
- handler_id = g_signal_handler_find ((gpointer)combo, G_SIGNAL_MATCH_ID,
+ handler_id = g_signal_handler_find ((gpointer)combo, G_SIGNAL_MATCH_ID,
signal_id, 0, 0, 0, 0);
if (handler_id > 0)
{
@@ -2879,7 +2879,7 @@ ghb_update_ui_combo_box(
g_signal_handler_block ((gpointer)combo, handler_id);
}
}
- }
+ }
if (all)
{
audio_bitrate_opts_set(ud->builder, "AudioBitrate");
@@ -2963,7 +2963,7 @@ ghb_update_ui_combo_box(
g_signal_handler_unblock ((gpointer)combo, handler_id);
}
}
-
+
static void
init_ui_combo_boxes(GtkBuilder *builder)
{
@@ -3119,7 +3119,7 @@ ghb_part_duration(gint tt, gint sc, gint ec, gint *hh, gint *mm, gint *ss)
hb_chapter_t * chapter;
gint count, c;
gint64 duration;
-
+
*hh = *mm = *ss = 0;
title = ghb_get_title_info( tt );
if (title == NULL) return;
@@ -3147,22 +3147,42 @@ ghb_part_duration(gint tt, gint sc, gint ec, gint *hh, gint *mm, gint *ss)
*ss = (duration / 90000) % 60;
}
-void
-ghb_get_chapter_duration(gint ti, gint ii, gint64 *duration)
+gint64
+ghb_get_chapter_duration(gint ti, gint chap)
{
hb_title_t * title;
hb_chapter_t * chapter;
gint count;
-
+
g_debug("ghb_get_chapter_duration (title = %d)\n", ti);
- *duration = 0;
title = ghb_get_title_info( ti );
- if (title == NULL) return;
+ if (title == NULL) return 0;
count = hb_list_count( title->list_chapter );
- if (ii >= count) return;
- chapter = hb_list_item(title->list_chapter, ii);
- if (chapter == NULL) return;
- *duration = chapter->duration;
+ if (chap >= count) return 0;
+ chapter = hb_list_item(title->list_chapter, chap);
+ if (chapter == NULL) return 0;
+ return chapter->duration;
+}
+
+gint64
+ghb_get_chapter_start(gint ti, gint chap)
+{
+ hb_title_t * title;
+ hb_chapter_t * chapter;
+ gint count, ii;
+ gint64 start = 0;
+
+ g_debug("ghb_get_chapter_start (title = %d)\n", ti);
+ title = ghb_get_title_info( ti );
+ if (title == NULL) return 0;
+ count = hb_list_count( title->list_chapter );
+ if (chap > count) return chap = count;
+ for (ii = 0; ii < chap; ii++)
+ {
+ chapter = hb_list_item(title->list_chapter, ii);
+ start += chapter->duration;
+ }
+ return start;
}
GValue*
@@ -3172,7 +3192,7 @@ ghb_get_chapters(gint titleindex)
hb_chapter_t * chapter;
gint count, ii;
GValue *chapters = NULL;
-
+
g_debug("ghb_get_chapters (title = %d)\n", titleindex);
chapters = ghb_array_value_new(0);
@@ -3190,7 +3210,7 @@ ghb_get_chapters(gint titleindex)
ghb_array_append(chapters, ghb_string_value_new(str));
g_free(str);
}
- else
+ else
{
ghb_array_append(chapters, ghb_string_value_new(chapter->title));
}
@@ -3223,7 +3243,7 @@ audio_bitrate_opts_add(GtkBuilder *builder, const gchar *name, gint rate)
GtkTreeIter iter;
GtkListStore *store;
gchar *str;
-
+
g_debug("audio_bitrate_opts_add ()\n");
if (rate >= 0 && rate < 8) return;
@@ -3248,12 +3268,12 @@ audio_bitrate_opts_add(GtkBuilder *builder, const gchar *name, gint rate)
{
str = g_strdup_printf ("<small>%s</small>", ghb_custom_bitrate_str);
gtk_list_store_append(store, &iter);
- gtk_list_store_set(store, &iter,
- 0, str,
- 1, TRUE,
- 2, ghb_custom_bitrate_str,
- 3, (gdouble)rate,
- 4, ghb_custom_bitrate_str,
+ gtk_list_store_set(store, &iter,
+ 0, str,
+ 1, TRUE,
+ 2, ghb_custom_bitrate_str,
+ 3, (gdouble)rate,
+ 4, ghb_custom_bitrate_str,
-1);
g_free(str);
}
@@ -3262,14 +3282,14 @@ audio_bitrate_opts_add(GtkBuilder *builder, const gchar *name, gint rate)
void
ghb_audio_bitrate_opts_filter(
GtkComboBox *combo,
- gint first_rate,
+ gint first_rate,
gint last_rate)
{
GtkTreeIter iter;
GtkListStore *store;
gdouble ivalue;
gboolean done = FALSE;
-
+
g_debug("audio_bitrate_opts_filter ()\n");
store = GTK_LIST_STORE(gtk_combo_box_get_model (combo));
if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL(store), &iter))
@@ -3292,9 +3312,9 @@ ghb_audio_bitrate_opts_filter(
static void
audio_bitrate_opts_update(
- GtkBuilder *builder,
- const gchar *name,
- gint first_rate,
+ GtkBuilder *builder,
+ const gchar *name,
+ gint first_rate,
gint last_rate,
gint extra_rate)
{
@@ -3302,7 +3322,7 @@ audio_bitrate_opts_update(
GtkListStore *store;
gdouble ivalue;
gboolean done = FALSE;
-
+
g_debug("audio_bitrate_opts_clean ()\n");
GtkComboBox *combo = GTK_COMBO_BOX(GHB_WIDGET(builder, name));
ghb_audio_bitrate_opts_filter(combo, first_rate, last_rate);
@@ -3341,7 +3361,7 @@ ghb_audio_bitrate_opts_set(GtkComboBox *combo, gboolean extra)
GtkTreeIter iter;
GtkListStore *store;
gchar *str;
-
+
g_debug("audio_bitrate_opts_set ()\n");
store = GTK_LIST_STORE(gtk_combo_box_get_model (combo));
gtk_list_store_clear(store);
@@ -3352,12 +3372,12 @@ ghb_audio_bitrate_opts_set(GtkComboBox *combo, gboolean extra)
{
gtk_list_store_append(store, &iter);
str = g_strdup_printf ("<small>%s</small>", rate->name);
- gtk_list_store_set(store, &iter,
+ gtk_list_store_set(store, &iter,
0, str,
- 1, TRUE,
- 2, rate->name,
- 3, (gdouble)rate->rate,
- 4, rate->name,
+ 1, TRUE,
+ 2, rate->name,
+ 3, (gdouble)rate->rate,
+ 4, rate->name,
-1);
g_free(str);
}
@@ -3385,8 +3405,8 @@ audio_bitrate_opts_set(GtkBuilder *builder, const gchar *name)
void
ghb_set_bitrate_opts(
- GtkBuilder *builder,
- gint first_rate,
+ GtkBuilder *builder,
+ gint first_rate,
gint last_rate,
gint extra_rate)
{
@@ -3489,7 +3509,7 @@ ghb_get_status(ghb_status_t *status)
memcpy(status, &hb_status, sizeof(ghb_status_t));
}
-void
+void
ghb_track_status()
{
hb_state_t s_scan;
@@ -3536,7 +3556,7 @@ ghb_track_status()
case HB_STATE_PAUSED:
hb_status.scan.state |= GHB_STATE_PAUSED;
break;
-
+
case HB_STATE_MUXING:
{
hb_status.scan.state |= GHB_STATE_MUXING;
@@ -3568,7 +3588,7 @@ ghb_track_status()
// When a job is stopped, libhb removes it from the job list,
// but does not remove other jobs that may be associated with it.
// Associated jobs are taged in the sequence id.
- while ((job = hb_job(h_scan, 0)) != NULL)
+ while ((job = hb_job(h_scan, 0)) != NULL)
hb_rem( h_scan, job );
} break;
#undef p
@@ -3629,7 +3649,7 @@ ghb_track_status()
case HB_STATE_PAUSED:
hb_status.queue.state |= GHB_STATE_PAUSED;
break;
-
+
case HB_STATE_MUXING:
{
hb_status.queue.state |= GHB_STATE_MUXING;
@@ -3662,7 +3682,7 @@ ghb_track_status()
// When a job is stopped, libhb removes it from the job list,
// but does not remove other jobs that may be associated with it.
// Associated jobs are taged in the sequence id.
- while ((job = hb_job(h_queue, 0)) != NULL)
+ while ((job = hb_job(h_queue, 0)) != NULL)
hb_rem( h_queue, job );
} break;
#undef p
@@ -3680,11 +3700,18 @@ ghb_get_title_info(gint titleindex)
return hb_list_item( list, titleindex );
}
+hb_list_t *
+ghb_get_title_list()
+{
+ if (h_scan == NULL) return NULL;
+ return hb_get_titles( h_scan );
+}
+
hb_audio_config_t*
ghb_get_scan_audio_info(gint titleindex, gint audioindex)
{
hb_audio_config_t *aconfig;
-
+
aconfig = get_hb_audio(h_scan, titleindex, audioindex);
return aconfig;
}
@@ -3788,7 +3815,7 @@ ghb_set_scale_settings(GValue *settings, gint mode)
gint mod;
gint max_width = 0;
gint max_height = 0;
-
+
g_debug("ghb_set_scale ()\n");
pic_par = ghb_settings_combo_int(settings, "PicturePAR");
@@ -3870,8 +3897,8 @@ ghb_set_scale_settings(GValue *settings, gint mode)
ghb_settings_set_int(settings, "PictureLeftCrop", crop[2]);
ghb_settings_set_int(settings, "PictureRightCrop", crop[3]);
}
- hb_reduce(&aspect_n, &aspect_d,
- title->width * title->pixel_aspect_width,
+ hb_reduce(&aspect_n, &aspect_d,
+ title->width * title->pixel_aspect_width,
title->height * title->pixel_aspect_height);
crop_width = title->width - crop[2] - crop[3];
crop_height = title->height - crop[0] - crop[1];
@@ -3931,14 +3958,14 @@ ghb_set_scale_settings(GValue *settings, gint mode)
job->anamorphic.keep_display_aspect = 0;
if (mode & GHB_PIC_KEEP_PAR)
{
- job->anamorphic.par_width =
+ job->anamorphic.par_width =
ghb_settings_get_int(settings, "PicturePARWidth");
- job->anamorphic.par_height =
+ job->anamorphic.par_height =
ghb_settings_get_int(settings, "PicturePARHeight");
}
else
{
- job->anamorphic.dar_width =
+ job->anamorphic.dar_width =
ghb_settings_get_int(settings, "PictureDisplayWidth");
job->anamorphic.dar_height = height;
}
@@ -3948,10 +3975,10 @@ ghb_set_scale_settings(GValue *settings, gint mode)
job->anamorphic.keep_display_aspect = 1;
}
// hb_set_anamorphic_size will adjust par, dar, and width/height
- // to conform to job parameters that have been set, including
+ // to conform to job parameters that have been set, including
// maxWidth and maxHeight
hb_set_anamorphic_size(job, &width, &height, &par_width, &par_height);
- if (job->anamorphic.mode == 3 && !keep_aspect &&
+ if (job->anamorphic.mode == 3 && !keep_aspect &&
mode & GHB_PIC_KEEP_PAR)
{
// hb_set_anamorphic_size reduces the par, which we
@@ -3961,7 +3988,7 @@ ghb_set_scale_settings(GValue *settings, gint mode)
par_height = ghb_settings_get_int(settings, "PicturePARHeight");
}
}
- else
+ else
{
// Adjust dims according to max values
if (max_height) height = MIN(height, max_height);
@@ -3971,8 +3998,8 @@ ghb_set_scale_settings(GValue *settings, gint mode)
{
gdouble par;
gint new_width, new_height;
-
- // Compute pixel aspect ration.
+
+ // Compute pixel aspect ration.
par = (gdouble)(title->height * aspect_n) / (title->width * aspect_d);
// Must scale so that par becomes 1:1
// Try to keep largest dimension
@@ -4029,6 +4056,36 @@ ghb_set_scale_settings(GValue *settings, gint mode)
}
void
+ghb_update_display_aspect_label(signal_user_data_t *ud)
+{
+ gint disp_width, disp_height, dar_width, dar_height;
+ gchar *str;
+
+ disp_width = ghb_settings_get_int(ud->settings, "PictureDisplayWidth");
+ disp_height = ghb_settings_get_int(ud->settings, "PictureDisplayHeight");
+ hb_reduce(&dar_width, &dar_height, disp_width, disp_height);
+ gint iaspect = dar_width * 9 / dar_height;
+ if (dar_width > 2 * dar_height)
+ {
+ str = g_strdup_printf("%.2f : 1", (gdouble)dar_width / dar_height);
+ }
+ else if (iaspect <= 16 && iaspect >= 15)
+ {
+ str = g_strdup_printf("%.2f : 9", (gdouble)dar_width * 9 / dar_height);
+ }
+ else if (iaspect <= 12 && iaspect >= 11)
+ {
+ str = g_strdup_printf("%.2f : 3", (gdouble)dar_width * 3 / dar_height);
+ }
+ else
+ {
+ str = g_strdup_printf("%d : %d", dar_width, dar_height);
+ }
+ ghb_ui_update(ud, "display_aspect", ghb_string_value(str));
+ g_free(str);
+}
+
+void
ghb_set_scale(signal_user_data_t *ud, gint mode)
{
if (ud->scale_busy) return;
@@ -4072,53 +4129,29 @@ ghb_set_scale(signal_user_data_t *ud, gint mode)
gtk_spin_button_set_increments (GTK_SPIN_BUTTON(widget), 2, 16);
}
- ghb_ui_update_from_settings(ud->builder, "autoscale", ud->settings);
- ghb_ui_update_from_settings(ud->builder, "PictureModulus", ud->settings);
- ghb_ui_update_from_settings(ud->builder, "PictureLooseCrop", ud->settings);
- ghb_ui_update_from_settings(ud->builder, "PictureKeepRatio", ud->settings);
-
- ghb_ui_update_from_settings(ud->builder, "PictureTopCrop", ud->settings);
- ghb_ui_update_from_settings(ud->builder, "PictureBottomCrop", ud->settings);
- ghb_ui_update_from_settings(ud->builder, "PictureLeftCrop", ud->settings);
- ghb_ui_update_from_settings(ud->builder, "PictureRightCrop", ud->settings);
+ ghb_ui_update_from_settings(ud, "autoscale", ud->settings);
+ ghb_ui_update_from_settings(ud, "PictureModulus", ud->settings);
+ ghb_ui_update_from_settings(ud, "PictureLooseCrop", ud->settings);
+ ghb_ui_update_from_settings(ud, "PictureKeepRatio", ud->settings);
- ghb_ui_update_from_settings(ud->builder, "scale_width", ud->settings);
- ghb_ui_update_from_settings(ud->builder, "scale_height", ud->settings);
+ ghb_ui_update_from_settings(ud, "PictureTopCrop", ud->settings);
+ ghb_ui_update_from_settings(ud, "PictureBottomCrop", ud->settings);
+ ghb_ui_update_from_settings(ud, "PictureLeftCrop", ud->settings);
+ ghb_ui_update_from_settings(ud, "PictureRightCrop", ud->settings);
- ghb_ui_update_from_settings(ud->builder, "PicturePARWidth", ud->settings);
- ghb_ui_update_from_settings(ud->builder, "PicturePARHeight", ud->settings);
- ghb_ui_update_from_settings(ud->builder, "PictureDisplayWidth", ud->settings);
- ghb_ui_update_from_settings(ud->builder, "PictureDisplayHeight", ud->settings);
- gint disp_width, disp_height, dar_width, dar_height;
- gchar *str;
+ ghb_ui_update_from_settings(ud, "scale_width", ud->settings);
+ ghb_ui_update_from_settings(ud, "scale_height", ud->settings);
- disp_width = ghb_settings_get_int(ud->settings, "PictureDisplayWidth");
- disp_height = ghb_settings_get_int(ud->settings, "PictureDisplayHeight");
- hb_reduce(&dar_width, &dar_height, disp_width, disp_height);
- gint iaspect = dar_width * 9 / dar_height;
- if (dar_width > 2 * dar_height)
- {
- str = g_strdup_printf("%.2f : 1", (gdouble)dar_width / dar_height);
- }
- else if (iaspect <= 16 && iaspect >= 15)
- {
- str = g_strdup_printf("%.2f : 9", (gdouble)dar_width * 9 / dar_height);
- }
- else if (iaspect <= 12 && iaspect >= 11)
- {
- str = g_strdup_printf("%.2f : 3", (gdouble)dar_width * 3 / dar_height);
- }
- else
- {
- str = g_strdup_printf("%d : %d", dar_width, dar_height);
- }
- ghb_ui_update(ud, "display_aspect", ghb_string_value(str));
- g_free(str);
+ ghb_ui_update_from_settings(ud, "PicturePARWidth", ud->settings);
+ ghb_ui_update_from_settings(ud, "PicturePARHeight", ud->settings);
+ ghb_ui_update_from_settings(ud, "PictureDisplayWidth", ud->settings);
+ ghb_ui_update_from_settings(ud, "PictureDisplayHeight", ud->settings);
+ ghb_update_display_aspect_label(ud);
ud->scale_busy = FALSE;
}
static void
-set_preview_job_settings(hb_job_t *job, GValue *settings)
+set_preview_job_settings(signal_user_data_t *ud, hb_job_t *job, GValue *settings)
{
job->crop[0] = ghb_settings_get_int(settings, "PictureTopCrop");
job->crop[1] = ghb_settings_get_int(settings, "PictureBottomCrop");
@@ -4126,17 +4159,17 @@ set_preview_job_settings(hb_job_t *job, GValue *settings)
job->crop[3] = ghb_settings_get_int(settings, "PictureRightCrop");
job->anamorphic.mode = ghb_settings_combo_int(settings, "PicturePAR");
- job->modulus =
+ job->modulus =
ghb_settings_combo_int(settings, "PictureModulus");
job->width = ghb_settings_get_int(settings, "scale_width");
job->height = ghb_settings_get_int(settings, "scale_height");
- if (ghb_settings_get_boolean(settings, "preview_show_crop"))
+ if (ghb_settings_get_boolean(ud->prefs, "preview_show_crop"))
{
- gdouble xscale = (gdouble)job->width /
+ gdouble xscale = (gdouble)job->width /
(gdouble)(job->title->width - job->crop[2] - job->crop[3]);
- gdouble yscale = (gdouble)job->height /
+ gdouble yscale = (gdouble)job->height /
(gdouble)(job->title->height - job->crop[0] - job->crop[1]);
-
+
job->width += xscale * (job->crop[2] + job->crop[3]);
job->height += yscale * (job->crop[0] + job->crop[1]);
job->crop[0] = 0;
@@ -4170,9 +4203,9 @@ set_preview_job_settings(hb_job_t *job, GValue *settings)
if (job->anamorphic.mode == 3 && !keep_aspect)
{
job->anamorphic.keep_display_aspect = 0;
- job->anamorphic.par_width =
+ job->anamorphic.par_width =
ghb_settings_get_int(settings, "PicturePARWidth");
- job->anamorphic.par_height =
+ job->anamorphic.par_height =
ghb_settings_get_int(settings, "PicturePARHeight");
}
else
@@ -4373,7 +4406,7 @@ ghb_validate_subtitles(GValue *settings)
_("Srt file does not exist or not a regular file.\n\n"
"You should choose a valid file.\n"
"If you continue, this subtitle will be ignored."));
- if (!ghb_message_dialog(GTK_MESSAGE_WARNING, message,
+ if (!ghb_message_dialog(GTK_MESSAGE_WARNING, message,
_("Cancel"), _("Continue")))
{
g_free(message);
@@ -4425,7 +4458,7 @@ ghb_validate_audio(GValue *settings)
aconfig = (hb_audio_config_t *) hb_list_audio_config_item(
title->list_audio, track );
if ( ghb_audio_is_passthru(codec) &&
- !(ghb_audio_can_passthru(aconfig->in.codec) &&
+ !(ghb_audio_can_passthru(aconfig->in.codec) &&
(aconfig->in.codec & codec)))
{
// Not supported. AC3 is passthrough only, so input must be AC3
@@ -4458,7 +4491,7 @@ ghb_validate_audio(GValue *settings)
gchar *a_unsup = NULL;
gchar *mux_s = NULL;
if (mux & HB_MUX_MASK_MP4)
- {
+ {
mux_s = "MP4";
// mp4/vorbis|DTS combination is not supported.
if (codec == HB_ACODEC_VORBIS)
@@ -4519,7 +4552,6 @@ ghb_validate_vquality(GValue *settings)
gchar *message;
gint min, max;
- if (ghb_settings_get_boolean(settings, "nocheckvquality")) return TRUE;
vcodec = ghb_settings_combo_int(settings, "VideoEncoder");
gdouble vquality;
vquality = ghb_settings_get_double(settings, "VideoQualitySlider");
@@ -4560,7 +4592,7 @@ ghb_validate_vquality(GValue *settings)
"many players and editors.\n\n"
"It will produce enormous output files.\n\n"
"Are you sure you wish to use this setting?"));
- if (!ghb_message_dialog(GTK_MESSAGE_QUESTION, message,
+ if (!ghb_message_dialog(GTK_MESSAGE_QUESTION, message,
_("Cancel"), _("Continue")))
{
g_free(message);
@@ -4576,7 +4608,7 @@ ghb_validate_vquality(GValue *settings)
"Typical values range from %d to %d.\n\n"
"Are you sure you wish to use this setting?"),
(gint)vquality, min, max);
- if (!ghb_message_dialog(GTK_MESSAGE_QUESTION, message,
+ if (!ghb_message_dialog(GTK_MESSAGE_QUESTION, message,
_("Cancel"), _("Continue")))
{
g_free(message);
@@ -4598,6 +4630,7 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, gint titleindex)
hb_filter_object_t * filter;
gchar *filter_str;
gchar *dest_str = NULL;
+ GValue *prefs;
g_debug("add_job()\n");
if (h == NULL) return;
@@ -4615,12 +4648,13 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, gint titleindex)
job = hb_job_init( title );
if (job == NULL) return;
+ prefs = ghb_settings_get_value(js, "Preferences");
job->angle = ghb_settings_get_int(js, "angle");
job->start_at_preview = ghb_settings_get_int(js, "start_frame") + 1;
if (job->start_at_preview)
{
- job->seek_points = ghb_settings_get_int(js, "preview_count");
- job->pts_to_stop = ghb_settings_get_int(js, "live_duration") * 90000LL;
+ job->seek_points = ghb_settings_get_int(prefs, "preview_count");
+ job->pts_to_stop = ghb_settings_get_int(prefs, "live_duration") * 90000LL;
}
job->mux = ghb_settings_combo_int(js, "FileFormat");
@@ -4656,7 +4690,7 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, gint titleindex)
start = ghb_settings_get_int(js, "start_point");
end = ghb_settings_get_int(js, "end_point");
job->pts_to_start = (int64_t)MIN(duration-1, start) * 90000;
- job->pts_to_stop = (int64_t)MAX(start+1, end) * 90000 -
+ job->pts_to_stop = (int64_t)MAX(start+1, end) * 90000 -
job->pts_to_start;
}
if (ghb_settings_combo_int(js, "PtoPType") == 2)
@@ -4666,7 +4700,7 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, gint titleindex)
gint64 max_frames;
max_frames = (gint64)duration * title->rate / title->rate_base;
job->frame_to_start = (int64_t)MIN(max_frames-1, start-1);
- job->frame_to_stop = (int64_t)MAX(start, end-1) -
+ job->frame_to_stop = (int64_t)MAX(start, end-1) -
job->frame_to_start;
}
if (job->chapter_start != job->chapter_end)
@@ -4691,7 +4725,7 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, gint titleindex)
name = NULL;
chapter = ghb_array_get_nth(chapters, chap);
- name = ghb_value_string(chapter);
+ name = ghb_value_string(chapter);
if (name == NULL)
{
name = g_strdup_printf ("Chapter %2d", chap+1);
@@ -4702,7 +4736,7 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, gint titleindex)
}
}
}
-
+
gboolean decomb_deint = ghb_settings_get_boolean(js, "PictureDecombDeinterlace");
gint decomb = ghb_settings_combo_int(js, "PictureDecomb");
gint deint = ghb_settings_combo_int(js, "PictureDeinterlace");
@@ -4718,9 +4752,9 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, gint titleindex)
job->modulus = ghb_settings_combo_int(js, "PictureModulus");
if (job->anamorphic.mode)
{
- job->anamorphic.par_width =
+ job->anamorphic.par_width =
ghb_settings_get_int(js, "PicturePARWidth");
- job->anamorphic.par_height =
+ job->anamorphic.par_height =
ghb_settings_get_int(js, "PicturePARHeight");
job->anamorphic.dar_width = 0;
job->anamorphic.dar_height = 0;
@@ -4744,7 +4778,7 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, gint titleindex)
crop[2] = ghb_settings_get_int(js, "PictureLeftCrop");
crop[3] = ghb_settings_get_int(js, "PictureRightCrop");
- filter_str = g_strdup_printf("%d:%d:%d:%d:%d:%d",
+ filter_str = g_strdup_printf("%d:%d:%d:%d:%d:%d",
width, height, crop[0], crop[1], crop[2], crop[3]);
filter = hb_filter_init(HB_FILTER_CROP_SCALE);
hb_add_filter( job, filter, filter_str );
@@ -4876,7 +4910,7 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, gint titleindex)
const GValue *audio_list;
gint count, ii;
gint tcount = 0;
-
+
audio_list = ghb_settings_get_value(js, "audio_list");
count = ghb_array_len(audio_list);
for (ii = 0; ii < count; ii++)
@@ -4894,7 +4928,7 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, gint titleindex)
char * aname = ghb_settings_get_string(asettings, "AudioTrackName");
if (aname && *aname)
{
- // This leaks, but there is no easy way to clean up
+ // This leaks, but there is no easy way to clean up
// presently
audio.out.name = aname;
}
@@ -4912,10 +4946,10 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, gint titleindex)
gint copy_mask = ghb_get_copy_mask(js);
audio.out.codec = ghb_select_audio_codec(job->mux, aconfig, acodec, fallback, copy_mask);
- audio.out.gain =
+ audio.out.gain =
ghb_settings_get_double(asettings, "AudioTrackGain");
- audio.out.dynamic_range_compression =
+ audio.out.dynamic_range_compression =
ghb_settings_get_double(asettings, "AudioTrackDRCSlider");
if (audio.out.dynamic_range_compression < 1.0)
audio.out.dynamic_range_compression = 0.0;
@@ -4929,7 +4963,7 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, gint titleindex)
{
audio.out.mixdown = ghb_settings_combo_int(asettings, "AudioMixdown");
// Make sure the mixdown is valid and pick a new one if not.
- audio.out.mixdown = ghb_get_best_mix(aconfig, audio.out.codec,
+ audio.out.mixdown = ghb_get_best_mix(aconfig, audio.out.codec,
audio.out.mixdown);
gint srate = ghb_settings_combo_int(asettings, "AudioSamplerate");
if (srate == 0) // 0 is same as source
@@ -4946,11 +4980,11 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, gint titleindex)
else
{
audio.out.quality = HB_INVALID_AUDIO_QUALITY;
- audio.out.bitrate =
+ audio.out.bitrate =
ghb_settings_combo_int(asettings, "AudioBitrate");
audio.out.bitrate = hb_audio_bitrate_get_best(
- audio.out.codec, audio.out.bitrate,
+ audio.out.codec, audio.out.bitrate,
audio.out.samplerate, audio.out.mixdown);
}
}
@@ -4967,7 +5001,7 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, gint titleindex)
const GValue *subtitle_list;
gint subtitle;
gboolean force, burned, def, one_burned = FALSE;
-
+
ghb_settings_set_boolean(js, "subtitle_scan", FALSE);
subtitle_list = ghb_settings_get_value(js, "subtitle_list");
count = ghb_array_len(subtitle_list);
@@ -5063,7 +5097,7 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, gint titleindex)
{
// Add filter that renders vobsubs
filter = hb_filter_init(HB_FILTER_RENDER_SUB);
- filter_str = g_strdup_printf("%d:%d:%d:%d",
+ filter_str = g_strdup_printf("%d:%d:%d:%d",
crop[0], crop[1], crop[2], crop[3]);
hb_add_filter( job, filter, filter_str );
g_free(filter_str);
@@ -5194,7 +5228,7 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, gint titleindex)
void
ghb_add_job(GValue *js, gint unique_id)
{
- // Since I'm doing a scan of the single title I want just prior
+ // Since I'm doing a scan of the single title I want just prior
// to adding the job, there is only the one title to choose from.
add_job(h_queue, js, unique_id, 0);
}
@@ -5211,7 +5245,7 @@ ghb_remove_job(gint unique_id)
{
hb_job_t * job;
gint ii;
-
+
// Multiples passes all get the same id
// remove them all.
// Go backwards through list, so reordering doesn't screw me.
@@ -5267,13 +5301,13 @@ ghb_pause_queue()
static void
vert_line(
- GdkPixbuf * pb,
- guint8 r,
- guint8 g,
- guint8 b,
- gint x,
- gint y,
- gint len,
+ GdkPixbuf * pb,
+ guint8 r,
+ guint8 g,
+ guint8 b,
+ gint x,
+ gint y,
+ gint len,
gint width)
{
guint8 *pixels = gdk_pixbuf_get_pixels (pb);
@@ -5297,12 +5331,12 @@ vert_line(
static void
horz_line(
- GdkPixbuf * pb,
- guint8 r,
- guint8 g,
- guint8 b,
- gint x,
- gint y,
+ GdkPixbuf * pb,
+ guint8 r,
+ guint8 g,
+ guint8 b,
+ gint x,
+ gint y,
gint len,
gint width)
{
@@ -5342,7 +5376,7 @@ hash_pixbuf(
guint8 r;
guint8 g;
guint8 b;
- } c[4] =
+ } c[4] =
{{0x80, 0x80, 0x80},{0xC0, 0x80, 0x70},{0x80, 0xA0, 0x80},{0x70, 0x80, 0xA0}};
if (!orientation)
@@ -5365,32 +5399,30 @@ hash_pixbuf(
GdkPixbuf*
ghb_get_preview_image(
- gint titleindex,
- gint index,
+ gint titleindex,
+ gint index,
signal_user_data_t *ud,
gint *out_width,
gint *out_height)
{
- GValue *settings;
hb_title_t *title;
hb_job_t *job;
-
- settings = ud->settings;
+
title = ghb_get_title_info( titleindex );
if( title == NULL ) return NULL;
job = hb_job_init( title );
if (job == NULL) return NULL;
- set_preview_job_settings(job, settings);
+ set_preview_job_settings(ud, job, ud->settings);
// hb_get_preview doesn't compensate for anamorphic, so lets
// calculate scale factors
gint width, height, par_width = 1, par_height = 1;
- gint pic_par = ghb_settings_combo_int(settings, "PicturePAR");
+ gint pic_par = ghb_settings_combo_int(ud->settings, "PicturePAR");
if (pic_par)
{
- hb_set_anamorphic_size( job, &width, &height,
+ hb_set_anamorphic_size( job, &width, &height,
&par_width, &par_height );
}
@@ -5413,13 +5445,13 @@ ghb_get_preview_image(
// Create an GdkPixbuf and copy the libhb image into it, converting it from
// libhb's format something suitable.
-
- // The image data returned by hb_get_preview is 4 bytes per pixel,
+
+ // The image data returned by hb_get_preview is 4 bytes per pixel,
// BGRA format. Alpha is ignored.
GdkPixbuf *preview = gdk_pixbuf_new(GDK_COLORSPACE_RGB, FALSE, 8, dstWidth, dstHeight);
guint8 *pixels = gdk_pixbuf_get_pixels (preview);
-
+
guint32 *src = (guint32*)buffer;
guint8 *dst = pixels;
@@ -5441,30 +5473,30 @@ ghb_get_preview_image(
}
dst += stride;
}
- gint w = ghb_settings_get_int(settings, "scale_width");
- gint h = ghb_settings_get_int(settings, "scale_height");
+ gint w = ghb_settings_get_int(ud->settings, "scale_width");
+ gint h = ghb_settings_get_int(ud->settings, "scale_height");
ghb_par_scale(ud, &w, &h, par_width, par_height);
gint c0, c1, c2, c3;
- c0 = ghb_settings_get_int(settings, "PictureTopCrop");
- c1 = ghb_settings_get_int(settings, "PictureBottomCrop");
- c2 = ghb_settings_get_int(settings, "PictureLeftCrop");
- c3 = ghb_settings_get_int(settings, "PictureRightCrop");
+ c0 = ghb_settings_get_int(ud->settings, "PictureTopCrop");
+ c1 = ghb_settings_get_int(ud->settings, "PictureBottomCrop");
+ c2 = ghb_settings_get_int(ud->settings, "PictureLeftCrop");
+ c3 = ghb_settings_get_int(ud->settings, "PictureRightCrop");
gdouble xscale = (gdouble)w / (gdouble)(title->width - c2 - c3);
gdouble yscale = (gdouble)h / (gdouble)(title->height - c0 - c1);
-
+
ghb_par_scale(ud, &dstWidth, &dstHeight, par_width, par_height);
*out_width = w;
*out_height = h;
- if (ghb_settings_get_boolean(settings, "reduce_hd_preview"))
+ if (ghb_settings_get_boolean(ud->prefs, "reduce_hd_preview"))
{
GdkScreen *ss;
gint s_w, s_h;
gint orig_w, orig_h;
gint factor = 80;
- if (ghb_settings_get_boolean(settings, "preview_fullscreen"))
+ if (ghb_settings_get_boolean(ud->prefs, "preview_fullscreen"))
{
factor = 100;
}
@@ -5491,7 +5523,7 @@ ghb_get_preview_image(
}
GdkPixbuf *scaled_preview;
scaled_preview = gdk_pixbuf_scale_simple(preview, dstWidth, dstHeight, GDK_INTERP_HYPER);
- if (ghb_settings_get_boolean(settings, "preview_show_crop"))
+ if (ghb_settings_get_boolean(ud->prefs, "preview_show_crop"))
{
c0 *= yscale;
c1 *= yscale;
diff --git a/gtk/src/hb-backend.h b/gtk/src/hb-backend.h
index 9aaf94fcc..e54aa1aad 100644
--- a/gtk/src/hb-backend.h
+++ b/gtk/src/hb-backend.h
@@ -3,17 +3,17 @@
* 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.
- *
+ *
* This program 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 Library General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
*/
-
+
#if !defined(_HBBACKEND_H_)
#define _HBBACKEND_H_
@@ -71,8 +71,8 @@ typedef struct
const gchar* ghb_version(void);
void ghb_vquality_range(
- signal_user_data_t *ud,
- gdouble *min,
+ signal_user_data_t *ud,
+ gdouble *min,
gdouble *max,
gdouble *step,
gdouble *page,
@@ -104,11 +104,13 @@ void ghb_backend_scan(const gchar *path, gint titleindex, gint preview_count, gu
void ghb_backend_scan_stop();
void ghb_backend_queue_scan(const gchar *path, gint titleindex);
hb_title_t* ghb_get_title_info(gint titleindex);
+hb_list_t * ghb_get_title_list();
void ghb_par_init(signal_user_data_t *ud);
void ghb_set_scale(signal_user_data_t *ud, gint mode);
void ghb_set_scale_settings(GValue *settings, gint mode);
GValue* ghb_get_chapters(gint titleindex);
-void ghb_get_chapter_duration(gint ti, gint ii, gint64 *dur);
+gint64 ghb_get_chapter_duration(gint ti, gint chap);
+gint64 ghb_get_chapter_start(gint ti, gint chap);
void ghb_part_duration(gint tt, gint sc, gint ec, gint *hh, gint *mm, gint *ss);
gint ghb_get_best_mix(hb_audio_config_t *aconfig, gint acodec, gint mix);
gboolean ghb_ac3_in_audio_list(const GValue *audio_list);
@@ -166,5 +168,6 @@ void ghb_audio_samplerate_opts_set(GtkComboBox *combo);
int ghb_lookup_audio_lang(const GValue *glang);
const iso639_lang_t* ghb_iso639_lookup_by_int(int idx);
+void ghb_update_display_aspect_label(signal_user_data_t *ud);
#endif // _HBBACKEND_H_
diff --git a/gtk/src/icon_tools.c b/gtk/src/icon_tools.c
index 763c0f8a0..0b53bc2aa 100644
--- a/gtk/src/icon_tools.c
+++ b/gtk/src/icon_tools.c
@@ -2,14 +2,14 @@
/*
* icon_tools.c
* Copyright (C) John Stebbins 2008-2013 <stebbins@stebbins>
- *
+ *
* icon_tools.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.
- *
+ *
*/
#include <glib.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
diff --git a/gtk/src/icon_tools.h b/gtk/src/icon_tools.h
index 24575a88b..c59b70d25 100644
--- a/gtk/src/icon_tools.h
+++ b/gtk/src/icon_tools.h
@@ -3,12 +3,12 @@
* 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.
- *
+ *
* This program 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 Library General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
diff --git a/gtk/src/icons.h b/gtk/src/icons.h
index 0e0aba7ef..2dbe85cf4 100644
--- a/gtk/src/icons.h
+++ b/gtk/src/icons.h
@@ -3,12 +3,12 @@
* 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.
- *
+ *
* This program 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 Library General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
diff --git a/gtk/src/internal_defaults.xml b/gtk/src/internal_defaults.xml
index 467880c9e..2815e52ff 100644
--- a/gtk/src/internal_defaults.xml
+++ b/gtk/src/internal_defaults.xml
@@ -2,6 +2,15 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
+ <key>Globals</key>
+ <dict>
+ <key>hide_settings</key>
+ <false />
+ <key>show_picture</key>
+ <false />
+ <key>scan_source</key>
+ <string></string>
+ </dict>
<key>Initialization</key>
<dict>
<key>AudioTrackName</key>
@@ -10,8 +19,6 @@
<integer>1</integer>
<key>angle</key>
<integer>1</integer>
- <key>anamorphic</key>
- <true />
<key>autoscale</key>
<false />
<key>dest_dir</key>
@@ -20,8 +27,6 @@
<string>new_video.mp4</string>
<key>end_point</key>
<integer>100</integer>
- <key>folder</key>
- <string></string>
<key>MetaName</key>
<string></string>
<key>MetaArtist</key>
@@ -40,10 +45,14 @@
<string></string>
<key>preset</key>
<array>
+ <string>Regular</string>
<string>Normal</string>
</array>
+ <key>preset_reload</key>
+ <false />
<key>preset_selection</key>
<array>
+ <string>Regular</string>
<string>Normal</string>
</array>
<key>PictureDisplayWidth</key>
@@ -56,12 +65,6 @@
<integer>0</integer>
<key>scale_width</key>
<integer>0</integer>
- <key>preview_show_crop</key>
- <false />
- <key>hide_settings</key>
- <false />
- <key>show_picture</key>
- <false />
<key>single_title</key>
<integer>1</integer>
<key>start_point</key>
@@ -115,6 +118,9 @@
<key>audio_list</key>
<array>
</array>
+ <key>chapter_list</key>
+ <array>
+ </array>
<key>subtitle_list</key>
<array>
</array>
@@ -141,8 +147,6 @@
<dict>
<key>HideAdvancedVideoSettings</key>
<false />
- <key>AdvancedAutoPassthru</key>
- <false />
<key>AutoScan</key>
<false />
<key>AddCC</key>
@@ -177,8 +181,6 @@
<string>1</string>
<key>LogLongevity</key>
<string>immortal</string>
- <key>nocheckvquality</key>
- <false />
<key>use_dvdnav</key>
<true />
<key>reduce_hd_preview</key>
@@ -189,6 +191,8 @@
<integer>10</integer>
<key>preview_fullscreen</key>
<false />
+ <key>preview_show_crop</key>
+ <false />
<key>preview_x</key>
<integer>-1</integer>
<key>preview_y</key>
@@ -213,8 +217,6 @@
<string>0.1</string>
<key>PreferredLanguage</key>
<string>und</string>
- <key>constant_rate_factor</key>
- <true />
<key>WhenComplete</key>
<string>notify</string>
<key>SrtDir</key>
diff --git a/gtk/src/main.c b/gtk/src/main.c
index 437540380..e91d1d9ce 100644
--- a/gtk/src/main.c
+++ b/gtk/src/main.c
@@ -2,19 +2,19 @@
/*
* main.c
* Copyright (C) John Stebbins 2008-2013 <stebbins@stebbins>
- *
+ *
* main.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.
- *
+ *
* main.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.,
@@ -108,7 +108,7 @@ create_builder_or_die(const gchar * name)
ghb_ui = g_value_get_string(gval);
if (xml != NULL)
res = gtk_builder_add_from_string(xml, ghb_ui, -1, &error);
- if (!xml || !res)
+ if (!xml || !res)
{
GtkWidget *dialog = gtk_message_dialog_new_with_markup(NULL,
GTK_DIALOG_MODAL,
@@ -158,16 +158,16 @@ MyConnect(
g_debug("handler_name %s", handler_name);
g_debug("signal_name %s", signal_name);
callback = self_symbol_lookup(handler_name);
- if (!callback)
+ if (!callback)
{
g_message("Signal handler (%s) not found", handler_name);
return;
}
- if (connect_object)
+ if (connect_object)
{
g_signal_connect_object(object, signal_name, callback, connect_object, flags);
}
- else
+ else
{
if (flags & G_CONNECT_AFTER)
{
@@ -293,14 +293,14 @@ bind_queue_tree_model(signal_user_data_t *ud)
gtk_tree_view_column_set_min_width(column, 24);
gtk_tree_view_append_column(treeview, GTK_TREE_VIEW_COLUMN(column));
- gtk_tree_view_enable_model_drag_dest(treeview, &SrcEntry, 1,
+ gtk_tree_view_enable_model_drag_dest(treeview, &SrcEntry, 1,
GDK_ACTION_MOVE);
- gtk_tree_view_enable_model_drag_source(treeview, GDK_BUTTON1_MASK,
+ gtk_tree_view_enable_model_drag_source(treeview, GDK_BUTTON1_MASK,
&SrcEntry, 1, GDK_ACTION_MOVE);
g_signal_connect(selection, "changed", queue_list_selection_changed_cb, ud);
g_signal_connect(cell, "clicked", queue_remove_clicked_cb, ud);
- g_signal_connect(treeview, "size-allocate", queue_list_size_allocate_cb,
+ g_signal_connect(treeview, "size-allocate", queue_list_size_allocate_cb,
textcell);
g_signal_connect(treeview, "drag_data_received", queue_drag_cb, ud);
g_signal_connect(treeview, "drag_motion", queue_drag_motion_cb, ud);
@@ -455,13 +455,13 @@ bind_presets_tree_model(signal_user_data_t *ud)
g_debug("bind_presets_tree_model()\n");
treeview = GTK_TREE_VIEW(GHB_WIDGET(ud->builder, "presets_list"));
selection = gtk_tree_view_get_selection(treeview);
- treestore = gtk_tree_store_new(6, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT,
+ treestore = gtk_tree_store_new(6, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT,
G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN);
gtk_tree_view_set_model(treeview, GTK_TREE_MODEL(treestore));
cell = gtk_cell_renderer_text_new();
- column = gtk_tree_view_column_new_with_attributes(_("Preset Name"), cell,
- "text", 0, "weight", 1, "style", 2,
+ column = gtk_tree_view_column_new_with_attributes(_("Preset Name"), cell,
+ "text", 0, "weight", 1, "style", 2,
"foreground", 3, "editable", 5, NULL);
g_signal_connect(cell, "edited", preset_edited_cb, ud);
@@ -470,9 +470,9 @@ bind_presets_tree_model(signal_user_data_t *ud)
gtk_tree_view_column_set_expand(column, TRUE);
gtk_tree_view_set_tooltip_column(treeview, 4);
- gtk_tree_view_enable_model_drag_dest(treeview, &SrcEntry, 1,
+ gtk_tree_view_enable_model_drag_dest(treeview, &SrcEntry, 1,
GDK_ACTION_MOVE);
- gtk_tree_view_enable_model_drag_source(treeview, GDK_BUTTON1_MASK,
+ gtk_tree_view_enable_model_drag_source(treeview, GDK_BUTTON1_MASK,
&SrcEntry, 1, GDK_ACTION_MOVE);
g_signal_connect(treeview, "drag_data_received", presets_drag_cb, ud);
@@ -650,7 +650,7 @@ static gchar *dvd_device = NULL;
static gchar *arg_preset = NULL;
static gboolean ghb_debug = FALSE;
-static GOptionEntry entries[] =
+static GOptionEntry entries[] =
{
{ "device", 'd', 0, G_OPTION_ARG_FILENAME, &dvd_device, N_("The device or file to encode"), NULL },
{ "preset", 'p', 0, G_OPTION_ARG_STRING, &arg_preset, N_("The preset values to use for encoding"), NULL },
@@ -846,7 +846,7 @@ main(int argc, char *argv[])
{
dvd_device = argv[1];
}
-
+
gtk_init(&argc, &argv);
#if GTK_CHECK_VERSION(3, 0, 0)
@@ -888,7 +888,13 @@ main(int argc, char *argv[])
g_log_set_handler(NULL, G_LOG_LEVEL_DEBUG, debug_log_handler, ud);
g_log_set_handler("Gtk", G_LOG_LEVEL_WARNING, warn_log_handler, ud);
//g_log_set_handler("Gtk", G_LOG_LEVEL_CRITICAL, warn_log_handler, ud);
+
+ ud->globals = ghb_settings_new();
+ ud->prefs = ghb_settings_new();
+ ud->settings_array = ghb_array_value_new(1);
ud->settings = ghb_settings_new();
+ ghb_array_append(ud->settings_array, ud->settings);
+
ud->builder = create_builder_or_die(BUILDER_NAME);
// Enable events that alert us to media change events
watch_volumes(ud);
@@ -1005,25 +1011,30 @@ main(int argc, char *argv[])
ghb_init_audio_defaults_ui(ud);
ghb_init_subtitle_defaults_ui(ud);
- // Load all internal settings
- ghb_settings_init(ud);
+ // Load all internal settings with default values
+ ghb_settings_init(ud->globals, "Globals");
+ ghb_settings_init(ud->prefs, "Preferences");
+ ghb_settings_init(ud->settings, "Initialization");
+ ghb_settings_init(ud->settings, "Presets");
+
// Load prefs before presets. Some preset defaults may depend
// on preference settings.
ghb_prefs_load(ud);
// Load the presets files
ghb_presets_load(ud);
+ ghb_globals_to_ui(ud);
ghb_prefs_to_ui(ud);
gint logLevel;
- logLevel = ghb_settings_get_int(ud->settings, "LoggingLevel");
+ logLevel = ghb_settings_get_int(ud->prefs, "LoggingLevel");
ghb_backend_init(logLevel);
- if (ghb_settings_get_boolean(ud->settings, "hbfd"))
+ if (ghb_settings_get_boolean(ud->prefs, "hbfd"))
{
ghb_hbfd(ud, TRUE);
}
- gchar *source = ghb_settings_get_string(ud->settings, "default_source");
+ gchar *source = ghb_settings_get_string(ud->prefs, "default_source");
ghb_dvd_set_current(source, ud);
g_free(source);
@@ -1053,7 +1064,7 @@ main(int argc, char *argv[])
if (dvd_device != NULL)
{
// Source overridden from command line option
- ghb_settings_set_string(ud->settings, "scan_source", dvd_device);
+ ghb_settings_set_string(ud->globals, "scan_source", dvd_device);
g_idle_add((GSourceFunc)ghb_idle_scan, ud);
}
// Reload and check status of the last saved queue
@@ -1071,7 +1082,7 @@ main(int argc, char *argv[])
ud->ai = app_indicator_new("HandBrake", "hb-icon", APP_INDICATOR_CATEGORY_APPLICATION_STATUS);
app_indicator_set_menu( ud->ai, ai_menu );
app_indicator_set_label( ud->ai, "", "99.99%");
- if (ghb_settings_get_boolean(ud->settings, "show_status"))
+ if (ghb_settings_get_boolean(ud->prefs, "show_status"))
{
app_indicator_set_status( ud->ai, APP_INDICATOR_STATUS_ACTIVE );
}
@@ -1088,11 +1099,11 @@ main(int argc, char *argv[])
si = GTK_STATUS_ICON(GHB_OBJECT(ud->builder, "hb_status"));
gtk_status_icon_set_visible(si,
- ghb_settings_get_boolean(ud->settings, "show_status"));
+ ghb_settings_get_boolean(ud->prefs, "show_status"));
#if GTK_CHECK_VERSION(2, 16, 0)
gtk_status_icon_set_has_tooltip(si, TRUE);
- g_signal_connect(si, "query-tooltip",
+ g_signal_connect(si, "query-tooltip",
status_icon_query_tooltip_cb, ud);
#else
gtk_status_icon_set_tooltip(si, "HandBrake");
@@ -1104,7 +1115,7 @@ main(int argc, char *argv[])
gint width, height;
#if GTK_CHECK_VERSION(3, 0, 0)
GtkRequisition min_size, size;
-
+
widget = GHB_WIDGET(ud->builder, "SrtCodeset");
gtk_widget_get_preferred_size( widget, &min_size, &size );
height = MAX(min_size.height, size.height);
@@ -1113,7 +1124,7 @@ main(int argc, char *argv[])
height += MAX(min_size.height, size.height);
#else
GtkRequisition size;
-
+
widget = GHB_WIDGET(ud->builder, "SrtCodeset");
gtk_widget_size_request( widget, &size );
height = size.height;
@@ -1121,17 +1132,17 @@ main(int argc, char *argv[])
gtk_widget_size_request( widget, &size );
height += size.height;
#endif
-
+
widget = GHB_WIDGET(ud->builder, "hb_window");
- GdkGeometry geo = {
+ GdkGeometry geo = {
-1, -1, 1024, 768, -1, -1, 10, 10, 0, 0, GDK_GRAVITY_NORTH_WEST
};
GdkWindowHints geo_mask;
geo_mask = GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE | GDK_HINT_BASE_SIZE;
gtk_window_set_geometry_hints( GTK_WINDOW(widget), widget, &geo, geo_mask);
- width = ghb_settings_get_int(ud->settings, "window_width");
- height = ghb_settings_get_int(ud->settings, "window_height");
+ width = ghb_settings_get_int(ud->prefs, "window_width");
+ height = ghb_settings_get_int(ud->prefs, "window_height");
gtk_window_resize(GTK_WINDOW(widget), width, height);
gtk_widget_show(widget);
@@ -1241,8 +1252,8 @@ main(int argc, char *argv[])
PangoFontDescription *font_desc;
font_desc = pango_font_description_from_string("monospace 10");
textview = GTK_TEXT_VIEW(GHB_WIDGET(ud->builder, "activity_view"));
- gtk_widget_override_font(GTK_WIDGET(textview), font_desc);
- pango_font_description_free(font_desc);
+ gtk_widget_override_font(GTK_WIDGET(textview), font_desc);
+ pango_font_description_free(font_desc);
// Everything should be go-to-go. Lets rock!
diff --git a/gtk/src/makedeps.py b/gtk/src/makedeps.py
index 40ea364d4..ad00a23b3 100644
--- a/gtk/src/makedeps.py
+++ b/gtk/src/makedeps.py
@@ -67,7 +67,6 @@ dep_map = (
DepEntry("x264_trellis", "x264_psy_trell", "0", True, False),
DepEntry("x264UseAdvancedOptions", "x264VideoSettingsTable", "TRUE", True, False),
DepEntry("x264UseAdvancedOptions", "x264_tab", "FALSE", True, False),
- DepEntry("HideAdvancedVideoSettings", "x264UseAdvancedOptions", "TRUE", True, True),
DepEntry("use_source_name", "chapters_in_destination", "TRUE", False, False),
DepEntry("use_source_name", "title_no_in_destination", "TRUE", False, False),
)
diff --git a/gtk/src/plist.c b/gtk/src/plist.c
index 61e9d263e..9581b771f 100644
--- a/gtk/src/plist.c
+++ b/gtk/src/plist.c
@@ -11,11 +11,11 @@
#define BUF_SZ (128*1024)
-static gchar *preamble =
+static gchar *preamble =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n"
"<plist version=\"1.0\">\n";
-static gchar *postfix =
+static gchar *postfix =
"</plist>\n";
enum
@@ -68,15 +68,15 @@ typedef struct
static void
start_element(
- GMarkupParseContext *ctx,
- const gchar *name,
+ GMarkupParseContext *ctx,
+ const gchar *name,
const gchar **attr_names,
const gchar **attr_values,
gpointer ud,
GError **error)
{
parse_data_t *pd = (parse_data_t*)ud;
- union
+ union
{
gint id;
gpointer pid;
@@ -181,14 +181,14 @@ start_element(
static void
end_element(
- GMarkupParseContext *ctx,
- const gchar *name,
+ GMarkupParseContext *ctx,
+ const gchar *name,
gpointer ud,
GError **error)
{
parse_data_t *pd = (parse_data_t*)ud;
gint id;
- union
+ union
{
gint id;
gpointer pid;
@@ -315,8 +315,8 @@ end_element(
static void
text_data(
- GMarkupParseContext *ctx,
- const gchar *text,
+ GMarkupParseContext *ctx,
+ const gchar *text,
gsize len,
gpointer ud,
GError **error)
@@ -328,8 +328,8 @@ text_data(
static void
passthrough(
- GMarkupParseContext *ctx,
- const gchar *text,
+ GMarkupParseContext *ctx,
+ const gchar *text,
gsize len,
gpointer ud,
GError **error)
@@ -346,7 +346,7 @@ parse_error(GMarkupParseContext *ctx, GError *error, gpointer ud)
}
// This is required or the parser crashes
-static void
+static void
destroy_notify(gpointer data)
{ // Do nothing
//g_debug("destroy parser");
@@ -498,7 +498,7 @@ gval_write(FILE *file, GValue *gval)
{
GDate *date;
date = g_value_get_boxed(gval);
- indent_fprintf(file, indent, "<date>%d-%d-%d</date>\n",
+ indent_fprintf(file, indent, "<date>%d-%d-%d</date>\n",
g_date_get_year(date),
g_date_get_month(date),
g_date_get_day(date)
diff --git a/gtk/src/preset_xlat.c b/gtk/src/preset_xlat.c
index 8d242fa6b..f9bcca8f0 100644
--- a/gtk/src/preset_xlat.c
+++ b/gtk/src/preset_xlat.c
@@ -15,7 +15,7 @@ typedef struct
#if 0
static value_map_t subtitle_xlat[] =
-{
+{
{ "None", "none" },
{ "Auto", "auto" },
{ "Any", "und" },
@@ -299,7 +299,7 @@ typedef struct
gboolean ignore;
} key_map_t;
-key_map_t key_map[] =
+key_map_t key_map[] =
{
{"Audio1Bitrate", NULL, NULL, FALSE, FALSE},
{"Audio1Encoder", NULL, NULL, FALSE, FALSE},
@@ -378,9 +378,9 @@ key_xlat(key_map_t *key_map, const gchar *mac_key)
static GValue*
value_xlat(
- GValue *defaults,
- key_map_t *key_map,
- gint key_index,
+ GValue *defaults,
+ key_map_t *key_map,
+ gint key_index,
GValue *mac_val)
{
GValue *gval, *def_val;
@@ -554,7 +554,7 @@ parse_preset_array(GValue *mac_array, GValue *lin_array)
for (ii = 0; ii < count; ii++)
{
mac_dict = ghb_array_get_nth(mac_array, ii);
-
+
// Only process builtin types
if (ghb_value_int(ghb_dict_lookup(mac_dict, "Type")) != 0)
continue;
@@ -564,13 +564,13 @@ parse_preset_array(GValue *mac_array, GValue *lin_array)
gval = ghb_dict_lookup(mac_dict, "PresetName");
if (gval)
{
- ghb_dict_insert(lin_dict, g_strdup("PresetName"),
+ ghb_dict_insert(lin_dict, g_strdup("PresetName"),
ghb_value_dup(gval));
}
gval = ghb_dict_lookup(mac_dict, "PresetDescription");
if (gval)
{
- ghb_dict_insert(lin_dict, g_strdup("PresetDescription"),
+ ghb_dict_insert(lin_dict, g_strdup("PresetDescription"),
ghb_value_dup(gval));
}
gval = ghb_dict_lookup(mac_dict, "Folder");
@@ -581,15 +581,15 @@ parse_preset_array(GValue *mac_array, GValue *lin_array)
mval = ghb_dict_lookup(mac_dict, "ChildrenArray");
lval = ghb_array_value_new(32);
ghb_dict_insert(lin_dict, g_strdup("ChildrenArray"), lval);
- ghb_dict_insert(lin_dict, g_strdup("Folder"),
+ ghb_dict_insert(lin_dict, g_strdup("Folder"),
ghb_boolean_value_new(TRUE));
- ghb_dict_insert(lin_dict, g_strdup("Type"),
+ ghb_dict_insert(lin_dict, g_strdup("Type"),
ghb_int_value_new(0));
parse_preset_array(mval, lval);
}
else
{ // Normal preset
- ghb_dict_insert(lin_dict, g_strdup("Type"),
+ ghb_dict_insert(lin_dict, g_strdup("Type"),
ghb_int_value_new(0));
parse_preset_dict(mac_dict, lin_dict);
}
diff --git a/gtk/src/presets.c b/gtk/src/presets.c
index 81d610cba..cced4aaba 100644
--- a/gtk/src/presets.c
+++ b/gtk/src/presets.c
@@ -2,14 +2,14 @@
/*
* presets.c
* Copyright (C) John Stebbins 2008-2013 <stebbins@stebbins>
- *
+ *
* presets.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.
- *
+ *
*/
#include <sys/types.h>
#include <sys/stat.h>
@@ -301,7 +301,7 @@ presets_remove_nth(GValue *presets, gint pos)
{
GValue *dict;
gint count;
-
+
if (presets == NULL || pos < 0) return;
count = ghb_array_len(presets);
if (pos >= count) return;
@@ -312,7 +312,7 @@ presets_remove_nth(GValue *presets, gint pos)
gboolean
ghb_presets_remove(
- GValue *presets,
+ GValue *presets,
gint *indices,
gint len)
{
@@ -331,7 +331,7 @@ ghb_presets_remove(
static void
ghb_presets_replace(
- GValue *presets,
+ GValue *presets,
GValue *dict,
gint *indices,
gint len)
@@ -349,7 +349,7 @@ ghb_presets_replace(
static void
ghb_presets_insert(
- GValue *presets,
+ GValue *presets,
GValue *dict,
gint *indices,
gint len)
@@ -370,7 +370,7 @@ presets_find_element(GValue *presets, const gchar *name)
{
GValue *dict;
gint count, ii;
-
+
g_debug("presets_find_element () (%s)", name);
if (presets == NULL || name == NULL) return -1;
count = ghb_array_len(presets);
@@ -392,7 +392,7 @@ single_find_pos(GValue *presets, const gchar *name, gint type)
{
GValue *dict;
gint count, ii, ptype, last;
-
+
if (presets == NULL || name == NULL) return -1;
last = count = ghb_array_len(presets);
for (ii = 0; ii < count; ii++)
@@ -517,7 +517,7 @@ presets_clear_default(GValue *presets)
{
if (preset_is_default(dict))
{
- ghb_dict_insert(dict, g_strdup("Default"),
+ ghb_dict_insert(dict, g_strdup("Default"),
ghb_boolean_value_new(FALSE));
}
}
@@ -541,7 +541,7 @@ presets_customize(GValue *presets)
ptype = ghb_value_int(preset_dict_get_value(dict, "Type"));
if (ptype != PRESETS_CUSTOM)
{
- ghb_dict_insert(dict, g_strdup("Type"),
+ ghb_dict_insert(dict, g_strdup("Type"),
ghb_int64_value_new(PRESETS_CUSTOM));
}
folder = ghb_value_boolean(preset_dict_get_value(dict, "Folder"));
@@ -608,7 +608,7 @@ presets_find_default(GValue *presets, gint *len)
gint*
ghb_preset_indices_from_path(
- GValue *presets,
+ GValue *presets,
const GValue *path,
gint *len)
{
@@ -654,7 +654,7 @@ ghb_preset_indices_from_path(
static gint
ghb_presets_get_type(
- GValue *presets,
+ GValue *presets,
gint *indices,
gint len)
{
@@ -675,7 +675,7 @@ ghb_presets_get_type(
static gboolean
ghb_presets_get_folder(
- GValue *presets,
+ GValue *presets,
gint *indices,
gint len)
{
@@ -698,7 +698,7 @@ void
presets_set_default(gint *indices, gint len)
{
GValue *dict;
-
+
g_debug("presets_set_default ()");
presets_clear_default(presetsPlist);
dict = presets_get_dict(presetsPlist, indices, len);
@@ -713,12 +713,12 @@ static void
presets_set_folder_open(gboolean open, gint *indices, gint len)
{
GValue *dict;
-
+
g_debug("presets_set_folder_open ()");
dict = presets_get_dict(presetsPlist, indices, len);
if (dict)
{
- ghb_dict_insert(dict, g_strdup("FolderOpen"),
+ ghb_dict_insert(dict, g_strdup("FolderOpen"),
ghb_boolean_value_new(open));
}
}
@@ -770,15 +770,15 @@ static void init_settings_from_dict(
static void
init_settings_from_array(
- GValue *dest,
+ GValue *dest,
GValue *internal,
GValue *array)
{
GValue *gval, *val;
gint count, ii;
-
+
count = ghb_array_len(array);
- // The first element of the internal version is always the
+ // The first element of the internal version is always the
// template for the allowed values
gval = ghb_array_get_nth(internal, 0);
for (ii = 0; ii < count; ii++)
@@ -816,7 +816,7 @@ init_settings_from_array(
static void
init_settings_from_dict(
- GValue *dest,
+ GValue *dest,
GValue *internal,
GValue *dict)
{
@@ -854,7 +854,7 @@ init_settings_from_dict(
init_settings_from_array(new_array, gval, val);
else
init_settings_from_array(new_array, gval, gval);
-
+
}
else
{
@@ -883,22 +883,25 @@ static gboolean dict_get_boolean(GValue *dict, const char *key)
void
init_ui_from_dict(
- signal_user_data_t *ud,
+ signal_user_data_t *ud,
GValue *internal,
GValue *dict)
{
GHashTableIter iter;
gchar *key;
GValue *gval, *val;
-
- ghb_dict_iter_init(&iter, internal);
+ GValue *tmp = ghb_value_dup(internal);
+
+ ghb_dict_iter_init(&iter, tmp);
// middle (void*) cast prevents gcc warning "defreferencing type-punned
// pointer will break strict-aliasing rules"
while (g_hash_table_iter_next(
&iter, (gpointer*)(void*)&key, (gpointer*)(void*)&gval))
{
if (!strcmp(key, "x264Option"))
+ {
continue;
+ }
val = NULL;
if (dict)
val = ghb_dict_lookup(dict, key);
@@ -906,6 +909,10 @@ init_ui_from_dict(
val = gval;
ghb_ui_update(ud, key, val);
}
+ ghb_value_free(tmp);
+
+ if (dict == NULL)
+ dict = internal;
if (ghb_value_boolean(preset_dict_get_value(dict, "x264UseAdvancedOptions")))
@@ -916,10 +923,9 @@ init_ui_from_dict(
}
}
-static void
-preset_to_ui(signal_user_data_t *ud, GValue *dict)
+void
+ghb_preset_to_settings(GValue *settings, GValue *preset)
{
- g_debug("preset_to_ui()\n");
// Initialize the ui from presets file.
GValue *internal, *hidden;
@@ -929,43 +935,42 @@ preset_to_ui(signal_user_data_t *ud, GValue *dict)
internal = plist_get_dict(internalPlist, "Presets");
hidden = plist_get_dict(internalPlist, "XlatPresets");
// Setting a ui widget will cause the corresponding setting
- // to be set, but it also triggers a callback that can
+ // to be set, but it also triggers a callback that can
// have the side effect of using other settings values
// that have not yet been set. So set *all* settings first
// then update the ui.
- init_settings_from_dict(ud->settings, internal, dict);
- init_settings_from_dict(ud->settings, hidden, dict);
- init_ui_from_dict(ud, internal, dict);
- init_ui_from_dict(ud, hidden, dict);
+ init_settings_from_dict(settings, internal, preset);
+ init_settings_from_dict(settings, hidden, preset);
- if (dict != NULL)
- {
- GValue *val;
- gboolean dd;
+ if (preset == NULL)
+ preset = internal;
- val = ghb_dict_lookup(dict, "PictureDecombDeinterlace");
- if (val != NULL)
- {
- dd = ghb_value_boolean(val);
- ghb_ui_update(ud, "PictureDeinterlaceDecomb", ghb_boolean_value(!dd));
- }
- val = ghb_dict_lookup(dict, "PictureHeight");
- if (val != NULL)
- {
- ghb_ui_update(ud, "scale_height", val);
- }
- val = ghb_dict_lookup(dict, "PictureWidth");
- if (val != NULL)
- {
- ghb_ui_update(ud, "scale_width", val);
- }
+ GValue *val;
+ gboolean dd;
+
+ val = ghb_dict_lookup(preset, "PictureDecombDeinterlace");
+ if (val != NULL)
+ {
+ dd = ghb_value_boolean(val);
+ ghb_settings_set_boolean(settings, "PictureDeinterlaceDecomb", !dd);
+ }
+ val = ghb_dict_lookup(preset, "PictureHeight");
+ if (val != NULL)
+ {
+ ghb_settings_set_value(settings, "scale_height", val);
+ }
+ val = ghb_dict_lookup(preset, "PictureWidth");
+ if (val != NULL)
+ {
+ ghb_settings_set_value(settings, "scale_width", val);
}
+ ghb_settings_set_boolean(settings, "preset_modified", FALSE);
}
void
ghb_settings_to_ui(signal_user_data_t *ud, GValue *dict)
{
- init_ui_from_dict(ud, dict, dict);
+ init_ui_from_dict(ud, dict, NULL);
}
static GValue *current_preset = NULL;
@@ -981,7 +986,10 @@ ghb_preset_is_custom()
}
void
-ghb_set_preset_from_indices(signal_user_data_t *ud, gint *indices, gint len)
+ghb_set_preset_settings_from_indices(
+ signal_user_data_t *ud,
+ gint *indices,
+ gint len)
{
GValue *dict = NULL;
gint fallback[2] = {0, -1};
@@ -996,7 +1004,7 @@ ghb_set_preset_from_indices(signal_user_data_t *ud, gint *indices, gint len)
}
if (dict == NULL)
{
- preset_to_ui(ud, NULL);
+ ghb_preset_to_settings(ud->settings, NULL);
current_preset = NULL;
}
else
@@ -1007,9 +1015,9 @@ ghb_set_preset_from_indices(signal_user_data_t *ud, gint *indices, gint len)
current_preset = dict;
folder = ghb_value_boolean(preset_dict_get_value(dict, "Folder"));
if (folder)
- preset_to_ui(ud, NULL);
+ ghb_preset_to_settings(ud->settings, NULL);
else
- preset_to_ui(ud, dict);
+ ghb_preset_to_settings(ud->settings, dict);
path = preset_path_from_indices(presetsPlist, indices, len);
ghb_settings_set_value(ud->settings, "preset", path);
ghb_value_free(path);
@@ -1025,11 +1033,11 @@ curr_preset_get_value(const gchar *key)
void
ghb_update_from_preset(
- signal_user_data_t *ud,
+ signal_user_data_t *ud,
const gchar *key)
{
const GValue *gval;
-
+
g_debug("ghb_update_from_preset() %s", key);
gval = curr_preset_get_value(key);
if (gval != NULL)
@@ -1040,8 +1048,8 @@ ghb_update_from_preset(
static void
ghb_select_preset2(
- GtkBuilder *builder,
- gint *indices,
+ GtkBuilder *builder,
+ gint *indices,
gint len)
{
GtkTreeView *treeview;
@@ -1049,7 +1057,7 @@ ghb_select_preset2(
GtkTreeModel *store;
GtkTreeIter iter;
GtkTreePath *path;
-
+
g_debug("ghb_select_preset2()");
treeview = GTK_TREE_VIEW(GHB_WIDGET(builder, "presets_list"));
selection = gtk_tree_view_get_selection (treeview);
@@ -1317,23 +1325,13 @@ remove_plist(const gchar *name)
static gboolean prefs_initializing = FALSE;
void
-ghb_prefs_to_ui(signal_user_data_t *ud)
+ghb_globals_to_ui(signal_user_data_t *ud)
{
const GValue *gval;
gchar *key;
- gchar *str;
- GValue *internal, *dict;
+ GValue *internal;
GHashTableIter iter;
-
- g_debug("ghb_prefs_to_ui");
- prefs_initializing = TRUE;
-
- // Setting a ui widget will cause the corresponding setting
- // to be set, but it also triggers a callback that can
- // have the side effect of using other settings values
- // that have not yet been set. So set *all* settings first
- // then update the ui.
internal = plist_get_dict(internalPlist, "Initialization");
ghb_dict_iter_init(&iter, internal);
// middle (void*) cast prevents gcc warning "defreferencing type-punned
@@ -1341,9 +1339,37 @@ ghb_prefs_to_ui(signal_user_data_t *ud)
while (g_hash_table_iter_next(
&iter, (gpointer*)(void*)&key, (gpointer*)(void*)&gval))
{
- ghb_ui_update(ud, key, gval);
+ ghb_ui_settings_update(ud, ud->settings, key, gval);
+ }
+
+ internal = plist_get_dict(internalPlist, "Globals");
+ ghb_dict_iter_init(&iter, internal);
+ // middle (void*) cast prevents gcc warning "defreferencing type-punned
+ // pointer will break strict-aliasing rules"
+ while (g_hash_table_iter_next(
+ &iter, (gpointer*)(void*)&key, (gpointer*)(void*)&gval))
+ {
+ ghb_ui_settings_update(ud, ud->globals, key, gval);
}
+}
+void
+ghb_prefs_to_ui(signal_user_data_t *ud)
+{
+ const GValue *gval;
+ gchar *key;
+ GValue *internal, *dict;
+ GHashTableIter iter;
+
+
+ g_debug("ghb_prefs_to_ui");
+ prefs_initializing = TRUE;
+
+ // Setting a ui widget will cause the corresponding setting
+ // to be set, but it also triggers a callback that can
+ // have the side effect of using other settings values
+ // that have not yet been set. So set *all* settings first
+ // then update the ui.
dict = plist_get_dict(prefsPlist, "Preferences");
internal = plist_get_dict(internalPlist, "Preferences");
ghb_dict_iter_init(&iter, internal);
@@ -1357,7 +1383,7 @@ ghb_prefs_to_ui(signal_user_data_t *ud)
value = ghb_dict_lookup(dict, key);
if (value == NULL)
value = gval;
- ghb_settings_set_value(ud->settings, key, value);
+ ghb_settings_set_value(ud->prefs, key, value);
}
internal = plist_get_dict(internalPlist, "Preferences");
ghb_dict_iter_init(&iter, internal);
@@ -1371,33 +1397,32 @@ ghb_prefs_to_ui(signal_user_data_t *ud)
value = ghb_dict_lookup(dict, key);
if (value == NULL)
value = gval;
- ghb_ui_update(ud, key, value);
+ ghb_ui_settings_update(ud, ud->prefs, key, value);
}
+#if 0
const GValue *val;
- val = ghb_settings_get_value(ud->settings, "show_presets");
- ghb_ui_update(ud, "show_presets", val);
- if (ghb_settings_get_boolean(ud->settings, "hbfd_feature"))
+ val = ghb_settings_get_value(ud->prefs, "show_presets");
+ ghb_ui_settings_update(ud, ud->prefs, "show_presets", val);
+#endif
+ if (ghb_settings_get_boolean(ud->prefs, "hbfd_feature"))
{
GtkWidget *widget;
+#if 0
val = ghb_settings_get_value(ud->settings, "hbfd");
- ghb_ui_update(ud, "hbfd", val);
+ ghb_ui_settings_update(ud, ud->prefs, "hbfd", val);
+#endif
widget = GHB_WIDGET (ud->builder, "hbfd");
gtk_widget_set_visible(widget, TRUE);
}
else
{
- ghb_ui_update(ud, "hbfd", ghb_int64_value(0));
+ ghb_ui_settings_update(ud, ud->prefs, "hbfd", ghb_int64_value(0));
}
- gval = ghb_settings_get_value(ud->settings, "default_source");
- ghb_settings_set_value (ud->settings, "scan_source", gval);
+ gval = ghb_settings_get_value(ud->prefs, "default_source");
+ ghb_settings_set_value(ud->globals, "scan_source", gval);
- str = ghb_settings_get_string(ud->settings, "destination_dir");
- ghb_ui_update(ud, "dest_dir", ghb_string_value(str));
-
- gchar *file = g_strdup_printf ("new_video.mp4");
- ghb_ui_update(ud, "dest_file", ghb_string_value(file));
- g_free(str);
- g_free(file);
+ ghb_ui_settings_update(ud, ud->settings, "dest_dir",
+ ghb_settings_get_value(ud->prefs, "destination_dir"));
prefs_initializing = FALSE;
}
@@ -1410,7 +1435,7 @@ ghb_prefs_save(GValue *settings)
GHashTableIter iter;
gchar *key;
const GValue *value;
-
+
if (prefs_initializing) return;
dict = plist_get_dict(internalPlist, "Preferences");
if (dict == NULL) return;
@@ -1433,10 +1458,10 @@ ghb_prefs_save(GValue *settings)
}
void
-ghb_pref_set(GValue *settings, const gchar *key)
+ghb_pref_save(GValue *settings, const gchar *key)
{
const GValue *value, *value2;
-
+
if (prefs_initializing) return;
value = ghb_settings_get_value(settings, key);
if (value != NULL)
@@ -1449,16 +1474,16 @@ ghb_pref_set(GValue *settings, const gchar *key)
{
ghb_dict_insert(dict, g_strdup(key), ghb_value_dup(value));
store_prefs();
- prefs_modified = TRUE;
+ prefs_modified = FALSE;
}
}
}
void
-ghb_pref_save(GValue *settings, const gchar *key)
+ghb_pref_set(GValue *settings, const gchar *key)
{
const GValue *value, *value2;
-
+
if (prefs_initializing) return;
value = ghb_settings_get_value(settings, key);
if (value != NULL)
@@ -1470,8 +1495,7 @@ ghb_pref_save(GValue *settings, const gchar *key)
if (ghb_value_cmp(value, value2) != 0)
{
ghb_dict_insert(dict, g_strdup(key), ghb_value_dup(value));
- store_prefs();
- prefs_modified = FALSE;
+ prefs_modified = TRUE;
}
}
}
@@ -1487,53 +1511,29 @@ ghb_prefs_store(void)
}
void
-ghb_settings_init(signal_user_data_t *ud)
+ghb_settings_init(GValue *settings, const char *name)
{
GValue *internal;
GHashTableIter iter;
gchar *key;
GValue *gval;
-
g_debug("ghb_settings_init");
- prefs_initializing = TRUE;
-
internalPlist = ghb_resource_get("internal-defaults");
// Setting a ui widget will cause the corresponding setting
- // to be set, but it also triggers a callback that can
+ // to be set, but it also triggers a callback that can
// have the side effect of using other settings values
// that have not yet been set. So set *all* settings first
// then update the ui.
- internal = plist_get_dict(internalPlist, "Initialization");
- ghb_dict_iter_init(&iter, internal);
- // middle (void*) cast prevents gcc warning "defreferencing type-punned
- // pointer will break strict-aliasing rules"
- while (g_hash_table_iter_next(
- &iter, (gpointer*)(void*)&key, (gpointer*)(void*)&gval))
- {
- ghb_settings_set_value(ud->settings, key, gval);
- }
-
- internal = plist_get_dict(internalPlist, "Presets");
- ghb_dict_iter_init(&iter, internal);
- // middle (void*) cast prevents gcc warning "defreferencing type-punned
- // pointer will break strict-aliasing rules"
- while (g_hash_table_iter_next(
- &iter, (gpointer*)(void*)&key, (gpointer*)(void*)&gval))
- {
- ghb_settings_set_value(ud->settings, key, gval);
- }
-
- internal = plist_get_dict(internalPlist, "Preferences");
+ internal = plist_get_dict(internalPlist, name);
ghb_dict_iter_init(&iter, internal);
// middle (void*) cast prevents gcc warning "defreferencing type-punned
// pointer will break strict-aliasing rules"
while (g_hash_table_iter_next(
&iter, (gpointer*)(void*)&key, (gpointer*)(void*)&gval))
{
- ghb_settings_set_value(ud->settings, key, gval);
+ ghb_settings_set_value(settings, key, gval);
}
- prefs_initializing = FALSE;
}
void
@@ -1582,7 +1582,7 @@ ghb_prefs_load(signal_user_data_t *ud)
GHashTableIter iter;
gchar *key;
GValue *gval;
-
+
g_debug("ghb_prefs_load");
prefsPlist = load_plist("preferences");
if (prefsPlist == NULL)
@@ -1594,7 +1594,7 @@ ghb_prefs_load(signal_user_data_t *ud)
dict = ghb_dict_value_new();
ghb_dict_insert(prefsPlist, g_strdup("Preferences"), dict);
- // Get defaults from internal defaults
+ // Get defaults from internal defaults
ghb_dict_iter_init(&iter, internal);
// middle (void*) cast prevents gcc warning "defreferencing type-punned
// pointer will break strict-aliasing rules"
@@ -1609,7 +1609,7 @@ ghb_prefs_load(signal_user_data_t *ud)
{
dir = ".";
}
- ghb_dict_insert(dict,
+ ghb_dict_insert(dict,
g_strdup("ExportDirectory"), ghb_value_dup(ghb_string_value(dir)));
dir = g_get_user_special_dir (G_USER_DIRECTORY_VIDEOS);
@@ -1617,10 +1617,10 @@ ghb_prefs_load(signal_user_data_t *ud)
{
dir = ".";
}
- ghb_dict_insert(dict,
+ ghb_dict_insert(dict,
g_strdup("destination_dir"), ghb_value_dup(ghb_string_value(dir)));
- ghb_dict_insert(dict,
+ ghb_dict_insert(dict,
g_strdup("SrtDir"), ghb_value_dup(ghb_string_value(dir)));
#if defined(_WIN32)
gchar *source;
@@ -1630,7 +1630,7 @@ ghb_prefs_load(signal_user_data_t *ud)
{
source = g_strdup("C:" G_DIR_SEPARATOR_S);
}
- ghb_dict_insert(dict, g_strdup("default_source"),
+ ghb_dict_insert(dict, g_strdup("default_source"),
ghb_value_dup(ghb_string_value(source)));
g_free(source);
#endif
@@ -1664,13 +1664,13 @@ get_preset_color(gint type, gboolean folder)
void
ghb_presets_list_init(
- signal_user_data_t *ud,
+ signal_user_data_t *ud,
gint *indices,
gint len)
{
GtkTreeView *treeview;
GtkTreeIter iter, titer, *piter;
-
+
GtkTreeStore *store;
const gchar *preset;
GtkTreePath *parent_path;
@@ -1680,7 +1680,7 @@ ghb_presets_list_init(
GValue *dict;
gint *more_indices;
GValue *presets = NULL;
-
+
g_debug("ghb_presets_list_init ()");
more_indices = g_malloc((len+1)*sizeof(gint));
memcpy(more_indices, indices, len*sizeof(gint));
@@ -1722,10 +1722,10 @@ ghb_presets_list_init(
type = ghb_preset_type(dict);
folder = ghb_preset_folder(dict);
color = get_preset_color(type, folder);
- gtk_tree_store_set(store, &iter, 0, preset,
- 1, def ? 800 : 400,
+ gtk_tree_store_set(store, &iter, 0, preset,
+ 1, def ? 800 : 400,
2, def ? 2 : 0,
- 3, color,
+ 3, color,
4, description,
5, type == PRESETS_BUILTIN ? 0 : 1,
-1);
@@ -1769,7 +1769,7 @@ ghb_presets_list_init(
static void
presets_list_update_item(
- signal_user_data_t *ud,
+ signal_user_data_t *ud,
gint *indices,
gint len,
gboolean recurse)
@@ -1784,7 +1784,7 @@ presets_list_update_item(
gboolean def, folder;
GValue *dict;
const gchar *color;
-
+
g_debug("presets_list_update_item ()");
dict = presets_get_dict(presetsPlist, indices, len);
if (dict == NULL)
@@ -1801,8 +1801,8 @@ presets_list_update_item(
type = ghb_preset_type(dict);
folder = ghb_preset_folder(dict);
color = get_preset_color(type, folder);
- gtk_tree_store_set(store, &iter, 0, name,
- 1, def ? 800 : 400,
+ gtk_tree_store_set(store, &iter, 0, name,
+ 1, def ? 800 : 400,
2, def ? 2 : 0,
3, color,
4, description,
@@ -1816,7 +1816,7 @@ presets_list_update_item(
static void
presets_list_insert(
- signal_user_data_t *ud,
+ signal_user_data_t *ud,
gint *indices,
gint len)
{
@@ -1832,7 +1832,7 @@ presets_list_insert(
GtkTreePath *parent_path;
GValue *dict;
const gchar *color;
-
+
g_debug("presets_list_insert ()");
treeview = GTK_TREE_VIEW(GHB_WIDGET(ud->builder, "presets_list"));
store = GTK_TREE_STORE(gtk_tree_view_get_model(treeview));
@@ -1866,8 +1866,8 @@ presets_list_insert(
type = ghb_preset_type(dict);
folder = ghb_preset_folder(dict);
color = get_preset_color(type, folder);
- gtk_tree_store_set(store, &iter, 0, preset,
- 1, def ? 800 : 400,
+ gtk_tree_store_set(store, &iter, 0, preset,
+ 1, def ? 800 : 400,
2, def ? 2 : 0,
3, color,
4, description,
@@ -1881,7 +1881,7 @@ presets_list_insert(
static void
presets_list_remove(
- signal_user_data_t *ud,
+ signal_user_data_t *ud,
gint *indices,
gint len)
{
@@ -1889,7 +1889,7 @@ presets_list_remove(
GtkTreePath *treepath;
GtkTreeIter iter;
GtkTreeStore *store;
-
+
g_debug("presets_list_remove ()");
treeview = GTK_TREE_VIEW(GHB_WIDGET(ud->builder, "presets_list"));
store = GTK_TREE_STORE(gtk_tree_view_get_model(treeview));
@@ -2299,9 +2299,9 @@ export_value_xlat(GValue *dict)
static GValue*
import_value_xlat2(
- GValue *defaults,
+ GValue *defaults,
value_map_t *value_map,
- const gchar *key,
+ const gchar *key,
GValue *mac_val)
{
GValue *gval, *def_val;
@@ -2566,7 +2566,7 @@ import_value_xlat(GValue *dict)
drc = ghb_value_double(mac_val);
if (drc < 1.0 && drc > 0.0)
{
- ghb_dict_insert(adict, g_strdup("AudioTrackDRCSlider"),
+ ghb_dict_insert(adict, g_strdup("AudioTrackDRCSlider"),
ghb_double_value_new(0.0));
}
}
@@ -2592,7 +2592,7 @@ import_xlat_preset(GValue *dict)
if (uses_max || uses_pic == 2)
{
- ghb_dict_insert(dict, g_strdup("autoscale"),
+ ghb_dict_insert(dict, g_strdup("autoscale"),
ghb_boolean_value_new(TRUE));
}
switch (par)
@@ -2600,24 +2600,24 @@ import_xlat_preset(GValue *dict)
case 0:
{
if (ghb_dict_lookup(dict, "PictureModulus") == NULL)
- ghb_dict_insert(dict, g_strdup("PictureModulus"),
+ ghb_dict_insert(dict, g_strdup("PictureModulus"),
ghb_int_value_new(16));
} break;
case 1:
{
- ghb_dict_insert(dict, g_strdup("PictureModulus"),
+ ghb_dict_insert(dict, g_strdup("PictureModulus"),
ghb_int_value_new(1));
} break;
case 2:
{
if (ghb_dict_lookup(dict, "PictureModulus") == NULL)
- ghb_dict_insert(dict, g_strdup("PictureModulus"),
+ ghb_dict_insert(dict, g_strdup("PictureModulus"),
ghb_int_value_new(16));
} break;
default:
{
if (ghb_dict_lookup(dict, "PictureModulus") == NULL)
- ghb_dict_insert(dict, g_strdup("PictureModulus"),
+ ghb_dict_insert(dict, g_strdup("PictureModulus"),
ghb_int_value_new(16));
} break;
}
@@ -2627,30 +2627,30 @@ import_xlat_preset(GValue *dict)
{
case 0:
{
- ghb_dict_insert(dict, g_strdup("vquality_type_bitrate"),
+ ghb_dict_insert(dict, g_strdup("vquality_type_bitrate"),
ghb_boolean_value_new(TRUE));
- ghb_dict_insert(dict, g_strdup("vquality_type_constant"),
+ ghb_dict_insert(dict, g_strdup("vquality_type_constant"),
ghb_boolean_value_new(FALSE));
} break;
case 1:
{
- ghb_dict_insert(dict, g_strdup("vquality_type_bitrate"),
+ ghb_dict_insert(dict, g_strdup("vquality_type_bitrate"),
ghb_boolean_value_new(TRUE));
- ghb_dict_insert(dict, g_strdup("vquality_type_constant"),
+ ghb_dict_insert(dict, g_strdup("vquality_type_constant"),
ghb_boolean_value_new(FALSE));
} break;
case 2:
{
- ghb_dict_insert(dict, g_strdup("vquality_type_bitrate"),
+ ghb_dict_insert(dict, g_strdup("vquality_type_bitrate"),
ghb_boolean_value_new(FALSE));
- ghb_dict_insert(dict, g_strdup("vquality_type_constant"),
+ ghb_dict_insert(dict, g_strdup("vquality_type_constant"),
ghb_boolean_value_new(TRUE));
} break;
default:
{
- ghb_dict_insert(dict, g_strdup("vquality_type_bitrate"),
+ ghb_dict_insert(dict, g_strdup("vquality_type_bitrate"),
ghb_boolean_value_new(FALSE));
- ghb_dict_insert(dict, g_strdup("vquality_type_constant"),
+ ghb_dict_insert(dict, g_strdup("vquality_type_constant"),
ghb_boolean_value_new(TRUE));
} break;
}
@@ -2719,7 +2719,7 @@ import_xlat_preset(GValue *dict)
GValue *val = ghb_dict_lookup(prefs, "AddCC");
if (val != NULL)
{
- ghb_dict_insert(dict, g_strdup("SubtitleAddCC"),
+ ghb_dict_insert(dict, g_strdup("SubtitleAddCC"),
ghb_value_dup(val));
}
}
@@ -2742,23 +2742,23 @@ import_xlat_preset(GValue *dict)
str = ghb_value_string(fr);
if (strcmp(str, "source") == 0)
{
- ghb_dict_insert(dict, g_strdup("VideoFramerateCFR"),
+ ghb_dict_insert(dict, g_strdup("VideoFramerateCFR"),
ghb_boolean_value_new(FALSE));
- ghb_dict_insert(dict, g_strdup("VideoFramerateVFR"),
+ ghb_dict_insert(dict, g_strdup("VideoFramerateVFR"),
ghb_boolean_value_new(TRUE));
}
else if (!pfr)
{
- ghb_dict_insert(dict, g_strdup("VideoFramerateCFR"),
+ ghb_dict_insert(dict, g_strdup("VideoFramerateCFR"),
ghb_boolean_value_new(TRUE));
- ghb_dict_insert(dict, g_strdup("VideoFramerateVFR"),
+ ghb_dict_insert(dict, g_strdup("VideoFramerateVFR"),
ghb_boolean_value_new(FALSE));
}
else
{
- ghb_dict_insert(dict, g_strdup("VideoFramerateCFR"),
+ ghb_dict_insert(dict, g_strdup("VideoFramerateCFR"),
ghb_boolean_value_new(FALSE));
- ghb_dict_insert(dict, g_strdup("VideoFramerateVFR"),
+ ghb_dict_insert(dict, g_strdup("VideoFramerateVFR"),
ghb_boolean_value_new(FALSE));
}
g_free(str);
@@ -2770,29 +2770,29 @@ import_xlat_preset(GValue *dict)
str = ghb_value_string(mode);
if (strcmp(str, "cfr") == 0)
{
- ghb_dict_insert(dict, g_strdup("VideoFramerateCFR"),
+ ghb_dict_insert(dict, g_strdup("VideoFramerateCFR"),
ghb_boolean_value_new(TRUE));
- ghb_dict_insert(dict, g_strdup("VideoFrameratePFR"),
+ ghb_dict_insert(dict, g_strdup("VideoFrameratePFR"),
ghb_boolean_value_new(FALSE));
- ghb_dict_insert(dict, g_strdup("VideoFramerateVFR"),
+ ghb_dict_insert(dict, g_strdup("VideoFramerateVFR"),
ghb_boolean_value_new(FALSE));
}
else if (strcmp(str, "pfr") == 0)
{
- ghb_dict_insert(dict, g_strdup("VideoFramerateCFR"),
+ ghb_dict_insert(dict, g_strdup("VideoFramerateCFR"),
ghb_boolean_value_new(FALSE));
- ghb_dict_insert(dict, g_strdup("VideoFrameratePFR"),
+ ghb_dict_insert(dict, g_strdup("VideoFrameratePFR"),
ghb_boolean_value_new(TRUE));
- ghb_dict_insert(dict, g_strdup("VideoFramerateVFR"),
+ ghb_dict_insert(dict, g_strdup("VideoFramerateVFR"),
ghb_boolean_value_new(FALSE));
}
else
{
- ghb_dict_insert(dict, g_strdup("VideoFramerateCFR"),
+ ghb_dict_insert(dict, g_strdup("VideoFramerateCFR"),
ghb_boolean_value_new(FALSE));
- ghb_dict_insert(dict, g_strdup("VideoFrameratePFR"),
+ ghb_dict_insert(dict, g_strdup("VideoFrameratePFR"),
ghb_boolean_value_new(FALSE));
- ghb_dict_insert(dict, g_strdup("VideoFramerateVFR"),
+ ghb_dict_insert(dict, g_strdup("VideoFramerateVFR"),
ghb_boolean_value_new(TRUE));
}
g_free(str);
@@ -2926,38 +2926,38 @@ export_xlat_preset(GValue *dict)
preset_dict_get_value(dict, "vquality_type_constant"));
if (autoscale)
- ghb_dict_insert(dict, g_strdup("UsesPictureSettings"),
+ ghb_dict_insert(dict, g_strdup("UsesPictureSettings"),
ghb_int_value_new(2));
else
- ghb_dict_insert(dict, g_strdup("UsesPictureSettings"),
+ ghb_dict_insert(dict, g_strdup("UsesPictureSettings"),
ghb_int_value_new(1));
// VideoQualityType/0/1/2 - vquality_type_/target/bitrate/constant
// *note: target is no longer used
if (br)
{
- ghb_dict_insert(dict, g_strdup("VideoQualityType"),
+ ghb_dict_insert(dict, g_strdup("VideoQualityType"),
ghb_int_value_new(1));
}
else if (constant)
{
- ghb_dict_insert(dict, g_strdup("VideoQualityType"),
+ ghb_dict_insert(dict, g_strdup("VideoQualityType"),
ghb_int_value_new(2));
}
if (ghb_value_boolean(preset_dict_get_value(dict, "VideoFramerateCFR")))
{
- ghb_dict_insert(dict, g_strdup("VideoFramerateMode"),
+ ghb_dict_insert(dict, g_strdup("VideoFramerateMode"),
ghb_string_value_new("cfr"));
}
else if (ghb_value_boolean(preset_dict_get_value(dict, "VideoFrameratePFR")))
{
- ghb_dict_insert(dict, g_strdup("VideoFramerateMode"),
+ ghb_dict_insert(dict, g_strdup("VideoFramerateMode"),
ghb_string_value_new("pfr"));
}
else
{
- ghb_dict_insert(dict, g_strdup("VideoFramerateMode"),
+ ghb_dict_insert(dict, g_strdup("VideoFramerateMode"),
ghb_string_value_new("vfr"));
}
@@ -2975,7 +2975,7 @@ export_xlat_preset(GValue *dict)
preset_dict_get_value(adict, "AudioTrackDRCSlider"));
if (drc < 1.0 && drc > 0.0)
{
- ghb_dict_insert(adict, g_strdup("AudioTrackDRCSlider"),
+ ghb_dict_insert(adict, g_strdup("AudioTrackDRCSlider"),
ghb_double_value_new(0.0));
}
}
@@ -3004,7 +3004,7 @@ export_xlat_preset(GValue *dict)
g_string_append_printf(str, ",%s", "zerolatency");
}
tunes = g_string_free(str, FALSE);
- ghb_dict_insert(dict, g_strdup("x264Tune"),
+ ghb_dict_insert(dict, g_strdup("x264Tune"),
ghb_string_value_new(tunes));
g_free(tunes);
@@ -3124,7 +3124,7 @@ ghb_presets_reload(signal_user_data_t *ud)
std_dict = ghb_array_get_nth(std_presets, ii);
copy_dict = ghb_value_dup(std_dict);
- ghb_dict_insert(copy_dict, g_strdup("PresetBuildNumber"),
+ ghb_dict_insert(copy_dict, g_strdup("PresetBuildNumber"),
ghb_int64_value_new(hb_get_build(NULL)));
ghb_presets_insert(presetsPlist, copy_dict, &indices, 1);
presets_list_insert(ud, &indices, 1);
@@ -3193,7 +3193,7 @@ replace_standard_presets()
std_dict = ghb_array_get_nth(std_presets, ii);
copy_dict = ghb_value_dup(std_dict);
- ghb_dict_insert(copy_dict, g_strdup("PresetBuildNumber"),
+ ghb_dict_insert(copy_dict, g_strdup("PresetBuildNumber"),
ghb_int64_value_new(hb_get_build(NULL)));
ghb_presets_insert(presetsPlist, copy_dict, &indices, 1);
}
@@ -3222,7 +3222,7 @@ update_standard_presets(signal_user_data_t *ud)
replace_standard_presets();
return 1;
}
-
+
type = ghb_value_int(gval);
if (type == 0)
{
@@ -3275,7 +3275,7 @@ ghb_presets_load(signal_user_data_t *ud)
if (!update_standard_presets(ud))
import_xlat_presets(presetsPlist);
}
-
+
}
static void
@@ -3366,17 +3366,17 @@ settings_save(signal_user_data_t *ud, const GValue *path)
if (replace)
{
def_indices = presets_find_default(presetsPlist, &def_len);
- if (def_indices != NULL &&
+ if (def_indices != NULL &&
preset_path_cmp(indices, len, def_indices, def_len) != 0)
{
- ghb_dict_insert(dict, g_strdup("Default"),
+ ghb_dict_insert(dict, g_strdup("Default"),
ghb_boolean_value_new(FALSE));
}
presets_list_update_item(ud, indices, len, FALSE);
}
else
{
- ghb_dict_insert(dict, g_strdup("Default"),
+ ghb_dict_insert(dict, g_strdup("Default"),
ghb_boolean_value_new(FALSE));
presets_list_insert(ud, indices, len);
}
@@ -3388,7 +3388,7 @@ settings_save(signal_user_data_t *ud, const GValue *path)
{
ghb_dict_remove(dict, "PictureHeight");
}
- ghb_dict_insert(dict, g_strdup("autoscale"),
+ ghb_dict_insert(dict, g_strdup("autoscale"),
ghb_boolean_value_new(
!ghb_settings_get_boolean( ud->settings, "PictureWidthEnable") &&
!ghb_settings_get_boolean( ud->settings, "PictureHeightEnable")
@@ -3430,7 +3430,7 @@ folder_save(signal_user_data_t *ud, const GValue *path)
}
// Already exists, update its description
dict = presets_get_dict(presetsPlist, indices, len);
- ghb_dict_insert(dict, g_strdup("PresetDescription"),
+ ghb_dict_insert(dict, g_strdup("PresetDescription"),
ghb_value_dup(preset_dict_get_value(
ud->settings, "PresetDescription")));
presets_list_update_item(ud, indices, len, FALSE);
@@ -3452,7 +3452,7 @@ folder_save(signal_user_data_t *ud, const GValue *path)
return;
}
}
- ghb_dict_insert(dict, g_strdup("PresetDescription"),
+ ghb_dict_insert(dict, g_strdup("PresetDescription"),
ghb_value_dup(preset_dict_get_value(
ud->settings, "PresetDescription")));
ghb_dict_insert(dict, g_strdup("PresetName"), ghb_string_value_new(name));
@@ -3469,15 +3469,15 @@ folder_save(signal_user_data_t *ud, const GValue *path)
}
void
-ghb_presets_list_default(signal_user_data_t *ud)
+ghb_presets_list_show_default(signal_user_data_t *ud)
{
GtkTreeView *treeview;
GtkTreePath *treepath;
GtkTreeIter iter;
GtkTreeStore *store;
gint *indices, len;
-
- g_debug("ghb_presets_list_default ()");
+
+ g_debug("ghb_presets_list_show_default()");
treeview = GTK_TREE_VIEW(GHB_WIDGET(ud->builder, "presets_list"));
store = GTK_TREE_STORE(gtk_tree_view_get_model(treeview));
indices = presets_find_default(presetsPlist, &len);
@@ -3487,8 +3487,8 @@ ghb_presets_list_default(signal_user_data_t *ud)
{
if (gtk_tree_model_get_iter(GTK_TREE_MODEL(store), &iter, treepath))
{
- gtk_tree_store_set(store, &iter,
- 1, 800,
+ gtk_tree_store_set(store, &iter,
+ 1, 800,
2, 2 ,
-1);
}
@@ -3505,7 +3505,7 @@ ghb_presets_list_clear_default(signal_user_data_t *ud)
GtkTreeIter iter;
GtkTreeStore *store;
gint *indices, len;
-
+
g_debug("ghb_presets_list_clear_default ()");
treeview = GTK_TREE_VIEW(GHB_WIDGET(ud->builder, "presets_list"));
store = GTK_TREE_STORE(gtk_tree_view_get_model(treeview));
@@ -3516,8 +3516,8 @@ ghb_presets_list_clear_default(signal_user_data_t *ud)
{
if (gtk_tree_model_get_iter(GTK_TREE_MODEL(store), &iter, treepath))
{
- gtk_tree_store_set(store, &iter,
- 1, 400,
+ gtk_tree_store_set(store, &iter,
+ 1, 400,
2, 0 ,
-1);
}
@@ -3556,7 +3556,7 @@ presets_menu_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
GtkMenu *menu;
menu = GTK_MENU(GHB_WIDGET(ud->builder, "presets_menu"));
- gtk_menu_popup(menu, NULL, NULL, NULL, NULL, 1,
+ gtk_menu_popup(menu, NULL, NULL, NULL, NULL, 1,
gtk_get_current_event_time());
}
@@ -3588,7 +3588,7 @@ preset_import_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), filter);
gtk_file_chooser_set_filter(GTK_FILE_CHOOSER(dialog), filter);
- exportDir = ghb_settings_get_string(ud->settings, "ExportDirectory");
+ exportDir = ghb_settings_get_string(ud->prefs, "ExportDirectory");
if (exportDir == NULL || exportDir[0] == '\0')
{
exportDir = g_strdup(".");
@@ -3656,12 +3656,12 @@ preset_import_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
}
ghb_value_free(array);
- exportDir = ghb_settings_get_string(ud->settings, "ExportDirectory");
+ exportDir = ghb_settings_get_string(ud->prefs, "ExportDirectory");
dir = g_path_get_dirname(filename);
if (strcmp(dir, exportDir) != 0)
{
- ghb_settings_set_string(ud->settings, "ExportDirectory", dir);
- ghb_pref_save(ud->settings, "ExportDirectory");
+ ghb_settings_set_string(ud->prefs, "ExportDirectory", dir);
+ ghb_pref_save(ud->prefs, "ExportDirectory");
}
g_free(filename);
g_free(exportDir);
@@ -3699,7 +3699,7 @@ preset_export_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
GHB_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
NULL);
- exportDir = ghb_settings_get_string(ud->settings, "ExportDirectory");
+ exportDir = ghb_settings_get_string(ud->prefs, "ExportDirectory");
if (exportDir == NULL || exportDir[0] == '\0')
{
exportDir = g_strdup(".");
@@ -3742,12 +3742,12 @@ preset_export_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
}
ghb_value_free(array);
- exportDir = ghb_settings_get_string(ud->settings, "ExportDirectory");
+ exportDir = ghb_settings_get_string(ud->prefs, "ExportDirectory");
dir = g_path_get_dirname(filename);
if (strcmp(dir, exportDir) != 0)
{
- ghb_settings_set_string(ud->settings, "ExportDirectory", dir);
- ghb_pref_save(ud->settings, "ExportDirectory");
+ ghb_settings_set_string(ud->prefs, "ExportDirectory", dir);
+ ghb_pref_save(ud->prefs, "ExportDirectory");
}
g_free(exportDir);
g_free(dir);
@@ -3770,7 +3770,7 @@ presets_new_folder_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
gint count, *indices, len;
g_debug("presets_new_folder_clicked_cb ()");
- preset = ghb_settings_get_value (ud->settings, "preset_selection");
+ preset = ghb_settings_get_value(ud->settings, "preset_selection");
count = ghb_array_len(preset);
if (count > 0)
@@ -3835,7 +3835,7 @@ presets_save_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
gint count, *indices, len;
g_debug("presets_save_clicked_cb ()");
- preset = ghb_settings_get_value (ud->settings, "preset_selection");
+ preset = ghb_settings_get_value(ud->settings, "preset_selection");
count = ghb_array_len(preset);
if (count > 0)
@@ -3847,9 +3847,9 @@ presets_save_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
int width = ghb_settings_get_int(ud->settings, "PictureWidth");
int height = ghb_settings_get_int(ud->settings, "PictureHeight");
gboolean autoscale = ghb_settings_get_boolean(ud->settings, "autoscale");
- ghb_ui_update(ud, "PictureWidthEnable",
+ ghb_ui_update(ud, "PictureWidthEnable",
ghb_boolean_value(width!=0&&!autoscale));
- ghb_ui_update(ud, "PictureHeightEnable",
+ ghb_ui_update(ud, "PictureHeightEnable",
ghb_boolean_value(height!=0&&!autoscale));
if (!width)
{
@@ -3911,7 +3911,7 @@ presets_restore_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
ghb_presets_reload(ud);
// Updating the presets list shuffles things around
// need to make sure the proper preset is selected
- preset = ghb_settings_get_value (ud->settings, "preset");
+ preset = ghb_settings_get_value(ud->settings, "preset");
ghb_select_preset(ud->builder, preset);
}
@@ -3943,7 +3943,7 @@ presets_remove_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
folder = ghb_presets_get_folder(presetsPlist, indices, len);
dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL,
GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO,
- "Confirm deletion of %s:\n\n%s",
+ "Confirm deletion of %s:\n\n%s",
folder ? "folder" : "preset",
preset);
response = gtk_dialog_run(GTK_DIALOG(dialog));
@@ -4066,7 +4066,7 @@ presets_drag_motion_cb(
// Only allow *drop into* for folders
if (!dst_folder)
- {
+ {
if (drop_pos == GTK_TREE_VIEW_DROP_INTO_OR_BEFORE)
drop_pos = GTK_TREE_VIEW_DROP_BEFORE;
if (drop_pos == GTK_TREE_VIEW_DROP_INTO_OR_AFTER)
@@ -4080,13 +4080,13 @@ presets_drag_motion_cb(
return TRUE;
}
-G_MODULE_EXPORT void
+G_MODULE_EXPORT void
presets_drag_cb(
- GtkTreeView *dstwidget,
- GdkDragContext *dc,
- gint x, gint y,
- GtkSelectionData *selection_data,
- guint info, guint t,
+ GtkTreeView *dstwidget,
+ GdkDragContext *dc,
+ gint x, gint y,
+ GtkSelectionData *selection_data,
+ guint info, guint t,
signal_user_data_t *ud)
{
GtkTreePath *path = NULL;
@@ -4095,9 +4095,9 @@ presets_drag_cb(
gint *dst_indices, dst_len, *src_indices, src_len;
gint src_ptype;
gboolean src_folder, dst_folder;
-
+
GtkTreeModel *dstmodel = gtk_tree_view_get_model(dstwidget);
-
+
g_debug("preset_drag_cb ()");
// This doesn't work here for some reason...
// gtk_tree_view_get_drag_dest_row(dstwidget, &path, &drop_pos);
@@ -4166,7 +4166,7 @@ presets_drag_cb(
dst_folder = ghb_presets_get_folder(presetsPlist, dst_indices, dst_len);
// Only allow *drop into* for folders
if (!dst_folder)
- {
+ {
if (drop_pos == GTK_TREE_VIEW_DROP_INTO_OR_BEFORE)
drop_pos = GTK_TREE_VIEW_DROP_BEFORE;
if (drop_pos == GTK_TREE_VIEW_DROP_INTO_OR_AFTER)
@@ -4180,22 +4180,22 @@ presets_drag_cb(
switch (drop_pos)
{
case GTK_TREE_VIEW_DROP_BEFORE:
- gtk_tree_store_insert_before(GTK_TREE_STORE (dstmodel),
+ gtk_tree_store_insert_before(GTK_TREE_STORE (dstmodel),
&iter, NULL, &dstiter);
break;
case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE:
- gtk_tree_store_insert(GTK_TREE_STORE (dstmodel),
+ gtk_tree_store_insert(GTK_TREE_STORE (dstmodel),
&iter, &dstiter, 0);
break;
case GTK_TREE_VIEW_DROP_AFTER:
- gtk_tree_store_insert_after(GTK_TREE_STORE (dstmodel),
+ gtk_tree_store_insert_after(GTK_TREE_STORE (dstmodel),
&iter, NULL, &dstiter);
break;
case GTK_TREE_VIEW_DROP_INTO_OR_AFTER:
- gtk_tree_store_insert_after(GTK_TREE_STORE (dstmodel),
+ gtk_tree_store_insert_after(GTK_TREE_STORE (dstmodel),
&iter, &dstiter, 0);
break;
@@ -4231,9 +4231,9 @@ presets_drag_cb(
void
presets_row_expanded_cb(
- GtkTreeView *treeview,
- GtkTreeIter *iter,
- GtkTreePath *path,
+ GtkTreeView *treeview,
+ GtkTreeIter *iter,
+ GtkTreePath *path,
signal_user_data_t *ud)
{
gint *indices, len;
@@ -4285,113 +4285,52 @@ presets_row_expanded_cb(
store_presets();
}
-static void
-preset_update_title_deps(signal_user_data_t *ud, hb_title_t *title)
+GValue*
+ghb_get_current_preset(signal_user_data_t *ud)
{
- GtkWidget *widget;
+ GtkTreeView *tv;
+ GtkTreeModel *tm;
+ GtkTreeSelection *ts;
+ GtkTreeIter ti;
+ GValue *preset = NULL;
+
+ tv = GTK_TREE_VIEW(GHB_WIDGET(ud->builder, "presets_list"));
+ ts = gtk_tree_view_get_selection(tv);
+ if (gtk_tree_selection_get_selected(ts, &tm, &ti))
+ {
+ GtkTreePath *tp;
+ gint *indices, len;
- ghb_ui_update(ud, "scale_width",
- ghb_int64_value(title->width - title->crop[2] - title->crop[3]));
- // If anamorphic or keep_aspect, the hight will be automatically calculated
- gboolean keep_aspect;
- gint pic_par;
- keep_aspect = ghb_settings_get_boolean(ud->settings, "PictureKeepRatio");
- pic_par = ghb_settings_combo_int(ud->settings, "PicturePAR");
- if (!(keep_aspect || pic_par) || pic_par == 3)
- {
- ghb_ui_update(ud, "scale_height",
- ghb_int64_value(title->height - title->crop[0] - title->crop[1]));
- }
-
- // Set the limits of cropping. hb_set_anamorphic_size crashes if
- // you pass it a cropped width or height == 0.
- gint bound;
- bound = title->height / 2 - 2;
- widget = GHB_WIDGET (ud->builder, "PictureTopCrop");
- gtk_spin_button_set_range (GTK_SPIN_BUTTON(widget), 0, bound);
- widget = GHB_WIDGET (ud->builder, "PictureBottomCrop");
- gtk_spin_button_set_range (GTK_SPIN_BUTTON(widget), 0, bound);
- bound = title->width / 2 - 2;
- widget = GHB_WIDGET (ud->builder, "PictureLeftCrop");
- gtk_spin_button_set_range (GTK_SPIN_BUTTON(widget), 0, bound);
- widget = GHB_WIDGET (ud->builder, "PictureRightCrop");
- gtk_spin_button_set_range (GTK_SPIN_BUTTON(widget), 0, bound);
- if (ghb_settings_get_boolean(ud->settings, "PictureAutoCrop"))
- {
- ghb_ui_update(ud, "PictureTopCrop", ghb_int64_value(title->crop[0]));
- ghb_ui_update(ud, "PictureBottomCrop", ghb_int64_value(title->crop[1]));
- ghb_ui_update(ud, "PictureLeftCrop", ghb_int64_value(title->crop[2]));
- ghb_ui_update(ud, "PictureRightCrop", ghb_int64_value(title->crop[3]));
+ tp = gtk_tree_model_get_path(tm, &ti);
+ indices = gtk_tree_path_get_indices(tp);
+ len = gtk_tree_path_get_depth(tp);
+ preset = presets_get_dict(presetsPlist, indices, len);
}
+ return preset;
}
-void
-ghb_refresh_preset(signal_user_data_t *ud)
+GValue*
+ghb_get_current_preset_path(signal_user_data_t *ud)
{
- GValue *preset;
- gint *indices, len;
+ GtkTreeView *tv;
+ GtkTreeModel *tm;
+ GtkTreeSelection *ts;
+ GtkTreeIter ti;
+ GValue *path = NULL;
- g_debug("ghb_refresh_preset ()");
- preset = ghb_settings_get_value(ud->settings, "preset_selection");
- indices = ghb_preset_indices_from_path(presetsPlist, preset, &len);
- if (indices)
+ tv = GTK_TREE_VIEW(GHB_WIDGET(ud->builder, "presets_list"));
+ ts = gtk_tree_view_get_selection(tv);
+ if (gtk_tree_selection_get_selected(ts, &tm, &ti))
{
- gboolean folder;
+ GtkTreePath *tp;
+ gint *indices, len;
- folder = ghb_presets_get_folder(presetsPlist, indices, len);
- if (!folder)
- {
- ud->dont_clear_presets = TRUE;
- ud->scale_busy = TRUE;
- // Temporarily set the video_quality range to (0,100)
- // This is needed so the video_quality value does not get
- // truncated when set. The range will be readjusted below
- GtkWidget *qp = GHB_WIDGET(ud->builder, "VideoQualitySlider");
- gtk_range_set_range (GTK_RANGE(qp), 0, 100);
- gtk_scale_set_digits(GTK_SCALE(qp), 3);
- ghb_set_preset_from_indices(ud, indices, len);
- gint titleindex;
- titleindex = ghb_settings_combo_int(ud->settings, "title");
- ghb_audio_def_settings_init(ud);
- ghb_subtitle_def_settings_init(ud);
- ghb_set_pref_audio_settings(titleindex, ud->settings);
- ghb_set_pref_audio_from_settings(ud, ud->settings);
- ghb_set_pref_subtitle(titleindex, ud);
- ghb_settings_set_boolean(ud->settings, "preset_modified", FALSE);
- hb_title_t * title = ghb_get_title_info(titleindex);
- if (title != NULL)
- {
- preset_update_title_deps(ud, title);
- }
- ud->scale_busy = FALSE;
- ghb_set_scale (ud, GHB_PIC_KEEP_PAR|GHB_PIC_USE_MAX);
- ud->dont_clear_presets = FALSE;
-
- gdouble vqmin, vqmax, step, page;
- gint digits;
- gboolean inverted;
-
- ghb_vquality_range(ud, &vqmin, &vqmax, &step,
- &page, &digits, &inverted);
- gtk_range_set_range (GTK_RANGE(qp), vqmin, vqmax);
- gtk_range_set_increments (GTK_RANGE(qp), step, page);
- gtk_scale_set_digits(GTK_SCALE(qp), digits);
- gtk_range_set_inverted (GTK_RANGE(qp), inverted);
-
- gchar *text;
- gint crop[4];
- GtkWidget *crop_widget;
- crop[0] = ghb_settings_get_int(ud->settings, "PictureTopCrop");
- crop[1] = ghb_settings_get_int(ud->settings, "PictureBottomCrop");
- crop[2] = ghb_settings_get_int(ud->settings, "PictureLeftCrop");
- crop[3] = ghb_settings_get_int(ud->settings, "PictureRightCrop");
- crop_widget = GHB_WIDGET (ud->builder, "crop_values");
- text = g_strdup_printf("%d:%d:%d:%d",
- crop[0], crop[1], crop[2], crop[3]);
- gtk_label_set_text (GTK_LABEL(crop_widget), text);
- g_free(text);
- }
+ tp = gtk_tree_model_get_path(tm, &ti);
+ indices = gtk_tree_path_get_indices(tp);
+ len = gtk_tree_path_get_depth(tp);
+ path = preset_path_from_indices(presetsPlist, indices, len);
}
+ return path;
}
G_MODULE_EXPORT void
@@ -4400,7 +4339,7 @@ presets_list_selection_changed_cb(GtkTreeSelection *selection, signal_user_data_
GtkTreeModel *store;
GtkTreeIter iter;
GtkWidget *widget;
-
+
g_debug("presets_list_selection_changed_cb ()");
widget = GHB_WIDGET (ud->builder, "presets_remove");
if (gtk_tree_selection_get_selected(selection, &store, &iter))
@@ -4418,58 +4357,14 @@ presets_list_selection_changed_cb(GtkTreeSelection *selection, signal_user_data_
ghb_settings_take_value(ud->settings, "preset_selection", path);
folder = ghb_presets_get_folder(presetsPlist, indices, len);
- if (!folder)
+ if (!folder && !ghb_settings_get_boolean(ud->settings, "preset_reload"))
{
- ud->dont_clear_presets = TRUE;
- ud->scale_busy = TRUE;
- // Temporarily set the video_quality range to (0,100)
- // This is needed so the video_quality value does not get
- // truncated when set. The range will be readjusted below
- GtkWidget *qp = GHB_WIDGET(ud->builder, "VideoQualitySlider");
- gtk_range_set_range (GTK_RANGE(qp), 0, 100);
- gtk_scale_set_digits(GTK_SCALE(qp), 3);
- ghb_set_preset_from_indices(ud, indices, len);
- gint titleindex;
- titleindex = ghb_settings_combo_int(ud->settings, "title");
- ghb_audio_def_settings_init(ud);
- ghb_subtitle_def_settings_init(ud);
- ghb_set_pref_audio_settings(titleindex, ud->settings);
- ghb_set_pref_audio_from_settings(ud, ud->settings);
- ghb_set_pref_subtitle(titleindex, ud);
- ghb_settings_set_boolean(ud->settings, "preset_modified", FALSE);
- hb_title_t * title = ghb_get_title_info(titleindex);
- if (title != NULL)
- {
- preset_update_title_deps(ud, title);
- }
- ud->scale_busy = FALSE;
- ghb_set_scale (ud, GHB_PIC_KEEP_PAR|GHB_PIC_USE_MAX);
- ud->dont_clear_presets = FALSE;
-
- gdouble vqmin, vqmax, step, page;
- gint digits;
- gboolean inverted;
-
- ghb_vquality_range(ud, &vqmin, &vqmax, &step,
- &page, &digits, &inverted);
- gtk_range_set_range (GTK_RANGE(qp), vqmin, vqmax);
- gtk_range_set_increments (GTK_RANGE(qp), step, page);
- gtk_scale_set_digits(GTK_SCALE(qp), digits);
- gtk_range_set_inverted (GTK_RANGE(qp), inverted);
-
- gchar *text;
- gint crop[4];
- GtkWidget *crop_widget;
- crop[0] = ghb_settings_get_int(ud->settings, "PictureTopCrop");
- crop[1] = ghb_settings_get_int(ud->settings, "PictureBottomCrop");
- crop[2] = ghb_settings_get_int(ud->settings, "PictureLeftCrop");
- crop[3] = ghb_settings_get_int(ud->settings, "PictureRightCrop");
- crop_widget = GHB_WIDGET (ud->builder, "crop_values");
- text = g_strdup_printf("%d:%d:%d:%d",
- crop[0], crop[1], crop[2], crop[3]);
- gtk_label_set_text (GTK_LABEL(crop_widget), text);
- g_free(text);
+ ghb_set_preset_settings_from_indices(ud, indices, len);
+ ghb_set_current_title_settings(ud);
+ ghb_load_settings(ud);
}
+ ghb_settings_set_boolean(ud->settings, "preset_reload", FALSE);
+
gtk_tree_path_free(treepath);
gtk_widget_set_sensitive(widget, TRUE);
}
@@ -4478,21 +4373,6 @@ presets_list_selection_changed_cb(GtkTreeSelection *selection, signal_user_data_
g_debug("No selection??? Perhaps unselected.");
gtk_widget_set_sensitive(widget, FALSE);
}
- if (ghb_settings_combo_int(ud->settings, "PtoPType") == 0)
- {
- gint start, end;
- start = ghb_settings_get_int(ud->settings, "start_point");
- end = ghb_settings_get_int(ud->settings, "end_point");
- widget = GHB_WIDGET (ud->builder, "ChapterMarkers");
- gtk_widget_set_sensitive(widget, TRUE);
- if (start == end)
- {
- ud->dont_clear_presets = TRUE;
- ghb_ui_update(ud, "ChapterMarkers", ghb_boolean_value(FALSE));
- ud->dont_clear_presets = FALSE;
- gtk_widget_set_sensitive(widget, FALSE);
- }
- }
}
void
@@ -4500,7 +4380,7 @@ ghb_clear_presets_selection(signal_user_data_t *ud)
{
GtkTreeView *treeview;
GtkTreeSelection *selection;
-
+
if (ud->dont_clear_presets) return;
g_debug("ghb_clear_presets_selection()");
treeview = GTK_TREE_VIEW(GHB_WIDGET(ud->builder, "presets_list"));
@@ -4516,7 +4396,7 @@ presets_frame_size_allocate_cb(GtkWidget *widget, GtkAllocation *allocation, sig
GtkTreeSelection *selection;
GtkTreeModel *store;
GtkTreeIter iter;
-
+
treeview = GTK_TREE_VIEW(GHB_WIDGET(ud->builder, "presets_list"));
selection = gtk_tree_view_get_selection(treeview);
if (gtk_tree_selection_get_selected(selection, &store, &iter))
@@ -4544,7 +4424,7 @@ presets_default_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
{
ghb_presets_list_clear_default(ud);
presets_set_default(indices, len);
- ghb_presets_list_default(ud);
+ ghb_presets_list_show_default(ud);
}
g_free(indices);
}
@@ -4552,9 +4432,9 @@ presets_default_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
G_MODULE_EXPORT void
preset_edited_cb(
- GtkCellRendererText *cell,
- gchar *path,
- gchar *text,
+ GtkCellRendererText *cell,
+ gchar *path,
+ gchar *text,
signal_user_data_t *ud)
{
GtkTreePath *treepath;
@@ -4564,7 +4444,7 @@ preset_edited_cb(
gint *indices, len, count;
GValue *dict;
GValue *preset, *dest;
-
+
g_debug("preset_edited_cb ()");
g_debug("path (%s)", path);
g_debug("text (%s)", text);
diff --git a/gtk/src/presets.h b/gtk/src/presets.h
index e3e126703..845160ef7 100644
--- a/gtk/src/presets.h
+++ b/gtk/src/presets.h
@@ -3,12 +3,12 @@
* 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.
- *
+ *
* This program 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 Library General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
@@ -19,12 +19,15 @@
void ghb_settings_save(signal_user_data_t *ud, const gchar *name);
void ghb_presets_load(signal_user_data_t *ud);
void ghb_update_from_preset(signal_user_data_t *ud, const gchar *key);
-void ghb_prefs_load(signal_user_data_t *ud);
-void ghb_settings_init(signal_user_data_t *ud);
+void ghb_settings_init(GValue *settings, const char *name);
void ghb_settings_close();
+void ghb_globals_to_ui(signal_user_data_t *ud);
+void ghb_prefs_load(signal_user_data_t *ud);
void ghb_prefs_to_ui(signal_user_data_t *ud);
void ghb_prefs_save(GValue *settings);
void ghb_pref_save(GValue *settings, const gchar *key);
+void ghb_pref_set(GValue *settings, const gchar *key);
+void ghb_prefs_store(void);
void ghb_save_queue(GValue *queue);
GValue* ghb_load_queue();
GValue* ghb_load_old_queue(int pid);
@@ -33,19 +36,19 @@ void ghb_remove_old_queue_file(int pid);
gchar* ghb_get_user_config_dir(gchar *subdir);
void ghb_settings_to_ui(signal_user_data_t *ud, GValue *dict);
void ghb_clear_presets_selection(signal_user_data_t *ud);
-void ghb_select_preset(GtkBuilder *builder,
- const GValue *preset);
+void ghb_select_preset(GtkBuilder *builder, const GValue *preset);
void ghb_select_default_preset(GtkBuilder *builder);
void ghb_presets_list_init(signal_user_data_t *ud, gint *indices, gint len);
GValue* ghb_parse_preset_path(const gchar *path);
gchar* ghb_preset_path_string(const GValue *path);
gboolean ghb_preset_is_custom(void);
-void ghb_prefs_store(void);
-void ghb_pref_set(GValue *settings, const gchar *key);
gboolean ghb_lock_file(const gchar *name);
-void ghb_refresh_preset(signal_user_data_t *ud);
int ghb_find_pid_file();
void ghb_unlink_pid_file(int pid);
void ghb_write_pid_file();
+GValue* ghb_get_current_preset(signal_user_data_t *ud);
+GValue* ghb_get_current_preset_path(signal_user_data_t *ud);
+void ghb_preset_to_settings(GValue *settings, GValue *preset);
+void dump_preset_path(const gchar *msg, const GValue *path);
#endif // _GHB_PRESETS_H_
diff --git a/gtk/src/preview.c b/gtk/src/preview.c
index 3df9311e0..8cdf4eb3e 100644
--- a/gtk/src/preview.c
+++ b/gtk/src/preview.c
@@ -2,14 +2,14 @@
/*
* preview.c
* Copyright (C) John Stebbins 2008-2013 <stebbins@stebbins>
- *
+ *
* preview.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.
- *
+ *
*/
#include <unistd.h>
#include <glib.h>
@@ -72,11 +72,11 @@ struct preview_s
#if defined(_ENABLE_GST)
G_MODULE_EXPORT gboolean live_preview_cb(GstBus *bus, GstMessage *msg, gpointer data);
-static GstBusSyncReply create_window(GstBus *bus, GstMessage *msg,
+static GstBusSyncReply create_window(GstBus *bus, GstMessage *msg,
gpointer data);
#endif
-G_MODULE_EXPORT gboolean preview_expose_cb(GtkWidget *widget, GdkEventExpose *event,
+G_MODULE_EXPORT gboolean preview_expose_cb(GtkWidget *widget, GdkEventExpose *event,
signal_user_data_t *ud);
void
@@ -169,7 +169,7 @@ ghb_preview_init(signal_user_data_t *ud)
ud->preview->live_id = -1;
widget = GHB_WIDGET (ud->builder, "preview_button_image");
gtk_widget_get_size_request(widget, &ud->preview->button_width, &ud->preview->button_height);
-
+
#if defined(_ENABLE_GST)
GstBus *bus;
GstElement *xover;
@@ -214,7 +214,7 @@ ghb_preview_init(signal_user_data_t *ud)
{
g_object_set(G_OBJECT(ud->preview->play), "video-sink", xover, NULL);
- g_object_set(ud->preview->play, "subtitle-font-desc",
+ g_object_set(ud->preview->play, "subtitle-font-desc",
"sans bold 20", NULL);
bus = gst_pipeline_get_bus(GST_PIPELINE(ud->preview->play));
@@ -311,7 +311,7 @@ caps_set(GstCaps *caps, signal_user_data_t *ud)
else
height = gst_util_uint64_scale_int(width, den, num);
- if (ghb_settings_get_boolean(ud->settings, "reduce_hd_preview"))
+ if (ghb_settings_get_boolean(ud->prefs, "reduce_hd_preview"))
{
GdkScreen *ss;
gint s_w, s_h;
@@ -331,7 +331,7 @@ caps_set(GstCaps *caps, signal_user_data_t *ud)
width = gst_util_uint64_scale_int(height, num, den);
}
}
-
+
if (width != ud->preview->width || height != ud->preview->height)
{
gtk_widget_set_size_request(ud->preview->view, width, height);
@@ -389,7 +389,7 @@ get_stream_info_objects_for_type (GstElement *play, const gchar *typestr)
if (info_arr == NULL)
return NULL;
- for (ii = 0; ii < info_arr->n_values; ++ii)
+ for (ii = 0; ii < info_arr->n_values; ++ii)
{
GObject *info_obj;
GValue *val;
@@ -397,7 +397,7 @@ get_stream_info_objects_for_type (GstElement *play, const gchar *typestr)
val = g_value_array_get_nth(info_arr, ii);
//val = &((GValue*)info_arr->values)[ii];
info_obj = g_value_get_object(val);
- if (info_obj)
+ if (info_obj)
{
GParamSpec *pspec;
GEnumValue *value;
@@ -408,10 +408,10 @@ get_stream_info_objects_for_type (GstElement *play, const gchar *typestr)
G_OBJECT_GET_CLASS (info_obj), "type");
value = g_enum_get_value(
G_PARAM_SPEC_ENUM (pspec)->enum_class, type);
- if (value)
+ if (value)
{
if (g_ascii_strcasecmp (value->value_nick, typestr) == 0 ||
- g_ascii_strcasecmp (value->value_name, typestr) == 0)
+ g_ascii_strcasecmp (value->value_name, typestr) == 0)
{
ret = g_list_prepend (ret, g_object_ref (info_obj));
}
@@ -785,7 +785,7 @@ ghb_live_encode_done(signal_user_data_t *ud, gboolean success)
ud->preview->live_id = -1;
prog = GHB_WIDGET(ud->builder, "live_encode_progress");
- if (success &&
+ if (success &&
ud->preview->encode_frame == ud->preview->frame)
{
gtk_progress_bar_set_text(GTK_PROGRESS_BAR(prog), "Done");
@@ -947,14 +947,14 @@ ghb_set_preview_image(signal_user_data_t *ud)
if (ud->preview->pix != NULL)
g_object_unref(ud->preview->pix);
- ud->preview->pix =
- ghb_get_preview_image(titleindex, ud->preview->frame,
+ ud->preview->pix =
+ ghb_get_preview_image(titleindex, ud->preview->frame,
ud, &width, &height);
if (ud->preview->pix == NULL) return;
preview_width = gdk_pixbuf_get_width(ud->preview->pix);
preview_height = gdk_pixbuf_get_height(ud->preview->pix);
widget = GHB_WIDGET (ud->builder, "preview_image");
- if (preview_width != ud->preview->width ||
+ if (preview_width != ud->preview->width ||
preview_height != ud->preview->height)
{
gtk_widget_set_size_request(widget, preview_width, preview_height);
@@ -967,7 +967,7 @@ ghb_set_preview_image(signal_user_data_t *ud)
widget = GHB_WIDGET (ud->builder, "preview_dims");
gtk_label_set_text(GTK_LABEL(widget), text);
g_free(text);
-
+
g_debug("preview %d x %d", preview_width, preview_height);
target_height = MIN(ud->preview->button_height, 200);
height = target_height;
@@ -981,7 +981,7 @@ ghb_set_preview_image(signal_user_data_t *ud)
if ((height >= 16) && (width >= 16))
{
GdkPixbuf *scaled_preview;
- scaled_preview = gdk_pixbuf_scale_simple (ud->preview->pix, width,
+ scaled_preview = gdk_pixbuf_scale_simple (ud->preview->pix, width,
height, GDK_INTERP_NEAREST);
if (scaled_preview != NULL)
{
@@ -1048,8 +1048,8 @@ delayed_expose_cb(signal_user_data_t *ud)
G_MODULE_EXPORT gboolean
position_overlay_cb(
GtkWidget *overlay,
- GtkWidget *widget,
- GdkRectangle *rect,
+ GtkWidget *widget,
+ GdkRectangle *rect,
signal_user_data_t *ud)
{
GtkRequisition min_size, size;
@@ -1066,8 +1066,8 @@ position_overlay_cb(
G_MODULE_EXPORT gboolean
preview_expose_cb(
- GtkWidget *widget,
- GdkEventExpose *event,
+ GtkWidget *widget,
+ GdkEventExpose *event,
signal_user_data_t *ud)
{
#if defined(_ENABLE_GST)
@@ -1139,26 +1139,13 @@ preview_button_size_allocate_cb(GtkWidget *widget, GtkAllocation *allocation, si
g_debug("nothing to do");
return;
}
- g_debug("prev allocate %d x %d", ud->preview->button_width,
+ g_debug("prev allocate %d x %d", ud->preview->button_width,
ud->preview->button_height);
ud->preview->button_width = allocation->width;
ud->preview->button_height = allocation->height;
ghb_set_preview_image(ud);
}
-static void
-set_visible(GtkWidget *widget, gboolean visible)
-{
- if (visible)
- {
- gtk_widget_show_now(widget);
- }
- else
- {
- gtk_widget_hide(widget);
- }
-}
-
void
ghb_preview_set_visible(signal_user_data_t *ud)
{
@@ -1166,22 +1153,22 @@ ghb_preview_set_visible(signal_user_data_t *ud)
GtkWidget *widget;
gboolean settings_active;
- settings_active = ghb_settings_get_boolean(ud->settings, "show_picture");
- widget = GHB_WIDGET (ud->builder, "preview_window");
+ settings_active = ghb_settings_get_boolean(ud->globals, "show_picture");
+ widget = GHB_WIDGET(ud->builder, "preview_window");
titleindex = ghb_settings_combo_int(ud->settings, "title");
if (settings_active && titleindex >= 0)
{
gint x, y;
- x = ghb_settings_get_int(ud->settings, "preview_x");
- y = ghb_settings_get_int(ud->settings, "preview_y");
+ x = ghb_settings_get_int(ud->prefs, "preview_x");
+ y = ghb_settings_get_int(ud->prefs, "preview_y");
if (x >= 0 && y >= 0)
gtk_window_move(GTK_WINDOW(widget), x, y);
- set_visible(widget,
- ghb_settings_get_boolean(ud->settings, "show_preview"));
+ gtk_widget_set_visible(widget,
+ ghb_settings_get_boolean(ud->prefs, "show_preview"));
}
else
{
- set_visible(widget, FALSE);
+ gtk_widget_set_visible(widget, FALSE);
}
}
@@ -1189,11 +1176,11 @@ G_MODULE_EXPORT void
preview_button_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
{
g_debug("preview_button_clicked_cb()");
- ghb_widget_to_setting (ud->settings, xwidget);
+ ghb_widget_to_setting (ud->prefs, xwidget);
ghb_preview_set_visible(ud);
ghb_check_dependency(ud, xwidget, NULL);
const gchar *name = ghb_get_setting_key(xwidget);
- ghb_pref_save(ud->settings, name);
+ ghb_pref_save(ud->prefs, name);
}
G_MODULE_EXPORT void
@@ -1204,17 +1191,17 @@ picture_settings_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
gint x, y;
g_debug("picture_settings_clicked_cb()");
- ghb_widget_to_setting (ud->settings, xwidget);
+ ghb_widget_to_setting(ud->globals, xwidget);
- hide_settings = ghb_settings_get_boolean(ud->settings, "hide_settings");
+ hide_settings = ghb_settings_get_boolean(ud->globals, "hide_settings");
- active = ghb_settings_get_boolean(ud->settings, "show_picture");
+ active = ghb_settings_get_boolean(ud->globals, "show_picture");
widget = GHB_WIDGET (ud->builder, "settings_window");
- x = ghb_settings_get_int(ud->settings, "settings_x");
- y = ghb_settings_get_int(ud->settings, "settings_y");
+ x = ghb_settings_get_int(ud->prefs, "settings_x");
+ y = ghb_settings_get_int(ud->prefs, "settings_y");
if (x >= 0 && y >= 0)
gtk_window_move(GTK_WINDOW(widget), x, y);
- set_visible(widget, active && !hide_settings);
+ gtk_widget_set_visible(widget, active && !hide_settings);
ghb_preview_set_visible(ud);
}
@@ -1247,10 +1234,10 @@ fullscreen_clicked_cb(GtkWidget *toggle, signal_user_data_t *ud)
GtkWindow *window;
g_debug("fullscreen_clicked_cb()");
- ghb_widget_to_setting (ud->settings, toggle);
+ ghb_widget_to_setting (ud->prefs, toggle);
ghb_check_dependency(ud, toggle, NULL);
const gchar *name = ghb_get_setting_key(toggle);
- ghb_pref_save(ud->settings, name);
+ ghb_pref_save(ud->prefs, name);
window = GTK_WINDOW(GHB_WIDGET (ud->builder, "preview_window"));
active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(toggle));
@@ -1280,15 +1267,15 @@ picture_settings_alt2_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
GtkWidget *window;
g_debug("picture_settings_alt2_clicked_cb()");
- ghb_widget_to_setting (ud->settings, xwidget);
- active = ghb_settings_get_boolean(ud->settings, "hide_settings");
+ ghb_widget_to_setting(ud->globals, xwidget);
+ active = ghb_settings_get_boolean(ud->globals, "hide_settings");
- toggle = GHB_WIDGET (ud->builder, "hide_settings");
+ toggle = GHB_WIDGET(ud->builder, "hide_settings");
window = GHB_WIDGET(ud->builder, "settings_window");
if (!active)
{
gtk_button_set_label(GTK_BUTTON(toggle), _("Hide Settings"));
- gtk_widget_set_tooltip_text(toggle,
+ gtk_widget_set_tooltip_text(toggle,
_("Hide the picture settings window while "
"leaving the preview visible."));
gtk_widget_show(window);
@@ -1315,24 +1302,24 @@ preview_frame_value_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
G_MODULE_EXPORT gboolean
preview_window_delete_cb(
- GtkWidget *widget,
- GdkEvent *event,
+ GtkWidget *widget,
+ GdkEvent *event,
signal_user_data_t *ud)
{
live_preview_stop(ud);
- widget = GHB_WIDGET (ud->builder, "show_picture");
+ widget = GHB_WIDGET(ud->builder, "show_picture");
gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(widget), FALSE);
return TRUE;
}
G_MODULE_EXPORT gboolean
settings_window_delete_cb(
- GtkWidget *widget,
- GdkEvent *event,
+ GtkWidget *widget,
+ GdkEvent *event,
signal_user_data_t *ud)
{
live_preview_stop(ud);
- widget = GHB_WIDGET (ud->builder, "show_picture");
+ widget = GHB_WIDGET(ud->builder, "show_picture");
gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(widget), FALSE);
return TRUE;
@@ -1343,10 +1330,10 @@ preview_duration_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
{
g_debug("preview_duration_changed_cb ()");
ghb_live_reset(ud);
- ghb_widget_to_setting (ud->settings, widget);
+ ghb_widget_to_setting (ud->prefs, widget);
ghb_check_dependency(ud, widget, NULL);
const gchar *name = ghb_get_setting_key(widget);
- ghb_pref_save(ud->settings, name);
+ ghb_pref_save(ud->prefs, name);
}
static guint hud_timeout_id = 0;
@@ -1546,7 +1533,7 @@ preview_hud_size_alloc_cb(
//g_message("preview_hud_size_alloc_cb()");
if (gtk_widget_get_visible(widget) && allocation->height > 50)
{
- shape = ghb_curved_rect_mask(allocation->width,
+ shape = ghb_curved_rect_mask(allocation->width,
allocation->height, allocation->height/4);
if (shape != NULL)
{
@@ -1573,10 +1560,10 @@ preview_configure_cb(
if (gtk_widget_get_visible(widget))
{
gtk_window_get_position(GTK_WINDOW(widget), &x, &y);
- ghb_settings_set_int(ud->settings, "preview_x", x);
- ghb_settings_set_int(ud->settings, "preview_y", y);
- ghb_pref_set(ud->settings, "preview_x");
- ghb_pref_set(ud->settings, "preview_y");
+ ghb_settings_set_int(ud->prefs, "preview_x", x);
+ ghb_settings_set_int(ud->prefs, "preview_y", y);
+ ghb_pref_set(ud->prefs, "preview_x");
+ ghb_pref_set(ud->prefs, "preview_y");
ghb_prefs_store();
}
return FALSE;
@@ -1594,10 +1581,10 @@ settings_configure_cb(
if (gtk_widget_get_visible(widget))
{
gtk_window_get_position(GTK_WINDOW(widget), &x, &y);
- ghb_settings_set_int(ud->settings, "settings_x", x);
- ghb_settings_set_int(ud->settings, "settings_y", y);
- ghb_pref_set(ud->settings, "settings_x");
- ghb_pref_set(ud->settings, "settings_y");
+ ghb_settings_set_int(ud->prefs, "settings_x", x);
+ ghb_settings_set_int(ud->prefs, "settings_y", y);
+ ghb_pref_set(ud->prefs, "settings_x");
+ ghb_pref_set(ud->prefs, "settings_y");
ghb_prefs_store();
}
return FALSE;
diff --git a/gtk/src/preview.h b/gtk/src/preview.h
index 56d62415b..375c1c510 100644
--- a/gtk/src/preview.h
+++ b/gtk/src/preview.h
@@ -3,12 +3,12 @@
* 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.
- *
+ *
* This program 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 Library General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
diff --git a/gtk/src/queuehandler.c b/gtk/src/queuehandler.c
index 5c45eebb8..9725bd1bd 100644
--- a/gtk/src/queuehandler.c
+++ b/gtk/src/queuehandler.c
@@ -2,9 +2,9 @@
/*
* callbacks.c
* Copyright (C) John Stebbins 2008-2013 <stebbins@stebbins>
- *
+ *
* callbacks.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)
@@ -29,7 +29,7 @@ queue_list_selection_changed_cb(GtkTreeSelection *selection, signal_user_data_t
{
GtkTreeModel *store;
GtkTreeIter iter, piter;
-
+
g_debug("queue_list_selection_changed_cb ()");
// A queue entry is made up of a parent and multiple
// children that are visible when expanded. When and entry
@@ -43,7 +43,7 @@ queue_list_selection_changed_cb(GtkTreeSelection *selection, signal_user_data_t
{
GtkTreePath *path;
GtkTreeView *treeview;
-
+
gtk_tree_selection_select_iter (selection, &piter);
path = gtk_tree_model_get_path (store, &piter);
treeview = gtk_tree_selection_get_tree_view (selection);
@@ -76,12 +76,12 @@ add_to_queue_list(signal_user_data_t *ud, GValue *settings, GtkTreeIter *piter)
gboolean pass2 = FALSE, keep_aspect, vqtype, turbo;
gint pic_par;
gchar *escape, *escape2;
-
+
g_debug("update_queue_list ()");
if (settings == NULL) return;
treeview = GTK_TREE_VIEW(GHB_WIDGET(ud->builder, "queue_list"));
store = GTK_TREE_STORE(gtk_tree_view_get_model(treeview));
-
+
title = ghb_settings_get_int(settings, "titlenum");
start_point = ghb_settings_get_int(settings, "start_point");
end_point = ghb_settings_get_int(settings, "end_point");
@@ -101,12 +101,12 @@ add_to_queue_list(signal_user_data_t *ud, GValue *settings, GtkTreeIter *piter)
points = _("Seconds");
else if (ghb_settings_combo_int(settings, "PtoPType") == 2)
points = _("Frames");
- info = g_strdup_printf
+ info = g_strdup_printf
(
"<big><b>%s</b></big> "
"<small>(Title %d, %s %d through %d, %d Video %s)"
" --> %s</small>",
- escape2, title, points, start_point, end_point,
+ escape2, title, points, start_point, end_point,
pass2 ? 2:1, pass2 ? "Passes":"Pass", escape
);
g_free(basename);
@@ -154,23 +154,23 @@ add_to_queue_list(signal_user_data_t *ud, GValue *settings, GtkTreeIter *piter)
markers = ghb_settings_get_boolean(settings, "ChapterMarkers");
if (preset_modified)
- g_string_append_printf(str,
- "<b>Modified Preset Based On:</b> <small>%s</small>\n",
+ g_string_append_printf(str,
+ "<b>Modified Preset Based On:</b> <small>%s</small>\n",
preset);
else
- g_string_append_printf(str,
- "<b>Preset:</b> <small>%s</small>\n",
+ g_string_append_printf(str,
+ "<b>Preset:</b> <small>%s</small>\n",
preset);
if (markers)
{
- g_string_append_printf(str,
- "<b>Format:</b> <small>%s Container, Chapter Markers</small>\n",
+ g_string_append_printf(str,
+ "<b>Format:</b> <small>%s Container, Chapter Markers</small>\n",
container);
}
else
{
- g_string_append_printf(str,
+ g_string_append_printf(str,
"<b>Format:</b> <small>%s Container</small>\n", container);
}
if (mux & HB_MUX_MASK_MP4)
@@ -193,7 +193,7 @@ add_to_queue_list(signal_user_data_t *ud, GValue *settings, GtkTreeIter *piter)
}
}
escape = g_markup_escape_text(dest, -1);
- g_string_append_printf(str,
+ g_string_append_printf(str,
"<b>Destination:</b> <small>%s</small>\n", escape);
width = ghb_settings_get_int(settings, "scale_width");
@@ -398,7 +398,7 @@ add_to_queue_list(signal_user_data_t *ud, GValue *settings, GtkTreeIter *piter)
strcmp(vcodec_abbr, "ffmpeg") == 0)
{
gchar *opts = ghb_build_advanced_opts_string(settings);
- g_string_append_printf(str,
+ g_string_append_printf(str,
"<b>Advanced Options:</b> <small>%s</small>\n", opts);
g_free(opts);
}
@@ -487,7 +487,7 @@ add_to_queue_list(signal_user_data_t *ud, GValue *settings, GtkTreeIter *piter)
{
g_string_append_printf(str,
"<small> %s%s%s%s</small>",
- track,
+ track,
force ? " (Force)":"",
burn ? " (Burn)":"",
def ? " (Default)":""
@@ -602,15 +602,15 @@ validate_settings(signal_user_data_t *ud, GValue *settings, gint batch)
gchar *resolved = ghb_resolve_symlink(destdir);
gfile = g_file_new_for_path(resolved);
- info = g_file_query_filesystem_info(gfile,
+ info = g_file_query_filesystem_info(gfile,
G_FILE_ATTRIBUTE_FILESYSTEM_FREE, NULL, NULL);
if (info != NULL)
{
if (g_file_info_has_attribute(info, G_FILE_ATTRIBUTE_FILESYSTEM_FREE))
{
- size = g_file_info_get_attribute_uint64(info,
+ size = g_file_info_get_attribute_uint64(info,
G_FILE_ATTRIBUTE_FILESYSTEM_FREE);
-
+
gint64 fsize = (guint64)10 * 1024 * 1024 * 1024;
if (size < fsize)
{
@@ -684,7 +684,7 @@ ghb_queue_add(signal_user_data_t *ud, GValue *settings, gint batch)
// Add settings to the queue
gint titleindex;
gint titlenum;
-
+
g_debug("queue_add ()");
if (!validate_settings(ud, settings, batch))
{
@@ -693,6 +693,12 @@ ghb_queue_add(signal_user_data_t *ud, GValue *settings, gint batch)
if (ud->queue == NULL)
ud->queue = ghb_array_value_new(32);
+
+ // Copy current prefs into settings
+ // The job should run with the preferences that existed
+ // when the job was added to the queue.
+ ghb_settings_set_value(settings, "Preferences", ud->prefs);
+
// Make a copy of current settings to be used for the new job
ghb_settings_set_int(settings, "job_status", GHB_QUEUE_PENDING);
ghb_settings_set_int(settings, "job_unique_id", 0);
@@ -775,7 +781,7 @@ queue_remove_clicked_cb(GtkWidget *widget, gchar *path, signal_user_data_t *ud)
ghb_save_queue(ud->queue);
}
else
- {
+ {
gtk_tree_path_free (treepath);
}
ghb_update_pending(ud);
@@ -787,7 +793,7 @@ find_last_finished(GValue *queue)
GValue *js;
gint ii, count;
gint status;
-
+
g_debug("find_last_finished");
count = ghb_array_len(queue);
for (ii = 0; ii < count; ii++)
@@ -876,7 +882,7 @@ queue_drag_motion_cb(
gdk_drag_status(ctx, 0, time);
return TRUE;
}
- if (pos != GTK_TREE_VIEW_DROP_AFTER &&
+ if (pos != GTK_TREE_VIEW_DROP_AFTER &&
row == finished)
{
gtk_tree_path_free(path);
@@ -889,13 +895,13 @@ queue_drag_motion_cb(
return TRUE;
}
-G_MODULE_EXPORT void
+G_MODULE_EXPORT void
queue_drag_cb(
- GtkTreeView *dstwidget,
- GdkDragContext *dc,
- gint x, gint y,
- GtkSelectionData *selection_data,
- guint info, guint t,
+ GtkTreeView *dstwidget,
+ GdkDragContext *dc,
+ gint x, gint y,
+ GtkSelectionData *selection_data,
+ guint info, guint t,
signal_user_data_t *ud)
{
GtkTreePath *path = NULL;
@@ -904,9 +910,9 @@ queue_drag_cb(
GtkTreeIter dstiter, srciter;
gint *indices, row;
GValue *js;
-
+
GtkTreeModel *dstmodel = gtk_tree_view_get_model(dstwidget);
-
+
g_debug("queue_drag_cb ()");
// This doesn't work here for some reason...
// gtk_tree_view_get_drag_dest_row(dstwidget, &path, &pos);
@@ -957,13 +963,13 @@ queue_drag_cb(
{
case GTK_TREE_VIEW_DROP_BEFORE:
case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE:
- gtk_tree_store_insert_before (GTK_TREE_STORE (dstmodel),
+ gtk_tree_store_insert_before (GTK_TREE_STORE (dstmodel),
&iter, NULL, &dstiter);
break;
case GTK_TREE_VIEW_DROP_AFTER:
case GTK_TREE_VIEW_DROP_INTO_OR_AFTER:
- gtk_tree_store_insert_after (GTK_TREE_STORE (dstmodel),
+ gtk_tree_store_insert_after (GTK_TREE_STORE (dstmodel),
&iter, NULL, &dstiter);
break;
@@ -1007,10 +1013,10 @@ ghb_queue_buttons_grey(signal_user_data_t *ud)
queue_state = ghb_get_queue_state();
scan_state = ghb_get_scan_state();
- show_stop = queue_state &
- (GHB_STATE_WORKING | GHB_STATE_SEARCHING |
+ show_stop = queue_state &
+ (GHB_STATE_WORKING | GHB_STATE_SEARCHING |
GHB_STATE_SCANNING | GHB_STATE_MUXING);
- show_start = !(scan_state & GHB_STATE_SCANNING) &&
+ show_start = !(scan_state & GHB_STATE_SCANNING) &&
(titleindex >= 0 || queue_count > 0);
@@ -1145,7 +1151,7 @@ queue_list_size_allocate_cb(GtkWidget *widget, GtkAllocation *allocation, GtkCel
{
GtkTreeViewColumn *column;
gint width;
-
+
column = gtk_tree_view_get_column (GTK_TREE_VIEW(widget), 0);
width = gtk_tree_view_column_get_width(column);
g_debug("col width %d alloc width %d", width, allocation->width);
@@ -1165,7 +1171,7 @@ queue_start_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
gint state;
state = ghb_get_queue_state();
- if (state & (GHB_STATE_WORKING | GHB_STATE_SEARCHING |
+ if (state & (GHB_STATE_WORKING | GHB_STATE_SEARCHING |
GHB_STATE_SCANNING | GHB_STATE_MUXING))
{
ghb_cancel_encode(ud, _("You are currently encoding. "
@@ -1178,7 +1184,7 @@ queue_start_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
{
js = ghb_array_get_nth(ud->queue, ii);
status = ghb_settings_get_int(js, "job_status");
- if ((status == GHB_QUEUE_RUNNING) ||
+ if ((status == GHB_QUEUE_RUNNING) ||
(status == GHB_QUEUE_PENDING))
{
running = TRUE;
@@ -1290,9 +1296,9 @@ find_pid:
return FALSE;
}
-G_MODULE_EXPORT gboolean
+G_MODULE_EXPORT gboolean
queue_key_press_cb(
- GtkWidget *widget,
+ GtkWidget *widget,
GdkEventKey *event,
signal_user_data_t *ud)
{
diff --git a/gtk/src/queuehandler.h b/gtk/src/queuehandler.h
index 6a261677e..abf33757a 100644
--- a/gtk/src/queuehandler.h
+++ b/gtk/src/queuehandler.h
@@ -2,19 +2,19 @@
/*
* queuehandler.h
* Copyright (C) John Stebbins 2008-2013 <stebbins@stebbins>
- *
+ *
* queuehandler.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.
- *
+ *
* callbacks.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.,
diff --git a/gtk/src/resources.c b/gtk/src/resources.c
index d29375989..05ec53ec7 100644
--- a/gtk/src/resources.c
+++ b/gtk/src/resources.c
@@ -2,14 +2,14 @@
/*
* resources.c
* Copyright (C) John Stebbins 2008-2013 <stebbins@stebbins>
- *
+ *
* resources.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.
- *
+ *
*/
#include <glib.h>
#include <glib-object.h>
diff --git a/gtk/src/resources.h b/gtk/src/resources.h
index dfca11db2..59a1e499b 100644
--- a/gtk/src/resources.h
+++ b/gtk/src/resources.h
@@ -3,12 +3,12 @@
* 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.
- *
+ *
* This program 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 Library General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
diff --git a/gtk/src/settings.c b/gtk/src/settings.c
index 5acee1ece..6094a0454 100644
--- a/gtk/src/settings.c
+++ b/gtk/src/settings.c
@@ -2,14 +2,14 @@
/*
* settings.c
* Copyright (C) John Stebbins 2008-2013 <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.
- *
+ *
*/
#include <fcntl.h>
#include <unistd.h>
@@ -39,8 +39,8 @@ ghb_settings_new()
void
ghb_settings_set_value(
- GValue *settings,
- const gchar *key,
+ GValue *settings,
+ const gchar *key,
const GValue *value)
{
if (key == NULL || value == NULL)
@@ -56,8 +56,8 @@ ghb_settings_take_value(GValue *settings, const gchar *key, GValue *value)
void
ghb_settings_set_string(
- GValue *settings,
- const gchar *key,
+ GValue *settings,
+ const gchar *key,
const gchar *sval)
{
GValue *value;
@@ -183,11 +183,11 @@ const gchar*
ghb_get_setting_key(GtkWidget *widget)
{
const gchar *name;
-
+
g_debug("get_setting_key ()\n");
if (widget == NULL) return NULL;
name = gtk_buildable_get_name(GTK_BUILDABLE(widget));
-
+
if (name == NULL)
{
name = gtk_widget_get_name(widget);
@@ -207,7 +207,7 @@ ghb_widget_value(GtkWidget *widget)
GValue *value = NULL;
const gchar *name;
GType type;
-
+
if (widget == NULL)
{
g_debug("NULL widget\n");
@@ -364,7 +364,7 @@ ghb_widget_string(GtkWidget *widget)
{
GValue *value;
gchar *sval;
-
+
value = ghb_widget_value(widget);
sval = ghb_value_string(value);
ghb_value_free(value);
@@ -376,7 +376,7 @@ ghb_widget_double(GtkWidget *widget)
{
GValue *value;
gdouble dval;
-
+
value = ghb_widget_value(widget);
dval = ghb_value_double(value);
ghb_value_free(value);
@@ -388,7 +388,7 @@ ghb_widget_int64(GtkWidget *widget)
{
GValue *value;
gint64 ival;
-
+
value = ghb_widget_value(widget);
ival = ghb_value_int64(value);
ghb_value_free(value);
@@ -400,7 +400,7 @@ ghb_widget_int(GtkWidget *widget)
{
GValue *value;
gint ival;
-
+
value = ghb_widget_value(widget);
ival = (gint)ghb_value_int64(value);
ghb_value_free(value);
@@ -412,7 +412,7 @@ ghb_widget_boolean(GtkWidget *widget)
{
GValue *value;
gboolean bval;
-
+
value = ghb_widget_value(widget);
bval = ghb_value_boolean(value);
ghb_value_free(value);
@@ -424,7 +424,7 @@ ghb_widget_to_setting(GValue *settings, GtkWidget *widget)
{
const gchar *key = NULL;
GValue *value;
-
+
if (widget == NULL) return;
g_debug("ghb_widget_to_setting");
// Find corresponding setting
@@ -467,7 +467,8 @@ ghb_update_widget(GtkWidget *widget, const GValue *value)
else if (type == GTK_TYPE_RADIO_BUTTON)
{
g_debug("radio button");
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), !!ival);
+ if (ival)
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), !!ival);
}
else if (type == GTK_TYPE_CHECK_BUTTON)
{
@@ -624,7 +625,7 @@ ghb_update_widget(GtkWidget *widget, const GValue *value)
}
int
-ghb_ui_update_from_settings(GtkBuilder *builder, const gchar *name, const GValue *settings)
+ghb_ui_update_from_settings(signal_user_data_t *ud, const gchar *name, const GValue *settings)
{
GObject *object;
GValue * value;
@@ -635,13 +636,16 @@ ghb_ui_update_from_settings(GtkBuilder *builder, const gchar *name, const GValue
value = ghb_settings_get_value(settings, name);
if (value == NULL)
return 0;
- object = GHB_OBJECT(builder, name);
+ object = GHB_OBJECT(ud->builder, name);
if (object == NULL)
{
g_debug("Failed to find widget for key: %s\n", name);
return -1;
}
ghb_update_widget((GtkWidget*)object, value);
+ // Its possible the value hasn't changed. Since settings are only
+ // updated when the value changes, I'm initializing settings here as well.
+ ghb_widget_to_setting(ud->settings, (GtkWidget*)object);
return 0;
}
@@ -666,3 +670,28 @@ ghb_ui_update(signal_user_data_t *ud, const gchar *name, const GValue *value)
return 0;
}
+int
+ghb_ui_settings_update(
+ signal_user_data_t *ud,
+ GValue *settings,
+ const gchar *name,
+ const GValue *value)
+{
+ GObject *object;
+
+ g_debug("ghb_ui_update() %s", name);
+ if (name == NULL || value == NULL)
+ return 0;
+ object = GHB_OBJECT(ud->builder, name);
+ if (object == NULL)
+ {
+ g_debug("Failed to find widget for key: %s\n", name);
+ return -1;
+ }
+ ghb_update_widget((GtkWidget*)object, value);
+ // Its possible the value hasn't changed. Since settings are only
+ // updated when the value changes, I'm initializing settings here as well.
+ ghb_widget_to_setting(settings, (GtkWidget*)object);
+ return 0;
+}
+
diff --git a/gtk/src/settings.h b/gtk/src/settings.h
index 6e3ee55ff..9d28da729 100644
--- a/gtk/src/settings.h
+++ b/gtk/src/settings.h
@@ -3,12 +3,12 @@
* 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.
- *
+ *
* This program 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 Library General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
@@ -58,7 +58,10 @@ typedef struct
gboolean scale_busy;
gint cancel_encode;
GtkBuilder *builder;
+ GValue *globals;
+ GValue *prefs;
GValue *settings;
+ GValue *settings_array;
GValue *queue;
GValue *current_job;
GIOChannel *activity_log;
@@ -116,7 +119,10 @@ void ghb_widget_to_setting(GValue *settings, GtkWidget *widget);
int ghb_ui_update(
signal_user_data_t *ud, const gchar *name, const GValue *value);
int ghb_ui_update_from_settings(
- GtkBuilder *builder, const gchar *name, const GValue *settings);
+ signal_user_data_t *ud, const gchar *name, const GValue *settings);
+int ghb_ui_settings_update(
+ signal_user_data_t *ud, GValue *settings, const gchar *name,
+ const GValue *value);
const gchar* ghb_get_setting_key(GtkWidget *widget);
void ghb_update_widget(GtkWidget *widget, const GValue *value);
diff --git a/gtk/src/subtitlehandler.c b/gtk/src/subtitlehandler.c
index abaee4b2e..9fc959666 100644
--- a/gtk/src/subtitlehandler.c
+++ b/gtk/src/subtitlehandler.c
@@ -115,7 +115,7 @@ subtitle_refresh_list_row_ui(
}
static void
-subtitle_refresh_list_ui(signal_user_data_t *ud)
+subtitle_refresh_list_ui_from_settings(signal_user_data_t *ud, GValue *settings)
{
GValue *subtitle_list;
GValue *subsettings;
@@ -129,7 +129,7 @@ subtitle_refresh_list_ui(signal_user_data_t *ud)
tm_count = gtk_tree_model_iter_n_children(tm, NULL);
- subtitle_list = ghb_settings_get_value(ud->settings, "subtitle_list");
+ subtitle_list = ghb_settings_get_value(settings, "subtitle_list");
count = ghb_array_len(subtitle_list);
if (count != tm_count)
{
@@ -148,6 +148,12 @@ subtitle_refresh_list_ui(signal_user_data_t *ud)
}
}
+static void
+subtitle_refresh_list_ui(signal_user_data_t *ud)
+{
+ subtitle_refresh_list_ui_from_settings(ud, ud->settings);
+}
+
void
ghb_subtitle_exclusive_burn_settings(GValue *settings, gint index)
{
@@ -301,6 +307,7 @@ subtitle_set_track_description(GValue *subsettings)
}
static GValue* subtitle_add_track(
+ signal_user_data_t *ud,
GValue *settings,
hb_title_t *title,
int track,
@@ -340,7 +347,7 @@ static GValue* subtitle_add_track(
ghb_settings_set_string(subsettings, "SrtCodeset", "UTF-8");
- dir = ghb_settings_get_string(settings, "SrtDir");
+ dir = ghb_settings_get_string(ud->prefs, "SrtDir");
filename = g_strdup_printf("%s/none", dir);
ghb_settings_set_string(subsettings, "SrtFile", filename);
g_free(dir);
@@ -393,7 +400,7 @@ ghb_subtitle_title_change(signal_user_data_t *ud, gboolean show)
}
void
-ghb_set_pref_subtitle_settings(hb_title_t *title, GValue *settings)
+ghb_set_pref_subtitle_settings(signal_user_data_t *ud, hb_title_t *title, GValue *settings)
{
gint track;
gboolean *used;
@@ -461,7 +468,7 @@ ghb_set_pref_subtitle_settings(hb_title_t *title, GValue *settings)
if (track > 0)
{
used[track] = TRUE;
- subtitle_add_track(settings, title, track, mux,
+ subtitle_add_track(ud, settings, title, track, mux,
TRUE, FALSE, &one_burned);
}
}
@@ -470,7 +477,8 @@ ghb_set_pref_subtitle_settings(hb_title_t *title, GValue *settings)
(audio_lang != NULL && !strncmp(audio_lang, pref_lang, 4)))
{
// Add search for foreign audio segments
- subtitle_add_track(settings, title, -1, mux, TRUE, FALSE, &one_burned);
+ subtitle_add_track(ud, settings, title, -1, mux,
+ TRUE, FALSE, &one_burned);
}
if (behavior != 0)
@@ -488,7 +496,7 @@ ghb_set_pref_subtitle_settings(hb_title_t *title, GValue *settings)
if (!used[track])
{
used[track] = TRUE;
- subtitle_add_track(settings, title, track, mux,
+ subtitle_add_track(ud, settings, title, track, mux,
FALSE, FALSE, &one_burned);
}
next_track = track + 1;
@@ -516,7 +524,7 @@ ghb_set_pref_subtitle_settings(hb_title_t *title, GValue *settings)
if (track < sub_count && !used[track])
{
used[track] = TRUE;
- subtitle_add_track(settings, title, track, mux,
+ subtitle_add_track(ud, settings, title, track, mux,
FALSE, FALSE, &one_burned);
}
}
@@ -548,7 +556,7 @@ ghb_set_pref_subtitle(gint titleindex, signal_user_data_t *ud)
widget = GHB_WIDGET(ud->builder, "SubtitleSrtDisable");
gtk_widget_set_sensitive(widget, TRUE);
}
- ghb_set_pref_subtitle_settings(title, ud->settings);
+ ghb_set_pref_subtitle_settings(ud, title, ud->settings);
subtitle_refresh_list_ui(ud);
}
@@ -621,31 +629,16 @@ subtitle_update_dialog_widgets(signal_user_data_t *ud, GValue *subsettings)
if (subsettings != NULL)
{
// Update widgets with subsettings
- gchar *str, *track;
- gint offset;
gboolean burn, force, def;
int mux = ghb_settings_combo_int(ud->settings, "FileFormat");
int source = ghb_settings_get_int(subsettings, "SubtitleSource");
- track = ghb_settings_get_string(subsettings, "SubtitleTrack");
- ghb_ui_update(ud, "SubtitleTrack", ghb_string_value(track));
- g_free(track);
-
- str = ghb_settings_get_string(subsettings, "SrtLanguage");
- ghb_ui_update(ud, "SrtLanguage", ghb_string_value(str));
- g_free(str);
-
- str = ghb_settings_get_string(subsettings, "SrtCodeset");
- ghb_ui_update(ud, "SrtCodeset", ghb_string_value(str));
- g_free(str);
-
- str = ghb_settings_get_string(subsettings, "SrtFile");
- ghb_ui_update(ud, "SrtFile", ghb_string_value(str));
- g_free(str);
-
- offset = ghb_settings_get_int(subsettings, "SrtOffset");
- ghb_ui_update(ud, "SrtOffset", ghb_int_value(offset));
+ ghb_ui_update_from_settings(ud, "SubtitleTrack", subsettings);
+ ghb_ui_update_from_settings(ud, "SrtLanguage", subsettings);
+ ghb_ui_update_from_settings(ud, "SrtCodeset", subsettings);
+ ghb_ui_update_from_settings(ud, "SrtFile", subsettings);
+ ghb_ui_update_from_settings(ud, "SrtOffset", subsettings);
if (source == SRTSUB)
{
@@ -688,36 +681,23 @@ subtitle_update_dialog_widgets(signal_user_data_t *ud, GValue *subsettings)
ghb_settings_set_boolean(subsettings, "SubtitleDefaultTrack", def);
ghb_ui_update(ud, "SubtitleDefaultTrack", ghb_boolean_value(def));
- if (source == SRTSUB)
- {
- // Hide regular subtitle widgets
- widget = GHB_WIDGET(ud->builder, "subtitle_track_box");
- gtk_widget_hide(widget);
-
- // Show SRT subitle widgets
- widget = GHB_WIDGET(ud->builder, "subtitle_srt_grid");
- gtk_widget_show(widget);
- }
- else
- {
- // Hide SRT subitle widgets
- widget = GHB_WIDGET(ud->builder, "subtitle_srt_grid");
- gtk_widget_hide(widget);
+ // Hide regular subtitle widgets
+ widget = GHB_WIDGET(ud->builder, "subtitle_track_box");
+ gtk_widget_set_visible(widget, source != SRTSUB);
- // Show regular subtitle widgets
- widget = GHB_WIDGET(ud->builder, "subtitle_track_box");
- gtk_widget_show(widget);
- }
+ // Show SRT subitle widgets
+ widget = GHB_WIDGET(ud->builder, "subtitle_srt_grid");
+ gtk_widget_set_visible(widget, source == SRTSUB);
}
else
{
// Hide SRT subitle widgets
widget = GHB_WIDGET(ud->builder, "subtitle_srt_grid");
- gtk_widget_hide(widget);
+ gtk_widget_set_visible(widget, FALSE);
// Show regular subtitle widgets
widget = GHB_WIDGET(ud->builder, "subtitle_track_box");
- gtk_widget_show(widget);
+ gtk_widget_set_visible(widget, TRUE);
}
}
@@ -916,15 +896,15 @@ srt_file_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
filename = ghb_settings_get_string(subsettings, "SrtFile");
if (g_file_test(filename, G_FILE_TEST_IS_DIR))
{
- ghb_settings_set_string(ud->settings, "SrtDir", filename);
+ ghb_settings_set_string(ud->prefs, "SrtDir", filename);
}
else
{
dirname = g_path_get_dirname(filename);
- ghb_settings_set_string(ud->settings, "SrtDir", dirname);
+ ghb_settings_set_string(ud->prefs, "SrtDir", dirname);
g_free(dirname);
}
- ghb_pref_save(ud->settings, "SrtDir");
+ ghb_pref_save(ud->prefs, "SrtDir");
g_free(filename);
}
}
@@ -1089,12 +1069,12 @@ subtitle_add_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
for (subsettings = NULL, track = 0;
subsettings == NULL && track < count; track++)
{
- subsettings = subtitle_add_track(ud->settings, title, track, mux,
+ subsettings = subtitle_add_track(ud, ud->settings, title, track, mux,
FALSE, FALSE, &one_burned);
}
if (subsettings == NULL)
{
- subsettings = subtitle_add_track(ud->settings, title, 0, mux,
+ subsettings = subtitle_add_track(ud, ud->settings, title, 0, mux,
FALSE, TRUE, &one_burned);
}
ghb_add_subtitle_to_ui(ud, subsettings);
@@ -1146,7 +1126,7 @@ subtitle_add_all_clicked_cb(GtkWidget *xwidget, signal_user_data_t *ud)
int count = hb_list_count(title->list_subtitle);
for (track = 0; track < count; track++)
{
- subtitle_add_track(ud->settings, title, track, mux,
+ subtitle_add_track(ud, ud->settings, title, track, mux,
FALSE, FALSE, &one_burned);
}
subtitle_refresh_list_ui(ud);
@@ -1431,7 +1411,7 @@ static void subtitle_def_lang_list_init(signal_user_data_t *ud)
}
}
-void ghb_subtitle_def_settings_init(signal_user_data_t *ud)
+void ghb_subtitle_defaults_to_ui(signal_user_data_t *ud)
{
subtitle_def_lang_list_init(ud);
}
diff --git a/gtk/src/subtitlehandler.h b/gtk/src/subtitlehandler.h
index e1f261d3c..5e09d4f6c 100644
--- a/gtk/src/subtitlehandler.h
+++ b/gtk/src/subtitlehandler.h
@@ -2,19 +2,19 @@
/*
* subtitlehandler.h
* Copyright (C) John Stebbins 2008-2013 <stebbins@stebbins>
- *
+ *
* audiohandler.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.
- *
+ *
* callbacks.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.,
@@ -28,14 +28,14 @@
#include "settings.h"
void ghb_set_pref_subtitle(gint titleindex, signal_user_data_t *ud);
-void ghb_set_pref_subtitle_settings(hb_title_t *title, GValue *settings);
+void ghb_set_pref_subtitle_settings(signal_user_data_t *ud, hb_title_t *title, GValue *settings);
void ghb_set_subtitle(signal_user_data_t *ud, gint track, GValue *settings);
void ghb_reset_subtitles(signal_user_data_t *ud, GValue *settings);
void ghb_subtitle_prune(signal_user_data_t *ud);
void ghb_subtitle_list_refresh_selected(signal_user_data_t *ud);
void ghb_subtitle_list_refresh_all(signal_user_data_t *ud);
void ghb_init_subtitle_defaults_ui(signal_user_data_t *ud);
-void ghb_subtitle_def_settings_init(signal_user_data_t *ud);
+void ghb_subtitle_defaults_to_ui(signal_user_data_t *ud);
void ghb_subtitle_title_change(signal_user_data_t *ud, gboolean show);
#endif // _SUBTITLEHANDLER_H_
diff --git a/gtk/src/values.c b/gtk/src/values.c
index 2b253c0e6..85886e17e 100644
--- a/gtk/src/values.c
+++ b/gtk/src/values.c
@@ -2,14 +2,14 @@
/*
* presets.c
* Copyright (C) John Stebbins 2008-2013 <stebbins@stebbins>
- *
+ *
* presets.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.
- *
+ *
*/
#include <glib.h>
@@ -264,7 +264,7 @@ ghb_value_cmp(const GValue *vala, const GValue *valb)
{
return 1;
}
-
+
if (typa == G_TYPE_STRING)
{
char *stra, *strb;
@@ -288,7 +288,7 @@ ghb_value_cmp(const GValue *vala, const GValue *valb)
g_free(strb);
return res;
}
- else if (typa == G_TYPE_INT64 || typa == G_TYPE_INT ||
+ else if (typa == G_TYPE_INT64 || typa == G_TYPE_INT ||
typa == G_TYPE_BOOLEAN)
{
return ghb_value_int64(vala) - ghb_value_int64(valb);
@@ -446,7 +446,7 @@ ghb_array_value_reset(GValue *gval, guint size)
g_value_take_boxed(gval, array);
}
-GValue*
+GValue*
ghb_date_value_new(GDate *date)
{
GValue *gval = ghb_value_new(g_date_get_type());
@@ -454,7 +454,7 @@ ghb_date_value_new(GDate *date)
return gval;
}
-GValue*
+GValue*
ghb_rawdata_value_new(ghb_rawdata_t *data)
{
GValue *gval = ghb_value_new(ghb_rawdata_get_type());
@@ -780,14 +780,14 @@ xform_boolean_double(const GValue *bval, GValue *dval)
void
ghb_register_transforms()
{
- g_value_register_transform_func(G_TYPE_STRING, G_TYPE_INT64,
+ g_value_register_transform_func(G_TYPE_STRING, G_TYPE_INT64,
xform_string_int64);
- g_value_register_transform_func(G_TYPE_STRING, G_TYPE_INT,
+ g_value_register_transform_func(G_TYPE_STRING, G_TYPE_INT,
xform_string_int);
- g_value_register_transform_func(G_TYPE_STRING, G_TYPE_DOUBLE,
+ g_value_register_transform_func(G_TYPE_STRING, G_TYPE_DOUBLE,
xform_string_double);
- g_value_register_transform_func(G_TYPE_BOOLEAN, G_TYPE_DOUBLE,
+ g_value_register_transform_func(G_TYPE_BOOLEAN, G_TYPE_DOUBLE,
xform_boolean_double);
- g_value_register_transform_func(G_TYPE_DOUBLE, G_TYPE_STRING,
+ g_value_register_transform_func(G_TYPE_DOUBLE, G_TYPE_STRING,
xform_double_string);
}
diff --git a/gtk/src/values.h b/gtk/src/values.h
index dde169036..f58b2dbfb 100644
--- a/gtk/src/values.h
+++ b/gtk/src/values.h
@@ -3,12 +3,12 @@
* 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.
- *
+ *
* This program 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 Library General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
diff --git a/gtk/src/x264handler.c b/gtk/src/x264handler.c
index c97bca218..753987954 100644
--- a/gtk/src/x264handler.c
+++ b/gtk/src/x264handler.c
@@ -2,9 +2,9 @@
/*
* x264handler.c
* Copyright (C) John Stebbins 2008-2013 <stebbins@stebbins>
- *
+ *
* x264handler.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)
@@ -29,22 +29,23 @@ static gboolean ignore_options_update = FALSE;
void ghb_show_hide_advanced_video( signal_user_data_t *ud )
{
- GtkWidget *nb = GHB_WIDGET(ud->builder, "SettingsNotebook");
- GtkWidget *at = GHB_WIDGET(ud->builder, "advanced_tab");
+ gboolean hide;
- int pgn = gtk_notebook_page_num(GTK_NOTEBOOK(nb), at);
-
- GtkWidget *pg;
- pg = gtk_notebook_get_nth_page(GTK_NOTEBOOK(nb), pgn);
- if (ghb_settings_get_boolean(ud->settings, "HideAdvancedVideoSettings"))
+ hide = ghb_settings_get_boolean(ud->prefs, "HideAdvancedVideoSettings");
+ if (hide)
{
- gtk_widget_hide(pg);
ghb_ui_update(ud, "x264UseAdvancedOptions", ghb_boolean_value(FALSE));
}
- else
- {
- gtk_widget_show(pg);
- }
+
+ GtkWidget *widget;
+ GtkWidget *nb = GHB_WIDGET(ud->builder, "SettingsNotebook");
+ GtkWidget *at = GHB_WIDGET(ud->builder, "advanced_tab");
+ int pgn = gtk_notebook_page_num(GTK_NOTEBOOK(nb), at);
+
+ widget = gtk_notebook_get_nth_page(GTK_NOTEBOOK(nb), pgn);
+ gtk_widget_set_visible(widget, !hide);
+ widget = GHB_WIDGET(ud->builder, "x264UseAdvancedOptions");
+ gtk_widget_set_visible(widget, !hide);
}
G_MODULE_EXPORT void
@@ -52,7 +53,7 @@ x264_use_advanced_options_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
{
ghb_widget_to_setting(ud->settings, widget);
- if (ghb_settings_get_boolean(ud->settings, "HideAdvancedVideoSettings") &&
+ if (ghb_settings_get_boolean(ud->prefs, "HideAdvancedVideoSettings") &&
ghb_settings_get_boolean(ud->settings, "x264UseAdvancedOptions"))
{
ghb_ui_update(ud, "x264UseAdvancedOptions", ghb_boolean_value(FALSE));
@@ -347,7 +348,7 @@ x264_entry_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
}
G_MODULE_EXPORT gboolean
-x264_focus_out_cb(GtkWidget *widget, GdkEventFocus *event,
+x264_focus_out_cb(GtkWidget *widget, GdkEventFocus *event,
signal_user_data_t *ud)
{
gchar *options, *sopts;
@@ -442,7 +443,7 @@ struct x264_opt_map_s
static gchar *x264_ref_syns[] = {"ref", "frameref", NULL};
static gchar *x264_bframes_syns[] = {"bframes", NULL};
static gchar *x264_badapt_syns[] = {"b-adapt", "b_adapt", NULL};
-static gchar *x264_direct_syns[] =
+static gchar *x264_direct_syns[] =
{"direct", "direct-pred", "direct_pred", NULL};
static gchar *x264_weightp_syns[] = {"weightp", NULL};
static gchar *x264_bpyramid_syns[] = {"b-pyramid", "b_pyramid", NULL};
@@ -458,7 +459,7 @@ static gchar *x264_pskip_syns[] = {"no-fast-pskip", "no_fast_pskip", NULL};
static gchar *x264_psy_syns[] = {"psy-rd", "psy_rd", NULL};
static gchar *x264_aq_strength_syns[] = {"aq-strength", "aq_strength", NULL};
static gchar *x264_mbtree_syns[] = {"mbtree", NULL};
-static gchar *x264_decimate_syns[] =
+static gchar *x264_decimate_syns[] =
{"no-dct-decimate", "no_dct_decimate", NULL};
static gchar *x264_cabac_syns[] = {"cabac", NULL};
@@ -554,7 +555,7 @@ static gchar *true_str[] =
NULL
};
-static gboolean
+static gboolean
str_is_true(const gchar *str)
{
gint ii;
@@ -654,7 +655,7 @@ x264_update_deblock(signal_user_data_t *ud, const gchar *xval)
if (xval == NULL) return;
val = g_strdup(xval);
bvalue = avalue = 0;
- if (val != NULL)
+ if (val != NULL)
{
gchar *pos = strchr(val, ',');
if (pos != NULL)
@@ -783,7 +784,7 @@ ghb_x264_parse_options(signal_user_data_t *ud, const gchar *options)
val = trans_x264_val(x264_opt_map[jj].translation, val);
if (val != NULL)
{
- do_update(ud, x264_opt_map[jj].name,
+ do_update(ud, x264_opt_map[jj].name,
x264_opt_map[jj].translation->ui_type, val);
// TODO un-grey the ui control
}
@@ -836,7 +837,7 @@ ghb_x264_parse_options(signal_user_data_t *ud, const gchar *options)
val = g_strdup(trans_x264_val(x264_opt_map[jj].translation, val));
if (val != NULL)
{
- do_update(ud, x264_opt_map[jj].name,
+ do_update(ud, x264_opt_map[jj].name,
x264_opt_map[jj].translation->ui_type, val);
// TODO un-grey the ui control
}
@@ -1107,7 +1108,7 @@ ghb_lookup_badapt(const gchar *options)
gint ret = 0;
gchar *result;
gchar **split;
-
+
if (options == NULL)
options = "";
@@ -1129,7 +1130,7 @@ ghb_lookup_aqmode(const gchar *options)
gint ret = 0;
gchar *result;
gchar **split;
-
+
if (options == NULL)
options = "";
@@ -1151,7 +1152,7 @@ ghb_lookup_bframes(const gchar *options)
gint ret = 0;
gchar *result;
gchar **split;
-
+
if (options == NULL)
options = "";
@@ -1173,7 +1174,7 @@ ghb_lookup_mbtree(const gchar *options)
gint ret = ghb_lookup_bframes(options) != 0;
gchar *result;
gchar **split;
-
+
if (options == NULL)
options = "";
@@ -1282,7 +1283,7 @@ sanitize_x264opts(signal_user_data_t *ud, const gchar *options)
}
G_MODULE_EXPORT gboolean
-lavc_focus_out_cb(GtkWidget *widget, GdkEventFocus *event,
+lavc_focus_out_cb(GtkWidget *widget, GdkEventFocus *event,
signal_user_data_t *ud)
{
ghb_widget_to_setting(ud->settings, widget);
diff --git a/gtk/src/x264handler.h b/gtk/src/x264handler.h
index d29f16290..a29c2626c 100644
--- a/gtk/src/x264handler.h
+++ b/gtk/src/x264handler.h
@@ -2,19 +2,19 @@
/*
* x264handler.h
* Copyright (C) John Stebbins 2008-2013 <stebbins@stebbins>
- *
+ *
* x264handler.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.
- *
+ *
* callbacks.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.,