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

Fader-Events of Hercules (via libdjconsole) are ignored when sending 0-position #4932

Closed
mixxxbot opened this issue Aug 22, 2022 · 13 comments
Closed
Labels

Comments

@mixxxbot
Copy link
Collaborator

Reported by: thomas-b2ag
Date: 2008-03-04T16:13:24Z
Status: Fix Released
Importance: Low
Launchpad Issue: lp198400
Attachments: [return statement removed for second==0 in consoleEvent](https://bugs.launchpad.net/bugs/198400/+attachment/221234/+files/return statement removed for second==0 in consoleEvent), [exclude fader of libdjconsole](https://bugs.launchpad.net/bugs/198400/+attachment/221428/+files/exclude fader of libdjconsole), restructure_herculeslinuxcpp.diff


This Bad causes Mixxx to don't register 0-position for line-faders under linux using Hercules Mk2 (or other via libdjconsole).

I've found an if-statement in herculeslinux.cpp line 216 saying to return (and don't handle this) when second parameter equals zero.
I've also attached bugfix.diff solving this problem.

Alternativ you could restrict the whole if-statement to "first equals 45,40 or 39" to only cancel return for faders.

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

Commented by: thomas-b2ag
Date: 2008-03-04T16:13:24Z
Attachments: [return statement removed for second==0 in consoleEvent](https://bugs.launchpad.net/mixxx/+bug/198400/+attachment/221234/+files/return statement removed for second==0 in consoleEvent)

@mixxxbot
Copy link
Collaborator Author

Commented by: deftdawg
Date: 2008-03-04T16:37:44Z


Yup, that looks like a bug.
The intent of that code was to catch button up events and clear the LED.
The if-condition should probably be modified to exclude controls that don't have LEDs (i.e. they aren't buttons).

@mixxxbot
Copy link
Collaborator Author

Commented by: thomas-b2ag
Date: 2008-03-04T18:29:09Z
Attachments: [exclude fader of libdjconsole](https://bugs.launchpad.net/mixxx/+bug/198400/+attachment/221428/+files/exclude fader of libdjconsole)


Okay, then please don't use my first bugfix so that buttons don't get handled twice.

Use the attched one :)

@mixxxbot
Copy link
Collaborator Author

Commented by: deftdawg
Date: 2008-03-04T19:32:50Z


Okay, then please don't use my first bugfix so that buttons don't get handled twice.
Use the attached one :)

I'm actually going to write it to use a QSet or QList or something with all of the non-button controls so it will be something like this psuedo code (note: since some of these vars aren't defined yet):

QSet<int> non_buttons;
non_button_controls  << XFADER << MAIN_VOL << MONITOR_SPLIT  << MONITOR_MIX;
non_button_controls << MONITOR_A << GAIN_A << VOLUME_A << LEFT_JOG << LEFT_BASS << LEFT_MID << LEFT_HIGH << LEFT_PITCH;
// same thing for Deck B / RIGHT side

if ( second == 0 && !non_button_controls.contains(first)) {
... 

@mixxxbot
Copy link
Collaborator Author

Commented by: thomas-b2ag
Date: 2008-03-04T19:58:42Z


please don't do that!

restructuring the whole method is more sane for me.
i think of a sequence like this:

  1. handeling-code for nonbuttons
  2. second = 0 -> setBits and go to hell (return)
  3. handeling-code for buttons

what do you say?

@mixxxbot
Copy link
Collaborator Author

Commented by: thomas-b2ag
Date: 2008-03-04T20:29:22Z
Attachments: restructure_herculeslinuxcpp.diff


what whould you say if i say: "i've done the job for you!"?

@mixxxbot
Copy link
Collaborator Author

Commented by: deftdawg
Date: 2008-03-04T20:40:10Z


restructuring the whole method is more sane for me.
i think of a sequence like this:

  1. handeling-code for nonbuttons
  2. second = 0 -> setBits and go to hell (return)
  3. handeling-code for buttons

The plan to do it as a 'set' would be to eventually roll this code up to libDJConsole in the form of an isButton(int first) function. Perhaps I'll just do an isButton function in the code under the MONITOR const block to make that easier.

Eventually we are planning to remove all the Hercules specific support code (both libDJConsole & herculeslinuxlegacy) and use MIDI mappings for the Hercules series as we do on Windows/OSX. We're optimistic Hercules will provide us MIDI drivers for Linux in the not too distant future to make this happen.

For that reason, I'd like to avoid doing any changes purely for aesthetic reasons if possible; there is more important work to be done.  

@mixxxbot
Copy link
Collaborator Author

Commented by: deftdawg
Date: 2008-03-05T00:44:01Z


fixed in r1874 - thanks to b2ag finding and offering suggested fixes for this one.

@mixxxbot
Copy link
Collaborator Author

Commented by: thomas-b2ag
Date: 2008-03-05T07:33:34Z


libdjconsole define "BUTTONS" with value 32. and it seams that evetns with "first <= 32" are button-event.
i simply don't like the idea of searching in an array (or set) for that.

@mixxxbot
Copy link
Collaborator Author

Commented by: deftdawg
Date: 2008-03-05T09:53:04Z


> libdjconsole define "BUTTONS" with value 32. and it seams that evetns with "first <= 32" are button-event.

Shortly there will be ~43 buttons to support - http://www.westenddj.co.uk/images/products/_Hercules/djc_rmx_top.jpg

@mixxxbot
Copy link
Collaborator Author

Commented by: thomas-b2ag
Date: 2008-03-05T19:23:33Z


nice

@mixxxbot
Copy link
Collaborator Author

Commented by: deftdawg
Date: 2008-11-17T23:46:26Z


I'm looking forward to closing down the libDJConsole project for Christmas...

@mixxxbot
Copy link
Collaborator Author

Issue closed with status Fix Released.

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