Changeset View
Changeset View
Standalone View
Standalone View
src/extractors/taglibextractor.h
Show All 16 Lines | 1 | /* | |||
---|---|---|---|---|---|
17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | 20 | | |||
21 | #ifndef TAGLIBEXTRACTOR_H | 21 | #ifndef TAGLIBEXTRACTOR_H | ||
22 | #define TAGLIBEXTRACTOR_H | 22 | #define TAGLIBEXTRACTOR_H | ||
23 | 23 | | |||
24 | #include "extractorplugin.h" | 24 | #include "extractorplugin.h" | ||
25 | #include <tstring.h> | ||||
26 | #include <tstringlist.h> | ||||
27 | #include <tfilestream.h> | ||||
25 | 28 | | |||
26 | namespace KFileMetaData | 29 | namespace KFileMetaData | ||
27 | { | 30 | { | ||
28 | 31 | | |||
29 | class TagLibExtractor : public ExtractorPlugin | 32 | class TagLibExtractor : public ExtractorPlugin | ||
30 | { | 33 | { | ||
31 | Q_OBJECT | 34 | Q_OBJECT | ||
32 | Q_PLUGIN_METADATA(IID "org.kde.kf5.kfilemetadata.ExtractorPlugin") | 35 | Q_PLUGIN_METADATA(IID "org.kde.kf5.kfilemetadata.ExtractorPlugin") | ||
33 | Q_INTERFACES(KFileMetaData::ExtractorPlugin) | 36 | Q_INTERFACES(KFileMetaData::ExtractorPlugin) | ||
34 | 37 | | |||
35 | public: | 38 | public: | ||
36 | explicit TagLibExtractor(QObject* parent = nullptr); | 39 | explicit TagLibExtractor(QObject* parent = nullptr); | ||
37 | 40 | | |||
38 | void extract(ExtractionResult* result) Q_DECL_OVERRIDE; | 41 | void extract(ExtractionResult* result) Q_DECL_OVERRIDE; | ||
39 | QStringList mimetypes() const Q_DECL_OVERRIDE; | 42 | QStringList mimetypes() const Q_DECL_OVERRIDE; | ||
43 | | ||||
44 | private: | ||||
45 | struct ExtractedData { | ||||
46 | TagLib::String artists; | ||||
47 | TagLib::String albumArtists; | ||||
48 | TagLib::String composers; | ||||
49 | TagLib::String lyricists; | ||||
50 | TagLib::StringList genres; | ||||
51 | QVariant discNumber; | ||||
52 | }; | ||||
53 | void extractMP3(TagLib::FileStream& stream, ExtractedData& data); | ||||
54 | void extractMP4(TagLib::FileStream& stream, ExtractedData& data); | ||||
55 | void extractMusePack(TagLib::FileStream& stream, ExtractedData& data); | ||||
56 | void extractOgg(TagLib::FileStream& stream, const QString& mimetype, ExtractedData& data); | ||||
40 | }; | 57 | }; | ||
41 | 58 | | |||
42 | } | 59 | } | ||
43 | 60 | | |||
44 | #endif // TAGLIBEXTRACTOR_H | 61 | #endif // TAGLIBEXTRACTOR_H |