Changeset View
Changeset View
Standalone View
Standalone View
src/extractors/taglibextractor.h
Show All 30 Lines | 30 | namespace ASF { | |||
---|---|---|---|---|---|
31 | class Tag; | 31 | class Tag; | ||
32 | } | 32 | } | ||
33 | namespace ID3v2 { | 33 | namespace ID3v2 { | ||
34 | class Tag; | 34 | class Tag; | ||
35 | } | 35 | } | ||
36 | namespace MP4 { | 36 | namespace MP4 { | ||
37 | class Tag; | 37 | class Tag; | ||
38 | } | 38 | } | ||
39 | namespace APE { | 39 | class PropertyMap; | ||
40 | class Tag; | | |||
41 | } | | |||
42 | namespace Ogg { | | |||
43 | class XiphComment; | | |||
44 | } | | |||
45 | } | 40 | } | ||
46 | 41 | | |||
47 | namespace KFileMetaData | 42 | namespace KFileMetaData | ||
48 | { | 43 | { | ||
49 | 44 | | |||
50 | class TagLibExtractor : public ExtractorPlugin | 45 | class TagLibExtractor : public ExtractorPlugin | ||
51 | { | 46 | { | ||
52 | Q_OBJECT | 47 | Q_OBJECT | ||
53 | Q_PLUGIN_METADATA(IID "org.kde.kf5.kfilemetadata.ExtractorPlugin") | 48 | Q_PLUGIN_METADATA(IID "org.kde.kf5.kfilemetadata.ExtractorPlugin") | ||
54 | Q_INTERFACES(KFileMetaData::ExtractorPlugin) | 49 | Q_INTERFACES(KFileMetaData::ExtractorPlugin) | ||
55 | 50 | | |||
56 | public: | 51 | public: | ||
57 | explicit TagLibExtractor(QObject* parent = nullptr); | 52 | explicit TagLibExtractor(QObject* parent = nullptr); | ||
58 | 53 | | |||
59 | void extract(ExtractionResult* result) override; | 54 | void extract(ExtractionResult* result) override; | ||
60 | QStringList mimetypes() const override; | 55 | QStringList mimetypes() const override; | ||
61 | 56 | | |||
62 | private: | 57 | private: | ||
63 | struct ExtractedData { | 58 | | ||
64 | TagLib::String artists; | 59 | void extractId3Tags(TagLib::ID3v2::Tag* Id3Tags, ExtractionResult* result); | ||
65 | TagLib::String albumArtists; | 60 | void extractMp4Tags(TagLib::MP4::Tag* mp4Tags, ExtractionResult* result); | ||
66 | TagLib::String composers; | 61 | void extractAsfTags(TagLib::ASF::Tag* asfTags, ExtractionResult* result); | ||
67 | TagLib::String lyricists; | 62 | void readGenericProperties(const TagLib::PropertyMap &savedProperties, ExtractionResult* result); | ||
68 | TagLib::String location; | | |||
69 | TagLib::String performer; | | |||
70 | TagLib::String conductor; | | |||
71 | TagLib::String copyright; | | |||
72 | TagLib::String ensemble; | | |||
73 | TagLib::String arranger; | | |||
74 | TagLib::String language; | | |||
75 | TagLib::String publisher; | | |||
76 | TagLib::String label; | | |||
77 | TagLib::String author; | | |||
78 | TagLib::String license; | | |||
79 | TagLib::String lyrics; | | |||
80 | TagLib::String compilation; | | |||
81 | TagLib::StringList genres; | | |||
82 | QString replayGainAlbumGain; | | |||
83 | QString replayGainAlbumPeak; | | |||
84 | QString replayGainTrackGain; | | |||
85 | QString replayGainTrackPeak; | | |||
86 | QVariant discNumber; | | |||
87 | QVariant opus; | | |||
88 | QVariant rating; | | |||
89 | }; | | |||
90 | void extractId3Tags(TagLib::ID3v2::Tag* id3Tags, ExtractedData& data); | | |||
91 | void extractMp4Tags(TagLib::MP4::Tag* mp4Tags, ExtractedData& data); | | |||
92 | void extractApeTags(TagLib::APE::Tag* apeTags, ExtractedData& data); | | |||
93 | void extractVorbisTags(TagLib::Ogg::XiphComment* vorbisTags, ExtractedData& data); | | |||
94 | void extractAsfTags(TagLib::ASF::Tag* asfTags, ExtractedData& data); | | |||
95 | }; | 63 | }; | ||
96 | 64 | | |||
97 | } | 65 | } | ||
98 | 66 | | |||
99 | #endif // TAGLIBEXTRACTOR_H | 67 | #endif // TAGLIBEXTRACTOR_H |