Sayonara Player
Tagging.h
1 /* id3.h */
2 
3 /* Copyright (C) 2011-2017 Lucio Carreras
4  *
5  * This file is part of sayonara player
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11 
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16 
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef TAGGING_H_
22 #define TAGGING_H_
23 
24 #include <taglib/audioproperties.h>
25 
26 namespace TagLib { class FileRef; }
27 
28 class QString;
29 class QImage;
30 class MetaData;
31 class QString;
32 class QByteArray;
33 
38 namespace Tagging
39 {
43  enum class Quality : unsigned char
44  {
45  Fast=TagLib::AudioProperties::Fast,
46  Standard=TagLib::AudioProperties::Average,
47  Quality=TagLib::AudioProperties::Accurate,
48  Dirty
49  };
50 
51  enum class TagType : unsigned char
52  {
53  ID3v1=0,
54  ID3v2,
55  Xiph,
56  MP4,
57  Unsupported,
58  Unknown
59  };
60 
67  bool getMetaDataOfFile(MetaData& md, Tagging::Quality quality=Tagging::Quality::Standard);
68 
74  bool setMetaDataOfFile(const MetaData& md);
75 
76  bool write_cover(const MetaData& md, const QImage& image);
77  bool write_cover(const MetaData& md, const QString& image_path);
78 
79  bool extract_cover(const MetaData& md, QByteArray& cover_data, QString& mime_type);
80 
81  bool is_valid_file(const TagLib::FileRef& f);
82  bool is_cover_supported(const QString& filepath);
83 
84  Tagging::TagType get_tag_type(const QString& filepath);
85  QString tag_type_to_string(Tagging::TagType);
86 }
87 
88 #endif
bool setMetaDataOfFile(const MetaData &md)
writes metadata into file specivied in MetaData::_filepath
Definition: AlbumArtist.h:29
ID3v2Frame namespace.
Definition: AlbumArtist.h:26
The MetaData class.
Definition: MetaData.h:55
Quality
The Quality enum.
Definition: Tagging.h:43
Tagging namespace.
Definition: AbstractFrame.h:38
Definition: AlbumArtist.h:32
bool getMetaDataOfFile(MetaData &md, Tagging::Quality quality=Tagging::Quality::Standard)
get metadata of file. Filepath should be given within the MetaData struct
Definition: AbstractFrame.h:31