Merge pull request #124 from netmindz/auto-playlist

New Usermod - Auto Playlist
This commit is contained in:
netmindz
2024-04-16 22:38:56 +01:00
committed by GitHub
10 changed files with 545 additions and 7 deletions

View File

@@ -115,7 +115,7 @@ Segment::Segment(const Segment &orig) {
//WLEDMM: recreate ledsrgb if more space needed (will not free ledsrgb!)
void Segment::allocLeds() {
size_t size = sizeof(CRGB)*max((size_t) length(), ledmapMaxSize); //TroyHack
size_t size = sizeof(CRGB)*max((size_t) length(), ledmapMaxSize); // TroyHacks
if ((size < sizeof(CRGB)) || (size > 164000)) { //softhack too small (<3) or too large (>160Kb)
DEBUG_PRINTF("allocLeds warning: size == %u !!\n", size);
if (ledsrgb && (ledsrgbSize == 0)) {
@@ -1552,7 +1552,7 @@ void WS2812FX::enumerateLedmaps() {
USER_PRINTF("enumerateLedmaps %s \"%s\"", fileName, name);
if (isMatrix) {
//WLEDMM calc ledmapMaxSize (TroyHack)
//WLEDMM calc ledmapMaxSize (TroyHacks)
char dim[34] = { '\0' };
f.find("\"width\":");
f.readBytesUntil('\n', dim, sizeof(dim)-1); //hack: use fileName as we have this allocated already
@@ -2406,7 +2406,7 @@ bool WS2812FX::deserializeMap(uint8_t n) {
//WLEDMM recreate customMappingTable if more space needed
if (Segment::maxWidth * Segment::maxHeight > customMappingTableSize) {
size_t size = max(ledmapMaxSize, size_t(Segment::maxWidth * Segment::maxHeight));//TroyHack
size_t size = max(ledmapMaxSize, size_t(Segment::maxWidth * Segment::maxHeight)); // TroyHacks
USER_PRINTF("deserializemap customMappingTable alloc %u from %u\n", size, customMappingTableSize);
//if (customMappingTable != nullptr) delete[] customMappingTable;
//customMappingTable = new uint16_t[size];