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  virtual ~MetaIOFLACVorbis(void) = 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
QList< AlbumArtImage * > AlbumArtList
Definition: musicmetadata.h:54
bool write(const QString &filename, MusicMetadata *mdata) override=0
Writes all metadata back to a file.
virtual AlbumArtList getAlbumArtList(const QString &filename)
Reads the list of embedded images in the tag.
Definition: metaio.h:71
virtual QImage * getAlbumArt(const QString &filename, ImageType type)
Definition: metaio.h:103
Read and write Vorbis (Xiph) tags in a FLAC file.
bool supportsEmbeddedImages(void) override
Does the tag support embedded cover art.
virtual bool changeImageType(const QString &filename, const AlbumArtImage *albumart, ImageType newType)
Definition: metaio.h:93
virtual bool writeAlbumArt(const QString &filename, const AlbumArtImage *albumart)
Definition: metaio.h:77
virtual bool removeAlbumArt(const QString &filename, const AlbumArtImage *albumart)
Definition: metaio.h:85
#define META_PUBLIC
Definition: mythmetaexp.h:9
MusicMetadata * read(const QString &filename) override=0
Reads MusicMetadata from a file.
ImageType
Definition: musicmetadata.h:26
virtual bool TagExists(const QString &filename)
Definition: metaio.h:135
Base for Taglib metadata classes.
Definition: metaiotaglib.h:20