diff options
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/src/callbacks.c | 55 | ||||
-rw-r--r-- | gtk/src/ghb.ui | 92 | ||||
-rw-r--r-- | gtk/src/hb-backend.c | 116 | ||||
-rw-r--r-- | gtk/src/hb-backend.h | 1 | ||||
-rw-r--r-- | gtk/src/internal_defaults.xml | 2 | ||||
-rw-r--r-- | gtk/src/resource_data.h | 139 | ||||
-rw-r--r-- | gtk/src/resources.plist | 94 | ||||
-rw-r--r-- | gtk/src/settings.c | 14 | ||||
-rw-r--r-- | gtk/src/settings.h | 1 | ||||
-rw-r--r-- | gtk/src/x264handler.c | 2 |
10 files changed, 379 insertions, 137 deletions
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c index c68bb49e1..1898271af 100644 --- a/gtk/src/callbacks.c +++ b/gtk/src/callbacks.c @@ -1106,6 +1106,30 @@ setting_widget_changed_cb(GtkWidget *widget, signal_user_data_t *ud) } void +vquality_changed_cb(GtkWidget *widget, signal_user_data_t *ud) +{ + ghb_widget_to_setting(ud->settings, widget); + ghb_check_dependency(ud, widget); + ghb_clear_presets_selection(ud); + ghb_live_reset(ud); + + gint vcodec = ghb_settings_combo_int(ud->settings, "VideoEncoder"); + gdouble step; + if (vcodec == HB_VCODEC_X264) + { + step = ghb_settings_combo_double(ud->settings, + "VideoQualityGranularity"); + } + else + { + step = 1; + } + gdouble val = gtk_range_get_value(GTK_RANGE(widget)); + val = ((int)((val + step / 2) / step)) * step; + gtk_range_set_value(GTK_RANGE(widget), val); +} + +void http_opt_changed_cb(GtkWidget *widget, signal_user_data_t *ud) { ghb_widget_to_setting(ud->settings, widget); @@ -1122,7 +1146,6 @@ vcodec_changed_cb(GtkWidget *widget, signal_user_data_t *ud) gdouble vqmin, vqmax, step, page; gboolean inverted; gint digits; - gint vcodec; ghb_widget_to_setting(ud->settings, widget); ghb_check_dependency(ud, widget); @@ -1134,14 +1157,13 @@ vcodec_changed_cb(GtkWidget *widget, signal_user_data_t *ud) 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); - vcodec = ghb_settings_combo_int(ud->settings, "VideoEncoder"); } void target_size_changed_cb(GtkWidget *widget, signal_user_data_t *ud) { const gchar *name = gtk_widget_get_name(widget); - g_debug("setting_widget_changed_cb () %s", name); + g_debug("target_size_changed_cb () %s", name); ghb_widget_to_setting(ud->settings, widget); ghb_check_dependency(ud, widget); ghb_clear_presets_selection(ud); @@ -2364,6 +2386,25 @@ pref_changed_cb(GtkWidget *widget, signal_user_data_t *ud) } 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_check_dependency(ud, widget); + + const gchar *name = gtk_widget_get_name(widget); + ghb_pref_save(ud->settings, name); + + 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_increments (GTK_RANGE(qp), step, page); +} + +void tweaks_changed_cb(GtkWidget *widget, signal_user_data_t *ud) { g_debug("tweaks_changed_cb"); @@ -2817,22 +2858,22 @@ format_vquality_cb(GtkScale *scale, gdouble val, signal_user_data_t *ud) crf = ghb_settings_get_boolean(ud->settings, "constant_rate_factor"); percent = 100. * (51 - val) / 51.; if (crf) - return g_strdup_printf("RF: %.1f / %.1f%%", val, percent); + return g_strdup_printf("RF: %.4g (%.0f%%)", val, percent); else - return g_strdup_printf("QP: %.1f / %.1f%%", val, percent); + return g_strdup_printf("QP: %.4g (%.0f%%)", val, percent); } break; case HB_VCODEC_XVID: case HB_VCODEC_FFMPEG: { percent = 100. * (30 - (val - 1)) / 30.; - return g_strdup_printf("QP: %d / %.1f%%", (int)val, percent); + return g_strdup_printf("QP: %d (%.0f%%)", (int)val, percent); } break; case HB_VCODEC_THEORA: { percent = 100. * val / 63.; - return g_strdup_printf("QP: %d / %.1f%%", (int)val, percent); + return g_strdup_printf("QP: %d (%.0f%%)", (int)val, percent); } break; default: diff --git a/gtk/src/ghb.ui b/gtk/src/ghb.ui index 01a55902b..ea7ff7634 100644 --- a/gtk/src/ghb.ui +++ b/gtk/src/ghb.ui @@ -114,12 +114,12 @@ <property name="value">0</property> </object> <object class="GtkAdjustment" id="adjustment5"> - <property name="upper">1</property> + <property name="upper">51</property> <property name="lower">0</property> - <property name="page_increment">1</property> - <property name="step_increment">0.1</property> + <property name="page_increment">5</property> + <property name="step_increment">0.25</property> <property name="page_size">0</property> - <property name="value">0.63</property> + <property name="value">20.25</property> </object> <object class="GtkAdjustment" id="adjustment6"> <property name="upper">4</property> @@ -1665,14 +1665,13 @@ </child> <child> <object class="GtkHScale" id="VideoQualitySlider"> - <property name="width_request">200</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="adjustment">adjustment5</property> <property name="digits">3</property> - <property name="value_pos">GTK_POS_RIGHT</property> - <signal handler="setting_widget_changed_cb" name="value_changed"/> + <property name="value_pos">GTK_POS_BOTTOM</property> + <signal handler="vquality_changed_cb" name="value_changed"/> <signal handler="format_vquality_cb" name="format-value"/> </object> <packing> @@ -3387,24 +3386,6 @@ the required multiple.</property> </packing> </child> <child> - <object class="GtkCheckButton" id="EncodeLogLocation"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="tooltip_text"> HandBrake produces 2 activity logs. -One for the session and one for each encoding. -Store the individual encode logs in the same -location as the movie.</property> - <property name="label" translatable="yes">Store logs in destination video directory</property> - <property name="draw_indicator">True</property> - <signal name="toggled" handler="pref_changed_cb"/> - </object> - <packing> - <property name="expand">False</property> - <property name="position">4</property> - </packing> - </child> - - <child> <object class="GtkAlignment" id="alignment50"> <property name="visible">True</property> <property name="left_padding">4</property> @@ -3443,9 +3424,64 @@ location as the movie.</property> </object> <packing> <property name="expand">False</property> + <property name="position">4</property> + </packing> + </child> + + <child> + <object class="GtkAlignment" id="alignment59"> + <property name="visible">True</property> + <property name="left_padding">4</property> + <child> + <object class="GtkHBox" id="hbox6"> + <property name="visible">True</property> + <property name="spacing">4</property> + <child> + <object class="GtkComboBox" id="VideoQualityGranularity"> + <property name="visible">True</property> + <property name="width_request">55</property> + <signal name="changed" handler="vqual_granularity_changed_cb"/> + </object> + <packing> + <property name="expand">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label85"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Video Qaulity Granularity</property> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> <property name="position">5</property> </packing> </child> + <child> + <object class="GtkCheckButton" id="EncodeLogLocation"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="tooltip_text"> HandBrake produces 2 activity logs. +One for the session and one for each encoding. +Store the individual encode logs in the same +location as the movie.</property> + <property name="label" translatable="yes">Store logs in destination video directory</property> + <property name="draw_indicator">True</property> + <signal name="toggled" handler="pref_changed_cb"/> + </object> + <packing> + <property name="expand">False</property> + <property name="position">6</property> + </packing> + </child> <child> <object class="GtkAlignment" id="alignment51"> @@ -3481,7 +3517,7 @@ location as the movie.</property> </object> <packing> <property name="expand">False</property> - <property name="position">6</property> + <property name="position">7</property> </packing> </child> @@ -3494,7 +3530,7 @@ location as the movie.</property> </object> <packing> <property name="expand">False</property> - <property name="position">7</property> + <property name="position">8</property> </packing> </child> <child> @@ -3506,7 +3542,7 @@ location as the movie.</property> </object> <packing> <property name="expand">False</property> - <property name="position">8</property> + <property name="position">9</property> </packing> </child> </object> diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c index 4f807f853..9f889ad79 100644 --- a/gtk/src/hb-backend.c +++ b/gtk/src/hb-backend.c @@ -39,7 +39,7 @@ typedef struct { const gchar *option; const gchar *shortOpt; - gint ivalue; + gdouble ivalue; const gchar *svalue; } options_map_t; @@ -76,6 +76,19 @@ combo_opts_t logging_opts = d_logging_opts }; +static options_map_t d_vqual_granularity_opts[] = +{ + {"0.2", "0.2", 0.2, "0.2"}, + {"0.25", "0.25", 0.25, "0.25"}, + {"0.5", "0.5", 0.5, "0.5"}, + {"1", "1", 1, "1"}, +}; +combo_opts_t vqual_granularity_opts = +{ + sizeof(d_vqual_granularity_opts)/sizeof(options_map_t), + d_vqual_granularity_opts +}; + static options_map_t d_container_opts[] = { {"MKV", "mkv", HB_MUX_MKV, "mkv"}, @@ -278,6 +291,7 @@ typedef struct combo_name_map_t combo_name_map[] = { {"LoggingLevel", &logging_opts}, + {"VideoQualityGranularity", &vqual_granularity_opts}, {"FileFormat", &container_opts}, {"PictureDeinterlace", &deint_opts}, {"PictureDecomb", &decomb_opts}, @@ -546,7 +560,6 @@ ghb_vquality_range( gboolean *inverted) { gint vcodec = ghb_settings_combo_int(ud->settings, "VideoEncoder"); - *step = 1; *page = 10; *digits = 0; switch (vcodec) @@ -555,8 +568,12 @@ ghb_vquality_range( { *min = 0; *max = 51; - *step = 0.1; - *digits = 3; + *step = ghb_settings_combo_double(ud->settings, + "VideoQualityGranularity"); + if (*step == 0.2 || *step == 0.5) + *digits = 1; + else if (*step == 0.25) + *digits = 2; *inverted = TRUE; } break; @@ -565,6 +582,7 @@ ghb_vquality_range( { *min = 1; *max = 31; + *step = 1; *inverted = TRUE; } break; @@ -572,6 +590,7 @@ ghb_vquality_range( { *min = 0; *max = 63; + *step = 1; *inverted = FALSE; } break; @@ -579,7 +598,7 @@ ghb_vquality_range( { *min = 0; *max = 100; - *digits = 3; + *step = 1; *inverted = FALSE; } break; } @@ -605,6 +624,26 @@ lookup_generic_int(combo_opts_t *opts, const GValue *gval) return result; } +static gdouble +lookup_generic_double(combo_opts_t *opts, const GValue *gval) +{ + gint ii; + gchar *str; + gdouble result = -1; + + str = ghb_value_string(gval); + for (ii = 0; ii < opts->count; ii++) + { + if (strcmp(opts->map[ii].shortOpt, str) == 0) + { + result = opts->map[ii].ivalue; + break; + } + } + g_free(str); + return result; +} + static const gchar* lookup_generic_option(combo_opts_t *opts, const GValue *gval) { @@ -849,7 +888,7 @@ get_acodec_value(gint val) for (ii = 0; ii < acodec_opts.count; ii++) { - if (acodec_opts.map[ii].ivalue == val) + if ((int)acodec_opts.map[ii].ivalue == val) { value = ghb_string_value_new(acodec_opts.map[ii].shortOpt); break; @@ -1199,7 +1238,7 @@ init_combo_box(GtkBuilder *builder, const gchar *name) // 4 - Int value determined by backend // 5 - String value determined by backend store = gtk_list_store_new(5, G_TYPE_STRING, G_TYPE_BOOLEAN, - G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING); + G_TYPE_STRING, G_TYPE_DOUBLE, G_TYPE_STRING); gtk_combo_box_set_model(combo, GTK_TREE_MODEL(store)); if (GTK_WIDGET_TYPE(combo) == GTK_TYPE_COMBO_BOX) @@ -1232,7 +1271,7 @@ audio_samplerate_opts_set(GtkBuilder *builder, const gchar *name, hb_rate_t *rat 0, "Same as source", 1, TRUE, 2, "source", - 3, 0, + 3, 0.0, 4, "source", -1); for (ii = 0; ii < count; ii++) @@ -1242,7 +1281,7 @@ audio_samplerate_opts_set(GtkBuilder *builder, const gchar *name, hb_rate_t *rat 0, rates[ii].string, 1, TRUE, 2, rates[ii].string, - 3, rates[ii].rate, + 3, (gdouble)rates[ii].rate, 4, rates[ii].string, -1); } @@ -1264,7 +1303,7 @@ video_rate_opts_set(GtkBuilder *builder, const gchar *name, hb_rate_t *rates, gi 0, "Same as source", 1, TRUE, 2, "source", - 3, 0, + 3, 0.0, 4, "source", -1); for (ii = 0; ii < count; ii++) @@ -1289,7 +1328,7 @@ video_rate_opts_set(GtkBuilder *builder, const gchar *name, hb_rate_t *rates, gi 0, option, 1, TRUE, 2, rates[ii].string, - 3, rates[ii].rate, + 3, (gdouble)rates[ii].rate, 4, rates[ii].string, -1); g_free(option); @@ -1311,7 +1350,7 @@ mix_opts_set(GtkBuilder *builder, const gchar *name) 0, "None", 1, TRUE, 2, "none", - 3, 0, + 3, 0.0, 4, "none", -1); for (ii = 0; ii < hb_audio_mixdowns_count; ii++) @@ -1321,7 +1360,7 @@ mix_opts_set(GtkBuilder *builder, const gchar *name) 0, hb_audio_mixdowns[ii].human_readable_name, 1, TRUE, 2, hb_audio_mixdowns[ii].short_name, - 3, hb_audio_mixdowns[ii].amixdown, + 3, (gdouble)hb_audio_mixdowns[ii].amixdown, 4, hb_audio_mixdowns[ii].internal_name, -1); } @@ -1344,7 +1383,7 @@ language_opts_set(GtkBuilder *builder, const gchar *name) 0, ghb_language_table[ii].eng_name, 1, TRUE, 2, ghb_language_table[ii].iso639_2, - 3, ii, + 3, (gdouble)ii, 4, ghb_language_table[ii].iso639_1, -1); } @@ -1393,7 +1432,7 @@ title_opts_set(GtkBuilder *builder, const gchar *name) 0, "No Titles", 1, TRUE, 2, "none", - 3, -1, + 3, -1.0, 4, "none", -1); title_opts.map[0].option = "No Titles"; @@ -1419,7 +1458,7 @@ title_opts_set(GtkBuilder *builder, const gchar *name) 0, titles[ii], 1, TRUE, 2, titles[ii], - 3, ii, + 3, (gdouble)ii, 4, titles[ii], -1); title_opts.map[ii].option = titles[ii]; @@ -1433,7 +1472,7 @@ title_opts_set(GtkBuilder *builder, const gchar *name) static gboolean find_combo_item_by_int(GtkTreeModel *store, gint value, GtkTreeIter *iter) { - gint ivalue; + gdouble ivalue; gboolean foundit = FALSE; if (gtk_tree_model_get_iter_first (store, iter)) @@ -1441,7 +1480,7 @@ find_combo_item_by_int(GtkTreeModel *store, gint value, GtkTreeIter *iter) do { gtk_tree_model_get(store, iter, 3, &ivalue, -1); - if (value == ivalue) + if (value == (int)ivalue) { foundit = TRUE; break; @@ -1494,7 +1533,7 @@ audio_track_opts_set(GtkBuilder *builder, const gchar *name, gint titleindex) 0, "No Audio", 1, TRUE, 2, "none", - 3, -1, + 3, -1.0, 4, "none", -1); audio_track_opts.map[0].option = "No Audio"; @@ -1511,7 +1550,7 @@ audio_track_opts_set(GtkBuilder *builder, const gchar *name, gint titleindex) 0, audio->lang.description, 1, TRUE, 2, index_str[ii], - 3, ii, + 3, (gdouble)ii, 4, index_str[ii], -1); audio_track_opts.map[ii].option = audio->lang.description, @@ -1563,7 +1602,7 @@ subtitle_opts_set(GtkBuilder *builder, const gchar *name, gint titleindex) 0, "None", 1, TRUE, 2, "none", - 3, -2, + 3, -2.0, 4, "none", -1); subtitle_opts.map[0].option = "None"; @@ -1575,7 +1614,7 @@ subtitle_opts_set(GtkBuilder *builder, const gchar *name, gint titleindex) 0, "Autoselect", 1, TRUE, 2, "auto", - 3, -1, + 3, -1.0, 4, "auto", -1); subtitle_opts.map[0].option = "Same as audio"; @@ -1592,7 +1631,7 @@ subtitle_opts_set(GtkBuilder *builder, const gchar *name, gint titleindex) 0, subtitle->lang, 1, TRUE, 2, subtitle->iso639_2, - 3, ii, + 3, (gdouble)ii, 4, subtitle->iso639_2, -1); subtitle_opts.map[ii+2].option = subtitle->lang; @@ -1610,7 +1649,7 @@ subtitle_opts_set(GtkBuilder *builder, const gchar *name, gint titleindex) 0, ghb_language_table[ii].eng_name, 1, TRUE, 2, ghb_language_table[ii].iso639_2, - 3, ii, + 3, (gdouble)ii, 4, ghb_language_table[ii].iso639_2, -1); subtitle_opts.map[ii+2].option = ghb_language_table[ii].eng_name; @@ -1865,6 +1904,27 @@ ghb_lookup_combo_int(const gchar *name, const GValue *gval) return 0; } +gdouble +ghb_lookup_combo_double(const gchar *name, const GValue *gval) +{ + if (strcmp(name, "AudioBitrate") == 0) + return lookup_audio_bitrate_int(gval); + else if (strcmp(name, "AudioSamplerate") == 0) + return lookup_audio_rate_int(gval); + else if (strcmp(name, "VideoFramerate") == 0) + return lookup_video_rate_int(gval); + else if (strcmp(name, "AudioMixdown") == 0) + return lookup_mix_int(gval); + else if (strcmp(name, "SourceAudioLang") == 0) + return lookup_audio_lang_int(gval); + else + { + return lookup_generic_double(find_combo_table(name), gval); + } + g_warning("ghb_lookup_combo_double() couldn't find %s", name); + return 0; +} + const gchar* ghb_lookup_combo_option(const gchar *name, const GValue *gval) { @@ -1923,6 +1983,7 @@ ghb_update_ui_combo_box(GtkBuilder *builder, const gchar *name, gint user_data, subtitle_opts_set(builder, "Subtitles", user_data); title_opts_set(builder, "title"); audio_track_opts_set(builder, "AudioTrack", user_data); + generic_opts_set(builder, "VideoQualityGranularity", &vqual_granularity_opts); generic_opts_set(builder, "LoggingLevel", &logging_opts); generic_opts_set(builder, "FileFormat", &container_opts); generic_opts_set(builder, "PictureDeinterlace", &deint_opts); @@ -2077,7 +2138,7 @@ audio_bitrate_opts_add(GtkBuilder *builder, const gchar *name, gint rate) 0, str, 1, TRUE, 2, str, - 3, rate, + 3, (gdouble)rate, 4, str, -1); g_free(str); @@ -2089,7 +2150,7 @@ audio_bitrate_opts_clean(GtkBuilder *builder, const gchar *name, gint last_rate) { GtkTreeIter iter; GtkListStore *store; - gint ivalue; + gdouble ivalue; gboolean done = FALSE; gint ii = 0; guint last = (guint)last_rate; @@ -2139,7 +2200,7 @@ audio_bitrate_opts_set(GtkBuilder *builder, const gchar *name) 0, hb_audio_bitrates[ii].string, 1, TRUE, 2, hb_audio_bitrates[ii].string, - 3, hb_audio_bitrates[ii].rate, + 3, (gdouble)hb_audio_bitrates[ii].rate, 4, hb_audio_bitrates[ii].string, -1); } @@ -3384,7 +3445,6 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, gint titleindex) } else { -printf("switching to faac\n"); audio.out.codec = HB_ACODEC_FAAC; } } diff --git a/gtk/src/hb-backend.h b/gtk/src/hb-backend.h index dc37d990f..bad1b2ac6 100644 --- a/gtk/src/hb-backend.h +++ b/gtk/src/hb-backend.h @@ -150,6 +150,7 @@ gboolean ghb_validate_filters(signal_user_data_t *ud); gboolean ghb_validate_filter_string(const gchar *str, gint max_fields); void ghb_hb_cleanup(gboolean partial); gint ghb_lookup_combo_int(const gchar *name, const GValue *acodec); +gdouble ghb_lookup_combo_double(const gchar *name, const GValue *acodec); const gchar* ghb_lookup_combo_option(const gchar *name, const GValue *acodec); gchar* ghb_get_tmp_dir(); diff --git a/gtk/src/internal_defaults.xml b/gtk/src/internal_defaults.xml index b1e9a3f07..1bc553f2d 100644 --- a/gtk/src/internal_defaults.xml +++ b/gtk/src/internal_defaults.xml @@ -122,6 +122,8 @@ <true /> <key>update_skip_version</key> <integer>0</integer> + <key>VideoQualityGranularity</key> + <string>0.2</string> <key>version</key> <string>0.1</string> </dict> diff --git a/gtk/src/resource_data.h b/gtk/src/resource_data.h index 60dc6c42a..4c480cf71 100644 --- a/gtk/src/resource_data.h +++ b/gtk/src/resource_data.h @@ -149,13 +149,13 @@ " </object>\n" " <object class="GtkAdjustment" id="adjustment5"" ">\n" -" <property name="upper">1</property>\n" +" <property name="upper">51</property>\n" " <property name="lower">0</property>\n" -" <property name="page_increment">1</property>\n" -" <property name="step_increment">0.1</property>" -";\n" +" <property name="page_increment">5</property>\n" +" <property name="step_increment">0.25</property&g" +"t;\n" " <property name="page_size">0</property>\n" -" <property name="value">0.63</property>\n" +" <property name="value">20.25</property>\n" " </object>\n" " <object class="GtkAdjustment" id="adjustment6"" ">\n" @@ -2616,8 +2616,6 @@ " <child>\n" " <object class="GtkHSc" "ale" id="VideoQualitySlider">\n" -" <property name="wid" -"th_request">200</property>\n" " <property name="vis" "ible">True</property>\n" " <property name="can" @@ -2630,9 +2628,9 @@ " <property name="dig" "its">3</property>\n" " <property name="val" -"ue_pos">GTK_POS_RIGHT</property>\n" -" <signal handler="se" -"tting_widget_changed_cb" name="value_changed"/>\n" +"ue_pos">GTK_POS_BOTTOM</property>\n" +" <signal handler="vq" +"uality_changed_cb" name="value_changed"/>\n" " <signal handler="fo" "rmat_vquality_cb" name="format-value"/>\n" " </object>\n" @@ -5538,34 +5536,6 @@ " </packing>\n" " </child>\n" " <child>\n" -" <object class="GtkCheckButton" i" -"d="EncodeLogLocation">\n" -" <property name="visible">Tr" -"ue</property>\n" -" <property name="can_focus">" -"True</property>\n" -" <property name="tooltip_text"&" -"gt; HandBrake produces 2 activity logs. \n" -"One for the session and one for each encoding.\n" -"Store the individual encode logs in the same\n" -"location as the movie.</property>\n" -" <property name="label" transla" -"table="yes">Store logs in destination video directory</" -"property>\n" -" <property name="draw_indicator"" -";>True</property>\n" -" <signal name="toggled" handler" -"="pref_changed_cb"/>\n" -" </object>\n" -" <packing>\n" -" <property name="expand">Fal" -"se</property>\n" -" <property name="position">4" -"</property>\n" -" </packing>\n" -" </child>\n" -"\n" -" <child>\n" " <object class="GtkAlignment" id=" ""alignment50">\n" " <property name="visible">Tr" @@ -5627,10 +5597,95 @@ " <packing>\n" " <property name="expand">Fal" "se</property>\n" +" <property name="position">4" +"</property>\n" +" </packing>\n" +" </child>\n" +"\n" +" <child>\n" +" <object class="GtkAlignment" id=" +""alignment59">\n" +" <property name="visible">Tr" +"ue</property>\n" +" <property name="left_padding"&" +"gt;4</property>\n" +" <child>\n" +" <object class="GtkHBox" id=&" +"quot;hbox6">\n" +" <property name="visible"&g" +"t;True</property>\n" +" <property name="spacing"&g" +"t;4</property>\n" +" <child>\n" +" <object class="GtkComboBox&qu" +"ot; id="VideoQualityGranularity">\n" +" <property name="visible&quo" +"t;>True</property>\n" +" <property name="width_reque" +"st">55</property>\n" +" <signal name="changed"" +" handler="vqual_granularity_changed_cb"/>\n" +" </object>\n" +" <packing>\n" +" <property name="expand"" +";>False</property>\n" +" <property name="position&qu" +"ot;>0</property>\n" +" </packing>\n" +" </child>\n" +" <child>\n" +" <object class="GtkLabel"" +" id="label85">\n" +" <property name="visible&quo" +"t;>True</property>\n" +" <property name="xalign"" +";>0</property>\n" +" <property name="label"" +" translatable="yes">Video Qaulity Granularity</property" +">\n" +" </object>\n" +" <packing>\n" +" <property name="position&qu" +"ot;>1</property>\n" +" </packing>\n" +" </child>\n" +" </object>\n" +" </child>\n" +" </object>\n" +" <packing>\n" +" <property name="expand">Fal" +"se</property>\n" " <property name="position">5" "</property>\n" " </packing>\n" " </child>\n" +" <child>\n" +" <object class="GtkCheckButton" i" +"d="EncodeLogLocation">\n" +" <property name="visible">Tr" +"ue</property>\n" +" <property name="can_focus">" +"True</property>\n" +" <property name="tooltip_text"&" +"gt; HandBrake produces 2 activity logs. \n" +"One for the session and one for each encoding.\n" +"Store the individual encode logs in the same\n" +"location as the movie.</property>\n" +" <property name="label" transla" +"table="yes">Store logs in destination video directory</" +"property>\n" +" <property name="draw_indicator"" +";>True</property>\n" +" <signal name="toggled" handler" +"="pref_changed_cb"/>\n" +" </object>\n" +" <packing>\n" +" <property name="expand">Fal" +"se</property>\n" +" <property name="position">6" +"</property>\n" +" </packing>\n" +" </child>\n" "\n" " <child>\n" " <object class="GtkAlignment" id=" @@ -5684,7 +5739,7 @@ " <packing>\n" " <property name="expand">Fal" "se</property>\n" -" <property name="position">6" +" <property name="position">7" "</property>\n" " </packing>\n" " </child>\n" @@ -5704,7 +5759,7 @@ " <packing>\n" " <property name="expand">Fal" "se</property>\n" -" <property name="position">7" +" <property name="position">8" "</property>\n" " </packing>\n" " </child>\n" @@ -5723,7 +5778,7 @@ " <packing>\n" " <property name="expand">Fal" "se</property>\n" -" <property name="position">8" +" <property name="position">9" "</property>\n" " </packing>\n" " </child>\n" @@ -11149,6 +11204,8 @@ " <false />\n" " <key>LoggingLevel</key>\n" " <string>1</string>\n" +" <key>VideoQualityGranularity</key>\n" +" <string>0.2</string>\n" " <key>allow_tweaks</key>\n" " <false />\n" " <key>chapters_in_destination</key>\n" diff --git a/gtk/src/resources.plist b/gtk/src/resources.plist index 126d000ef..11fa87c5b 100644 --- a/gtk/src/resources.plist +++ b/gtk/src/resources.plist @@ -119,12 +119,12 @@ <property name="value">0</property> </object> <object class="GtkAdjustment" id="adjustment5"> - <property name="upper">1</property> + <property name="upper">51</property> <property name="lower">0</property> - <property name="page_increment">1</property> - <property name="step_increment">0.1</property> + <property name="page_increment">5</property> + <property name="step_increment">0.25</property> <property name="page_size">0</property> - <property name="value">0.63</property> + <property name="value">20.25</property> </object> <object class="GtkAdjustment" id="adjustment6"> <property name="upper">4</property> @@ -1670,14 +1670,13 @@ </child> <child> <object class="GtkHScale" id="VideoQualitySlider"> - <property name="width_request">200</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="adjustment">adjustment5</property> <property name="digits">3</property> - <property name="value_pos">GTK_POS_RIGHT</property> - <signal handler="setting_widget_changed_cb" name="value_changed"/> + <property name="value_pos">GTK_POS_BOTTOM</property> + <signal handler="vquality_changed_cb" name="value_changed"/> <signal handler="format_vquality_cb" name="format-value"/> </object> <packing> @@ -3392,24 +3391,6 @@ the required multiple.</property> </packing> </child> <child> - <object class="GtkCheckButton" id="EncodeLogLocation"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="tooltip_text"> HandBrake produces 2 activity logs. -One for the session and one for each encoding. -Store the individual encode logs in the same -location as the movie.</property> - <property name="label" translatable="yes">Store logs in destination video directory</property> - <property name="draw_indicator">True</property> - <signal name="toggled" handler="pref_changed_cb"/> - </object> - <packing> - <property name="expand">False</property> - <property name="position">4</property> - </packing> - </child> - - <child> <object class="GtkAlignment" id="alignment50"> <property name="visible">True</property> <property name="left_padding">4</property> @@ -3448,9 +3429,64 @@ location as the movie.</property> </object> <packing> <property name="expand">False</property> + <property name="position">4</property> + </packing> + </child> + + <child> + <object class="GtkAlignment" id="alignment59"> + <property name="visible">True</property> + <property name="left_padding">4</property> + <child> + <object class="GtkHBox" id="hbox6"> + <property name="visible">True</property> + <property name="spacing">4</property> + <child> + <object class="GtkComboBox" id="VideoQualityGranularity"> + <property name="visible">True</property> + <property name="width_request">55</property> + <signal name="changed" handler="vqual_granularity_changed_cb"/> + </object> + <packing> + <property name="expand">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label85"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Video Qaulity Granularity</property> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> <property name="position">5</property> </packing> </child> + <child> + <object class="GtkCheckButton" id="EncodeLogLocation"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="tooltip_text"> HandBrake produces 2 activity logs. +One for the session and one for each encoding. +Store the individual encode logs in the same +location as the movie.</property> + <property name="label" translatable="yes">Store logs in destination video directory</property> + <property name="draw_indicator">True</property> + <signal name="toggled" handler="pref_changed_cb"/> + </object> + <packing> + <property name="expand">False</property> + <property name="position">6</property> + </packing> + </child> <child> <object class="GtkAlignment" id="alignment51"> @@ -3486,7 +3522,7 @@ location as the movie.</property> </object> <packing> <property name="expand">False</property> - <property name="position">6</property> + <property name="position">7</property> </packing> </child> @@ -3499,7 +3535,7 @@ location as the movie.</property> </object> <packing> <property name="expand">False</property> - <property name="position">7</property> + <property name="position">8</property> </packing> </child> <child> @@ -3511,7 +3547,7 @@ location as the movie.</property> </object> <packing> <property name="expand">False</property> - <property name="position">8</property> + <property name="position">9</property> </packing> </child> </object> @@ -5555,6 +5591,8 @@ R2RrUAAABBgBAQACAAAAQAAAABAAAAAQ////AP///wD///8A////AP///wD///8A////AP///wD///8A <false /> <key>LoggingLevel</key> <string>1</string> + <key>VideoQualityGranularity</key> + <string>0.2</string> <key>allow_tweaks</key> <false /> <key>chapters_in_destination</key> diff --git a/gtk/src/settings.c b/gtk/src/settings.c index 20c1416a6..5912fba52 100644 --- a/gtk/src/settings.c +++ b/gtk/src/settings.c @@ -158,6 +158,12 @@ ghb_settings_combo_int(const GValue *settings, const gchar *key) return ghb_lookup_combo_int(key, ghb_settings_get_value(settings, key)); } +gdouble +ghb_settings_combo_double(const GValue *settings, const gchar *key) +{ + return ghb_lookup_combo_double(key, ghb_settings_get_value(settings, key)); +} + const gchar* ghb_settings_combo_option(const GValue *settings, const gchar *key) { @@ -465,7 +471,7 @@ update_widget(GtkWidget *widget, const GValue *value) GtkTreeModel *store; GtkTreeIter iter; gchar *shortOpt; - gint ivalue; + gdouble ivalue; gboolean foundit = FALSE; g_debug("combo (%s)", str); @@ -491,7 +497,7 @@ update_widget(GtkWidget *widget, const GValue *value) do { gtk_tree_model_get(store, &iter, 3, &ivalue, -1); - if (ivalue == ival) + if ((gint)ivalue == ival || ivalue == dval) { gtk_combo_box_set_active_iter ( GTK_COMBO_BOX(widget), &iter); @@ -510,7 +516,7 @@ update_widget(GtkWidget *widget, const GValue *value) GtkTreeModel *store; GtkTreeIter iter; gchar *shortOpt; - gint ivalue; + gdouble ivalue; gboolean foundit = FALSE; g_debug("GTK_COMBO_BOX_ENTRY"); @@ -536,7 +542,7 @@ update_widget(GtkWidget *widget, const GValue *value) do { gtk_tree_model_get(store, &iter, 3, &ivalue, -1); - if (ivalue == ival) + if ((gint)ivalue == ival || ivalue == dval) { gtk_combo_box_set_active_iter ( GTK_COMBO_BOX(widget), &iter); diff --git a/gtk/src/settings.h b/gtk/src/settings.h index 55584ca70..8c2cac821 100644 --- a/gtk/src/settings.h +++ b/gtk/src/settings.h @@ -84,6 +84,7 @@ gint ghb_settings_get_int(const GValue *settings, const gchar *key); gdouble ghb_settings_get_double(const GValue *settings, const gchar *key); gchar* ghb_settings_get_string(const GValue *settings, const gchar *key); gint ghb_settings_combo_int(const GValue *settings, const gchar *key); +gdouble ghb_settings_combo_double(const GValue *settings, const gchar *key); const gchar* ghb_settings_combo_option(const GValue *settings, const gchar *key); GValue* ghb_widget_value(GtkWidget *widget); diff --git a/gtk/src/x264handler.c b/gtk/src/x264handler.c index cad604999..5bff6b040 100644 --- a/gtk/src/x264handler.c +++ b/gtk/src/x264handler.c @@ -254,7 +254,7 @@ x264_update_combo(signal_user_data_t *ud, const gchar *name, const gchar *val) GtkTreeModel *store; GtkTreeIter iter; gchar *shortOpt; - gint ivalue; + gdouble ivalue; gboolean foundit = FALSE; GtkWidget *widget; |