Music Hub  ..
A session-wide music playback service
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
service.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_SERVICE_H_
20 #define MPRIS_SERVICE_H_
21 
22 #include <core/dbus/macros.h>
23 
24 #include <chrono>
25 #include <string>
26 
27 namespace mpris
28 {
29 struct Service
30 {
31  static const std::string& name()
32  {
33  static const std::string s{"core.ubuntu.media.Service"};
34  return s;
35  }
36 
37  struct Errors
38  {
40  {
41  static const std::string& name()
42  {
43  static const std::string s
44  {
45  "core.ubuntu.media.Service.Error.CreatingSession"
46  };
47  return s;
48  }
49  };
50 
52  {
53  static const std::string& name()
54  {
55  static const std::string s
56  {
57  "core.ubuntu.media.Service.Error.CreatingFixedSession"
58  };
59  return s;
60  }
61  };
62 
64  {
65  static const std::string& name()
66  {
67  static const std::string s
68  {
69  "core.ubuntu.media.Service.Error.ResumingSession"
70  };
71  return s;
72  }
73  };
74  };
75 
76  DBUS_CPP_METHOD_WITH_TIMEOUT_DEF(CreateSession, Service, 1000)
77  DBUS_CPP_METHOD_WITH_TIMEOUT_DEF(CreateFixedSession, Service, 1000)
78  DBUS_CPP_METHOD_WITH_TIMEOUT_DEF(ResumeSession, Service, 1000)
79  DBUS_CPP_METHOD_WITH_TIMEOUT_DEF(PauseOtherSessions, Service, 1000)
80 };
81 }
82 
83 #endif // MPRIS_SERVICE_H_
static const std::string & name()
Definition: service.h:65
static const std::string & name()
Definition: service.h:41
static const std::string & name()
Definition: service.h:31
static const std::string & name()
Definition: service.h:53