Music Hub  ..
A session-wide music playback service
media_player2.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2014 Canonical Ltd.
3  * Copyright © 2022 UBports Foundation.
4  *
5  * Contact: Alberto Mardegan <mardy@users.sourceforge.net>
6  *
7  * This program is free software: you can redistribute it and/or modify it
8  * under the terms of the GNU Lesser General Public License version 3,
9  * as published by the Free Software Foundation.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  *
19  * Authored by: Thomas Voß <thomas.voss@canonical.com>
20  */
21 
22 #ifndef MPRIS_MEDIA_PLAYER2_H
23 #define MPRIS_MEDIA_PLAYER2_H
24 
25 #include <QDBusContext>
26 #include <QObject>
27 
28 namespace lomiri {
29 namespace MediaHubService {
30 
31 class PlayerImplementation;
32 
33 }}
34 
35 namespace mpris
36 {
37 
38 /* Adaptor class exposing the media-hub service through the D-Bus MPRIS
39  * interface.
40  */
41 class MediaPlayer2Private;
42 class MediaPlayer2: public QObject, protected QDBusContext
43 {
44  Q_OBJECT
45 
46 public:
47  MediaPlayer2(QObject *parent = nullptr);
48  virtual ~MediaPlayer2();
49 
53 
54  bool registerObject();
55 
56 private:
57  Q_DECLARE_PRIVATE(MediaPlayer2)
58  QScopedPointer<MediaPlayer2Private> d_ptr;
59 };
60 
61 } // namespace
62 
63 #endif // MPRIS_MEDIA_PLAYER2_H
QObject
lomiri::MediaHubService::PlayerImplementation
Definition: player_implementation.h:44
mpris::MediaPlayer2::player
lomiri::MediaHubService::PlayerImplementation * player()
Definition: media_player2.cpp:349
mpris::MediaPlayer2::setPlayer
void setPlayer(lomiri::MediaHubService::PlayerImplementation *impl)
Definition: media_player2.cpp:343
mpris::MediaPlayer2::~MediaPlayer2
virtual ~MediaPlayer2()
QDBusContext
mpris::MediaPlayer2::registerObject
bool registerObject()
Definition: media_player2.cpp:361
mpris::MediaPlayer2::MediaPlayer2
MediaPlayer2(QObject *parent=nullptr)
Definition: media_player2.cpp:335
mpris::MediaPlayer2
Definition: media_player2.h:42
lomiri
Definition: dbus_utils.h:24
mpris
Definition: media_player2.cpp:37