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

sync_enabled not sticking with javascript mapped control #8455

Closed
mixxxbot opened this issue Aug 22, 2022 · 4 comments
Closed

sync_enabled not sticking with javascript mapped control #8455

mixxxbot opened this issue Aug 22, 2022 · 4 comments
Labels
Milestone

Comments

@mixxxbot
Copy link
Collaborator

Reported by: JosepMaJAZ
Date: 2016-01-24T20:21:29Z
Status: Fix Released
Importance: Medium
Launchpad Issue: lp1537547


OS: Windows 10 64bit
Mixxx: 2.0 32 and 64bits
Controller: Hercules DJ Console 4-Mx (contributed mapping as relesed in 2.0).

New in 1.12/2.0, the "SYNC" button enables master sync for the deck if it is pressed and NOT released immediately. (Visually, it remains "on" after releasing).
This works from the UI, and also if mapped to a controller with XML, but not from when doing so from javascript (either with setValue or with setParameter).

I've been able to pinpoint the problem to an incorrect behaviour of the QTimer in this file:
https://github.com/mixxxdj/mixxx/blob/1.12/src/control/controlbehavior.cpp
Method void ControlPushButtonBehavior::setValueFromMidiParameter(
MidiOpCode o, double dParam, ControlDoublePrivate* pControl)

When i press it from my controller, it enters the "pressed" block (LONGPRESSLATCHING), the action is executed, and the timer is started (it returns an id for the timer, so i assume that means that it started).
When i release the button, after several seconds, the "else" block is executed and enters inside the if that contains the "timer.isActive()". Said timer is expected to return false instead, because the time has elapsed, so i don't know what happens.

I've read in QT's documentation that: " In multithreaded applications, you can use QTimer in any thread that has an event loop. To start an event loop from a non-GUI thread, use QThread::exec(). "
Of course, we are in the midi thread, and is a non-GUI thread.

@mixxxbot mixxxbot added the bug label Aug 22, 2022
@mixxxbot
Copy link
Collaborator Author

Commented by: JosepMaJAZ
Date: 2017-04-09T18:08:17Z


Ok, I just realized that the setValue/setParameter do not use this specific functionality, only the XML and the keyboard mappings.

So, the question is: should we modify setValue/setParameter so that "POWERWINDOW" and "LONGPRESSLATCHING" constrols also have this behaviour? Or it has to be strictly a script thing (in which case, we should update the mixxxcontrols wiki page to indicate so).

@mixxxbot
Copy link
Collaborator Author

Commented by: daschuer
Date: 2017-04-09T21:23:22Z


I would prefer to expose ControlObject::setValueFromMidi, or wrap it into a more reasonable function for the script context.

@mixxxbot
Copy link
Collaborator Author

Commented by: Be-ing
Date: 2017-05-26T05:35:04Z


#1244
Components SyncButton object now takes care of this easily.

@mixxxbot
Copy link
Collaborator Author

Issue closed with status Fix Released.

@mixxxbot mixxxbot transferred this issue from another repository Aug 24, 2022
@mixxxbot mixxxbot added this to the 2.1.0 milestone Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant