Music Hub ..
A session-wide music playback service
 
Loading...
Searching...
No Matches
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
37namespace xesam
38{
39DATUM(Album, xesam:album, std::string)
40DATUM(AlbumArtist, xesam:albumArtist, std::vector<std::string>)
41DATUM(Artist, xesam:artist, std::vector<std::string>)
42DATUM(AsText, xesam:asText, std::string)
43DATUM(AudioBpm, xesam:audioBpm, std::int32_t)
44DATUM(AutoRating, xesam:autoRating, double)
45DATUM(Comment, xesam:comment, std::vector<std::string>)
46DATUM(Composer, xesam:composer, std::vector<std::string>)
47DATUM(ContentCreated, xesam:comment, std::string)
48DATUM(DiscNumber, xesam:discNumber, std::int32_t)
49DATUM(FirstUsed, xesam:firstUsed, std::string)
50DATUM(Genre, xesam:genre, std::vector<std::string>)
51DATUM(LastUsed, xesam:lastUsed, std::string)
52DATUM(Lyricist, xesam:lyricist, std::vector<std::string>)
53DATUM(Title, xesam:title, std::string)
54DATUM(TrackNumber, xesam:trackNumber, std::int32_t)
55DATUM(Url, xesam:url, std::string)
56DATUM(UserRating, xesam:userRating, double)
57}
58
59namespace tags
60{
61// Does the track contain album art?
62DATUM(Image, tag:image, bool)
63// Does the track contain a small album art preview image?
64DATUM(PreviewImage, tag::previewImage, bool)
65}
66
67#endif // XESAM_H
Definition xesam.h:60
Definition xesam.h:38
#define DATUM(Type, Name, VType)
Definition xesam.h:30