mixxx icon indicating copy to clipboard operation
mixxx copied to clipboard

ControlDoublePrivate::getControl returning NULL for ( "[EffectRack1_EffectUnit1]" , "num_effects" )

Open mixxxbot opened this issue 2 years ago • 5 comments

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

mixxxbot avatar Aug 23 '22 02:08 mixxxbot

Commented by: Holzhaus Date: 2022-01-12T23:37:45Z


This is a regression caused by https://github.com/mixxxdj/mixxx/commit/535a717e2b0793c566dfe1aea8de292d330c1ec5

mixxxbot avatar Aug 23 '22 02:08 mixxxbot

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.

mixxxbot avatar Aug 23 '22 02:08 mixxxbot

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.

mixxxbot avatar Aug 23 '22 02:08 mixxxbot

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?

mixxxbot avatar Aug 23 '22 02:08 mixxxbot

Commented by: daschuer Date: 2022-01-16T21:29:32Z


A PR is welcome.

mixxxbot avatar Aug 23 '22 02:08 mixxxbot

num_effects also appears in src\test\co_dumps\co_dump_inital.csv. I don't see that this file is used somehow.

JoergAtGithub avatar Jun 03 '23 11:06 JoergAtGithub

num_effects also occurs in Reloop-Jockey-3-ME-scripts.js though its commented out.

Swiftb0y avatar Jun 03 '23 13:06 Swiftb0y

easiest would be an alias (to not break mappings 🤷🏼) and mark the CO depreceated in the manual, no?

ronso0 avatar Jun 03 '23 13:06 ronso0

IIUC num_effects is not the same as num_effectslots?

Swiftb0y avatar Jun 03 '23 14:06 Swiftb0y

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:

ronso0 avatar Jun 14 '23 08:06 ronso0