15 QStringList data(QString(
m_file.readAll()).
split(
"\n"));
21 if(!data.takeFirst().toLower().contains(
"[playlist]"))
26 const QRegExp regx1(
"^File(\\d+)=(.+)");
27 const QRegExp regx2(
"^Length(\\d+)=(-{0,1}\\d+)");
32 for(
const QString &line :
qAsConst(data))
34 if(regx1.indexIn(line) > -1)
36 if((number = regx1.cap(1).toInt()) > 0)
45 else if(regx2.indexIn(line) > -1)
47 if((number = regx2.cap(1).toInt()) > 0)
81 data << QString(
"[playlist]");
84 for(
int i = 0; i < items.count(); ++i)
90 data << QString(
"File%1=%2").arg(count).arg(song.path());
91 data << QString(
"Title%1=%2").arg(count).arg(song.name());
96 data <<
"NumberOfEntries=" + QString::number(count);
99 m_file.write(data.join(
"\n").toUtf8());
virtual bool readBuffer(MusicSongItemList &items) overridefinal
virtual bool writeBuffer(const MusicSongItemList &items) overridefinal
TTK_MODULE_EXPORT QStringList split(const QString &value, const QString &key=TTK_DEFAULT_STR)
The class of the read write interface.
The class of the music song item.
The class of the music song info.
#define TTK_ERROR_STREAM(msg)
The class of the ttk file interface.
static qint64 formatDuration(const QString &time) noexcept