MythTV  master
metaioflacvorbis.h
Go to the documentation of this file.
1 #ifndef METAIOFLACVORBIS_H_
2 #define METAIOFLACVORBIS_H_
3 
4 // libmythmetadata
5 #include "metaiotaglib.h"
6 #include "musicmetadata.h"
7 
8 // Taglib
9 #include <flacfile.h>
10 
11 using TagLib::Tag;
12 using TagLib::String;
13 
22 {
23 public:
24  MetaIOFLACVorbis(void) = default;
25  ~MetaIOFLACVorbis(void) override = default;
26 
27  bool write(const QString &filename, MusicMetadata* mdata) override; // MetaIOTagLib
28  bool writeAlbumArt(const QString &filename, const AlbumArtImage *albumart) override; // MetaIO
29  bool removeAlbumArt(const QString &filename, const AlbumArtImage *albumart) override; // MetaIO
30 
31  MusicMetadata* read(const QString &filename) override; // MetaIOTagLib
32  AlbumArtList getAlbumArtList(const QString &filename) override; // MetaIO
33  QImage *getAlbumArt(const QString &filename, ImageType type) override; // MetaIO
34 
35  bool supportsEmbeddedImages(void) override { return true; } // MetaIO
36 
37  bool changeImageType(const QString &filename, const AlbumArtImage *albumart,
38  ImageType newType) override; // MetaIO
39 
40  bool TagExists(const QString &filename) override; // MetaIO
41 
42 private:
43  static TagLib::FLAC::File *OpenFile(const QString &filename);
44  static TagLib::FLAC::Picture *getPictureFromFile(TagLib::FLAC::File *flacfile,
45  ImageType type);
46  static TagLib::FLAC::Picture::Type PictureTypeFromImageType(ImageType itype);
47  static QString getExtFromMimeType(const QString &mimeType);
48 };
49 
50 #endif
MetaIOFLACVorbis::supportsEmbeddedImages
bool supportsEmbeddedImages(void) override
Does the tag support embedded cover art.
Definition: metaioflacvorbis.h:35
MetaIO::getAlbumArt
virtual QImage * getAlbumArt(const QString &filename, ImageType type)
Definition: metaio.h:103
MetaIOTagLib::write
bool write(const QString &filename, MusicMetadata *mdata) override=0
Writes all metadata back to a file.
MetaIO::writeAlbumArt
virtual bool writeAlbumArt(const QString &filename, const AlbumArtImage *albumart)
Definition: metaio.h:77
MusicMetadata
Definition: musicmetadata.h:81
MetaIO::changeImageType
virtual bool changeImageType(const QString &filename, const AlbumArtImage *albumart, ImageType newType)
Definition: metaio.h:93
MetaIOTagLib::read
MusicMetadata * read(const QString &filename) override=0
Reads MusicMetadata from a file.
MetaIO::removeAlbumArt
virtual bool removeAlbumArt(const QString &filename, const AlbumArtImage *albumart)
Definition: metaio.h:85
filename
QString filename
Definition: mythplugins/mytharchive/mytharchivehelper/main.cpp:637
MetaIOFLACVorbis::MetaIOFLACVorbis
MetaIOFLACVorbis(void)=default
MetaIOTagLib
Base for Taglib metadata classes.
Definition: metaiotaglib.h:21
metaiotaglib.h
MetaIO::getAlbumArtList
virtual AlbumArtList getAlbumArtList(const QString &filename)
Reads the list of embedded images in the tag.
Definition: metaio.h:71
AlbumArtList
QList< AlbumArtImage * > AlbumArtList
Definition: musicmetadata.h:56
MetaIOFLACVorbis
Read and write Vorbis (Xiph) tags in a FLAC file.
Definition: metaioflacvorbis.h:22
MetaIOFLACVorbis::~MetaIOFLACVorbis
~MetaIOFLACVorbis(void) override=default
AlbumArtImage
Definition: musicmetadata.h:40
MetaIO::TagExists
virtual bool TagExists(const QString &filename)
Definition: metaio.h:135
META_PUBLIC
#define META_PUBLIC
Definition: mythmetaexp.h:9
ImageType
ImageType
Definition: musicmetadata.h:29
musicmetadata.h