MCPcopy Create free account
hub / github.com/Blueforcer/awtrix3 / ShowCustomApp

Function ShowCustomApp

src/Apps.cpp:434–748  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

432}
433
434void ShowCustomApp(String name, FastLED_NeoMatrix *matrix, MatrixDisplayUiState *state, int16_t x, int16_t y, GifPlayer *gifPlayer)
435{
436 // Abort if notifyFlag is set
437 if (notifyFlag)
438 {
439 return;
440 }
441
442 // Get custom App by ID
443 CustomApp *ca = getCustomAppByName(name);
444
445 // Abort if custom App not found
446 if (ca == nullptr)
447 {
448 return;
449 }
450
451 if (!DisplayManager.appIsSwitching)
452 {
453 if (ca->duration > 0)
454 {
455 DisplayManager.setAppTime(ca->duration);
456 }
457 }
458
459 DisplayManager.drawFilledRect(x, y, 32, 8, ca->background);
460
461 if (ca->effect > -1)
462 {
463 callEffect(matrix, x, y, ca->effect);
464 }
465
466 CURRENT_APP = ca->name;
467 currentCustomApp = name;
468
469 if ((ca->iconName.length() > 0) && !ca->icon)
470 {
471 const char *extensions[] = {".jpg", ".gif"};
472 bool isGifFlags[] = {false, true};
473
474 for (int i = 0; i < 2; i++)
475 {
476 String filePath = "/ICONS/" + ca->iconName + extensions[i];
477 if (LittleFS.exists(filePath))
478 {
479 ca->isGif = isGifFlags[i];
480 ca->icon = LittleFS.open(filePath);
481 ca->currentFrame = 0;
482 break;
483 }
484 }
485 }
486
487 bool hasIcon = ca->icon || ca->jpegDataSize > 0;
488
489 uint16_t textWidth = 0;
490 if (!ca->fragments.empty())
491 {

Callers 15

CApp1Function · 0.85
CApp2Function · 0.85
CApp3Function · 0.85
CApp4Function · 0.85
CApp5Function · 0.85
CApp6Function · 0.85
CApp7Function · 0.85
CApp8Function · 0.85
CApp9Function · 0.85
CApp10Function · 0.85
CApp11Function · 0.85
CApp12Function · 0.85

Calls 15

getCustomAppByNameFunction · 0.85
callEffectFunction · 0.85
replacePlaceholdersFunction · 0.85
getTextWidthFunction · 0.85
TextEffectFunction · 0.85
EffectOverlayFunction · 0.85
setAppTimeMethod · 0.80
drawFilledRectMethod · 0.80
lengthMethod · 0.80
playGifMethod · 0.80
getFrameMethod · 0.80
drawJPGMethod · 0.80

Tested by

no test coverage detected