Move code related to push-to-remote into a central file

Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
falkTX 2022-12-29 12:16:43 +00:00
parent cebb66f290
commit b71acc9f22
No known key found for this signature in database
GPG key ID: CDBAA37ABC74FBA0
15 changed files with 278 additions and 211 deletions

View file

@ -584,8 +584,11 @@ static void Window__downscaleBitmap(uint8_t* pixels, int& width, int& height) {
static void Window__writeImagePNG(void* context, void* data, int size) {
USE_NAMESPACE_DISTRHO
UI* const ui = static_cast<UI*>(context);
ui->setState("screenshot", String::asBase64(data, size).buffer());
CardinalBaseUI* const ui = static_cast<CardinalBaseUI*>(context);
if (const char* const screenshot = String::asBase64(data, size).buffer()) {
ui->setState("screenshot", screenshot);
remoteUtils::sendScreenshotToRemote(ui->remoteDetails, screenshot);
}
}
#endif
#endif