mixxxdj / mixxx

Mixxx is Free DJ software that gives you everything you need to perform live mixes.
http://mixxx.org
Other
4.5k stars 1.28k forks source link

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

Closed mixxxbot closed 2 years ago

mixxxbot commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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


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

mixxxbot commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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


nice

mixxxbot commented 2 years ago

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


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

mixxxbot commented 2 years ago

Issue closed with status Fix Released.