Example #1
0
// ----------------------------------------------------------------------------
//
void SpotifyEngine::_processTrackAnalysis() 
{
    if ( isAnalyzing() ) {
        saveTrackAnalysis( m_analyzer->captureAnalyzerData() );
        removeTrackAnalyzer();
    }
}
Example #2
0
void UCIEngine::protocolEnd()
{
	if(isAnalyzing()) {
		stopAnalysis();
		m_quitAfterAnalysis = true;
	} else {
		send("quit");
		setActive(false);
	}
}
Example #3
0
bool UCIEngine::stopAnalysis()
{
	if(!isAnalyzing()) {
		return false;
	}
	
	send("stop");
	
	return true;
}
Example #4
0
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);
	}
}
Example #5
0
// ----------------------------------------------------------------------------
//
void SpotifyEngine::removeTrackAnalyzer() {
    if ( isAnalyzing() ) {
        delete m_analyzer;
        m_analyzer = NULL;
    }
}