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

Bug #1957573 reported by Jörg Wartenberg
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mixxx
Confirmed
High
Unassigned

Bug Description

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

Revision history for this message
Jan Holthuis (holthuis-jan) wrote (last edit ):
Revision history for this message
Jan Holthuis (holthuis-jan) wrote :

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.

Revision history for this message
Jörg Wartenberg (joerg-ubuntu) wrote :

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.

Revision history for this message
Jörg Wartenberg (joerg-ubuntu) wrote :

Should I open a PR to remove num_effects from the manual? Or will this be fixed otherwise?

Revision history for this message
Daniel Schürmann (daschuer) wrote :

A PR is welcome.

Changed in mixxx:
status: New → Confirmed
importance: Undecided → High
milestone: none → 2.4.0
tags: removed: 2.4
Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/10638

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.