Hi list,

This patch introduces an "Enable Needle Skip Prevention" setting to the
Vinyl Control preferences, as the Needle Skip Prevention correction may be
undesirable for some people when scratching or otherwise spinning the record
fast. It basically renames the b_CDMode variable and introduces a setting in
the configuration file "NeedleSkipPrevention" under the section [Vinyl
Control].

The setting is only honoured for vinyl control; if a Serato CD is used, the
prevention code setting is forced to false to prevent any problems with
rapid CUEing.

Peace,
NG
Index: vinylcontrolxwax.cpp
===================================================================
--- vinylcontrolxwax.cpp	(revision 2738)
+++ vinylcontrolxwax.cpp	(working copy)
@@ -40,17 +40,17 @@
     m_samples               = NULL;
     char * timecode  =  NULL;
     bShouldClose    = false;
-    m_bCDMode               = false;
+    m_bNeedleSkipPrevention = (m_pConfig->getValueString( ConfigKey( "[VinylControl]", "NeedleSkipPrevention" ) ).toInt() > 0?true:false);
     
     //this is all needed because libxwax indexes by C-strings
     //so we go and pass libxwax a pointer into our local stack...
     if (strVinylType == MIXXX_VINYL_SERATOCV02VINYLSIDEA)
         timecode = (char*)"serato_2a";
-    else if (strVinylType == MIXXX_VINYL_SERATOCV02VINYLSIDEB)
+    else if (strVinylType == MIXXX_VINYL_SERATOCV02VINYLSIDEB) 
         timecode = (char*)"serato_2b";
     else if (strVinylType == MIXXX_VINYL_SERATOCD) {
         timecode = (char*)"serato_cd";
-        m_bCDMode = true;
+        m_bNeedleSkipPrevention = false;
     }
     else if (strVinylType == MIXXX_VINYL_TRAKTORSCRATCHSIDEA)
         timecode = (char*)"traktor_a";
@@ -213,7 +213,7 @@
                     //If the position from the timecode is more than a few seconds off, resync the position.
                     if (fabs(dVinylPosition - filePosition - iLeadInTime) > 3.0 && 
                         (iVCMode == MIXXX_VCMODE_ABSOLUTE) &&
-                        !m_bCDMode)
+                        m_bNeedleSkipPrevention)
                     {
                         syncPosition();
                     }
@@ -221,7 +221,7 @@
                     //with CDJs, so there's no point in trying to prevent needle skips.
                     else if (fabs(dVinylPosition - filePosition - iLeadInTime) > 0.2 &&
                              (iVCMode == MIXXX_VCMODE_ABSOLUTE) &&
-                             m_bCDMode) //CD Mode
+                             (!m_bNeedleSkipPrevention)) 
                     {
                         syncPosition();
                     }
Index: vinylcontrolxwax.h
===================================================================
--- vinylcontrolxwax.h	(revision 2738)
+++ vinylcontrolxwax.h	(working copy)
@@ -43,7 +43,7 @@
 
 	bool		   bShouldClose;
 	bool		   bIsRunning;
-    bool           m_bCDMode;      /**< CD mode disables the needle-skip prevention code */
+    bool           m_bNeedleSkipPrevention;      /**< needle skip prevention is now optional (still CD mode force this to be false) */
 };        
 
 #endif
Index: dlgprefvinyl.cpp
===================================================================
--- dlgprefvinyl.cpp	(revision 2738)
+++ dlgprefvinyl.cpp	(working copy)
@@ -193,6 +193,10 @@
     else if (iMode == MIXXX_VCMODE_SCRATCH)
         ScratchMode->setChecked(true);
 
+    // Honour the Needle Skip Prevention setting.
+    int iSkipEnabled = config->getValueString( ConfigKey("[VinylControl]", "NeedleSkipPrevention") ).toInt();
+    NeedleSkipEnable->setChecked( (iSkipEnabled > 0) );
+
     //set vinyl control gain
     VinylGain->setValue( config->getValueString(ConfigKey("[VinylControl]","VinylControlGain")).toInt());
 }
@@ -302,6 +306,7 @@
 
     ControlObject::getControl(ConfigKey("[VinylControl]", "Mode"))->set(iMode);
     config->set(ConfigKey("[VinylControl]","Mode"), ConfigValue(iMode));
+    config->set(ConfigKey("[VinylControl]","NeedleSkipPrevention" ), ConfigValue( (NeedleSkipEnable->isChecked( )?1:0) ) );
 
     //if (config->getValueString(ConfigKey("[Soundcard]","SoundApi"))=="None" || !m_pSoundManager->setupDevices())
     //if (config->getValueString(ConfigKey("[Soundcard]","SoundApi"))=="None"|| (m_pSoundManager->setupDevices() != 0))
Index: dlgprefvinyldlg.ui
===================================================================
--- dlgprefvinyldlg.ui	(revision 2738)
+++ dlgprefvinyldlg.ui	(working copy)
@@ -308,6 +308,13 @@
         </property>
        </widget>
       </item>
+      <item>
+        <widget class="QCheckBox" name="NeedleSkipEnable" >
+        <property name="text">
+                <string>Enable Needle Skip Prevention</string>
+        </property>
+        </widget>
+      </item>
      </layout>
     </widget>
    </item>
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Mixxx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mixxx-devel

Reply via email to