diff options
author | jstebbins <[email protected]> | 2010-06-18 17:31:46 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2010-06-18 17:31:46 +0000 |
commit | 52cc84bfac801b89127403139a3cd67d786700c5 (patch) | |
tree | 14031dcc7e43596594376f010ecd377c12bc4bc0 /gtk/src | |
parent | 66e0b095b658b047bb155ec9cdcb0a3d1b4fa466 (diff) |
LinGui: change psy_trellis increments to 0.05
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3387 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src')
-rw-r--r-- | gtk/src/ghb.ui | 40 | ||||
-rw-r--r-- | gtk/src/x264handler.c | 32 |
2 files changed, 38 insertions, 34 deletions
diff --git a/gtk/src/ghb.ui b/gtk/src/ghb.ui index db1590f3b..a71118907 100644 --- a/gtk/src/ghb.ui +++ b/gtk/src/ghb.ui @@ -121,22 +121,6 @@ <property name="page_size">0</property> <property name="value">20.25</property> </object> - <object class="GtkAdjustment" id="adjustment6"> - <property name="upper">4</property> - <property name="lower">0</property> - <property name="page_increment">1</property> - <property name="step_increment">0.2</property> - <property name="page_size">0</property> - <property name="value">2.6</property> - </object> - <object class="GtkAdjustment" id="adjustment7"> - <property name="upper">4</property> - <property name="lower">1</property> - <property name="page_increment">0.20000000000000001</property> - <property name="step_increment">0.20000000000000001</property> - <property name="page_size">0</property> - <property name="value">2.3999999999999999</property> - </object> <object class="GtkAdjustment" id="adjustment8"> <property name="upper">16</property> <property name="lower">1</property> @@ -181,7 +165,7 @@ <property name="upper">1</property> <property name="lower">0</property> <property name="page_increment">0.5</property> - <property name="step_increment">0.1</property> + <property name="step_increment">0.05</property> <property name="page_size">0</property> <property name="value">0</property> </object> @@ -249,22 +233,6 @@ <property name="page_size">0</property> <property name="value">0</property> </object> - <object class="GtkAdjustment" id="adjustment32"> - <property name="upper">99999</property> - <property name="lower">0</property> - <property name="page_increment">60</property> - <property name="step_increment">1</property> - <property name="page_size">0</property> - <property name="value">99999</property> - </object> - <object class="GtkAdjustment" id="adjustment33"> - <property name="upper">99999</property> - <property name="lower">1</property> - <property name="page_increment">60</property> - <property name="step_increment">1</property> - <property name="page_size">0</property> - <property name="value">0</property> - </object> <object class="GtkAdjustment" id="adjustment34"> <property name="upper">1</property> <property name="lower">0</property> @@ -3246,6 +3214,7 @@ Optimal mode gets slower as the maximum number of B-Frames increases, but makes <property name="restrict_to_fill_level">False</property> <property name="value_pos">GTK_POS_RIGHT</property> <signal handler="x264_widget_changed_cb" name="value_changed"/> + <signal name="format_value" handler="x264_format_slider_cb"/> </object> <packing> <property name="left_attach">1</property> @@ -3276,6 +3245,7 @@ Optimal mode gets slower as the maximum number of B-Frames increases, but makes <property name="restrict_to_fill_level">False</property> <property name="value_pos">GTK_POS_RIGHT</property> <signal handler="x264_widget_changed_cb" name="value_changed"/> + <signal name="format_value" handler="x264_format_slider_cb"/> </object> <packing> <property name="top_attach">1</property> @@ -3305,9 +3275,11 @@ Optimal mode gets slower as the maximum number of B-Frames increases, but makes <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> <property name="tooltip-text" translatable="yes">Psychovisual trellis is an experimental algorithm to further improve sharpness and detail retention beyond what Psychovisual RD does. Recommended values are around 0.2, though higher values may help for very grainy video or lower bitrate encodes. Not recommended for cel animation and other sharp-edged graphics.</property> <property name="adjustment">adjustment23</property> + <property name="digits">2</property> <property name="restrict_to_fill_level">False</property> <property name="value_pos">GTK_POS_RIGHT</property> - <signal handler="x264_widget_changed_cb" name="value_changed"/> + <signal handler="x264_slider_changed_cb" name="value_changed"/> + <signal name="format_value" handler="x264_format_slider_cb"/> </object> <packing> <property name="top_attach">2</property> diff --git a/gtk/src/x264handler.c b/gtk/src/x264handler.c index 2368801a6..11be36eb8 100644 --- a/gtk/src/x264handler.c +++ b/gtk/src/x264handler.c @@ -42,6 +42,38 @@ x264_widget_changed_cb(GtkWidget *widget, signal_user_data_t *ud) } G_MODULE_EXPORT void +x264_slider_changed_cb(GtkWidget *widget, signal_user_data_t *ud) +{ + ghb_widget_to_setting(ud->settings, widget); + + // Lock slider values to multiples of step_increment + GtkAdjustment * adj = gtk_range_get_adjustment(GTK_RANGE(widget)); + gdouble step = gtk_adjustment_get_step_increment(adj); + gdouble val = gtk_range_get_value(GTK_RANGE(widget)); + gdouble new_val = ((int)((val + step / 2) / step)) * step; + gdouble diff = val - new_val; + if ( diff > 0.0001 || diff < -0.0001 ) + { + gtk_range_set_value(GTK_RANGE(widget), new_val); + } + else if (!ignore_options_update) + { + ignore_options_update = TRUE; + x264_opt_update(ud, widget); + ignore_options_update = FALSE; + } + ghb_check_dependency(ud, widget, NULL); + ghb_clear_presets_selection(ud); +} + +G_MODULE_EXPORT gchar* +x264_format_slider_cb(GtkScale *scale, gdouble val, signal_user_data_t *ud) +{ + return g_strdup_printf("%-6.6g", val); +} + + +G_MODULE_EXPORT void x264_me_changed_cb(GtkWidget *widget, signal_user_data_t *ud) { gint me; |