engine.connectionControl(group, control, function, true) connects control to a function rather than removes connection

Bug #1458264 reported by Be
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mixxx
Fix Released
Undecided
Be

Bug Description

According to http://mixxx.org/wiki/doku.php/midi_scripting#automatic_reactions , "engine.connectControl(control group, control name, script function name, true) - Tacking a ,true on to the list of parameters disconnects the specified Mixxx control signal from the specified script function. It returns true if the disconnection was successful." However, this makes a new connection rather than disconnecting. I tried commenting out every instance of engine.connectControl() in my script and put one in the init function with true as the last argument and the function executed when that control was changed. Wrapping engine.connectControl() in an if statement that prints a debug message shows that engine.connectControl() returns true whether or not the the last boolean argument is included (regardless of whether it is true or false).

Be (be.ing)
description: updated
Revision history for this message
Be (be.ing) wrote :

This happens both with 1.12 beta and 1.11.

Revision history for this message
Sébastien BLAISOT (sblaisot) wrote :

I tried to reproduce it with attached testing mapping with no luck.

adding true as a last argument did disconnect the control for me.

Be (be.ing)
tags: added: mapping
Be (be.ing)
Changed in mixxx:
status: New → Invalid
Revision history for this message
Be (be.ing) wrote :

Your example works as expected. I figured out what I was doing differently in my script. I was not putting the function names (the third argument) in quotes. It is weird that the connection works without quotes but not the disconnection.

Curiously, I get these errors in the debugging output:
Warning [Controller]: Could not Disconnect connection "testit.button1"
but it actually does disconnect the function.

Thanks for taking the time to make that example and test it.

Revision history for this message
Be (be.ing) wrote :

Err, the debug message is actually:
Warning [Controller]: Could not Disconnect connection "testit.playLed"

Revision history for this message
Be (be.ing) wrote :

I made a note of this on the wiki and corrected the deck toggle button example.

Changed in mixxx:
status: Invalid → Confirmed
Revision history for this message
Sébastien BLAISOT (sblaisot) wrote :

In fact, there is a bug in code :
https://github.com/mixxxdj/mixxx/blob/1.12/src/controllers/controllerengine.cpp#L801

if "callback" parameter is a string, the "disconnect" parameter is taken into account, but if "callback" is a function or a QObject, the "disconnect" parameter is totally ignored.

I think we should handle the "disconnect" parameter should be respected even if the callback parameter is a function.

Be (be.ing)
Changed in mixxx:
assignee: nobody → Be (be.ing)
Revision history for this message
Be (be.ing) wrote :
Changed in mixxx:
status: Confirmed → In Progress
Revision history for this message
Be (be.ing) wrote :
Changed in mixxx:
assignee: Be (be.ing) → nobody
status: In Progress → Fix Committed
RJ Skerry-Ryan (rryan)
Changed in mixxx:
milestone: none → 2.1.0
Revision history for this message
Be (be.ing) wrote :

Actual fix for this was to deprecate the messy, inconsistent API of engine.connectControl in favor of engine.makeConnection https://github.com/mixxxdj/mixxx/pull/1218

Changed in mixxx:
assignee: nobody → Be (be.ing)
Changed in mixxx:
status: Fix Committed → Fix Released
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/8062

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

Bug attachments

Remote bug watches

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