MCPcopy Create free account
hub / github.com/QNapi/qnapi / perform

Method perform

libqnapi/src/subtitlepostprocessor.cpp:27–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25 : ppConfig(ppConfig), subtitleConverter(subtitleConverter) {}
26
27void SubtitlePostProcessor::perform(const QString& movieFilePath,
28 const QString& subtitleFilePath) const {
29 if (ppConfig.removeWordsEnabled()) {
30 ppRemoveLinesContainingWords(subtitleFilePath, ppConfig.removeWords());
31 }
32
33 switch (ppConfig.encodingChangeMethod()) {
34 case ECM_REPLACE_DIACRITICS:
35 ppReplaceDiacriticsWithASCII(subtitleFilePath);
36 break;
37 case ECM_CHANGE:
38 if (!ppConfig.encodingAutoDetectFrom() ||
39 !ppChangeSubtitlesEncoding(subtitleFilePath, ppConfig.encodingTo())) {
40 ppChangeSubtitlesEncoding(subtitleFilePath, ppConfig.encodingFrom(),
41 ppConfig.encodingTo());
42 }
43 break;
44 case ECM_ORIGINAL:
45 // Nie ruszaj pobranych napisów!
46 break;
47 }
48
49 if (!ppConfig.subFormat().isEmpty()) {
50 QString targetFormat = ppConfig.subFormat();
51 subtitleConverter->convertSubtitles(subtitleFilePath, targetFormat,
52 subtitleFilePath, movieFilePath);
53 }
54}
55
56bool SubtitlePostProcessor::ppReplaceDiacriticsWithASCII(
57 const QString& subtitleFilePath) const {

Callers 1

postProcessSubtitlesMethod · 0.80

Calls 8

removeWordsEnabledMethod · 0.80
removeWordsMethod · 0.80
encodingChangeMethodMethod · 0.80
encodingToMethod · 0.80
encodingFromMethod · 0.80
subFormatMethod · 0.80
convertSubtitlesMethod · 0.80

Tested by

no test coverage detected