Changeset View
Changeset View
Standalone View
Standalone View
src/extractors/taglibextractor.h
Show All 17 Lines | |||||
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 | 25 | | |||
26 | namespace TagLib | | |||
27 | { | | |||
28 | namespace ASF { | | |||
29 | class Tag; | | |||
30 | } | | |||
31 | namespace ID3v2 { | | |||
32 | class Tag; | | |||
33 | } | | |||
34 | namespace MP4 { | | |||
35 | class Tag; | | |||
36 | } | | |||
37 | class PropertyMap; | | |||
38 | } | | |||
39 | | ||||
40 | namespace KFileMetaData | 26 | namespace KFileMetaData | ||
41 | { | 27 | { | ||
42 | 28 | | |||
43 | class TagLibExtractor : public ExtractorPlugin | 29 | class TagLibExtractor : public ExtractorPlugin | ||
44 | { | 30 | { | ||
45 | Q_OBJECT | 31 | Q_OBJECT | ||
46 | Q_PLUGIN_METADATA(IID "org.kde.kf5.kfilemetadata.ExtractorPlugin" | 32 | Q_PLUGIN_METADATA(IID "org.kde.kf5.kfilemetadata.ExtractorPlugin" | ||
47 | FILE "taglibextractor.json") | 33 | FILE "taglibextractor.json") | ||
48 | Q_INTERFACES(KFileMetaData::ExtractorPlugin) | 34 | Q_INTERFACES(KFileMetaData::ExtractorPlugin) | ||
49 | 35 | | |||
50 | public: | 36 | public: | ||
51 | explicit TagLibExtractor(QObject* parent = nullptr); | 37 | explicit TagLibExtractor(QObject* parent = nullptr); | ||
52 | 38 | | |||
53 | void extract(ExtractionResult* result) override; | 39 | void extract(ExtractionResult* result) override; | ||
54 | QStringList mimetypes() const override; | 40 | QStringList mimetypes() const override; | ||
55 | 41 | | |||
56 | private: | | |||
57 | | ||||
58 | void extractId3Tags(TagLib::ID3v2::Tag* Id3Tags, ExtractionResult* result); | | |||
59 | void extractMp4Tags(TagLib::MP4::Tag* mp4Tags, ExtractionResult* result); | | |||
60 | void extractAsfTags(TagLib::ASF::Tag* asfTags, ExtractionResult* result); | | |||
61 | void readGenericProperties(const TagLib::PropertyMap &savedProperties, ExtractionResult* result); | | |||
62 | }; | 42 | }; | ||
63 | 43 | | |||
64 | } | 44 | } | ||
65 | 45 | | |||
66 | #endif // TAGLIBEXTRACTOR_H | 46 | #endif // TAGLIBEXTRACTOR_H |