changeset 232:025065fd5b49

Merge from debug-output branch
author Chris Cannam
date Tue, 14 Jun 2011 14:49:22 +0100
parents 85e59c901de9 (current diff) 8c13e8219903 (diff)
children 8aace2d9f1c2
files
diffstat 12 files changed, 155 insertions(+), 156 deletions(-) [+]
line wrap: on
line diff
--- a/audioio/AudioCallbackPlaySource.cpp	Thu Apr 14 15:21:41 2011 +0100
+++ b/audioio/AudioCallbackPlaySource.cpp	Tue Jun 14 14:49:22 2011 +0100
@@ -101,7 +101,7 @@
 AudioCallbackPlaySource::~AudioCallbackPlaySource()
 {
 #ifdef DEBUG_AUDIO_PLAY_SOURCE
-    std::cerr << "AudioCallbackPlaySource::~AudioCallbackPlaySource entering" << std::endl;
+    DEBUG << "AudioCallbackPlaySource::~AudioCallbackPlaySource entering" << endl;
 #endif
     m_exiting = true;
 
@@ -136,7 +136,7 @@
     m_bufferScavenger.scavenge(true);
     m_pluginScavenger.scavenge(true);
 #ifdef DEBUG_AUDIO_PLAY_SOURCE
-    std::cerr << "AudioCallbackPlaySource::~AudioCallbackPlaySource finishing" << std::endl;
+    DEBUG << "AudioCallbackPlaySource::~AudioCallbackPlaySource finishing" << endl;
 #endif
 }
 
@@ -192,7 +192,7 @@
                 if (wfm && wfm != dtvm &&
                     wfm->getSampleRate() != model->getSampleRate() &&
                     wfm->getSampleRate() == m_sourceSampleRate) {
-                    std::cerr << "AudioCallbackPlaySource::addModel: Conflicting wave file model " << *i << " found" << std::endl;
+                    DEBUG << "AudioCallbackPlaySource::addModel: Conflicting wave file model " << *i << " found" << endl;
                     conflicting = true;
                     break;
                 }
@@ -200,12 +200,12 @@
 
             if (conflicting) {
 
-                std::cerr << "AudioCallbackPlaySource::addModel: ERROR: "
-                          << "New model sample rate does not match" << std::endl
+                DEBUG << "AudioCallbackPlaySource::addModel: ERROR: "
+                          << "New model sample rate does not match" << endl
                           << "existing model(s) (new " << model->getSampleRate()
                           << " vs " << m_sourceSampleRate
                           << "), playback will be wrong"
-                          << std::endl;
+                          << endl;
                 
                 emit sampleRateMismatch(model->getSampleRate(),
                                         m_sourceSampleRate,
@@ -266,7 +266,7 @@
 AudioCallbackPlaySource::modelChanged(size_t startFrame, size_t endFrame)
 {
 #ifdef DEBUG_AUDIO_PLAY_SOURCE
-    std::cerr << "AudioCallbackPlaySource::modelChanged(" << startFrame << "," << endFrame << ")" << std::endl;
+    DEBUG << "AudioCallbackPlaySource::modelChanged(" << startFrame << "," << endFrame << ")" << endl;
 #endif
     if (endFrame > m_lastModelEndFrame) {
         m_lastModelEndFrame = endFrame;
@@ -384,11 +384,11 @@
     if (m_viewManager->getPlaySelectionMode() &&
 	!m_viewManager->getSelections().empty()) {
 
-        std::cerr << "AudioCallbackPlaySource::play: constraining frame " << startFrame << " to selection = ";
+        DEBUG << "AudioCallbackPlaySource::play: constraining frame " << startFrame << " to selection = ";
 
         startFrame = m_viewManager->constrainFrameToSelection(startFrame);
 
-        std::cerr << startFrame << std::endl;
+        DEBUG << startFrame << endl;
 
     } else {
 	if (startFrame >= m_lastModelEndFrame) {
@@ -466,7 +466,7 @@
 AudioCallbackPlaySource::stop()
 {
 #ifdef DEBUG_AUDIO_PLAY_SOURCE
-    std::cerr << "AudioCallbackPlaySource::stop()" << std::endl;
+    DEBUG << "AudioCallbackPlaySource::stop()" << endl;
 #endif
     bool changed = m_playing;
     m_playing = false;
@@ -555,10 +555,10 @@
         m_blockSize = size;
     }
     if (size * 4 > m_ringBufferSize) {
-        std::cerr << "AudioCallbackPlaySource::setTarget: Buffer size "
+        DEBUG << "AudioCallbackPlaySource::setTarget: Buffer size "
                   << size << " > a quarter of ring buffer size "
                   << m_ringBufferSize << ", calling for more ring buffer"
-                  << std::endl;
+                  << endl;
         m_ringBufferSize = size * 4;
         if (m_writeBuffers && !m_writeBuffers->empty()) {
             clearRingBuffers();
@@ -848,7 +848,7 @@
     MultiSelection::SelectionList::const_iterator i;
 
 #ifdef DEBUG_AUDIO_PLAY_SOURCE
-    std::cerr << "AudioCallbackPlaySource::rebuildRangeLists" << std::endl;
+    DEBUG << "AudioCallbackPlaySource::rebuildRangeLists" << endl;
 #endif
 
     if (!selections.empty()) {
@@ -968,8 +968,8 @@
     m_resampleQuality = q;
 
 #ifdef DEBUG_AUDIO_PLAY_SOURCE
-    std::cerr << "AudioCallbackPlaySource::setResampleQuality: setting to "
-              << m_resampleQuality << std::endl;
+    DEBUG << "AudioCallbackPlaySource::setResampleQuality: setting to "
+              << m_resampleQuality << endl;
 #endif
 
     initialiseConverter();
@@ -1068,7 +1068,7 @@
 
     if (!m_playing) {
 #ifdef DEBUG_AUDIO_PLAY_SOURCE_PLAYING
-        std::cerr << "AudioCallbackPlaySource::getSourceSamples: Not playing" << std::endl;
+        DEBUG << "AudioCallbackPlaySource::getSourceSamples: Not playing" << endl;
 #endif
 	for (size_t ch = 0; ch < getTargetChannelCount(); ++ch) {
 	    for (int i = 0; i < count; ++i) {
@@ -1079,7 +1079,7 @@
     }
 
 #ifdef DEBUG_AUDIO_PLAY_SOURCE_PLAYING
-    std::cerr << "AudioCallbackPlaySource::getSourceSamples: Playing" << std::endl;
+    DEBUG << "AudioCallbackPlaySource::getSourceSamples: Playing" << endl;
 #endif
 
     // Ensure that all buffers have at least the amount of data we
@@ -1230,8 +1230,8 @@
                 
 #ifdef DEBUG_AUDIO_PLAY_SOURCE_PLAYING
                 if (c == 0) {
-                    std::cerr << "feeding stretcher: got " << gotHere
-                              << ", " << rb->getReadSpace() << " remain" << std::endl;
+                    DEBUG << "feeding stretcher: got " << gotHere
+                              << ", " << rb->getReadSpace() << " remain" << endl;
                 }
 #endif
                 
@@ -1722,7 +1722,7 @@
 		    // OK, we don't have enough and there's more to
 		    // read -- don't unify until we can do better
 #ifdef DEBUG_AUDIO_PLAY_SOURCE_PLAYING
-                    std::cerr << "AudioCallbackPlaySource::unifyRingBuffers: Not unifying: write buffer has less (" << wb->getReadSpace() << ") than " << m_blockSize*2 << " to read and write buffer fill (" << m_writeBufferFill << ") is not close to end frame (" << m_lastModelEndFrame << ")" << std::endl;
+                    DEBUG << "AudioCallbackPlaySource::unifyRingBuffers: Not unifying: write buffer has less (" << wb->getReadSpace() << ") than " << m_blockSize*2 << " to read and write buffer fill (" << m_writeBufferFill << ") is not close to end frame (" << m_lastModelEndFrame << ")" << endl;
 #endif
 		    return;
 		}
@@ -1742,7 +1742,7 @@
     }
     
 #ifdef DEBUG_AUDIO_PLAY_SOURCE_PLAYING
-    std::cerr << "AudioCallbackPlaySource::unifyRingBuffers: m_readBufferFill = " << m_readBufferFill << ", rf = " << rf << ", m_writeBufferFill = " << m_writeBufferFill << std::endl;
+    DEBUG << "AudioCallbackPlaySource::unifyRingBuffers: m_readBufferFill = " << m_readBufferFill << ", rf = " << rf << ", m_writeBufferFill = " << m_writeBufferFill << endl;
 #endif
 
     size_t wf = m_writeBufferFill;
--- a/audioio/AudioGenerator.cpp	Thu Apr 14 15:21:41 2011 +0100
+++ b/audioio/AudioGenerator.cpp	Tue Jun 14 14:49:22 2011 +0100
@@ -66,7 +66,7 @@
 AudioGenerator::~AudioGenerator()
 {
 #ifdef DEBUG_AUDIO_GENERATOR
-    std::cerr << "AudioGenerator::~AudioGenerator" << std::endl;
+    DEBUG << "AudioGenerator::~AudioGenerator" << endl;
 #endif
 }
 
@@ -97,7 +97,7 @@
             std::cerr << "WARNING: AudioGenerator::getSampleDir: "
                       << "Unable to copy " << fileName.toStdString()
                       << " into temporary directory \""
-                      << m_sampleDir.toStdString() << "\"" << std::endl;
+                      << m_sampleDir << "\"" << std::endl;
         } else {
             QFile tf(target);
             tf.setPermissions(tf.permissions() |
@@ -160,7 +160,7 @@
 AudioGenerator::playPluginConfigurationChanged(const Playable *playable,
                                                QString configurationXml)
 {
-//    std::cerr << "AudioGenerator::playPluginConfigurationChanged" << std::endl;
+//    DEBUG << "AudioGenerator::playPluginConfigurationChanged" << endl;
 
     const Model *model = dynamic_cast<const Model *>(playable);
     if (!model) {
@@ -171,7 +171,7 @@
     }
 
     if (m_synthMap.find(model) == m_synthMap.end()) {
-        std::cerr << "AudioGenerator::playPluginConfigurationChanged: We don't know about this plugin" << std::endl;
+        DEBUG << "AudioGenerator::playPluginConfigurationChanged: We don't know about this plugin" << endl;
         return;
     }
 
@@ -240,7 +240,7 @@
 	(pluginId, 0, 0, m_sourceSampleRate, m_pluginBlockSize, m_targetChannelCount);
 
     if (!instance) {
-	std::cerr << "Failed to instantiate plugin " << pluginId.toStdString() << std::endl;
+	std::cerr << "Failed to instantiate plugin " << pluginId << std::endl;
         return 0;
     }
 
@@ -255,7 +255,7 @@
         instance->selectProgram(defaultProgram);
     }
     if (program != "") {
-//        std::cerr << "now selecting desired program " << program.toStdString() << std::endl;
+//        std::cerr << "now selecting desired program " << program << std::endl;
         instance->selectProgram(program.toStdString());
     }
     instance->setIdealChannelCount(m_targetChannelCount); // reset!
@@ -309,7 +309,7 @@
 {
     if (m_targetChannelCount == targetChannelCount) return;
 
-//    std::cerr << "AudioGenerator::setTargetChannelCount(" << targetChannelCount << ")" << std::endl;
+//    DEBUG << "AudioGenerator::setTargetChannelCount(" << targetChannelCount << ")" << endl;
 
     QMutexLocker locker(&m_mutex);
     m_targetChannelCount = targetChannelCount;
@@ -464,7 +464,7 @@
 
 	size_t sourceChannel = (c % modelChannels);
 
-//	std::cerr << "mixing channel " << c << " from source channel " << sourceChannel << std::endl;
+//	DEBUG << "mixing channel " << c << " from source channel " << sourceChannel << endl;
 
 	float channelGain = gain;
 	if (pan != 0.0) {
--- a/audioio/AudioJACKTarget.cpp	Thu Apr 14 15:21:41 2011 +0100
+++ b/audioio/AudioJACKTarget.cpp	Tue Jun 14 14:49:22 2011 +0100
@@ -262,7 +262,7 @@
 
 AudioJACKTarget::~AudioJACKTarget()
 {
-    std::cerr << "AudioJACKTarget::~AudioJACKTarget()" << std::endl;
+    DEBUG << "AudioJACKTarget::~AudioJACKTarget()" << endl;
 
     if (m_source) {
         m_source->setTarget(0, m_bufferSize);
@@ -289,7 +289,7 @@
 
     m_client = 0;
 
-    std::cerr << "AudioJACKTarget::~AudioJACKTarget() done" << std::endl;
+    DEBUG << "AudioJACKTarget::~AudioJACKTarget() done" << endl;
 }
 
 void
@@ -351,7 +351,7 @@
     while (ports[physicalPortCount]) ++physicalPortCount;
 
 #ifdef DEBUG_AUDIO_JACK_TARGET    
-    std::cerr << "AudioJACKTarget::sourceModelReplaced: have " << channels << " channels and " << physicalPortCount << " physical ports" << std::endl;
+    DEBUG << "AudioJACKTarget::sourceModelReplaced: have " << channels << " channels and " << physicalPortCount << " physical ports" << endl;
 #endif
 
     while (m_outputs.size() < channels) {
--- a/audioio/AudioPortAudioTarget.cpp	Thu Apr 14 15:21:41 2011 +0100
+++ b/audioio/AudioPortAudioTarget.cpp	Tue Jun 14 14:49:22 2011 +0100
@@ -113,7 +113,7 @@
 
 AudioPortAudioTarget::~AudioPortAudioTarget()
 {
-    std::cerr << "AudioPortAudioTarget::~AudioPortAudioTarget()" << std::endl;
+    DEBUG << "AudioPortAudioTarget::~AudioPortAudioTarget()" << endl;
 
     if (m_source) {
         m_source->setTarget(0, m_bufferSize);
@@ -123,7 +123,7 @@
 
     if (m_stream) {
 
-        std::cerr << "closing stream" << std::endl;
+        DEBUG << "closing stream" << endl;
 
 	PaError err;
 	err = Pa_CloseStream(m_stream);
@@ -141,14 +141,14 @@
 
     m_stream = 0;
 
-    std::cerr << "AudioPortAudioTarget::~AudioPortAudioTarget() done" << std::endl;
+    DEBUG << "AudioPortAudioTarget::~AudioPortAudioTarget() done" << endl;
 }
 
 void 
 AudioPortAudioTarget::shutdown()
 {
 #ifdef DEBUG_PORT_AUDIO_TARGET
-    std::cerr << "AudioPortAudioTarget::shutdown" << std::endl;
+    DEBUG << "AudioPortAudioTarget::shutdown" << endl;
 #endif
     m_done = true;
 }
@@ -190,12 +190,12 @@
                               PaStreamCallbackFlags)
 {
 #ifdef DEBUG_AUDIO_PORT_AUDIO_TARGET    
-    std::cerr << "AudioPortAudioTarget::process(" << nframes << ")" << std::endl;
+    DEBUG << "AudioPortAudioTarget::process(" << nframes << ")" << endl;
 #endif
 
     if (!m_source || m_done) {
 #ifdef DEBUG_AUDIO_PORT_AUDIO_TARGET
-        std::cerr << "AudioPortAudioTarget::process: Doing nothing, no source or application done" << std::endl;
+        DEBUG << "AudioPortAudioTarget::process: Doing nothing, no source or application done" << endl;
 #endif
         return 0;
     }
@@ -205,9 +205,9 @@
         sched_param param;
         param.sched_priority = 20;
         if (pthread_setschedparam(pthread_self(), SCHED_RR, &param)) {
-            std::cerr << "AudioPortAudioTarget: NOTE: couldn't set RT scheduling class" << std::endl;
+            DEBUG << "AudioPortAudioTarget: NOTE: couldn't set RT scheduling class" << endl;
         } else {
-            std::cerr << "AudioPortAudioTarget: NOTE: successfully set RT scheduling class" << std::endl;
+            DEBUG << "AudioPortAudioTarget: NOTE: successfully set RT scheduling class" << endl;
         }
 #endif
         m_prioritySet = true;
--- a/audioio/AudioPulseAudioTarget.cpp	Thu Apr 14 15:21:41 2011 +0100
+++ b/audioio/AudioPulseAudioTarget.cpp	Tue Jun 14 14:49:22 2011 +0100
@@ -96,7 +96,7 @@
 
 AudioPulseAudioTarget::~AudioPulseAudioTarget()
 {
-    std::cerr << "AudioPulseAudioTarget::~AudioPulseAudioTarget()" << std::endl;
+    DEBUG << "AudioPulseAudioTarget::~AudioPulseAudioTarget()" << endl;
 
     if (m_source) {
         m_source->setTarget(0, m_bufferSize);
@@ -119,7 +119,7 @@
     m_context = 0;
     m_loop = 0;
 
-    std::cerr << "AudioPulseAudioTarget::~AudioPulseAudioTarget() done" << std::endl;
+    DEBUG << "AudioPulseAudioTarget::~AudioPulseAudioTarget() done" << endl;
 }
 
 void 
@@ -275,8 +275,8 @@
     }
 
 #ifdef DEBUG_AUDIO_PULSE_AUDIO_TARGET_PLAY
-    std::cerr << "calling pa_stream_write with "
-              << nframes * tmpbufch * sizeof(float) << " bytes" << std::endl;
+    DEBUG << "calling pa_stream_write with "
+              << nframes * tmpbufch * sizeof(float) << " bytes" << endl;
 #endif
 
     pa_stream_write(m_stream, output, nframes * tmpbufch * sizeof(float),
@@ -302,7 +302,7 @@
 AudioPulseAudioTarget::streamStateChanged()
 {
 #ifdef DEBUG_AUDIO_PULSE_AUDIO_TARGET
-    std::cerr << "AudioPulseAudioTarget::streamStateChanged" << std::endl;
+    DEBUG << "AudioPulseAudioTarget::streamStateChanged" << endl;
 #endif
     QMutexLocker locker(&m_mutex);
 
@@ -314,7 +314,7 @@
 
         case PA_STREAM_READY:
         {
-            std::cerr << "AudioPulseAudioTarget::streamStateChanged: Ready" << std::endl;
+            DEBUG << "AudioPulseAudioTarget::streamStateChanged: Ready" << endl;
 
             pa_usec_t latency = 0;
             int negative = 0;
@@ -327,13 +327,13 @@
 
             const pa_buffer_attr *attr;
             if (!(attr = pa_stream_get_buffer_attr(m_stream))) {
-                std::cerr << "AudioPulseAudioTarget::streamStateChanged: Cannot query stream buffer attributes" << std::endl;
+                DEBUG << "AudioPulseAudioTarget::streamStateChanged: Cannot query stream buffer attributes" << endl;
                 m_source->setTarget(this, m_bufferSize);
                 m_source->setTargetSampleRate(m_sampleRate);
                 if (latframes != 0) m_source->setTargetPlayLatency(latframes);
             } else {
                 int targetLength = attr->tlength;
-                std::cerr << "AudioPulseAudioTarget::streamStateChanged: stream target length = " << targetLength << std::endl;
+                DEBUG << "AudioPulseAudioTarget::streamStateChanged: stream target length = " << targetLength << endl;
                 m_source->setTarget(this, targetLength);
                 m_source->setTargetSampleRate(m_sampleRate);
                 if (latframes == 0) latframes = targetLength;
@@ -367,7 +367,7 @@
 AudioPulseAudioTarget::contextStateChanged()
 {
 #ifdef DEBUG_AUDIO_PULSE_AUDIO_TARGET
-    std::cerr << "AudioPulseAudioTarget::contextStateChanged" << std::endl;
+    DEBUG << "AudioPulseAudioTarget::contextStateChanged" << endl;
 #endif
     QMutexLocker locker(&m_mutex);
 
@@ -379,8 +379,8 @@
             break;
 
         case PA_CONTEXT_READY:
-            std::cerr << "AudioPulseAudioTarget::contextStateChanged: Ready"
-                      << std::endl;
+            DEBUG << "AudioPulseAudioTarget::contextStateChanged: Ready"
+                      << endl;
 
             m_stream = pa_stream_new(m_context, "stream", &m_spec, 0);
             assert(m_stream); //!!!
@@ -400,7 +400,7 @@
             break;
 
         case PA_CONTEXT_TERMINATED:
-            std::cerr << "AudioPulseAudioTarget::contextStateChanged: Terminated" << std::endl;
+            DEBUG << "AudioPulseAudioTarget::contextStateChanged: Terminated" << endl;
             //!!! do something...
             break;
 
@@ -416,13 +416,13 @@
 void
 AudioPulseAudioTarget::streamOverflowStatic(pa_stream *, void *)
 {
-    std::cerr << "AudioPulseAudioTarget::streamOverflowStatic: Overflow!" << std::endl;
+    DEBUG << "AudioPulseAudioTarget::streamOverflowStatic: Overflow!" << endl;
 }
 
 void
 AudioPulseAudioTarget::streamUnderflowStatic(pa_stream *, void *data)
 {
-    std::cerr << "AudioPulseAudioTarget::streamUnderflowStatic: Underflow!" << std::endl;
+    DEBUG << "AudioPulseAudioTarget::streamUnderflowStatic: Underflow!" << endl;
     AudioPulseAudioTarget *target = (AudioPulseAudioTarget *)data;
     if (target && target->m_source) {
         target->m_source->audioProcessingOverload();
--- a/audioio/AudioTargetFactory.cpp	Thu Apr 14 15:21:41 2011 +0100
+++ b/audioio/AudioTargetFactory.cpp	Tue Jun 14 14:49:22 2011 +0100
@@ -135,7 +135,7 @@
 #endif
 
         if (!target || !target->isOK()) {
-            std::cerr << "WARNING: AudioTargetFactory::createCallbackTarget: Failed to open the requested target (\"" << m_default.toStdString() << "\")" << std::endl;
+            std::cerr << "WARNING: AudioTargetFactory::createCallbackTarget: Failed to open the requested target (\"" << m_default << "\")" << std::endl;
             delete target;
             return 0;
         } else {
--- a/audioio/AudioTargetFactory.h	Thu Apr 14 15:21:41 2011 +0100
+++ b/audioio/AudioTargetFactory.h	Tue Jun 14 14:49:22 2011 +0100
@@ -19,6 +19,8 @@
 #include <vector>
 #include <QString>
 
+#include "base/Debug.h"
+
 class AudioCallbackPlaySource;
 class AudioCallbackPlayTarget;
 
--- a/framework/Document.cpp	Thu Apr 14 15:21:41 2011 +0100
+++ b/framework/Document.cpp	Tue Jun 14 14:49:22 2011 +0100
@@ -63,23 +63,23 @@
     CommandHistory::getInstance()->clear();
     
 #ifdef DEBUG_DOCUMENT
-    std::cerr << "Document::~Document: about to delete layers" << std::endl;
+    DEBUG << "Document::~Document: about to delete layers" << endl;
 #endif
     while (!m_layers.empty()) {
 	deleteLayer(*m_layers.begin(), true);
     }
 
     if (!m_models.empty()) {
-	std::cerr << "Document::~Document: WARNING: " 
+	DEBUG << "Document::~Document: WARNING: " 
 		  << m_models.size() << " model(s) still remain -- "
 		  << "should have been garbage collected when deleting layers"
-		  << std::endl;
+		  << endl;
 	while (!m_models.empty()) {
             Model *model = m_models.begin()->first;
 	    if (model == m_mainModel) {
 		// just in case!
-		std::cerr << "Document::~Document: WARNING: Main model is also"
-			  << " in models list!" << std::endl;
+		DEBUG << "Document::~Document: WARNING: Main model is also"
+			  << " in models list!" << endl;
 	    } else if (model) {
                 model->aboutToDelete();
 		emit modelAboutToBeDeleted(model);
@@ -90,8 +90,8 @@
     }
 
 #ifdef DEBUG_DOCUMENT
-    std::cerr << "Document::~Document: About to get rid of main model"
-	      << std::endl;
+    DEBUG << "Document::~Document: About to get rid of main model"
+	      << endl;
 #endif
     if (m_mainModel) {
         m_mainModel->aboutToDelete();
@@ -114,8 +114,8 @@
     m_layers.insert(newLayer);
 
 #ifdef DEBUG_DOCUMENT
-    std::cerr << "Document::createLayer: Added layer of type " << type
-              << ", now have " << m_layers.size() << " layers" << std::endl;
+    DEBUG << "Document::createLayer: Added layer of type " << type
+              << ", now have " << m_layers.size() << " layers" << endl;
 #endif
 
     emit layerAdded(newLayer);
@@ -160,8 +160,8 @@
     m_layers.insert(newLayer);
 
 #ifdef DEBUG_DOCUMENT
-    std::cerr << "Document::createImportedLayer: Added layer of type " << type
-              << ", now have " << m_layers.size() << " layers" << std::endl;
+    DEBUG << "Document::createImportedLayer: Added layer of type " << type
+              << ", now have " << m_layers.size() << " layers" << endl;
 #endif
 
     emit layerAdded(newLayer);
@@ -220,7 +220,7 @@
 	LayerFactory::getInstance()->getValidLayerTypes(newModel);
 
     if (types.empty()) {
-	std::cerr << "WARNING: Document::createLayerForTransformer: no valid display layer for output of transform " << transform.getIdentifier().toStdString() << std::endl;
+	std::cerr << "WARNING: Document::createLayerForTransformer: no valid display layer for output of transform " << transform.getIdentifier() << std::endl;
         newModel->aboutToDelete();
         emit modelAboutToBeDeleted(newModel);
         m_models.erase(newModel);
@@ -282,8 +282,8 @@
     // delete any of the models.
 
 #ifdef DEBUG_DOCUMENT
-    std::cerr << "Document::setMainModel: Have "
-              << m_layers.size() << " layers" << std::endl;
+    DEBUG << "Document::setMainModel: Have "
+              << m_layers.size() << " layers" << endl;
     std::cerr << "Models now: ";
     for (ModelMap::const_iterator i = m_models.begin(); i != m_models.end(); ++i) {
         std::cerr << i->first << " ";
@@ -297,9 +297,9 @@
 	Model *model = layer->getModel();
 
 #ifdef DEBUG_DOCUMENT
-        std::cerr << "Document::setMainModel: inspecting model "
-                  << (model ? model->objectName().toStdString() : "(null)") << " in layer "
-                  << layer->objectName().toStdString() << std::endl;
+        DEBUG << "Document::setMainModel: inspecting model "
+                  << (model ? model->objectName(): "(null)") << " in layer "
+                  << layer->objectName() << endl;
 #endif
 
 	if (model == oldMainModel) {
@@ -351,7 +351,7 @@
 	    
 	    if (!replacementModel) {
 		std::cerr << "WARNING: Document::setMainModel: Failed to regenerate model for transform \""
-			  << transformId.toStdString() << "\"" << " in layer " << layer << std::endl;
+			  << transformId << "\"" << " in layer " << layer << std::endl;
                 if (failedTransformers.find(transformId)
                     == failedTransformers.end()) {
                     emit modelRegenerationFailed(layer->objectName(),
@@ -367,12 +367,12 @@
                                                   message);
                 }
 #ifdef DEBUG_DOCUMENT
-                std::cerr << "Replacing model " << model << " (type "
+                DEBUG << "Replacing model " << model << " (type "
                           << typeid(*model).name() << ") with model "
                           << replacementModel << " (type "
                           << typeid(*replacementModel).name() << ") in layer "
-                          << layer << " (name " << layer->objectName().toStdString() << ")"
-                          << std::endl;
+                          << layer << " (name " << layer->objectName() << ")"
+                          << endl;
 #endif
                 RangeSummarisableTimeValueModel *rm =
                     dynamic_cast<RangeSummarisableTimeValueModel *>(replacementModel);
@@ -397,8 +397,8 @@
         Model *m = i->first;
 
 #ifdef DEBUG_DOCUMENT
-        std::cerr << "considering alignment for model " << m << " (name \""
-                  << m->objectName().toStdString() << "\")" << std::endl;
+        DEBUG << "considering alignment for model " << m << " (name \""
+                  << m->objectName() << "\")" << endl;
 #endif
 
         if (m_autoAlignment) {
@@ -438,7 +438,7 @@
     }
 
 #ifdef DEBUG_DOCUMENT
-    std::cerr << "Document::addDerivedModel: source is " << input.getModel() << " \"" << input.getModel()->objectName().toStdString() << "\"" << std::endl;
+    DEBUG << "Document::addDerivedModel: source is " << input.getModel() << " \"" << input.getModel()->objectName() << "\"" << endl;
 #endif
 
     ModelRecord rec;
@@ -452,7 +452,7 @@
     m_models[outputModelToAdd] = rec;
 
 #ifdef DEBUG_DOCUMENT
-    std::cerr << "Document::addDerivedModel: Added model " << outputModelToAdd << std::endl;
+    DEBUG << "Document::addDerivedModel: Added model " << outputModelToAdd << endl;
     std::cerr << "Models now: ";
     for (ModelMap::const_iterator i = m_models.begin(); i != m_models.end(); ++i) {
         std::cerr << i->first << " ";
@@ -480,7 +480,7 @@
     m_models[model] = rec;
 
 #ifdef DEBUG_DOCUMENT
-    std::cerr << "Document::addImportedModel: Added model " << model << std::endl;
+    DEBUG << "Document::addImportedModel: Added model " << model << endl;
     std::cerr << "Models now: ";
     for (ModelMap::const_iterator i = m_models.begin(); i != m_models.end(); ++i) {
         std::cerr << i->first << " ";
@@ -526,7 +526,7 @@
          .getPluginVersion());
 
     if (!model) {
-	std::cerr << "WARNING: Document::addDerivedModel: no output model for transform " << transform.getIdentifier().toStdString() << std::endl;
+	std::cerr << "WARNING: Document::addDerivedModel: no output model for transform " << transform.getIdentifier() << std::endl;
     } else {
 	addDerivedModel(applied, input, model);
     }
@@ -575,10 +575,10 @@
 	}
 
 	if (sourceCount > 0) {
-	    std::cerr << "Document::releaseModel: Deleting model "
+	    DEBUG << "Document::releaseModel: Deleting model "
 		      << model << " even though it is source for "
 		      << sourceCount << " other derived model(s) -- resetting "
-		      << "their source fields appropriately" << std::endl;
+		      << "their source fields appropriately" << endl;
 	}
 
         model->aboutToDelete();
@@ -586,7 +586,7 @@
 	m_models.erase(model);
 
 #ifdef DEBUG_DOCUMENT
-        std::cerr << "Document::releaseModel: Deleted model " << model << std::endl;
+        DEBUG << "Document::releaseModel: Deleted model " << model << endl;
         std::cerr << "Models now: ";
         for (ModelMap::const_iterator i = m_models.begin(); i != m_models.end(); ++i) {
             std::cerr << i->first << " ";
@@ -605,7 +605,7 @@
 	m_layerViewMap[layer].size() > 0) {
 
 	std::cerr << "WARNING: Document::deleteLayer: Layer "
-		  << layer << " [" << layer->objectName().toStdString() << "]"
+		  << layer << " [" << layer->objectName() << "]"
 		  << " is still used in " << m_layerViewMap[layer].size()
 		  << " views!" << std::endl;
 
@@ -630,18 +630,18 @@
     }
 
     if (m_layers.find(layer) == m_layers.end()) {
-	std::cerr << "Document::deleteLayer: Layer "
+	DEBUG << "Document::deleteLayer: Layer "
                   << layer << " (" << typeid(layer).name() <<
                   ") does not exist, or has already been deleted "
-		  << "(this may not be as serious as it sounds)" << std::endl;
+		  << "(this may not be as serious as it sounds)" << endl;
 	return;
     }
 
     m_layers.erase(layer);
 
 #ifdef DEBUG_DOCUMENT
-    std::cerr << "Document::deleteLayer: Removing, now have "
-              << m_layers.size() << " layers" << std::endl;
+    DEBUG << "Document::deleteLayer: Removing, now have "
+              << m_layers.size() << " layers" << endl;
 #endif
 
     releaseModel(layer->getModel());
@@ -667,12 +667,11 @@
     Model *previousModel = layer->getModel();
 
     if (previousModel == model) {
-        std::cerr << "NOTE: Document::setModel: Layer " << layer << " (\""
-                  << layer->objectName().toStdString()
-                  << "\") is already set to model "
+        DEBUG << "NOTE: Document::setModel: Layer " << layer << " (\""
+                  << layer->objectName()                  << "\") is already set to model "
                   << model << " (\""
-                  << (model ? model->objectName().toStdString() : "(null)")
-                  << "\")" << std::endl;
+                  << (model ? model->objectName(): "(null)")
+                  << "\")" << endl;
         return;
     }
 
@@ -704,10 +703,9 @@
     Model *model = layer->getModel();
     if (!model) {
 #ifdef DEBUG_DOCUMENT
-	std::cerr << "Document::addLayerToView: Layer (\""
-                  << layer->objectName().toStdString()
-                  << "\") with no model being added to view: "
-                  << "normally you want to set the model first" << std::endl;
+	DEBUG << "Document::addLayerToView: Layer (\""
+                  << layer->objectName()                  << "\") with no model being added to view: "
+                  << "normally you want to set the model first" << endl;
 #endif
     } else {
 	if (model != m_mainModel &&
@@ -850,7 +848,7 @@
     if (!rm) return;
 
     if (rm->getAlignmentReference() == m_mainModel) {
-        std::cerr << "Document::alignModel: model " << rm << " is already aligned to main model " << m_mainModel << std::endl;
+        DEBUG << "Document::alignModel: model " << rm << " is already aligned to main model " << m_mainModel << endl;
         return;
     }
     
@@ -859,7 +857,7 @@
         // it possible to distinguish between the reference and any
         // unaligned model just by looking at the model itself,
         // without also knowing what the main model is
-        std::cerr << "Document::alignModel(" << model << "): is main model, setting appropriately" << std::endl;
+        DEBUG << "Document::alignModel(" << model << "): is main model, setting appropriately" << endl;
         rm->setAlignment(new AlignmentModel(model, model, 0, 0));
         return;
     }
@@ -904,7 +902,7 @@
     transform.setStepSize(transform.getBlockSize()/2);
     transform.setParameter("serialise", 1);
 
-    std::cerr << "Document::alignModel: Alignment transform step size " << transform.getStepSize() << ", block size " << transform.getBlockSize() << std::endl;
+    DEBUG << "Document::alignModel: Alignment transform step size " << transform.getStepSize() << ", block size " << transform.getBlockSize() << endl;
 
     ModelTransformerFactory *mtf = ModelTransformerFactory::getInstance();
 
@@ -958,7 +956,7 @@
 Document::AddLayerCommand::~AddLayerCommand()
 {
 #ifdef DEBUG_DOCUMENT
-    std::cerr << "Document::AddLayerCommand::~AddLayerCommand" << std::endl;
+    DEBUG << "Document::AddLayerCommand::~AddLayerCommand" << endl;
 #endif
     if (!m_added) {
 	m_d->deleteLayer(m_layer);
@@ -969,8 +967,8 @@
 Document::AddLayerCommand::getName() const
 {
 #ifdef DEBUG_DOCUMENT
-    std::cerr << "Document::AddLayerCommand::getName(): Name is "
-              << m_name.toStdString() << std::endl;
+    DEBUG << "Document::AddLayerCommand::getName(): Name is "
+              << m_name << endl;
 #endif
     return m_name;
 }
@@ -1018,7 +1016,7 @@
 Document::RemoveLayerCommand::~RemoveLayerCommand()
 {
 #ifdef DEBUG_DOCUMENT
-    std::cerr << "Document::RemoveLayerCommand::~RemoveLayerCommand" << std::endl;
+    DEBUG << "Document::RemoveLayerCommand::~RemoveLayerCommand" << endl;
 #endif
     if (!m_added) {
 	m_d->deleteLayer(m_layer);
@@ -1029,8 +1027,8 @@
 Document::RemoveLayerCommand::getName() const
 {
 #ifdef DEBUG_DOCUMENT
-    std::cerr << "Document::RemoveLayerCommand::getName(): Name is "
-              << m_name.toStdString() << std::endl;
+    DEBUG << "Document::RemoveLayerCommand::getName(): Name is "
+              << m_name << endl;
 #endif
     return m_name;
 }
--- a/framework/MainWindowBase.cpp	Thu Apr 14 15:21:41 2011 +0100
+++ b/framework/MainWindowBase.cpp	Tue Jun 14 14:49:22 2011 +0100
@@ -234,7 +234,7 @@
 
 MainWindowBase::~MainWindowBase()
 {
-    std::cerr << "MainWindowBase::~MainWindowBase" << std::endl;
+    DEBUG << "MainWindowBase::~MainWindowBase" << endl;
     if (m_playTarget) m_playTarget->shutdown();
 //    delete m_playTarget;
     delete m_playSource;
@@ -427,7 +427,7 @@
 void
 MainWindowBase::documentModified()
 {
-//    std::cerr << "MainWindowBase::documentModified" << std::endl;
+//    DEBUG << "MainWindowBase::documentModified" << endl;
 
     if (!m_documentModified) {
         //!!! this in subclass implementation?
@@ -441,7 +441,7 @@
 void
 MainWindowBase::documentRestored()
 {
-//    std::cerr << "MainWindowBase::documentRestored" << std::endl;
+//    DEBUG << "MainWindowBase::documentRestored" << endl;
 
     if (m_documentModified) {
         //!!! this in subclass implementation?
@@ -1073,7 +1073,7 @@
 MainWindowBase::FileOpenStatus
 MainWindowBase::openAudio(FileSource source, AudioFileOpenMode mode, QString templateName)
 {
-//    std::cerr << "MainWindowBase::openAudio(" << source.getLocation().toStdString() << ")" << std::endl;
+//    DEBUG << "MainWindowBase::openAudio(" << source.getLocation() << ")" << endl;
 
     if (!source.isAvailable()) return FileOpenFailed;
     source.waitForData();
@@ -1158,7 +1158,7 @@
     bool loadedTemplate = false;
     if ((mode == ReplaceMainModel) && (templateName.length() != 0)) {
         QString tplPath = "file::templates/" + templateName + ".xml";
-        std::cerr << "SV looking for template " << tplPath.toStdString() << std::endl;
+        std::cerr << "SV looking for template " << tplPath << std::endl;
         FileOpenStatus tplStatus = openSessionFile(tplPath);
         if(tplStatus != FileOpenFailed) {
             loadedTemplate = true;
@@ -1280,7 +1280,7 @@
 MainWindowBase::FileOpenStatus
 MainWindowBase::openPlaylist(FileSource source, AudioFileOpenMode mode)
 {
-    std::cerr << "MainWindowBase::openPlaylist(" << source.getLocation().toStdString() << ")" << std::endl;
+    DEBUG << "MainWindowBase::openPlaylist(" << source.getLocation() << ")" << endl;
 
     std::set<QString> extensions;
     PlaylistFileReader::getSupportedExtensions(extensions);
@@ -1321,7 +1321,7 @@
 MainWindowBase::FileOpenStatus
 MainWindowBase::openLayer(FileSource source)
 {
-    std::cerr << "MainWindowBase::openLayer(" << source.getLocation().toStdString() << ")" << std::endl;
+    DEBUG << "MainWindowBase::openLayer(" << source.getLocation() << ")" << endl;
 
     Pane *pane = m_paneStack->getCurrentPane();
     
@@ -1382,7 +1382,7 @@
             std::cerr << "ERROR: MainWindowBase::openLayer("
                       << source.getLocation().toStdString()
                       << "): Failed to read XML file: "
-                      << reader.getErrorString().toStdString() << std::endl;
+                      << reader.getErrorString() << std::endl;
             return FileOpenFailed;
         }
 
@@ -1418,7 +1418,7 @@
 
             if (model) {
 
-                std::cerr << "MainWindowBase::openLayer: Have model" << std::endl;
+                DEBUG << "MainWindowBase::openLayer: Have model" << endl;
 
                 emit activity(tr("Import MIDI file \"%1\"").arg(source.getLocation()));
 
@@ -1453,7 +1453,7 @@
 MainWindowBase::FileOpenStatus
 MainWindowBase::openImage(FileSource source)
 {
-    std::cerr << "MainWindowBase::openImage(" << source.getLocation().toStdString() << ")" << std::endl;
+    DEBUG << "MainWindowBase::openImage(" << source.getLocation() << ")" << endl;
 
     Pane *pane = m_paneStack->getCurrentPane();
     
@@ -1485,7 +1485,7 @@
 
     // We don't put the image file in Recent Files
 
-    std::cerr << "openImage: trying location \"" << source.getLocation().toStdString() << "\" in image layer" << std::endl;
+    std::cerr << "openImage: trying location \"" << source.getLocation() << "\" in image layer" << std::endl;
 
     if (!il->addImage(m_viewManager->getGlobalCentreFrame(), source.getLocation())) {
         if (newLayer) {
@@ -1513,7 +1513,7 @@
 MainWindowBase::FileOpenStatus
 MainWindowBase::openSession(FileSource source)
 {
-    std::cerr << "MainWindowBase::openSession(" << source.getLocation().toStdString() << ")" << std::endl;
+    DEBUG << "MainWindowBase::openSession(" << source.getLocation() << ")" << endl;
 
     if (!source.isAvailable()) return FileOpenFailed;
     source.waitForData();
@@ -1633,7 +1633,7 @@
 MainWindowBase::FileOpenStatus
 MainWindowBase::openSessionFromRDF(FileSource source)
 {
-    std::cerr << "MainWindowBase::openSessionFromRDF(" << source.getLocation().toStdString() << ")" << std::endl;
+    DEBUG << "MainWindowBase::openSessionFromRDF(" << source.getLocation() << ")" << endl;
 
     if (!source.isAvailable()) return FileOpenFailed;
     source.waitForData();
@@ -1664,7 +1664,7 @@
 {
     size_t rate = 0;
 
-    std::cerr << "MainWindowBase::openLayersFromRDF" << std::endl;
+    DEBUG << "MainWindowBase::openLayersFromRDF" << endl;
 
     ProgressDialog dialog(tr("Importing from RDF..."), true, 2000, this);
     connect(&dialog, SIGNAL(showing()), this, SIGNAL(hideSplash()));
@@ -1901,7 +1901,7 @@
             std::cerr << "Failed to open session file \""
                       << temp.getTemporaryFilename().toStdString()
                       << "\" for writing: "
-                      << bzFile.errorString().toStdString() << std::endl;
+                      << bzFile.errorString() << std::endl;
             return false;
         }
 
@@ -2587,7 +2587,7 @@
         //!!! how to prevent this function from being active if not
         //appropriate model type?  or will we ultimately support
         //tabular display for all editable models?
-        std::cerr << "NOTE: Not a tabular model" << std::endl;
+        DEBUG << "NOTE: Not a tabular model" << endl;
         return;
     }
 
@@ -2769,7 +2769,7 @@
 void
 MainWindowBase::viewCentreFrameChanged(View *v, unsigned long frame)
 {
-//    std::cerr << "MainWindowBase::viewCentreFrameChanged(" << v << "," << frame << ")" << std::endl;
+//    DEBUG << "MainWindowBase::viewCentreFrameChanged(" << v << "," << frame << ")" << endl;
 
     if (m_viewDataDialogMap.find(v) != m_viewDataDialogMap.end()) {
         for (DataDialogSet::iterator i = m_viewDataDialogMap[v].begin();
@@ -2795,21 +2795,21 @@
 void
 MainWindowBase::layerAdded(Layer *)
 {
-//    std::cerr << "MainWindowBase::layerAdded(" << layer << ")" << std::endl;
+//    DEBUG << "MainWindowBase::layerAdded(" << layer << ")" << endl;
     updateMenuStates();
 }
 
 void
 MainWindowBase::layerRemoved(Layer *)
 {
-//    std::cerr << "MainWindowBase::layerRemoved(" << layer << ")" << std::endl;
+//    DEBUG << "MainWindowBase::layerRemoved(" << layer << ")" << endl;
     updateMenuStates();
 }
 
 void
 MainWindowBase::layerAboutToBeDeleted(Layer *layer)
 {
-//    std::cerr << "MainWindowBase::layerAboutToBeDeleted(" << layer << ")" << std::endl;
+//    DEBUG << "MainWindowBase::layerAboutToBeDeleted(" << layer << ")" << endl;
 
     removeLayerEditDialog(layer);
 
@@ -2822,7 +2822,7 @@
 void
 MainWindowBase::layerInAView(Layer *layer, bool inAView)
 {
-//    std::cerr << "MainWindowBase::layerInAView(" << layer << "," << inAView << ")" << std::endl;
+//    DEBUG << "MainWindowBase::layerInAView(" << layer << "," << inAView << ")" << endl;
 
     if (!inAView) removeLayerEditDialog(layer);
 
@@ -2876,14 +2876,14 @@
 void
 MainWindowBase::modelAdded(Model *model)
 {
-//    std::cerr << "MainWindowBase::modelAdded(" << model << ")" << std::endl;
+//    DEBUG << "MainWindowBase::modelAdded(" << model << ")" << endl;
     m_playSource->addModel(model);
 }
 
 void
 MainWindowBase::mainModelChanged(WaveFileModel *model)
 {
-//    std::cerr << "MainWindowBase::mainModelChanged(" << model << ")" << std::endl;
+//    DEBUG << "MainWindowBase::mainModelChanged(" << model << ")" << endl;
     updateDescriptionLabel();
     if (model) m_viewManager->setMainModelSampleRate(model->getSampleRate());
     if (model && !m_playTarget && m_audioOutput) createPlayTarget();
@@ -2892,7 +2892,7 @@
 void
 MainWindowBase::modelAboutToBeDeleted(Model *model)
 {
-//    std::cerr << "MainWindowBase::modelAboutToBeDeleted(" << model << ")" << std::endl;
+//    DEBUG << "MainWindowBase::modelAboutToBeDeleted(" << model << ")" << endl;
     if (model == m_viewManager->getPlaybackModel()) {
         m_viewManager->setPlaybackModel(0);
     }
@@ -2911,8 +2911,8 @@
         }
     }
     if (!found) {
-        std::cerr << "MainWindowBase::paneDeleteButtonClicked: Unknown pane "
-                  << pane << std::endl;
+        DEBUG << "MainWindowBase::paneDeleteButtonClicked: Unknown pane "
+                  << pane << endl;
         return;
     }
 
@@ -2940,7 +2940,7 @@
 MainWindowBase::pollOSC()
 {
     if (!m_oscQueue || m_oscQueue->isEmpty()) return;
-    std::cerr << "MainWindowBase::pollOSC: have " << m_oscQueue->getMessagesAvailable() << " messages" << std::endl;
+    DEBUG << "MainWindowBase::pollOSC: have " << m_oscQueue->getMessagesAvailable() << " messages" << endl;
 
     if (m_openingAudioFile) return;
 
--- a/framework/SVFileReader.cpp	Thu Apr 14 15:21:41 2011 +0100
+++ b/framework/SVFileReader.cpp	Tue Jun 14 14:49:22 2011 +0100
@@ -442,7 +442,7 @@
 
     QString name = attributes.value("name");
 
-    std::cerr << "SVFileReader::readModel: model name \"" << name.toStdString() << "\"" << std::endl;
+    DEBUG << "SVFileReader::readModel: model name \"" << name << "\"" << endl;
 
     READ_MANDATORY(int, sampleRate, toInt);
 
@@ -462,9 +462,9 @@
         file.waitForStatus();
 
         if (!file.isOK()) {
-            std::cerr << "SVFileReader::readModel: Failed to retrieve file \"" << path.toStdString() << "\" for wave file model: " << file.getErrorString().toStdString() << std::endl;
+            std::cerr << "SVFileReader::readModel: Failed to retrieve file \"" << path << "\" for wave file model: " << file.getErrorString() << std::endl;
         } else if (!file.isAvailable()) {
-            std::cerr << "SVFileReader::readModel: Failed to retrieve file \"" << path.toStdString() << "\" for wave file model: Source unavailable" << std::endl;
+            std::cerr << "SVFileReader::readModel: Failed to retrieve file \"" << path << "\" for wave file model: Source unavailable" << std::endl;
         } else {
 
             file.waitForData();
@@ -954,7 +954,7 @@
 
     READ_MANDATORY(int, frame, toInt);
 
-//    std::cerr << "SVFileReader::addPointToDataset: frame = " << frame << std::endl;
+//    DEBUG << "SVFileReader::addPointToDataset: frame = " << frame << endl;
 
     SparseOneDimensionalModel *sodm = dynamic_cast<SparseOneDimensionalModel *>
 	(m_currentDataset);
@@ -1016,7 +1016,7 @@
 	float height = 0.0;
 	height = attributes.value("height").trimmed().toFloat(&ok);
 	QString label = attributes.value("label");
-//        std::cerr << "SVFileReader::addPointToDataset: TextModel: frame = " << frame << ", height = " << height << ", label = " << label.toStdString() << ", ok = " << ok << std::endl;
+//        DEBUG << "SVFileReader::addPointToDataset: TextModel: frame = " << frame << ", height = " << height << ", label = " << label << ", ok = " << ok << endl;
 	tm->addPoint(TextModel::Point(frame, height, label));
 	return ok;
     }
@@ -1026,7 +1026,7 @@
     if (pm) {
 //        std::cerr << "Current dataset is a path model" << std::endl;
         int mapframe = attributes.value("mapframe").trimmed().toInt(&ok);
-//        std::cerr << "SVFileReader::addPointToDataset: PathModel: frame = " << frame << ", mapframe = " << mapframe << ", ok = " << ok << std::endl;
+//        DEBUG << "SVFileReader::addPointToDataset: PathModel: frame = " << frame << ", mapframe = " << mapframe << ", ok = " << ok << endl;
 	pm->addPoint(PathModel::Point(frame, mapframe));
 	return ok;
     }
@@ -1037,7 +1037,7 @@
 //        std::cerr << "Current dataset is an image model" << std::endl;
 	QString image = attributes.value("image");
 	QString label = attributes.value("label");
-//        std::cerr << "SVFileReader::addPointToDataset: ImageModel: frame = " << frame << ", image = " << image.toStdString() << ", label = " << label.toStdString() << ", ok = " << ok << std::endl;
+//        DEBUG << "SVFileReader::addPointToDataset: ImageModel: frame = " << frame << ", image = " << image << ", label = " << label << ", ok = " << ok << endl;
 	im->addPoint(ImageModel::Point(frame, image, label));
 	return ok;
     }
@@ -1185,8 +1185,8 @@
         return true;
     } else {
         m_currentTransformIsNewStyle = false;
-        std::cerr << "NOTE: SV-XML: Reading old-style derivation element"
-                  << std::endl;
+        DEBUG << "NOTE: SV-XML: Reading old-style derivation element"
+                  << endl;
     }
 
     QString transformId = attributes.value("transform");
@@ -1368,8 +1368,8 @@
 bool
 SVFileReader::readMeasurement(const QXmlAttributes &attributes)
 {
-    std::cerr << "SVFileReader::readMeasurement: inLayer "
-              << m_inLayer << ", layer " << m_currentLayer << std::endl;
+    DEBUG << "SVFileReader::readMeasurement: inLayer "
+              << m_inLayer << ", layer " << m_currentLayer << endl;
 
     if (!m_inLayer) {
         std::cerr << "WARNING: SV-XML: Measurement found outside layer" << std::endl;
--- a/framework/TransformUserConfigurator.cpp	Thu Apr 14 15:21:41 2011 +0100
+++ b/framework/TransformUserConfigurator.cpp	Tue Jun 14 14:49:22 2011 +0100
@@ -37,12 +37,12 @@
 {
     if (plugin && plugin->getType() == "Feature Extraction Plugin") {
 	Vamp::Plugin *vp = static_cast<Vamp::Plugin *>(plugin);
-	std::cerr << "TransformUserConfigurator::getChannelRange: is a VP" << std::endl;
+	DEBUG << "TransformUserConfigurator::getChannelRange: is a VP" << endl;
         minChannels = vp->getMinChannelCount();
         maxChannels = vp->getMaxChannelCount();
         return true;
     } else {
-	std::cerr << "TransformUserConfigurator::getChannelRange: is not a VP" << std::endl;
+	DEBUG << "TransformUserConfigurator::getChannelRange: is not a VP" << endl;
         return TransformFactory::getInstance()->
             getTransformChannelRange(identifier, minChannels, maxChannels);
     }
@@ -81,7 +81,7 @@
 	std::vector<Vamp::Plugin::OutputDescriptor> od =
 	    vp->getOutputDescriptors();
 
-	std::cerr << "configure: looking for output: " << output.toStdString() << std::endl;
+	std::cerr << "configure: looking for output: " << output << std::endl;
 
 	if (od.size() > 1) {
 	    for (size_t i = 0; i < od.size(); ++i) {
@@ -119,7 +119,7 @@
             static_cast<RealTimePluginInstance *>(plugin);
 
         if (effect && source) {
-	    std::cerr << "Setting auditioning effect" << std::endl;
+	    DEBUG << "Setting auditioning effect" << endl;
             source->setAuditioningEffect(rtp);
         }
     }
@@ -173,12 +173,12 @@
     if (selectedInput != "") {
 	if (modelMap.contains(selectedInput)) {
 	    inputModel = modelMap.value(selectedInput);
-	    std::cerr << "Found selected input \"" << selectedInput.toStdString() << "\" in model map, result is " << inputModel << std::endl;
+	    std::cerr << "Found selected input \"" << selectedInput << "\" in model map, result is " << inputModel << std::endl;
 	} else {
-	    std::cerr << "Failed to find selected input \"" << selectedInput.toStdString() << "\" in model map" << std::endl;
+	    std::cerr << "Failed to find selected input \"" << selectedInput << "\" in model map" << std::endl;
 	}
     } else {
-	std::cerr << "Selected input empty: \"" << selectedInput.toStdString() << "\"" << std::endl;
+	std::cerr << "Selected input empty: \"" << selectedInput << "\"" << std::endl;
     }
         
     // Write parameters back to transform object
--- a/framework/VersionTester.cpp	Thu Apr 14 15:21:41 2011 +0100
+++ b/framework/VersionTester.cpp	Tue Jun 14 14:49:22 2011 +0100
@@ -19,6 +19,7 @@
 */
 
 #include "VersionTester.h"
+#include "base/Debug.h"
 
 #include <iostream>
 
@@ -87,9 +88,7 @@
     if (lines.empty()) return;
 
     QString latestVersion = lines[0];
-    std::cerr << "Comparing current version \"" << m_myVersion.toStdString()
-              << "\" with latest version \"" << latestVersion.toStdString()
-	      << "\"" << std::endl;
+    DEBUG << "Comparing current version \"" << m_myVersion              << "\" with latest version \"" << latestVersion	      << "\"" << endl;
     if (isVersionNewerThan(latestVersion, m_myVersion)) {
         emit newerVersionAvailable(latestVersion);
     }