/** * SPDX-FileCopyrightText: 2014 Sujith Haridasan * SPDX-FileCopyrightText: 2014 Ashish Madeti * SPDX-FileCopyrightText: 2016 Matthieu Gallien * SPDX-FileCopyrightText: 2022-2023 Bart De Vries * * SPDX-License-Identifier: GPL-3.0-or-later */ #pragma once #include #include #include #if !defined Q_OS_ANDROID && !defined Q_OS_WIN class MediaPlayer2Player; class MediaPlayer2; #endif class KMediaSession; class Mpris2 : public QObject { Q_OBJECT Q_PROPERTY(bool showProgressOnTaskBar READ showProgressOnTaskBar WRITE setShowProgressOnTaskBar NOTIFY showProgressOnTaskBarChanged) public: explicit Mpris2(QObject *parent = nullptr); ~Mpris2() override; [[nodiscard]] bool showProgressOnTaskBar() const; public Q_SLOTS: void setShowProgressOnTaskBar(bool value); Q_SIGNALS: void showProgressOnTaskBarChanged(); private: void initDBusService(const QString &playerName); bool unregisterDBusService(const QString &playerName); #if !defined Q_OS_ANDROID && !defined Q_OS_WIN std::unique_ptr m_mp2; std::unique_ptr m_mp2p; #endif KMediaSession *m_audioPlayer = nullptr; bool m_ShowProgressOnTaskBar = true; QString m_playerName; };