Music Hub ..
A session-wide music playback service
 
Loading...
Searching...
No Matches
mpris.h
Go to the documentation of this file.
1/*
2 * Copyright © 2021-2022 UBports Foundation.
3 *
4 * Contact: Alberto Mardegan <mardy@users.sourceforge.net>
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU Lesser General Public License version 3,
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef MPRIS_H
20#define MPRIS_H
21
22#include <string>
23#include <tuple>
24#include <vector>
25
26#include <cstdint>
27
28namespace mpris {
29
30struct Service
31{
32 static const QString &name()
33 {
34 static const QString s{"com.lomiri.MediaHub.Service"};
35 return s;
36 }
37
38 struct Errors
39 {
41 {
42 static const QString &name()
43 {
44 static const QString s
45 {
46 "com.lomiri.MediaHub.Service.Error.CreatingSession"
47 };
48 return s;
49 }
50 };
51
53 {
54 static const QString &name()
55 {
56 static const QString s
57 {
58 "com.lomiri.MediaHub.Service.Error.DetachingSession"
59 };
60 return s;
61 }
62 };
63
65 {
66 static const QString &name()
67 {
68 static const QString s
69 {
70 "com.lomiri.MediaHub.Service.Error.ReattachingSession"
71 };
72 return s;
73 }
74 };
75
77 {
78 static const QString &name()
79 {
80 static const QString s
81 {
82 "com.lomiri.MediaHub.Service.Error.DestroyingSession"
83 };
84 return s;
85 }
86 };
87
89 {
90 static const QString &name()
91 {
92 static const QString s
93 {
94 "com.lomiri.MediaHub.Service.Error.CreatingFixedSession"
95 };
96 return s;
97 }
98 };
99
101 {
102 static const QString &name()
103 {
104 static const QString s
105 {
106 "com.lomiri.MediaHub.Service.Error.ResumingSession"
107 };
108 return s;
109 }
110 };
111
113 {
114 static const QString &name()
115 {
116 static const QString s
117 {
118 "com.lomiri.MediaHub.Service.Error.PlayerKeyNotFound"
119 };
120 return s;
121 }
122 };
123 };
124
125};
126
127struct Player
128{
129 static const QString &name()
130 {
131 static const QString s{"org.mpris.MediaPlayer2.Player"};
132 return s;
133 }
134
136 {
137 LoopStatus() = delete;
138
153
154 static constexpr const char* none{"None"};
155 static constexpr const char* track{"Track"};
156 static constexpr const char* playlist{"Playlist"};
157 };
158
160 {
161 PlaybackStatus() = delete;
162
180
181 static constexpr const char* playing{"Playing"};
182 static constexpr const char* paused{"Paused"};
183 static constexpr const char* stopped{"Stopped"};
184 };
185
186 struct Error
187 {
189 {
190 static constexpr const char* name
191 {
192 "mpris.Player.Error.OutOfProcessBufferStreamingNotSupported"
193 };
194 };
195
197 {
198 static constexpr const char* name
199 {
200 "mpris.Player.Error.InsufficientAppArmorPermissions"
201 };
202 };
203
205 {
206 static constexpr const char* name
207 {
208 "mpris.Player.Error.UriNotFound"
209 };
210 };
211 };
212};
213
215{
216 static const std::string& name()
217 {
218 static const std::string s{"org.mpris.MediaPlayer2.TrackList"};
219 return s;
220 }
221
222 struct Error
223 {
225 {
226 static constexpr const char* name
227 {
228 "mpris.TrackList.Error.InsufficientPermissionsToAddTrack"
229 };
230 };
231
233 {
234 static constexpr const char* name
235 {
236 "mpris.TrackList.Error.FailedToMoveTrack"
237 };
238 };
239
241 {
242 static constexpr const char* name
243 {
244 "mpris.TrackList.Error.FailedToFindMoveTrackSource"
245 };
246 };
247
249 {
250 static constexpr const char* name
251 {
252 "mpris.TrackList.Error.FailedToFindMoveTrackDest"
253 };
254 };
255
257 {
258 static constexpr const char* name
259 {
260 "mpris.TrackList.Error.TrackNotFound"
261 };
262 };
263 };
264};
265
266}
267
268#endif // MPRIS_PLAYER_H
Definition mpris.h:28
static constexpr const char * name
Definition mpris.h:207
static constexpr const char * none
Definition mpris.h:154
static constexpr const char * track
Definition mpris.h:155
static const char * from(lomiri::MediaHubService::Player::LoopStatus status)
Definition mpris.h:139
static constexpr const char * playlist
Definition mpris.h:156
static constexpr const char * paused
Definition mpris.h:182
static const char * from(lomiri::MediaHubService::Player::PlaybackStatus status)
Definition mpris.h:163
static constexpr const char * playing
Definition mpris.h:181
static constexpr const char * stopped
Definition mpris.h:183
static const QString & name()
Definition mpris.h:129
static const QString & name()
Definition mpris.h:90
static const QString & name()
Definition mpris.h:42
static const QString & name()
Definition mpris.h:78
static const QString & name()
Definition mpris.h:54
static const QString & name()
Definition mpris.h:114
static const QString & name()
Definition mpris.h:66
static const QString & name()
Definition mpris.h:102
static const QString & name()
Definition mpris.h:32
static constexpr const char * name
Definition mpris.h:251
static constexpr const char * name
Definition mpris.h:235
static constexpr const char * name
Definition mpris.h:259
static const std::string & name()
Definition mpris.h:216