changeset 684:917039d333bb tonioni

Merge from default branch
author Chris Cannam
date Tue, 26 Nov 2013 14:38:48 +0000
parents ced5f158eda7 (current diff) 692a8b9804fe (diff)
children f46da276b21c
files layer/FlexiNoteLayer.cpp layer/LayerFactory.cpp layer/NoteLayer.cpp view/Pane.cpp view/ViewManager.cpp
diffstat 43 files changed, 443 insertions(+), 424 deletions(-) [+]
line wrap: on
line diff
--- a/layer/Colour3DPlotLayer.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/layer/Colour3DPlotLayer.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -689,7 +689,7 @@
 
     float value = m_model->getValueAt(sx0, sy);
 
-//    std::cerr << "bin value (" << sx0 << "," << sy << ") is " << value << std::endl;
+//    cerr << "bin value (" << sx0 << "," << sy << ") is " << value << endl;
     
     QString binName = m_model->getBinName(sy);
     if (binName == "") binName = QString("[%1]").arg(sy + 1);
@@ -786,7 +786,7 @@
                 paint.setPen(QColor(qRed(c), qGreen(c), qBlue(c)));
                 paint.drawLine(5, 11 + y, cw - 5, 11 + y);
             } else {
-                std::cerr << "WARNING: Colour3DPlotLayer::paintVerticalScale: value " << value << ", mmin " << mmin << ", mmax " << mmax << " leads to invalid pixel " << pixel << std::endl;
+                cerr << "WARNING: Colour3DPlotLayer::paintVerticalScale: value " << value << ", mmin " << mmin << ", mmax " << mmax << " leads to invalid pixel " << pixel << endl;
             }
         }
 
@@ -970,7 +970,7 @@
 
     if (m_cacheValidStart <= firstBin && m_cacheValidEnd >= lastBin) {
 #ifdef DEBUG_COLOUR_3D_PLOT_LAYER_PAINT
-        std::cerr << "Cache is valid in this region already" << std::endl;
+        cerr << "Cache is valid in this region already" << endl;
 #endif
         return;
     }
@@ -1006,7 +1006,7 @@
     }
 
 #ifdef DEBUG_COLOUR_3D_PLOT_LAYER_PAINT
-    std::cerr << "Cache size " << cacheWidth << "x" << cacheHeight << " will be valid from " << m_cacheValidStart << " to " << m_cacheValidEnd << std::endl;
+    cerr << "Cache size " << cacheWidth << "x" << cacheHeight << " will be valid from " << m_cacheValidStart << " to " << m_cacheValidEnd << endl;
 #endif
 
     DenseThreeDimensionalModel::Column values;
@@ -1229,7 +1229,7 @@
 
 #ifdef DEBUG_COLOUR_3D_PLOT_LAYER_PAINT
     SVDEBUG << "Colour3DPlotLayer::paint: w " << x1-x0 << ", h " << h << ", sx0 " << sx0 << ", sx1 " << sx1 << ", sw " << sx1-sx0 << ", sh " << sh << endl;
-    std::cerr << "Colour3DPlotLayer: sample rate is " << m_model->getSampleRate() << ", resolution " << m_model->getResolution() << std::endl;
+    cerr << "Colour3DPlotLayer: sample rate is " << m_model->getSampleRate() << ", resolution " << m_model->getResolution() << endl;
 #endif
 
     QPoint illuminatePos;
@@ -1289,8 +1289,8 @@
 	    }
             
 #ifdef DEBUG_COLOUR_3D_PLOT_LAYER_PAINT
-//            std::cerr << "rect " << r.x() << "," << r.y() << " "
-//                      << r.width() << "x" << r.height() << std::endl;
+//            cerr << "rect " << r.x() << "," << r.y() << " "
+//                      << r.width() << "x" << r.height() << endl;
 #endif
 
 	    paint.drawRect(r);
--- a/layer/ColourMapper.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/layer/ColourMapper.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -19,6 +19,8 @@
 
 #include <cmath>
 
+#include "base/Debug.h"
+
 ColourMapper::ColourMapper(int map, float min, float max) :
     QObject(),
     m_map(map),
@@ -26,8 +28,8 @@
     m_max(max)
 {
     if (m_min == m_max) {
-        std::cerr << "WARNING: ColourMapper: min == max (== " << m_min
-                  << "), adjusting" << std::endl;
+        cerr << "WARNING: ColourMapper: min == max (== " << m_min
+                  << "), adjusting" << endl;
         m_max = m_min + 1;
     }
 }
--- a/layer/FlexiNoteLayer.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/layer/FlexiNoteLayer.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -250,7 +250,7 @@
     }
 
 #ifdef DEBUG_NOTE_LAYER
-    std::cerr << "NoteLayer::getDisplayExtents: min = " << min << ", max = " << max << " (m_scaleMinimum = " << m_scaleMinimum << ", m_scaleMaximum = " << m_scaleMaximum << ")" << std::endl;
+    cerr << "NoteLayer::getDisplayExtents: min = " << min << ", max = " << max << " (m_scaleMinimum = " << m_scaleMinimum << ", m_scaleMaximum = " << m_scaleMaximum << ")" << endl;
 #endif
 
     return true;
@@ -273,7 +273,7 @@
     m_scaleMaximum = max;
 
 #ifdef DEBUG_NOTE_LAYER
-    std::cerr << "FlexiNoteLayer::setDisplayExtents: min = " << min << ", max = " << max << std::endl;
+    cerr << "FlexiNoteLayer::setDisplayExtents: min = " << min << ", max = " << max << endl;
 #endif
     
     emit layerParametersChanged();
@@ -339,7 +339,7 @@
         newmax = (newdist + sqrtf(newdist*newdist + 4*dmin*dmax)) / 2;
         newmin = newmax - newdist;
 
-//        std::cerr << "newmin = " << newmin << ", newmax = " << newmax << std::endl;
+//        cerr << "newmin = " << newmin << ", newmax = " << newmax << endl;
 
     } else {
         float dmid = (dmax + dmin) / 2;
@@ -356,7 +356,7 @@
     }
     
 #ifdef DEBUG_NOTE_LAYER
-    std::cerr << "FlexiNoteLayer::setVerticalZoomStep: " << step << ": " << newmin << " -> " << newmax << " (range " << newdist << ")" << std::endl;
+    cerr << "FlexiNoteLayer::setVerticalZoomStep: " << step << ": " << newmin << " -> " << newmax << " (range " << newdist << ")" << endl;
 #endif
 
     setDisplayExtents(newmin, newmax);
@@ -438,7 +438,7 @@
     FlexiNoteModel::PointList onPoints = m_model->getPoints(frame);
     if (onPoints.empty()) return false;
 
-//    std::cerr << "frame " << frame << ": " << onPoints.size() << " candidate points" << std::endl;
+//    cerr << "frame " << frame << ": " << onPoints.size() << " candidate points" << endl;
 
     int nearestDistance = -1;
 
@@ -668,14 +668,17 @@
                 max = Pitch::getFrequencyForPitch(lrintf(max + 1));
             }
 
-            // std::cerr << "FlexiNoteLayer[" << this << "]::getScaleExtents: min = " << min << ", max = " << max << ", log = " << log << std::endl;
+#ifdef DEBUG_NOTE_LAYER
+            cerr << "FlexiNoteLayer[" << this << "]::getScaleExtents: min = " << min << ", max = " << max << ", log = " << log << endl;
+#endif
 
         } else if (log) {
 
             LogRange::mapRange(min, max);
 
-            // std::cerr << "FlexiNoteLayer[" << this << "]::getScaleExtents: min = " << min << ", max = " << max << ", log = " << log << std::endl;
-
+#ifdef DEBUG_NOTE_LAYER
+            cerr << "FlexiNoteLayer[" << this << "]::getScaleExtents: min = " << min << ", max = " << max << ", log = " << log << endl;
+#endif
         }
 
     } else {
@@ -708,21 +711,29 @@
 
     getScaleExtents(v, min, max, logarithmic);
 
-//    std::cerr << "FlexiNoteLayer[" << this << "]::getYForValue(" << val << "): min = " << min << ", max = " << max << ", log = " << logarithmic << std::endl;
+#ifdef DEBUG_NOTE_LAYER
+    cerr << "FlexiNoteLayer[" << this << "]::getYForValue(" << val << "): min = " << min << ", max = " << max << ", log = " << logarithmic << endl;
+#endif
 
     if (shouldConvertMIDIToHz()) {
         val = Pitch::getFrequencyForPitch(lrintf(val),
                                           lrintf((val - lrintf(val)) * 100));
-//        std::cerr << "shouldConvertMIDIToHz true, val now = " << val << std::endl;
+#ifdef DEBUG_NOTE_LAYER
+        cerr << "shouldConvertMIDIToHz true, val now = " << val << endl;
+#endif
     }
 
     if (logarithmic) {
         val = LogRange::map(val);
-//        std::cerr << "logarithmic true, val now = " << val << std::endl;
+#ifdef DEBUG_NOTE_LAYER
+        cerr << "logarithmic true, val now = " << val << endl;
+#endif
     }
 
     int y = int(h - ((val - min) * h) / (max - min)) - 1;
-//    std::cerr << "y = " << y << std::endl;
+#ifdef DEBUG_NOTE_LAYER
+    cerr << "y = " << y << endl;
+#endif
     return y;
 }
 
--- a/layer/ImageLayer.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/layer/ImageLayer.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -163,7 +163,7 @@
         }
     }
 
-//    std::cerr << rv.size() << " point(s)" << std::endl;
+//    cerr << rv.size() << " point(s)" << endl;
 
     return rv;
 }
@@ -500,15 +500,15 @@
 bool
 ImageLayer::getImageOriginalSize(QString name, QSize &size) const
 {
-//    std::cerr << "getImageOriginalSize: \"" << name << "\"" << std::endl;
+//    cerr << "getImageOriginalSize: \"" << name << "\"" << endl;
 
     QMutexLocker locker(&m_imageMapMutex);
     if (m_images.find(name) == m_images.end()) {
-//        std::cerr << "don't have, trying to open local" << std::endl;
+//        cerr << "don't have, trying to open local" << endl;
         m_images[name] = QImage(getLocalFilename(name));
     }
     if (m_images[name].isNull()) {
-//        std::cerr << "null image" << std::endl;
+//        cerr << "null image" << endl;
         return false;
     } else {
         size = m_images[name].size();
@@ -529,7 +529,7 @@
           m_scaled[v][name].height() <= maxSize.height()) ||
          (m_scaled[v][name].width()  <= maxSize.width() &&
           m_scaled[v][name].height() == maxSize.height()))) {
-//        std::cerr << "cache hit" << std::endl;
+//        cerr << "cache hit" << endl;
         return m_scaled[v][name];
     }
 
@@ -540,7 +540,7 @@
     }
 
     if (m_images[name].isNull()) {
-//        std::cerr << "null image" << std::endl;
+//        cerr << "null image" << endl;
         m_scaled[v][name] = QImage();
     } else if (m_images[name].width() <= maxSize.width() &&
                m_images[name].height() <= maxSize.height()) {
@@ -627,7 +627,7 @@
 {
     QImage image(getLocalFilename(url));
     if (image.isNull()) {
-        std::cerr << "Failed to open image from url \"" << url << "\" (local filename \"" << getLocalFilename(url) << "\"" << std::endl;
+        cerr << "Failed to open image from url \"" << url << "\" (local filename \"" << getLocalFilename(url) << "\"" << endl;
         delete m_fileSources[url];
         m_fileSources.erase(url);
         return false;
@@ -915,7 +915,7 @@
     ProgressDialog dialog(tr("Opening image URL..."), true, 2000);
     FileSource *rf = new FileSource(img, &dialog);
     if (rf->isOK()) {
-        std::cerr << "ok, adding it (local filename = " << rf->getLocalFilename() << ")" << std::endl;
+        cerr << "ok, adding it (local filename = " << rf->getLocalFilename() << ")" << endl;
         m_fileSources[img] = rf;
         connect(rf, SIGNAL(ready()), this, SLOT(fileSourceReady()));
     } else {
@@ -948,7 +948,7 @@
          i != m_fileSources.end(); ++i) {
         if (i->second == rf) {
             img = i->first;
-//            std::cerr << "it's image \"" << img << "\"" << std::endl;
+//            cerr << "it's image \"" << img << "\"" << endl;
             break;
         }
     }
--- a/layer/ImageRegionFinder.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/layer/ImageRegionFinder.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -118,7 +118,7 @@
     float db = float(qBlue(a) - qBlue(b)) / 255.f;
     float dist = sqrtf(dr * dr + dg * dg + db * db);
 
-//    std::cerr << "thresh=" << thresh << ", dist=" << dist << std::endl;
+//    cerr << "thresh=" << thresh << ", dist=" << dist << endl;
 
     return (dist < thresh);
 }
--- a/layer/Layer.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/layer/Layer.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -106,7 +106,7 @@
 PlayParameters *
 Layer::getPlayParameters() 
 {
-//    std::cerr << "Layer (" << this << ", " << objectName() << ")::getPlayParameters: model is "<< getModel() << std::endl;
+//    cerr << "Layer (" << this << ", " << objectName() << ")::getPlayParameters: model is "<< getModel() << endl;
     const Model *model = getModel();
     if (model) {
 	return PlayParameterRepository::getInstance()->getPlayParameters(model);
@@ -257,7 +257,7 @@
         }
         long myMappedFrame = alignToReference(v, sourceFrame);
 
-//        std::cerr << "sourceFrame = " << sourceFrame << ", referenceFrame = " << referenceFrame << " (have = " << i->haveReferenceFrame() << "), myMappedFrame = " << myMappedFrame << std::endl;
+//        cerr << "sourceFrame = " << sourceFrame << ", referenceFrame = " << referenceFrame << " (have = " << i->haveReferenceFrame() << "), myMappedFrame = " << myMappedFrame << endl;
 
         if (myMappedFrame != referenceFrame) return true;
     }
--- a/layer/LayerFactory.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/layer/LayerFactory.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -486,7 +486,7 @@
     QString defaults = settings.value(getLayerTypeName(type), "").toString();
     if (defaults == "") return;
 
-//    std::cerr << "defaults=\"" << defaults << "\"" << std::endl;
+//    cerr << "defaults=\"" << defaults << "\"" << endl;
 
     QString xml = layer->toXmlString();
     QDomDocument docOld, docNew;
@@ -502,9 +502,9 @@
         for (unsigned int i = 0; i < attrNodes.length(); ++i) {
             QDomAttr attr = attrNodes.item(i).toAttr();
             if (attr.isNull()) continue;
-//            std::cerr << "append \"" << attr.name().toStdString()
+//            cerr << "append \"" << attr.name()
 //                      << "\" -> \"" << attr.value() << "\""
-//                      << std::endl;
+//                      << endl;
             attrs.append(attr.name(), "", "", attr.value());
         }
         
@@ -514,9 +514,9 @@
             QDomAttr attr = attrNodes.item(i).toAttr();
             if (attr.isNull()) continue;
             if (attrs.value(attr.name()) == "") {
-//                std::cerr << "append \"" << attr.name().toStdString()
+//                cerr << "append \"" << attr.name()
 //                          << "\" -> \"" << attr.value() << "\""
-//                          << std::endl;
+//                          << endl;
                 attrs.append(attr.name(), "", "", attr.value());
             }
         }
--- a/layer/NoteLayer.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/layer/NoteLayer.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -237,7 +237,7 @@
     }
 
 #ifdef DEBUG_NOTE_LAYER
-    std::cerr << "NoteLayer::getDisplayExtents: min = " << min << ", max = " << max << " (m_scaleMinimum = " << m_scaleMinimum << ", m_scaleMaximum = " << m_scaleMaximum << ")" << std::endl;
+    cerr << "NoteLayer::getDisplayExtents: min = " << min << ", max = " << max << " (m_scaleMinimum = " << m_scaleMinimum << ", m_scaleMaximum = " << m_scaleMaximum << ")" << endl;
 #endif
 
     return true;
@@ -260,7 +260,7 @@
     m_scaleMaximum = max;
 
 #ifdef DEBUG_NOTE_LAYER
-    std::cerr << "NoteLayer::setDisplayExtents: min = " << min << ", max = " << max << std::endl;
+    cerr << "NoteLayer::setDisplayExtents: min = " << min << ", max = " << max << endl;
 #endif
     
     emit layerParametersChanged();
@@ -326,7 +326,7 @@
         newmax = (newdist + sqrtf(newdist*newdist + 4*dmin*dmax)) / 2;
         newmin = newmax - newdist;
 
-//        std::cerr << "newmin = " << newmin << ", newmax = " << newmax << std::endl;
+//        cerr << "newmin = " << newmin << ", newmax = " << newmax << endl;
 
     } else {
         float dmid = (dmax + dmin) / 2;
@@ -343,7 +343,7 @@
     }
     
 #ifdef DEBUG_NOTE_LAYER
-    std::cerr << "NoteLayer::setVerticalZoomStep: " << step << ": " << newmin << " -> " << newmax << " (range " << newdist << ")" << std::endl;
+    cerr << "NoteLayer::setVerticalZoomStep: " << step << ": " << newmin << " -> " << newmax << " (range " << newdist << ")" << endl;
 #endif
 
     setDisplayExtents(newmin, newmax);
@@ -425,7 +425,7 @@
     NoteModel::PointList onPoints = m_model->getPoints(frame);
     if (onPoints.empty()) return false;
 
-//    std::cerr << "frame " << frame << ": " << onPoints.size() << " candidate points" << std::endl;
+//    cerr << "frame " << frame << ": " << onPoints.size() << " candidate points" << endl;
 
     int nearestDistance = -1;
 
@@ -626,7 +626,7 @@
             }
 
 #ifdef DEBUG_NOTE_LAYER
-            std::cerr << "NoteLayer[" << this << "]::getScaleExtents: min = " << min << ", max = " << max << ", log = " << log << std::endl;
+            cerr << "NoteLayer[" << this << "]::getScaleExtents: min = " << min << ", max = " << max << ", log = " << log << endl;
 #endif
 
         } else if (log) {
@@ -634,7 +634,7 @@
             LogRange::mapRange(min, max);
 
 #ifdef DEBUG_NOTE_LAYER
-            std::cerr << "NoteLayer[" << this << "]::getScaleExtents: min = " << min << ", max = " << max << ", log = " << log << std::endl;
+            cerr << "NoteLayer[" << this << "]::getScaleExtents: min = " << min << ", max = " << max << ", log = " << log << endl;
 #endif
 
         }
@@ -670,27 +670,27 @@
     getScaleExtents(v, min, max, logarithmic);
 
 #ifdef DEBUG_NOTE_LAYER
-    std::cerr << "NoteLayer[" << this << "]::getYForValue(" << val << "): min = " << min << ", max = " << max << ", log = " << logarithmic << std::endl;
+    cerr << "NoteLayer[" << this << "]::getYForValue(" << val << "): min = " << min << ", max = " << max << ", log = " << logarithmic << endl;
 #endif
 
     if (shouldConvertMIDIToHz()) {
         val = Pitch::getFrequencyForPitch(lrintf(val),
                                           lrintf((val - lrintf(val)) * 100));
 #ifdef DEBUG_NOTE_LAYER
-        std::cerr << "shouldConvertMIDIToHz true, val now = " << val << std::endl;
+        cerr << "shouldConvertMIDIToHz true, val now = " << val << endl;
 #endif
     }
 
     if (logarithmic) {
         val = LogRange::map(val);
 #ifdef DEBUG_NOTE_LAYER
-        std::cerr << "logarithmic true, val now = " << val << std::endl;
+        cerr << "logarithmic true, val now = " << val << endl;
 #endif
     }
 
     int y = int(h - ((val - min) * h) / (max - min)) - 1;
 #ifdef DEBUG_NOTE_LAYER
-    std::cerr << "y = " << y << std::endl;
+    cerr << "y = " << y << endl;
 #endif
     return y;
 }
--- a/layer/PaintAssistant.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/layer/PaintAssistant.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -52,13 +52,13 @@
         } while (!round && mult < limit);
         if (round) {
             mult /= 10;
-//            std::cerr << "\n\nstep goes from " << step;
+//            cerr << "\n\nstep goes from " << step;
             step = float(round) / mult;
             n = lrintf((maxVal - minVal) / step);
             if (mult > 1) {
                 mult /= 10;
             }
-//            std::cerr << " to " << step << " (n = " << n << ")" << std::endl;
+//            cerr << " to " << step << " (n = " << n << ")" << endl;
         }
     }
 
--- a/layer/RegionLayer.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/layer/RegionLayer.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -614,13 +614,13 @@
             min = m_model->getValueMinimum();
             max = m_model->getValueMaximum();
 
-//            std::cerr << "RegionLayer[" << this << "]::getScaleExtents: min = " << min << ", max = " << max << ", log = " << log << std::endl;
+//            cerr << "RegionLayer[" << this << "]::getScaleExtents: min = " << min << ", max = " << max << ", log = " << log << endl;
 
         } else if (log) {
 
             LogRange::mapRange(min, max);
 
-//            std::cerr << "RegionLayer[" << this << "]::getScaleExtents: min = " << min << ", max = " << max << ", log = " << log << std::endl;
+//            cerr << "RegionLayer[" << this << "]::getScaleExtents: min = " << min << ", max = " << max << ", log = " << log << endl;
 
         }
 
@@ -632,7 +632,7 @@
             i = m_spacingMap.end();
             --i;
             max = i->second;
-//            std::cerr << "RegionLayer[" << this << "]::getScaleExtents: equal spaced; min = " << min << ", max = " << max << ", log = " << log << std::endl;
+//            cerr << "RegionLayer[" << this << "]::getScaleExtents: equal spaced; min = " << min << ", max = " << max << ", log = " << log << endl;
         }
 
     } else {
@@ -695,8 +695,8 @@
 
         getScaleExtents(v, min, max, logarithmic);
 
-//    std::cerr << "RegionLayer[" << this << "]::getYForValue(" << val << "): min = " << min << ", max = " << max << ", log = " << logarithmic << std::endl;
-//    std::cerr << "h = " << h << ", margin = " << margin << std::endl;
+//    cerr << "RegionLayer[" << this << "]::getYForValue(" << val << "): min = " << min << ", max = " << max << ", log = " << logarithmic << endl;
+//    cerr << "h = " << h << ", margin = " << margin << endl;
 
         if (logarithmic) {
             val = LogRange::map(val);
@@ -740,7 +740,7 @@
         int dist = iy - y;
         int gap = h / n; // between region lines
 
-//        std::cerr << "getValueForY: y = " << y << ", vh = " << vh << ", ivh = " << ivh << " of " << n << ", iy = " << iy << ", dist = " << dist << ", gap = " << gap << std::endl;
+//        cerr << "getValueForY: y = " << y << ", vh = " << vh << ", ivh = " << ivh << " of " << n << ", iy = " << iy << ", dist = " << dist << ", gap = " << gap << endl;
 
         SpacingMap::const_iterator i = m_spacingMap.begin();
         while (i != m_spacingMap.end()) {
@@ -749,11 +749,11 @@
         }
         if (i == m_spacingMap.end()) i = m_spacingMap.begin();
 
-//        std::cerr << "nearest existing value = " << i->first << " at " << iy << std::endl;
+//        cerr << "nearest existing value = " << i->first << " at " << iy << endl;
 
         float val = 0;
 
-//        std::cerr << "note: avoid = " << avoid << ", i->second = " << i->second << std::endl;
+//        cerr << "note: avoid = " << avoid << ", i->second = " << i->second << endl;
 
         if (dist < -gap/3 &&
             ((avoid == -1) ||
@@ -761,12 +761,12 @@
             // bisect gap to prior
             if (i == m_spacingMap.begin()) {
                 val = i->first - 1.f;
-//                std::cerr << "extended down to " << val << std::endl;
+//                cerr << "extended down to " << val << endl;
             } else {
                 SpacingMap::const_iterator j = i;
                 --j;
                 val = (i->first + j->first) / 2;
-//                std::cerr << "bisected down to " << val << std::endl;
+//                cerr << "bisected down to " << val << endl;
             }
         } else if (dist > gap/3 &&
                    ((avoid == -1) ||
@@ -776,15 +776,15 @@
             ++j;
             if (j == m_spacingMap.end()) {
                 val = i->first + 1.f;
-//                std::cerr << "extended up to " << val << std::endl;
+//                cerr << "extended up to " << val << endl;
             } else {
                 val = (i->first + j->first) / 2;
-//                std::cerr << "bisected up to " << val << std::endl;
+//                cerr << "bisected up to " << val << endl;
             }
         } else {
             // snap
             val = i->first;
-//            std::cerr << "snapped to " << val << std::endl;
+//            cerr << "snapped to " << val << endl;
         }            
 
         return val;
--- a/layer/SingleColourLayer.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/layer/SingleColourLayer.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -161,11 +161,11 @@
         // a virtual function
         hint = getDefaultColourHint(dark, impose);
 #ifdef DEBUG_COLOUR_SELECTION
-        std::cerr << "hint = " << hint << ", impose = " << impose << std::endl;
+        cerr << "hint = " << hint << ", impose = " << impose << endl;
 #endif
     } else {
 #ifdef DEBUG_COLOUR_SELECTION
-        std::cerr << "(from ctor)" << std::endl;
+        cerr << "(from ctor)" << endl;
 #endif
     }
 
@@ -188,19 +188,19 @@
         }
 
 #ifdef DEBUG_COLOUR_SELECTION
-        std::cerr << "index = " << index << ", count = " << count;
+        cerr << "index = " << index << ", count = " << count;
 #endif
 
         if (bestColour < 0 || count < bestCount) {
             bestColour = index;
             bestCount = count;
 #ifdef DEBUG_COLOUR_SELECTION
-            std::cerr << " *";
+            cerr << " *";
 #endif
         }
 
 #ifdef DEBUG_COLOUR_SELECTION
-        std::cerr << std::endl;
+        cerr << endl;
 #endif
     }
     
--- a/layer/SliceLayer.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/layer/SliceLayer.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -57,8 +57,8 @@
         dynamic_cast<const DenseThreeDimensionalModel *>(model);
 
     if (model && !sliceable) {
-        std::cerr << "WARNING: SliceLayer::setSliceableModel(" << model
-                  << "): model is not a DenseThreeDimensionalModel" << std::endl;
+        cerr << "WARNING: SliceLayer::setSliceableModel(" << model
+                  << "): model is not a DenseThreeDimensionalModel" << endl;
     }
 
     if (m_sliceableModel == sliceable) return;
@@ -360,7 +360,7 @@
     size_t f1 = v->getFrameForX(f0x + 1);
     if (f1 > f0) --f1;
 
-//    std::cerr << "centre frame " << v->getCentreFrame() << ", x " << f0x << ", f0 " << f0 << ", f1 " << f1 << std::endl;
+//    cerr << "centre frame " << v->getCentreFrame() << ", x " << f0x << ", f0 " << f0 << ", f1 " << f1 << endl;
 
     size_t res = m_sliceableModel->getResolution();
     size_t col0 = f0 / res;
@@ -369,7 +369,7 @@
     f0 = col0 * res;
     f1 = (col1 + 1) * res - 1;
 
-//    std::cerr << "resolution " << res << ", col0 " << col0 << ", col1 " << col1 << ", f0 " << f0 << ", f1 " << f1 << std::endl;
+//    cerr << "resolution " << res << ", col0 " << col0 << ", col1 " << col1 << ", f0 " << f0 << ", f1 " << f1 << endl;
 
     m_currentf0 = f0;
     m_currentf1 = f1;
@@ -622,7 +622,7 @@
 	*max = 50;
         *deflt = 0;
 
-        std::cerr << "gain is " << m_gain << ", mode is " << m_samplingMode << std::endl;
+        cerr << "gain is " << m_gain << ", mode is " << m_samplingMode << endl;
 
 	val = lrint(log10(m_gain) * 20.0);
 	if (val < *min) val = *min;
--- a/layer/SpectrogramLayer.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/layer/SpectrogramLayer.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -40,8 +40,8 @@
 
 #include <iostream>
 
-using std::cerr;
-using std::endl;
+
+
 #include <cassert>
 #include <cmath>
 
@@ -127,7 +127,7 @@
 void
 SpectrogramLayer::setModel(const DenseTimeValueModel *model)
 {
-//    std::cerr << "SpectrogramLayer(" << this << "): setModel(" << model << ")" << std::endl;
+//    cerr << "SpectrogramLayer(" << this << "): setModel(" << model << ")" << endl;
 
     if (model == m_model) return;
 
@@ -584,16 +584,16 @@
                   << v->getStartFrame() << ", " << v->getEndFrame()
                   << endl;
 
-        std::cerr << "Valid area was: " << i->second.validArea.x() << ", "
+        cerr << "Valid area was: " << i->second.validArea.x() << ", "
                   << i->second.validArea.y() << " "
                   << i->second.validArea.width() << "x"
-                  << i->second.validArea.height() << std::endl;
+                  << i->second.validArea.height() << endl;
 #endif
 
         if (long(startFrame) > v->getStartFrame()) {
             if (startFrame >= v->getEndFrame()) {
 #ifdef DEBUG_SPECTROGRAM_REPAINT
-                std::cerr << "Modified start frame is off right of view" << std::endl;
+                cerr << "Modified start frame is off right of view" << endl;
 #endif
                 return;
             }
@@ -610,7 +610,7 @@
         } else {
             if (long(endFrame) < v->getStartFrame()) {
 #ifdef DEBUG_SPECTROGRAM_REPAINT
-                std::cerr << "Modified end frame is off left of view" << std::endl;
+                cerr << "Modified end frame is off left of view" << endl;
 #endif
                 return;
             }
@@ -628,10 +628,10 @@
         }
 
 #ifdef DEBUG_SPECTROGRAM_REPAINT
-        std::cerr << "Valid area is now: " << i->second.validArea.x() << ", "
+        cerr << "Valid area is now: " << i->second.validArea.x() << ", "
                   << i->second.validArea.y() << " "
                   << i->second.validArea.width() << "x"
-                  << i->second.validArea.height() << std::endl;
+                  << i->second.validArea.height() << endl;
 #endif
     }
 }
@@ -1067,7 +1067,7 @@
             if (fill >= lastFill) {
                 if (fill >= m_model->getEndFrame() && lastFill > 0) {
 #ifdef DEBUG_SPECTROGRAM_REPAINT
-                    std::cerr << "complete!" << std::endl;
+                    cerr << "complete!" << endl;
 #endif
                     invalidateImageCaches();
                     i->second.second = -1;
@@ -1075,8 +1075,8 @@
 
                 } else if (fill > lastFill) {
 #ifdef DEBUG_SPECTROGRAM_REPAINT
-                    std::cerr << "SpectrogramLayer: emitting modelChanged("
-                              << lastFill << "," << fill << ")" << std::endl;
+                    cerr << "SpectrogramLayer: emitting modelChanged("
+                              << lastFill << "," << fill << ")" << endl;
 #endif
                     invalidateImageCaches(lastFill, fill);
                     i->second.second = fill;
@@ -1084,8 +1084,8 @@
                 }
             } else {
 #ifdef DEBUG_SPECTROGRAM_REPAINT
-                std::cerr << "SpectrogramLayer: going backwards, emitting modelChanged("
-                          << m_model->getStartFrame() << "," << m_model->getEndFrame() << ")" << std::endl;
+                cerr << "SpectrogramLayer: going backwards, emitting modelChanged("
+                          << m_model->getStartFrame() << "," << m_model->getEndFrame() << ")" << endl;
 #endif
                 invalidateImageCaches();
                 i->second.second = fill;
@@ -1100,7 +1100,7 @@
 
     if (allDone) {
 #ifdef DEBUG_SPECTROGRAM_REPAINT
-        std::cerr << "SpectrogramLayer: all complete!" << std::endl;
+        cerr << "SpectrogramLayer: all complete!" << endl;
 #endif
         delete m_updateTimer;
         m_updateTimer = 0;
@@ -1674,7 +1674,7 @@
 
         if (!m_sliceableModel) {
 #ifdef DEBUG_SPECTROGRAM
-            std::cerr << "SpectrogramLayer: emitting sliceableModelReplaced(0, " << model << ")" << std::endl;
+            cerr << "SpectrogramLayer: emitting sliceableModelReplaced(0, " << model << ")" << endl;
 #endif
             ((SpectrogramLayer *)this)->sliceableModelReplaced(0, model);
             m_sliceableModel = model;
@@ -1730,7 +1730,7 @@
     m_peakCaches.clear();
 
     if (m_sliceableModel) {
-        std::cerr << "SpectrogramLayer: emitting sliceableModelReplaced(" << m_sliceableModel << ", 0)" << std::endl;
+        cerr << "SpectrogramLayer: emitting sliceableModelReplaced(" << m_sliceableModel << ", 0)" << endl;
         emit sliceableModelReplaced(m_sliceableModel, 0);
         m_sliceableModel = 0;
     }
@@ -1805,7 +1805,7 @@
 #ifdef DEBUG_SPECTROGRAM_REPAINT
     SVDEBUG << "SpectrogramLayer::paint(): m_model is " << m_model << ", zoom level is " << v->getZoomLevel() << ", m_updateTimer " << m_updateTimer << endl;
     
-    std::cerr << "rect is " << rect.x() << "," << rect.y() << " " << rect.width() << "x" << rect.height() << std::endl;
+    cerr << "rect is " << rect.x() << "," << rect.y() << " " << rect.width() << "x" << rect.height() << endl;
 #endif
 
     long startFrame = v->getStartFrame();
@@ -1831,7 +1831,7 @@
 /*
     FFTModel *fft = getFFTModel(v);
     if (!fft) {
-	std::cerr << "ERROR: SpectrogramLayer::paint(): No FFT model, returning" << std::endl;
+	cerr << "ERROR: SpectrogramLayer::paint(): No FFT model, returning" << endl;
 	return;
     }
 */
@@ -1859,7 +1859,7 @@
     x1 = rect.right() + 1;
 /*
     float xPixelRatio = float(fft->getResolution()) / float(zoomLevel);
-    std::cerr << "xPixelRatio = " << xPixelRatio << std::endl;
+    cerr << "xPixelRatio = " << xPixelRatio << endl;
     if (xPixelRatio < 1.f) xPixelRatio = 1.f;
 */
     if (cache.validArea.width() > 0) {
@@ -1877,7 +1877,7 @@
                 cache.validArea.x() + cache.validArea.width() >= x1) {
 	    
 #ifdef DEBUG_SPECTROGRAM_REPAINT
-		std::cerr << "SpectrogramLayer: image cache good" << std::endl;
+		cerr << "SpectrogramLayer: image cache good" << endl;
 #endif
 
 		paint.drawImage(rect, cache.image, rect);
@@ -1891,7 +1891,7 @@
 	    } else {
 
 #ifdef DEBUG_SPECTROGRAM_REPAINT
-		std::cerr << "SpectrogramLayer: image cache partially OK" << std::endl;
+		cerr << "SpectrogramLayer: image cache partially OK" << endl;
 #endif
 
 		recreateWholeImageCache = false;
@@ -1900,7 +1900,7 @@
 		         v->getXForFrame(startFrame);
 
 #ifdef DEBUG_SPECTROGRAM_REPAINT
-		std::cerr << "SpectrogramLayer: dx = " << dx << " (image cache " << cw << "x" << ch << ")" << std::endl;
+		cerr << "SpectrogramLayer: dx = " << dx << " (image cache " << cw << "x" << ch << ")" << endl;
 #endif
 
 		if (dx != 0 &&
@@ -1946,10 +1946,10 @@
                               pw, cache.validArea.height());
 
 #ifdef DEBUG_SPECTROGRAM_REPAINT
-                    std::cerr << "valid area now "
+                    cerr << "valid area now "
                               << px << "," << cache.validArea.y()
                               << " " << pw << "x" << cache.validArea.height()
-                              << std::endl;
+                              << endl;
 #endif
 /*
 		    paint.drawImage(rect & cache.validArea,
@@ -1961,7 +1961,7 @@
                     // we scrolled too far to be of use
 
 #ifdef DEBUG_SPECTROGRAM_REPAINT
-                    std::cerr << "dx == " << dx << ": scrolled too far for cache to be useful" << std::endl;
+                    cerr << "dx == " << dx << ": scrolled too far for cache to be useful" << endl;
 #endif
 
                     cache.validArea = QRect();
@@ -1970,17 +1970,17 @@
 	    }
 	} else {
 #ifdef DEBUG_SPECTROGRAM_REPAINT
-	    std::cerr << "SpectrogramLayer: image cache useless" << std::endl;
+	    cerr << "SpectrogramLayer: image cache useless" << endl;
             if (int(cache.zoomLevel) != zoomLevel) {
-                std::cerr << "(cache zoomLevel " << cache.zoomLevel
-                          << " != " << zoomLevel << ")" << std::endl;
+                cerr << "(cache zoomLevel " << cache.zoomLevel
+                          << " != " << zoomLevel << ")" << endl;
             }
             if (cw != v->width()) {
-                std::cerr << "(cache width " << cw
+                cerr << "(cache width " << cw
                           << " != " << v->width();
             }
             if (ch != v->height()) {
-                std::cerr << "(cache height " << ch
+                cerr << "(cache height " << ch
                           << " != " << v->height();
             }
 #endif
@@ -1991,7 +1991,7 @@
 
     if (updateViewMagnitudes(v)) {
 #ifdef DEBUG_SPECTROGRAM_REPAINT
-        std::cerr << "SpectrogramLayer: magnitude range changed to [" << m_viewMags[v].getMin() << "->" << m_viewMags[v].getMax() << "]" << std::endl;
+        cerr << "SpectrogramLayer: magnitude range changed to [" << m_viewMags[v].getMin() << "->" << m_viewMags[v].getMax() << "]" << endl;
 #endif
         if (m_normalizeVisibleArea) {
             cache.validArea = QRect();
@@ -1999,7 +1999,7 @@
         }
     } else {
 #ifdef DEBUG_SPECTROGRAM_REPAINT
-        std::cerr << "No change in magnitude range [" << m_viewMags[v].getMin() << "->" << m_viewMags[v].getMax() << "]" << std::endl;
+        cerr << "No change in magnitude range [" << m_viewMags[v].getMin() << "->" << m_viewMags[v].getMax() << "]" << endl;
 #endif
     }
 
@@ -2040,7 +2040,7 @@
     }
 
 #ifdef DEBUG_SPECTROGRAM_REPAINT
-    std::cerr << "[" << this << "]: last paint width: " << m_lastPaintBlockWidth << ", last paint time: " << m_lastPaintTime << ", new paint width: " << paintBlockWidth << std::endl;
+    cerr << "[" << this << "]: last paint width: " << m_lastPaintBlockWidth << ", last paint time: " << m_lastPaintTime << ", new paint width: " << paintBlockWidth << endl;
 #endif
 
     // We always paint the full height when refreshing the cache.
@@ -2065,7 +2065,7 @@
         vx1 = cache.validArea.x() + cache.validArea.width();
         
 #ifdef DEBUG_SPECTROGRAM_REPAINT
-        std::cerr << "x0 " << x0 << ", x1 " << x1 << ", vx0 " << vx0 << ", vx1 " << vx1 << ", paintBlockWidth " << paintBlockWidth << std::endl;
+        cerr << "x0 " << x0 << ", x1 " << x1 << ", vx0 " << vx0 << ", vx1 " << vx1 << ", paintBlockWidth " << paintBlockWidth << endl;
 #endif         
         if (x0 < vx0) {
             if (x0 + paintBlockWidth < vx0) {
@@ -2096,10 +2096,10 @@
              cache.validArea.height());
 
 #ifdef DEBUG_SPECTROGRAM_REPAINT
-        std::cerr << "Valid area becomes " << cache.validArea.x()
+        cerr << "Valid area becomes " << cache.validArea.x()
                   << ", " << cache.validArea.y() << ", "
                   << cache.validArea.width() << "x"
-                  << cache.validArea.height() << std::endl;
+                  << cache.validArea.height() << endl;
 #endif
             
     } else {
@@ -2116,8 +2116,8 @@
             }
         }
 #ifdef DEBUG_SPECTROGRAM_REPAINT
-        std::cerr << "Valid area becomes " << x0 << ", 0, " << (x1-x0)
-                  << "x" << h << std::endl;
+        cerr << "Valid area becomes " << x0 << ", 0, " << (x1-x0)
+                  << "x" << h << endl;
 #endif
         cache.validArea = QRect(x0, 0, x1 - x0, h);
     }
@@ -2131,7 +2131,7 @@
     int w = x1 - x0;
 
 #ifdef DEBUG_SPECTROGRAM_REPAINT
-    std::cerr << "x0 " << x0 << ", x1 " << x1 << ", w " << w << ", h " << h << std::endl;
+    cerr << "x0 " << x0 << ", x1 " << x1 << ", w " << w << ", h " << h << endl;
 #endif
 
     int sr = m_model->getSampleRate();
@@ -2156,7 +2156,7 @@
     size_t minbin = 1;
     if (m_minFrequency > 0) {
 	minbin = int((double(m_minFrequency) * m_fftSize) / sr + 0.001);
-//        std::cerr << "m_minFrequency = " << m_minFrequency << " -> minbin = " << minbin << std::endl;
+//        cerr << "m_minFrequency = " << m_minFrequency << " -> minbin = " << minbin << endl;
 	if (minbin < 1) minbin = 1;
 	if (minbin >= maxbin) minbin = maxbin - 1;
     }
@@ -2176,7 +2176,7 @@
         displayMaxFreq = getEffectiveMaxFrequency();
     }
 
-//    std::cerr << "(giving actual minFreq " << minFreq << " and display minFreq " << displayMinFreq << ")" << std::endl;
+//    cerr << "(giving actual minFreq " << minFreq << " and display minFreq " << displayMinFreq << ")" << endl;
 
     int increment = getWindowIncrement();
     
@@ -2197,7 +2197,7 @@
     bool fftSuspended = false;
 
 #ifdef DEBUG_SPECTROGRAM_REPAINT
-    std::cerr << ((float(v->getFrameForX(1) - v->getFrameForX(0))) / increment) << " bin(s) per pixel" << std::endl;
+    cerr << ((float(v->getFrameForX(1) - v->getFrameForX(0))) / increment) << " bin(s) per pixel" << endl;
 #endif
 
     bool runOutOfData = false;
@@ -2337,24 +2337,24 @@
 
         if (runOutOfData) {
 #ifdef DEBUG_SPECTROGRAM_REPAINT
-            std::cerr << "Run out of data -- dropping out of loop" << std::endl;
+            cerr << "Run out of data -- dropping out of loop" << endl;
 #endif
             break;
         }
     }
 */
 #ifdef DEBUG_SPECTROGRAM_REPAINT
-//    std::cerr << pixels << " pixels drawn" << std::endl;
+//    cerr << pixels << " pixels drawn" << endl;
 #endif
 
     if (overallMagChanged) {
         m_viewMags[v] = overallMag;
 #ifdef DEBUG_SPECTROGRAM_REPAINT
-        std::cerr << "Overall mag is now [" << m_viewMags[v].getMin() << "->" << m_viewMags[v].getMax() << "] - will be updating" << std::endl;
+        cerr << "Overall mag is now [" << m_viewMags[v].getMin() << "->" << m_viewMags[v].getMax() << "] - will be updating" << endl;
 #endif
     } else {
 #ifdef DEBUG_SPECTROGRAM_REPAINT
-        std::cerr << "Overall mag unchanged at [" << m_viewMags[v].getMin() << "->" << m_viewMags[v].getMax() << "]" << std::endl;
+        cerr << "Overall mag unchanged at [" << m_viewMags[v].getMin() << "->" << m_viewMags[v].getMax() << "]" << endl;
 #endif
     }
 
@@ -2464,7 +2464,7 @@
             }
         } else {
             // overallMagChanged
-            std::cerr << "\noverallMagChanged - updating all\n" << std::endl;
+            cerr << "\noverallMagChanged - updating all\n" << endl;
             cache.validArea = QRect();
             v->update();
         }
@@ -2540,7 +2540,7 @@
             if (!m_synchronous) {
                 if (!fft->isColumnAvailable(sx)) {
 #ifdef DEBUG_SPECTROGRAM_REPAINT
-                    std::cerr << "Met unavailable column at col " << sx << std::endl;
+                    cerr << "Met unavailable column at col " << sx << endl;
 #endif
                     return false;
                 }
@@ -2592,10 +2592,10 @@
             if (mag.isSet()) {
                 if (sx >= int(m_columnMags.size())) {
 #ifdef DEBUG_SPECTROGRAM
-                    std::cerr << "INTERNAL ERROR: " << sx << " >= "
+                    cerr << "INTERNAL ERROR: " << sx << " >= "
                               << m_columnMags.size()
                               << " at SpectrogramLayer.cpp::paintDrawBuffer"
-                              << std::endl;
+                              << endl;
 #endif
                 } else {
                     m_columnMags[sx].sample(mag);
@@ -2689,7 +2689,7 @@
         for (int sx = sx0; sx < sx1; ++sx) {
 
 #ifdef DEBUG_SPECTROGRAM_REPAINT
-//            std::cerr << "sx = " << sx << std::endl;
+//            cerr << "sx = " << sx << endl;
 #endif
 
             if (sx < 0 || sx >= int(sourceModel->getWidth())) continue;
@@ -2697,7 +2697,7 @@
             if (!m_synchronous) {
                 if (!sourceModel->isColumnAvailable(sx)) {
 #ifdef DEBUG_SPECTROGRAM_REPAINT
-                    std::cerr << "Met unavailable column at col " << sx << std::endl;
+                    cerr << "Met unavailable column at col " << sx << endl;
 #endif
                     return false;
                 }
@@ -2805,10 +2805,10 @@
             if (mag.isSet()) {
                 if (sx >= int(m_columnMags.size())) {
 #ifdef DEBUG_SPECTROGRAM
-                    std::cerr << "INTERNAL ERROR: " << sx << " >= "
+                    cerr << "INTERNAL ERROR: " << sx << " >= "
                               << m_columnMags.size()
                               << " at SpectrogramLayer.cpp::paintDrawBuffer"
-                              << std::endl;
+                              << endl;
 #endif
                 } else {
                     m_columnMags[sx].sample(mag);
@@ -2846,8 +2846,8 @@
         return;
     }
 
-//    std::cerr << "SpectrogramLayer: illuminateLocalFeatures("
-//              << localPos.x() << "," << localPos.y() << ")" << std::endl;
+//    cerr << "SpectrogramLayer: illuminateLocalFeatures("
+//              << localPos.x() << "," << localPos.y() << ")" << endl;
 
     float s0, s1;
     float f0, f1;
@@ -2864,8 +2864,8 @@
         int y1 = int(getYForFrequency(v, f1));
         int y0 = int(getYForFrequency(v, f0));
         
-//        std::cerr << "SpectrogramLayer: illuminate "
-//                  << x0 << "," << y1 << " -> " << x1 << "," << y0 << std::endl;
+//        cerr << "SpectrogramLayer: illuminate "
+//                  << x0 << "," << y1 << " -> " << x1 << "," << y0 << endl;
         
         paint.setPen(v->getForeground());
 
@@ -3006,8 +3006,8 @@
 {
     ImageCache &cache = m_imageCaches[v];
 
-    std::cerr << "cache width: " << cache.image.width() << ", height: "
-              << cache.image.height() << std::endl;
+    cerr << "cache width: " << cache.image.width() << ", height: "
+              << cache.image.height() << endl;
 
     QImage image = cache.image;
 
@@ -3584,7 +3584,7 @@
     float dmin = m_minFrequency, dmax = m_maxFrequency;
 //    getDisplayExtents(dmin, dmax);
 
-//    std::cerr << "current range " << dmin << " -> " << dmax << ", range " << dmax-dmin << ", mid " << (dmax + dmin)/2 << std::endl;
+//    cerr << "current range " << dmin << " -> " << dmax << ", range " << dmax-dmin << ", mid " << (dmax + dmin)/2 << endl;
     
     int sr = m_model->getSampleRate();
     SpectrogramRangeMapper mapper(sr, m_fftSize);
@@ -3618,7 +3618,7 @@
         newmax = (newdist + sqrtf(newdist*newdist + 4*dmin*dmax)) / 2;
         newmin = newmax - newdist;
 
-//        std::cerr << "newmin = " << newmin << ", newmax = " << newmax << std::endl;
+//        cerr << "newmin = " << newmin << ", newmax = " << newmax << endl;
 
     } else {
         float dmid = (dmax + dmin) / 2;
--- a/layer/SpectrumLayer.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/layer/SpectrumLayer.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -717,7 +717,7 @@
 
             size_t bin = i->first;
             
-//            std::cerr << "bin = " << bin << ", thresh = " << thresh << ", value = " << fft->getMagnitudeAt(col, bin) << std::endl;
+//            cerr << "bin = " << bin << ", thresh = " << thresh << ", value = " << fft->getMagnitudeAt(col, bin) << endl;
 
             if (!fft->isOverThreshold(col, bin, thresh)) continue;
             
--- a/layer/TimeInstantLayer.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/layer/TimeInstantLayer.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -60,7 +60,7 @@
     connectSignals(m_model);
 
 #ifdef DEBUG_TIME_INSTANT_LAYER
-    std::cerr << "TimeInstantLayer::setModel(" << model << ")" << std::endl;
+    cerr << "TimeInstantLayer::setModel(" << model << ")" << endl;
 #endif
 
     if (m_model && m_model->getRDFTypeURI().endsWith("Segment")) {
@@ -469,7 +469,7 @@
 TimeInstantLayer::drawStart(View *v, QMouseEvent *e)
 {
 #ifdef DEBUG_TIME_INSTANT_LAYER
-    std::cerr << "TimeInstantLayer::drawStart(" << e->x() << ")" << std::endl;
+    cerr << "TimeInstantLayer::drawStart(" << e->x() << ")" << endl;
 #endif
 
     if (!m_model) return;
@@ -492,7 +492,7 @@
 TimeInstantLayer::drawDrag(View *v, QMouseEvent *e)
 {
 #ifdef DEBUG_TIME_INSTANT_LAYER
-    std::cerr << "TimeInstantLayer::drawDrag(" << e->x() << ")" << std::endl;
+    cerr << "TimeInstantLayer::drawDrag(" << e->x() << ")" << endl;
 #endif
 
     if (!m_model || !m_editing) return;
@@ -509,7 +509,7 @@
 TimeInstantLayer::drawEnd(View *, QMouseEvent *e)
 {
 #ifdef DEBUG_TIME_INSTANT_LAYER
-    std::cerr << "TimeInstantLayer::drawEnd(" << e->x() << ")" << std::endl;
+    cerr << "TimeInstantLayer::drawEnd(" << e->x() << ")" << endl;
 #endif
     if (!m_model || !m_editing) return;
     QString newName = tr("Add Point at %1 s")
@@ -570,7 +570,7 @@
 TimeInstantLayer::editStart(View *v, QMouseEvent *e)
 {
 #ifdef DEBUG_TIME_INSTANT_LAYER
-    std::cerr << "TimeInstantLayer::editStart(" << e->x() << ")" << std::endl;
+    cerr << "TimeInstantLayer::editStart(" << e->x() << ")" << endl;
 #endif
 
     if (!m_model) return;
@@ -592,7 +592,7 @@
 TimeInstantLayer::editDrag(View *v, QMouseEvent *e)
 {
 #ifdef DEBUG_TIME_INSTANT_LAYER
-    std::cerr << "TimeInstantLayer::editDrag(" << e->x() << ")" << std::endl;
+    cerr << "TimeInstantLayer::editDrag(" << e->x() << ")" << endl;
 #endif
 
     if (!m_model || !m_editing) return;
@@ -615,7 +615,7 @@
 TimeInstantLayer::editEnd(View *, QMouseEvent *e)
 {
 #ifdef DEBUG_TIME_INSTANT_LAYER
-    std::cerr << "TimeInstantLayer::editEnd(" << e->x() << ")" << std::endl;
+    cerr << "TimeInstantLayer::editEnd(" << e->x() << ")" << endl;
 #endif
     if (!m_model || !m_editing) return;
     if (m_editingCommand) {
--- a/layer/TimeRulerLayer.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/layer/TimeRulerLayer.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -29,8 +29,8 @@
 
 //#define DEBUG_TIME_RULER_LAYER 1
 
-using std::cerr;
-using std::endl;
+
+
 
 TimeRulerLayer::TimeRulerLayer() :
     SingleColourLayer(),
@@ -207,7 +207,7 @@
     long startFrame = v->getFrameForX(rect.x() - 50);
 
 #ifdef DEBUG_TIME_RULER_LAYER
-    std::cerr << "start frame = " << startFrame << std::endl;
+    cerr << "start frame = " << startFrame << endl;
 #endif
 
     bool quarter = false;
@@ -217,7 +217,7 @@
     ms = (ms / incms) * incms - incms;
 
 #ifdef DEBUG_TIME_RULER_LAYER
-    std::cerr << "start ms = " << ms << " at step " << incms << std::endl;
+    cerr << "start ms = " << ms << " at step " << incms << endl;
 #endif
 
     // Calculate the number of ticks per increment -- approximate
@@ -257,7 +257,7 @@
 
         if (x >= rect.x() + rect.width() + 50) {
 #ifdef DEBUG_TIME_RULER_LAYER
-            std::cerr << "X well out of range, ending here" << std::endl;
+            cerr << "X well out of range, ending here" << endl;
 #endif
             break;
         }
@@ -267,7 +267,7 @@
             RealTime rt = RealTime::fromMilliseconds(ms);
 
 #ifdef DEBUG_TIME_RULER_LAYER
-            std::cerr << "X in range, drawing line here for time " << rt.toText() << std::endl;
+            cerr << "X in range, drawing line here for time " << rt.toText() << endl;
 #endif
 
             QString text(QString::fromStdString(rt.toText()));
@@ -278,7 +278,7 @@
                 (x < rect.x() - tw/2 ||
                  x >= rect.x() + rect.width() + tw/2)) {
 #ifdef DEBUG_TIME_RULER_LAYER
-                std::cerr << "hm, maybe X isn't in range after all (x = " << x << ", tw = " << tw << ", rect.x() = " << rect.x() << ", rect.width() = " << rect.width() << ")" << std::endl;
+                cerr << "hm, maybe X isn't in range after all (x = " << x << ", tw = " << tw << ", rect.x() = " << rect.x() << ", rect.width() = " << rect.width() << ")" << endl;
 #endif
             }
 
@@ -327,13 +327,13 @@
 
             if (x < rect.x() || x >= rect.x() + rect.width()) {
 #ifdef DEBUG_TIME_RULER_LAYER
-//                std::cerr << "tick " << i << ": X out of range, going on to next tick" << std::endl;
+//                cerr << "tick " << i << ": X out of range, going on to next tick" << endl;
 #endif
                 continue;
             }
 
 #ifdef DEBUG_TIME_RULER_LAYER
-            std::cerr << "tick " << i << " in range, drawing at " << x << std::endl;
+            cerr << "tick " << i << " in range, drawing at " << x << endl;
 #endif
 
 	    int sz = 5;
--- a/layer/TimeValueLayer.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/layer/TimeValueLayer.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -81,7 +81,7 @@
     }
 
 #ifdef DEBUG_TIME_VALUE_LAYER
-    std::cerr << "TimeValueLayer::setModel(" << model << ")" << std::endl;
+    cerr << "TimeValueLayer::setModel(" << model << ")" << endl;
 #endif
 
     emit modelReplaced();
@@ -334,7 +334,7 @@
     }
 
 #ifdef DEBUG_TIME_VALUE_LAYER
-    std::cerr << "TimeValueLayer::getValueExtents: min = " << min << ", max = " << max << std::endl;
+    cerr << "TimeValueLayer::getValueExtents: min = " << min << ", max = " << max << endl;
 #endif
 
     if (!shouldAutoAlign() && !logarithmic && !m_derivative) {
@@ -349,7 +349,7 @@
         }
 
 #ifdef DEBUG_TIME_VALUE_LAYER
-        std::cerr << "TimeValueLayer::getValueExtents: min = " << min << ", max = " << max << " (after adjustment)" << std::endl;
+        cerr << "TimeValueLayer::getValueExtents: min = " << min << ", max = " << max << " (after adjustment)" << endl;
 #endif
     }
 
@@ -376,7 +376,7 @@
     }
 
 #ifdef DEBUG_TIME_VALUE_LAYER
-    std::cerr << "TimeValueLayer::getDisplayExtents: min = " << min << ", max = " << max << std::endl;
+    cerr << "TimeValueLayer::getDisplayExtents: min = " << min << ", max = " << max << endl;
 #endif
 
     return true;
@@ -399,7 +399,7 @@
     m_scaleMaximum = max;
 
 #ifdef DEBUG_TIME_VALUE_LAYER
-    std::cerr << "TimeValueLayer::setDisplayExtents: min = " << min << ", max = " << max << std::endl;
+    cerr << "TimeValueLayer::setDisplayExtents: min = " << min << ", max = " << max << endl;
 #endif
     
     emit layerParametersChanged();
@@ -431,7 +431,7 @@
     int nr = mapper->getPositionForValue(dmax - dmin);
 
 #ifdef DEBUG_TIME_VALUE_LAYER
-    std::cerr << "TimeValueLayer::getCurrentVerticalZoomStep: dmin = " << dmin << ", dmax = " << dmax << ", nr = " << nr << std::endl;
+    cerr << "TimeValueLayer::getCurrentVerticalZoomStep: dmin = " << dmin << ", dmax = " << dmax << ", nr = " << nr << endl;
 #endif
 
     delete mapper;
@@ -468,7 +468,7 @@
         newmin = newmax - newdist;
 
 #ifdef DEBUG_TIME_VALUE_LAYER
-        std::cerr << "newmin = " << newmin << ", newmax = " << newmax << std::endl;
+        cerr << "newmin = " << newmin << ", newmax = " << newmax << endl;
 #endif
 
     } else {
@@ -486,7 +486,7 @@
     }
     
 #ifdef DEBUG_TIME_VALUE_LAYER
-    std::cerr << "TimeValueLayer::setVerticalZoomStep: " << step << ": " << newmin << " -> " << newmax << " (range " << newdist << ")" << std::endl;
+    cerr << "TimeValueLayer::setVerticalZoomStep: " << step << ": " << newmin << " -> " << newmax << " (range " << newdist << ")" << endl;
 #endif
 
     setDisplayExtents(newmin, newmax);
@@ -792,7 +792,7 @@
     }
 
 #ifdef DEBUG_TIME_VALUE_LAYER
-    std::cerr << "TimeValueLayer::getScaleExtents: min = " << min << ", max = " << max << std::endl;
+    cerr << "TimeValueLayer::getScaleExtents: min = " << min << ", max = " << max << endl;
 #endif
 }
 
@@ -806,8 +806,8 @@
     getScaleExtents(v, min, max, logarithmic);
 
 #ifdef DEBUG_TIME_VALUE_LAYER
-    std::cerr << "getYForValue(" << val << "): min " << min << ", max "
-              << max << ", log " << logarithmic << std::endl;
+    cerr << "getYForValue(" << val << "): min " << min << ", max "
+              << max << ", log " << logarithmic << endl;
 #endif
 
     if (logarithmic) {
@@ -858,8 +858,8 @@
     }
 
 #ifdef DEBUG_TIME_VALUE_LAYER
-    std::cerr << "TimeValueLayer::getColourForValue: min " << min << ", max "
-              << max << ", log " << log << ", value " << val << std::endl;
+    cerr << "TimeValueLayer::getColourForValue: min " << min << ", max "
+              << max << ", log " << log << ", value " << val << endl;
 #endif
 
     QColor solid = ColourMapper(m_colourMap, min, max).map(val);
@@ -902,8 +902,8 @@
     paint.setBrush(brushColour);
 
 #ifdef DEBUG_TIME_VALUE_LAYER
-    std::cerr << "TimeValueLayer::paint: resolution is "
-	      << m_model->getResolution() << " frames" << std::endl;
+    cerr << "TimeValueLayer::paint: resolution is "
+	      << m_model->getResolution() << " frames" << endl;
 #endif
 
     float min = m_model->getValueMinimum();
@@ -920,7 +920,7 @@
 	SparseTimeValueModel::PointList localPoints =
 	    getLocalPoints(v, localPos.x());
 #ifdef DEBUG_TIME_VALUE_LAYER
-        std::cerr << "TimeValueLayer: " << localPoints.size() << " local points" << std::endl;
+        cerr << "TimeValueLayer: " << localPoints.size() << " local points" << endl;
 #endif
 	if (!localPoints.empty()) illuminateFrame = localPoints.begin()->frame;
     }
@@ -1004,8 +1004,8 @@
 	    haveNext = true;
         }
 
-//        std::cout << "frame = " << p.frame << ", x = " << x << ", haveNext = " << haveNext 
-//                  << ", nx = " << nx << std::endl;
+//        cout << "frame = " << p.frame << ", x = " << x << ", haveNext = " << haveNext 
+//                  << ", nx = " << nx << endl;
 
         if (m_plotStyle == PlotDiscreteCurves) {
             paint.setPen(QPen(getBaseQColor(), 3));
@@ -1132,7 +1132,7 @@
 	if (m_plotStyle == PlotSegmentation) {
 
 #ifdef DEBUG_TIME_VALUE_LAYER
-            std::cerr << "drawing rect" << std::endl;
+            cerr << "drawing rect" << endl;
 #endif
 	    
 	    if (nx <= x) continue;
@@ -1263,7 +1263,7 @@
         if (prec < 0) dp = -prec;
         round = powf(10.f, prec);
 #ifdef DEBUG_TIME_VALUE_LAYER
-        std::cerr << "inc = " << inc << ", round = " << round << ", dp = " << dp << std::endl;
+        cerr << "inc = " << inc << ", round = " << round << ", dp = " << dp << endl;
 #endif
     }
 
@@ -1286,7 +1286,7 @@
             }
             dispval = lrintf(val / round) * round;
 #ifdef DEBUG_TIME_VALUE_LAYER
-            std::cerr << "val = " << val << ", dispval = " << dispval << std::endl;
+            cerr << "val = " << val << ", dispval = " << dispval << endl;
 #endif
             if (logarithmic) {
                 y = getYForValue(v, LogRange::unmap(dispval));
@@ -1342,7 +1342,7 @@
 TimeValueLayer::drawStart(View *v, QMouseEvent *e)
 {
 #ifdef DEBUG_TIME_VALUE_LAYER
-    std::cerr << "TimeValueLayer::drawStart(" << e->x() << "," << e->y() << ")" << std::endl;
+    cerr << "TimeValueLayer::drawStart(" << e->x() << "," << e->y() << ")" << endl;
 #endif
 
     if (!m_model) return;
@@ -1362,7 +1362,7 @@
              i != points.end(); ++i) {
             if (((i->frame / resolution) * resolution) != frame) {
 #ifdef DEBUG_TIME_VALUE_LAYER
-                std::cerr << "ignoring out-of-range frame at " << i->frame << std::endl;
+                cerr << "ignoring out-of-range frame at " << i->frame << endl;
 #endif
                 continue;
             }
@@ -1392,7 +1392,7 @@
 TimeValueLayer::drawDrag(View *v, QMouseEvent *e)
 {
 #ifdef DEBUG_TIME_VALUE_LAYER
-    std::cerr << "TimeValueLayer::drawDrag(" << e->x() << "," << e->y() << ")" << std::endl;
+    cerr << "TimeValueLayer::drawDrag(" << e->x() << "," << e->y() << ")" << endl;
 #endif
 
     if (!m_model || !m_editing) return;
@@ -1407,7 +1407,7 @@
     SparseTimeValueModel::PointList points = getLocalPoints(v, e->x());
 
 #ifdef DEBUG_TIME_VALUE_LAYER
-    std::cerr << points.size() << " points" << std::endl;
+    cerr << points.size() << " points" << endl;
 #endif
 
     bool havePoint = false;
@@ -1418,18 +1418,18 @@
             if (i->frame == m_editingPoint.frame &&
                 i->value == m_editingPoint.value) {
 #ifdef DEBUG_TIME_VALUE_LAYER
-                std::cerr << "ignoring current editing point at " << i->frame << ", " << i->value << std::endl;
+                cerr << "ignoring current editing point at " << i->frame << ", " << i->value << endl;
 #endif
                 continue;
             }
             if (((i->frame / resolution) * resolution) != frame) {
 #ifdef DEBUG_TIME_VALUE_LAYER
-                std::cerr << "ignoring out-of-range frame at " << i->frame << std::endl;
+                cerr << "ignoring out-of-range frame at " << i->frame << endl;
 #endif
                 continue;
             }
 #ifdef DEBUG_TIME_VALUE_LAYER
-            std::cerr << "adjusting to new point at " << i->frame << ", " << i->value << std::endl;
+            cerr << "adjusting to new point at " << i->frame << ", " << i->value << endl;
 #endif
             m_editingPoint = *i;
             m_originalPoint = m_editingPoint;
@@ -1454,7 +1454,7 @@
 TimeValueLayer::drawEnd(View *, QMouseEvent *)
 {
 #ifdef DEBUG_TIME_VALUE_LAYER
-    std::cerr << "TimeValueLayer::drawEnd" << std::endl;
+    cerr << "TimeValueLayer::drawEnd" << endl;
 #endif
     if (!m_model || !m_editing) return;
     finish(m_editingCommand);
@@ -1511,7 +1511,7 @@
 TimeValueLayer::editStart(View *v, QMouseEvent *e)
 {
 #ifdef DEBUG_TIME_VALUE_LAYER
-    std::cerr << "TimeValueLayer::editStart(" << e->x() << "," << e->y() << ")" << std::endl;
+    cerr << "TimeValueLayer::editStart(" << e->x() << "," << e->y() << ")" << endl;
 #endif
 
     if (!m_model) return;
@@ -1534,7 +1534,7 @@
 TimeValueLayer::editDrag(View *v, QMouseEvent *e)
 {
 #ifdef DEBUG_TIME_VALUE_LAYER
-    std::cerr << "TimeValueLayer::editDrag(" << e->x() << "," << e->y() << ")" << std::endl;
+    cerr << "TimeValueLayer::editDrag(" << e->x() << "," << e->y() << ")" << endl;
 #endif
 
     if (!m_model || !m_editing) return;
@@ -1560,7 +1560,7 @@
 TimeValueLayer::editEnd(View *, QMouseEvent *)
 {
 #ifdef DEBUG_TIME_VALUE_LAYER
-    std::cerr << "TimeValueLayer::editEnd" << std::endl;
+    cerr << "TimeValueLayer::editEnd" << endl;
 #endif
     if (!m_model || !m_editing) return;
 
@@ -1900,17 +1900,17 @@
             newPoint.value = i->getValue();
         } else {
 #ifdef DEBUG_TIME_VALUE_LAYER
-            std::cerr << "Setting value on point at " << newPoint.frame << " from labeller";
+            cerr << "Setting value on point at " << newPoint.frame << " from labeller";
             if (i == points.begin()) {
-                std::cerr << ", no prev point" << std::endl;
+                cerr << ", no prev point" << endl;
             } else {
-                std::cerr << ", prev point is at " << prevPoint.frame << std::endl;
+                cerr << ", prev point is at " << prevPoint.frame << endl;
             }
 #endif
             labeller.setValue<SparseTimeValueModel::Point>
                 (newPoint, (i == points.begin()) ? 0 : &prevPoint);
 #ifdef DEBUG_TIME_VALUE_LAYER
-            std::cerr << "New point value = " << newPoint.value << std::endl;
+            cerr << "New point value = " << newPoint.value << endl;
 #endif
             if (labeller.actingOnPrevPoint() && i != points.begin()) {
                 usePrev = true;
@@ -1973,7 +1973,7 @@
     float min = attributes.value("scaleMinimum").toFloat(&ok);
     float max = attributes.value("scaleMaximum").toFloat(&alsoOk);
 #ifdef DEBUG_TIME_VALUE_LAYER
-    std::cerr << "from properties: min = " << min << ", max = " << max << std::endl;
+    cerr << "from properties: min = " << min << ", max = " << max << endl;
 #endif
     if (ok && alsoOk && min != max) setDisplayExtents(min, max);
 }
--- a/layer/WaveformLayer.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/layer/WaveformLayer.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -30,8 +30,8 @@
 
 //#define DEBUG_WAVEFORM_PAINT 1
 
-using std::cerr;
-using std::endl;
+
+
 
 WaveformLayer::WaveformLayer() :
     SingleColourLayer(),
@@ -474,7 +474,7 @@
 
 #ifdef DEBUG_WAVEFORM_PAINT
     Profiler profiler("WaveformLayer::paint", true);
-    std::cerr << "WaveformLayer::paint (" << rect.x() << "," << rect.y()
+    cerr << "WaveformLayer::paint (" << rect.x() << "," << rect.y()
 	      << ") [" << rect.width() << "x" << rect.height() << "]: zoom " << zoomLevel << endl;
 #endif
 
@@ -494,7 +494,7 @@
     if (m_aggressive) {
 
 #ifdef DEBUG_WAVEFORM_PAINT
-        std::cerr << "WaveformLayer::paint: aggressive is true" << endl;
+        cerr << "WaveformLayer::paint: aggressive is true" << endl;
 #endif
 
 	if (m_cacheValid && (zoomLevel != m_cacheZoomLevel)) {
@@ -504,7 +504,7 @@
 	if (!m_cache || m_cache->width() != w || m_cache->height() != h) {
 #ifdef DEBUG_WAVEFORM_PAINT
             if (m_cache) {
-                std::cerr << "WaveformLayer::paint: cache size " << m_cache->width() << "x" << m_cache->height() << " differs from view size " << w << "x" << h << ": regenerating aggressive cache" << endl;
+                cerr << "WaveformLayer::paint: cache size " << m_cache->width() << "x" << m_cache->height() << " differs from view size " << w << "x" << h << ": regenerating aggressive cache" << endl;
             }
 #endif
 	    delete m_cache;
@@ -562,7 +562,7 @@
     getSourceFramesForX(v, x1, modelZoomLevel, spare, frame1);
     
 #ifdef DEBUG_WAVEFORM_PAINT
-    std::cerr << "Painting waveform from " << frame0 << " to " << frame1 << " (" << (x1-x0+1) << " pixels at zoom " << zoomLevel << " and model zoom " << modelZoomLevel << ")" <<  std::endl;
+    cerr << "Painting waveform from " << frame0 << " to " << frame1 << " (" << (x1-x0+1) << " pixels at zoom " << zoomLevel << " and model zoom " << modelZoomLevel << ")" <<  endl;
 #endif
 
     RangeSummarisableTimeValueModel::RangeBlock *ranges = 
@@ -604,7 +604,7 @@
 	int my = m + (((ch - minChannel) * h) / channels);
 
 #ifdef DEBUG_WAVEFORM_PAINT	
-	std::cerr << "ch = " << ch << ", channels = " << channels << ", m = " << m << ", my = " << my << ", h = " << h << std::endl;
+	cerr << "ch = " << ch << ", channels = " << channels << ", m = " << m << ", my = " << my << ", h = " << h << endl;
 #endif
 
 	if (my - m > y1 || my + m < y0) continue;
@@ -670,7 +670,7 @@
                               *ranges, modelZoomLevel);
 
 #ifdef DEBUG_WAVEFORM_PAINT
-        std::cerr << "channel " << ch << ": " << ranges->size() << " ranges from " << frame0 << " to " << frame1 << " at zoom level " << modelZoomLevel << std::endl;
+        cerr << "channel " << ch << ": " << ranges->size() << " ranges from " << frame0 << " to " << frame1 << " at zoom level " << modelZoomLevel << endl;
 #endif
 
 	if (mergingChannels || mixingChannels) {
@@ -697,7 +697,7 @@
             f1 = f1 - 1;
 
             if (f0 < frame0) {
-                std::cerr << "ERROR: WaveformLayer::paint: pixel " << x << " has f0 = " << f0 << " which is less than range frame0 " << frame0 << " for x0 = " << x0 << std::endl;
+                cerr << "ERROR: WaveformLayer::paint: pixel " << x << " has f0 = " << f0 << " which is less than range frame0 " << frame0 << " for x0 = " << x0 << endl;
                 continue;
             }
 
@@ -705,11 +705,11 @@
             size_t i1 = (f1 - frame0) / modelZoomLevel;
 
 #ifdef DEBUG_WAVEFORM_PAINT
-            std::cerr << "WaveformLayer::paint: pixel " << x << ": i0 " << i0 << " (f " << f0 << "), i1 " << i1 << " (f " << f1 << ")" << std::endl;
+            cerr << "WaveformLayer::paint: pixel " << x << ": i0 " << i0 << " (f " << f0 << "), i1 " << i1 << " (f " << f1 << ")" << endl;
 #endif
 
             if (i1 > i0 + 1) {
-                std::cerr << "WaveformLayer::paint: ERROR: i1 " << i1 << " > i0 " << i0 << " plus one (zoom = " << zoomLevel << ", model zoom = " << modelZoomLevel << ")" << std::endl;
+                cerr << "WaveformLayer::paint: ERROR: i1 " << i1 << " > i0 " << i0 << " plus one (zoom = " << zoomLevel << ", model zoom = " << modelZoomLevel << ")" << endl;
             }
 
 	    if (ranges && i0 < ranges->size()) {
@@ -724,7 +724,7 @@
 
 	    } else {
 #ifdef DEBUG_WAVEFORM_PAINT
-                std::cerr << "No (or not enough) ranges for i0 = " << i0 << std::endl;
+                cerr << "No (or not enough) ranges for i0 = " << i0 << endl;
 #endif
 		continue;
 	    }
@@ -874,7 +874,7 @@
 	    }
 
 #ifdef DEBUG_WAVEFORM_PAINT
-            std::cerr << "range " << rangeBottom << " -> " << rangeTop << ", means " << meanBottom << " -> " << meanTop << ", raw range " << range.min() << " -> " << range.max() << std::endl;
+            cerr << "range " << rangeBottom << " -> " << rangeTop << ", means " << meanBottom << " -> " << meanTop << ", raw range " << range.min() << " -> " << range.max() << endl;
 #endif
 
             if (rangeTop == rangeBottom) {
@@ -1051,7 +1051,7 @@
         break;
     }
 
-//    std::cerr << "mergingChannels= " << mergingChannels << ", channel  = " << channel << ", value = " << value << ", vy = " << vy << std::endl;
+//    cerr << "mergingChannels= " << mergingChannels << ", channel  = " << channel << ", value = " << value << ", vy = " << vy << endl;
 
     return my - vy;
 }
--- a/view/Overview.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/view/Overview.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -24,8 +24,8 @@
 
 //#define DEBUG_OVERVIEW 1
 
-using std::cerr;
-using std::endl;
+
+
 
 Overview::Overview(QWidget *w) :
     View(w, false),
@@ -95,7 +95,7 @@
 Overview::globalCentreFrameChanged(unsigned long f)
 {
 #ifdef DEBUG_OVERVIEW
-    std::cerr << "Overview::globalCentreFrameChanged: " << f << std::endl;
+    cerr << "Overview::globalCentreFrameChanged: " << f << endl;
 #endif
     update();
 }
@@ -104,7 +104,7 @@
 Overview::viewCentreFrameChanged(View *v, unsigned long f)
 {
 #ifdef DEBUG_OVERVIEW
-    std::cerr << "Overview[" << this << "]::viewCentreFrameChanged(" << v << "): " << f << std::endl;
+    cerr << "Overview[" << this << "]::viewCentreFrameChanged(" << v << "): " << f << endl;
 #endif
     if (m_views.find(v) != m_views.end()) {
 	update();
@@ -124,7 +124,7 @@
 Overview::viewManagerPlaybackFrameChanged(unsigned long f)
 {
 #ifdef DEBUG_OVERVIEW
-    std::cerr << "Overview[" << this << "]::viewManagerPlaybackFrameChanged(" << f << "): " << f << std::endl;
+    cerr << "Overview[" << this << "]::viewManagerPlaybackFrameChanged(" << f << "): " << f << endl;
 #endif
 
     bool changed = false;
@@ -143,7 +143,7 @@
     // Recalculate zoom in case the size of the widget has changed.
 
 #ifdef DEBUG_OVERVIEW
-    std::cerr << "Overview::paintEvent: width is " << width() << ", centre frame " << m_centreFrame << std::endl;
+    cerr << "Overview::paintEvent: width is " << width() << ", centre frame " << m_centreFrame << endl;
 #endif
 
     size_t startFrame = getModelsStartFrame();
@@ -163,12 +163,12 @@
     }
     if (centreFrame != m_centreFrame) {
 #ifdef DEBUG_OVERVIEW
-        std::cerr << "Overview::paintEvent: Centre frame changed from "
+        cerr << "Overview::paintEvent: Centre frame changed from "
                   << m_centreFrame << " to " << centreFrame << " and thus start frame from " << getStartFrame();
 #endif
 	m_centreFrame = centreFrame;
 #ifdef DEBUG_OVERVIEW
-        std::cerr << " to " << getStartFrame() << std::endl;
+        cerr << " to " << getStartFrame() << endl;
 #endif
 	emit centreFrameChanged(m_centreFrame, false, PlaybackIgnore);
     }
@@ -278,7 +278,7 @@
 	std::min(m_centreFrame, newCentreFrame) > size_t(m_zoomLevel)) {
         size_t rf = alignToReference(newCentreFrame);
 #ifdef DEBUG_OVERVIEW
-        std::cerr << "Overview::mouseMoveEvent: x " << e->x() << " and click x " << m_clickPos.x() << " -> frame " << newCentreFrame << " -> rf " << rf << std::endl;
+        cerr << "Overview::mouseMoveEvent: x " << e->x() << " and click x " << m_clickPos.x() << " -> frame " << newCentreFrame << " -> rf " << rf << endl;
 #endif
 	emit centreFrameChanged(rf, true, PlaybackScrollContinuous);
     }
@@ -291,7 +291,7 @@
     size_t rf = 0;
     if (frame > 0) rf = alignToReference(frame);
 #ifdef DEBUG_OVERVIEW
-    std::cerr << "Overview::mouseDoubleClickEvent: frame " << frame << " -> rf " << rf << std::endl;
+    cerr << "Overview::mouseDoubleClickEvent: frame " << frame << " -> rf " << rf << endl;
 #endif
     m_clickedInRange = false; // we're not starting a drag with the second click
     emit centreFrameChanged(rf, true, PlaybackScrollContinuous);
--- a/view/Pane.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/view/Pane.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -58,8 +58,8 @@
 
 //#define DEBUG_PANE
 
-using std::cerr;
-using std::endl;
+
+
 
 QCursor *Pane::m_measureCursor1 = 0;
 QCursor *Pane::m_measureCursor2 = 0;
@@ -115,7 +115,7 @@
         ++count;
     }
 
-    std::cerr << "Have " << count+1 << " zoom levels" << std::endl;
+    cerr << "Have " << count+1 << " zoom levels" << endl;
 */
 
     Layer *layer = 0;
@@ -228,25 +228,25 @@
                 step *= 2;
                 --pwr;
             }
-//            std::cerr << level << std::endl;
+//            cerr << level << endl;
             level += step;
             if (++count == 100 || level > 262144) break;
         }
     }
 
-//    std::cerr << "Have " << count << " zoom levels" << std::endl;
+//    cerr << "Have " << count << " zoom levels" << endl;
 
     m_hthumb->setMinimumValue(0);
     m_hthumb->setMaximumValue(count);
     m_hthumb->setValue(count - current);
 
-//    std::cerr << "set value to " << count-current << std::endl;
-
-//    std::cerr << "default value is " << m_hthumb->getDefaultValue() << std::endl;
+//    cerr << "set value to " << count-current << endl;
+
+//    cerr << "default value is " << m_hthumb->getDefaultValue() << endl;
 
     if (count != 50 && m_hthumb->getDefaultValue() == 0) {
         m_hthumb->setDefaultValue(count - current);
-//        std::cerr << "set default value to " << m_hthumb->getDefaultValue() << std::endl;
+//        cerr << "set default value to " << m_hthumb->getDefaultValue() << endl;
     }
 
     bool haveVThumb = false;
@@ -266,9 +266,9 @@
             m_vthumb->setValue(layer->getCurrentVerticalZoomStep());
             m_vthumb->blockSignals(false);
 
-//            std::cerr << "Vertical thumbwheel: min 0, max " << max
+//            cerr << "Vertical thumbwheel: min 0, max " << max
 //                      << ", default " << defaultStep << ", value "
-//                      << m_vthumb->getValue() << std::endl;
+//                      << m_vthumb->getValue() << endl;
 
         }
     }
@@ -779,11 +779,11 @@
     const Model *reference = model->getAlignmentReference();
 /*
     if (!reference) {
-        std::cerr << "Pane[" << this << "]::drawAlignmentStatus: No reference" << std::endl;
+        cerr << "Pane[" << this << "]::drawAlignmentStatus: No reference" << endl;
     } else if (reference == model) {
-        std::cerr << "Pane[" << this << "]::drawAlignmentStatus: This is the reference model" << std::endl;
+        cerr << "Pane[" << this << "]::drawAlignmentStatus: This is the reference model" << endl;
     } else {
-        std::cerr << "Pane[" << this << "]::drawAlignmentStatus: This is not the reference" << std::endl;
+        cerr << "Pane[" << this << "]::drawAlignmentStatus: This is not the reference" << endl;
     }
 */
     QString text;
@@ -883,8 +883,8 @@
     std::vector<QPixmap> pixmaps;
     for (LayerList::iterator i = m_layers.begin(); i != m_layers.end(); ++i) {
         texts.push_back((*i)->getLayerPresentationName());
-//        std::cerr << "Pane " << this << ": Layer presentation name for " << *i << ": "
-//                  << texts[texts.size()-1] << std::endl;
+//        cerr << "Pane " << this << ": Layer presentation name for " << *i << ": "
+//                  << texts[texts.size()-1] << endl;
         pixmaps.push_back((*i)->getLayerPresentationPixmap
                           (QSize(fontAscent, fontAscent)));
     }
@@ -901,7 +901,7 @@
     
         for (size_t i = 0; i < texts.size(); ++i) {
 
-//            std::cerr << "Pane "<< this << ": text " << i << ": " << texts[i] << std::endl;
+//            cerr << "Pane "<< this << ": text " << i << ": " << texts[i] << endl;
             
             if (i + 1 == texts.size()) {
                 paint.setPen(getForeground());
@@ -1283,7 +1283,7 @@
         return;
     }
 
-   // std::cerr << "mousePressEvent" << std::endl;
+//    cerr << "mousePressEvent" << endl;
 
     m_clickPos = e->pos();
     m_mousePos = m_clickPos;
@@ -1412,7 +1412,7 @@
         return;
     }
 
-//    std::cerr << "mouseReleaseEvent" << std::endl;
+//    cerr << "mouseReleaseEvent" << endl;
 
     ViewManager::ToolMode mode = ViewManager::NavigateMode;
     if (m_manager) mode = m_manager->getToolMode();
@@ -1538,7 +1538,7 @@
         return;
     }
 
-//    std::cerr << "mouseMoveEvent" << std::endl;
+//    cerr << "mouseMoveEvent" << endl;
 
     QPoint pos = e->pos();
     updateContextHelp(&pos);
@@ -1808,11 +1808,11 @@
     }
         
     float ratio = float(w) / float(width());
-//  std::cerr << "ratio: " << ratio << std::endl;
+//	cerr << "ratio: " << ratio << endl;
     size_t newZoomLevel = (size_t)nearbyint(m_zoomLevel * ratio);
     if (newZoomLevel < 1) newZoomLevel = 1;
 
-//  std::cerr << "start: " << m_startFrame << ", level " << m_zoomLevel << std::endl;
+//	cerr << "start: " << m_startFrame << ", level " << m_zoomLevel << endl;
     setZoomLevel(getZoomConstraintBlockSize(newZoomLevel));
     setStartFrame(newStartFrame);
 
@@ -1836,12 +1836,12 @@
         }
         float rmin = min + ((max - min) * (height() - y1)) / height();
         float rmax = min + ((max - min) * (height() - y0)) / height();
-        std::cerr << "min: " << min << ", max: " << max << ", y0: " << y0 << ", y1: " << y1 << ", h: " << height() << ", rmin: " << rmin << ", rmax: " << rmax << std::endl;
+        cerr << "min: " << min << ", max: " << max << ", y0: " << y0 << ", y1: " << y1 << ", h: " << height() << ", rmin: " << rmin << ", rmax: " << rmax << endl;
         if (log) {
             rmin = powf(10, rmin);
             rmax = powf(10, rmax);
         }
-        std::cerr << "finally: rmin: " << rmin << ", rmax: " << rmax << " " << unit << std::endl;
+        cerr << "finally: rmin: " << rmin << ", rmax: " << rmax << " " << unit << endl;
 
         layer->setDisplayExtents(rmin, rmax);
         updateVerticalPanner();
@@ -1923,12 +1923,12 @@
 
         if (getTopLayerDisplayExtents(vmin, vmax, dmin, dmax)) {
 
-//            std::cerr << "ydiff = " << ydiff << std::endl;
+//            cerr << "ydiff = " << ydiff << endl;
 
             int ydiff = e->y() - m_clickPos.y();
             float perpix = (dmax - dmin) / height();
             float valdiff = ydiff * perpix;
-//            std::cerr << "valdiff = " << valdiff << std::endl;
+//            cerr << "valdiff = " << valdiff << endl;
 
             if (m_dragMode == UnresolvedDrag && ydiff != 0) {
                 m_dragMode = VerticalDrag;
@@ -1944,8 +1944,8 @@
                 newmin -= newmax - vmax;
                 newmax -= newmax - vmax;
             }
-//            std::cerr << "(" << dmin << ", " << dmax << ") -> ("
-//                      << newmin << ", " << newmax << ") (drag start " << m_dragStartMinValue << ")" << std::endl;
+//            cerr << "(" << dmin << ", " << dmax << ") -> ("
+//                      << newmin << ", " << newmax << ") (drag start " << m_dragStartMinValue << ")" << endl;
 
             setTopLayerDisplayExtents(newmin, newmax);
             updateVerticalPanner();
@@ -2027,8 +2027,8 @@
         layer->snapToFeatureFrame(this, snapFrameRight,
                                   resolution, Layer::SnapRight);
     }
-    
-//  std::cerr << "snap: frame = " << mouseFrame << ", start frame = " << m_selectionStartFrame << ", left = " << snapFrameLeft << ", right = " << snapFrameRight << std::endl;
+	
+//	cerr << "snap: frame = " << mouseFrame << ", start frame = " << m_selectionStartFrame << ", left = " << snapFrameLeft << ", right = " << snapFrameRight << endl;
 
     if (snapFrameLeft < 0) snapFrameLeft = 0;
     if (snapFrameRight < 0) snapFrameRight = 0;
@@ -2091,7 +2091,7 @@
         return;
     }
 
-//    std::cerr << "mouseDoubleClickEvent" << std::endl;
+//    cerr << "mouseDoubleClickEvent" << endl;
 
     m_clickPos = e->pos();
     m_clickedInRange = true;
@@ -2172,7 +2172,7 @@
 void
 Pane::wheelEvent(QWheelEvent *e)
 {
-    //std::cerr << "wheelEvent, delta " << e->delta() << std::endl;
+    //cerr << "wheelEvent, delta " << e->delta() << endl;
 
     int count = e->delta();
 
@@ -2291,13 +2291,13 @@
                 step *= 2;
                 --pwr;
             }
-//            std::cerr << level << std::endl;
+//            cerr << level << endl;
             level += step;
             if (++count == 100 || level > 262144) break;
         }
     }
         
-//    std::cerr << "new level is " << level << std::endl;
+//    cerr << "new level is " << level << endl;
     setZoomLevel(level);
 }    
 
@@ -2329,8 +2329,8 @@
     float y1 = y0 + h;
     float newmax = vmin + ((1.0 - y0) * (vmax - vmin));
     float newmin = vmin + ((1.0 - y1) * (vmax - vmin));
-//    std::cerr << "verticalPannerMoved: (" << x0 << "," << y0 << "," << w
-//              << "," << h << ") -> (" << newmin << "," << newmax << ")" << std::endl;
+//    cerr << "verticalPannerMoved: (" << x0 << "," << y0 << "," << w
+//              << "," << h << ") -> (" << newmin << "," << newmax << ")" << endl;
     setTopLayerDisplayExtents(newmin, newmax);
 }
 
@@ -2370,10 +2370,10 @@
 Pane::dragEnterEvent(QDragEnterEvent *e)
 {
     QStringList formats(e->mimeData()->formats());
-    std::cerr << "dragEnterEvent: format: "
-              << formats.join(",").toStdString()
+    cerr << "dragEnterEvent: format: "
+              << formats.join(",")
               << ", possibleActions: " << e->possibleActions()
-              << ", proposedAction: " << e->proposedAction() << std::endl;
+              << ", proposedAction: " << e->proposedAction() << endl;
     
     if (e->mimeData()->hasFormat("text/uri-list") ||
         e->mimeData()->hasFormat("text/plain")) {
@@ -2390,8 +2390,8 @@
 void
 Pane::dropEvent(QDropEvent *e)
 {
-    std::cerr << "dropEvent: text: \"" << e->mimeData()->text().toStdString()
-              << "\"" << std::endl;
+    cerr << "dropEvent: text: \"" << e->mimeData()->text()
+              << "\"" << endl;
 
     if (e->mimeData()->hasFormat("text/uri-list") || 
         e->mimeData()->hasFormat("text/plain")) {
@@ -2560,8 +2560,8 @@
 void
 Pane::viewZoomLevelChanged(View *v, unsigned long z, bool locked)
 {
-//    std::cerr << "Pane[" << this << "]::zoomLevelChanged (global now "
-//              << (m_manager ? m_manager->getGlobalZoom() : 0) << ")" << std::endl;
+//    cerr << "Pane[" << this << "]::zoomLevelChanged (global now "
+//              << (m_manager ? m_manager->getGlobalZoom() : 0) << ")" << endl;
 
     View::viewZoomLevelChanged(v, z, locked);
 
--- a/view/PaneStack.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/view/PaneStack.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -258,7 +258,7 @@
 	}
 
 	if (!found) {
-	    std::cerr << "WARNING: PaneStack::deletePane(" << pane << "): Pane not found in visible or hidden panes, not deleting" << std::endl;
+	    cerr << "WARNING: PaneStack::deletePane(" << pane << "): Pane not found in visible or hidden panes, not deleting" << endl;
 	    return;
 	}
     }
@@ -283,7 +283,7 @@
 void
 PaneStack::showOrHidePaneAccessories()
 {
-    std::cerr << "PaneStack::showOrHidePaneAccessories: count == " << getPaneCount() << std::endl;
+    cerr << "PaneStack::showOrHidePaneAccessories: count == " << getPaneCount() << endl;
 
     bool multi = (getPaneCount() > 1);
     for (std::vector<PaneRec>::iterator i = m_panes.begin();
@@ -335,7 +335,7 @@
 	++i;
     }
 
-    std::cerr << "WARNING: PaneStack::hidePane(" << pane << "): Pane not found in visible panes" << std::endl;
+    cerr << "WARNING: PaneStack::hidePane(" << pane << "): Pane not found in visible panes" << endl;
 }
 
 void
@@ -359,7 +359,7 @@
 	++i;
     }
 
-    std::cerr << "WARNING: PaneStack::showPane(" << pane << "): Pane not found in hidden panes" << std::endl;
+    cerr << "WARNING: PaneStack::showPane(" << pane << "): Pane not found in hidden panes" << endl;
 }
 
 void
@@ -398,7 +398,7 @@
 	m_currentPane = pane;
 	emit currentPaneChanged(m_currentPane);
     } else {
-	std::cerr << "WARNING: PaneStack::setCurrentPane(" << pane << "): pane is not a visible pane in this stack" << std::endl;
+	cerr << "WARNING: PaneStack::setCurrentPane(" << pane << "): pane is not a visible pane in this stack" << endl;
     }
 }
 
@@ -602,11 +602,11 @@
     }
 
 /*
-    std::cerr << "sizes: ";
+    cerr << "sizes: ";
     for (int i = 0; i < sizes.size(); ++i) {
-        std::cerr << sizes[i] << " ";
+        cerr << sizes[i] << " ";
     }
-    std::cerr << std::endl;
+    cerr << endl;
 */
 
     m_splitter->setSizes(sizes);
--- a/view/View.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/view/View.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -43,8 +43,8 @@
 
 //#define DEBUG_VIEW_WIDGET_PAINT 1
 
-using std::cerr;
-using std::endl;
+
+
 
 View::View(QWidget *w, bool showProgress) :
     QFrame(w),
@@ -325,7 +325,7 @@
 	if (newPixel != formerPixel) {
 
 #ifdef DEBUG_VIEW_WIDGET_PAINT
-	    std::cout << "View(" << this << ")::setCentreFrame: newPixel " << newPixel << ", formerPixel " << formerPixel << std::endl;
+	    cout << "View(" << this << ")::setCentreFrame: newPixel " << newPixel << ", formerPixel " << formerPixel << endl;
 #endif
 	    update();
 
@@ -335,9 +335,9 @@
 	if (e) {
             size_t rf = alignToReference(f);
 #ifdef DEBUG_VIEW_WIDGET_PAINT
-            std::cerr << "View[" << this << "]::setCentreFrame(" << f
+            cerr << "View[" << this << "]::setCentreFrame(" << f
                       << "): emitting centreFrameChanged("
-                      << rf << ")" << std::endl;
+                      << rf << ")" << endl;
 #endif
             emit centreFrameChanged(rf, m_followPan, m_followPlay);
         }
@@ -436,7 +436,7 @@
 View::getZoomLevel() const
 {
 #ifdef DEBUG_VIEW_WIDGET_PAINT
-//	std::cout << "zoom level: " << m_zoomLevel << std::endl;
+//	cout << "zoom level: " << m_zoomLevel << endl;
 #endif
     return m_zoomLevel;
 }
@@ -753,7 +753,7 @@
         
         QRect r = paint.fontMetrics().boundingRect(text);
         r.translate(QPoint(x, y));
-//        std::cerr << "drawVisibleText: r = " << r.x() << "," <<r.y() << " " << r.width() << "x" << r.height() << std::endl;
+//        cerr << "drawVisibleText: r = " << r.x() << "," <<r.y() << " " << r.width() << "x" << r.height() << endl;
         paint.drawRect(r);
         paint.setBrush(Qt::NoBrush);
 
@@ -774,7 +774,7 @@
 
     } else {
 
-	std::cerr << "ERROR: View::drawVisibleText: Boxed style not yet implemented!" << std::endl;
+	cerr << "ERROR: View::drawVisibleText: Boxed style not yet implemented!" << endl;
     }
 }
 
@@ -791,7 +791,7 @@
     QObject *obj = sender();
 
 #ifdef DEBUG_VIEW_WIDGET_PAINT
-    std::cerr << "View(" << this << ")::modelChanged()" << std::endl;
+    cerr << "View(" << this << ")::modelChanged()" << endl;
 #endif
     
     // If the model that has changed is not used by any of the cached
@@ -830,7 +830,7 @@
     size_t myEndFrame = getEndFrame();
 
 #ifdef DEBUG_VIEW_WIDGET_PAINT
-    std::cerr << "View(" << this << ")::modelChanged(" << startFrame << "," << endFrame << ") [me " << myStartFrame << "," << myEndFrame << "]" << std::endl;
+    cerr << "View(" << this << ")::modelChanged(" << startFrame << "," << endFrame << ") [me " << myStartFrame << "," << myEndFrame << "]" << endl;
 #endif
 
     if (myStartFrame > 0 && endFrame < size_t(myStartFrame)) {
@@ -873,7 +873,7 @@
 void
 View::modelCompletionChanged()
 {
-//    std::cerr << "View(" << this << ")::modelCompletionChanged()" << std::endl;
+//    cerr << "View(" << this << ")::modelCompletionChanged()" << endl;
 
     QObject *obj = sender();
     checkProgress(obj);
@@ -882,7 +882,7 @@
 void
 View::modelAlignmentCompletionChanged()
 {
-//    std::cerr << "View(" << this << ")::modelAlignmentCompletionChanged()" << std::endl;
+//    cerr << "View(" << this << ")::modelAlignmentCompletionChanged()" << endl;
 
     QObject *obj = sender();
     checkProgress(obj);
@@ -892,7 +892,7 @@
 View::modelReplaced()
 {
 #ifdef DEBUG_VIEW_WIDGET_PAINT
-    std::cerr << "View(" << this << ")::modelReplaced()" << std::endl;
+    cerr << "View(" << this << ")::modelReplaced()" << endl;
 #endif
     delete m_cache;
     m_cache = 0;
@@ -945,8 +945,8 @@
     if (m_followPan) {
         size_t f = alignFromReference(rf);
 #ifdef DEBUG_VIEW_WIDGET_PAINT
-        std::cerr << "View[" << this << "]::globalCentreFrameChanged(" << rf
-                  << "): setting centre frame to " << f << std::endl;
+        cerr << "View[" << this << "]::globalCentreFrameChanged(" << rf
+                  << "): setting centre frame to " << f << endl;
 #endif
         setCentreFrame(f, false);
     }
@@ -1014,8 +1014,8 @@
 	}
 
 #ifdef DEBUG_VIEW_WIDGET_PAINT
-	std::cerr << "PlaybackScrollPage: f = " << m_playPointerFrame << ", sf = " << sf << ", start frame "
-		  << getStartFrame() << std::endl;
+	cerr << "PlaybackScrollPage: f = " << m_playPointerFrame << ", sf = " << sf << ", start frame "
+		  << getStartFrame() << endl;
 #endif
 
 	// We don't consider scrolling unless the pointer is outside
@@ -1024,7 +1024,7 @@
 	int xnew = getXForFrame(m_playPointerFrame);
 
 #ifdef DEBUG_VIEW_WIDGET_PAINT
-	std::cerr << "xnew = " << xnew << ", width = " << width() << std::endl;
+	cerr << "xnew = " << xnew << ", width = " << width() << endl;
 #endif
 
 	if (xnew < width()/8 || xnew > (width()*7)/8) {
@@ -1057,7 +1057,7 @@
 View::viewZoomLevelChanged(View *p, unsigned long z, bool locked)
 {
 #ifdef DEBUG_VIEW_WIDGET_PAINT
-    std::cerr  << "View[" << this << "]: viewZoomLevelChanged(" << p << ", " << z << ", " << locked << ")" << std::endl;
+    cerr  << "View[" << this << "]: viewZoomLevelChanged(" << p << ", " << z << ", " << locked << ")" << endl;
 #endif
     if (m_followZoom && p != this && locked) {
         setZoomLevel(z);
@@ -1245,16 +1245,16 @@
 /*
     Model *pm = m_manager->getPlaybackModel();
 
-//    std::cerr << "View[" << this << "]::getAlignedPlaybackFrame: pf = " << pf;
+//    cerr << "View[" << this << "]::getAlignedPlaybackFrame: pf = " << pf;
 
     if (pm) {
         pf = pm->alignToReference(pf);
-//        std::cerr << " -> " << pf;
+//        cerr << " -> " << pf;
     }
 */
     int af = aligningModel->alignFromReference(pf);
 
-//    std::cerr << ", aligned = " << af << std::endl;
+//    cerr << ", aligned = " << af << endl;
     return af;
 }
 
@@ -1281,8 +1281,8 @@
 
     for (LayerList::const_iterator i = m_layers.begin(); i != m_layers.end(); ++i) {
 //        SVDEBUG << "View::getScrollableBackLayers: calling isLayerDormant on layer " << *i << endl;
-//        std::cerr << "(name is " << (*i)->objectName() << ")"
-//                  << std::endl;
+//        cerr << "(name is " << (*i)->objectName() << ")"
+//                  << endl;
 //        SVDEBUG << "View::getScrollableBackLayers: I am " << this << endl;
 	if ((*i)->isLayerDormant(this)) continue;
 	if ((*i)->isLayerOpaque()) {
@@ -1485,7 +1485,7 @@
 
 	    } else {
 
-//                std::cerr << "progress = " << completion << std::endl;
+//                cerr << "progress = " << completion << endl;
 
                 if (!pb->isVisible()) {
                     i->second.lastCheck = 0;
@@ -1578,8 +1578,8 @@
     if (e) {
 	cacheRect &= e->rect();
 #ifdef DEBUG_VIEW_WIDGET_PAINT
-	std::cerr << "paint rect " << cacheRect.width() << "x" << cacheRect.height()
-		  << ", my rect " << width() << "x" << height() << std::endl;
+	cerr << "paint rect " << cacheRect.width() << "x" << cacheRect.height()
+		  << ", my rect " << width() << "x" << height() << endl;
 #endif
     }
 
@@ -1619,11 +1619,11 @@
     }
 
 #ifdef DEBUG_VIEW_WIDGET_PAINT
-    std::cerr << "View(" << this << ")::paintEvent: have " << scrollables.size()
+    cerr << "View(" << this << ")::paintEvent: have " << scrollables.size()
 	      << " scrollable back layers and " << nonScrollables.size()
-	      << " non-scrollable front layers" << std::endl;
-    std::cerr << "haveSelections " << haveSelections << ", selectionCacheable "
-	      << selectionCacheable << ", m_selectionCached " << m_selectionCached << std::endl;
+	      << " non-scrollable front layers" << endl;
+    cerr << "haveSelections " << haveSelections << ", selectionCacheable "
+	      << selectionCacheable << ", m_selectionCached " << m_selectionCached << endl;
 #endif
 
     if (layersChanged || scrollables.empty() ||
@@ -1636,8 +1636,8 @@
     if (!scrollables.empty()) {
 
 #ifdef DEBUG_VIEW_WIDGET_PAINT
-        std::cerr << "View(" << this << "): cache " << m_cache << ", cache zoom "
-                  << m_cacheZoomLevel << ", zoom " << m_zoomLevel << std::endl;
+        cerr << "View(" << this << "): cache " << m_cache << ", cache zoom "
+                  << m_cacheZoomLevel << ", zoom " << m_zoomLevel << endl;
 #endif
 
 	if (!m_cache ||
@@ -1651,13 +1651,13 @@
 		delete m_cache;
                 m_cache = 0;
 #ifdef DEBUG_VIEW_WIDGET_PAINT
-		std::cerr << "View(" << this << ")::paintEvent: small repaint, not bothering to recreate cache" << std::endl;
+		cerr << "View(" << this << ")::paintEvent: small repaint, not bothering to recreate cache" << endl;
 #endif
 	    } else {
 		delete m_cache;
 		m_cache = new QPixmap(width(), height());
 #ifdef DEBUG_VIEW_WIDGET_PAINT
-		std::cerr << "View(" << this << ")::paintEvent: recreated cache" << std::endl;
+		cerr << "View(" << this << ")::paintEvent: recreated cache" << endl;
 #endif
 		cacheRect = rect();
 		repaintCache = true;
@@ -1702,19 +1702,19 @@
 		    cacheRect = QRect(0, 0, dx, height());
 		}
 #ifdef DEBUG_VIEW_WIDGET_PAINT
-		std::cerr << "View(" << this << ")::paintEvent: scrolled cache by " << dx << std::endl;
+		cerr << "View(" << this << ")::paintEvent: scrolled cache by " << dx << endl;
 #endif
 	    } else {
 		cacheRect = rect();
 #ifdef DEBUG_VIEW_WIDGET_PAINT
-		std::cerr << "View(" << this << ")::paintEvent: scrolling too far" << std::endl;
+		cerr << "View(" << this << ")::paintEvent: scrolling too far" << endl;
 #endif
 	    }
 	    repaintCache = true;
 
 	} else {
 #ifdef DEBUG_VIEW_WIDGET_PAINT
-	    std::cerr << "View(" << this << ")::paintEvent: cache is good" << std::endl;
+	    cerr << "View(" << this << ")::paintEvent: cache is good" << endl;
 #endif
 	    paint.begin(this);
 	    paint.drawPixmap(cacheRect, *m_cache, cacheRect);
@@ -1728,7 +1728,7 @@
     }
 
 #ifdef DEBUG_VIEW_WIDGET_PAINT
-//    std::cerr << "View(" << this << ")::paintEvent: cacheRect " << cacheRect << ", nonCacheRect " << (nonCacheRect | cacheRect) << ", repaintCache " << repaintCache << ", paintedCacheRect " << paintedCacheRect << std::endl;
+//    cerr << "View(" << this << ")::paintEvent: cacheRect " << cacheRect << ", nonCacheRect " << (nonCacheRect | cacheRect) << ", repaintCache " << repaintCache << ", paintedCacheRect " << paintedCacheRect << endl;
 #endif
 
     // Scrollable (cacheable) items first
@@ -2309,7 +2309,7 @@
 		    paint.save();
 	            paint.translate(xorigin + x, 0);
 
-	            std::cerr << "Centre frame now: " << m_centreFrame << " drawing to " << chunk.x() + x + xorigin << ", " << chunk.width() << std::endl;
+	            cerr << "Centre frame now: " << m_centreFrame << " drawing to " << chunk.x() + x + xorigin << ", " << chunk.width() << endl;
 
 	            (*i)->setSynchronousPainting(true);
 
--- a/view/ViewManager.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/view/ViewManager.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -70,18 +70,18 @@
 
     if (getGlobalDarkBackground()) {
 /*
-        std::cerr << "dark palette:" << std::endl;
-        std::cerr << "window = " << QApplication::palette().color(QPalette::Window).name() << std::endl;
-        std::cerr << "windowtext = " << QApplication::palette().color(QPalette::WindowText).name() << std::endl;
-        std::cerr << "base = " << QApplication::palette().color(QPalette::Base).name() << std::endl;
-        std::cerr << "alternatebase = " << QApplication::palette().color(QPalette::AlternateBase).name() << std::endl;
-        std::cerr << "text = " << QApplication::palette().color(QPalette::Text).name() << std::endl;
-        std::cerr << "button = " << QApplication::palette().color(QPalette::Button).name() << std::endl;
-        std::cerr << "buttontext = " << QApplication::palette().color(QPalette::ButtonText).name() << std::endl;
-        std::cerr << "brighttext = " << QApplication::palette().color(QPalette::BrightText).name() << std::endl;
-        std::cerr << "light = " << QApplication::palette().color(QPalette::Light).name() << std::endl;
-        std::cerr << "dark = " << QApplication::palette().color(QPalette::Dark).name() << std::endl;
-        std::cerr << "mid = " << QApplication::palette().color(QPalette::Mid).name() << std::endl;
+        cerr << "dark palette:" << endl;
+        cerr << "window = " << QApplication::palette().color(QPalette::Window).name() << endl;
+        cerr << "windowtext = " << QApplication::palette().color(QPalette::WindowText).name() << endl;
+        cerr << "base = " << QApplication::palette().color(QPalette::Base).name() << endl;
+        cerr << "alternatebase = " << QApplication::palette().color(QPalette::AlternateBase).name() << endl;
+        cerr << "text = " << QApplication::palette().color(QPalette::Text).name() << endl;
+        cerr << "button = " << QApplication::palette().color(QPalette::Button).name() << endl;
+        cerr << "buttontext = " << QApplication::palette().color(QPalette::ButtonText).name() << endl;
+        cerr << "brighttext = " << QApplication::palette().color(QPalette::BrightText).name() << endl;
+        cerr << "light = " << QApplication::palette().color(QPalette::Light).name() << endl;
+        cerr << "dark = " << QApplication::palette().color(QPalette::Dark).name() << endl;
+        cerr << "mid = " << QApplication::palette().color(QPalette::Mid).name() << endl;
 */
         m_lightPalette = QPalette(QColor("#000000"),  // WindowText
                                   QColor("#dddfe4"),  // Button
@@ -96,18 +96,18 @@
 
     } else {
 /*
-        std::cerr << "light palette:" << std::endl;
-        std::cerr << "window = " << QApplication::palette().color(QPalette::Window).name() << std::endl;
-        std::cerr << "windowtext = " << QApplication::palette().color(QPalette::WindowText).name() << std::endl;
-        std::cerr << "base = " << QApplication::palette().color(QPalette::Base).name() << std::endl;
-        std::cerr << "alternatebase = " << QApplication::palette().color(QPalette::AlternateBase).name() << std::endl;
-        std::cerr << "text = " << QApplication::palette().color(QPalette::Text).name() << std::endl;
-        std::cerr << "button = " << QApplication::palette().color(QPalette::Button).name() << std::endl;
-        std::cerr << "buttontext = " << QApplication::palette().color(QPalette::ButtonText).name() << std::endl;
-        std::cerr << "brighttext = " << QApplication::palette().color(QPalette::BrightText).name() << std::endl;
-        std::cerr << "light = " << QApplication::palette().color(QPalette::Light).name() << std::endl;
-        std::cerr << "dark = " << QApplication::palette().color(QPalette::Dark).name() << std::endl;
-        std::cerr << "mid = " << QApplication::palette().color(QPalette::Mid).name() << std::endl;
+        cerr << "light palette:" << endl;
+        cerr << "window = " << QApplication::palette().color(QPalette::Window).name() << endl;
+        cerr << "windowtext = " << QApplication::palette().color(QPalette::WindowText).name() << endl;
+        cerr << "base = " << QApplication::palette().color(QPalette::Base).name() << endl;
+        cerr << "alternatebase = " << QApplication::palette().color(QPalette::AlternateBase).name() << endl;
+        cerr << "text = " << QApplication::palette().color(QPalette::Text).name() << endl;
+        cerr << "button = " << QApplication::palette().color(QPalette::Button).name() << endl;
+        cerr << "buttontext = " << QApplication::palette().color(QPalette::ButtonText).name() << endl;
+        cerr << "brighttext = " << QApplication::palette().color(QPalette::BrightText).name() << endl;
+        cerr << "light = " << QApplication::palette().color(QPalette::Light).name() << endl;
+        cerr << "dark = " << QApplication::palette().color(QPalette::Dark).name() << endl;
+        cerr << "mid = " << QApplication::palette().color(QPalette::Mid).name() << endl;
 */
         m_darkPalette = QPalette(QColor("#ffffff"),  // WindowText
                                  QColor("#3e3e3e"),  // Button
@@ -129,7 +129,7 @@
 ViewManager::getGlobalCentreFrame() const
 {
 #ifdef DEBUG_VIEW_MANAGER
-    std::cerr << "ViewManager::getGlobalCentreFrame: returning " << m_globalCentreFrame << std::endl;
+    cerr << "ViewManager::getGlobalCentreFrame: returning " << m_globalCentreFrame << endl;
 #endif
     return m_globalCentreFrame;
 }
@@ -138,7 +138,7 @@
 ViewManager::setGlobalCentreFrame(unsigned long f)
 {
 #ifdef DEBUG_VIEW_MANAGER
-    std::cerr << "ViewManager::setGlobalCentreFrame to " << f << std::endl;
+    cerr << "ViewManager::setGlobalCentreFrame to " << f << endl;
 #endif
     m_globalCentreFrame = f;
     emit globalCentreFrameChanged(f);
@@ -148,7 +148,7 @@
 ViewManager::getGlobalZoom() const
 {
 #ifdef DEBUG_VIEW_MANAGER
-    std::cerr << "ViewManager::getGlobalZoom: returning " << m_globalZoom << std::endl;
+    cerr << "ViewManager::getGlobalZoom: returning " << m_globalZoom << endl;
 #endif
     return m_globalZoom;
 }
@@ -474,7 +474,7 @@
 	m_playbackFrame = m_playSource->getCurrentPlayingFrame();
 
 #ifdef DEBUG_VIEW_MANAGER
-	std::cerr << "ViewManager::checkPlayStatus: Playing, frame " << m_playbackFrame << ", levels " << m_lastLeft << "," << m_lastRight << std::endl;
+	cerr << "ViewManager::checkPlayStatus: Playing, frame " << m_playbackFrame << ", levels " << m_lastLeft << "," << m_lastRight << endl;
 #endif
 
 	emit playbackFrameChanged(m_playbackFrame);
@@ -492,7 +492,7 @@
 	}
 
 #ifdef DEBUG_VIEW_MANAGER
-//	std::cerr << "ViewManager::checkPlayStatus: Not playing" << std::endl;
+//	cerr << "ViewManager::checkPlayStatus: Not playing" << endl;
 #endif
     }
 }
@@ -510,7 +510,7 @@
     View *v = dynamic_cast<View *>(sender());
 
 #ifdef DEBUG_VIEW_MANAGER
-    std::cerr << "ViewManager::viewCentreFrameChanged(" << f << ", " << locked << ", " << mode << "), view is " << v << std::endl;
+    cerr << "ViewManager::viewCentreFrameChanged(" << f << ", " << locked << ", " << mode << "), view is " << v << endl;
 #endif
 
     if (locked) {
@@ -539,7 +539,7 @@
 ViewManager::seek(unsigned long f)
 {
 #ifdef DEBUG_VIEW_MANAGER 
-    std::cerr << "ViewManager::seek(" << f << ")" << std::endl;
+    cerr << "ViewManager::seek(" << f << ")" << endl;
 #endif
 
     if (m_playSource && m_playSource->isPlaying()) {
@@ -549,7 +549,7 @@
 	    m_playbackFrame = f;
 	    m_playSource->play(f);
 #ifdef DEBUG_VIEW_MANAGER 
-	    std::cerr << "ViewManager::considerSeek: reseeking from " << playFrame << " to " << f << std::endl;
+	    cerr << "ViewManager::considerSeek: reseeking from " << playFrame << " to " << f << endl;
 #endif
             emit playbackFrameChanged(f);
 	}
@@ -578,7 +578,7 @@
     }
 
 #ifdef DEBUG_VIEW_MANAGER 
-    std::cerr << "ViewManager::viewZoomLevelChanged(" << v << ", " << z << ", " << locked << ")" << std::endl;
+    cerr << "ViewManager::viewZoomLevelChanged(" << v << ", " << z << ", " << locked << ")" << endl;
 #endif
 
     emit viewZoomLevelChanged(v, z, locked);
--- a/widgets/ActivityLog.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/widgets/ActivityLog.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -55,7 +55,7 @@
     name = name.replace("&", "");
 //    SVDEBUG << "ActivityLog::activityHappened(" << name << ")" << endl;
     if (name == m_prevName) {
-//        std::cerr << "(ignoring duplicate)" << std::endl;
+//        cerr << "(ignoring duplicate)" << endl;
         return;
     }
     m_prevName = name;
--- a/widgets/AudioDial.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/widgets/AudioDial.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -52,8 +52,8 @@
 
 #include "base/Profiler.h"
 
-using std::endl;
-using std::cerr;
+
+
 
 
 //!!! Pedro updated his version to use my up/down response code from RG -- need to grab that code in preference to this version from Rui
@@ -99,7 +99,7 @@
 
 void AudioDial::setRangeMapper(RangeMapper *mapper)
 {
-//    std::cerr << "AudioDial[" << this << "][\"" << objectName() << "\"::setRangeMapper(" << mapper << ") [current is " << m_rangeMapper << "] (have " << dialsExtant << " dials extant)" << std::endl;
+//    cerr << "AudioDial[" << this << "][\"" << objectName() << "\"::setRangeMapper(" << mapper << ") [current is " << m_rangeMapper << "] (have " << dialsExtant << " dials extant)" << endl;
 
     if (m_rangeMapper == mapper) return;
 
@@ -183,7 +183,7 @@
     // Tick notches...
 
     if ( notchesVisible() ) {
-//	std::cerr << "Notches visible" << std::endl;
+//	cerr << "Notches visible" << endl;
 	pen.setColor(palette().dark().color());
 	pen.setWidth(scale);
 	paint.setPen(pen);
@@ -202,7 +202,7 @@
     pen.setWidth(indent);
     paint.setPen(pen);
 
-//    std::cerr << "degrees " << degrees << ", gives us " << -(degrees - 45) * 16 << std::endl;
+//    cerr << "degrees " << degrees << ", gives us " << -(degrees - 45) * 16 << endl;
 
     int arcLen = -(degrees - 45) * 16;
     if (arcLen == 0) arcLen = -16;
--- a/widgets/CSVFormatDialog.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/widgets/CSVFormatDialog.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -31,6 +31,8 @@
 
 #include <iostream>
 
+#include "base/Debug.h"
+
 CSVFormatDialog::CSVFormatDialog(QWidget *parent, CSVFormat format,
                                  int maxDisplayCols) :
     QDialog(parent),
@@ -290,8 +292,8 @@
         
         if (thisChanged) {
 
-            std::cerr << "i == " << i << ", fuzzy == " << m_fuzzyColumn
-                      << ", p == " << p << std::endl;
+            cerr << "i == " << i << ", fuzzy == " << m_fuzzyColumn
+                      << ", p == " << p << endl;
 
             if (i == m_fuzzyColumn) {
                 for (int j = i; j < m_format.getColumnCount(); ++j) {
--- a/widgets/CommandHistory.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/widgets/CommandHistory.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -143,7 +143,7 @@
     if (!command) return;
 
 #ifdef DEBUG_COMMAND_HISTORY
-    SVDEBUG << "CommandHistory::addCommand: " << command->getName().toLocal8Bit().data() << " of type " << typeid(*command).name() << " at " << command << ": execute = " << execute << ", bundle = " << bundle << " (m_currentCompound = " << m_currentCompound << ", m_currentBundle = " << m_currentBundle << ")" << endl;
+    SVDEBUG << "CommandHistory::addCommand: " << command->getName() << " of type " << typeid(*command).name() << " at " << command << ": execute = " << execute << ", bundle = " << bundle << " (m_currentCompound = " << m_currentCompound << ", m_currentBundle = " << m_currentBundle << ")" << endl;
 #endif
 
     if (m_currentCompound) {
@@ -265,7 +265,7 @@
 CommandHistory::addToCompound(Command *command, bool execute)
 {
 #ifdef DEBUG_COMMAND_HISTORY
-    SVDEBUG << "CommandHistory::addToCompound: " << command->getName().toLocal8Bit().data() << endl;
+    SVDEBUG << "CommandHistory::addToCompound: " << command->getName() << endl;
 #endif
     if (!m_currentCompound) {
 	SVDEBUG << "CommandHistory::addToCompound: ERROR: no compound operation in progress!" << endl;
@@ -281,7 +281,7 @@
 {
     if (m_currentCompound) {
 	SVDEBUG << "CommandHistory::startCompoundOperation: ERROR: compound operation already in progress!" << endl;
-	std::cerr << "(name is " << m_currentCompound->getName().toLocal8Bit().data() << ")" << std::endl;
+	cerr << "(name is " << m_currentCompound->getName() << ")" << endl;
         return;
     }
  
@@ -436,7 +436,7 @@
 	for (i = 0; i < limit; ++i) {
 #ifdef DEBUG_COMMAND_HISTORY
 	    Command *command = stack.top();
-	    SVDEBUG << "CommandHistory::clipStack: Saving recent command: " << command->getName().toLocal8Bit().data() << " at " << command << endl;
+	    SVDEBUG << "CommandHistory::clipStack: Saving recent command: " << command->getName() << " at " << command << endl;
 #endif
 	    tempStack.push(stack.top());
 	    stack.pop();
--- a/widgets/Fader.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/widgets/Fader.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -57,25 +57,25 @@
     QString background_path = ":/icons/fader_background.png";
     bool ok = m_back.load(background_path);
     if (ok == false) {
-	std::cerr << "Fader: Error loading pixmap" << std::endl;
+	cerr << "Fader: Error loading pixmap" << endl;
     }
 
     QString leds_path = ":/icons/fader_leds.png";
     ok = m_leds.load(leds_path);
     if (ok == false) {
-	std::cerr <<  "Error loading pixmap" << std::endl;
+	cerr <<  "Error loading pixmap" << endl;
     }
 
     QString knob_path = ":/icons/fader_knob.png";
     ok = m_knob.load(knob_path);
     if (ok == false) {
-	std::cerr <<  "Error loading pixmap" << std::endl;
+	cerr <<  "Error loading pixmap" << endl;
     }
 
     QString clip_path = ":/icons/fader_knob_red.png";
     ok = m_clip.load(clip_path);
     if (ok == false) {
-	std::cerr <<  "Error loading pixmap" << std::endl;
+	cerr <<  "Error loading pixmap" << endl;
     }
 }
 
@@ -222,7 +222,7 @@
                 .arg(abs(int(db * 10.0) % 10))
                 .arg(abs(int(db * 100.0) % 10));
 	}
-        std::cerr << "Fader: setting tooltip to \"" << text << "\"" << std::endl;
+        cerr << "Fader: setting tooltip to \"" << text << "\"" << endl;
         QWidget::setToolTip(text);
 	update();
     }
--- a/widgets/ImageDialog.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/widgets/ImageDialog.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -204,7 +204,7 @@
             }
         }
         
-//        std::cerr << "image filename: \"" << fileName << "\"" << std::endl;
+//        cerr << "image filename: \"" << fileName << "\"" << endl;
 
         m_loadedImage = QPixmap(fileName);
         m_loadedImageFile = img;
--- a/widgets/InteractiveFileFinder.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/widgets/InteractiveFileFinder.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -225,7 +225,7 @@
         break;
 
     case SessionOrAudioFile:
-        std::cerr << "ERROR: Internal error: InteractiveFileFinder::getSaveFileName: SessionOrAudioFile cannot be used here" << std::endl;
+        cerr << "ERROR: Internal error: InteractiveFileFinder::getSaveFileName: SessionOrAudioFile cannot be used here" << endl;
         abort();
 
     case ImageFile:
@@ -241,7 +241,7 @@
         break;
 
     case AnyFile:
-        std::cerr << "ERROR: Internal error: InteractiveFileFinder::getSaveFileName: AnyFile cannot be used here" << std::endl;
+        cerr << "ERROR: Internal error: InteractiveFileFinder::getSaveFileName: AnyFile cannot be used here" << endl;
         abort();
     };
 
@@ -297,7 +297,7 @@
         
         QFileInfo fi(path);
 
-        std::cerr << "type = " << type << ", suffix = " << fi.suffix() << std::endl;
+        cerr << "type = " << type << ", suffix = " << fi.suffix() << endl;
         
         if ((type == LayerFile || type == LayerFileNoMidi)
             && fi.suffix() == "") {
@@ -314,7 +314,7 @@
             } else if (selectedFilter.contains(".ttl")) {
                 expectedExtension = "ttl";
             }
-            std::cerr << "expected extension = " << expectedExtension << std::endl;
+            cerr << "expected extension = " << expectedExtension << endl;
             if (expectedExtension != "") {
                 path = QString("%1.%2").arg(path).arg(expectedExtension);
                 fi = QFileInfo(path);
@@ -444,7 +444,7 @@
     if (FileSource::isRemote(relativeTo)) {
         resolved = QUrl(relativeTo).resolved(fileName).toString();
         if (!FileSource(resolved).isAvailable()) resolved = "";
-        std::cerr << "resolved: " << resolved << std::endl;
+        cerr << "resolved: " << resolved << endl;
     } else {
         if (QUrl(relativeTo).scheme() == "file") {
             relativeTo = QUrl(relativeTo).toLocalFile();
--- a/widgets/LEDButton.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/widgets/LEDButton.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -94,7 +94,7 @@
 void
 LEDButton::mousePressEvent(QMouseEvent *e)
 {
-    std::cerr << "LEDButton(" << this << ")::mousePressEvent" << std::endl;
+    cerr << "LEDButton(" << this << ")::mousePressEvent" << endl;
 
     if (e->buttons() & Qt::LeftButton) {
 	toggle();
--- a/widgets/LayerTree.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/widgets/LayerTree.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -319,7 +319,7 @@
 void
 LayerTreeModel::paneAboutToBeDeleted(Pane *pane)
 {
-    std::cerr << "paneDeleted: " << pane << std::endl;
+    cerr << "paneDeleted: " << pane << endl;
     m_deletedPanes.insert(pane);
     emit layoutChanged();
 }
--- a/widgets/ModelDataTableDialog.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/widgets/ModelDataTableDialog.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -216,8 +216,8 @@
 
     // should only select if no part of the desired row is currently selected
 
-//    std::cerr << "rh = " << rh << ", row = " << row << ", scrolling to "
-//              << topRow << std::endl;
+//    cerr << "rh = " << rh << ", row = " << row << ", scrolling to "
+//              << topRow << endl;
 
     int pos = m_tableView->rowViewportPosition(row);
 
--- a/widgets/PluginParameterBox.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/widgets/PluginParameterBox.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -109,8 +109,8 @@
         float qtz = 0.0;
         if (params[i].isQuantized) qtz = params[i].quantizeStep;
 
-//        std::cerr << "PluginParameterBox: hint = " << hint << ", min = " << min << ", max = "
-//                  << max << ", qtz = " << qtz << std::endl;
+//        cerr << "PluginParameterBox: hint = " << hint << ", min = " << min << ", max = "
+//                  << max << ", qtz = " << qtz << endl;
 
         std::vector<std::string> valueNames = params[i].valueNames;
 
@@ -225,7 +225,7 @@
     }
 
     if (m_params.find(identifier) == m_params.end()) {
-        std::cerr << "WARNING: PluginParameterBox::dialChanged: Unknown parameter \"" << identifier << "\"" << std::endl;
+        cerr << "WARNING: PluginParameterBox::dialChanged: Unknown parameter \"" << identifier << "\"" << endl;
         return;
     }
 
@@ -288,7 +288,7 @@
     }
 
     if (m_params.find(identifier) == m_params.end()) {
-        std::cerr << "WARNING: PluginParameterBox::checkBoxChanged: Unknown parameter \"" << identifier << "\"" << std::endl;
+        cerr << "WARNING: PluginParameterBox::checkBoxChanged: Unknown parameter \"" << identifier << "\"" << endl;
         return;
     }
 
@@ -314,7 +314,7 @@
     }
 
     if (m_params.find(identifier) == m_params.end()) {
-        std::cerr << "WARNING: PluginParameterBox::spinBoxChanged: Unknown parameter \"" << identifier << "\"" << std::endl;
+        cerr << "WARNING: PluginParameterBox::spinBoxChanged: Unknown parameter \"" << identifier << "\"" << endl;
         return;
     }
 
--- a/widgets/PluginParameterDialog.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/widgets/PluginParameterDialog.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -40,6 +40,8 @@
 #include <QDesktopServices>
 #include <QUrl>
 
+#include "base/Debug.h"
+
 PluginParameterDialog::PluginParameterDialog(Vamp::PluginBase *plugin,
 					     QWidget *parent) :
     QDialog(parent),
@@ -327,7 +329,7 @@
         } else {
 
             if (m_haveChannelBoxData) {
-                std::cerr << "WARNING: PluginParameterDialog::setChannelArrangement: Calling more than once on same dialog is not currently implemented" << std::endl;
+                cerr << "WARNING: PluginParameterDialog::setChannelArrangement: Calling more than once on same dialog is not currently implemented" << endl;
                 return;
             }
             
@@ -372,7 +374,7 @@
                                                 bool showFrequencyDomainOptions)
 {
     if (m_haveWindowBoxData) {
-        std::cerr << "WARNING: PluginParameterDialog::setShowProcessingOptions: Calling more than once on same dialog is not currently implemented" << std::endl;
+        cerr << "WARNING: PluginParameterDialog::setShowProcessingOptions: Calling more than once on same dialog is not currently implemented" << endl;
         return;
     }
 
@@ -385,7 +387,7 @@
         int increment = 1024;
         if (fePlugin) {
             size = fePlugin->getPreferredBlockSize();
-            std::cerr << "Feature extraction plugin \"" << fePlugin->getName() << "\" reports preferred block size as " << size << std::endl;
+            cerr << "Feature extraction plugin \"" << fePlugin->getName() << "\" reports preferred block size as " << size << endl;
             if (size == 0) size = 1024;
             increment = fePlugin->getPreferredStepSize();
             if (increment == 0) {
@@ -406,7 +408,7 @@
             windowLayout->addWidget(new QLabel(tr("Audio frames per block:")), 0, 0);
         }
 
-        std::cerr << "size: " << size << ", increment: " << increment << std::endl;
+        cerr << "size: " << size << ", increment: " << increment << endl;
 
         QComboBox *blockSizeCombo = new QComboBox;
         blockSizeCombo->setEditable(true);
@@ -559,7 +561,7 @@
 PluginParameterDialog::blockSizeComboChanged(const QString &text)
 {
     m_blockSize = text.toInt();
-    std::cerr << "Block size changed to " << m_blockSize << std::endl;
+    cerr << "Block size changed to " << m_blockSize << endl;
 }
 
 void
@@ -567,7 +569,7 @@
 {
     m_stepSize = text.toInt();
     //!!! rename increment to step size throughout
-    std::cerr << "Increment changed to " << m_stepSize << std::endl;
+    cerr << "Increment changed to " << m_stepSize << endl;
 }
 
 void
@@ -605,7 +607,7 @@
         m_advancedButton->setChecked(false);
     }
 
-//    std::cerr << "resize to " << sizeHint().width() << " x " << sizeHint().height() << std::endl;
+//    cerr << "resize to " << sizeHint().width() << " x " << sizeHint().height() << endl;
 
 //    setMinimumHeight(sizeHint().height());
     adjustSize();
--- a/widgets/PropertyBox.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/widgets/PropertyBox.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -59,8 +59,8 @@
     m_playButton(0)
 {
 #ifdef DEBUG_PROPERTY_BOX
-    std::cerr << "PropertyBox[" << this << "(\"" <<
-	container->getPropertyContainerName() << "\" at " << container << ")]::PropertyBox" << std::endl;
+    cerr << "PropertyBox[" << this << "(\"" <<
+	container->getPropertyContainerName() << "\" at " << container << ")]::PropertyBox" << endl;
 #endif
 
     m_mainBox = new QVBoxLayout;
@@ -102,14 +102,14 @@
             this, SLOT(colourDatabaseChanged()));
 
 #ifdef DEBUG_PROPERTY_BOX
-    std::cerr << "PropertyBox[" << this << "]::PropertyBox returning" << std::endl;
+    cerr << "PropertyBox[" << this << "]::PropertyBox returning" << endl;
 #endif
 }
 
 PropertyBox::~PropertyBox()
 {
 #ifdef DEBUG_PROPERTY_BOX
-    std::cerr << "PropertyBox[" << this << "]::~PropertyBox" << std::endl;
+    cerr << "PropertyBox[" << this << "]::~PropertyBox" << endl;
 #endif
 }
 
@@ -117,7 +117,7 @@
 PropertyBox::populateViewPlayFrame()
 {
 #ifdef DEBUG_PROPERTY_BOX
-    std::cerr << "PropertyBox(" << m_container << ")::populateViewPlayFrame" << std::endl;
+    cerr << "PropertyBox(" << m_container << ")::populateViewPlayFrame" << endl;
 #endif
 
     if (m_viewPlayFrame) {
@@ -274,12 +274,12 @@
     QString iconName = m_container->getPropertyIconName(name);
 
 #ifdef DEBUG_PROPERTY_BOX
-    std::cerr << "PropertyBox[" << this
-	      << "(\"" << m_container->getPropertyContainerName().toStdString()
+    cerr << "PropertyBox[" << this
+	      << "(\"" << m_container->getPropertyContainerName()
 	      << "\")]";
-    std::cerr << "::updatePropertyEditor(\"" << name << "\"):";
-    std::cerr << " value " << value << ", have " << have << ", group \""
-	      << groupName << "\"" << std::endl;
+    cerr << "::updatePropertyEditor(\"" << name << "\"):";
+    cerr << " value " << value << ", have " << have << ", group \""
+	      << groupName << "\"" << endl;
 #endif
 
     bool inGroup = (groupName != QString());
@@ -288,7 +288,7 @@
 	if (inGroup) {
 	    if (m_groupLayouts.find(groupName) == m_groupLayouts.end()) {
 #ifdef DEBUG_PROPERTY_BOX
-		std::cerr << "PropertyBox: adding label \"" << groupName << "\" and frame for group for \"" << name << "\"" << std::endl;
+		cerr << "PropertyBox: adding label \"" << groupName << "\" and frame for group for \"" << name << "\"" << endl;
 #endif
 		m_layout->addWidget(new QLabel(groupName, m_mainWidget), row, 0);
 		QFrame *frame = new QFrame(m_mainWidget);
@@ -299,7 +299,7 @@
 	    }
 	} else {
 #ifdef DEBUG_PROPERTY_BOX 
-	    std::cerr << "PropertyBox: adding label \"" << propertyLabel << "\"" << std::endl;
+	    cerr << "PropertyBox: adding label \"" << propertyLabel << "\"" << endl;
 #endif
 	    m_layout->addWidget(new QLabel(propertyLabel, m_mainWidget), row, 0);
 	}
@@ -316,7 +316,7 @@
             assert(button);
 	} else {
 #ifdef DEBUG_PROPERTY_BOX 
-	    std::cerr << "PropertyBox: creating new checkbox" << std::endl;
+	    cerr << "PropertyBox: creating new checkbox" << endl;
 #endif
             if (iconName != "") {
                 button = new NotifyingPushButton();
@@ -370,7 +370,7 @@
                 
 	} else {
 #ifdef DEBUG_PROPERTY_BOX 
-	    std::cerr << "PropertyBox: creating new dial" << std::endl;
+	    cerr << "PropertyBox: creating new dial" << endl;
 #endif
 	    dial = new AudioDial();
 	    dial->setObjectName(name);
@@ -426,7 +426,7 @@
 	    assert(cb);
 	} else {
 #ifdef DEBUG_PROPERTY_BOX 
-	    std::cerr << "PropertyBox: creating new combobox" << std::endl;
+	    cerr << "PropertyBox: creating new combobox" << endl;
 #endif
 
 	    cb = new NotifyingComboBox();
@@ -511,7 +511,7 @@
         }
         cb->blockSignals(false);
 
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
 	// Crashes on startup without this, for some reason
 	cb->setMinimumSize(QSize(10, 10));
 #endif
@@ -561,12 +561,12 @@
 void
 PropertyBox::unitDatabaseChanged()
 {
-    std::cerr << "PropertyBox[" << this << "]: unitDatabaseChanged" << std::endl;
+    cerr << "PropertyBox[" << this << "]: unitDatabaseChanged" << endl;
     blockSignals(true);
 
-//    std::cerr << "my container is " << m_container << std::endl;
-//    std::cerr << "my container's name is... " << std::endl;
-//    std::cerr << m_container->objectName() << std::endl;
+//    cerr << "my container is " << m_container << endl;
+//    cerr << "my container's name is... " << endl;
+//    cerr << m_container->objectName() << endl;
 
     PropertyContainer::PropertyList properties = m_container->getProperties();
     for (size_t i = 0; i < properties.size(); ++i) {
--- a/widgets/SelectableLabel.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/widgets/SelectableLabel.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -131,7 +131,7 @@
 void
 SelectableLabel::enterEvent(QEvent *)
 {
-//    std::cerr << "enterEvent" << std::endl;
+//    cerr << "enterEvent" << endl;
 //    QPalette palette = QApplication::palette();
 //    palette.setColor(QPalette::Window, Qt::gray);
 //    setStyleSheet("background: gray");
@@ -141,7 +141,7 @@
 void
 SelectableLabel::leaveEvent(QEvent *)
 {
-//    std::cerr << "leaveEvent" << std::endl;
+//    cerr << "leaveEvent" << endl;
 //    setStyleSheet("background: white");
 //    QPalette palette = QApplication::palette();
 //    palette.setColor(QPalette::Window, Qt::gray);
--- a/widgets/SubdividingMenu.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/widgets/SubdividingMenu.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -17,6 +17,8 @@
 
 #include <iostream>
 
+#include "base/Debug.h"
+
 using std::set;
 using std::map;
 
@@ -81,7 +83,7 @@
             firstInitialInChunk = initial;
         }
 
-//        std::cerr << "count = "<< count << ", upper limit = " << m_upperLimit << std::endl;
+//        cerr << "count = "<< count << ", upper limit = " << m_upperLimit << endl;
 
         bool lastInChunk = (k == entries.end() ||
                             (count >= m_lowerLimit-1 &&
@@ -134,7 +136,7 @@
 SubdividingMenu::entriesAdded()
 {
     if (m_entriesSet) {
-        std::cerr << "ERROR: SubdividingMenu::entriesAdded: setEntries was also called -- should use one mechanism or the other, but not both" << std::endl;
+        cerr << "ERROR: SubdividingMenu::entriesAdded: setEntries was also called -- should use one mechanism or the other, but not both" << endl;
         return;
     }
     
--- a/widgets/TextAbbrev.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/widgets/TextAbbrev.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -263,7 +263,7 @@
 
 //    SVDEBUG << "TextAbbrev::getPrefixLength: prefix length is " << candidate << endl;
 //    for (int i = 0; i < texts.size(); ++i) {
-//        std::cerr << texts[i].left(candidate) << "|" << texts[i].right(texts[i].length() - candidate) << std::endl;
+//        cerr << texts[i].left(candidate) << "|" << texts[i].right(texts[i].length() - candidate) << endl;
 //    }
 
     return candidate;
--- a/widgets/Thumbwheel.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/widgets/Thumbwheel.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -506,7 +506,7 @@
 
     float radians = m_rotation * 1.5f * M_PI;
 
-//    std::cerr << "value = " << m_value << ", min = " << m_min << ", max = " << m_max << ", rotation = " << rotation << std::endl;
+//    cerr << "value = " << m_value << ", min = " << m_min << ", max = " << m_max << ", rotation = " << rotation << endl;
 
     w = (m_orientation == Qt::Horizontal ? width() : height()) - bw*2;
 
--- a/widgets/TipDialog.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/widgets/TipDialog.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -146,7 +146,7 @@
 TipDialog::showTip()
 {
     if (m_tipNumber < int(m_tips.size())) {
-        std::cerr << "Tip " << m_tipNumber << " is: " << m_tips[m_tipNumber] << std::endl;
+        cerr << "Tip " << m_tipNumber << " is: " << m_tips[m_tipNumber] << endl;
         m_label->setText(m_tips[m_tipNumber]);
     } else {
         accept();
@@ -196,24 +196,24 @@
         if (caption != "") m_dialog->m_caption = caption;
     } else if (name == "tip") {
         if (m_inTip) {
-            std::cerr << "WARNING: TipFileParser: nested <tip> elements" << std::endl;
+            cerr << "WARNING: TipFileParser: nested <tip> elements" << endl;
         }
         m_inTip = true;
     } else if (name == "text") {
         if (m_inTip) {
             m_inText = true;
-            std::cerr << "TipFileParser: adding new tip" << std::endl;
+            cerr << "TipFileParser: adding new tip" << endl;
             m_dialog->m_tips.push_back("");
         } else {
-            std::cerr << "WARNING: TipFileParser: <text> outside <tip> element" << std::endl;
+            cerr << "WARNING: TipFileParser: <text> outside <tip> element" << endl;
         }
     } else if (name == "html") {
         if (m_inTip) {
             m_inHtml = true;
-            std::cerr << "TipFileParser: adding new tip" << std::endl;
+            cerr << "TipFileParser: adding new tip" << endl;
             m_dialog->m_tips.push_back("");
         } else {
-            std::cerr << "WARNING: TipFileParser: <html> outside <tip> element" << std::endl;
+            cerr << "WARNING: TipFileParser: <html> outside <tip> element" << endl;
         }
     } else if (m_inHtml) {
         m_dialog->m_tips[m_dialog->m_tips.size()-1] += "<" + qName;
@@ -236,21 +236,21 @@
 
     if (name == "text") {
         if (!m_inText) {
-            std::cerr << "WARNING: TipFileParser: </text> without <text>" << std::endl;
+            cerr << "WARNING: TipFileParser: </text> without <text>" << endl;
         }
         m_inText = false;
     } else if (name == "html") {
         if (!m_inHtml) {
-            std::cerr << "WARNING: TipFileParser: </html> without <html>" << std::endl;
+            cerr << "WARNING: TipFileParser: </html> without <html>" << endl;
         }
         m_inHtml = false;
     } else if (name == "tip") {
         if (m_inText) {
-            std::cerr << "WARNING: TipFileParser: <text> without </text>" << std::endl;
+            cerr << "WARNING: TipFileParser: <text> without </text>" << endl;
         } else if (m_inHtml) {
-            std::cerr << "WARNING: TipFileParser: <html> without </html>" << std::endl;
+            cerr << "WARNING: TipFileParser: <html> without </html>" << endl;
         } else if (!m_inTip) {
-            std::cerr << "WARNING: TipFileParser: </tip> without <tip>" << std::endl;
+            cerr << "WARNING: TipFileParser: </tip> without <tip>" << endl;
         }
         m_inTip = false;
     } else if (m_inHtml) {
@@ -280,7 +280,7 @@
 	.arg(exception.message())
 	.arg(exception.lineNumber())
 	.arg(exception.columnNumber());
-    std::cerr << errorString << std::endl;
+    cerr << errorString << endl;
     return QXmlDefaultHandler::error(exception);
 }
 
@@ -292,6 +292,6 @@
 	.arg(exception.message())
 	.arg(exception.lineNumber())
 	.arg(exception.columnNumber());
-    std::cerr << errorString << std::endl;
+    cerr << errorString << endl;
     return QXmlDefaultHandler::fatalError(exception);
 }
--- a/widgets/TransformFinder.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/widgets/TransformFinder.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -169,7 +169,7 @@
 void
 TransformFinder::searchTextChanged(const QString &text)
 {
-//    std::cerr << "text is " << text << std::endl;
+//    cerr << "text is " << text << endl;
     m_newSearchText = text;
 }
 
@@ -187,7 +187,7 @@
         TransformFactory::SearchResults results =
             TransformFactory::getInstance()->search(keywords);
         
-//        std::cerr << results.size() << " result(s)..." << std::endl;
+//        cerr << results.size() << " result(s)..." << endl;
         
         std::set<TextMatcher::Match> sorted;
         sorted.clear();
@@ -241,7 +241,7 @@
 
         int i = m_upToDateCount;
 
-//        std::cerr << "sorted size = " << m_sortedResults.size() << std::endl;
+//        cerr << "sorted size = " << m_sortedResults.size() << endl;
 
         TransformDescription desc;
         TransformId tid = m_sortedResults[i].key;
@@ -318,7 +318,7 @@
         m_labels[i]->setFixedWidth(this->width() - 40);
         m_labels[i]->setUnselectedText(labelText);
 
-//        std::cerr << "selected text: " << selectedText << std::endl;
+//        cerr << "selected text: " << selectedText << endl;
         m_labels[i]->setSelectedText(selectedText);
 
         m_labels[i]->setSelected(m_selectedTransform == desc.identifier);
@@ -350,8 +350,8 @@
             }
         }
     }
-    std::cerr << "selectedLabelChanged: selected transform is now \""
-              << m_selectedTransform << "\"" << std::endl;
+    cerr << "selectedLabelChanged: selected transform is now \""
+              << m_selectedTransform << "\"" << endl;
 }
 
 void
--- a/widgets/WindowShapePreview.cpp	Fri Nov 22 10:40:51 2013 +0000
+++ b/widgets/WindowShapePreview.cpp	Tue Nov 26 14:38:48 2013 +0000
@@ -177,7 +177,7 @@
     path = QPainterPath();
     freqPainter.setPen(Qt::black);
 
-//    std::cerr << "maxdb = " << maxdb << ", mindb = " << mindb << ", maxval = " <<maxval << std::endl;
+//    cerr << "maxdb = " << maxdb << ", mindb = " << mindb << ", maxval = " <<maxval << endl;
 
     for (int i = 0; i < fftsize/2; ++i) {
         float power = output[i][0] * output[i][0] + output[i][1] * output[i][1];