| 38 | } |
| 39 | |
| 40 | void AssFile::LoadDefault(bool include_dialogue_line, std::string const& style_catalog) { |
| 41 | Info.emplace_back("Title", "Default Aegisub file"); |
| 42 | Info.emplace_back("ScriptType", "v4.00+"); |
| 43 | Info.emplace_back("WrapStyle", "0"); |
| 44 | Info.emplace_back("ScaledBorderAndShadow", "yes"); |
| 45 | if (!OPT_GET("Subtitle/Default Resolution/Auto")->GetBool()) { |
| 46 | Info.emplace_back("PlayResX", std::to_string(OPT_GET("Subtitle/Default Resolution/Width")->GetInt())); |
| 47 | Info.emplace_back("PlayResY", std::to_string(OPT_GET("Subtitle/Default Resolution/Height")->GetInt())); |
| 48 | } |
| 49 | Info.emplace_back("YCbCr Matrix", "None"); |
| 50 | |
| 51 | // Add default style |
| 52 | Styles.push_back(*new AssStyle); |
| 53 | |
| 54 | // Add/replace any catalog styles requested |
| 55 | if (AssStyleStorage::CatalogExists(style_catalog)) { |
| 56 | AssStyleStorage catalog; |
| 57 | catalog.LoadCatalog(style_catalog); |
| 58 | catalog.ReplaceIntoFile(*this); |
| 59 | } |
| 60 | |
| 61 | if (include_dialogue_line) |
| 62 | Events.push_back(*new AssDialogue); |
| 63 | } |
| 64 | |
| 65 | AssFile::AssFile(const AssFile &from) |
| 66 | : Info(from.Info) |
no test coverage detected