Playlist creation bugfix (preset 0 selected).

This commit is contained in:
Blaz Kristan 2022-11-30 19:34:32 +01:00
parent bd601ad2da
commit 643f300792
3 changed files with 1144 additions and 1147 deletions

View File

@ -17,6 +17,7 @@ var d = document;
var palettesData; var palettesData;
var fxdata = []; var fxdata = [];
var pJson = {}, eJson = {}, lJson = {}; var pJson = {}, eJson = {}, lJson = {};
var plJson = {}; // array of playlists
var pN = "", pI = 0, pNum = 0; var pN = "", pI = 0, pNum = 0;
var pmt = 1, pmtLS = 0, pmtLast = 0; var pmt = 1, pmtLS = 0, pmtLast = 0;
var lastinfo = {}; var lastinfo = {};
@ -1698,15 +1699,6 @@ function resetUtil()
+ '<div class="segname" onclick="makeSeg()"><i class="icons btn-icon">&#xe18a;</i>Add segment</div></div>'; + '<div class="segname" onclick="makeSeg()"><i class="icons btn-icon">&#xe18a;</i>Add segment</div></div>';
} }
var plJson = {"0":{
"ps": [0],
"dur": [100],
"transition": [-1], // to be inited to default transition dur
"repeat": 0,
"r": false,
"end": 0
}};
function makePlSel(el, incPl=false) { function makePlSel(el, incPl=false) {
var plSelContent = ""; var plSelContent = "";
delete pJson["0"]; // remove filler preset delete pJson["0"]; // remove filler preset
@ -1787,6 +1779,14 @@ function plR(p) {
function makeP(i,pl) { function makeP(i,pl) {
var content = ""; var content = "";
if (pl) { if (pl) {
if (i===0) plJson[0] = {
ps: [1],
dur: [100],
transition: [tr],
repeat: 0,
r: false,
end: 0
};
var rep = plJson[i].repeat ? plJson[i].repeat : 0; var rep = plJson[i].repeat ? plJson[i].repeat : 0;
content = content =
`<div id="ple${i}" style="margin-top:10px;"></div><label class="check revchkl">Shuffle `<div id="ple${i}" style="margin-top:10px;"></div><label class="check revchkl">Shuffle
@ -1909,7 +1909,6 @@ function makePlUtil()
if (pNum < 2) { if (pNum < 2) {
showToast("You need at least 2 presets to make a playlist!"); //return; showToast("You need at least 2 presets to make a playlist!"); //return;
} }
if (plJson[0].transition[0] < 0) plJson[0].transition[0] = tr;
let p = gId('putil'); let p = gId('putil');
p.classList.remove('staybot'); p.classList.remove('staybot');
p.classList.add('pres'); p.classList.add('pres');

File diff suppressed because it is too large Load Diff

View File

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