From bb76bd09c6c986ee9fbfdc3f2d7f5909a12d60b4 Mon Sep 17 00:00:00 2001 From: themancalledjakob Date: Sun, 8 Oct 2023 17:28:15 +0200 Subject: [PATCH] fix remove color mapping & options --- bin/web/js/audio.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/bin/web/js/audio.js b/bin/web/js/audio.js index cf102e4..c3feb2a 100644 --- a/bin/web/js/audio.js +++ b/bin/web/js/audio.js @@ -51,6 +51,14 @@ const Audio = function(tp, record) { return false; } if (!mapping[layer.id()].hasOwnProperty(propTitle)) { + if (propTitle === 'color' && + config.audio.colorSeparateRGBA && + mapping[layer.id()].hasOwnProperty('color.r') && + mapping[layer.id()].hasOwnProperty('color.g') && + mapping[layer.id()].hasOwnProperty('color.b') && + mapping[layer.id()].hasOwnProperty('color.a')) { + return true; + } return false; } return true; @@ -121,7 +129,7 @@ const Audio = function(tp, record) { if (!mapping[layer.id()].hasOwnProperty(propTitle)) { // no propTitle // perhaps color? - if (config.audio.separateRGBA && propTitle === 'color') { + if (config.audio.colorSeparateRGBA && propTitle === 'color') { let isGood = true; isGood = removeAudioMapping(layer, 'color.r'); isGood = removeAudioMapping(layer, 'color.g'); @@ -148,6 +156,7 @@ const Audio = function(tp, record) { audioOptions.style.position = 'relative'; audioOptions.style.width = '100%'; if (propTitle.split('.')[0] === 'color' && propTitle.split('.').length > 1) { + audioOptions.classList.add(toCssClass('audioOptionscolor')); switch(propTitle.split('.')[1]) { case 'r': { audioOptions.style.background = 'rgba(255,0,0,0.2)'; @@ -513,7 +522,7 @@ const Audio = function(tp, record) { convolver.buffer = buffer; }, function(e) { - console.log("Error with decoding audio data" + e.err); + console.log("Audio::audioCtx.decodeAudioData", "Error with decoding audio data" + e.err); } ); };