// ---------------------------------------------------------------------------- // void SpotifyEngine::_processTrackAnalysis() { if ( isAnalyzing() ) { saveTrackAnalysis( m_analyzer->captureAnalyzerData() ); removeTrackAnalyzer(); } }
void UCIEngine::protocolEnd() { if(isAnalyzing()) { stopAnalysis(); m_quitAfterAnalysis = true; } else { send("quit"); setActive(false); } }
bool UCIEngine::stopAnalysis() { if(!isAnalyzing()) { return false; } send("stop"); return true; }
void UCIEngine::processMessage(const QString& message) { if(message == "uciok") { //once the engine is running wait for it to initialise m_waitingOn = "uciok"; send("isready"); } if(message == "readyok") { if(m_waitingOn == "uciok") { //engine is now initialised and ready to go m_waitingOn = ""; setActive(true); } if(m_waitingOn == "ucinewgame") { //engine is now ready to analyse a new position m_waitingOn = ""; send("position fen " + m_position); send("go infinite"); } } if(message.section(' ', 0, 0) == "bestmove") { //analysis finished setAnalyzing(false); if(m_quitAfterAnalysis) { send("quit"); setActive(false); } } if(message.section(' ', 0, 0) == "info" && isAnalyzing()) { parseAnalysis(message); } }
// ---------------------------------------------------------------------------- // void SpotifyEngine::removeTrackAnalyzer() { if ( isAnalyzing() ) { delete m_analyzer; m_analyzer = NULL; } }