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 QPixmap;
30 class MetaData;
31 class QString;
32 class QByteArray;
33 
38 namespace Tagging
39 {
40 
41  namespace Util
42  {
46  enum class Quality : unsigned char
47  {
48  Fast=TagLib::AudioProperties::Fast,
49  Standard=TagLib::AudioProperties::Average,
50  Quality=TagLib::AudioProperties::Accurate,
51  Dirty
52  };
53 
54  enum class TagType : unsigned char
55  {
56  ID3v1=0,
57  ID3v2,
58  Xiph,
59  MP4,
60  Unsupported,
61  Unknown
62  };
63 
64 
71  bool getMetaDataOfFile(MetaData& md, Tagging::Util::Quality quality=Tagging::Util::Quality::Standard);
72 
78  bool setMetaDataOfFile(const MetaData& md);
79 
80  bool write_cover(const QString& filepath, const QPixmap& image);
81  bool write_cover(const QString& filepath, const QString& image_path);
82  bool extract_cover(const QString& filepath, QByteArray& cover_data, QString& mime_type);
83  QPixmap extract_cover(const QString& filepath);
84  bool has_cover(const QString& filepath);
85  bool is_cover_supported(const QString& filepath);
86 
87  bool write_lyrics(const MetaData& md, const QString& lyrics);
88  bool extract_lyrics(const MetaData& md, QString& lyrics);
89  bool is_lyrics_supported(const QString& filepath);
90 
91  bool is_valid_file(const TagLib::FileRef& f);
92 
93 
94  Tagging::Util::TagType get_tag_type(const QString& filepath);
95  QString tag_type_to_string(Tagging::Util::TagType);
96  }
97 }
98 
99 #endif
ID3v2Frame namespace.
Definition: AlbumArtist.h:26
The MetaData class.
Definition: MetaData.h:48
Helper functions.
Definition: Crypt.h:29
The GUI_TagEdit class.
Definition: AbstractLibrary.h:42