MythTV
master
|
#include <metaio.h>
Classes | |
struct | m_fileinfo |
Public Member Functions | |
MetaIO (void) | |
virtual | ~MetaIO (void)=default |
virtual bool | write (const QString &filename, MusicMetadata *mdata)=0 |
Writes all metadata back to a file. More... | |
virtual bool | writeVolatileMetadata ([[maybe_unused]] const QString &filename, [[maybe_unused]] MusicMetadata *mdata) |
Writes rating and playcount back to a file. More... | |
virtual MusicMetadata * | read (const QString &filename)=0 |
Reads MusicMetadata from a file. More... | |
virtual bool | supportsEmbeddedImages (void) |
Does the tag support embedded cover art. More... | |
virtual AlbumArtList | getAlbumArtList ([[maybe_unused]] const QString &filename) |
Reads the list of embedded images in the tag. More... | |
virtual bool | writeAlbumArt ([[maybe_unused]] const QString &filename, [[maybe_unused]] const AlbumArtImage *albumart) |
virtual bool | removeAlbumArt ([[maybe_unused]] const QString &filename, [[maybe_unused]] const AlbumArtImage *albumart) |
virtual bool | changeImageType ([[maybe_unused]] const QString &filename, [[maybe_unused]] const AlbumArtImage *albumart, [[maybe_unused]] ImageType newType) |
virtual QImage * | getAlbumArt ([[maybe_unused]] const QString &filename, [[maybe_unused]] ImageType type) |
void | readFromFilename (const QString &filename, QString &artist, QString &album, QString &title, QString &genre, int &tracknum) |
Reads MusicMetadata based on the folder/filename. More... | |
MusicMetadata * | readFromFilename (const QString &filename, bool blnLength=false) |
Reads MusicMetadata based on the folder/filename. More... | |
void | readFromFilename (MusicMetadata *metadata) |
Reads MusicMetadata based on the folder/filename. More... | |
virtual bool | TagExists ([[maybe_unused]] const QString &filename) |
Static Public Member Functions | |
static MetaIO * | createTagger (const QString &filename) |
Finds an appropriate tagger for the given file. More... | |
static MusicMetadata * | readMetadata (const QString &filename) |
Read the metadata from filename directly. More... | |
static MusicMetadata * | getMetadata (const QString &filename) |
Get the metadata for filename . More... | |
Static Public Attributes | |
static const QString | kValidFileExtensions |
Protected Member Functions | |
void | saveTimeStamps (void) |
void | restoreTimeStamps (void) |
virtual std::chrono::milliseconds | getTrackLength (const QString &filename)=0 |
Protected Attributes | |
QString | m_filename |
QString | m_filenameFormat |
|
virtualdefault |
|
pure virtual |
Writes all metadata back to a file.
filename | The filename to write metadata to |
mdata | A pointer to a MusicMetadata object |
Implemented in MetaIOTagLib, MetaIOID3, MetaIOWavPack, MetaIOFLACVorbis, MetaIOOggVorbis, MetaIOAVFComment, and MetaIOMP4.
Referenced by ImportMusicDialog::addPressed(), MainServer::HandleMusicTagUpdateMetadata(), and UpdateMeta().
|
inlinevirtual |
Writes rating and playcount back to a file.
filename | The filename to write metadata to |
mdata | A pointer to a MusicMetadata object |
|
pure virtual |
Reads MusicMetadata from a file.
filename | The filename to read metadata from. |
Implemented in MetaIOTagLib, MetaIOID3, MetaIOFLACVorbis, MetaIOWavPack, MetaIOOggVorbis, MetaIOAVFComment, and MetaIOMP4.
Referenced by readMetadata(), and ImportMusicDialog::scanDirectory().
|
inlinevirtual |
Does the tag support embedded cover art.
Reimplemented in MetaIOID3, and MetaIOFLACVorbis.
Definition at line 58 of file metaio.h.
Referenced by MusicFileScanner::AddFileToDB(), ExtractImage(), MainServer::HandleMusicFindAlbumArt(), MainServer::HandleMusicTagAddImage(), MainServer::HandleMusicTagChangeImage(), MainServer::HandleMusicTagRemoveImage(), and EditAlbumartDialog::showMenu().
|
inlinevirtual |
Reads the list of embedded images in the tag.
filename | The filename to read images from. |
Definition at line 69 of file metaio.h.
Referenced by MusicFileScanner::AddFileToDB(), and MainServer::HandleMusicFindAlbumArt().
|
inlinevirtual |
Definition at line 74 of file metaio.h.
Referenced by MainServer::HandleMusicTagAddImage().
|
inlinevirtual |
Definition at line 80 of file metaio.h.
Referenced by MainServer::HandleMusicTagRemoveImage().
|
inlinevirtual |
Definition at line 86 of file metaio.h.
Referenced by MainServer::HandleMusicTagChangeImage().
|
inlinevirtual |
Definition at line 93 of file metaio.h.
Referenced by ExtractImage().
void MetaIO::readFromFilename | ( | const QString & | filename, |
QString & | artist, | ||
QString & | album, | ||
QString & | title, | ||
QString & | genre, | ||
int & | tracknum | ||
) |
Reads MusicMetadata based on the folder/filename.
[in] | filename | The filename to try and determine metadata for. |
[out] | artist | |
[out] | album | |
[out] | title | |
[out] | genre | |
[out] | tracknum |
Definition at line 95 of file metaio.cpp.
Referenced by MetaIOMP4::read(), MetaIOAVFComment::read(), readFromFilename(), MetaIOTagLib::ReadGenericMetadata(), and readMetadata().
MusicMetadata * MetaIO::readFromFilename | ( | const QString & | filename, |
bool | blnLength = false |
||
) |
Reads MusicMetadata based on the folder/filename.
filename | The filename to try and determine metadata for. |
blnLength | If true, read the file length as well. |
Definition at line 161 of file metaio.cpp.
void MetaIO::readFromFilename | ( | MusicMetadata * | metadata | ) |
Reads MusicMetadata based on the folder/filename.
metadata | MusicMetadata Pointer |
Definition at line 184 of file metaio.cpp.
|
inlinevirtual |
|
static |
Finds an appropriate tagger for the given file.
filename | The filename to find a tagger for. |
Definition at line 25 of file metaio.cpp.
Referenced by MusicFileScanner::AddFileToDB(), ImportMusicDialog::addPressed(), MusicMetadata::getTagger(), readMetadata(), ImportMusicDialog::scanDirectory(), and EditAlbumartDialog::showMenu().
|
static |
Read the metadata from filename
directly.
Creates a MetaIO
object using MetaIO::createTagger
and uses the MetaIO object to read the metadata.
filename | The filename to read metadata from. |
MusicMetadata
owned by the caller Definition at line 56 of file metaio.cpp.
Referenced by MusicFileScanner::AddFileToDB(), getMetadata(), handleMedia(), and MusicFileScanner::UpdateFileInDB().
|
static |
Get the metadata for filename
.
First tries to read the metadata from the database. If there is no database entry, it'll call MetaIO::readMetadata
.
filename | The filename to get metadata for. |
MusicMetadata
owned by the caller Definition at line 84 of file metaio.cpp.
Referenced by MusicFileScanner::UpdateFileInDB().
|
protected |
Definition at line 215 of file metaio.cpp.
Referenced by MetaIOID3::SaveFile(), MetaIOOggVorbis::write(), MetaIOFLACVorbis::write(), MetaIOWavPack::write(), and MetaIOFLACVorbis::writeAlbumArt().
|
protected |
Definition at line 224 of file metaio.cpp.
Referenced by MetaIOID3::SaveFile(), MetaIOOggVorbis::write(), MetaIOFLACVorbis::write(), MetaIOWavPack::write(), and MetaIOFLACVorbis::writeAlbumArt().
|
protectedpure virtual |
Implemented in MetaIOTagLib, MetaIOAVFComment, and MetaIOMP4.
Referenced by readFromFilename().
|
static |
Definition at line 161 of file metaio.h.
Referenced by MusicFileScanner::AddFileToDB(), createTagger(), avfDecoderFactory::extension(), GetMusicFilter(), MusicFileScanner::IsMusicFile(), and setupKeys().
|
protected |
Definition at line 169 of file metaio.h.
Referenced by MetaIOID3::CloseFile(), MetaIOID3::OpenFile(), restoreTimeStamps(), saveTimeStamps(), MetaIOOggVorbis::write(), MetaIOFLACVorbis::write(), MetaIOWavPack::write(), and MetaIOFLACVorbis::writeAlbumArt().
|
protected |
Definition at line 170 of file metaio.h.
Referenced by readFromFilename().