Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
MprisHost.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 fuddlesworth
2// SPDX-License-Identifier: LGPL-2.1-or-later
3
4#pragma once
5
6#include <PhosphorServiceMpris/phosphorservicempris_export.h>
7
9
10#include <QList>
11#include <QObject>
12
14
15class PHOSPHORSERVICEMPRIS_EXPORT MprisHost : public QObject
16{
17 Q_OBJECT
18 Q_DISABLE_COPY_MOVE(MprisHost)
19 Q_PROPERTY(int playerCount READ playerCount NOTIFY playerCountChanged)
20
21public:
22 explicit MprisHost(QObject* parent = nullptr);
23 ~MprisHost() override;
24
25 [[nodiscard]] int playerCount() const;
26 [[nodiscard]] QList<MprisPlayer*> players() const;
27 [[nodiscard]] Q_INVOKABLE PhosphorServiceMpris::MprisPlayer* playerAt(int index) const;
28
29Q_SIGNALS:
33
34private Q_SLOTS:
39 void _q_nameOwnerChanged(const QString& service, const QString& oldOwner, const QString& newOwner);
40
41private:
42 class Private;
43 std::unique_ptr<Private> d;
44};
45
46} // namespace PhosphorServiceMpris
PhosphorServiceMpris::MprisPlayer * playerAt(int index) const
QList< MprisPlayer * > players() const
MprisHost(QObject *parent=nullptr)
void playerRemoved(PhosphorServiceMpris::MprisPlayer *player)
void playerAdded(PhosphorServiceMpris::MprisPlayer *player)
Definition MprisPlayer.h:16
Definition MprisHost.h:13