OSDN Git Service

LinGui: picture filter changes
authorjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Wed, 26 Aug 2009 16:29:05 +0000 (16:29 +0000)
committerjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Wed, 26 Aug 2009 16:29:05 +0000 (16:29 +0000)
- change "None" to "Off" for detelecine, decomb, deinterlace, and denoise
- add decomb/deinterlace switch, hide controls that are not active
- update builtin presets to reflect change in order of "Custom" option

git-svn-id: svn://localhost/HandBrake/trunk@2777 b64f7644-9d1e-0410-96f1-a4d463321fa5

gtk/src/ghb.ui
gtk/src/hb-backend.c
gtk/src/internal_defaults.xml
gtk/src/presets.c
gtk/src/queuehandler.c
gtk/src/standard_presets.xml
gtk/src/widgetdeps.c

index f20fa42..00d004c 100644 (file)
@@ -5630,7 +5630,7 @@ the required multiple.</property>
                             <child>
                               <object class="GtkTable" id="table10">
                                 <property name="visible">True</property>
-                                <property name="n_rows">6</property>
+                                <property name="n_rows">7</property>
                                 <property name="n_columns">2</property>
                                 <property name="column_spacing">5</property>
 
@@ -5674,14 +5674,45 @@ the required multiple.</property>
                                 </child>
 
                                 <child>
-                                  <object class="GtkLabel" id="label56">
+                                  <object class="GtkRadioButton" id="PictureDecombDeinterlace">
+                                    <property name="label" translatable="yes">Decomb</property>
                                     <property name="visible">True</property>
-                                    <property name="xalign">0</property>
-                                    <property name="label" translatable="yes">Decomb:</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">False</property>
+                                    <property name="active">True</property>
+                                    <property name="draw_indicator">True</property>
+                                    <signal name="toggled" handler="setting_widget_changed_cb"/>
+                                  </object>
+                                  <packing>
+                                    <property name="top_attach">2</property>
+                                    <property name="bottom_attach">3</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkRadioButton" id="PictureDeinterlaceDecomb">
+                                    <property name="label" translatable="yes">Deinterlace</property>
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">True</property>
+                                    <property name="receives_default">False</property>
+                                    <property name="draw_indicator">True</property>
+                                    <property name="group">PictureDecombDeinterlace</property>
                                   </object>
                                   <packing>
                                     <property name="top_attach">2</property>
                                     <property name="bottom_attach">3</property>
+                                    <property name="left_attach">1</property>
+                                    <property name="right_attach">2</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkLabel" id="PictureDecombLabel">
+                                    <property name="visible">True</property>
+                                    <property name="xalign">0</property>
+                                    <property name="label" translatable="yes">Decomb:</property>
+                                  </object>
+                                  <packing>
+                                    <property name="top_attach">3</property>
+                                    <property name="bottom_attach">4</property>
                                   </packing>
                                 </child>
                                 <child>
@@ -5692,8 +5723,8 @@ the required multiple.</property>
                                     <signal name="changed" handler="setting_widget_changed_cb"/>
                                   </object>
                                   <packing>
-                                    <property name="top_attach">2</property>
-                                    <property name="bottom_attach">3</property>
+                                    <property name="top_attach">3</property>
+                                    <property name="bottom_attach">4</property>
                                     <property name="left_attach">1</property>
                                     <property name="right_attach">2</property>
                                   </packing>
@@ -5709,22 +5740,22 @@ the required multiple.</property>
                                     <signal name="changed" handler="setting_widget_changed_cb"/>
                                   </object>
                                   <packing>
-                                    <property name="top_attach">3</property>
-                                    <property name="bottom_attach">4</property>
+                                    <property name="top_attach">4</property>
+                                    <property name="bottom_attach">5</property>
                                     <property name="left_attach">1</property>
                                     <property name="right_attach">2</property>
                                   </packing>
                                 </child>
 
                                 <child>
-                                  <object class="GtkLabel" id="label31">
+                                  <object class="GtkLabel" id="PictureDeinterlaceLabel">
                                     <property name="visible">True</property>
                                     <property name="xalign">0</property>
                                     <property name="label" translatable="yes">Deinterlace:</property>
                                   </object>
                                   <packing>
-                                    <property name="top_attach">4</property>
-                                    <property name="bottom_attach">5</property>
+                                    <property name="top_attach">5</property>
+                                    <property name="bottom_attach">6</property>
                                   </packing>
                                 </child>
                                 <child>
@@ -5735,8 +5766,8 @@ the required multiple.</property>
                                     <signal name="changed" handler="setting_widget_changed_cb"/>
                                   </object>
                                   <packing>
-                                    <property name="top_attach">4</property>
-                                    <property name="bottom_attach">5</property>
+                                    <property name="top_attach">5</property>
+                                    <property name="bottom_attach">6</property>
                                     <property name="left_attach">1</property>
                                     <property name="right_attach">2</property>
                                   </packing>
@@ -5752,8 +5783,8 @@ the required multiple.</property>
                                     <signal name="changed" handler="setting_widget_changed_cb"/>
                                   </object>
                                   <packing>
-                                    <property name="top_attach">5</property>
-                                    <property name="bottom_attach">6</property>
+                                    <property name="top_attach">6</property>
+                                    <property name="bottom_attach">7</property>
                                     <property name="left_attach">1</property>
                                     <property name="right_attach">2</property>
                                   </packing>
index 65f553f..231903d 100644 (file)
@@ -173,7 +173,7 @@ combo_opts_t container_opts =
 
 static options_map_t d_detel_opts[] =
 {
-       {"None",   "none",   0, ""},
+       {"Off",    "off",   0, ""},
        {"Custom", "custom", 1, ""},
        {"Default","default",2, NULL},
 };
@@ -185,7 +185,7 @@ combo_opts_t detel_opts =
 
 static options_map_t d_decomb_opts[] =
 {
-       {"None",   "none",   0, ""},
+       {"Off",    "off",   0, ""},
        {"Custom", "custom", 1, ""},
        {"Default","default",2, NULL},
 };
@@ -197,7 +197,7 @@ combo_opts_t decomb_opts =
 
 static options_map_t d_deint_opts[] =
 {
-       {"None",   "none",   0, ""},
+       {"Off",    "off",   0, ""},
        {"Custom", "custom", 1, ""},
        {"Fast",   "fast",   2, "-1:-1:-1:0:1"},
        {"Slow",   "slow",   3, "2:-1:-1:0:1"},
@@ -211,7 +211,7 @@ combo_opts_t deint_opts =
 
 static options_map_t d_denoise_opts[] =
 {
-       {"None",   "none",   0, ""},
+       {"Off",    "off",   0, ""},
        {"Custom", "custom", 1, ""},
        {"Weak",   "weak",   2, "2:1:2:3"},
        {"Medium", "medium", 3, "3:2:2:3"},
@@ -3382,9 +3382,17 @@ set_preview_job_settings(hb_job_t *job, GValue *settings)
                job->anamorphic.modulus = 2;
        }
 
-       gint deint = ghb_settings_combo_int(settings, "PictureDeinterlace");
-       gint decomb = ghb_settings_combo_int(settings, "PictureDecomb");
-       job->deinterlace = (!decomb && deint == 0) ? 0 : 1;
+       gboolean decomb_deint = ghb_settings_get_boolean(settings, "PictureDecombDeinterlace");
+       if (decomb_deint)
+       {
+               gint decomb = ghb_settings_combo_int(settings, "PictureDecomb");
+               job->deinterlace = (decomb == 0) ? 0 : 1;
+       }
+       else
+       {
+               gint deint = ghb_settings_combo_int(settings, "PictureDeinterlace");
+               job->deinterlace = (deint == 0) ? 0 : 1;
+       }
 
        gboolean keep_aspect;
        keep_aspect = ghb_settings_get_boolean(settings, "PictureKeepRatio");
@@ -3463,9 +3471,10 @@ ghb_validate_filters(signal_user_data_t *ud)
        gint index;
        gchar *message;
 
+       gboolean decomb_deint = ghb_settings_get_boolean(ud->settings, "PictureDecombDeinterlace");
        // deinte
        index = ghb_settings_combo_int(ud->settings, "PictureDeinterlace");
-       if (index == 1)
+       if (!decomb_deint && index == 1)
        {
                str = ghb_settings_get_string(ud->settings, "PictureDeinterlaceCustom");
                if (!ghb_validate_filter_string(str, 4))
@@ -3499,7 +3508,7 @@ ghb_validate_filters(signal_user_data_t *ud)
        }
        // decomb
        index = ghb_settings_combo_int(ud->settings, "PictureDecomb");
-       if (index == 1)
+       if (decomb_deint && index == 1)
        {
                str = ghb_settings_get_string(ud->settings, "PictureDecombCustom");
                if (!ghb_validate_filter_string(str, 15))
@@ -4016,9 +4025,10 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, gint titleindex)
        job->crop[3] = ghb_settings_get_int(js, "PictureRightCrop");
 
        
+       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");
-       if (!decomb)
+       if (!decomb_deint)
                job->deinterlace = (deint != 0) ? 1 : 0;
        else
                job->deinterlace = 0;
@@ -4064,7 +4074,7 @@ add_job(hb_handle_t *h, GValue *js, gint unique_id, gint titleindex)
                hb_filter_detelecine.settings = detel_str;
                hb_list_add( job->filters, &hb_filter_detelecine );
        }
-       if ( decomb )
+       if ( decomb_deint && decomb )
        {
                if (decomb != 1)
                {
index fe8d9e0..c103b99 100644 (file)
                <integer>16</integer>
                <key>PictureDeblock</key>
                <integer>0</integer>
+               <key>PictureDecombDeinterlace</key>
+               <true />
                <key>PictureDecomb</key>
-               <string>none</string>
+               <string>off</string>
                <key>PictureDecombCustom</key>
                <string></string>
                <key>Default</key>
                <key>PictureTopCrop</key>
                <integer>0</integer>
                <key>PictureDeinterlace</key>
-               <string>none</string>
+               <string>off</string>
                <key>PictureDeinterlaceCustom</key>
                <string></string>
                <key>PictureDenoise</key>
-               <string>none</string>
+               <string>off</string>
                <key>PictureDenoiseCustom</key>
                <string></string>
                <key>PictureDetelecine</key>
-               <string>none</string>
+               <string>off</string>
                <key>PictureDetelecineCustom</key>
                <string></string>
                <key>PicturePAR</key>
index 43babd1..7d31519 100644 (file)
@@ -1855,7 +1855,7 @@ value_map_t mix_xlat[] =
 
 value_map_t deint_xlat[] =
 {
-       {"0", "none"},
+       {"0", "off"},
        {"1", "custom"},
        {"2", "fast"},
        {"3", "slow"},
@@ -1865,7 +1865,7 @@ value_map_t deint_xlat[] =
 
 value_map_t denoise_xlat[] =
 {
-       {"0", "none"},
+       {"0", "off"},
        {"1", "custom"},
        {"2", "weak"},
        {"3", "medium"},
@@ -1875,7 +1875,7 @@ value_map_t denoise_xlat[] =
 
 value_map_t detel_xlat[] =
 {
-       {"0", "none"},
+       {"0", "off"},
        {"1", "custom"},
        {"2", "default"},
        {NULL, NULL}
@@ -1883,7 +1883,7 @@ value_map_t detel_xlat[] =
 
 value_map_t decomb_xlat[] =
 {
-       {"0", "none"},
+       {"0", "off"},
        {"1", "custom"},
        {"2", "default"},
        {NULL, NULL}
index 8aca1f6..8456d27 100644 (file)
@@ -283,8 +283,10 @@ add_to_queue_list(signal_user_data_t *ud, GValue *settings, GtkTreeIter *piter)
                 source_width, source_height, width, height, aspect_desc);
 
        gint decomb, detel;
+       gboolean decomb_deint;
        gboolean filters = FALSE;
 
+       decomb_deint = ghb_settings_get_boolean(settings, "PictureDecombDeinterlace");
        decomb = ghb_settings_combo_int(settings, "PictureDecomb");
        g_string_append_printf(str, "<b>Filters:</b><small>");
        detel = ghb_settings_combo_int(settings, "PictureDetelecine");
@@ -300,7 +302,7 @@ add_to_queue_list(signal_user_data_t *ud, GValue *settings, GtkTreeIter *piter)
                }
                filters = TRUE;
        }
-       if (decomb)
+       if (decomb_deint && decomb)
        {
                g_string_append_printf(str, " - Decomb");
                if (decomb == 1)
@@ -312,7 +314,7 @@ add_to_queue_list(signal_user_data_t *ud, GValue *settings, GtkTreeIter *piter)
                }
                filters = TRUE;
        }
-       else
+       else if (!decomb_deint)
        {
                gint deint = ghb_settings_combo_int(settings, "PictureDeinterlace");
                if (deint)
index 1f8e8c9..76b5eda 100644 (file)
                <key>Folder</key>
                <true/>
                <key>PresetBuildNumber</key>
-               <integer>2009073001</integer>
+               <integer>2009082501</integer>
                <key>PresetName</key>
                <string>Apple</string>
                <key>Type</key>
                                <key>PictureDeblock</key>
                                <integer>0</integer>
                                <key>PictureDecomb</key>
+                               <integer>2</integer>
+                               <key>PictureDecombDeinterlace</key>
                                <integer>1</integer>
                                <key>PictureDeinterlace</key>
                                <integer>0</integer>
                                <key>PictureDenoise</key>
                                <integer>0</integer>
                                <key>PictureDetelecine</key>
-                               <integer>1</integer>
+                               <integer>2</integer>
                                <key>PictureHeight</key>
                                <integer>0</integer>
                                <key>PictureKeepRatio</key>
                <key>Folder</key>
                <true/>
                <key>PresetBuildNumber</key>
-               <integer>2009073001</integer>
+               <integer>2009082501</integer>
                <key>PresetName</key>
                <string>Regular</string>
                <key>Type</key>
                <key>Folder</key>
                <true/>
                <key>PresetBuildNumber</key>
-               <integer>2009073001</integer>
+               <integer>2009082501</integer>
                <key>PresetName</key>
                <string>Legacy</string>
                <key>Type</key>
index 598b86b..4747f69 100644 (file)
@@ -40,8 +40,12 @@ static dependency_t dep_map[] =
        {"FileFormat", "Mp4LargeFile", "mp4", FALSE, TRUE},
        {"FileFormat", "Mp4HttpOptimize", "mp4", FALSE, TRUE},
        {"FileFormat", "Mp4iPodCompatible", "mp4", FALSE, TRUE},
-       {"PictureDecomb", "PictureDeinterlace", "none", FALSE, FALSE},
-       {"PictureDecomb", "PictureDeinterlaceCustom", "none", FALSE, TRUE},
+       {"PictureDecombDeinterlace", "PictureDeinterlace", "TRUE", TRUE, TRUE},
+       {"PictureDecombDeinterlace", "PictureDeinterlaceCustom", "TRUE", TRUE, TRUE},
+       {"PictureDecombDeinterlace", "PictureDeinterlaceLabel", "TRUE", TRUE, TRUE},
+       {"PictureDecombDeinterlace", "PictureDecomb", "FALSE", TRUE, TRUE},
+       {"PictureDecombDeinterlace", "PictureDecombCustom", "FALSE", TRUE, TRUE},
+       {"PictureDecombDeinterlace", "PictureDecombLabel", "FALSE", TRUE, TRUE},
        {"PictureDeinterlace", "PictureDeinterlaceCustom", "custom", FALSE, TRUE},
        {"PictureDenoise", "PictureDenoiseCustom", "custom", FALSE, TRUE},
        {"PictureDecomb", "PictureDecombCustom", "custom", FALSE, TRUE},