Music Hub
..
A session-wide music playback service
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
macros.h
Go to the documentation of this file.
1
/*
2
* Copyright © 2013 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 MPRIS_MACROS_H_
20
#define MPRIS_MACROS_H_
21
22
#include <core/dbus/types/object_path.h>
23
24
#include <chrono>
25
#include <string>
26
27
#define SECONDS(seconds) std::chrono::seconds{seconds};
28
29
#define METHOD(Name, Itf, Timeout) \
30
struct Name \
31
{ \
32
typedef Itf Interface; \
33
inline static const std::string& name() \
34
{ \
35
static const std::string s{#Name}; \
36
return s; \
37
} \
38
inline static const std::chrono::milliseconds default_timeout() { return std::chrono::milliseconds{2000}; } \
39
};\
40
41
#define SIGNAL(Name, Itf, ArgType) \
42
struct Name \
43
{ \
44
inline static std::string name() \
45
{ \
46
return #Name; \
47
}; \
48
typedef Itf Interface; \
49
typedef ArgType ArgumentType; \
50
};\
51
52
#define READABLE_PROPERTY(Name, Itf, Type) \
53
struct Name \
54
{ \
55
inline static std::string name() \
56
{ \
57
return #Name; \
58
}; \
59
typedef Itf Interface; \
60
typedef Type ValueType; \
61
static const bool readable = true; \
62
static const bool writable = false; \
63
}; \
64
65
#define WRITABLE_PROPERTY(Name, Itf, Type) \
66
struct Name \
67
{ \
68
inline static std::string name() \
69
{ \
70
return #Name; \
71
}; \
72
typedef Itf Interface; \
73
typedef Type ValueType; \
74
static const bool readable = true; \
75
static const bool writable = true; \
76
}; \
77
78
#endif // MPRIS_MACROS_H_
79
src
core
media
mpris
macros.h
Generated on Wed May 21 2014 08:55:56 for Music Hub by
1.8.7