Add compatibility for SR playlists (to support HB effects)
liveviewws2D and ws.cpp: show preset and playlist id json.cpp: add SR preset compatibility
This commit is contained in:
@@ -34,6 +34,22 @@ void deserializeSegment(JsonObject elem, byte it, byte presetId)
|
||||
byte id = elem["id"] | it;
|
||||
if (id >= strip.getMaxSegments()) return;
|
||||
|
||||
//WLEDSR: add compatibility for SR presets
|
||||
// Serial.printf("before %d: %s %s %s %s\n", id, elem["start"].as<std::string>().c_str(), elem["stop"].as<std::string>().c_str(), elem["startY"].as<std::string>().c_str(), elem["stopY"].as<std::string>().c_str());
|
||||
if (strip.isMatrix && !elem["start"].isNull() && !elem["stop"].isNull() && elem["startY"].isNull() && elem["stopY"].isNull()) {
|
||||
uint16_t start1=elem["start"], stop1=elem["stop"];
|
||||
elem["start"] = start1%strip.matrixWidth;
|
||||
elem["startY"]= strip.matrixWidth?(start1 / strip.matrixWidth):0;
|
||||
elem["stop"] = (stop1-1)%strip.matrixWidth + 1;
|
||||
elem["stopY"]= strip.matrixWidth?((stop1-1) / strip.matrixWidth) + 1:0;
|
||||
// Serial.printf("after %s %s %s %s\n", elem["start"].as<std::string>().c_str(), elem["stop"].as<std::string>().c_str(), elem["startY"].as<std::string>().c_str(), elem["stopY"].as<std::string>().c_str());
|
||||
}
|
||||
if (!elem["c1x"].isNull()) elem["c1"] = elem["c1x"];
|
||||
if (!elem["c2x"].isNull()) elem["c2"] = elem["c2x"];
|
||||
if (!elem["c3x"].isNull()) elem["c3"] = elem["c3x"];
|
||||
if (!elem["rev2D"].isNull()) elem["rY"] = elem["rev2D"];
|
||||
if (!elem["rot2D"].isNull()) elem["tp"] = elem["rot2D"];
|
||||
|
||||
int stop = elem["stop"] | -1;
|
||||
|
||||
// if using vectors use this code to append segment
|
||||
|
||||
Reference in New Issue
Block a user