• ScreenPlayManager
  • ScreenPlayManager Class

    class ScreenPlay::ScreenPlayManager

    The ScreenPlayManager is used to manage multiple ScreenPlayWallpaper and ScreenPlayWidget. More...

    Header: #include <ScreenPlayManager>

    Public Functions

    ScreenPlayManager(QObject *parent = nullptr)
    int activeWallpaperCounter() const
    int activeWidgetsCounter() const
    void init(const std::shared_ptr<GlobalVariables> &globalVariables, const std::shared_ptr<MonitorListModel> &mlm, const std::shared_ptr<Settings> &settings)

    Public Slots

    ScreenPlay::ScreenPlayWallpaper *getWallpaperByAppID(const QString &appID) const
    void newConnection()
    bool removeAllWallpapers()
    bool removeAllWidgets()
    bool requestProjectSettingsAtMonitorIndex(const int index)
    void setActiveWallpaperCounter(int activeWallpaperCounter)
    void setActiveWidgetsCounter(int activeWidgetsCounter)
    bool setAllWallpaperValue(const QString &key, const QString &value)
    bool setWallpaperValue(const QString &appID, const QString &key, const QString &value)
    bool setWallpaperValueAtMonitorIndex(const int index, const QString &key, const QString &value)

    Signals

    void activeWallpaperCounterChanged(int activeWallpaperCounter)
    void activeWidgetsCounterChanged(int activeWidgetsCounter)

    Detailed Description

    Creates and (indirectly) destroys Wallpaper and Widgets via opening and closing QLocalPipe connectons of the ScreenPlaySDK. Also responsible to set the current active wallpaper to the monitorListModel.

    Member Function Documentation

    ScreenPlayManager::ScreenPlayManager(QObject *parent = nullptr)

    Constructor that checks if another ScreenPlay instance is running via a localsocket. Starts a save timer to limit the amount of times to save. This is used for limiting slider small value save spam.

    [slot] ScreenPlay::ScreenPlayWallpaper *ScreenPlayManager::getWallpaperByAppID(const QString &appID) const

    Returns a ScreenPlayWallpaper if successful, otherwhise std::nullopt. This function is only used in QML.

    [slot] void ScreenPlayManager::newConnection()

    Appends a new SDKConnection object shared_ptr to the m_clients list.

    [slot] bool ScreenPlayManager::removeAllWallpapers()

    Removes all wallpaper entries in the profiles.json.

    [slot] bool ScreenPlayManager::removeAllWidgets()

    Removes all widgets and resets the activeWidgetCounter to 0.

    [slot] bool ScreenPlayManager::requestProjectSettingsAtMonitorIndex(const int index)

    Request a spesific json profile to display in the active wallpaper popup on the right.

    [slot] bool ScreenPlayManager::setAllWallpaperValue(const QString &key, const QString &value)

    Convenient function to set a value at a given index and key for all wallaper. For exmaple used to mute all wallpaper.

    [slot] bool ScreenPlayManager::setWallpaperValue(const QString &appID, const QString &key, const QString &value)

    Sets a given value to a given key. The appID is used to identify the receiver socket.

    [slot] bool ScreenPlayManager::setWallpaperValueAtMonitorIndex(const int index, const QString &key, const QString &value)

    Set a wallpaper value at a given index and key.

    void ScreenPlayManager::init(const std::shared_ptr<GlobalVariables> &globalVariables, const std::shared_ptr<MonitorListModel> &mlm, const std::shared_ptr<Settings> &settings)

    Inits this class instead of init in the constructor. This is because we need to check first if another ScreenPlay instance is running. If it is not the case we call this function.