Skip to content

Commit 70f38c3

Browse files
committed
Output Processors: respect active/disabled checkbox
1 parent 06d28b1 commit 70f38c3

File tree

1 file changed

+23
-18
lines changed

1 file changed

+23
-18
lines changed

src/channeloutput/processors/OutputProcessor.cpp

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -81,25 +81,30 @@ void OutputProcessors::loadFromJSON(const Json::Value& config, bool clear) {
8181
}
8282
}
8383
OutputProcessor* OutputProcessors::create(const Json::Value& config) {
84-
std::string type = config["type"].asString();
85-
if (type == "Remap") {
86-
return new RemapOutputProcessor(config);
87-
} else if (type == "Brightness") {
88-
return new BrightnessOutputProcessor(config);
89-
} else if (type == "Hold Value") {
90-
return new HoldValueOutputProcessor(config);
91-
} else if (type == "Set Value") {
92-
return new SetValueOutputProcessor(config);
93-
} else if (type == "Reorder Colors") {
94-
return new ColorOrderOutputProcessor(config);
95-
} else if (type == "Three to Four") {
96-
return new ThreeToFourOutputProcessor(config);
97-
} else if (type == "Override Zero") {
98-
return new OverrideZeroOutputProcessor(config);
99-
} else if (type == "Fold") {
100-
return new FoldOutputProcessor(config);
84+
int active = config["active"].asInt();
85+
if (active == 1) {
86+
std::string type = config["type"].asString();
87+
if (type == "Remap") {
88+
return new RemapOutputProcessor(config);
89+
} else if (type == "Brightness") {
90+
return new BrightnessOutputProcessor(config);
91+
} else if (type == "Hold Value") {
92+
return new HoldValueOutputProcessor(config);
93+
} else if (type == "Set Value") {
94+
return new SetValueOutputProcessor(config);
95+
} else if (type == "Reorder Colors") {
96+
return new ColorOrderOutputProcessor(config);
97+
} else if (type == "Three to Four") {
98+
return new ThreeToFourOutputProcessor(config);
99+
} else if (type == "Override Zero") {
100+
return new OverrideZeroOutputProcessor(config);
101+
} else if (type == "Fold") {
102+
return new FoldOutputProcessor(config);
103+
} else {
104+
LogErr(VB_CHANNELOUT, "Unknown OutputProcessor type: %s\n", type.c_str());
105+
}
101106
} else {
102-
LogErr(VB_CHANNELOUT, "Unknown OutputProcessor type: %s\n", type.c_str());
107+
LogDebug(VB_CHANNELOUT, "Skipping disabled OutputProcessor\n");
103108
}
104109
return nullptr;
105110
}

0 commit comments

Comments
 (0)