| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /* | ||
| 2 | * This file is part of the Falcon Player (FPP) and is Copyright (C) | ||
| 3 | * 2013-2022 by the Falcon Player Developers. | ||
| 4 | * | ||
| 5 | * The Falcon Player (FPP) is free software, and is covered under | ||
| 6 | * multiple Open Source licenses. Please see the included 'LICENSES' | ||
| 7 | * file for descriptions of what files are covered by each license. | ||
| 8 | * | ||
| 9 | * This source file is covered under the LGPL v2.1 as described in the | ||
| 10 | * included LICENSE.LGPL file. | ||
| 11 | */ | ||
| 12 | |||
| 13 | #include "fpp-pch.h" | ||
| 14 | |||
| 15 | #include "fpp-json.h" | ||
| 16 | |||
| 17 | #include "../../log.h" | ||
| 18 | |||
| 19 | #include "SetValueOutputProcessor.h" | ||
| 20 | |||
| 21 | 35 | SetValueOutputProcessor::SetValueOutputProcessor(const Json::Value& config) { | |
| 22 |
2/4✓ Branch 0 taken 35 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 35 times.
✗ Branch 3 not taken.
|
35 | description = config["description"].asString(); |
| 23 |
2/4✓ Branch 0 taken 35 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 35 times.
✗ Branch 3 not taken.
|
35 | active = config["active"].asInt() ? true : false; |
| 24 |
3/4✓ Branch 0 taken 35 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 34 times.
✓ Branch 3 taken 1 times.
|
35 | start = config["start"].asInt(); |
| 25 |
2/4✓ Branch 0 taken 34 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 34 times.
✗ Branch 3 not taken.
|
34 | count = config["count"].asInt(); |
| 26 |
2/4✓ Branch 0 taken 34 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 34 times.
✗ Branch 3 not taken.
|
34 | value = config["value"].asInt(); |
| 27 |
1/2✓ Branch 0 taken 34 times.
✗ Branch 1 not taken.
|
34 | ProcessModelConfig(config, model, start, count); |
| 28 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 34 times.
|
34 | if (count < 0) { |
| 29 | ✗ | count = 0; | |
| 30 | } | ||
| 31 |
1/2✓ Branch 0 taken 34 times.
✗ Branch 1 not taken.
|
34 | LogInfo(VB_CHANNELOUT, "Set Channel Value: %d-%d => %d, Model: %s\n", |
| 32 | start + 1, start + count, | ||
| 33 | value, model.c_str()); | ||
| 34 | 36 | } | |
| 35 | |||
| 36 | 8 | SetValueOutputProcessor::~SetValueOutputProcessor() { | |
| 37 | 8 | } | |
| 38 | |||
| 39 | 674 | void SetValueOutputProcessor::ProcessData(unsigned char* channelData) const { | |
| 40 | 674 | memset(channelData + start, value, count); | |
| 41 | 674 | } | |
| 42 |