Hey all... As you may know, I've been working for quite a while now on adding support for my Numark Total Control to the Mixxx code base.
The first order of business is getting the jog wheels to work correctly. This patch corrects two problems which prevented the jog wheels to function.
They are 'diff' controls, but with a bit of a twist. First, they are extremely sensitive (barely touching the wheel results in a +1 or a -1) so this patch allows diff controls to respect sensitivity.
The patch also solves a bug where spinning the wheel backward very fast is interpreted as spinning the wheel forward.
Diff currently interprets signed values using a buggy Two's Compliment decoding method (or an entirely different decoding method) such that -64 is interpreted incorrectly as 64.
This patch fixes the problem for me (with a >= instead of a >) but I'm not entirely convinced that this won't cause a problem for other hardware.
Can whoever originally wrote this code please validate that this is the correct way to go about fixing it?
ttyl -- Alex (Malex) Markley 740.927.3588 - http://MalexMedia.Net/ - http://SermonMP3s.com/
Index: src/configobject.cpp
===================================================================
--- src/configobject.cpp (revision 1900)
+++ src/configobject.cpp (working copy)
@@ -355,11 +355,14 @@
}
else if (midioption == MIDI_OPT_DIFF)
{
- if (_newmidivalue > 64.) {
- _newmidivalue = _prevmidivalue - 128. + _newmidivalue;
- } else {
- _newmidivalue = _prevmidivalue + _newmidivalue;
- }
+ //Interpret 7-bit signed value using two's compliment.
+ if (_newmidivalue >= 64.)
+ _newmidivalue = _newmidivalue - 128.;
+ //Apply sensitivity to signed value.
+ if(sensitivity > 0)
+ _newmidivalue = _newmidivalue * ((double)sensitivity / 50.);
+ //Apply new value to current value.
+ _prevmidivalue = _prevmidivalue + _newmidivalue;
}
else if (midioption == MIDI_OPT_BUTTON)
{
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________ Mixxx-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mixxx-devel
