summaryrefslogtreecommitdiffstats
path: root/gtk/src/presets.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2009-02-11 01:22:50 +0000
committerjstebbins <[email protected]>2009-02-11 01:22:50 +0000
commit8fe4592112acf80dd8fba8de130196e8a12a2c46 (patch)
tree7b0a89947938c64fc1d680b434582367b2d57aa4 /gtk/src/presets.c
parente6fa09bc4f3b7b093454e34805ae491d3f5ab71d (diff)
LinGui: Constant Quality Slider now QP/RF based
Nearest percentage is also shown for reference git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2138 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk/src/presets.c')
-rw-r--r--gtk/src/presets.c44
1 files changed, 43 insertions, 1 deletions
diff --git a/gtk/src/presets.c b/gtk/src/presets.c
index dd186f8da..203a911e8 100644
--- a/gtk/src/presets.c
+++ b/gtk/src/presets.c
@@ -16,6 +16,7 @@
#include <glib/gstdio.h>
#include <string.h>
#include <gtk/gtk.h>
+#include "hb.h"
#include "settings.h"
#include "callbacks.h"
#include "audiohandler.h"
@@ -2192,6 +2193,43 @@ import_xlat_preset(GValue *dict)
} break;
}
import_value_xlat(dict);
+
+ gdouble vquality;
+ const GValue *gval;
+
+ vquality = ghb_value_double(preset_dict_get_value(dict, "VideoQualitySlider"));
+ if (vquality < 1.0)
+ {
+ gint vcodec;
+
+ gval = preset_dict_get_value(dict, "VideoEncoder");
+ vcodec = ghb_lookup_combo_int("VideoEncoder", gval);
+ switch (vcodec)
+ {
+ case HB_VCODEC_X264:
+ {
+ vquality = 51. - vquality * 51.;
+ } break;
+
+ case HB_VCODEC_XVID:
+ case HB_VCODEC_FFMPEG:
+ {
+ vquality = 31. - vquality * 30.;
+ } break;
+
+ case HB_VCODEC_THEORA:
+ {
+ vquality = vquality * 63.;
+ } break;
+
+ default:
+ {
+ vquality = 0.;
+ } break;
+ }
+ ghb_dict_insert(dict, g_strdup("VideoQualitySlider"),
+ ghb_double_value_new(vquality));
+ }
}
static void
@@ -3184,10 +3222,14 @@ presets_list_selection_changed_cb(GtkTreeSelection *selection, signal_user_data_
gdouble vqmin, vqmax, step, page;
gint digits;
- ghb_vquality_range(ud, &vqmin, &vqmax, &step, &page, &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];