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

Bug #198400 reported by b2ag
2
Affects Status Importance Assigned to Milestone
Mixxx
Fix Released
Low
ironstorm

Bug Description

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.

Revision history for this message
b2ag (thomas-b2ag) wrote :
Revision history for this message
ironstorm (ironstorm-gmail) wrote :

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).

Changed in mixxx:
assignee: nobody → ironstorm-gmail
status: New → In Progress
Revision history for this message
b2ag (thomas-b2ag) wrote :

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

Use the attched one :)

Revision history for this message
ironstorm (ironstorm-gmail) wrote :

> 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)) {
...

Revision history for this message
b2ag (thomas-b2ag) wrote :

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?

Revision history for this message
b2ag (thomas-b2ag) wrote :

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

Revision history for this message
ironstorm (ironstorm-gmail) wrote :

> 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.

Revision history for this message
ironstorm (ironstorm-gmail) wrote :

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

Changed in mixxx:
importance: Undecided → Low
status: In Progress → Fix Committed
Revision history for this message
b2ag (thomas-b2ag) wrote :

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.

Revision history for this message
ironstorm (ironstorm-gmail) wrote :

> 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

Revision history for this message
b2ag (thomas-b2ag) wrote :

nice

Revision history for this message
ironstorm (ironstorm-gmail) wrote :

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

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/4932

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.