Music Hub  ..
A session-wide music playback service
xesam.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2014 Canonical Ltd.
3  * Copyright © 2022 UBports Foundation.
4  *
5  * Contact: Alberto Mardegan <mardy@users.sourceforge.net>
6  *
7  * This program is free software: you can redistribute it and/or modify it
8  * under the terms of the GNU Lesser General Public License version 3,
9  * as published by the Free Software Foundation.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  *
19  * Authored by: Thomas Voß <thomas.voss@canonical.com>
20  */
21 
22 #ifndef XESAM_H
23 #define XESAM_H
24 
25 #include <cstdint>
26 
27 #include <string>
28 #include <vector>
29 
30 #define DATUM(Type, Name, VType) \
31  struct Type \
32  {\
33  static constexpr const char* name{#Name};\
34  typedef VType ValueType;\
35  };
36 
37 namespace xesam
38 {
39 DATUM(Album, xesam:album, std::string)
40 DATUM(AlbumArtist, xesam:albumArtist, std::vector<std::string>)
41 DATUM(Artist, xesam:artist, std::vector<std::string>)
42 DATUM(AsText, xesam:asText, std::string)
43 DATUM(AudioBpm, xesam:audioBpm, std::int32_t)
44 DATUM(AutoRating, xesam:autoRating, double)
45 DATUM(Comment, xesam:comment, std::vector<std::string>)
46 DATUM(Composer, xesam:composer, std::vector<std::string>)
47 DATUM(ContentCreated, xesam:comment, std::string)
48 DATUM(DiscNumber, xesam:discNumber, std::int32_t)
49 DATUM(FirstUsed, xesam:firstUsed, std::string)
50 DATUM(Genre, xesam:genre, std::vector<std::string>)
51 DATUM(LastUsed, xesam:lastUsed, std::string)
52 DATUM(Lyricist, xesam:lyricist, std::vector<std::string>)
53 DATUM(Title, xesam:title, std::string)
54 DATUM(TrackNumber, xesam:trackNumber, std::int32_t)
55 DATUM(Url, xesam:url, std::string)
56 DATUM(UserRating, xesam:userRating, double)
57 }
58 
59 namespace tags
60 {
61 // Does the track contain album art?
62 DATUM(Image, tag:image, bool)
63 // Does the track contain a small album art preview image?
64 DATUM(PreviewImage, tag::previewImage, bool)
65 }
66 
67 #endif // XESAM_H
DATUM
#define DATUM(Type, Name, VType)
Definition: xesam.h:30
tags
Definition: xesam.h:59
xesam
Definition: xesam.h:37