</packing>
</child>
<child>
+ <object class="GtkCheckButton" id="reduce_hd_preview">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="tooltip_text"> Automatically reduce the size of High Definition previews.
+This is helpfull when working on laptops or similar
+non-hidef screens. </property>
+ <property name="label" translatable="yes">Scale down High Definition previews</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="pref_changed_cb"/>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkCheckButton" id="noscale">
<property name="visible">True</property>
<property name="can_focus">True</property>
<signal name="toggled" handler="pref_changed_cb"/>
</object>
<packing>
- <property name="position">2</property>
+ <property name="position">3</property>
</packing>
</child>
<child>
<signal name="toggled" handler="vcodec_changed_cb"/>
</object>
<packing>
- <property name="position">3</property>
+ <property name="position">4</property>
</packing>
</child>
<child>
<signal name="toggled" handler="tweaks_changed_cb"/>
</object>
<packing>
- <property name="position">4</property>
+ <property name="position">5</property>
</packing>
</child>
<child>
<signal name="toggled" handler="hbfd_feature_changed_cb"/>
</object>
<packing>
- <property name="position">5</property>
+ <property name="position">6</property>
</packing>
</child>
</object>
}
}
+#define RED_HEIGHT 720.0
+#define RED_WIDTH 1280.0
+
GdkPixbuf*
ghb_get_preview_image(
gint titleindex,
else
dstHeight = dstHeight * par_height / par_width;
}
+ if (ghb_settings_get_boolean(settings, "reduce_hd_preview"))
+ {
+ gdouble factor = 1.0;
+
+ if (dstHeight > RED_HEIGHT)
+ {
+ factor = RED_HEIGHT / (gdouble)dstHeight;
+ }
+ if (dstWidth * factor > RED_WIDTH)
+ {
+ factor = RED_WIDTH / (gdouble)dstWidth;
+ }
+ dstHeight = dstHeight * factor + 0.5;
+ dstWidth = dstWidth * factor + 0.5;
+ }
g_debug("scaled %d x %d\n", dstWidth, dstHeight);
GdkPixbuf *scaled_preview;
<false />
<key>nocheckvquality</key>
<false />
+ <key>reduce_hd_preview</key>
+ <true />
<key>noscale</key>
<false />
<key>show_presets</key>
gchar *str;
GValue *gval;
+ if (lin_val == NULL) return NULL;
str = ghb_value_string(lin_val);
if (strcmp(str, "none") == 0)
{
gchar *str;
GValue *gval;
+ if (mac_val == NULL) return NULL;
str = ghb_value_string(mac_val);
if (strcmp(str, "None") == 0)
{
gchar *str;
GValue *gval = NULL;
+ if (lin_val == NULL) return NULL;
str = ghb_value_string(lin_val);
if (strcmp(str, "none") == 0)
{
gchar *str;
GValue *gval;
+ if (mac_val == NULL) return NULL;
val = ghb_value_int(mac_val);
if (val <= 0)
{
store_presets();
}
+static gboolean
+check_old_presets()
+{
+ gint count, ii;
+
+ count = ghb_array_len(presetsPlist);
+ for (ii = count-1; ii >= 0; ii--)
+ {
+ GValue *dict;
+ GValue *type;
+
+ dict = ghb_array_get_nth(presetsPlist, ii);
+ type = ghb_dict_lookup(dict, "Type");
+ if (type == NULL)
+ return TRUE;
+ }
+ return FALSE;
+}
+
void
ghb_presets_load()
{
presetsPlist = ghb_value_dup(ghb_resource_get("standard-presets"));
store_presets();
}
+ else if (check_old_presets())
+ {
+ ghb_value_free(presetsPlist);
+ presetsPlist = ghb_value_dup(ghb_resource_get("standard-presets"));
+ store_presets();
+ }
import_xlat_presets(presetsPlist);
}
" </child>\n"
" <child>\n"
" <object class="GtkCheckButton" i"
+"d="reduce_hd_preview">\n"
+" <property name="visible">Tr"
+"ue</property>\n"
+" <property name="can_focus">"
+"True</property>\n"
+" <property name="tooltip_text"&"
+"gt; Automatically reduce the size of High Definition previews.\n"
+"This is helpfull when working on laptops or similar\n"
+"non-hidef screens. </property>\n"
+" <property name="label" transla"
+"table="yes">Scale down High Definition previews</proper"
+"ty>\n"
+" <property name="draw_indicator""
+";>True</property>\n"
+" <signal name="toggled" handler"
+"="pref_changed_cb"/>\n"
+" </object>\n"
+" <packing>\n"
+" <property name="position">2"
+"</property>\n"
+" </packing>\n"
+" </child>\n"
+" <child>\n"
+" <object class="GtkCheckButton" i"
"d="noscale">\n"
" <property name="visible">Tr"
"ue</property>\n"
"="pref_changed_cb"/>\n"
" </object>\n"
" <packing>\n"
-" <property name="position">2"
+" <property name="position">3"
"</property>\n"
" </packing>\n"
" </child>\n"
"="vcodec_changed_cb"/>\n"
" </object>\n"
" <packing>\n"
-" <property name="position">3"
+" <property name="position">4"
"</property>\n"
" </packing>\n"
" </child>\n"
"="tweaks_changed_cb"/>\n"
" </object>\n"
" <packing>\n"
-" <property name="position">4"
+" <property name="position">5"
"</property>\n"
" </packing>\n"
" </child>\n"
"="hbfd_feature_changed_cb"/>\n"
" </object>\n"
" <packing>\n"
-" <property name="position">5"
+" <property name="position">6"
"</property>\n"
" </packing>\n"
" </child>\n"
" <false />\n"
" <key>noscale</key>\n"
" <false />\n"
+" <key>reduce_hd_preview</key>\n"
+" <true />\n"
" <key>show_presets</key>\n"
" <true />\n"
" <key>use_source_name</key>\n"
</packing>
</child>
<child>
+ <object class="GtkCheckButton" id="reduce_hd_preview">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="tooltip_text"> Automatically reduce the size of High Definition previews.
+This is helpfull when working on laptops or similar
+non-hidef screens. </property>
+ <property name="label" translatable="yes">Scale down High Definition previews</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="pref_changed_cb"/>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkCheckButton" id="noscale">
<property name="visible">True</property>
<property name="can_focus">True</property>
<signal name="toggled" handler="pref_changed_cb"/>
</object>
<packing>
- <property name="position">2</property>
+ <property name="position">3</property>
</packing>
</child>
<child>
<signal name="toggled" handler="vcodec_changed_cb"/>
</object>
<packing>
- <property name="position">3</property>
+ <property name="position">4</property>
</packing>
</child>
<child>
<signal name="toggled" handler="tweaks_changed_cb"/>
</object>
<packing>
- <property name="position">4</property>
+ <property name="position">5</property>
</packing>
</child>
<child>
<signal name="toggled" handler="hbfd_feature_changed_cb"/>
</object>
<packing>
- <property name="position">5</property>
+ <property name="position">6</property>
</packing>
</child>
</object>
<false />
<key>noscale</key>
<false />
+ <key>reduce_hd_preview</key>
+ <true />
<key>show_presets</key>
<true />
<key>use_source_name</key>