|
MythTV master
|
#include <libmythmetadata/metaio.h>
Classes | |
| struct | m_fileinfo |
Public Member Functions | |
| MetaIO () | |
| virtual | ~MetaIO (void)=default |
| virtual bool | write (const QString &filename, MusicMetadata *mdata)=0 |
| Writes all metadata back to a file. More... | |
| virtual bool | writeVolatileMetadata (const QString &filename, 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 (const QString &filename) |
| Reads the list of embedded images in the tag. More... | |
| virtual bool | writeAlbumArt (const QString &filename, const AlbumArtImage *albumart) |
| virtual bool | removeAlbumArt (const QString &filename, const AlbumArtImage *albumart) |
| virtual bool | changeImageType (const QString &filename, const AlbumArtImage *albumart, ImageType newType) |
| virtual QImage * | getAlbumArt (const QString &filename, 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 (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 |
| MetaIO::MetaIO | ( | ) |
Definition at line 25 of file metaio.cpp.
|
virtualdefault |
|
inlinevirtual |
Reimplemented in MetaIOFLACVorbis, and MetaIOID3.
Definition at line 85 of file metaio.h.
Referenced by MainServer::HandleMusicTagChangeImage().
|
static |
Finds an appropriate tagger for the given file.
| filename | The filename to find a tagger for. |
Definition at line 31 of file metaio.cpp.
Referenced by MusicFileScanner::AddFileToDB(), ImportMusicDialog::addPressed(), MusicMetadata::getTagger(), readMetadata(), ImportMusicDialog::scanDirectory(), and EditAlbumartDialog::showMenu().
|
inlinevirtual |
Reimplemented in MetaIOFLACVorbis, and MetaIOID3.
Definition at line 92 of file metaio.h.
Referenced by ExtractImage().
|
inlinevirtual |
Reads the list of embedded images in the tag.
| filename | The filename to read images from. |
Reimplemented in MetaIOFLACVorbis, and MetaIOID3.
Definition at line 68 of file metaio.h.
Referenced by MusicFileScanner::AddFileToDB(), and MainServer::HandleMusicFindAlbumArt().
|
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 90 of file metaio.cpp.
Referenced by MusicFileScanner::UpdateFileInDB().
|
protectedpure virtual |
Implemented in MetaIOAVFComment, MetaIOMP4, and MetaIOTagLib.
Referenced by readFromFilename().
|
pure virtual |
Reads MusicMetadata from a file.
| filename | The filename to read metadata from. |
Implemented in MetaIOAVFComment, MetaIOFLACVorbis, MetaIOID3, MetaIOMP4, MetaIOOggVorbis, MetaIOWavPack, and MetaIOTagLib.
Referenced by readMetadata(), and ImportMusicDialog::scanDirectory().
| 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 169 of file metaio.cpp.
| 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 101 of file metaio.cpp.
Referenced by MetaIOAVFComment::read(), MetaIOMP4::read(), readFromFilename(), MetaIOTagLib::ReadGenericMetadata(), and readMetadata().
| void MetaIO::readFromFilename | ( | MusicMetadata * | metadata | ) |
Reads MusicMetadata based on the folder/filename.
| metadata | MusicMetadata Pointer |
Definition at line 192 of file metaio.cpp.
|
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 62 of file metaio.cpp.
Referenced by MusicFileScanner::AddFileToDB(), getMetadata(), handleMedia(), and MusicFileScanner::UpdateFileInDB().
|
inlinevirtual |
Reimplemented in MetaIOFLACVorbis, and MetaIOID3.
Definition at line 79 of file metaio.h.
Referenced by MainServer::HandleMusicTagRemoveImage().
|
protected |
Definition at line 232 of file metaio.cpp.
Referenced by MetaIOID3::SaveFile(), MetaIOFLACVorbis::write(), MetaIOOggVorbis::write(), MetaIOWavPack::write(), and MetaIOFLACVorbis::writeAlbumArt().
|
protected |
Definition at line 223 of file metaio.cpp.
Referenced by MetaIOID3::SaveFile(), MetaIOFLACVorbis::write(), MetaIOOggVorbis::write(), MetaIOWavPack::write(), and MetaIOFLACVorbis::writeAlbumArt().
|
inlinevirtual |
Does the tag support embedded cover art.
Reimplemented in MetaIOFLACVorbis, and MetaIOID3.
Definition at line 57 of file metaio.h.
Referenced by MusicFileScanner::AddFileToDB(), ExtractImage(), MainServer::HandleMusicFindAlbumArt(), MainServer::HandleMusicTagAddImage(), MainServer::HandleMusicTagChangeImage(), MainServer::HandleMusicTagRemoveImage(), and EditAlbumartDialog::showMenu().
|
inlinevirtual |
Reimplemented in MetaIOFLACVorbis, and MetaIOID3.
|
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 MetaIOAVFComment, MetaIOFLACVorbis, MetaIOID3, MetaIOMP4, MetaIOOggVorbis, MetaIOWavPack, and MetaIOTagLib.
Referenced by ImportMusicDialog::addPressed(), MainServer::HandleMusicTagUpdateMetadata(), and UpdateMeta().
|
inlinevirtual |
Reimplemented in MetaIOFLACVorbis, and MetaIOID3.
Definition at line 73 of file metaio.h.
Referenced by MainServer::HandleMusicTagAddImage().
|
inlinevirtual |
Writes rating and playcount back to a file.
| filename | The filename to write metadata to |
| mdata | A pointer to a MusicMetadata object |
Reimplemented in MetaIOID3.
|
static |
Definition at line 160 of file metaio.h.
Referenced by MusicFileScanner::AddFileToDB(), createTagger(), avfDecoderFactory::extension(), GetMusicFilter(), MusicFileScanner::IsMusicFile(), and setupKeys().
|
protected |
Definition at line 168 of file metaio.h.
Referenced by MetaIOID3::CloseFile(), MetaIOID3::OpenFile(), restoreTimeStamps(), saveTimeStamps(), MetaIOFLACVorbis::write(), MetaIOOggVorbis::write(), MetaIOWavPack::write(), and MetaIOFLACVorbis::writeAlbumArt().
|
protected |
Definition at line 169 of file metaio.h.
Referenced by readFromFilename().