fix remove color mapping & options

This commit is contained in:
jrkb 2023-10-08 17:28:15 +02:00
parent 667447b9a2
commit bb76bd09c6

View file

@ -51,6 +51,14 @@ const Audio = function(tp, record) {
return false; return false;
} }
if (!mapping[layer.id()].hasOwnProperty(propTitle)) { 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 false;
} }
return true; return true;
@ -121,7 +129,7 @@ const Audio = function(tp, record) {
if (!mapping[layer.id()].hasOwnProperty(propTitle)) { if (!mapping[layer.id()].hasOwnProperty(propTitle)) {
// no propTitle // no propTitle
// perhaps color? // perhaps color?
if (config.audio.separateRGBA && propTitle === 'color') { if (config.audio.colorSeparateRGBA && propTitle === 'color') {
let isGood = true; let isGood = true;
isGood = removeAudioMapping(layer, 'color.r'); isGood = removeAudioMapping(layer, 'color.r');
isGood = removeAudioMapping(layer, 'color.g'); isGood = removeAudioMapping(layer, 'color.g');
@ -148,6 +156,7 @@ const Audio = function(tp, record) {
audioOptions.style.position = 'relative'; audioOptions.style.position = 'relative';
audioOptions.style.width = '100%'; audioOptions.style.width = '100%';
if (propTitle.split('.')[0] === 'color' && propTitle.split('.').length > 1) { if (propTitle.split('.')[0] === 'color' && propTitle.split('.').length > 1) {
audioOptions.classList.add(toCssClass('audioOptionscolor'));
switch(propTitle.split('.')[1]) { switch(propTitle.split('.')[1]) {
case 'r': { case 'r': {
audioOptions.style.background = 'rgba(255,0,0,0.2)'; audioOptions.style.background = 'rgba(255,0,0,0.2)';
@ -513,7 +522,7 @@ const Audio = function(tp, record) {
convolver.buffer = buffer; convolver.buffer = buffer;
}, },
function(e) { function(e) {
console.log("Error with decoding audio data" + e.err); console.log("Audio::audioCtx.decodeAudioData", "Error with decoding audio data" + e.err);
} }
); );
}; };