diff options
author | jstebbins <[email protected]> | 2010-06-28 15:59:31 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2010-06-28 15:59:31 +0000 |
commit | 007b591efce31dcf65d23c8d3782d054b45717da (patch) | |
tree | f533b4f31bc1a2ec92ca37d4293758faad7fde36 /gtk | |
parent | 554ff68202cbc5d5d2081505b4a381f341f7c416 (diff) |
LinGui: Add max width/height widgets to preset save dialog
These are only visible when autosize is disabled, meaning the user
has chosen to set specific video dimensions. These values are used
when a preset or title is loaded to set the default storage dimensions.
This allows setting arbitrary PictureWidth/PictureHeight in the preset
which was not previously possible. The values were previously limited
to what the currently loaded source would allow you to enter into
the picture settings width/height fields.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3417 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/src/callbacks.c | 2 | ||||
-rw-r--r-- | gtk/src/ghb.ui | 115 | ||||
-rw-r--r-- | gtk/src/hb-backend.c | 17 | ||||
-rw-r--r-- | gtk/src/hb-backend.h | 1 | ||||
-rw-r--r-- | gtk/src/makedeps.py | 1 | ||||
-rw-r--r-- | gtk/src/presets.c | 21 |
6 files changed, 124 insertions, 33 deletions
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c index 0f2343f55..b66e48e41 100644 --- a/gtk/src/callbacks.c +++ b/gtk/src/callbacks.c @@ -1460,7 +1460,7 @@ show_title_info(signal_user_data_t *ud, ghb_title_info_t *tinfo) ghb_ui_update(ud, "PictureRightCrop", ghb_int64_value(tinfo->crop[3])); } ud->scale_busy = FALSE; - ghb_set_scale (ud, GHB_PIC_KEEP_PAR); + 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"); diff --git a/gtk/src/ghb.ui b/gtk/src/ghb.ui index 53174bf19..d1019dea7 100644 --- a/gtk/src/ghb.ui +++ b/gtk/src/ghb.ui @@ -66,7 +66,7 @@ <property name="value">0</property> </object> <object class="GtkAdjustment" id="adjustment17"> - <property name="upper">2000</property> + <property name="upper">8000</property> <property name="lower">0</property> <property name="page_increment">16</property> <property name="step_increment">2</property> @@ -74,7 +74,7 @@ <property name="value">0</property> </object> <object class="GtkAdjustment" id="adjustment18"> - <property name="upper">1200</property> + <property name="upper">8000</property> <property name="lower">0</property> <property name="page_increment">16</property> <property name="step_increment">2</property> @@ -233,6 +233,22 @@ <property name="page_size">0</property> <property name="value">0</property> </object> + <object class="GtkAdjustment" id="adjustment32"> + <property name="upper">8000</property> + <property name="lower">0</property> + <property name="page_increment">16</property> + <property name="step_increment">2</property> + <property name="page_size">0</property> + <property name="value">0</property> + </object> + <object class="GtkAdjustment" id="adjustment33"> + <property name="upper">8000</property> + <property name="lower">0</property> + <property name="page_increment">16</property> + <property name="step_increment">2</property> + <property name="page_size">0</property> + <property name="value">0</property> + </object> <object class="GtkAdjustment" id="adjustment34"> <property name="upper">2</property> <property name="lower">0</property> @@ -4678,6 +4694,7 @@ no-fast-pskip=0:no-dct-decimate=0:cabac=1</property> <property name="visible">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="label" translatable="yes">Preset Name:</property> + <property name="xalign">0</property> </object> <packing> <property name="expand">False</property> @@ -4700,8 +4717,98 @@ no-fast-pskip=0:no-dct-decimate=0:cabac=1</property> </object> <packing> <property name="expand">False</property> + <property name="position">0</property> + <property name="padding">10</property> </packing> </child> + <child> + <object class="GtkVBox" id="PicturePresetBox"> + <property name="orientation">vertical</property> + <property name="visible">True</property> + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> + + <child> + <object class="GtkLabel" id="UsingCurrentPicLabel"> + <property name="visible">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="label" translatable="yes"><b>Using Current Picture Settings</b></property> + <property name="xalign">0</property> + <property name="use_markup">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkHBox" id="hbox31"> + <property name="visible">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="spacing">4</property> + <child> + <object class="GtkLabel" id="label31"> + <property name="visible">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="label" translatable="yes">Max Width:</property> + <property name="xalign">0</property> + </object> + <packing> + <property name="expand">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkSpinButton" id="PictureWidth"> + <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="tooltip-text" translatable="yes">This is the maximum width that the video will be stored at. Whenever a new source is loaded, this value will be applied if the source width is greater. Setting this to 0 means there is no maximum width.</property> + <property name="adjustment">adjustment32</property> + <property name="snap_to_ticks">True</property> + <signal name="value_changed" handler="setting_widget_changed_cb"/> + </object> + <packing> + <property name="expand">False</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label75"> + <property name="visible">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="label" translatable="yes">Max Height:</property> + <property name="xalign">1</property> + </object> + <packing> + <property name="expand">False</property> + <property name="position">2</property> + </packing> + </child> + <child> + <object class="GtkSpinButton" id="PictureHeight"> + <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="tooltip-text" translatable="yes">This is the maximum height that the video will be stored at. Whenever a new source is loaded, this value will be applied if the source height is greater. Setting this to 0 means there is no maximum height.</property> + <property name="adjustment">adjustment33</property> + <signal name="value_changed" handler="setting_widget_changed_cb"/> + </object> + <packing> + <property name="expand">False</property> + <property name="position">3</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="position">1</property> + </packing> + </child> <child> <object class="GtkFrame" id="frame14"> <property name="visible">True</property> @@ -4738,8 +4845,8 @@ no-fast-pskip=0:no-dct-decimate=0:cabac=1</property> </child> </object> <packing> - <property name="padding">2</property> - <property name="position">1</property> + <property name="padding">10</property> + <property name="position">2</property> </packing> </child> </object> diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c index 81742f2ee..1dee59666 100644 --- a/gtk/src/hb-backend.c +++ b/gtk/src/hb-backend.c @@ -3600,12 +3600,6 @@ ghb_set_scale(signal_user_data_t *ud, gint mode) if (ud->scale_busy) return; ud->scale_busy = TRUE; - if (!ud->dont_clear_presets && (keep_width || keep_height)) - { - ghb_settings_set_int(ud->settings, "PictureWidth", 0); - ghb_settings_set_int(ud->settings, "PictureHeight", 0); - } - // First configure widgets mod = ghb_settings_combo_int(ud->settings, "PictureModulus"); pic_par = ghb_settings_combo_int(ud->settings, "PicturePAR"); @@ -3708,10 +3702,13 @@ ghb_set_scale(signal_user_data_t *ud, gint mode) { width = ghb_settings_get_int(ud->settings, "scale_width"); height = ghb_settings_get_int(ud->settings, "scale_height"); - max_width = MOD_DOWN( - ghb_settings_get_int(ud->settings, "PictureWidth"), mod); - max_height = MOD_DOWN( - ghb_settings_get_int(ud->settings, "PictureHeight"), mod); + if (mode & GHB_PIC_USE_MAX) + { + max_width = MOD_DOWN( + ghb_settings_get_int(ud->settings, "PictureWidth"), mod); + max_height = MOD_DOWN( + ghb_settings_get_int(ud->settings, "PictureHeight"), mod); + } } g_debug("max_width %d, max_height %d\n", max_width, max_height); diff --git a/gtk/src/hb-backend.h b/gtk/src/hb-backend.h index 8395b7968..10f9e97a4 100644 --- a/gtk/src/hb-backend.h +++ b/gtk/src/hb-backend.h @@ -59,6 +59,7 @@ typedef struct #define GHB_PIC_KEEP_DISPLAY_HEIGHT 0x08 #define GHB_PIC_KEEP_DAR 0x10 #define GHB_PIC_KEEP_PAR 0x20 +#define GHB_PIC_USE_MAX 0x40 typedef struct { diff --git a/gtk/src/makedeps.py b/gtk/src/makedeps.py index dbc492353..594b22faf 100644 --- a/gtk/src/makedeps.py +++ b/gtk/src/makedeps.py @@ -40,6 +40,7 @@ dep_map = ( DepEntry("PictureDenoise", "PictureDenoiseCustom", "custom", False, True), DepEntry("PictureDecomb", "PictureDecombCustom", "custom", False, True), DepEntry("PictureDetelecine", "PictureDetelecineCustom", "custom", False, True), + DepEntry("autoscale", "PicturePresetBox", "FALSE", False, True), DepEntry("PictureAutoCrop", "PictureTopCrop", "FALSE", False, False), DepEntry("PictureAutoCrop", "PictureBottomCrop", "FALSE", False, False), DepEntry("PictureAutoCrop", "PictureLeftCrop", "FALSE", False, False), diff --git a/gtk/src/presets.c b/gtk/src/presets.c index 1cb2b416b..40329de14 100644 --- a/gtk/src/presets.c +++ b/gtk/src/presets.c @@ -3062,7 +3062,6 @@ settings_save(signal_user_data_t *ud, const GValue *path) GHashTableIter iter; gchar *key; GValue *value; - gboolean autoscale; gint *indices, len, count; gint *def_indices, def_len; const gchar *name; @@ -3105,7 +3104,6 @@ settings_save(signal_user_data_t *ud, const GValue *path) } } current_preset = dict; - autoscale = ghb_settings_get_boolean(ud->settings, "autoscale"); ghb_settings_set_int64(ud->settings, "Type", PRESETS_CUSTOM); ghb_settings_set_int64(ud->settings, "PresetBuildNumber", hb_get_build(NULL)); @@ -3117,21 +3115,8 @@ settings_save(signal_user_data_t *ud, const GValue *path) &iter, (gpointer*)(void*)&key, (gpointer*)(void*)&value)) { const GValue *gval; - gchar *key2; - key2 = key; - if (!autoscale) - { - if (strcmp(key, "PictureWidth") == 0) - { - key2 = "scale_width"; - } - else if (strcmp(key, "PictureHeight") == 0) - { - key2 = "scale_height"; - } - } - gval = ghb_settings_get_value(ud->settings, key2); + gval = ghb_settings_get_value(ud->settings, key); if (gval == NULL) { continue; @@ -4136,7 +4121,7 @@ ghb_refresh_preset(signal_user_data_t *ud) preset_update_title_deps(ud, &tinfo); } ud->scale_busy = FALSE; - ghb_set_scale (ud, GHB_PIC_KEEP_PAR); + ghb_set_scale (ud, GHB_PIC_KEEP_PAR|GHB_PIC_USE_MAX); ud->dont_clear_presets = FALSE; gdouble vqmin, vqmax, step, page; @@ -4216,7 +4201,7 @@ presets_list_selection_changed_cb(GtkTreeSelection *selection, signal_user_data_ preset_update_title_deps(ud, &tinfo); } ud->scale_busy = FALSE; - ghb_set_scale (ud, GHB_PIC_KEEP_PAR); + ghb_set_scale (ud, GHB_PIC_KEEP_PAR|GHB_PIC_USE_MAX); ud->dont_clear_presets = FALSE; gdouble vqmin, vqmax, step, page; |