| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #pragma once | ||
| 2 | /* | ||
| 3 | * Pixel Overlay Effects for Falcon Player (FPP) ported from WLED | ||
| 4 | * | ||
| 5 | * This file is part of the Falcon Player (FPP) and is Copyright (C) | ||
| 6 | * 2013-2022 by the Falcon Player Developers. | ||
| 7 | * | ||
| 8 | * The Falcon Player (FPP) is free software, and is covered under | ||
| 9 | * multiple Open Source licenses. Please see the included 'LICENSES' | ||
| 10 | * file for descriptions of what files are covered by each license. | ||
| 11 | * | ||
| 12 | * This source file is covered under the LGPL v2.1 as described in the | ||
| 13 | * included LICENSE.LGPL file. | ||
| 14 | */ | ||
| 15 | |||
| 16 | #include "PixelOverlayEffects.h" | ||
| 17 | |||
| 18 | // Per-arg semantic role for WLED-ported effects. The base class returns | ||
| 19 | // an empty role list (meaning "match by arg name"); RawWLEDEffect | ||
| 20 | // overrides getArgRoles() to declare which slot is which, so external | ||
| 21 | // callers (e.g. WLEDAPIResponder) can fill the args vector from the | ||
| 22 | // matching WLED segment fields without re-parsing FX.cpp data strings. | ||
| 23 | enum class WLEDArgRole { | ||
| 24 | Unknown, | ||
| 25 | Mapping, | ||
| 26 | Brightness, | ||
| 27 | Speed, | ||
| 28 | Intensity, | ||
| 29 | Palette, | ||
| 30 | Color1, | ||
| 31 | Color2, | ||
| 32 | Color3, | ||
| 33 | Custom1, | ||
| 34 | Custom2, | ||
| 35 | Custom3, | ||
| 36 | Check1, | ||
| 37 | Check2, | ||
| 38 | Check3, | ||
| 39 | Text | ||
| 40 | }; | ||
| 41 | |||
| 42 | class WLEDEffect : public PixelOverlayEffect { | ||
| 43 | public: | ||
| 44 | WLEDEffect(const std::string& name); | ||
| 45 | virtual ~WLEDEffect(); | ||
| 46 | |||
| 47 | // One entry per `args` slot, in the same order. Empty means | ||
| 48 | // "fall back to name-based heuristics in the caller". | ||
| 49 | 1 | virtual std::vector<WLEDArgRole> getArgRoles() const { return {}; } | |
| 50 | |||
| 51 | static std::list<PixelOverlayEffect*> getWLEDEffects(); | ||
| 52 | static void cleanupWLEDEffects(); | ||
| 53 | |||
| 54 | // WLED modes FPP no longer offers (getWLEDEffects() leaves them out), by | ||
| 55 | // the names they had. | ||
| 56 | static std::list<std::string> getRetiredWLEDEffectNames(); | ||
| 57 | // The effect list as the WLED JSON API numbers it: every effect FPP | ||
| 58 | // offers, in the same order, with a retired effect's slot kept as "RSVD" | ||
| 59 | // (WLED's own placeholder for a removed effect). WLED apps and Home | ||
| 60 | // Assistant store effects by that number, so a retired effect must not | ||
| 61 | // move the ones after it. | ||
| 62 | static const std::list<std::string>& getWLEDAPIEffectNames(); | ||
| 63 | }; | ||
| 64 |