# HG changeset patch # User Chris Cannam # Date 1305562765 -3600 # Node ID f4960f8ce79854a24cfd7005872ec5addc1473c1 # Parent 1fe7951a61e8e6d5633b992d7c95716daa00c8b1 Convert many cerrs to DEBUGs diff -r 1fe7951a61e8 -r f4960f8ce798 layer/Colour3DPlotLayer.cpp --- a/layer/Colour3DPlotLayer.cpp Thu May 12 17:31:43 2011 +0100 +++ b/layer/Colour3DPlotLayer.cpp Mon May 16 17:19:25 2011 +0100 @@ -493,8 +493,8 @@ if (dormant) { #ifdef DEBUG_COLOUR_3D_PLOT_LAYER_PAINT - std::cerr << "Colour3DPlotLayer::setLayerDormant(" << dormant << ")" - << std::endl; + DEBUG << "Colour3DPlotLayer::setLayerDormant(" << dormant << ")" + << endl; #endif if (isLayerDormant(v)) { @@ -588,7 +588,7 @@ { if (!m_model) return; -// std::cerr << "Colour3DPlotLayer::setVerticalZoomStep(" < " << lastBin << std::endl; + DEBUG << "Colour3DPlotLayer::fillCache: " << firstBin << " -> " << lastBin << endl; #endif size_t modelStartBin = modelStart / modelResolution; @@ -1152,12 +1152,12 @@ { /* if (m_model) { - std::cerr << "Colour3DPlotLayer::paint: model says shouldUseLogValueScale = " << m_model->shouldUseLogValueScale() << std::endl; + DEBUG << "Colour3DPlotLayer::paint: model says shouldUseLogValueScale = " << m_model->shouldUseLogValueScale() << endl; } */ Profiler profiler("Colour3DPlotLayer::paint"); #ifdef DEBUG_COLOUR_3D_PLOT_LAYER_PAINT - std::cerr << "Colour3DPlotLayer::paint(): m_model is " << m_model << ", zoom level is " << v->getZoomLevel() << std::endl; + DEBUG << "Colour3DPlotLayer::paint(): m_model is " << m_model << ", zoom level is " << v->getZoomLevel() << endl; #endif int completion = 0; @@ -1213,7 +1213,7 @@ sx1 < 0 ? 0 : sx1); #ifdef DEBUG_COLOUR_3D_PLOT_LAYER_PAINT - std::cerr << "Colour3DPlotLayer::paint: height = "<< m_model->getHeight() << ", modelStart = " << modelStart << ", resolution = " << modelResolution << ", model rate = " << m_model->getSampleRate() << " (zoom level = " << v->getZoomLevel() << ", srRatio = " << srRatio << ")" << std::endl; + DEBUG << "Colour3DPlotLayer::paint: height = "<< m_model->getHeight() << ", modelStart = " << modelStart << ", resolution = " << modelResolution << ", model rate = " << m_model->getSampleRate() << " (zoom level = " << v->getZoomLevel() << ", srRatio = " << srRatio << ")" << endl; #endif if (m_opaque || @@ -1221,14 +1221,14 @@ int(m_model->getHeight()) >= v->height() || ((modelResolution * srRatio) / v->getZoomLevel()) < 2) { #ifdef DEBUG_COLOUR_3D_PLOT_LAYER_PAINT - std::cerr << "calling paintDense" << std::endl; + DEBUG << "calling paintDense" << endl; #endif paintDense(v, paint, rect); return; } #ifdef DEBUG_COLOUR_3D_PLOT_LAYER_PAINT - std::cerr << "Colour3DPlotLayer::paint: w " << x1-x0 << ", h " << h << ", sx0 " << sx0 << ", sx1 " << sx1 << ", sw " << sx1-sx0 << ", sh " << sh << std::endl; + DEBUG << "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; #endif @@ -1358,7 +1358,7 @@ if (m_peaksCache) { if (((modelResolution * srRatio * m_peakResolution) / zoomLevel) < 1) { - std::cerr << "using peaks cache" << std::endl; + DEBUG << "using peaks cache" << endl; source = m_peaksCache; modelResolution *= m_peakResolution; } else { diff -r 1fe7951a61e8 -r f4960f8ce798 layer/ImageLayer.cpp --- a/layer/ImageLayer.cpp Thu May 12 17:31:43 2011 +0100 +++ b/layer/ImageLayer.cpp Mon May 16 17:19:25 2011 +0100 @@ -127,7 +127,7 @@ { if (!m_model) return ImageModel::PointList(); -// std::cerr << "ImageLayer::getLocalPoints(" << x << "," << y << "):"; +// DEBUG << "ImageLayer::getLocalPoints(" << x << "," << y << "):"; const ImageModel::PointList &points(m_model->getPoints()); ImageModel::PointList rv; @@ -155,7 +155,7 @@ int width = 32; if (m_scaled[v].find(p.image) != m_scaled[v].end()) { width = m_scaled[v][p.image].width(); -// std::cerr << "scaled width = " << width << std::endl; +// DEBUG << "scaled width = " << width << endl; } if (x >= px && x < px + width) { @@ -521,8 +521,8 @@ { bool need = false; -// std::cerr << "ImageLayer::getImage(" << v << ", " << name << ", (" -// << maxSize.width() << "x" << maxSize.height() << "))" << std::endl; +// DEBUG << "ImageLayer::getImage(" << v << ", " << name << ", (" +// << maxSize.width() << "x" << maxSize.height() << "))" << endl; if (!m_scaled[v][name].isNull() && ((m_scaled[v][name].width() == maxSize.width() && @@ -558,10 +558,10 @@ void ImageLayer::drawStart(View *v, QMouseEvent *e) { -// std::cerr << "ImageLayer::drawStart(" << e->x() << "," << e->y() << ")" << std::endl; +// DEBUG << "ImageLayer::drawStart(" << e->x() << "," << e->y() << ")" << endl; if (!m_model) { - std::cerr << "ImageLayer::drawStart: no model" << std::endl; + DEBUG << "ImageLayer::drawStart: no model" << endl; return; } @@ -582,7 +582,7 @@ void ImageLayer::drawDrag(View *v, QMouseEvent *e) { -// std::cerr << "ImageLayer::drawDrag(" << e->x() << "," << e->y() << ")" << std::endl; +// DEBUG << "ImageLayer::drawDrag(" << e->x() << "," << e->y() << ")" << endl; if (!m_model || !m_editing) return; @@ -598,7 +598,7 @@ void ImageLayer::drawEnd(View *v, QMouseEvent *) { -// std::cerr << "ImageLayer::drawEnd(" << e->x() << "," << e->y() << ")" << std::endl; +// DEBUG << "ImageLayer::drawEnd(" << e->x() << "," << e->y() << ")" << endl; if (!m_model || !m_editing) return; bool ok = false; @@ -644,7 +644,7 @@ void ImageLayer::editStart(View *v, QMouseEvent *e) { -// std::cerr << "ImageLayer::editStart(" << e->x() << "," << e->y() << ")" << std::endl; +// DEBUG << "ImageLayer::editStart(" << e->x() << "," << e->y() << ")" << endl; if (!m_model) return; @@ -686,7 +686,7 @@ void ImageLayer::editEnd(View *, QMouseEvent *) { -// std::cerr << "ImageLayer::editEnd(" << e->x() << "," << e->y() << ")" << std::endl; +// DEBUG << "ImageLayer::editEnd(" << e->x() << "," << e->y() << ")" << endl; if (!m_model || !m_editing) return; if (m_editingCommand) { @@ -906,7 +906,7 @@ void ImageLayer::checkAddSource(QString img) const { - std::cerr << "ImageLayer::checkAddSource(" << img << "): yes, trying..." << std::endl; + DEBUG << "ImageLayer::checkAddSource(" << img << "): yes, trying..." << endl; if (m_fileSources.find(img) != m_fileSources.end()) { return; @@ -938,7 +938,7 @@ void ImageLayer::fileSourceReady() { -// std::cerr << "ImageLayer::fileSourceReady" << std::endl; +// DEBUG << "ImageLayer::fileSourceReady" << endl; FileSource *rf = dynamic_cast(sender()); if (!rf) return; diff -r 1fe7951a61e8 -r f4960f8ce798 layer/Layer.cpp --- a/layer/Layer.cpp Thu May 12 17:31:43 2011 +0100 +++ b/layer/Layer.cpp Mon May 16 17:19:25 2011 +0100 @@ -42,7 +42,7 @@ Layer::~Layer() { -// std::cerr << "Layer::~Layer(" << this << ")" << std::endl; +// DEBUG << "Layer::~Layer(" << this << ")" << endl; } void @@ -169,7 +169,7 @@ Layer::alignToReference(View *v, size_t frame) const { const Model *m = getModel(); - std::cerr << "Layer::alignToReference(" << frame << "): model = " << m << ", alignment reference = " << (m ? m->getAlignmentReference() : 0) << std::endl; + DEBUG << "Layer::alignToReference(" << frame << "): model = " << m << ", alignment reference = " << (m ? m->getAlignmentReference() : 0) << endl; if (m && m->getAlignmentReference()) { return m->alignToReference(frame); } else { @@ -181,7 +181,7 @@ Layer::alignFromReference(View *v, size_t frame) const { const Model *m = getModel(); - std::cerr << "Layer::alignFromReference(" << frame << "): model = " << m << ", alignment reference = " << (m ? m->getAlignmentReference() : 0) << std::endl; + DEBUG << "Layer::alignFromReference(" << frame << "): model = " << m << ", alignment reference = " << (m ? m->getAlignmentReference() : 0) << endl; if (m && m->getAlignmentReference()) { return m->alignFromReference(frame); } else { diff -r 1fe7951a61e8 -r f4960f8ce798 layer/LayerFactory.cpp --- a/layer/LayerFactory.cpp Thu May 12 17:31:43 2011 +0100 +++ b/layer/LayerFactory.cpp Mon May 16 17:19:25 2011 +0100 @@ -442,11 +442,11 @@ } if (!layer) { - std::cerr << "LayerFactory::createLayer: Unknown layer type " - << type << std::endl; + DEBUG << "LayerFactory::createLayer: Unknown layer type " + << type << endl; } else { -// std::cerr << "LayerFactory::createLayer: Setting object name " -// << getLayerPresentationName(type) << " on " << layer << std::endl; +// DEBUG << "LayerFactory::createLayer: Setting object name " +// << getLayerPresentationName(type) << " on " << layer << endl; layer->setObjectName(getLayerPresentationName(type)); setLayerDefaultProperties(type, layer); } @@ -457,7 +457,7 @@ void LayerFactory::setLayerDefaultProperties(LayerType type, Layer *layer) { -// std::cerr << "LayerFactory::setLayerDefaultProperties: type " << type << " (name \"" << getLayerTypeName(type) << "\")" << std::endl; +// DEBUG << "LayerFactory::setLayerDefaultProperties: type " << type << " (name \"" << getLayerTypeName(type) << "\")" << endl; QSettings settings; settings.beginGroup("LayerDefaults"); diff -r 1fe7951a61e8 -r f4960f8ce798 layer/NoteLayer.cpp --- a/layer/NoteLayer.cpp Thu May 12 17:31:43 2011 +0100 +++ b/layer/NoteLayer.cpp Mon May 16 17:19:25 2011 +0100 @@ -60,7 +60,7 @@ connectSignals(m_model); -// std::cerr << "NoteLayer::setModel(" << model << ")" << std::endl; +// DEBUG << "NoteLayer::setModel(" << model << ")" << endl; m_scaleMinimum = 0; m_scaleMaximum = 0; @@ -253,7 +253,7 @@ m_scaleMinimum = min; m_scaleMaximum = max; -// std::cerr << "NoteLayer::setDisplayExtents: min = " << min << ", max = " << max << std::endl; +// DEBUG << "NoteLayer::setDisplayExtents: min = " << min << ", max = " << max << endl; emit layerParametersChanged(); return true; @@ -334,7 +334,7 @@ newmax = max; } - std::cerr << "NoteLayer::setVerticalZoomStep: " << step << ": " << newmin << " -> " << newmax << " (range " << newdist << ")" << std::endl; + DEBUG << "NoteLayer::setVerticalZoomStep: " << step << ": " << newmin << " -> " << newmax << " (range " << newdist << ")" << endl; setDisplayExtents(newmin, newmax); } @@ -724,8 +724,8 @@ QColor brushColour(getBaseQColor()); brushColour.setAlpha(80); -// std::cerr << "NoteLayer::paint: resolution is " -// << m_model->getResolution() << " frames" << std::endl; +// DEBUG << "NoteLayer::paint: resolution is " +// << m_model->getResolution() << " frames" << endl; float min = m_model->getValueMinimum(); float max = m_model->getValueMaximum(); @@ -794,7 +794,7 @@ void NoteLayer::drawStart(View *v, QMouseEvent *e) { -// std::cerr << "NoteLayer::drawStart(" << e->x() << "," << e->y() << ")" << std::endl; +// DEBUG << "NoteLayer::drawStart(" << e->x() << "," << e->y() << ")" << endl; if (!m_model) return; @@ -818,7 +818,7 @@ void NoteLayer::drawDrag(View *v, QMouseEvent *e) { -// std::cerr << "NoteLayer::drawDrag(" << e->x() << "," << e->y() << ")" << std::endl; +// DEBUG << "NoteLayer::drawDrag(" << e->x() << "," << e->y() << ")" << endl; if (!m_model || !m_editing) return; @@ -847,7 +847,7 @@ void NoteLayer::drawEnd(View *, QMouseEvent *) { -// std::cerr << "NoteLayer::drawEnd(" << e->x() << "," << e->y() << ")" << std::endl; +// DEBUG << "NoteLayer::drawEnd(" << e->x() << "," << e->y() << ")" << endl; if (!m_model || !m_editing) return; finish(m_editingCommand); m_editingCommand = 0; @@ -897,7 +897,7 @@ void NoteLayer::editStart(View *v, QMouseEvent *e) { -// std::cerr << "NoteLayer::editStart(" << e->x() << "," << e->y() << ")" << std::endl; +// DEBUG << "NoteLayer::editStart(" << e->x() << "," << e->y() << ")" << endl; if (!m_model) return; @@ -920,7 +920,7 @@ void NoteLayer::editDrag(View *v, QMouseEvent *e) { -// std::cerr << "NoteLayer::editDrag(" << e->x() << "," << e->y() << ")" << std::endl; +// DEBUG << "NoteLayer::editDrag(" << e->x() << "," << e->y() << ")" << endl; if (!m_model || !m_editing) return; @@ -949,7 +949,7 @@ void NoteLayer::editEnd(View *, QMouseEvent *) { -// std::cerr << "NoteLayer::editEnd(" << e->x() << "," << e->y() << ")" << std::endl; +// DEBUG << "NoteLayer::editEnd(" << e->x() << "," << e->y() << ")" << endl; if (!m_model || !m_editing) return; if (m_editingCommand) { diff -r 1fe7951a61e8 -r f4960f8ce798 layer/PaintAssistant.cpp --- a/layer/PaintAssistant.cpp Thu May 12 17:31:43 2011 +0100 +++ b/layer/PaintAssistant.cpp Mon May 16 17:19:25 2011 +0100 @@ -104,8 +104,8 @@ ny = getYForValue(scale, nval, minVal, maxVal, rect.y(), h); } -// std::cerr << "PaintAssistant::paintVerticalLevelScale: val = " -// << val << ", y = " << y << ", h = " << h << std::endl; +// DEBUG << "PaintAssistant::paintVerticalLevelScale: val = " +// << val << ", y = " << y << ", h = " << h << endl; bool spaceForLabel = (i == 0 || abs(y - lastLabelledY) >= textHeight - 1); diff -r 1fe7951a61e8 -r f4960f8ce798 layer/RegionLayer.cpp --- a/layer/RegionLayer.cpp Thu May 12 17:31:43 2011 +0100 +++ b/layer/RegionLayer.cpp Mon May 16 17:19:25 2011 +0100 @@ -61,7 +61,7 @@ connect(m_model, SIGNAL(modelChanged()), this, SLOT(recalcSpacing())); recalcSpacing(); -// std::cerr << "RegionLayer::setModel(" << model << ")" << std::endl; +// DEBUG << "RegionLayer::setModel(" << model << ")" << endl; emit modelReplaced(); } @@ -239,12 +239,12 @@ m_distributionMap.clear(); if (!m_model) return; -// std::cerr << "RegionLayer::recalcSpacing" << std::endl; +// DEBUG << "RegionLayer::recalcSpacing" << endl; for (RegionModel::PointList::const_iterator i = m_model->getPoints().begin(); i != m_model->getPoints().end(); ++i) { m_distributionMap[i->value]++; -// std::cerr << "RegionLayer::recalcSpacing: value found: " << i->value << " (now have " << m_distributionMap[i->value] << " of this value)" << std::endl; +// DEBUG << "RegionLayer::recalcSpacing: value found: " << i->value << " (now have " << m_distributionMap[i->value] << " of this value)" << endl; } int n = 0; @@ -252,7 +252,7 @@ for (SpacingMap::const_iterator i = m_distributionMap.begin(); i != m_distributionMap.end(); ++i) { m_spacingMap[i->first] = n++; -// std::cerr << "RegionLayer::recalcSpacing: " << i->first << " -> " << m_spacingMap[i->first] << std::endl; +// DEBUG << "RegionLayer::recalcSpacing: " << i->first << " -> " << m_spacingMap[i->first] << endl; } } @@ -680,7 +680,7 @@ int y = spacingIndexToY(v, i->second); -// std::cerr << "RegionLayer::getYForValue: value " << val << " -> i->second " << i->second << " -> y " << y << std::endl; +// DEBUG << "RegionLayer::getYForValue: value " << val << " -> i->second " << i->second << " -> y " << y << endl; return y; @@ -811,8 +811,8 @@ val = LogRange::map(val); } -// std::cerr << "RegionLayer::getColourForValue: min " << min << ", max " -// << max << ", log " << log << ", value " << val << std::endl; +// DEBUG << "RegionLayer::getColourForValue: min " << min << ", max " +// << max << ", log " << log << ", value " << val << endl; QColor solid = ColourMapper(m_colourMap, min, max).map(val); return QColor(solid.red(), solid.green(), solid.blue(), 120); @@ -848,8 +848,8 @@ QColor brushColour(getBaseQColor()); brushColour.setAlpha(80); -// std::cerr << "RegionLayer::paint: resolution is " -// << m_model->getResolution() << " frames" << std::endl; +// DEBUG << "RegionLayer::paint: resolution is " +// << m_model->getResolution() << " frames" << endl; float min = m_model->getValueMinimum(); float max = m_model->getValueMaximum(); diff -r 1fe7951a61e8 -r f4960f8ce798 layer/SingleColourLayer.cpp --- a/layer/SingleColourLayer.cpp Thu May 12 17:31:43 2011 +0100 +++ b/layer/SingleColourLayer.cpp Mon May 16 17:19:25 2011 +0100 @@ -132,7 +132,7 @@ SingleColourLayer::setDefaultColourFor(View *v) { #ifdef DEBUG_COLOUR_SELECTION - std::cerr << "SingleColourLayer::setDefaultColourFor: m_colourExplicitlySet = " << m_colourExplicitlySet << ", m_defaultColourSet " << m_defaultColourSet << std::endl; + DEBUG << "SingleColourLayer::setDefaultColourFor: m_colourExplicitlySet = " << m_colourExplicitlySet << ", m_defaultColourSet " << m_defaultColourSet << endl; #endif if (m_colourExplicitlySet || m_defaultColourSet) return; @@ -312,7 +312,7 @@ if (m_colour != colour) { #ifdef DEBUG_COLOUR_SELECTION - std::cerr << "SingleColourLayer::setProperties: changing colour from " << m_colour << " to " << colour << std::endl; + DEBUG << "SingleColourLayer::setProperties: changing colour from " << m_colour << " to " << colour << endl; #endif if (m_colourRefCount.find(m_colour) != m_colourRefCount.end() && diff -r 1fe7951a61e8 -r f4960f8ce798 layer/SliceLayer.cpp --- a/layer/SliceLayer.cpp Thu May 12 17:31:43 2011 +0100 +++ b/layer/SliceLayer.cpp Mon May 16 17:19:25 2011 +0100 @@ -73,7 +73,7 @@ void SliceLayer::sliceableModelReplaced(const Model *orig, const Model *replacement) { - std::cerr << "SliceLayer::sliceableModelReplaced(" << orig << ", " << replacement << ")" << std::endl; + DEBUG << "SliceLayer::sliceableModelReplaced(" << orig << ", " << replacement << ")" << endl; if (orig == m_sliceableModel) { setSliceableModel @@ -84,7 +84,7 @@ void SliceLayer::modelAboutToBeDeleted(Model *m) { - std::cerr << "SliceLayer::modelAboutToBeDeleted(" << m << ")" << std::endl; + DEBUG << "SliceLayer::modelAboutToBeDeleted(" << m << ")" << endl; if (m == m_sliceableModel) { setSliceableModel(0); diff -r 1fe7951a61e8 -r f4960f8ce798 layer/SpectrogramLayer.cpp --- a/layer/SpectrogramLayer.cpp Thu May 12 17:31:43 2011 +0100 +++ b/layer/SpectrogramLayer.cpp Mon May 16 17:19:25 2011 +0100 @@ -578,10 +578,10 @@ const View *v = i->first; #ifdef DEBUG_SPECTROGRAM_REPAINT - std::cerr << "SpectrogramLayer::invalidateImageCaches(" + DEBUG << "SpectrogramLayer::invalidateImageCaches(" << startFrame << ", " << endFrame << "): view range is " << v->getStartFrame() << ", " << v->getEndFrame() - << std::endl; + << endl; std::cerr << "Valid area was: " << i->second.validArea.x() << ", " << i->second.validArea.y() << " " @@ -598,7 +598,7 @@ } int x = v->getXForFrame(startFrame); #ifdef DEBUG_SPECTROGRAM_REPAINT - std::cerr << "clipping from 0 to " << x-1 << std::endl; + DEBUG << "clipping from 0 to " << x-1 << endl; #endif if (x > 1) { i->second.validArea &= @@ -615,8 +615,8 @@ } int x = v->getXForFrame(endFrame); #ifdef DEBUG_SPECTROGRAM_REPAINT - std::cerr << "clipping from " << x+1 << " to " << v->width() - << std::endl; + DEBUG << "clipping from " << x+1 << " to " << v->width() + << endl; #endif if (x < v->width()) { i->second.validArea &= @@ -638,7 +638,7 @@ void SpectrogramLayer::preferenceChanged(PropertyContainer::PropertyName name) { - std::cerr << "SpectrogramLayer::preferenceChanged(" << name << ")" << std::endl; + DEBUG << "SpectrogramLayer::preferenceChanged(" << name << ")" << endl; if (name == "Window Type") { setWindowType(Preferences::getInstance()->getWindowType()); @@ -764,8 +764,8 @@ void SpectrogramLayer::setGain(float gain) { -// std::cerr << "SpectrogramLayer::setGain(" << gain << ") (my gain is now " -// << m_gain << ")" << std::endl; +// DEBUG << "SpectrogramLayer::setGain(" << gain << ") (my gain is now " +// << m_gain << ")" << endl; if (m_gain == gain) return; @@ -805,7 +805,7 @@ { if (m_minFrequency == mf) return; -// std::cerr << "SpectrogramLayer::setMinFrequency: " << mf << std::endl; +// DEBUG << "SpectrogramLayer::setMinFrequency: " << mf << endl; invalidateImageCaches(); invalidateMagnitudes(); @@ -826,7 +826,7 @@ { if (m_maxFrequency == mf) return; -// std::cerr << "SpectrogramLayer::setMaxFrequency: " << mf << std::endl; +// DEBUG << "SpectrogramLayer::setMaxFrequency: " << mf << endl; invalidateImageCaches(); invalidateMagnitudes(); @@ -951,8 +951,8 @@ void SpectrogramLayer::setNormalizeVisibleArea(bool n) { - std::cerr << "SpectrogramLayer::setNormalizeVisibleArea(" << n - << ") (from " << m_normalizeVisibleArea << ")" << std::endl; + DEBUG << "SpectrogramLayer::setNormalizeVisibleArea(" << n + << ") (from " << m_normalizeVisibleArea << ")" << endl; if (m_normalizeVisibleArea == n) return; @@ -975,8 +975,8 @@ if (dormant) { #ifdef DEBUG_SPECTROGRAM_REPAINT - std::cerr << "SpectrogramLayer::setLayerDormant(" << dormant << ")" - << std::endl; + DEBUG << "SpectrogramLayer::setLayerDormant(" << dormant << ")" + << endl; #endif if (isLayerDormant(v)) { @@ -1020,7 +1020,7 @@ SpectrogramLayer::cacheInvalid() { #ifdef DEBUG_SPECTROGRAM_REPAINT - std::cerr << "SpectrogramLayer::cacheInvalid()" << std::endl; + DEBUG << "SpectrogramLayer::cacheInvalid()" << endl; #endif invalidateImageCaches(); @@ -1031,7 +1031,7 @@ SpectrogramLayer::cacheInvalid(size_t from, size_t to) { #ifdef DEBUG_SPECTROGRAM_REPAINT - std::cerr << "SpectrogramLayer::cacheInvalid(" << from << ", " << to << ")" << std::endl; + DEBUG << "SpectrogramLayer::cacheInvalid(" << from << ", " << to << ")" << endl; #endif invalidateImageCaches(from, to); @@ -1046,7 +1046,7 @@ bool allDone = true; #ifdef DEBUG_SPECTROGRAM_REPAINT - std::cerr << "SpectrogramLayer::fillTimerTimedOut: have " << m_fftModels.size() << " FFT models associated with views" << std::endl; + DEBUG << "SpectrogramLayer::fillTimerTimedOut: have " << m_fftModels.size() << " FFT models associated with views" << endl; #endif for (ViewFFTMap::iterator i = m_fftModels.begin(); @@ -1060,7 +1060,7 @@ size_t fill = model->getFillExtent(); #ifdef DEBUG_SPECTROGRAM_REPAINT - std::cerr << "SpectrogramLayer::fillTimerTimedOut: extent for " << model << ": " << fill << ", last " << lastFill << ", total " << m_model->getEndFrame() << std::endl; + DEBUG << "SpectrogramLayer::fillTimerTimedOut: extent for " << model << ": " << fill << ", last " << lastFill << ", total " << m_model->getEndFrame() << endl; #endif if (fill >= lastFill) { @@ -1629,13 +1629,13 @@ if (m_fftModels.find(v) != m_fftModels.end()) { if (m_fftModels[v].first == 0) { #ifdef DEBUG_SPECTROGRAM_REPAINT - std::cerr << "SpectrogramLayer::getFFTModel(" << v << "): Found null model" << std::endl; + DEBUG << "SpectrogramLayer::getFFTModel(" << v << "): Found null model" << endl; #endif return 0; } if (m_fftModels[v].first->getHeight() != fftSize / 2 + 1) { #ifdef DEBUG_SPECTROGRAM_REPAINT - std::cerr << "SpectrogramLayer::getFFTModel(" << v << "): Found a model with the wrong height (" << m_fftModels[v].first->getHeight() << ", wanted " << (fftSize / 2 + 1) << ")" << std::endl; + DEBUG << "SpectrogramLayer::getFFTModel(" << v << "): Found a model with the wrong height (" << m_fftModels[v].first->getHeight() << ", wanted " << (fftSize / 2 + 1) << ")" << endl; #endif delete m_fftModels[v].first; m_fftModels.erase(v); @@ -1643,7 +1643,7 @@ m_peakCaches.erase(v); } else { #ifdef DEBUG_SPECTROGRAM_REPAINT - std::cerr << "SpectrogramLayer::getFFTModel(" << v << "): Found a good model of height " << m_fftModels[v].first->getHeight() << std::endl; + DEBUG << "SpectrogramLayer::getFFTModel(" << v << "): Found a good model of height " << m_fftModels[v].first->getHeight() << endl; #endif return m_fftModels[v].first; } @@ -1764,7 +1764,7 @@ int s0 = int(std::min(s00, s10) + 0.0001); int s1 = int(std::max(s01, s11) + 0.0001); -// std::cerr << "SpectrogramLayer::updateViewMagnitudes: x0 = " << x0 << ", x1 = " << x1 << ", s00 = " << s00 << ", s11 = " << s11 << " s0 = " << s0 << ", s1 = " << s1 << std::endl; +// DEBUG << "SpectrogramLayer::updateViewMagnitudes: x0 = " << x0 << ", x1 = " << x1 << ", s00 = " << s00 << ", s11 = " << s11 << " s0 = " << s0 << ", s1 = " << s1 << endl; if (int(m_columnMags.size()) <= s1) { m_columnMags.resize(s1 + 1); @@ -1777,8 +1777,8 @@ } #ifdef DEBUG_SPECTROGRAM_REPAINT - std::cerr << "SpectrogramLayer::updateViewMagnitudes returning from cols " - << s0 << " -> " << s1 << " inclusive" << std::endl; + DEBUG << "SpectrogramLayer::updateViewMagnitudes returning from cols " + << s0 << " -> " << s1 << " inclusive" << endl; #endif if (!mag.isSet()) return false; @@ -1802,7 +1802,7 @@ Profiler profiler("SpectrogramLayer::paint", false); #ifdef DEBUG_SPECTROGRAM_REPAINT - std::cerr << "SpectrogramLayer::paint(): m_model is " << m_model << ", zoom level is " << v->getZoomLevel() << ", m_updateTimer " << m_updateTimer << std::endl; + DEBUG << "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; #endif @@ -1816,7 +1816,7 @@ } if (isLayerDormant(v)) { - std::cerr << "SpectrogramLayer::paint(): Layer is dormant, making it undormant again" << std::endl; + DEBUG << "SpectrogramLayer::paint(): Layer is dormant, making it undormant again" << endl; } // Need to do this even if !isLayerDormant, as that could mean v @@ -1837,14 +1837,14 @@ ImageCache &cache = m_imageCaches[v]; #ifdef DEBUG_SPECTROGRAM_REPAINT - std::cerr << "SpectrogramLayer::paint(): image cache valid area " << cache. - -validArea.x() << ", " << cache.validArea.y() << ", " << cache.validArea.width() << "x" << cache.validArea.height() << std::endl; + DEBUG << "SpectrogramLayer::paint(): image cache valid area " << cache. + +validArea.x() << ", " << cache.validArea.y() << ", " << cache.validArea.width() << "x" << cache.validArea.height() << endl; #endif #ifdef DEBUG_SPECTROGRAM_REPAINT bool stillCacheing = (m_updateTimer != 0); - std::cerr << "SpectrogramLayer::paint(): Still cacheing = " << stillCacheing << std::endl; + DEBUG << "SpectrogramLayer::paint(): Still cacheing = " << stillCacheing << endl; #endif int zoomLevel = v->getZoomLevel(); @@ -2202,7 +2202,7 @@ bool runOutOfData = false; if (w == 0) { - std::cerr << "*** NOTE: w == 0" << std::endl; + DEBUG << "*** NOTE: w == 0" << endl; } #ifdef DEBUG_SPECTROGRAM_REPAINT @@ -2363,18 +2363,18 @@ if (recreateWholeImageCache) { #ifdef DEBUG_SPECTROGRAM_REPAINT - std::cerr << "Recreating image cache: width = " << v->width() - << ", height = " << h << std::endl; + DEBUG << "Recreating image cache: width = " << v->width() + << ", height = " << h << endl; #endif cache.image = QImage(v->width(), h, QImage::Format_ARGB32_Premultiplied); } if (w > 0) { #ifdef DEBUG_SPECTROGRAM_REPAINT - std::cerr << "Painting " << w << "x" << h + DEBUG << "Painting " << w << "x" << h << " from draw buffer at " << 0 << "," << 0 << " to " << w << "x" << h << " on cache at " - << x0 << "," << 0 << std::endl; + << x0 << "," << 0 << endl; #endif QPainter cachePainter(&cache.image); @@ -2383,13 +2383,13 @@ int scaledLeft = v->getXForFrame(leftBoundaryFrame); int scaledRight = v->getXForFrame(rightBoundaryFrame); #ifdef DEBUG_SPECTROGRAM_REPAINT - cerr << "Rescaling image from " << bufwid + DEBUG << "Rescaling image from " << bufwid << "x" << h << " to " << scaledRight-scaledLeft << "x" << h << endl; #endif Preferences::SpectrogramXSmoothing xsmoothing = Preferences::getInstance()->getSpectrogramXSmoothing(); -// cerr << "xsmoothing == " << xsmoothing << endl; +// DEBUG << "xsmoothing == " << xsmoothing << endl; QImage scaled = m_drawBuffer.scaled (scaledRight - scaledLeft, h, Qt::IgnoreAspectRatio, @@ -2398,7 +2398,7 @@ int scaledLeftCrop = v->getXForFrame(leftCropFrame); int scaledRightCrop = v->getXForFrame(rightCropFrame); #ifdef DEBUG_SPECTROGRAM_REPAINT - cerr << "Drawing image region of width " << scaledRightCrop - scaledLeftCrop << " to " + DEBUG << "Drawing image region of width " << scaledRightCrop - scaledLeftCrop << " to " << scaledLeftCrop << " from " << scaledLeftCrop - scaledLeft << endl; #endif cachePainter.drawImage @@ -2419,9 +2419,9 @@ QRect pr = rect & cache.validArea; #ifdef DEBUG_SPECTROGRAM_REPAINT - std::cerr << "Painting " << pr.width() << "x" << pr.height() + DEBUG << "Painting " << pr.width() << "x" << pr.height() << " from cache at " << pr.x() << "," << pr.y() - << " to window" << std::endl; + << " to window" << endl; #endif paint.drawImage(pr.x(), pr.y(), cache.image, @@ -2439,8 +2439,8 @@ if (cache.validArea.x() > 0) { #ifdef DEBUG_SPECTROGRAM_REPAINT - std::cerr << "SpectrogramLayer::paint() updating left (0, " - << cache.validArea.x() << ")" << std::endl; + DEBUG << "SpectrogramLayer::paint() updating left (0, " + << cache.validArea.x() << ")" << endl; #endif v->update(0, 0, cache.validArea.x(), h); } @@ -2448,12 +2448,12 @@ if (cache.validArea.x() + cache.validArea.width() < cache.image.width()) { #ifdef DEBUG_SPECTROGRAM_REPAINT - std::cerr << "SpectrogramLayer::paint() updating right (" + DEBUG << "SpectrogramLayer::paint() updating right (" << cache.validArea.x() + cache.validArea.width() << ", " << cache.image.width() - (cache.validArea.x() + cache.validArea.width()) - << ")" << std::endl; + << ")" << endl; #endif v->update(cache.validArea.x() + cache.validArea.width(), 0, @@ -2472,7 +2472,7 @@ illuminateLocalFeatures(v, paint); #ifdef DEBUG_SPECTROGRAM_REPAINT - std::cerr << "SpectrogramLayer::paint() returning" << std::endl; + DEBUG << "SpectrogramLayer::paint() returning" << endl; #endif if (!m_synchronous) { @@ -2707,7 +2707,7 @@ if (sx != psx) { if (fft) { #ifdef DEBUG_SPECTROGRAM_REPAINT - cerr << "Retrieving column " << sx << " from fft directly" << endl; + DEBUG << "Retrieving column " << sx << " from fft directly" << endl; #endif if (m_colourScale == PhaseColourScale) { fft->getPhasesAt(sx, autoarray, minbin, maxbin - minbin + 1); @@ -2718,7 +2718,7 @@ } } else { #ifdef DEBUG_SPECTROGRAM_REPAINT - cerr << "Retrieving column " << sx << " from peaks cache" << endl; + DEBUG << "Retrieving column " << sx << " from peaks cache" << endl; #endif c = sourceModel->getColumn(sx); if (m_normalizeColumns) { @@ -2900,7 +2900,7 @@ size_t completion = m_fftModels[v].first->getCompletion(); #ifdef DEBUG_SPECTROGRAM_REPAINT - std::cerr << "SpectrogramLayer::getCompletion: completion = " << completion << std::endl; + DEBUG << "SpectrogramLayer::getCompletion: completion = " << completion << endl; #endif return completion; } @@ -2933,7 +2933,7 @@ min = getEffectiveMinFrequency(); max = getEffectiveMaxFrequency(); -// std::cerr << "SpectrogramLayer::getDisplayExtents: " << min << "->" << max << std::endl; +// DEBUG << "SpectrogramLayer::getDisplayExtents: " << min << "->" << max << endl; return true; } @@ -2942,7 +2942,7 @@ { if (!m_model) return false; -// std::cerr << "SpectrogramLayer::setDisplayExtents: " << min << "->" << max << std::endl; +// DEBUG << "SpectrogramLayer::setDisplayExtents: " << min << "->" << max << endl; if (min < 0) min = 0; if (max > m_model->getSampleRate()/2) max = m_model->getSampleRate()/2; @@ -3551,7 +3551,7 @@ defaultStep = mapper.getPositionForValue(initialMax) - minStep; -// std::cerr << "SpectrogramLayer::getVerticalZoomSteps: " << maxStep - minStep << " (" << maxStep <<"-" << minStep << "), default is " << defaultStep << " (from initial max freq " << initialMax << ")" << std::endl; +// DEBUG << "SpectrogramLayer::getVerticalZoomSteps: " << maxStep - minStep << " (" << maxStep <<"-" << minStep << "), default is " << defaultStep << " (from initial max freq " << initialMax << ")" << endl; return maxStep - minStep; } @@ -3566,7 +3566,7 @@ SpectrogramRangeMapper mapper(m_model->getSampleRate(), m_fftSize); int n = mapper.getPositionForValue(dmax - dmin); -// std::cerr << "SpectrogramLayer::getCurrentVerticalZoomStep: " << n << std::endl; +// DEBUG << "SpectrogramLayer::getCurrentVerticalZoomStep: " << n << endl; return n; } @@ -3632,7 +3632,7 @@ newmax = mmax; } -// std::cerr << "SpectrogramLayer::setVerticalZoomStep: " << step << ": " << newmin << " -> " << newmax << " (range " << newdist << ")" << std::endl; +// DEBUG << "SpectrogramLayer::setVerticalZoomStep: " << step << ": " << newmin << " -> " << newmax << " (range " << newdist << ")" << endl; setMinFrequency(lrintf(newmin)); setMaxFrequency(lrintf(newmax)); @@ -3654,7 +3654,7 @@ int y1 = y0; if (r.endY > 0.0) y1 = getYForFrequency(v, r.endY); -// std::cerr << "SpectrogramLayer::updateMeasureRectYCoords: start " << r.startY << " -> " << y0 << ", end " << r.endY << " -> " << y1 << std::endl; +// DEBUG << "SpectrogramLayer::updateMeasureRectYCoords: start " << r.startY << " -> " << y0 << ", end " << r.endY << " -> " << y1 << endl; r.pixrect = QRect(r.pixrect.x(), y0, r.pixrect.width(), y1 - y0); } @@ -3668,7 +3668,7 @@ } else { r.endY = getFrequencyForY(v, y); } -// std::cerr << "SpectrogramLayer::setMeasureRectYCoord: start " << r.startY << " <- " << y << ", end " << r.endY << " <- " << y << std::endl; +// DEBUG << "SpectrogramLayer::setMeasureRectYCoord: start " << r.startY << " <- " << y << ", end " << r.endY << " <- " << y << endl; } @@ -3744,13 +3744,13 @@ size_t minFrequency = attributes.value("minFrequency").toUInt(&ok); if (ok) { - std::cerr << "SpectrogramLayer::setProperties: setting min freq to " << minFrequency << std::endl; + DEBUG << "SpectrogramLayer::setProperties: setting min freq to " << minFrequency << endl; setMinFrequency(minFrequency); } size_t maxFrequency = attributes.value("maxFrequency").toUInt(&ok); if (ok) { - std::cerr << "SpectrogramLayer::setProperties: setting max freq to " << maxFrequency << std::endl; + DEBUG << "SpectrogramLayer::setProperties: setting max freq to " << maxFrequency << endl; setMaxFrequency(maxFrequency); } diff -r 1fe7951a61e8 -r f4960f8ce798 layer/SpectrumLayer.cpp --- a/layer/SpectrumLayer.cpp Thu May 12 17:31:43 2011 +0100 +++ b/layer/SpectrumLayer.cpp Mon May 16 17:19:25 2011 +0100 @@ -57,7 +57,7 @@ void SpectrumLayer::setModel(DenseTimeValueModel *model) { - std::cerr << "SpectrumLayer::setModel(" << model << ") from " << m_originModel << std::endl; + DEBUG << "SpectrumLayer::setModel(" << model << ") from " << m_originModel << endl; if (m_originModel == model) return; @@ -79,7 +79,7 @@ void SpectrumLayer::setChannel(int channel) { - std::cerr << "SpectrumLayer::setChannel(" << channel << ") from " << m_channel << std::endl; + DEBUG << "SpectrumLayer::setChannel(" << channel << ") from " << m_channel << endl; m_channelSet = true; @@ -654,12 +654,12 @@ { if (!m_originModel || !m_originModel->isOK() || !m_originModel->isReady()) { - std::cerr << "SpectrumLayer::paint: no origin model, or origin model not OK or not ready" << std::endl; + DEBUG << "SpectrumLayer::paint: no origin model, or origin model not OK or not ready" << endl; return; } if (m_newFFTNeeded) { - std::cerr << "SpectrumLayer::paint: new FFT needed, calling setupFFT" << std::endl; + DEBUG << "SpectrumLayer::paint: new FFT needed, calling setupFFT" << endl; const_cast(this)->setupFFT(); //ugh } @@ -682,7 +682,7 @@ // draw peak lines -// std::cerr << "Showing peaks..." << std::endl; +// DEBUG << "Showing peaks..." << endl; size_t col = v->getCentreFrame() / fft->getResolution(); diff -r 1fe7951a61e8 -r f4960f8ce798 layer/TextLayer.cpp --- a/layer/TextLayer.cpp Thu May 12 17:31:43 2011 +0100 +++ b/layer/TextLayer.cpp Mon May 16 17:19:25 2011 +0100 @@ -51,7 +51,7 @@ connectSignals(m_model); -// std::cerr << "TextLayer::setModel(" << model << ")" << std::endl; +// DEBUG << "TextLayer::setModel(" << model << ")" << endl; emit modelReplaced(); } @@ -331,8 +331,8 @@ QColor penColour; penColour = v->getForeground(); -// std::cerr << "TextLayer::paint: resolution is " -// << m_model->getResolution() << " frames" << std::endl; +// DEBUG << "TextLayer::paint: resolution is " +// << m_model->getResolution() << " frames" << endl; QPoint localPos; TextModel::Point illuminatePoint(0); @@ -413,10 +413,10 @@ void TextLayer::drawStart(View *v, QMouseEvent *e) { -// std::cerr << "TextLayer::drawStart(" << e->x() << "," << e->y() << ")" << std::endl; +// DEBUG << "TextLayer::drawStart(" << e->x() << "," << e->y() << ")" << endl; if (!m_model) { - std::cerr << "TextLayer::drawStart: no model" << std::endl; + DEBUG << "TextLayer::drawStart: no model" << endl; return; } @@ -439,7 +439,7 @@ void TextLayer::drawDrag(View *v, QMouseEvent *e) { -// std::cerr << "TextLayer::drawDrag(" << e->x() << "," << e->y() << ")" << std::endl; +// DEBUG << "TextLayer::drawDrag(" << e->x() << "," << e->y() << ")" << endl; if (!m_model || !m_editing) return; @@ -458,7 +458,7 @@ void TextLayer::drawEnd(View *v, QMouseEvent *) { -// std::cerr << "TextLayer::drawEnd(" << e->x() << "," << e->y() << ")" << std::endl; +// DEBUG << "TextLayer::drawEnd(" << e->x() << "," << e->y() << ")" << endl; if (!m_model || !m_editing) return; bool ok = false; @@ -523,7 +523,7 @@ void TextLayer::editStart(View *v, QMouseEvent *e) { -// std::cerr << "TextLayer::editStart(" << e->x() << "," << e->y() << ")" << std::endl; +// DEBUG << "TextLayer::editStart(" << e->x() << "," << e->y() << ")" << endl; if (!m_model) return; @@ -572,7 +572,7 @@ void TextLayer::editEnd(View *, QMouseEvent *) { -// std::cerr << "TextLayer::editEnd(" << e->x() << "," << e->y() << ")" << std::endl; +// DEBUG << "TextLayer::editEnd(" << e->x() << "," << e->y() << ")" << endl; if (!m_model || !m_editing) return; if (m_editingCommand) { diff -r 1fe7951a61e8 -r f4960f8ce798 layer/TimeInstantLayer.cpp --- a/layer/TimeInstantLayer.cpp Thu May 12 17:31:43 2011 +0100 +++ b/layer/TimeInstantLayer.cpp Mon May 16 17:19:25 2011 +0100 @@ -60,7 +60,7 @@ connectSignals(m_model); #ifdef DEBUG_TIME_INSTANT_LAYER - std::cerr << "TimeInstantLayer::setModel(" << model << ")" << std::endl; + DEBUG << "TimeInstantLayer::setModel(" << model << ")" << endl; #endif if (m_model && m_model->getRDFTypeURI().endsWith("Segment")) { @@ -363,8 +363,8 @@ oddBrushColour.setAlpha(100); } -// std::cerr << "TimeInstantLayer::paint: resolution is " -// << m_model->getResolution() << " frames" << std::endl; +// DEBUG << "TimeInstantLayer::paint: resolution is " +// << m_model->getResolution() << " frames" << endl; QPoint localPos; long illuminateFrame = -1; @@ -469,7 +469,7 @@ TimeInstantLayer::drawStart(View *v, QMouseEvent *e) { #ifdef DEBUG_TIME_INSTANT_LAYER - std::cerr << "TimeInstantLayer::drawStart(" << e->x() << ")" << std::endl; + DEBUG << "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; + DEBUG << "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; + DEBUG << "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; + DEBUG << "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; + DEBUG << "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; + DEBUG << "TimeInstantLayer::editEnd(" << e->x() << ")" << endl; #endif if (!m_model || !m_editing) return; if (m_editingCommand) { diff -r 1fe7951a61e8 -r f4960f8ce798 layer/TimeRulerLayer.cpp --- a/layer/TimeRulerLayer.cpp Thu May 12 17:31:43 2011 +0100 +++ b/layer/TimeRulerLayer.cpp Mon May 16 17:19:25 2011 +0100 @@ -72,7 +72,7 @@ resolution = RealTime::realTime2Frame(rtick, rate); int right = left + resolution; -// std::cerr << "TimeRulerLayer::snapToFeatureFrame: type " +// DEBUG << "TimeRulerLayer::snapToFeatureFrame: type " // << int(snap) << ", frame " << frame << " (time " // << rt << ", tick " << rtick << ", rounded " << rdrt << ") "; @@ -135,7 +135,7 @@ } } -// std::cerr << " -> " << frame << " (resolution = " << resolution << ")" << std::endl; +// DEBUG << " -> " << frame << " (resolution = " << resolution << ")" << endl; return true; } @@ -195,8 +195,8 @@ TimeRulerLayer::paint(View *v, QPainter &paint, QRect rect) const { #ifdef DEBUG_TIME_RULER_LAYER - std::cerr << "TimeRulerLayer::paint (" << rect.x() << "," << rect.y() - << ") [" << rect.width() << "x" << rect.height() << "]" << std::endl; + DEBUG << "TimeRulerLayer::paint (" << rect.x() << "," << rect.y() + << ") [" << rect.width() << "x" << rect.height() << "]" << endl; #endif if (!m_model || !m_model->isOK()) return; @@ -252,7 +252,7 @@ int x = v->getXForFrame(frame); #ifdef DEBUG_TIME_RULER_LAYER - std::cerr << "Considering frame = " << frame << ", x = " << x << std::endl; + DEBUG << "Considering frame = " << frame << ", x = " << x << endl; #endif if (x >= rect.x() + rect.width() + 50) { diff -r 1fe7951a61e8 -r f4960f8ce798 layer/TimeValueLayer.cpp --- a/layer/TimeValueLayer.cpp Thu May 12 17:31:43 2011 +0100 +++ b/layer/TimeValueLayer.cpp Mon May 16 17:19:25 2011 +0100 @@ -81,7 +81,7 @@ } #ifdef DEBUG_TIME_VALUE_LAYER - std::cerr << "TimeValueLayer::setModel(" << model << ")" << std::endl; + DEBUG << "TimeValueLayer::setModel(" << model << ")" << endl; #endif emit modelReplaced(); @@ -348,7 +348,7 @@ } #ifdef DEBUG_TIME_VALUE_LAYER - std::cerr << "TimeValueLayer::getDisplayExtents: min = " << min << ", max = " << max << std::endl; + DEBUG << "TimeValueLayer::getDisplayExtents: min = " << min << ", max = " << max << endl; #endif return true; @@ -371,7 +371,7 @@ m_scaleMaximum = max; #ifdef DEBUG_TIME_VALUE_LAYER - std::cerr << "TimeValueLayer::setDisplayExtents: min = " << min << ", max = " << max << std::endl; + DEBUG << "TimeValueLayer::setDisplayExtents: min = " << min << ", max = " << max << endl; #endif emit layerParametersChanged(); @@ -403,7 +403,7 @@ int nr = mapper->getPositionForValue(dmax - dmin); #ifdef DEBUG_TIME_VALUE_LAYER - std::cerr << "TimeValueLayer::getCurrentVerticalZoomStep: dmin = " << dmin << ", dmax = " << dmax << ", nr = " << nr << std::endl; + DEBUG << "TimeValueLayer::getCurrentVerticalZoomStep: dmin = " << dmin << ", dmax = " << dmax << ", nr = " << nr << endl; #endif delete mapper; @@ -458,7 +458,7 @@ } #ifdef DEBUG_TIME_VALUE_LAYER - std::cerr << "TimeValueLayer::setVerticalZoomStep: " << step << ": " << newmin << " -> " << newmax << " (range " << newdist << ")" << std::endl; + DEBUG << "TimeValueLayer::setVerticalZoomStep: " << step << ": " << newmin << " -> " << newmax << " (range " << newdist << ")" << endl; #endif setDisplayExtents(newmin, newmax); @@ -826,8 +826,8 @@ } #ifdef DEBUG_TIME_VALUE_LAYER - std::cerr << "TimeValueLayer::getColourForValue: min " << min << ", max " - << max << ", log " << log << ", value " << val << std::endl; + DEBUG << "TimeValueLayer::getColourForValue: min " << min << ", max " + << max << ", log " << log << ", value " << val << endl; #endif QColor solid = ColourMapper(m_colourMap, min, max).map(val); @@ -870,8 +870,8 @@ paint.setBrush(brushColour); #ifdef DEBUG_TIME_VALUE_LAYER - std::cerr << "TimeValueLayer::paint: resolution is " - << m_model->getResolution() << " frames" << std::endl; + DEBUG << "TimeValueLayer::paint: resolution is " + << m_model->getResolution() << " frames" << endl; #endif float min = m_model->getValueMinimum(); @@ -1067,7 +1067,7 @@ if (m_plotStyle == PlotSegmentation) { #ifdef DEBUG_TIME_VALUE_LAYER - std::cerr << "drawing rect" << std::endl; + DEBUG << "drawing rect" << endl; #endif if (nx <= x) continue; @@ -1251,7 +1251,7 @@ TimeValueLayer::drawStart(View *v, QMouseEvent *e) { #ifdef DEBUG_TIME_VALUE_LAYER - std::cerr << "TimeValueLayer::drawStart(" << e->x() << "," << e->y() << ")" << std::endl; + DEBUG << "TimeValueLayer::drawStart(" << e->x() << "," << e->y() << ")" << endl; #endif if (!m_model) return; @@ -1271,7 +1271,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; + DEBUG << "ignoring out-of-range frame at " << i->frame << endl; #endif continue; } @@ -1301,7 +1301,7 @@ TimeValueLayer::drawDrag(View *v, QMouseEvent *e) { #ifdef DEBUG_TIME_VALUE_LAYER - std::cerr << "TimeValueLayer::drawDrag(" << e->x() << "," << e->y() << ")" << std::endl; + DEBUG << "TimeValueLayer::drawDrag(" << e->x() << "," << e->y() << ")" << endl; #endif if (!m_model || !m_editing) return; @@ -1327,18 +1327,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; + DEBUG << "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; + DEBUG << "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; + DEBUG << "adjusting to new point at " << i->frame << ", " << i->value << endl; #endif m_editingPoint = *i; m_originalPoint = m_editingPoint; @@ -1363,7 +1363,7 @@ TimeValueLayer::drawEnd(View *, QMouseEvent *) { #ifdef DEBUG_TIME_VALUE_LAYER - std::cerr << "TimeValueLayer::drawEnd" << std::endl; + DEBUG << "TimeValueLayer::drawEnd" << endl; #endif if (!m_model || !m_editing) return; finish(m_editingCommand); @@ -1420,7 +1420,7 @@ TimeValueLayer::editStart(View *v, QMouseEvent *e) { #ifdef DEBUG_TIME_VALUE_LAYER - std::cerr << "TimeValueLayer::editStart(" << e->x() << "," << e->y() << ")" << std::endl; + DEBUG << "TimeValueLayer::editStart(" << e->x() << "," << e->y() << ")" << endl; #endif if (!m_model) return; @@ -1443,7 +1443,7 @@ TimeValueLayer::editDrag(View *v, QMouseEvent *e) { #ifdef DEBUG_TIME_VALUE_LAYER - std::cerr << "TimeValueLayer::editDrag(" << e->x() << "," << e->y() << ")" << std::endl; + DEBUG << "TimeValueLayer::editDrag(" << e->x() << "," << e->y() << ")" << endl; #endif if (!m_model || !m_editing) return; @@ -1469,7 +1469,7 @@ TimeValueLayer::editEnd(View *, QMouseEvent *) { #ifdef DEBUG_TIME_VALUE_LAYER - std::cerr << "TimeValueLayer::editEnd" << std::endl; + DEBUG << "TimeValueLayer::editEnd" << endl; #endif if (!m_model || !m_editing) return; @@ -1809,9 +1809,9 @@ newPoint.value = i->getValue(); } else { #ifdef DEBUG_TIME_VALUE_LAYER - std::cerr << "Setting value on point at " << newPoint.frame << " from labeller"; + DEBUG << "Setting value on point at " << newPoint.frame << " from labeller"; if (i == points.begin()) { - std::cerr << ", no prev point" << std::endl; + DEBUG << ", no prev point" << endl; } else { std::cerr << ", prev point is at " << prevPoint.frame << std::endl; } diff -r 1fe7951a61e8 -r f4960f8ce798 layer/WaveformLayer.cpp --- a/layer/WaveformLayer.cpp Thu May 12 17:31:43 2011 +0100 +++ b/layer/WaveformLayer.cpp Mon May 16 17:19:25 2011 +0100 @@ -288,7 +288,7 @@ void WaveformLayer::setChannel(int channel) { -// std::cerr << "WaveformLayer::setChannel(" << channel << ")" << std::endl; +// DEBUG << "WaveformLayer::setChannel(" << channel << ")" << endl; if (m_channel == channel) return; m_channel = channel; @@ -382,7 +382,7 @@ merging = (m_channelMode == MergeChannels && rawChannels > 1); mixing = (m_channelMode == MixChannels && rawChannels > 1); -// std::cerr << "WaveformLayer::getChannelArrangement: min " << min << ", max " << max << ", merging " << merging << ", channels " << channels << std::endl; +// DEBUG << "WaveformLayer::getChannelArrangement: min " << min << ", max " << max << ", merging " << merging << ", channels " << channels << endl; return channels; } @@ -474,8 +474,8 @@ #ifdef DEBUG_WAVEFORM_PAINT Profiler profiler("WaveformLayer::paint", true); - std::cerr << "WaveformLayer::paint (" << rect.x() << "," << rect.y() - << ") [" << rect.width() << "x" << rect.height() << "]: zoom " << zoomLevel << ", start " << startFrame << std::endl; + DEBUG << "WaveformLayer::paint (" << rect.x() << "," << rect.y() + << ") [" << rect.width() << "x" << rect.height() << "]: zoom " << zoomLevel << ", start " << startFrame << endl; #endif size_t channels = 0, minChannel = 0, maxChannel = 0; @@ -494,7 +494,7 @@ if (m_aggressive) { #ifdef DEBUG_WAVEFORM_PAINT - std::cerr << "WaveformLayer::paint: aggressive is true" << std::endl; + DEBUG << "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" << std::endl; + DEBUG << "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; + DEBUG << "Painting waveform from " << frame0 << " to " << frame1 << " (" << (x1-x0+1) << " pixels at zoom " << zoomLevel << " and model zoom " << modelZoomLevel << ")" << endl; #endif RangeSummarisableTimeValueModel::RangeBlock *ranges = @@ -703,11 +703,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; + DEBUG << "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; + DEBUG << "WaveformLayer::paint: ERROR: i1 " << i1 << " > i0 " << i0 << " plus one (zoom = " << zoomLevel << ", model zoom = " << modelZoomLevel << ")" << endl; } if (ranges && i0 < ranges->size()) { diff -r 1fe7951a61e8 -r f4960f8ce798 view/Overview.cpp --- a/view/Overview.cpp Thu May 12 17:31:43 2011 +0100 +++ b/view/Overview.cpp Mon May 16 17:19:25 2011 +0100 @@ -130,7 +130,7 @@ { // Recalculate zoom in case the size of the widget has changed. -// std::cerr << "Overview::paintEvent: width is " << width() << ", centre frame " << m_centreFrame << std::endl; +// DEBUG << "Overview::paintEvent: width is " << width() << ", centre frame " << m_centreFrame << endl; size_t startFrame = getModelsStartFrame(); size_t frameCount = getModelsEndFrame() - getModelsStartFrame(); @@ -148,10 +148,10 @@ centreFrame = (startFrame + getModelsEndFrame())/2; } if (centreFrame != m_centreFrame) { -// std::cerr << "Overview::paintEvent: Centre frame changed from " +// DEBUG << "Overview::paintEvent: Centre frame changed from " // << m_centreFrame << " to " << centreFrame << " and thus start frame from " << getStartFrame(); m_centreFrame = centreFrame; -// std::cerr << " to " << getStartFrame() << std::endl; +// DEBUG << " to " << getStartFrame() << endl; emit centreFrameChanged(m_centreFrame, false, PlaybackIgnore); } diff -r 1fe7951a61e8 -r f4960f8ce798 view/Pane.cpp --- a/view/Pane.cpp Thu May 12 17:31:43 2011 +0100 +++ b/view/Pane.cpp Mon May 16 17:19:25 2011 +0100 @@ -85,7 +85,7 @@ updateHeadsUpDisplay(); -// std::cerr << "Pane::Pane(" << this << ") returning" << std::endl; +// DEBUG << "Pane::Pane(" << this << ") returning" << endl; } void @@ -624,7 +624,7 @@ // Profiler profiler("Pane::paintEvent - painting vertical scale", true); -// std::cerr << "Pane::paintEvent: calling paint.save() in vertical scale block" << std::endl; +// DEBUG << "Pane::paintEvent: calling paint.save() in vertical scale block" << endl; paint.save(); paint.setPen(getForeground()); @@ -827,8 +827,7 @@ { QString title = model->getTitle(); QString maker = model->getMaker(); -//std::cerr << "Pane::drawWorkTitle: title=\"" << title.toStdString() -//<< "\", maker=\"" << maker << "\"" << std::endl; +//DEBUG << "Pane::drawWorkTitle: title=\"" << title//<< "\", maker=\"" << maker << "\"" << endl; if (title == "") return; QString text = title; @@ -1784,8 +1783,8 @@ } #ifdef DEBUG_PANE - std::cerr << "Pane::dragTopLayer: newCentreFrame = " << newCentreFrame << - ", models end frame = " << getModelsEndFrame() << std::endl; + DEBUG << "Pane::dragTopLayer: newCentreFrame = " << newCentreFrame << + ", models end frame = " << getModelsEndFrame() << endl; #endif if (newCentreFrame >= getModelsEndFrame()) { @@ -1850,26 +1849,26 @@ int smallThreshold = 10, bigThreshold = 80; -// std::cerr << "Pane::updateDragMode: xdiff = " << xdiff << ", ydiff = " -// << ydiff << ", canMoveVertical = " << canMoveVertical << ", drag mode = " << m_dragMode << std::endl; +// DEBUG << "Pane::updateDragMode: xdiff = " << xdiff << ", ydiff = " +// << ydiff << ", canMoveVertical = " << canMoveVertical << ", drag mode = " << m_dragMode << endl; if (dragMode == UnresolvedDrag) { if (abs(ydiff) > smallThreshold && abs(ydiff) > abs(xdiff) * 2 && canMoveVertical) { -// std::cerr << "Pane::updateDragMode: passed vertical threshold" << std::endl; +// DEBUG << "Pane::updateDragMode: passed vertical threshold" << endl; dragMode = VerticalDrag; } else if (abs(xdiff) > smallThreshold && abs(xdiff) > abs(ydiff) * 2 && canMoveHorizontal) { -// std::cerr << "Pane::updateDragMode: passed horizontal threshold" << std::endl; +// DEBUG << "Pane::updateDragMode: passed horizontal threshold" << endl; dragMode = HorizontalDrag; } else if (abs(xdiff) > smallThreshold && abs(ydiff) > smallThreshold && canMoveVertical && canMoveHorizontal) { -// std::cerr << "Pane::updateDragMode: passed both thresholds" << std::endl; +// DEBUG << "Pane::updateDragMode: passed both thresholds" << endl; dragMode = FreeDrag; } } @@ -2278,7 +2277,7 @@ if (e->provides("text/uri-list")) { - std::cerr << "accepting... data is \"" << e->encodedData("text/uri-list").data() << "\"" << std::endl; + DEBUG << "accepting... data is \"" << e->encodedData("text/uri-list").data() << "\"" << endl; emit dropAccepted(QString::fromLocal8Bit (e->encodedData("text/uri-list").data()) .split(QRegExp("[\\r\\n]+"), @@ -2373,7 +2372,7 @@ Pane::toolModeChanged() { ViewManager::ToolMode mode = m_manager->getToolMode(); -// std::cerr << "Pane::toolModeChanged(" << mode << ")" << std::endl; +// DEBUG << "Pane::toolModeChanged(" << mode << ")" << endl; if (mode == ViewManager::MeasureMode && !m_measureCursor1) { m_measureCursor1 = new QCursor(QBitmap(":/icons/measure1cursor.xbm"), diff -r 1fe7951a61e8 -r f4960f8ce798 view/PaneStack.cpp --- a/view/PaneStack.cpp Thu May 12 17:31:43 2011 +0100 +++ b/view/PaneStack.cpp Mon May 16 17:19:25 2011 +0100 @@ -495,10 +495,10 @@ for (size_t i = 0; i < m_panes.size(); ++i) { if (!m_panes[i].propertyStack) continue; #ifdef DEBUG_PANE_STACK - std::cerr << "PaneStack::sizePropertyStacks: " << i << ": min " + DEBUG << "PaneStack::sizePropertyStacks: " << i << ": min " << m_panes[i].propertyStack->minimumSizeHint().width() << ", hint " << m_panes[i].propertyStack->sizeHint().width() << ", current " - << m_panes[i].propertyStack->width() << std::endl; + << m_panes[i].propertyStack->width() << endl; #endif if (m_panes[i].propertyStack->sizeHint().width() > maxMinWidth) { @@ -507,7 +507,7 @@ } #ifdef DEBUG_PANE_STACK - std::cerr << "PaneStack::sizePropertyStacks: max min width " << maxMinWidth << std::endl; + DEBUG << "PaneStack::sizePropertyStacks: max min width " << maxMinWidth << endl; #endif int setWidth = maxMinWidth; diff -r 1fe7951a61e8 -r f4960f8ce798 view/View.cpp --- a/view/View.cpp Thu May 12 17:31:43 2011 +0100 +++ b/view/View.cpp Mon May 16 17:19:25 2011 +0100 @@ -64,12 +64,12 @@ m_manager(0), m_propertyContainer(new ViewPropertyContainer(this)) { - std::cerr << "View::View(" << this << ")" << std::endl; + DEBUG << "View::View(" << this << ")" << endl; } View::~View() { -// std::cerr << "View::~View(" << this << ")" << std::endl; +// DEBUG << "View::~View(" << this << ")" << endl; m_deleting = true; delete m_propertyContainer; @@ -274,7 +274,7 @@ void View::toolModeChanged() { -// std::cerr << "View::toolModeChanged(" << m_manager->getToolMode() << ")" << std::endl; +// DEBUG << "View::toolModeChanged(" << m_manager->getToolMode() << ")" << endl; } void @@ -359,7 +359,7 @@ long frame = m_centreFrame - (width()/2) * z; #ifdef DEBUG_VIEW_WIDGET_PAINT - std::cerr << "View::getFrameForX(" << x << "): z = " << z << ", m_centreFrame = " << m_centreFrame << ", width() = " << width() << ", frame = " << frame << std::endl; + DEBUG << "View::getFrameForX(" << x << "): z = " << z << ", m_centreFrame = " << m_centreFrame << ", width() = " << width() << ", frame = " << frame << endl; #endif frame = (frame / z) * z; // this is start frame @@ -688,13 +688,13 @@ // setCentreFrame(m_manager->getViewInitialCentreFrame()); if (m_followPlay == PlaybackScrollPage) { -// std::cerr << "View::setViewManager: setting centre frame to global centre frame: " << m_manager->getGlobalCentreFrame() << std::endl; +// DEBUG << "View::setViewManager: setting centre frame to global centre frame: " << m_manager->getGlobalCentreFrame() << endl; setCentreFrame(m_manager->getGlobalCentreFrame(), false); } else if (m_followPlay == PlaybackScrollContinuous) { -// std::cerr << "View::setViewManager: setting centre frame to playback frame: " << m_manager->getPlaybackFrame() << std::endl; +// DEBUG << "View::setViewManager: setting centre frame to playback frame: " << m_manager->getPlaybackFrame() << endl; setCentreFrame(m_manager->getPlaybackFrame(), false); } else if (m_followPan) { -// std::cerr << "View::setViewManager: (follow pan) setting centre frame to global centre frame: " << m_manager->getGlobalCentreFrame() << std::endl; +// DEBUG << "View::setViewManager: (follow pan) setting centre frame to global centre frame: " << m_manager->getGlobalCentreFrame() << endl; setCentreFrame(m_manager->getGlobalCentreFrame(), false); } @@ -897,7 +897,7 @@ Layer *layer = dynamic_cast(sender()); #ifdef DEBUG_VIEW_WIDGET_PAINT - std::cerr << "View::layerParametersChanged()" << std::endl; + DEBUG << "View::layerParametersChanged()" << endl; #endif delete m_cache; @@ -1271,10 +1271,10 @@ bool metUnscrollable = false; for (LayerList::const_iterator i = m_layers.begin(); i != m_layers.end(); ++i) { -// std::cerr << "View::getScrollableBackLayers: calling isLayerDormant on layer " << *i << std::endl; +// DEBUG << "View::getScrollableBackLayers: calling isLayerDormant on layer " << *i << endl; // std::cerr << "(name is " << (*i)->objectName() << ")" // << std::endl; -// std::cerr << "View::getScrollableBackLayers: I am " << this << std::endl; +// DEBUG << "View::getScrollableBackLayers: I am " << this << endl; if ((*i)->isLayerDormant(this)) continue; if ((*i)->isLayerOpaque()) { // You can't see anything behind an opaque layer! @@ -1459,7 +1459,7 @@ (wfm = dynamic_cast (model->getSourceModel()))) { completion = wfm->getAlignmentCompletion(); -// std::cerr << "View::checkProgress: Alignment completion = " << completion << std::endl; +// DEBUG << "View::checkProgress: Alignment completion = " << completion << endl; if (completion < 100) { text = tr("Alignment"); } @@ -1544,7 +1544,7 @@ View::paintEvent(QPaintEvent *e) { // Profiler prof("View::paintEvent", false); -// std::cerr << "View::paintEvent: centre frame is " << m_centreFrame << std::endl; +// DEBUG << "View::paintEvent: centre frame is " << m_centreFrame << endl; if (m_layers.empty()) { QFrame::paintEvent(e); @@ -1876,7 +1876,7 @@ if (p1 < 0 || p0 > width()) continue; #ifdef DEBUG_VIEW_WIDGET_PAINT - std::cerr << "View::drawSelections: " << p0 << ",-1 [" << (p1-p0) << "x" << (height()+1) << "]" << std::endl; + DEBUG << "View::drawSelections: " << p0 << ",-1 [" << (p1-p0) << "x" << (height()+1) << "]" << endl; #endif bool illuminateThis = @@ -1978,8 +1978,8 @@ View::drawMeasurementRect(QPainter &paint, const Layer *topLayer, QRect r, bool focus) const { -// std::cerr << "View::drawMeasurementRect(" << r.x() << "," << r.y() << " " -// << r.width() << "x" << r.height() << ")" << std::endl; +// DEBUG << "View::drawMeasurementRect(" << r.x() << "," << r.y() << " " +// << r.width() << "x" << r.height() << ")" << endl; if (r.x() + r.width() < 0 || r.x() >= width()) return; diff -r 1fe7951a61e8 -r f4960f8ce798 view/ViewManager.cpp --- a/view/ViewManager.cpp Thu May 12 17:31:43 2011 +0100 +++ b/view/ViewManager.cpp Mon May 16 17:19:25 2011 +0100 @@ -499,7 +499,7 @@ View *v = dynamic_cast(sender()); #ifdef DEBUG_VIEW_MANAGER - std::cerr << "ViewManager::viewCentreFrameChanged(" << f << ", " << locked << ", " << mode << "), view is " << v << std::endl; + DEBUG << "ViewManager::viewCentreFrameChanged(" << f << ", " << locked << ", " << mode << "), view is " << v << endl; #endif if (locked) { @@ -556,7 +556,7 @@ View *v = dynamic_cast(sender()); if (!v) { - std::cerr << "ViewManager::viewZoomLevelChanged: WARNING: sender is not a view" << std::endl; + DEBUG << "ViewManager::viewZoomLevelChanged: WARNING: sender is not a view" << endl; return; } diff -r 1fe7951a61e8 -r f4960f8ce798 widgets/ActivityLog.cpp --- a/widgets/ActivityLog.cpp Thu May 12 17:31:43 2011 +0100 +++ b/widgets/ActivityLog.cpp Mon May 16 17:19:25 2011 +0100 @@ -53,7 +53,7 @@ ActivityLog::activityHappened(QString name) { name = name.replace("&", ""); -// std::cerr << "ActivityLog::activityHappened(" << name << ")" << std::endl; +// DEBUG << "ActivityLog::activityHappened(" << name << ")" << endl; if (name == m_prevName) { // std::cerr << "(ignoring duplicate)" << std::endl; return; diff -r 1fe7951a61e8 -r f4960f8ce798 widgets/AudioDial.cpp --- a/widgets/AudioDial.cpp Thu May 12 17:31:43 2011 +0100 +++ b/widgets/AudioDial.cpp Mon May 16 17:19:25 2011 +0100 @@ -365,7 +365,7 @@ bool changed = (m_mappedValue != mappedValue); m_mappedValue = mappedValue; m_noMappedUpdate = true; - std::cerr << "AudioDial::setMappedValue(" << mappedValue << "): new position is " << newPosition << std::endl; + DEBUG << "AudioDial::setMappedValue(" << mappedValue << "): new position is " << newPosition << endl; if (newPosition != value()) { setValue(newPosition); } else if (changed) { @@ -390,7 +390,7 @@ float AudioDial::mappedValue() const { if (m_rangeMapper) { -// std::cerr << "AudioDial::mappedValue(): value = " << value() << ", mappedValue = " << m_mappedValue << std::endl; +// DEBUG << "AudioDial::mappedValue(): value = " << value() << ", mappedValue = " << m_mappedValue << endl; return m_mappedValue; } return value(); diff -r 1fe7951a61e8 -r f4960f8ce798 widgets/CommandHistory.cpp --- a/widgets/CommandHistory.cpp Thu May 12 17:31:43 2011 +0100 +++ b/widgets/CommandHistory.cpp Mon May 16 17:19:25 2011 +0100 @@ -101,7 +101,7 @@ CommandHistory::clear() { #ifdef DEBUG_COMMAND_HISTORY - std::cerr << "CommandHistory::clear()" << std::endl; + DEBUG << "CommandHistory::clear()" << endl; #endif closeBundle(); m_savedAt = -1; @@ -143,7 +143,7 @@ if (!command) return; #ifdef DEBUG_COMMAND_HISTORY - std::cerr << "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 << ")" << std::endl; + DEBUG << "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; #endif if (m_currentCompound) { @@ -160,7 +160,7 @@ #ifdef DEBUG_COMMAND_HISTORY if (!m_redoStack.empty()) { - std::cerr << "CommandHistory::clearing redo stack" << std::endl; + DEBUG << "CommandHistory::clearing redo stack" << endl; } #endif @@ -192,9 +192,8 @@ if (m_currentBundle) { if (!command || (command->getName() != m_currentBundleName)) { #ifdef DEBUG_COMMAND_HISTORY - std::cerr << "CommandHistory::addToBundle: " - << command->getName().toStdString() - << ": closing current bundle" << std::endl; + DEBUG << "CommandHistory::addToBundle: " + << command->getName() << ": closing current bundle" << endl; #endif closeBundle(); } @@ -205,9 +204,8 @@ if (!m_currentBundle) { #ifdef DEBUG_COMMAND_HISTORY - std::cerr << "CommandHistory::addToBundle: " - << command->getName().toStdString() - << ": creating new bundle" << std::endl; + DEBUG << "CommandHistory::addToBundle: " + << command->getName() << ": creating new bundle" << endl; #endif // need to addCommand before setting m_currentBundle, as addCommand @@ -221,9 +219,8 @@ } #ifdef DEBUG_COMMAND_HISTORY - std::cerr << "CommandHistory::addToBundle: " - << command->getName().toStdString() - << ": adding to bundle" << std::endl; + DEBUG << "CommandHistory::addToBundle: " + << command->getName() << ": adding to bundle" << endl; #endif if (execute) command->execute(); @@ -246,7 +243,7 @@ CommandHistory::closeBundle() { #ifdef DEBUG_COMMAND_HISTORY - std::cerr << "CommandHistory::closeBundle" << std::endl; + DEBUG << "CommandHistory::closeBundle" << endl; #endif if (m_currentBundle) emit activity(m_currentBundle->getName()); @@ -258,7 +255,7 @@ CommandHistory::bundleTimerTimeout() { #ifdef DEBUG_COMMAND_HISTORY - std::cerr << "CommandHistory::bundleTimerTimeout: bundle is " << m_currentBundle << std::endl; + DEBUG << "CommandHistory::bundleTimerTimeout: bundle is " << m_currentBundle << endl; #endif closeBundle(); @@ -268,10 +265,10 @@ CommandHistory::addToCompound(Command *command, bool execute) { #ifdef DEBUG_COMMAND_HISTORY - std::cerr << "CommandHistory::addToCompound: " << command->getName().toLocal8Bit().data() << std::endl; + DEBUG << "CommandHistory::addToCompound: " << command->getName().toLocal8Bit().data() << endl; #endif if (!m_currentCompound) { - std::cerr << "CommandHistory::addToCompound: ERROR: no compound operation in progress!" << std::endl; + DEBUG << "CommandHistory::addToCompound: ERROR: no compound operation in progress!" << endl; return; } @@ -283,7 +280,7 @@ CommandHistory::startCompoundOperation(QString name, bool execute) { if (m_currentCompound) { - std::cerr << "CommandHistory::startCompoundOperation: ERROR: compound operation already in progress!" << std::endl; + DEBUG << "CommandHistory::startCompoundOperation: ERROR: compound operation already in progress!" << endl; std::cerr << "(name is " << m_currentCompound->getName().toLocal8Bit().data() << ")" << std::endl; return; } @@ -298,7 +295,7 @@ CommandHistory::endCompoundOperation() { if (!m_currentCompound) { - std::cerr << "CommandHistory::endCompoundOperation: ERROR: no compound operation in progress!" << std::endl; + DEBUG << "CommandHistory::endCompoundOperation: ERROR: no compound operation in progress!" << endl; return; } @@ -332,7 +329,7 @@ if (m_undoStack.empty()) return; #ifdef DEBUG_COMMAND_HISTORY - std::cerr << "CommandHistory::undo()" << std::endl; + DEBUG << "CommandHistory::undo()" << endl; #endif closeBundle(); @@ -358,7 +355,7 @@ if (m_redoStack.empty()) return; #ifdef DEBUG_COMMAND_HISTORY - std::cerr << "CommandHistory::redo()" << std::endl; + DEBUG << "CommandHistory::redo()" << endl; #endif closeBundle(); @@ -439,7 +436,7 @@ for (i = 0; i < limit; ++i) { #ifdef DEBUG_COMMAND_HISTORY Command *command = stack.top(); - std::cerr << "CommandHistory::clipStack: Saving recent command: " << command->getName().toLocal8Bit().data() << " at " << command << std::endl; + DEBUG << "CommandHistory::clipStack: Saving recent command: " << command->getName().toLocal8Bit().data() << " at " << command << endl; #endif tempStack.push(stack.top()); stack.pop(); @@ -461,7 +458,7 @@ Command *command = stack.top(); // Not safe to call getName() on a command about to be deleted #ifdef DEBUG_COMMAND_HISTORY - std::cerr << "CommandHistory::clearStack: About to delete command " << command << std::endl; + DEBUG << "CommandHistory::clearStack: About to delete command " << command << endl; #endif delete command; stack.pop(); diff -r 1fe7951a61e8 -r f4960f8ce798 widgets/InteractiveFileFinder.cpp --- a/widgets/InteractiveFileFinder.cpp Thu May 12 17:31:43 2011 +0100 +++ b/widgets/InteractiveFileFinder.cpp Mon May 16 17:19:25 2011 +0100 @@ -35,7 +35,7 @@ InteractiveFileFinder::InteractiveFileFinder() : m_lastLocatedLocation("") { - std::cerr << "Registering interactive file finder" << std::endl; + DEBUG << "Registering interactive file finder" << endl; FileFinder::registerFileFinder(this); } @@ -383,7 +383,7 @@ { if (FileSource::canHandleScheme(location)) { if (FileSource(location).isAvailable()) { - std::cerr << "InteractiveFileFinder::find: ok, it's available... returning" << std::endl; + DEBUG << "InteractiveFileFinder::find: ok, it's available... returning" << endl; return location; } } @@ -408,8 +408,8 @@ { if (relativeTo == "") return ""; - std::cerr << "Looking for \"" << location << "\" next to \"" - << relativeTo << "\"..." << std::endl; + DEBUG << "Looking for \"" << location << "\" next to \"" + << relativeTo << "\"..." << endl; QString fileName; QString resolved; diff -r 1fe7951a61e8 -r f4960f8ce798 widgets/LEDButton.cpp --- a/widgets/LEDButton.cpp Thu May 12 17:31:43 2011 +0100 +++ b/widgets/LEDButton.cpp Mon May 16 17:19:25 2011 +0100 @@ -99,7 +99,7 @@ if (e->buttons() & Qt::LeftButton) { toggle(); bool newState = state(); - std::cerr << "emitting new state " << newState << std::endl; + DEBUG << "emitting new state " << newState << endl; emit stateChanged(newState); } } diff -r 1fe7951a61e8 -r f4960f8ce798 widgets/LEDButton.h --- a/widgets/LEDButton.h Thu May 12 17:31:43 2011 +0100 +++ b/widgets/LEDButton.h Mon May 16 17:19:25 2011 +0100 @@ -29,6 +29,7 @@ #define _LED_BUTTON_H_ #include +#include "base/Debug.h" class QColor; diff -r 1fe7951a61e8 -r f4960f8ce798 widgets/LayerTree.cpp --- a/widgets/LayerTree.cpp Thu May 12 17:31:43 2011 +0100 +++ b/widgets/LayerTree.cpp Mon May 16 17:19:25 2011 +0100 @@ -111,7 +111,7 @@ m_models.erase(*i); } - std::cerr << "ModelMetadataModel::rebuildModelSet: " << m_models.size() << " models" << std::endl; + DEBUG << "ModelMetadataModel::rebuildModelSet: " << m_models.size() << " models" << endl; } void @@ -371,8 +371,8 @@ PlayParameters *params = dynamic_cast(sender()); if (!params) return; - std::cerr << "LayerTreeModel::playParametersAudibilityChanged(" - << params << "," << a << ")" << std::endl; + DEBUG << "LayerTreeModel::playParametersAudibilityChanged(" + << params << "," << a << ")" << endl; for (int i = 0; i < m_stack->getPaneCount(); ++i) { Pane *pane = m_stack->getPane(i); @@ -381,8 +381,8 @@ Layer *layer = pane->getLayer(j); if (!layer) continue; if (layer->getPlayParameters() == params) { - std::cerr << "LayerTreeModel::playParametersAudibilityChanged(" - << params << "," << a << "): row " << pane->getLayerCount() - j - 1 << ", col " << 2 << std::endl; + DEBUG << "LayerTreeModel::playParametersAudibilityChanged(" + << params << "," << a << "): row " << pane->getLayerCount() - j - 1 << ", col " << 2 << endl; emit dataChanged(createIndex(pane->getLayerCount() - j - 1, m_layerPlayedColumn, pane), diff -r 1fe7951a61e8 -r f4960f8ce798 widgets/ModelDataTableDialog.cpp --- a/widgets/ModelDataTableDialog.cpp Thu May 12 17:31:43 2011 +0100 +++ b/widgets/ModelDataTableDialog.cpp Mon May 16 17:19:25 2011 +0100 @@ -243,24 +243,24 @@ void ModelDataTableDialog::viewClicked(const QModelIndex &index) { -// std::cerr << "ModelDataTableDialog::viewClicked: " << index.row() << ", " << index.column() << std::endl; +// DEBUG << "ModelDataTableDialog::viewClicked: " << index.row() << ", " << index.column() << endl; emit scrollToFrame(m_table->getFrameForModelIndex(index)); } void ModelDataTableDialog::viewPressed(const QModelIndex &index) { -// std::cerr << "ModelDataTableDialog::viewPressed: " << index.row() << ", " << index.column() << std::endl; +// DEBUG << "ModelDataTableDialog::viewPressed: " << index.row() << ", " << index.column() << endl; } void ModelDataTableDialog::currentChanged(const QModelIndex ¤t, const QModelIndex &previous) { -// std::cerr << "ModelDataTableDialog::currentChanged: from " +// DEBUG << "ModelDataTableDialog::currentChanged: from " // << previous.row() << ", " << previous.column() // << " to " << current.row() << ", " << current.column() -// << std::endl; +// << endl; m_currentRow = current.row(); m_table->setCurrentRow(m_currentRow); } @@ -301,7 +301,7 @@ void ModelDataTableDialog::currentChangedThroughResort(const QModelIndex &index) { -// std::cerr << "ModelDataTableDialog::currentChangedThroughResort: row = " << index.row() << std::endl; +// DEBUG << "ModelDataTableDialog::currentChangedThroughResort: row = " << index.row() << endl; // m_tableView->scrollTo(index); makeCurrent(index.row()); } diff -r 1fe7951a61e8 -r f4960f8ce798 widgets/Panner.cpp --- a/widgets/Panner.cpp Thu May 12 17:31:43 2011 +0100 +++ b/widgets/Panner.cpp Mon May 16 17:19:25 2011 +0100 @@ -210,8 +210,8 @@ void Panner::setRectExtents(float x0, float y0, float width, float height) { -// std::cerr << "Panner::setRectExtents(" << x0 << ", " << y0 << ", " -// << width << ", " << height << ")" << std::endl; +// DEBUG << "Panner::setRectExtents(" << x0 << ", " << y0 << ", " +// << width << ", " << height << ")" << endl; if (m_rectX == x0 && m_rectY == y0 && diff -r 1fe7951a61e8 -r f4960f8ce798 widgets/PluginParameterBox.cpp --- a/widgets/PluginParameterBox.cpp Thu May 12 17:31:43 2011 +0100 +++ b/widgets/PluginParameterBox.cpp Mon May 16 17:19:25 2011 +0100 @@ -258,7 +258,7 @@ newValue = min + ival * qtz; } -// std::cerr << "PluginParameterBox::dialChanged: newValue = " << newValue << std::endl; +// DEBUG << "PluginParameterBox::dialChanged: newValue = " << newValue << endl; QDoubleSpinBox *spin = m_params[identifier].spin; if (spin) { @@ -267,7 +267,7 @@ spin->blockSignals(false); } -// std::cerr << "setting plugin parameter \"" << identifier << "\" to value " << newValue << std::endl; +// DEBUG << "setting plugin parameter \"" << identifier << "\" to value " << newValue << endl; m_plugin->setParameter(identifier.toStdString(), newValue); @@ -352,7 +352,7 @@ dial->blockSignals(false); } - std::cerr << "setting plugin parameter \"" << identifier << "\" to value " << value << std::endl; + DEBUG << "setting plugin parameter \"" << identifier << "\" to value " << value << endl; m_plugin->setParameter(identifier.toStdString(), value); diff -r 1fe7951a61e8 -r f4960f8ce798 widgets/PropertyBox.cpp --- a/widgets/PropertyBox.cpp Thu May 12 17:31:43 2011 +0100 +++ b/widgets/PropertyBox.cpp Mon May 16 17:19:25 2011 +0100 @@ -148,7 +148,7 @@ layout->setMargin(layout->margin() / 2); #ifdef DEBUG_PROPERTY_BOX - std::cerr << "PropertyBox::populateViewPlayFrame: container " << m_container << " (name " << m_container->getPropertyContainerName() << ") params " << params << std::endl; + DEBUG << "PropertyBox::populateViewPlayFrame: container " << m_container << " (name " << m_container->getPropertyContainerName() << ") params " << params << endl; #endif if (layer) { @@ -530,7 +530,7 @@ if (pc != m_container) return; #ifdef DEBUG_PROPERTY_BOX - std::cerr << "PropertyBox::propertyContainerPropertyChanged" << std::endl; + DEBUG << "PropertyBox::propertyContainerPropertyChanged" << endl; #endif PropertyContainer::PropertyList properties = m_container->getProperties(); @@ -608,8 +608,7 @@ QString name = obj->objectName(); #ifdef DEBUG_PROPERTY_BOX - std::cerr << "PropertyBox::propertyControllerChanged(" << name.toStdString() - << ", " << value << ")" << std::endl; + DEBUG << "PropertyBox::propertyControllerChanged(" << name << ", " << value << ")" << endl; #endif PropertyContainer::PropertyType type = m_container->getPropertyType(name); diff -r 1fe7951a61e8 -r f4960f8ce798 widgets/PropertyStack.cpp --- a/widgets/PropertyStack.cpp Thu May 12 17:31:43 2011 +0100 +++ b/widgets/PropertyStack.cpp Mon May 16 17:19:25 2011 +0100 @@ -80,7 +80,7 @@ blockSignals(true); #ifdef DEBUG_PROPERTY_STACK - std::cerr << "PropertyStack::repopulate" << std::endl; + DEBUG << "PropertyStack::repopulate" << endl; #endif while (count() > 0) { diff -r 1fe7951a61e8 -r f4960f8ce798 widgets/SubdividingMenu.cpp --- a/widgets/SubdividingMenu.cpp Thu May 12 17:31:43 2011 +0100 +++ b/widgets/SubdividingMenu.cpp Mon May 16 17:19:25 2011 +0100 @@ -67,7 +67,7 @@ j != entries.end(); ++j) { -// std::cerr << "SubdividingMenu::setEntries: j -> " << j->toStdString() << std::endl; +// DEBUG << "SubdividingMenu::setEntries: j -> " << j->toStdString() << endl; m_nameToChunkMenuMap[*j] = chunkMenu; @@ -176,12 +176,12 @@ } if (m_nameToChunkMenuMap.find(name) == m_nameToChunkMenuMap.end()) { -// std::cerr << "SubdividingMenu::addAction(" << name << "): not found in name-to-chunk map, adding to main menu" << std::endl; +// DEBUG << "SubdividingMenu::addAction(" << name << "): not found in name-to-chunk map, adding to main menu" << endl; QMenu::addAction(action); return; } -// std::cerr << "SubdividingMenu::addAction(" << name << "): found in name-to-chunk map for menu " << m_nameToChunkMenuMap[name]->title() << std::endl; +// DEBUG << "SubdividingMenu::addAction(" << name << "): found in name-to-chunk map for menu " << m_nameToChunkMenuMap[name]->title() << endl; m_nameToChunkMenuMap[name]->addAction(action); } @@ -195,11 +195,11 @@ } if (m_nameToChunkMenuMap.find(name) == m_nameToChunkMenuMap.end()) { -// std::cerr << "SubdividingMenu::addAction(" << name << "): not found in name-to-chunk map, adding to main menu" << std::endl; +// DEBUG << "SubdividingMenu::addAction(" << name << "): not found in name-to-chunk map, adding to main menu" << endl; return QMenu::addAction(name); } -// std::cerr << "SubdividingMenu::addAction(" << name << "): found in name-to-chunk map for menu " << m_nameToChunkMenuMap[name]->title() << std::endl; +// DEBUG << "SubdividingMenu::addAction(" << name << "): found in name-to-chunk map for menu " << m_nameToChunkMenuMap[name]->title() << endl; return m_nameToChunkMenuMap[name]->addAction(name); } @@ -212,12 +212,12 @@ } if (m_nameToChunkMenuMap.find(name) == m_nameToChunkMenuMap.end()) { -// std::cerr << "SubdividingMenu::addAction(" << name << "): not found in name-to-chunk map, adding to main menu" << std::endl; +// DEBUG << "SubdividingMenu::addAction(" << name << "): not found in name-to-chunk map, adding to main menu" << endl; QMenu::addAction(action); return; } -// std::cerr << "SubdividingMenu::addAction(" << name << "): found in name-to-chunk map for menu " << m_nameToChunkMenuMap[name]->title() << std::endl; +// DEBUG << "SubdividingMenu::addAction(" << name << "): found in name-to-chunk map for menu " << m_nameToChunkMenuMap[name]->title() << endl; m_nameToChunkMenuMap[name]->addAction(action); } @@ -232,12 +232,12 @@ } if (m_nameToChunkMenuMap.find(name) == m_nameToChunkMenuMap.end()) { -// std::cerr << "SubdividingMenu::addMenu(" << name << "): not found in name-to-chunk map, adding to main menu" << std::endl; +// DEBUG << "SubdividingMenu::addMenu(" << name << "): not found in name-to-chunk map, adding to main menu" << endl; QMenu::addMenu(menu); return; } -// std::cerr << "SubdividingMenu::addMenu(" << name << "): found in name-to-chunk map for menu " << m_nameToChunkMenuMap[name]->title() << std::endl; +// DEBUG << "SubdividingMenu::addMenu(" << name << "): found in name-to-chunk map for menu " << m_nameToChunkMenuMap[name]->title() << endl; m_nameToChunkMenuMap[name]->addMenu(menu); } @@ -252,11 +252,11 @@ } if (m_nameToChunkMenuMap.find(name) == m_nameToChunkMenuMap.end()) { -// std::cerr << "SubdividingMenu::addMenu(" << name << "): not found in name-to-chunk map, adding to main menu" << std::endl; +// DEBUG << "SubdividingMenu::addMenu(" << name << "): not found in name-to-chunk map, adding to main menu" << endl; return QMenu::addMenu(name); } -// std::cerr << "SubdividingMenu::addMenu(" << name << "): found in name-to-chunk map for menu " << m_nameToChunkMenuMap[name]->title() << std::endl; +// DEBUG << "SubdividingMenu::addMenu(" << name << "): found in name-to-chunk map for menu " << m_nameToChunkMenuMap[name]->title() << endl; return m_nameToChunkMenuMap[name]->addMenu(name); } @@ -269,12 +269,12 @@ } if (m_nameToChunkMenuMap.find(name) == m_nameToChunkMenuMap.end()) { -// std::cerr << "SubdividingMenu::addMenu(" << name << "): not found in name-to-chunk map, adding to main menu" << std::endl; +// DEBUG << "SubdividingMenu::addMenu(" << name << "): not found in name-to-chunk map, adding to main menu" << endl; QMenu::addMenu(menu); return; } -// std::cerr << "SubdividingMenu::addMenu(" << name << "): found in name-to-chunk map for menu " << m_nameToChunkMenuMap[name]->title() << std::endl; +// DEBUG << "SubdividingMenu::addMenu(" << name << "): found in name-to-chunk map for menu " << m_nameToChunkMenuMap[name]->title() << endl; m_nameToChunkMenuMap[name]->addMenu(menu); } diff -r 1fe7951a61e8 -r f4960f8ce798 widgets/TextAbbrev.cpp --- a/widgets/TextAbbrev.cpp Thu May 12 17:31:43 2011 +0100 +++ b/widgets/TextAbbrev.cpp Mon May 16 17:19:25 2011 +0100 @@ -261,7 +261,7 @@ } } -// std::cerr << "TextAbbrev::getPrefixLength: prefix length is " << candidate << std::endl; +// DEBUG << "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; // } diff -r 1fe7951a61e8 -r f4960f8ce798 widgets/Thumbwheel.cpp --- a/widgets/Thumbwheel.cpp Thu May 12 17:31:43 2011 +0100 +++ b/widgets/Thumbwheel.cpp Mon May 16 17:19:25 2011 +0100 @@ -142,7 +142,7 @@ bool changed = (m_mappedValue != mappedValue); m_mappedValue = mappedValue; m_noMappedUpdate = true; -// std::cerr << "Thumbwheel::setMappedValue(" << mappedValue << "): new value is " << newValue << " (visible " << isVisible() << ")" << std::endl; +// DEBUG << "Thumbwheel::setMappedValue(" << mappedValue << "): new value is " << newValue << " (visible " << isVisible() << ")" << endl; if (newValue != getValue()) { setValue(newValue); changed = true; @@ -169,8 +169,8 @@ void Thumbwheel::setValue(int value) { -// std::cerr << "Thumbwheel::setValue(" << value << ") (from " << m_value -// << ", rotation " << m_rotation << ")" << " (visible " << isVisible() << ")" << std::endl; +// DEBUG << "Thumbwheel::setValue(" << value << ") (from " << m_value +// << ", rotation " << m_rotation << ")" << " (visible " << isVisible() << ")" << endl; if (m_value != value) { @@ -206,7 +206,7 @@ Thumbwheel::getMappedValue() const { if (m_rangeMapper) { -// std::cerr << "Thumbwheel::getMappedValue(): value = " << getValue() << ", mappedValue = " << m_mappedValue << std::endl; +// DEBUG << "Thumbwheel::getMappedValue(): value = " << getValue() << ", mappedValue = " << m_mappedValue << endl; return m_mappedValue; } return getValue(); diff -r 1fe7951a61e8 -r f4960f8ce798 widgets/TipDialog.cpp --- a/widgets/TipDialog.cpp Thu May 12 17:31:43 2011 +0100 +++ b/widgets/TipDialog.cpp Mon May 16 17:19:25 2011 +0100 @@ -114,7 +114,7 @@ void TipDialog::readTips() { - std::cerr << "TipDialog::readTips" << std::endl; + DEBUG << "TipDialog::readTips" << endl; QString language = QLocale::system().name(); QString filename = QString(":i18n/tips_%1.xml").arg(language); @@ -134,7 +134,7 @@ QFile file(filename); - std::cerr << "TipDialog::readTips from " << filename << std::endl; + DEBUG << "TipDialog::readTips from " << filename << endl; QXmlInputSource source(&file); @@ -188,11 +188,11 @@ { QString name = qName.toLower(); - std::cerr << "TipFileParser::startElement(" << name << ")" << std::endl; + DEBUG << "TipFileParser::startElement(" << name << ")" << endl; if (name == "tips") { QString caption = attributes.value("caption"); - std::cerr << "TipFileParser::caption = " << caption << std::endl; + DEBUG << "TipFileParser::caption = " << caption << endl; if (caption != "") m_dialog->m_caption = caption; } else if (name == "tip") { if (m_inTip) { @@ -224,7 +224,7 @@ m_dialog->m_tips[m_dialog->m_tips.size()-1] += ">"; } - std::cerr << "TipFileParser::startElement done" << std::endl; + DEBUG << "TipFileParser::startElement done" << endl; return true; } @@ -263,7 +263,7 @@ bool TipDialog::TipFileParser::characters(const QString &text) { - std::cerr << "TipFileParser::characters(" << text << ")" << std::endl; + DEBUG << "TipFileParser::characters(" << text << ")" << endl; if (m_inText || m_inHtml) { m_dialog->m_tips[m_dialog->m_tips.size()-1] += text;