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