From f41d1de9f855972a98ded4ce11394ca11ad5b32e Mon Sep 17 00:00:00 2001 From: Vincent PINON Date: Fri, 17 Jan 2014 18:29:55 +0100 Subject: [PATCH] use only kDebug/qDebug, no cout --- src/kdenlivedoc.cpp | 4 +++- src/lib/audio/audioCorrelation.cpp | 6 ++++-- src/lib/audio/audioCorrelationInfo.cpp | 1 - src/lib/audio/audioEnvelope.cpp | 24 +++++++++++------------- src/lib/audio/audioInfo.cpp | 1 - src/lib/audio/audioStreamInfo.cpp | 14 ++++++-------- src/lib/audio/fftCorrelation.cpp | 6 +++--- src/widgets/titlewidget.cpp | 22 +++++++++++----------- 8 files changed, 38 insertions(+), 40 deletions(-) diff --git a/src/kdenlivedoc.cpp b/src/kdenlivedoc.cpp index 26ee9eb6..14611b42 100644 --- a/src/kdenlivedoc.cpp +++ b/src/kdenlivedoc.cpp @@ -1213,9 +1213,11 @@ QString KdenliveDoc::searchFileRecursively(const QDir &dir, const QString &match fileHash = QCryptographicHash::hash(fileData, QCryptographicHash::Md5); if (QString(fileHash.toHex()) == matchHash) return file.fileName(); + else + kDebug() << filesAndDirs.at(i) << "size match but not hash"; } } - kDebug() << filesAndDirs.at(i) << file.size() << fileHash.toHex(); + //kDebug() << filesAndDirs.at(i) << file.size() << fileHash.toHex(); } filesAndDirs = dir.entryList(QDir::Dirs | QDir::Readable | QDir::Executable | QDir::NoDotAndDotDot); for (int i = 0; i < filesAndDirs.size() && foundFileName.isEmpty(); ++i) { diff --git a/src/lib/audio/audioCorrelation.cpp b/src/lib/audio/audioCorrelation.cpp index 2e3219b7..1d2464ef 100644 --- a/src/lib/audio/audioCorrelation.cpp +++ b/src/lib/audio/audioCorrelation.cpp @@ -11,10 +11,12 @@ the Free Software Foundation, either version 3 of the License, or #include "audioCorrelation.h" #include "fftCorrelation.h" +#include #include #include #include + AudioCorrelation::AudioCorrelation(AudioEnvelope *mainTrackEnvelope) : m_mainTrackEnvelope(mainTrackEnvelope) { @@ -31,7 +33,7 @@ AudioCorrelation::~AudioCorrelation() delete info; } - std::cout << "Envelope deleted." << std::endl; + qDebug() << "Envelope deleted."; } int AudioCorrelation::addChild(AudioEnvelope *envelope, bool useFFT) @@ -146,7 +148,7 @@ void AudioCorrelation::correlate(const int64_t *envMain, int sizeMain, } } - std::cout << "Correlation calculated. Time taken: " << t.elapsed() << " ms." << std::endl; + qDebug() << "Correlation calculated. Time taken: " << t.elapsed() << " ms."; if (out_max != NULL) { *out_max = max; diff --git a/src/lib/audio/audioCorrelationInfo.cpp b/src/lib/audio/audioCorrelationInfo.cpp index 2313fe2b..6aaf27d0 100644 --- a/src/lib/audio/audioCorrelationInfo.cpp +++ b/src/lib/audio/audioCorrelationInfo.cpp @@ -9,7 +9,6 @@ ***************************************************************************/ #include "audioCorrelationInfo.h" -#include AudioCorrelationInfo::AudioCorrelationInfo(int mainSize, int subSize) : diff --git a/src/lib/audio/audioEnvelope.cpp b/src/lib/audio/audioEnvelope.cpp index 6a5da33b..55cc3622 100644 --- a/src/lib/audio/audioEnvelope.cpp +++ b/src/lib/audio/audioEnvelope.cpp @@ -15,7 +15,6 @@ #include #include #include -#include AudioEnvelope::AudioEnvelope(const QString &url, Mlt::Producer *producer, int offset, int length) : m_envelope(NULL), @@ -79,7 +78,7 @@ void AudioEnvelope::loadEnvelope() { Q_ASSERT(m_envelope == NULL); - std::cout << "Loading envelope ..." << std::endl; + qDebug() << "Loading envelope ..."; int samplingRate = m_info->info(0)->samplingRate(); mlt_audio_format format_s16 = mlt_audio_s16; @@ -117,7 +116,7 @@ void AudioEnvelope::loadEnvelope() m_envelopeMax = sum; } -// std::cout << position << "|" << m_producer->get_playtime() +// qDebug() << position << "|" << m_producer->get_playtime() // << "-" << m_producer->get_in() << "+" << m_producer->get_out() << " "; delete frame; @@ -128,14 +127,14 @@ void AudioEnvelope::loadEnvelope() } } m_envelopeMean /= m_envelopeSize; - std::cout << "Calculating the envelope (" << m_envelopeSize << " frames) took " - << t.elapsed() << " ms." << std::endl; + qDebug() << "Calculating the envelope (" << m_envelopeSize << " frames) took " + << t.elapsed() << " ms."; } int64_t AudioEnvelope::loadStdDev() { if (m_envelopeStdDevCalculated) { - std::cout << "Standard deviation already calculated, not re-calculating." << std::endl; + qDebug() << "Standard deviation already calculated, not re-calculating."; } else { if (m_envelope == NULL) { @@ -208,15 +207,14 @@ QImage AudioEnvelope::drawEnvelope() void AudioEnvelope::dumpInfo() const { if (m_envelope == NULL) { - std::cout << "Envelope not generated, no information available." << std::endl; + qDebug() << "Envelope not generated, no information available."; } else { - std::cout << "Envelope info" << std::endl - << "* size = " << m_envelopeSize << std::endl - << "* max = " << m_envelopeMax << std::endl - << "* µ = " << m_envelopeMean << std::endl - ; + qDebug() << "Envelope info" + << "\n* size = " << m_envelopeSize + << "\n* max = " << m_envelopeMax + << "\n* µ = " << m_envelopeMean; if (m_envelopeStdDevCalculated) { - std::cout << "* s = " << m_envelopeStdDev << std::endl; + qDebug() << "* s = " << m_envelopeStdDev; } } } diff --git a/src/lib/audio/audioInfo.cpp b/src/lib/audio/audioInfo.cpp index e9b88c49..819edb40 100644 --- a/src/lib/audio/audioInfo.cpp +++ b/src/lib/audio/audioInfo.cpp @@ -12,7 +12,6 @@ #include "audioStreamInfo.h" #include -#include #include AudioInfo::AudioInfo(Mlt::Producer *producer) : diff --git a/src/lib/audio/audioStreamInfo.cpp b/src/lib/audio/audioStreamInfo.cpp index 1a172277..dcd9989a 100644 --- a/src/lib/audio/audioStreamInfo.cpp +++ b/src/lib/audio/audioStreamInfo.cpp @@ -10,8 +10,8 @@ the Free Software Foundation, either version 3 of the License, or #include "audioStreamInfo.h" +#include #include -#include #include AudioStreamInfo::AudioStreamInfo(Mlt::Producer *producer, int audioStreamIndex) : @@ -73,11 +73,9 @@ const QString& AudioStreamInfo::codecName(bool longName) const void AudioStreamInfo::dumpInfo() const { - std::cout << "Info for audio stream " << m_audioStreamIndex << std::endl - << "\tCodec: " << m_codecLongName.toLocal8Bit().data() << " (" << m_codecName.toLocal8Bit().data() << ")" << std::endl - << "\tChannels: " << m_channels << std::endl - << "\tSampling rate: " << m_samplingRate << std::endl - << "\tBit rate: " << m_bitRate << std::endl - ; - + qDebug() << "Info for audio stream " << m_audioStreamIndex + << "\n\tCodec: " << m_codecLongName.toLocal8Bit().data() << " (" << m_codecName.toLocal8Bit().data() << ")" + << "\n\tChannels: " << m_channels + << "\n\tSampling rate: " << m_samplingRate + << "\n\tBit rate: " << m_bitRate; } diff --git a/src/lib/audio/fftCorrelation.cpp b/src/lib/audio/fftCorrelation.cpp index 139ea203..0543a466 100644 --- a/src/lib/audio/fftCorrelation.cpp +++ b/src/lib/audio/fftCorrelation.cpp @@ -15,8 +15,8 @@ extern "C" #include "../external/kiss_fft/tools/kiss_fftr.h" } +#include #include -#include #include void FFTCorrelation::correlate(const int64_t *left, const int leftSize, @@ -74,7 +74,7 @@ void FFTCorrelation::correlate(const int64_t *left, const int leftSize, // Now we can convolve to get the correlation convolve(leftF, leftSize, rightF, rightSize, out_correlated); - std::cout << "Correlation (FFT based) computed in " << t.elapsed() << " ms." << std::endl; + qDebug() << "Correlation (FFT based) computed in " << t.elapsed() << " ms."; } void FFTCorrelation::convolve(const float *left, const int leftSize, @@ -141,5 +141,5 @@ void FFTCorrelation::convolve(const float *left, const int leftSize, kiss_fftr_free(fftConfig); kiss_fftr_free(ifftConfig); - std::cout << "FFT convolution computed. Time taken: " << time.elapsed() << " ms" << std::endl; + qDebug() << "FFT convolution computed. Time taken: " << time.elapsed() << " ms"; } diff --git a/src/widgets/titlewidget.cpp b/src/widgets/titlewidget.cpp index e8184fab..924ce984 100644 --- a/src/widgets/titlewidget.cpp +++ b/src/widgets/titlewidget.cpp @@ -991,7 +991,7 @@ void TitleWidget::selectionChanged() { if (m_scene->tool() != TITLE_SELECT) return; - std::cout << "Number of selected items: " << graphicsView->scene()->selectedItems().length() << "\n"; + kDebug() << "Number of selected items: " << graphicsView->scene()->selectedItems().length() << "\n"; QList l; @@ -1046,7 +1046,7 @@ void TitleWidget::selectionChanged() break; } } - std::cout << "All equal? " << allEqual << ".\n"; + kDebug() << "All equal? " << allEqual << ".\n"; if (allEqual) { prepareTools(l.at(0)); } else { @@ -1093,7 +1093,7 @@ void TitleWidget::slotValueChanged(int type) */ QList l = graphicsView->scene()->selectedItems(); - std::cout << l.size() << " items to be resized\n"; + kDebug() << l.size() << " items to be resized\n"; // Get the updated value here already to do less coding afterwards int val = 0; @@ -1113,7 +1113,7 @@ void TitleWidget::slotValueChanged(int type) } for (int k = 0; k < l.size(); ++k) { - std::cout << "Type of item " << k << ": " << l.at(k)->type() << "\n"; + kDebug() << "Type of item " << k << ": " << l.at(k)->type() << "\n"; if (l.at(k)->type() == TEXTITEM) { // Just update the position. We don't allow setting width/height for text items yet. @@ -1191,8 +1191,8 @@ void TitleWidget::slotValueChanged(int type) qtrans.rotate(t.rotatey, Qt::YAxis); qtrans.rotate(t.rotatez, Qt::ZAxis); i->setTransform(qtrans); - std::cout << "scale is: " << scale << "\n"; - std::cout << i->boundingRect().width() << ": new width\n"; + kDebug() << "scale is: " << scale << "\n"; + kDebug() << i->boundingRect().width() << ": new width\n"; m_transformations[i] = t; if (l.size() == 1) { @@ -1236,7 +1236,7 @@ void TitleWidget::updateDimension(QGraphicsItem *i) value_h->setValue(i->sceneBoundingRect().height()); } else if (i->type() == RECTITEM) { QGraphicsRectItem *r = static_cast (i); - std::cout << "Rect width is: " << r->rect().width() << ", was: " << value_w->value() << "\n"; + kDebug() << "Rect width is: " << r->rect().width() << ", was: " << value_w->value() << "\n"; value_w->setValue((int) r->rect().width()); value_h->setValue((int) r->rect().height()); } else if (i->type() == TEXTITEM) { @@ -2406,14 +2406,14 @@ void TitleWidget::slotZIndexTop() { QList l = graphicsView->scene()->selectedItems(); qreal max = zIndexBounds(true, false); - std::cout << "Max z-index is " << max << ".\n"; + kDebug() << "Max z-index is " << max << ".\n"; for (int i = 0; i < l.size(); ++i) { qreal currentZ = l[i]->zValue(); if (currentZ <= max) { - std::cout << "Updating item " << i << ", is " << currentZ << ".\n"; + kDebug() << "Updating item " << i << ", is " << currentZ << ".\n"; l[i]->setZValue(max + 1); } else { - std::cout << "Not updating " << i << ", is " << currentZ << ".\n"; + kDebug() << "Not updating " << i << ", is " << currentZ << ".\n"; } } // Update the z index value in the GUI @@ -2539,7 +2539,7 @@ void TitleWidget::prepareTools(QGraphicsItem *referenceItem) value_h->blockSignals(true); if (referenceItem == NULL) { - std::cout << "NULL item.\n"; + kDebug() << "NULL item.\n"; effect_stack->setHidden(true); effect_frame->setEnabled(false); effect_list->setCurrentIndex(0); -- 2.39.2