3#if QT_VERSION >= QT_VERSION_CHECK(6,0,0)
4#include <QStringConverter>
13 m_outFile(fileName), m_outStream(&m_outFile)
15#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
22 LOG(VB_GENERAL, LOG_ERR, QString(
"Failed to create '%1'").arg(fileName));
26 LOG(VB_GENERAL, LOG_DEBUG, QString(
"Created '%1'").arg(fileName));
42 for (
const auto & text : std::as_const(sub.
m_text))
53 QTime time = QTime::fromMSecsSinceStartOfDay(time_in_msec.count());
54 return time.toString(
"HH:mm:ss,zzz");
Represents one subtitle record.
std::chrono::milliseconds m_length
Time we have to show subtitle, msec.
QStringList m_text
Lines of text of subtitles.
std::chrono::milliseconds m_startTime
Time we have to start showing subtitle, msec.
static QString FormatTime(std::chrono::milliseconds time_in_msec)
Formats time to format appropriate to SubRip file.
void AddSubtitle(const OneSubtitle &sub, int number)
Adds next subtitle.
SRTWriter(const QString &fileName)
QTextStream m_outStream
Output stream associated with m_outFile.
QFile m_outFile
Output file.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)