TTKMusicPlayer
4.1.3.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
|
The class of the music song meta. More...
#include <musicsongmeta.h>
Public Member Functions | |
MusicSongMeta () noexcept | |
~MusicSongMeta () noexcept | |
bool | read (const QString &url) |
bool | save () |
QString | filePath () const noexcept |
QString | fileBasePath () noexcept |
QString | fileRelatedPath () noexcept |
QString | artist () noexcept |
QString | title () noexcept |
QString | album () noexcept |
QString | comment () noexcept |
QString | year () noexcept |
QString | trackNum () noexcept |
QString | genre () noexcept |
QString | rating () noexcept |
QString | channel () noexcept |
QString | description () noexcept |
void | setArtist (const QString &artist) noexcept |
void | setTitle (const QString &title) noexcept |
void | setAlbum (const QString &album) noexcept |
void | setComment (const QString &comment) noexcept |
void | setYear (const QString &year) noexcept |
void | setTrackNum (const QString &track) noexcept |
void | setGenre (const QString &genre) noexcept |
void | setRating (const QString &rating) noexcept |
void | setCover (const QPixmap &cover) noexcept |
void | setCover (const QByteArray &data) noexcept |
QPixmap | cover () noexcept |
QString | lyrics () noexcept |
QString | sampleRate () noexcept |
QString | bitrate () noexcept |
QString | duration () noexcept |
MusicSongMeta (const MusicSongMeta &other) noexcept | |
MusicSongMeta (MusicSongMeta &&other) noexcept | |
MusicSongMeta & | operator= (const MusicSongMeta &other) noexcept |
MusicSongMeta & | operator= (MusicSongMeta &&other) noexcept |
void | setSongMetaIndex (int index) noexcept |
int | songMetaCount () const noexcept |
Private Member Functions | |
void | clearSongMeta () noexcept |
MusicMeta * | songMeta () noexcept |
QString | formatString (TagMeta::Type type) noexcept |
bool | readInformation () |
bool | saveInformation () |
Private Attributes | |
int | m_offset |
QString | m_path |
QList< MusicMeta * > | m_songMetas |
The class of the music song meta.
Definition at line 30 of file musicsongmeta.h.
|
noexcept |
Object constructor.
Definition at line 23 of file musicsongmeta.cpp.
|
noexcept |
|
noexcept |
Definition at line 245 of file musicsongmeta.cpp.
References qAsConst.
|
noexcept |
Definition at line 261 of file musicsongmeta.cpp.
|
noexcept |
Get song album.
Definition at line 97 of file musicsongmeta.cpp.
References TagMeta::ALBUM, and formatString().
Referenced by MusicDownloadMetaDataRequest::downLoadFinished(), MusicFileInformationWidget::initialize(), MusicLocalManagerWidget::refreshItems(), and saveInformation().
|
noexcept |
Get artist name.
Definition at line 87 of file musicsongmeta.cpp.
References TagMeta::ARTIST, and formatString().
Referenced by MusicDownloadMetaDataRequest::downLoadFinished(), TTK::generateSongList(), MusicFileInformationWidget::initialize(), MusicLocalManagerWidget::refreshItems(), MusicSongCheckToolsRenameThread::run(), and saveInformation().
|
noexcept |
Get song bitrate.
Definition at line 234 of file musicsongmeta.cpp.
References TagMeta::BITRATE, MusicMeta::m_metaData, songMeta(), and TTK_DEFAULT_STR.
Referenced by MusicFileInformationWidget::initialize(), MusicSongRingtoneMaker::initInputPath(), readInformation(), MusicSongCheckToolsDuplicateThread::run(), and MusicSongCheckToolsQualityThread::run().
|
noexcept |
Get song channel.
Definition at line 133 of file musicsongmeta.cpp.
References TagMeta::CHANNEL, MusicMeta::m_metaData, and songMeta().
Referenced by MusicFileInformationWidget::initialize().
|
privatenoexcept |
Clear music song meta.
Definition at line 315 of file musicsongmeta.cpp.
References m_offset, and m_songMetas.
Referenced by readInformation(), and ~MusicSongMeta().
|
noexcept |
Get song comment.
Definition at line 102 of file musicsongmeta.cpp.
References TagMeta::COMMENT, MusicMeta::m_metaData, and songMeta().
Referenced by MusicDownloadMetaDataRequest::downLoadFinished().
|
noexcept |
Get song image cover artist.
Definition at line 215 of file musicsongmeta.cpp.
References MusicMeta::m_cover, and songMeta().
Referenced by MusicSongsListItemInfoWidget::initialize(), MusicFileInformationWidget::initialize(), MusicSongsListPlayWidget::initialize(), MusicFileInformationWidget::openDynamicImage(), MusicFileInformationWidget::saveAlbumImage(), and saveInformation().
|
noexcept |
Read music description.
Definition at line 138 of file musicsongmeta.cpp.
References TagMeta::DESCRIPTION, MusicMeta::m_metaData, and songMeta().
Referenced by MusicFileInformationWidget::initialize(), and readInformation().
|
noexcept |
Get song time duration.
Definition at line 240 of file musicsongmeta.cpp.
References TagMeta::LENGTH, MusicMeta::m_metaData, and songMeta().
Referenced by TTK::generateNetworkSongTime(), TTK::generateSongList(), MusicFileInformationWidget::initialize(), MusicSongsListPlayWidget::initialize(), and MusicSongRingtoneMaker::initInputPath().
|
noexcept |
Get file url.
Definition at line 77 of file musicsongmeta.cpp.
References MusicMeta::m_path, and songMeta().
Referenced by TTK::generateSongList().
|
noexcept |
|
noexcept |
Get file related path.
Definition at line 82 of file musicsongmeta.cpp.
References MusicMeta::m_metaData, songMeta(), and TagMeta::URL.
Referenced by MusicSongsListItemInfoWidget::initialize(), and MusicFileInformationWidget::initialize().
|
privatenoexcept |
Format legal data string.
Definition at line 338 of file musicsongmeta.cpp.
References TTK::String::charactersReplace().
Referenced by album(), artist(), genre(), rating(), and title().
|
noexcept |
Get song genre.
Definition at line 123 of file musicsongmeta.cpp.
References formatString(), and TagMeta::GENRE.
Referenced by MusicFileInformationWidget::initialize(), MusicLocalManagerWidget::refreshItems(), and saveInformation().
|
noexcept |
Get song lyrics buffer data.
Definition at line 224 of file musicsongmeta.cpp.
References MusicMeta::m_lyrics, and songMeta().
Referenced by TTK::generateSongList().
|
noexcept |
Definition at line 269 of file musicsongmeta.cpp.
|
noexcept |
Definition at line 287 of file musicsongmeta.cpp.
References m_offset, m_path, m_songMetas, and std::swap().
|
noexcept |
Get song rating.
Definition at line 128 of file musicsongmeta.cpp.
References formatString(), and TagMeta::RATING.
Referenced by MusicFileInformationWidget::initialize().
bool MusicSongMeta::read | ( | const QString & | url | ) |
Read music file to anaylsis.
Definition at line 34 of file musicsongmeta.cpp.
References MusicFormats::isTrack(), m_path, readInformation(), setSongMetaIndex(), TTK_SEPARATOR, and TTK_WSEPARATOR.
Referenced by MusicDownloadMetaDataRequest::downLoadFinished(), TTK::generateNetworkSongTime(), TTK::generateSongList(), MusicSongsListItemInfoWidget::initialize(), MusicFileInformationWidget::initialize(), MusicSongsListPlayWidget::initialize(), MusicSongRingtoneMaker::initInputPath(), MusicFileInformationWidget::openDynamicImage(), MusicLocalManagerWidget::refreshItems(), MusicSongCheckToolsRenameThread::run(), MusicSongCheckToolsDuplicateThread::run(), MusicSongCheckToolsQualityThread::run(), MusicFileInformationWidget::saveAlbumImage(), and MusicFileInformationWidget::saveTag().
|
private |
Read other taglib not by plugin.
Definition at line 351 of file musicsongmeta.cpp.
References TagMeta::ALBUM, Qmmp::ALBUM, TrackInfo::AllParts, TagMeta::ARTIST, Qmmp::ARTIST, TagMeta::BITRATE, Qmmp::BITRATE, bitrate(), TagMeta::CHANNEL, Qmmp::CHANNELS, clearSongMeta(), TagMeta::COMMENT, Qmmp::COMMENT, MetaDataModel::cover(), DecoderFactory::createMetaDataModel(), DecoderFactory::createPlayList(), DecoderProperties::description, TagMeta::DESCRIPTION, description(), MetaDataModel::descriptions(), MetaDataModel::extraProperties(), Decoder::findByFilePath(), TTKTime::formatDuration(), TagMeta::GENRE, Qmmp::GENRE, TagMeta::LENGTH, MetaDataModel::lyrics(), MusicMeta::m_cover, MusicMeta::m_lyrics, MusicMeta::m_metaData, m_offset, MusicMeta::m_path, m_path, m_songMetas, DecoderProperties::name, DecoderFactory::properties(), qAsConst, TagMeta::RATING, TagMeta::SAMPLERATE, Qmmp::SAMPLERATE, DecoderProperties::shortName, songMeta(), SPLITER, TagMeta::TITLE, Qmmp::TITLE, TagMeta::TRACK, Qmmp::TRACK, TTK_LINEFEED, TagMeta::URL, TagMeta::YEAR, and Qmmp::YEAR.
Referenced by read().
|
noexcept |
Get song sample rate.
Definition at line 229 of file musicsongmeta.cpp.
References MusicMeta::m_metaData, TagMeta::SAMPLERATE, and songMeta().
Referenced by MusicFileInformationWidget::initialize(), and MusicSongRingtoneMaker::initInputPath().
bool MusicSongMeta::save | ( | ) |
Save music tags to music file.
Definition at line 67 of file musicsongmeta.cpp.
References saveInformation().
Referenced by MusicDownloadMetaDataRequest::downLoadFinished(), and MusicFileInformationWidget::saveTag().
|
private |
Save other taglib not by plugin.
Definition at line 455 of file musicsongmeta.cpp.
References album(), Qmmp::ALBUM, artist(), Qmmp::ARTIST, cover(), DecoderFactory::createMetaDataModel(), Decoder::findByFilePath(), genre(), Qmmp::GENRE, m_path, MetaDataModel::removeCover(), TagModel::save(), MetaDataModel::setCover(), TagModel::setValue(), MetaDataModel::tags(), title(), Qmmp::TITLE, Qmmp::TRACK, trackNum(), year(), and Qmmp::YEAR.
Referenced by save().
|
noexcept |
Set song album.
Definition at line 153 of file musicsongmeta.cpp.
References TagMeta::ALBUM.
Referenced by MusicDownloadMetaDataRequest::downLoadFinished(), MusicFileInformationWidget::saveTag(), and MusicDownloadWidget::startToRequestMusic().
|
noexcept |
Set artist name.
Definition at line 143 of file musicsongmeta.cpp.
References TagMeta::ARTIST.
Referenced by MusicDownloadMetaDataRequest::downLoadFinished(), MusicFileInformationWidget::saveTag(), and MusicDownloadWidget::startToRequestMusic().
|
noexcept |
Set song comment.
Definition at line 158 of file musicsongmeta.cpp.
References TagMeta::COMMENT.
Referenced by MusicDownloadWidget::startToRequestMusic().
|
noexcept |
Set song image cover artist.
Definition at line 183 of file musicsongmeta.cpp.
Referenced by MusicDownloadMetaDataRequest::downLoadFinished(), and MusicFileInformationWidget::saveTag().
|
noexcept |
Set song image cover artist.
Definition at line 199 of file musicsongmeta.cpp.
References TTK_ERROR_STREAM.
|
noexcept |
Set song genre.
Definition at line 173 of file musicsongmeta.cpp.
References TagMeta::GENRE.
Referenced by MusicFileInformationWidget::saveTag().
|
noexcept |
|
noexcept |
Set music song meta index offset.
Definition at line 300 of file musicsongmeta.cpp.
Referenced by TTK::generateSongList(), and read().
|
noexcept |
Set song title.
Definition at line 148 of file musicsongmeta.cpp.
References TagMeta::TITLE.
Referenced by MusicDownloadMetaDataRequest::downLoadFinished(), MusicFileInformationWidget::saveTag(), and MusicDownloadWidget::startToRequestMusic().
|
noexcept |
Set song track number.
Definition at line 168 of file musicsongmeta.cpp.
References TagMeta::TRACK.
Referenced by MusicDownloadMetaDataRequest::downLoadFinished(), and MusicDownloadWidget::startToRequestMusic().
|
noexcept |
Set song year.
Definition at line 163 of file musicsongmeta.cpp.
References TagMeta::YEAR.
Referenced by MusicDownloadMetaDataRequest::downLoadFinished(), MusicFileInformationWidget::saveTag(), and MusicDownloadWidget::startToRequestMusic().
|
privatenoexcept |
Get music song meta pointer.
Definition at line 322 of file musicsongmeta.cpp.
References m_offset, m_songMetas, and songMetaCount().
Referenced by bitrate(), channel(), comment(), cover(), description(), duration(), fileBasePath(), fileRelatedPath(), lyrics(), readInformation(), sampleRate(), trackNum(), and year().
|
noexcept |
Get music song meta count.
Definition at line 310 of file musicsongmeta.cpp.
References m_songMetas.
Referenced by TTK::generateSongList(), and songMeta().
|
noexcept |
Get song title.
Definition at line 92 of file musicsongmeta.cpp.
References formatString(), and TagMeta::TITLE.
Referenced by MusicDownloadMetaDataRequest::downLoadFinished(), TTK::generateSongList(), MusicFileInformationWidget::initialize(), MusicLocalManagerWidget::refreshItems(), MusicSongCheckToolsRenameThread::run(), and saveInformation().
|
noexcept |
Get song track number.
Definition at line 112 of file musicsongmeta.cpp.
References MusicMeta::m_metaData, songMeta(), TagMeta::TRACK, and TTK_DEFAULT_STR.
Referenced by MusicDownloadMetaDataRequest::downLoadFinished(), MusicFileInformationWidget::initialize(), MusicLocalManagerWidget::refreshItems(), and saveInformation().
|
noexcept |
Get song year.
Definition at line 107 of file musicsongmeta.cpp.
References MusicMeta::m_metaData, songMeta(), and TagMeta::YEAR.
Referenced by MusicDownloadMetaDataRequest::downLoadFinished(), MusicFileInformationWidget::initialize(), MusicLocalManagerWidget::refreshItems(), and saveInformation().
|
private |
Definition at line 208 of file musicsongmeta.h.
Referenced by clearSongMeta(), operator=(), readInformation(), and songMeta().
|
private |
Definition at line 209 of file musicsongmeta.h.
Referenced by filePath(), operator=(), read(), readInformation(), and saveInformation().
|
private |
Definition at line 210 of file musicsongmeta.h.
Referenced by clearSongMeta(), operator=(), readInformation(), songMeta(), and songMetaCount().