/*************************************************************************** controllerengine.cpp - description ------------------- begin : Sat Apr 30 2011 copyright : (C) 2011 by Sean M. Pappalardo email : spappalardo@mixxx.org ***************************************************************************/#include"controllers/controllerengine.h"#include"controllers/controller.h"#include"controllers/controllerdebug.h"#include"control/controlobject.h"#include"control/controlobjectscript.h"#include"errordialoghandler.h"#include"mixer/playermanager.h"// to tell the msvs compiler about `isnan`#include"util/math.h"#include"util/time.h"// Used for id's inside controlConnection objects// (closure compatible version of connectControl)#include<QUuid>constintkDecks=16;// Use 1ms for the Alpha-Beta dt. We're assuming the OS actually gives us a 1ms// timer.constintkScratchTimerMs=1;constdoublekAlphaBetaDt=kScratchTimerMs/1000.0;ControllerEngine::ControllerEngine(Controller*controller):m_pEngine(nullptr),m_pController(controller),m_bPopups(false),m_pBaClass(nullptr){// Handle error dialog buttonsqRegisterMetaType<QMessageBox::StandardButton>("QMessageBox::StandardButton");// Pre-allocate arrays for average number of virtual decksm_intervalAccumulator.resize(kDecks);m_lastMovement.resize(kDecks);m_dx.resize(kDecks);m_rampTo.resize(kDecks);m_ramp.resize(kDecks);m_scratchFilters.resize(kDecks);m_rampFactor.resize(kDecks);m_brakeActive.resize(kDecks);// Initialize arrays used for testing and pointersfor(inti=0;i<kDecks;++i){m_dx[i]=0.0;m_scratchFilters[i]=newAlphaBetaFilter();m_ramp[i]=false;}initializeScriptEngine();}ControllerEngine::~Cont