FX data optimization (#2908)

* Do not require commas between ! in fxdata

* Updating fxdata: Halfway through the FX list

* fxdata flags and optimizations

* Revert optional commas after !
This commit is contained in:
Christian Schwinne 2022-11-26 21:31:45 +01:00 committed by GitHub
parent 9a44f0c869
commit 1db25d4b20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 185 additions and 183 deletions

File diff suppressed because it is too large Load Diff

View File

@ -522,7 +522,7 @@ function loadFXData(callback = null)
fxdata = json||[];
// add default value for Solid
fxdata.shift()
fxdata.unshift(";!;0");
fxdata.unshift(";!;");
})
.catch((e)=>{
fxdata = [];
@ -847,17 +847,18 @@ function populateEffects()
let fd = "";
if (ef.name.indexOf("RSVD") < 0) {
if (Array.isArray(fxdata) && fxdata.length>id) {
if (fxdata[id].length==0) fd = ";;!;1d"
if (fxdata[id].length==0) fd = ";;!;1"
else fd = fxdata[id];
let eP = (fd == '')?[]:fd.split(";"); // effect parameters
let p = (eP.length<3 || eP[2]==='')?[]:eP[2].split(","); // palette data
if (p.length>0 && (p[0] !== "" && !isNumeric(p[0]))) nm += "&#x1F3A8;"; // effects using palette
let m = (eP.length<4 || eP[3]==='')?[]:eP[3].split(","); // metadata
if (m.length>0) for (let r of m) {
if (r.substring(0,2)=="1d") nm += "&#8942;"; // 1D effects
if (r.substring(0,2)=="2d") nm += "&#9638;"; // 2D effects
if (r.substring(0,2)=="vo") nm += "&#9834;"; // volume effects
if (r.substring(0,2)=="fr") nm += "&#9835;"; // frequency effects
let m = (eP.length<4 || eP[3]==='')?'1':eP[3]; // flags
if (id == 0) m = ''; // solid has no flags
if (m.length>0) {
if (m.includes('1')) nm += "&#8942;"; // 1D effects
if (m.includes('2')) nm += "&#9638;"; // 2D effects
if (m.includes('v')) nm += "&#9834;"; // volume effects
if (m.includes('f')) nm += "&#9835;"; // frequency effects
}
}
html += generateListItemHtml('fx',id,nm,'setFX','',fd);

View File

@ -8,6 +8,7 @@
// Autogenerated from wled00/data/index.htm, do not edit!!
const uint16_t PAGE_index_L = 30488;
const uint8_t PAGE_index[] PROGMEM = {
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x13, 0xd4, 0xbd, 0x69, 0x7a, 0xe3, 0x3a,
0xb2, 0x28, 0xf8, 0xdf, 0xab, 0x60, 0x32, 0xab, 0x9c, 0x52, 0x89, 0x96, 0xa8, 0xd1, 0x1a, 0x52,

View File

@ -8,7 +8,7 @@
*/
// version code in format yymmddb (b = daily build)
#define VERSION 2211250
#define VERSION 2211260
//uncomment this if you have a "my_config.h" file you'd like to use
//#define WLED_USE_MY_CONFIG