Make default script resolution customizable

Originally committed to SVN as r6205.
This commit is contained in:
Thomas Goyne 2012-01-08 01:04:37 +00:00
parent 6b85782dc5
commit 0fd475031a
3 changed files with 20 additions and 4 deletions

View File

@ -38,6 +38,7 @@
#ifndef AGI_PRE
#include <algorithm>
#include <fstream>
#include <inttypes.h>
#include <list>
#include <wx/filename.h>
@ -439,6 +440,10 @@ void AssFile::LoadDefault(bool defline) {
AddLine("WrapStyle: 0", "[Script Info]",version);
AddLine("ScaledBorderAndShadow: yes","[Script Info]",version);
AddLine("Collisions: Normal","[Script Info]",version);
if (!OPT_GET("Subtitle/Default Resolution/Auto")->GetBool()) {
AddLine(wxString::Format("PlayResX: %" PRId64, OPT_GET("Subtitle/Default Resolution/Width")->GetInt()),"[Script Info]",version);
AddLine(wxString::Format("PlayResY: %" PRId64, OPT_GET("Subtitle/Default Resolution/Height")->GetInt()),"[Script Info]",version);
}
AddLine("","[Script Info]",version);
AddLine("[V4+ Styles]","[V4+ Styles]",version);
AddLine("Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding","[V4+ Styles]",version);

View File

@ -346,6 +346,11 @@
},
"Subtitle" : {
"Default Resolution" : {
"Auto" : true,
"Height" : 720,
"Width" : 1280
},
"Edit Box" : {
"Font Face" : "",
"Font Size" : 10,

View File

@ -185,10 +185,6 @@ Video::Video(wxTreebook *book, Preferences *parent): OptionPage(book, parent, _(
OptionAdd(general, _("Seek video to line start on selection change"), "Video/Subtitle Sync");
CellSkip(general);
const wxString cres_arr[3] = { _("Never"), _("Ask"), _("Always") };
wxArrayString choice_res(3, cres_arr);
OptionChoice(general, _("Match video resolution on open"), choice_res, "Video/Check Script Res");
const wxString czoom_arr[24] = { "12.5%", "25%", "37.5%", "50%", "62.5%", "75%", "87.5%", "100%", "112.5%", "125%", "137.5%", "150%", "162.5%", "175%", "187.5%", "200%", "212.5%", "225%", "237.5%", "250%", "262.5%", "275%", "287.5%", "300%" };
wxArrayString choice_zoom(24, czoom_arr);
OptionChoice(general, _("Default Zoom"), choice_zoom, "Video/Default Zoom");
@ -199,6 +195,16 @@ Video::Video(wxTreebook *book, Preferences *parent): OptionPage(book, parent, _(
wxArrayString scr_res(3, cscr_arr);
OptionChoice(general, _("Screenshot save path"), scr_res, "Path/Screenshot");
wxFlexGridSizer *resolution = PageSizer(_("Script Resolution"));
OptionAdd(resolution, _("Use resolution of first video opened"), "Subtitle/Default Resolution/Auto");
CellSkip(resolution);
OptionAdd(resolution, _("Default width"), "Subtitle/Default Resolution/Width");
OptionAdd(resolution, _("Default height"), "Subtitle/Default Resolution/Height");
const wxString cres_arr[3] = { _("Never"), _("Ask"), _("Always") };
wxArrayString choice_res(3, cres_arr);
OptionChoice(resolution, _("Match video resolution on open"), choice_res, "Video/Check Script Res");
SetSizerAndFit(sizer);
}