| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #pragma once | ||
| 2 | /* | ||
| 3 | * This file is part of the Falcon Player (FPP) and is Copyright (C) | ||
| 4 | * 2013-2026 by the Falcon Player Developers. | ||
| 5 | * | ||
| 6 | * The Falcon Player (FPP) is free software, and is covered under | ||
| 7 | * multiple Open Source licenses. Please see the included 'LICENSES' | ||
| 8 | * file for descriptions of what files are covered by each license. | ||
| 9 | * | ||
| 10 | * This source file is covered under the LGPL v2.1 as described in the | ||
| 11 | * included LICENSE.LGPL file. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #include "LocalOnlyCommand.h" | ||
| 15 | |||
| 16 | // An If evaluates local state, so it is a LocalOnlyCommand: multisyncing it | ||
| 17 | // would broadcast the raw condition check to other instances, which each | ||
| 18 | // independently re-evaluate it against their own local state | ||
| 19 | // (GPIO/Variable/Sensor/etc.) - not what "Multisync" means for any other | ||
| 20 | // command. Put a Multisync-enabled command inside Then/Else instead to | ||
| 21 | // propagate the *result* of a check. (LocalOnlyCommand emits the | ||
| 22 | // "disallowMultisync" UI flag; see its header for why that route, not a | ||
| 23 | // Command virtual.) | ||
| 24 | class IfCommand : public LocalOnlyCommand { | ||
| 25 | public: | ||
| 26 | IfCommand(); | ||
| 27 | 7468 | virtual ~IfCommand() {} | |
| 28 | virtual std::unique_ptr<Command::Result> run(const std::vector<std::string>& args) override; | ||
| 29 | // In-progress Sequential Then/Else command chains are advanced by a | ||
| 30 | // self-re-arming Timers timer that exists only while chains are pending | ||
| 31 | // - see AdvancePendingChains() in IfCommand.cpp for why Sequential | ||
| 32 | // never waits on the calling thread: If is reached synchronously from | ||
| 33 | // frame-triggered Command Presets and GPIO edge handlers, threads a | ||
| 34 | // lighting player can't afford to stall. | ||
| 35 | }; | ||
| 36 |