Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mixxxbot opened this issue Aug 23, 2022 · 10 comments
Assignees
Labels
bug changelog This PR should be included in the changelog confirmed effects regression
Milestone

Comments

@mixxxbot
Copy link
Collaborator

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
Copy link
Collaborator Author

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


This is a regression caused by 535a717

@mixxxbot
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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


A PR is welcome.

@mixxxbot mixxxbot transferred this issue from another repository Aug 24, 2022
@mixxxbot mixxxbot added this to the 2.4.0 milestone Aug 24, 2022
@JoergAtGithub JoergAtGithub self-assigned this Feb 11, 2023
@JoergAtGithub JoergAtGithub added the changelog This PR should be included in the changelog label Jun 3, 2023
@JoergAtGithub
Copy link
Member

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

@Swiftb0y
Copy link
Member

Swiftb0y commented Jun 3, 2023

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

@ronso0
Copy link
Member

ronso0 commented Jun 3, 2023

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

@Swiftb0y
Copy link
Member

Swiftb0y commented Jun 3, 2023

IIUC num_effects is not the same as num_effectslots?

@ronso0
Copy link
Member

ronso0 commented Jun 14, 2023

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 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug changelog This PR should be included in the changelog confirmed effects regression
Projects
None yet
Development

No branches or pull requests

4 participants