8 : m_sort(
Sort::ByFileName),
12 m_addTimeStr(TTK_DEFAULT_STR),
14 m_name(TTK_DEFAULT_STR),
15 m_path(TTK_DEFAULT_STR),
16 m_format(TTK_DEFAULT_STR),
17 m_duration(TTK_DEFAULT_STR)
37 m_name = name.isEmpty() ? fin.completeBaseName() :
name;
40 m_addTime = fin.lastModified().toMSecsSinceEpoch();
58 return m_path == other.m_path;
65 case Sort::ByFileName:
return m_name < other.m_name;
66 case Sort::BySinger:
return artist() < other.artist();
67 case Sort::ByFileSize:
return m_size < other.m_size;
68 case Sort::ByAddTime:
return m_addTime < other.m_addTime;
69 case Sort::ByDuration:
return m_duration < other.m_duration;
70 case Sort::ByPlayCount:
return m_playCount < other.m_playCount;
80 case Sort::ByFileName:
return m_name > other.m_name;
81 case Sort::BySinger:
return artist() > other.artist();
82 case Sort::ByFileSize:
return m_size > other.m_size;
83 case Sort::ByAddTime:
return m_addTime > other.m_addTime;
84 case Sort::ByDuration:
return m_duration > other.m_duration;
85 case Sort::ByPlayCount:
return m_playCount > other.m_playCount;
103 for(
int i = 0; i <
size; ++i)
117 if(!songs.isEmpty() && !meta.
lyrics().isEmpty())
120 if(file.open(QIODevice::WriteOnly))
122 file.write(meta.
lyrics().toUtf8());
TTK_MODULE_EXPORT QString generateSongArtist(const QString &name, const QString &key=TTK_DEFAULT_STR)
TTK_MODULE_EXPORT QString trackRelatedPath(const QString &path)
QString path() const noexcept
TTK_MODULE_EXPORT QString generateSongTitle(const QString &name, const QString &key=TTK_DEFAULT_STR)
TTK_MODULE_EXPORT QString sizeByteToLabel(qint64 size)
QString artist() const noexcept
TTK_MODULE_EXPORT QString lrcDirPrefix()
QString duration() const noexcept
QString name() const noexcept
bool operator<(const MusicSong &other) const noexcept
bool operator==(const MusicSong &other) const noexcept
#define TTK_FILE_SUFFIX(fin)
The class of the music song info.
QString title() const noexcept
bool operator>(const MusicSong &other) const noexcept
TTK_MODULE_EXPORT QString generateSongName(const QString &title, const QString &artist) noexcept
TTK_MODULE_EXPORT MusicSongList generateSongList(const QString &path)