Mercurial > hg > svcore
diff data/fft/FFTDataServer.cpp @ 690:1424aa29ae95
Seems to be a bad idea to use plain DEBUG symbol on OS/X (system wants it)
author | Chris Cannam |
---|---|
date | Tue, 14 Jun 2011 15:26:52 +0100 |
parents | 06f13a3b9e9e |
children | 97c53dfaf798 e802e550a1f2 |
line wrap: on
line diff
--- a/data/fft/FFTDataServer.cpp Tue Jun 14 14:47:59 2011 +0100 +++ b/data/fft/FFTDataServer.cpp Tue Jun 14 15:26:52 2011 +0100 @@ -191,7 +191,7 @@ if (server->getFillCompletion() < 50) distance += 100; #ifdef DEBUG_FFT_SERVER - DEBUG << "FFTDataServer::getFuzzyInstance: Distance for server " << server << " is " << distance << ", best is " << bestdist << endl; + SVDEBUG << "FFTDataServer::getFuzzyInstance: Distance for server " << server << " is " << distance << ", best is " << bestdist << endl; #endif if (bestdist == -1 || distance < bestdist) { @@ -204,7 +204,7 @@ if (bestdist >= 0) { FFTDataServer *server = best->second.first; #ifdef DEBUG_FFT_SERVER - DEBUG << "FFTDataServer::getFuzzyInstance: We like server " << server << " (with distance " << bestdist << ")" << endl; + SVDEBUG << "FFTDataServer::getFuzzyInstance: We like server " << server << " (with distance " << bestdist << ")" << endl; #endif claimInstance(server, false); return server; @@ -228,7 +228,7 @@ FFTDataServer::findServer(QString n) { #ifdef DEBUG_FFT_SERVER - DEBUG << "FFTDataServer::findServer(\"" << n << "\")" << endl; + SVDEBUG << "FFTDataServer::findServer(\"" << n << "\")" << endl; #endif if (m_servers.find(n) != m_servers.end()) { @@ -236,7 +236,7 @@ FFTDataServer *server = m_servers[n].first; #ifdef DEBUG_FFT_SERVER - DEBUG << "FFTDataServer::findServer(\"" << n << "\"): found " << server << endl; + SVDEBUG << "FFTDataServer::findServer(\"" << n << "\"): found " << server << endl; #endif claimInstance(server, false); @@ -245,7 +245,7 @@ } #ifdef DEBUG_FFT_SERVER - DEBUG << "FFTDataServer::findServer(\"" << n << "\"): not found" << endl; + SVDEBUG << "FFTDataServer::findServer(\"" << n << "\"): not found" << endl; #endif return 0; @@ -264,7 +264,7 @@ "FFTDataServer::claimInstance::m_serverMapMutex"); #ifdef DEBUG_FFT_SERVER - DEBUG << "FFTDataServer::claimInstance(" << server << ")" << endl; + SVDEBUG << "FFTDataServer::claimInstance(" << server << ")" << endl; #endif for (ServerMap::iterator i = m_servers.begin(); i != m_servers.end(); ++i) { @@ -275,7 +275,7 @@ if (*j == server) { #ifdef DEBUG_FFT_SERVER - DEBUG << "FFTDataServer::claimInstance: found in released server list, removing from it" << endl; + SVDEBUG << "FFTDataServer::claimInstance: found in released server list, removing from it" << endl; #endif m_releasedServers.erase(j); break; @@ -285,7 +285,7 @@ ++i->second.second; #ifdef DEBUG_FFT_SERVER - DEBUG << "FFTDataServer::claimInstance: new refcount is " << i->second.second << endl; + SVDEBUG << "FFTDataServer::claimInstance: new refcount is " << i->second.second << endl; #endif return; @@ -309,7 +309,7 @@ "FFTDataServer::releaseInstance::m_serverMapMutex"); #ifdef DEBUG_FFT_SERVER - DEBUG << "FFTDataServer::releaseInstance(" << server << ")" << endl; + SVDEBUG << "FFTDataServer::releaseInstance(" << server << ")" << endl; #endif // -- if ref count > 0, decrement and return @@ -332,7 +332,7 @@ /*!!! if (server->m_lastUsedCache == -1) { // never used #ifdef DEBUG_FFT_SERVER - DEBUG << "FFTDataServer::releaseInstance: instance " + SVDEBUG << "FFTDataServer::releaseInstance: instance " << server << " has never been used, erasing" << endl; #endif @@ -341,7 +341,7 @@ } else { */ #ifdef DEBUG_FFT_SERVER - DEBUG << "FFTDataServer::releaseInstance: instance " + SVDEBUG << "FFTDataServer::releaseInstance: instance " << server << " no longer in use, marking for possible collection" << endl; #endif @@ -361,7 +361,7 @@ //!!! } } else { #ifdef DEBUG_FFT_SERVER - DEBUG << "FFTDataServer::releaseInstance: instance " + SVDEBUG << "FFTDataServer::releaseInstance: instance " << server << " now has refcount " << i->second.second << endl; #endif @@ -378,7 +378,7 @@ FFTDataServer::purgeLimbo(int maxSize) { #ifdef DEBUG_FFT_SERVER - DEBUG << "FFTDataServer::purgeLimbo(" << maxSize << "): " + SVDEBUG << "FFTDataServer::purgeLimbo(" << maxSize << "): " << m_releasedServers.size() << " candidates" << endl; #endif @@ -389,7 +389,7 @@ bool found = false; #ifdef DEBUG_FFT_SERVER - DEBUG << "FFTDataServer::purgeLimbo: considering candidate " + SVDEBUG << "FFTDataServer::purgeLimbo: considering candidate " << server << endl; #endif @@ -405,7 +405,7 @@ break; } #ifdef DEBUG_FFT_SERVER - DEBUG << "FFTDataServer::purgeLimbo: looks OK, erasing it" + SVDEBUG << "FFTDataServer::purgeLimbo: looks OK, erasing it" << endl; #endif @@ -426,7 +426,7 @@ } #ifdef DEBUG_FFT_SERVER - DEBUG << "FFTDataServer::purgeLimbo(" << maxSize << "): " + SVDEBUG << "FFTDataServer::purgeLimbo(" << maxSize << "): " << m_releasedServers.size() << " remain" << endl; #endif @@ -439,7 +439,7 @@ "FFTDataServer::modelAboutToBeDeleted::m_serverMapMutex"); #ifdef DEBUG_FFT_SERVER - DEBUG << "FFTDataServer::modelAboutToBeDeleted(" << model << ")" + SVDEBUG << "FFTDataServer::modelAboutToBeDeleted(" << model << ")" << endl; #endif @@ -450,7 +450,7 @@ if (server->getModel() == model) { #ifdef DEBUG_FFT_SERVER - DEBUG << "FFTDataServer::modelAboutToBeDeleted: server is " + SVDEBUG << "FFTDataServer::modelAboutToBeDeleted: server is " << server << endl; #endif @@ -463,14 +463,14 @@ j != m_releasedServers.end(); ++j) { if (*j == server) { #ifdef DEBUG_FFT_SERVER - DEBUG << "FFTDataServer::modelAboutToBeDeleted: erasing from released servers" << endl; + SVDEBUG << "FFTDataServer::modelAboutToBeDeleted: erasing from released servers" << endl; #endif m_releasedServers.erase(j); break; } } #ifdef DEBUG_FFT_SERVER - DEBUG << "FFTDataServer::modelAboutToBeDeleted: erasing server" << endl; + SVDEBUG << "FFTDataServer::modelAboutToBeDeleted: erasing server" << endl; #endif m_servers.erase(i); delete server; @@ -841,7 +841,7 @@ // preconditions: m_caches[c] exists and contains a file writer; // m_cacheVectorLock is not locked by this thread #ifdef DEBUG_FFT_SERVER - DEBUG << "FFTDataServer::makeCacheReader(" << c << ")" << endl; + SVDEBUG << "FFTDataServer::makeCacheReader(" << c << ")" << endl; #endif QThread *me = QThread::currentThread(); @@ -875,7 +875,7 @@ cb = m_caches.at(deleteCandidate); if (cb && cb->fileCacheReader.find(me) != cb->fileCacheReader.end()) { #ifdef DEBUG_FFT_SERVER - DEBUG << "FFTDataServer::makeCacheReader: Deleting probably unpopular reader " << deleteCandidate << " for this thread (as I create reader " << c << ")" << endl; + SVDEBUG << "FFTDataServer::makeCacheReader: Deleting probably unpopular reader " << deleteCandidate << " for this thread (as I create reader " << c << ")" << endl; #endif delete cb->fileCacheReader[me]; cb->fileCacheReader.erase(me); @@ -901,7 +901,7 @@ if (!cache->haveSetColumnAt(col)) { Profiler profiler("FFTDataServer::getMagnitudeAt: filling"); #ifdef DEBUG_FFT_SERVER - DEBUG << "FFTDataServer::getMagnitudeAt: calling fillColumn(" + SVDEBUG << "FFTDataServer::getMagnitudeAt: calling fillColumn(" << x << ")" << endl; #endif fillColumn(x); @@ -1130,7 +1130,7 @@ if (!cache->haveSetColumnAt(col)) { Profiler profiler("FFTDataServer::getValuesAt: filling"); #ifdef DEBUG_FFT_SERVER - DEBUG << "FFTDataServer::getValuesAt(" << x << ", " << y << "): filling" << endl; + SVDEBUG << "FFTDataServer::getValuesAt(" << x << ", " << y << "): filling" << endl; #endif fillColumn(x); } @@ -1189,7 +1189,7 @@ /*!!! if (m_lastUsedCache == -1) { if (m_suspended) { - DEBUG << "FFTDataServer::isColumnReady(" << x << "): no cache, calling resume" << endl; + SVDEBUG << "FFTDataServer::isColumnReady(" << x << "): no cache, calling resume" << endl; resume(); } m_fillThread->start(); @@ -1258,7 +1258,7 @@ endFrame -= winsize / 2; #ifdef DEBUG_FFT_SERVER_FILL - DEBUG << "FFTDataServer::fillColumn: requesting frames " + SVDEBUG << "FFTDataServer::fillColumn: requesting frames " << startFrame + pfx << " -> " << endFrame << " ( = " << endFrame - (startFrame + pfx) << ") at index " << off + pfx << " in buffer of size " << m_fftSize @@ -1370,7 +1370,7 @@ } if (m_suspended) { -// DEBUG << "FFTDataServer::fillColumn(" << x << "): calling resume" << endl; +// SVDEBUG << "FFTDataServer::fillColumn(" << x << "): calling resume" << endl; // resume(); } } @@ -1446,7 +1446,7 @@ FFTDataServer::FillThread::run() { #ifdef DEBUG_FFT_SERVER_FILL - DEBUG << "FFTDataServer::FillThread::run()" << endl; + SVDEBUG << "FFTDataServer::FillThread::run()" << endl; #endif m_extent = 0; @@ -1454,7 +1454,7 @@ while (!m_server.m_model->isReady() && !m_server.m_exiting) { #ifdef DEBUG_FFT_SERVER_FILL - DEBUG << "FFTDataServer::FillThread::run(): waiting for model " << m_server.m_model << " to be ready" << endl; + SVDEBUG << "FFTDataServer::FillThread::run(): waiting for model " << m_server.m_model << " to be ready" << endl; #endif sleep(1); } @@ -1476,7 +1476,7 @@ try { m_server.fillColumn(int((f - start) / m_server.m_windowIncrement)); } catch (std::exception &e) { - DEBUG << "FFTDataServer::FillThread::run: exception: " << e.what() << endl; + SVDEBUG << "FFTDataServer::FillThread::run: exception: " << e.what() << endl; m_error = e.what(); m_server.fillComplete(); m_completion = 100; @@ -1525,7 +1525,7 @@ try { m_server.fillColumn(int((f - start) / m_server.m_windowIncrement)); } catch (std::exception &e) { - DEBUG << "FFTDataServer::FillThread::run: exception: " << e.what() << endl; + SVDEBUG << "FFTDataServer::FillThread::run: exception: " << e.what() << endl; m_error = e.what(); m_server.fillComplete(); m_completion = 100; @@ -1567,7 +1567,7 @@ m_extent = end; #ifdef DEBUG_FFT_SERVER - DEBUG << "FFTDataServer::FillThread::run exiting" << endl; + SVDEBUG << "FFTDataServer::FillThread::run exiting" << endl; #endif }