mixxx
mixxx copied to clipboard
ControlDoublePrivate::getControl returning NULL for ( "[EffectRack1_EffectUnit1]" , "num_effects" )
Reported by: JoergAtGithub Date: 2022-01-12T21:31:16Z Status: Confirmed Importance: High Launchpad Issue: lp1957573 Tags: effects, regression
I use the following code section in my mapping:
for (let macroFxUnitIdx = 1; macroFxUnitIdx <= 2; macroFxUnitIdx++) {
let numOfLoadedButDisabledEffects = 0;
let numOfLoadedandEnabledEffects = 0;
for (let effectIdx = 1; effectIdx <= engine.getValue("[EffectRack1_EffectUnit" + macroFxUnitIdx + "]", "num_effects"); effectIdx++) {
if (engine.getValue("[EffectRack1_EffectUnit" + macroFxUnitIdx + "_Effect" + effectIdx + "]", "loaded") === 1) {
if (engine.getValue("[EffectRack1_EffectUnit" + macroFxUnitIdx + "_Effect" + effectIdx + "]", "enabled") === 1) {
numOfLoadedandEnabledEffects++;
} else {
numOfLoadedButDisabledEffects++;
}
}
}
}
This worked without failure, using Main versions from ~spring 2021. Now I updated to the latest Main and get the following warning: warning Controller ControlDoublePrivate::getControl returning NULL for ( "[EffectRack1_EffectUnit1]" , "num_effects" ) warning Controller Unknown control "[EffectRack1_EffectUnit1]" "num_effects" , returning 0.0 warning Controller ControlDoublePrivate::getControl returning NULL for ( "[EffectRack1_EffectUnit2]" , "num_effects" ) warning Controller Unknown control "[EffectRack1_EffectUnit2]" "num_effects" , returning 0.0
With return value 0, the loop is longer executed of cause, and the mapping does not work as expected anymore. The CO is stillin the manual for 2.4, so I supposeit should still work: https://manual.mixxx.org/2.4/en/chapters/appendix/mixxx_controls.html#control-[EffectRack1_EffectUnitN]-num_effects
Commented by: Holzhaus Date: 2022-01-12T23:37:45Z
This is a regression caused by https://github.com/mixxxdj/mixxx/commit/535a717e2b0793c566dfe1aea8de292d330c1ec5
Commented by: Holzhaus Date: 2022-01-12T23:59:13Z
In your case you probably want to use num_effectslots
instead of num_effects
anyway.
However, we must not remove COs (which is basically a breaking API change) without at least documenting that change.
Commented by: JoergAtGithub Date: 2022-01-13T00:24:11Z
It seems num_effectslots does the job for my case as well. Maybe num_effects is redundant. I don't understand, what was the difference between them, both return the value 4, while 3 slots are visible.
The only official mapping which contains it, is res/controllers/Reloop-Jockey-3-ME-scripts.js, but there it's commented out.
Commented by: JoergAtGithub Date: 2022-01-13T20:26:44Z
Should I open a PR to remove num_effects from the manual? Or will this be fixed otherwise?
num_effects also appears in src\test\co_dumps\co_dump_inital.csv
. I don't see that this file is used somehow.
num_effects
also occurs in Reloop-Jockey-3-ME-scripts.js
though its commented out.
easiest would be an alias (to not break mappings 🤷🏼) and mark the CO depreceated in the manual, no?
IIUC num_effects
is not the same as num_effectslots
?
Yeah, true, and I also don't understand what exactly it means / what it's useful for.
both return the value 4, while 3 slots are visible.
There are 4 effect slots available but only 3 are shown to match the common controller layout. Go ahead and remove it from the 2.4 manual :+1: