diff --git a/aegisub/src/ass_file.cpp b/aegisub/src/ass_file.cpp index 6fa333aa1..684bc6679 100644 --- a/aegisub/src/ass_file.cpp +++ b/aegisub/src/ass_file.cpp @@ -38,6 +38,7 @@ #ifndef AGI_PRE #include #include +#include #include #include @@ -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); diff --git a/aegisub/src/libresrc/default_config.json b/aegisub/src/libresrc/default_config.json index 2b628777d..3a009c081 100644 --- a/aegisub/src/libresrc/default_config.json +++ b/aegisub/src/libresrc/default_config.json @@ -346,6 +346,11 @@ }, "Subtitle" : { + "Default Resolution" : { + "Auto" : true, + "Height" : 720, + "Width" : 1280 + }, "Edit Box" : { "Font Face" : "", "Font Size" : 10, diff --git a/aegisub/src/preferences.cpp b/aegisub/src/preferences.cpp index 96f6b8491..96950e91e 100644 --- a/aegisub/src/preferences.cpp +++ b/aegisub/src/preferences.cpp @@ -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); }