Music Hub  ..
A session-wide music playback service
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.DetachingSession"
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.ReattachingSession"
70  };
71  return s;
72  }
73  };
74 
76  {
77  static const std::string& name()
78  {
79  static const std::string s
80  {
81  "core.ubuntu.media.Service.Error.DestroyingSession"
82  };
83  return s;
84  }
85  };
86 
88  {
89  static const std::string& name()
90  {
91  static const std::string s
92  {
93  "core.ubuntu.media.Service.Error.CreatingFixedSession"
94  };
95  return s;
96  }
97  };
98 
100  {
101  static const std::string& name()
102  {
103  static const std::string s
104  {
105  "core.ubuntu.media.Service.Error.ResumingSession"
106  };
107  return s;
108  }
109  };
110 
112  {
113  static const std::string& name()
114  {
115  static const std::string s
116  {
117  "core.ubuntu.media.Service.Error.PlayerKeyNotFound"
118  };
119  return s;
120  }
121  };
122  };
123 
124  DBUS_CPP_METHOD_WITH_TIMEOUT_DEF(CreateSession, Service, 1000)
125  DBUS_CPP_METHOD_WITH_TIMEOUT_DEF(DetachSession, Service, 1000)
126  DBUS_CPP_METHOD_WITH_TIMEOUT_DEF(ReattachSession, Service, 1000)
127  DBUS_CPP_METHOD_WITH_TIMEOUT_DEF(DestroySession, Service, 1000)
128  DBUS_CPP_METHOD_WITH_TIMEOUT_DEF(CreateFixedSession, Service, 1000)
129  DBUS_CPP_METHOD_WITH_TIMEOUT_DEF(ResumeSession, Service, 1000)
130  DBUS_CPP_METHOD_WITH_TIMEOUT_DEF(PauseOtherSessions, Service, 1000)
131 };
132 }
133 
134 #endif // MPRIS_SERVICE_H_
static const std::string & name()
Definition: service.h:113
static const std::string & name()
Definition: service.h:77
static const std::string & name()
Definition: service.h:53
static const std::string & name()
Definition: service.h:101
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:65
static const std::string & name()
Definition: service.h:89