ScreenPlay SDK
Custom application who no not use Qt need to replicate the following features to work with ScreenPlay:
- Implement a platform abstract QLocalSocket alternative
- Connect to the socket name "ScreenPlay" with the appID (is transferred as first parameter to your app)
- Exit the app if the "LocalSocket" is disconnected
Sdk
The SDK is used for all communication between the Widgets, Wallpapers and external applications. This adds one major advatage: Crash save multi processing. If one Widgets/Wallpaper encounters an error it does not take down all other Widgets/Wallapers.
Connection Process Exmaple
- User chooses an Widget to start -> ScreenPlay::createWidget(...) gets called
- A new ScreenPlayWidget object gets instantiated and saved in the m_screenPlayWidgetList vector
- The ScreenPlayWidget now determents in the constructor the type of project (qml or custom executable)
- If the widgets is a pure qml widget the we start our ScreenPlayWidget App or else we start their custom executable
- We use process arguments to deliver some start settings (for example default plays peed and volume) and more importantly assign an appID to every active Widget/Wallpaper.
Using the appID to communicate between ScreenPlay and the Widgets/Wallpaper
When the Wallpaper/Widget started it uses the appID from the starting arguments to register itself via QLocalSocket. When the appID is valid ScreenPlay keeps the connection open otherwise it closes the connection. A closing connection causes the SDK to call QApplication::quit() and so to exit application.
When a widget/wallpaper uses custom settings to enable a wide range of customization. The can be updated in real time via the Screen Tab in ScreenPlay. Theses settings are simple key/value pairs. For example when the user changes his wallpaper volume the SDKConnector::setWallpaperValue method sends the Json Object:
{
"volume" : 1
}
The SDK then emits the void incommingMessage(QString key, QString value) method to listen to.