MCPcopy Create free account
hub / github.com/TypesettingTools/Aegisub / save_subtitles

Function save_subtitles

src/command/subtitle.cpp:344–362  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

342};
343
344static void save_subtitles(agi::Context *c, agi::fs::path filename) {
345 if (filename.empty()) {
346 c->videoController->Stop();
347 filename = SaveFileSelector(_("Save subtitles file"), "Path/Last/Subtitles",
348 c->subsController->Filename().stem().string() + ".ass", "ass",
349 "Advanced Substation Alpha (*.ass)|*.ass", c->parent);
350 if (filename.empty()) return;
351 }
352
353 try {
354 c->subsController->Save(filename);
355 }
356 catch (const agi::Exception& err) {
357 wxMessageBox(to_wx(err.GetMessage()), "Error", wxOK | wxICON_ERROR | wxCENTER, c->parent);
358 }
359 catch (...) {
360 wxMessageBox("Unknown error", "Error", wxOK | wxICON_ERROR | wxCENTER, c->parent);
361 }
362}
363
364struct subtitle_save final : public Command {
365 CMD_NAME("subtitle/save")

Callers

nothing calls this directly

Calls 6

SaveFileSelectorFunction · 0.85
stringMethod · 0.80
FilenameMethod · 0.80
to_wxFunction · 0.50
StopMethod · 0.45
SaveMethod · 0.45

Tested by

no test coverage detected