• 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 int &telemetry, const std::shared_ptr<Settings> &settings)

    Public Slots

    void closeAllWallpapers()
    void closeAllWidgets()
    bool closeConnection(const QString &appID)
    bool closeConntectionByType(const QStringList &types)
    void createWallpaper(const ScreenPlay::InstalledType::InstalledType type, const ScreenPlay::FillMode::FillMode fillMode, const QString &absoluteStoragePath, const QString &previewImage, const QString &file, const QVector<int> &monitorIndex, const float volume, const float playbackRate, const QJsonObject &properties, const bool saveToProfilesConfigFile)
    void createWidget(const ScreenPlay::InstalledType::InstalledType type, const QPoint &position, const QString &absoluteStoragePath, const QString &previewImage, const QJsonObject &properties, const bool saveToProfilesConfigFile)
    ScreenPlay::ScreenPlayWallpaper *getWallpaperByAppID(const QString &appID) const
    void newConnection()
    void removeAllWallpapers()
    void removeAllWidgets()
    bool removeApp(const QString &appID)
    void requestProjectSettingsAtMonitorIndex(const int index)
    void setActiveWallpaperCounter(int activeWallpaperCounter)
    void setActiveWidgetsCounter(int activeWidgetsCounter)
    void setAllWallpaperValue(const QString &key, const QString &value)
    void setWallpaperValue(const QString &appID, const QString &key, const QString &value)
    void 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] void ScreenPlayManager::closeAllWallpapers()

    Closes all wallpaper connection with the following type:

    [slot] void ScreenPlayManager::closeAllWidgets()

    Closes all widgets connection with the following type:

    [slot] bool ScreenPlayManager::closeConnection(const QString &appID)

    Closes a Wallpaper or Widget connection by the given appID.

    [slot] bool ScreenPlayManager::closeConntectionByType(const QStringList &types)

    Closes a connection by type. Used only by closeAllWidgets() and closeAllWallpapers()

    [slot] void ScreenPlayManager::createWallpaper(const ScreenPlay::InstalledType::InstalledType type, const ScreenPlay::FillMode::FillMode fillMode, const QString &absoluteStoragePath, const QString &previewImage, const QString &file, const QVector<int> &monitorIndex, const float volume, const float playbackRate, const QJsonObject &properties, const bool saveToProfilesConfigFile)

    Creates a wallpaper with a given monitorIndex list, a absoluteStoragePath folder, a previewImage (relative path to the absoluteStoragePath), a default volume, a fillMode, a type (htmlWallpaper, qmlWallpaper etc.), a saveToProfilesConfigFile bool only set to flase if we call the method when using via the settings on startup to skip a unnecessary save.

    [slot] void ScreenPlayManager::createWidget(const ScreenPlay::InstalledType::InstalledType type, const QPoint &position, const QString &absoluteStoragePath, const QString &previewImage, const QJsonObject &properties, const bool saveToProfilesConfigFile)

    Creates a ScreenPlayWidget object via a absoluteStoragePath and a preview image (relative path).

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

    Returns a ScreenPlayWallpaper if successful, otherwhise std::nullopt.

    [slot] void ScreenPlayManager::newConnection()

    Appends a new SDKConnection object shared_ptr to the m_clients list.

    [slot] void ScreenPlayManager::removeAllWallpapers()

    Removes all wallpaper entries in the profiles.json. This method will likely be removed when using nlohmann/json in the future.

    [slot] void ScreenPlayManager::removeAllWidgets()

    Removes all widgets and resets the activeWidgetCounter to 0.

    [slot] bool ScreenPlayManager::removeApp(const QString &appID)

    Disconnects the connection, remove

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

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

    [slot] void 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] void 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] void 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 int &telemetry, 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.