/* SPDX-FileCopyrightText: 2012 Alex Merry SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once #include #include "playercontainer.h" #include class Multiplexer : public Plasma::DataContainer { Q_OBJECT public: static const QLatin1String sourceName; explicit Multiplexer(QObject *parent = nullptr); void addPlayer(PlayerContainer *container); void removePlayer(const QString &name); PlayerContainer *activePlayer() const; Q_SIGNALS: void activePlayerChanged(PlayerContainer *container); /** * There is no player opened. * * @since 5.24 */ void playerListEmptied(); private Q_SLOTS: void playerUpdated(const QString &name, const Plasma::DataEngine::Data &data); private: void evaluatePlayer(PlayerContainer *container); void setBestActive(); void replaceData(const Plasma::DataEngine::Data &data); PlayerContainer *firstPlayerFromHash(const QHash &hash, PlayerContainer **proxyCandidate) const; QString m_activeName; QHash m_playing; QHash m_paused; QHash m_stopped; QHash m_proxies; };