Hi Albert,

first off, attached you find the fixed patch for better centering behaviour. "grep 63.5 src/*" did the trick. I changed the 63.5 (which was there just because it was impossible to center the pots with any valid MIDI value) into 64.0

So, this patch fixes the mistakes of the first one and should be okay.

Thanks for the patch. I'll try to test this out in the next day or so.
If you plan on continuing to contribute, then we'll consider giving you
SVN access at some point (your patches have been good). Would you be
interested in this?

Very flattering. Thank you very much! But still, for the moment, I think I'll decline. I wasn't even planning on contributing more than the necessary fixes to make me a happy DM2+Mixxx user when I first checked out the SVN trunk.

Rest assured that I will not contribute any more slowly by contributing patches than I would by committing directly. In fact, I think so far this has worked out rather well.

The minute I feel that I want to make contributions more regularly (job permitting), I'll gladly accept the offer. At this point, I feel it's a bit early...

Thanks again,

Ján



Index: mixxx/src/midiobject.cpp
===================================================================
--- mixxx/src/midiobject.cpp	(revision 1772)
+++ mixxx/src/midiobject.cpp	(working copy)
@@ -182,9 +182,9 @@
         _14bit <<= 7;
         _14bit |= (unsigned char) control;
         // qDebug("-- 14 bit pitch %i", _14bit);
-        // Need to force the centre point, otherwise the conversion formula maps it very slightly off-centre
+        // Need to force the centre point, otherwise the conversion formula maps it very slightly off-centre (not any more)
         if (_14bit == 8192)
-            newValue = 63.5;
+            newValue = 64.0;
         else
             newValue = (double) _14bit * 127. / 16383.;
         // qDebug("-- converted to %f", newValue);
Index: mixxx/src/wslidercomposed.h
===================================================================
--- mixxx/src/wslidercomposed.h	(revision 1772)
+++ mixxx/src/wslidercomposed.h	(working copy)
@@ -33,7 +33,7 @@
 class WSliderComposed : public WAbstractControl  {
     Q_OBJECT
 public:
-    WSliderComposed(QWidget *parent=0, const char *name=0, float defaultValue=63.5);
+    WSliderComposed(QWidget *parent=0, const char *name=0, float defaultValue=64.0);
     ~WSliderComposed();
     void setup(QDomNode node);
     void setPixmaps(bool bHorizontal, const QString &filenameSlider, const QString &filenameHandle);
Index: mixxx/src/controlpotmeter.cpp
===================================================================
--- mixxx/src/controlpotmeter.cpp	(revision 1772)
+++ mixxx/src/controlpotmeter.cpp	(working copy)
@@ -69,17 +69,20 @@
 
 double ControlPotmeter::getValueToWidget(double dValue)
 {
-    return 127.*(dValue-m_dMinValue)/m_dValueRange;
+    double out = (dValue-m_dMinValue)/m_dValueRange;
+    return (out < 0.5) ? out*128. : out*126. + 1.;
 }
 
 double ControlPotmeter::GetMidiValue()
 {
-    return 127.*(m_dValue-m_dMinValue)/m_dValueRange;
+    double out = (m_dValue-m_dMinValue)/m_dValueRange;
+    return (out < 0.5) ? out*128. : out*126. + 1.;
 }
 
 double ControlPotmeter::getValueFromWidget(double dValue)
 {
-    return m_dMinValue + (dValue/127.)*m_dValueRange;
+    double out = (dValue < 64) ? dValue / 128. : (dValue-1) / 126.;
+    return m_dMinValue + out * m_dValueRange;
 }
 
 void ControlPotmeter::setValueFromThread(double dValue)
@@ -106,7 +109,8 @@
 
 void ControlPotmeter::setValueFromMidi(MidiCategory, double v)
 {
-    m_dValue = m_dMinValue + (v/127.)*m_dValueRange;
+    double out = (v < 64) ? v / 128. : (v-1) / 126.;
+    m_dValue = m_dMinValue + out*m_dValueRange;
     emit(valueChanged(m_dValue));
 }
 
-------------------------------------------------------------------------
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

Reply via email to