| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #pragma once | ||
| 2 | /* | ||
| 3 | * This file is part of the Falcon Player (FPP) and is Copyright (C) | ||
| 4 | * 2013-2022 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 <functional> | ||
| 15 | #include "fpp-json-fwd.h" | ||
| 16 | #include <list> | ||
| 17 | #include <string> | ||
| 18 | #include <vector> | ||
| 19 | |||
| 20 | class ChannelOutput { | ||
| 21 | public: | ||
| 22 | ChannelOutput(unsigned int startChannel = 1, | ||
| 23 | unsigned int channelCount = 1); | ||
| 24 | virtual ~ChannelOutput(); | ||
| 25 | |||
| 26 | 259 | virtual std::string GetOutputType() const { | |
| 27 |
1/2✓ Branch 0 taken 259 times.
✗ Branch 1 not taken.
|
537 | return typeid(*this).name(); |
| 28 | } | ||
| 29 | |||
| 30 | unsigned int ChannelCount(void) { return m_channelCount; } | ||
| 31 | 2 | unsigned int StartChannel(void) { return m_startChannel; } | |
| 32 | |||
| 33 | virtual int Init(Json::Value config); | ||
| 34 | virtual int Close(void); | ||
| 35 | |||
| 36 | 9936 | virtual void PrepData(unsigned char* channelData) {} | |
| 37 | virtual int SendData(unsigned char* channelData) = 0; | ||
| 38 | |||
| 39 | virtual void GetRequiredChannelRanges(const std::function<void(int, int)>& addRange) = 0; | ||
| 40 | |||
| 41 | // Some outputs may need to know ahead of time that they are about to start or stop outputting | ||
| 42 | // data so that resources can be setup that are only valid during the time the data is | ||
| 43 | // being output. For example, tcp sockets or auth tokens or similar. | ||
| 44 | 362 | virtual void StartingOutput() {} | |
| 45 | 362 | virtual void StoppingOutput() {} | |
| 46 | |||
| 47 | // For "OutputSpecific" test types, the output can overlay data based on the configuration | ||
| 48 | // it knows (per port, per universe, per panel, etc...). TestType is specific to the | ||
| 49 | // output as well and could be a cycle color, output pattern, etc.... | ||
| 50 | ✗ | virtual void OverlayTestData(unsigned char* channelData, int cycleNum, float percentOfCycle, int testType, const Json::Value& config) {} | |
| 51 | 4 | virtual bool SupportsTesting() const { return false; } | |
| 52 | |||
| 53 | protected: | ||
| 54 | virtual void DumpConfig(void); | ||
| 55 | |||
| 56 | std::string m_outputType; | ||
| 57 | unsigned int m_startChannel; | ||
| 58 | unsigned int m_channelCount; | ||
| 59 | std::list<std::string> m_usedGPIOS; | ||
| 60 | }; | ||
| 61 |