Either I am out of my mind or sleep is taking over me, this is the corrected
(spelling mistake :P) version of "snapshot of how I am using
ControlObject::getCallStatus()"


  //COcallOld stores value of sync() call last time this function was called
  //COcallNew stores current value of sync()
  //m_dist stores the dist traveled by mouse from last call of this
function
  //m_distOld stores last value of m_dist


       *//exact - last set value has been used just once*
       if (COcallNew - COcallOld) = 1 or -10 )* *
            {
             m_distOld = m_dist;
            }
        *//lag **- last set value has NOT yet been used*
        else if ( COcallOld - COcallNew) = 0 )
            {
             m_dist += m_distOld;     //since last value has not has not
been used so add it to current value
             m_distOld = m_dist;
            }
        *//lead **- last set value has been used more than once*
        else
            {int engineLead = fabs(COcallNew - COcallOld);

             //Engine can't lead by more than 4 syncs
             if ( engineLead < 6 && engineLead > 4)
                 qDebug()<<"This is not supposed to happen, BLAME IT ON
SHANX!";
             else if ( engineLead == 7 )
                 engineLead = 4;
             else if ( (engineLead == 3) || (engineLead == 8) )
                 engineLead = 3;
             else if ( (engineLead == 2) || (engineLead == 9) )
                 engineLead = 2;

             //engineLead stores number of times value has been re-used,
since we want value to be used atleast once, so we subtract
             //1 from engineLead
             m_dist -= m_distOld * (engineLead-1);
             m_distOld = m_dist;
            }
------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Mixxx-devel mailing list
Mixxx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mixxx-devel

Reply via email to