Commit fbe31bde authored by Vincent PINON's avatar Vincent PINON

fix scan-build warnings (1)

parent 17cbdbe7
...@@ -59,7 +59,6 @@ static const int SLIDETAB = 3; ...@@ -59,7 +59,6 @@ static const int SLIDETAB = 3;
static const int IMAGETAB = 4; static const int IMAGETAB = 4;
static const int MARKERTAB = 5; static const int MARKERTAB = 5;
static const int METATAB = 6; static const int METATAB = 6;
static const int ADVANCEDTAB = 7;
ClipProperties::ClipProperties(DocClipBase *clip, const Timecode &tc, double fps, QWidget * parent) : ClipProperties::ClipProperties(DocClipBase *clip, const Timecode &tc, double fps, QWidget * parent) :
......
...@@ -123,8 +123,6 @@ QImage HistogramGenerator::calculateHistogram(const QSize &paradeSize, const QIm ...@@ -123,8 +123,6 @@ QImage HistogramGenerator::calculateHistogram(const QSize &paradeSize, const QIm
if (drawB) { if (drawB) {
drawComponentFull(&davinci, b, scaling, QRect(0, wy, ww, partH + dist), QColor(0, 128, 255, 255), dist, unscaled, 256); drawComponentFull(&davinci, b, scaling, QRect(0, wy, ww, partH + dist), QColor(0, 128, 255, 255), dist, unscaled, 256);
wy += partH + d;
} }
return histogram; return histogram;
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#endif #endif
const QString EXTENSION_PNG = ".png"; const QString EXTENSION_PNG = ".png";
const int SCALE_RANGE = 80;
ColorPlaneExport::ColorPlaneExport(QWidget *parent) : ColorPlaneExport::ColorPlaneExport(QWidget *parent) :
QDialog(parent) QDialog(parent)
......
...@@ -33,7 +33,6 @@ public: ...@@ -33,7 +33,6 @@ public:
private: private:
ColorTools *m_colorTools; ColorTools *m_colorTools;
float m_scaling; float m_scaling;
float m_Y;
void enableSliderScaling(bool enable); void enableSliderScaling(bool enable);
void enableSliderColor(bool enable); void enableSliderColor(bool enable);
void enableCbVariant(bool enable); void enableCbVariant(bool enable);
......
...@@ -1191,7 +1191,7 @@ void KdenliveSettingsDialog::slotEditVideo4LinuxProfile() ...@@ -1191,7 +1191,7 @@ void KdenliveSettingsDialog::slotEditVideo4LinuxProfile()
void KdenliveSettingsDialog::slotReloadBlackMagic() void KdenliveSettingsDialog::slotReloadBlackMagic()
{ {
Render::getBlackMagicDeviceList(m_configCapture.kcfg_decklink_capturedevice, true); Render::getBlackMagicDeviceList(m_configCapture.kcfg_decklink_capturedevice, true);
if (!Render::getBlackMagicOutputDeviceList(m_configSdl.kcfg_blackmagic_output_device), true) { if (!Render::getBlackMagicOutputDeviceList(m_configSdl.kcfg_blackmagic_output_device, true)) {
// No blackmagic card found // No blackmagic card found
m_configSdl.kcfg_external_display->setEnabled(false); m_configSdl.kcfg_external_display->setEnabled(false);
} }
......
...@@ -120,8 +120,8 @@ void FFTTools::fftNormalized(const QVector<int16_t> audioFrame, const uint chann ...@@ -120,8 +120,8 @@ void FFTTools::fftNormalized(const QVector<int16_t> audioFrame, const uint chann
const uint numSamples = audioFrame.size()/numChannels; const uint numSamples = audioFrame.size()/numChannels;
Q_ASSERT((windowSize & 1) == 0); if (windowSize & 1 || windowSize < 2)
Q_ASSERT(windowSize > 0); return;
const QString cfgSig = cfgSignature(windowSize); const QString cfgSig = cfgSignature(windowSize);
const QString winSig = windowSignature(windowType, windowSize, param); const QString winSig = windowSignature(windowType, windowSize, param);
......
...@@ -102,38 +102,34 @@ Point2 NearestPointOnCurve(Point2 P, Point2 *V, double *tOut) ...@@ -102,38 +102,34 @@ Point2 NearestPointOnCurve(Point2 P, Point2 *V, double *tOut)
free((char *)w); free((char *)w);
/* Compare distances of P to all candidates, and to t=0, and t=1 */ /* Compare distances of P to all candidates, and to t=0, and t=1 */
{ double dist, new_dist;
double dist, new_dist; Point2 p;
Point2 p; Vector2 v;
Vector2 v; int i;
int i;
/* Check distance to beginning of curve, where t = 0 */
dist = V2SquaredLength(V2Sub(&P, &V[0], &v));
/* Check distance to beginning of curve, where t = 0 */ t = 0.0;
dist = V2SquaredLength(V2Sub(&P, &V[0], &v));
t = 0.0; /* Find distances for candidate points */
for (i = 0; i < n_solutions; ++i) {
/* Find distances for candidate points */ p = Bezier(V, DEGREE, t_candidate[i],
for (i = 0; i < n_solutions; ++i) { (Point2 *)NULL, (Point2 *)NULL);
p = Bezier(V, DEGREE, t_candidate[i], new_dist = V2SquaredLength(V2Sub(&P, &p, &v));
(Point2 *)NULL, (Point2 *)NULL); if (new_dist < dist) {
new_dist = V2SquaredLength(V2Sub(&P, &p, &v)); dist = new_dist;
if (new_dist < dist) { t = t_candidate[i];
dist = new_dist;
t = t_candidate[i];
}
} }
}
/* Finally, look at distance to end point, where t = 1.0 */ /* Finally, look at distance to end point, where t = 1.0 */
new_dist = V2SquaredLength(V2Sub(&P, &V[DEGREE], &v)); new_dist = V2SquaredLength(V2Sub(&P, &V[DEGREE], &v));
if (new_dist < dist) { if (new_dist < dist) {
dist = new_dist; t = 1.0;
t = 1.0;
}
} }
/* Return the point on the curve at parameter value t */ /* Return the point on the curve at parameter value t */
// printf("t : %4.12f\n", t); // printf("t : %4.12f\n", t);
*tOut = t; *tOut = t;
return (Bezier(V, DEGREE, t, (Point2 *)NULL, (Point2 *)NULL)); return (Bezier(V, DEGREE, t, (Point2 *)NULL, (Point2 *)NULL));
} }
...@@ -222,26 +218,25 @@ static int FindRoots(Point2 *w, int degree, double *t, int depth) ...@@ -222,26 +218,25 @@ static int FindRoots(Point2 *w, int degree, double *t, int depth)
int left_count, /* Solution count from */ int left_count, /* Solution count from */
right_count; /* children */ right_count; /* children */
double left_t[W_DEGREE+1], /* Solutions from kids */ double left_t[W_DEGREE+1], /* Solutions from kids */
right_t[W_DEGREE+1]; right_t[W_DEGREE+1];
switch (CrossingCount(w, degree)) { switch (CrossingCount(w, degree)) {
case 0 : { /* No solutions here */ case 0 : /* No solutions here */
return 0; return 0;
}
case 1 : { /* Unique solution */ case 1 : /* Unique solution */
/* Stop recursion when the tree is deep enough */ /* Stop recursion when the tree is deep enough */
/* if deep enough, return 1 solution at midpoint */ /* if deep enough, return 1 solution at midpoint */
if (depth >= MAXDEPTH) { if (depth >= MAXDEPTH) {
t[0] = (w[0].x + w[W_DEGREE].x) / 2.0; t[0] = (w[0].x + w[W_DEGREE].x) / 2.0;
return 1; return 1;
} }
if (ControlPolygonFlatEnough(w, degree)) { if (ControlPolygonFlatEnough(w, degree)) {
t[0] = ComputeXIntercept(w, degree); t[0] = ComputeXIntercept(w, degree);
return 1; return 1;
} }
break; break;
} }
}
/* Otherwise, solve recursively after */ /* Otherwise, solve recursively after */
/* subdividing control polygon */ /* subdividing control polygon */
...@@ -252,10 +247,10 @@ static int FindRoots(Point2 *w, int degree, double *t, int depth) ...@@ -252,10 +247,10 @@ static int FindRoots(Point2 *w, int degree, double *t, int depth)
/* Gather solutions together */ /* Gather solutions together */
for (i = 0; i < left_count; ++i) { for (i = 0; i < left_count; ++i) {
t[i] = left_t[i]; t[i] = left_t[i]; /* FIXME: static analyzer says left_t can be undefined */
} }
for (i = 0; i < right_count; ++i) { for (i = 0; i < right_count; ++i) {
t[i+left_count] = right_t[i]; t[i+left_count] = right_t[i]; /* FIXME: static analyzer says right_t can be undefined */
} }
/* Send back total number of solutions */ /* Send back total number of solutions */
...@@ -277,7 +272,7 @@ static int CrossingCount(Point2 *V, int degree) ...@@ -277,7 +272,7 @@ static int CrossingCount(Point2 *V, int degree)
int n_crossings = 0; /* Number of zero-crossings */ int n_crossings = 0; /* Number of zero-crossings */
int sign, old_sign; /* Sign of coefficients */ int sign, old_sign; /* Sign of coefficients */
sign = old_sign = SGN(V[0].y); old_sign = SGN(V[0].y);
for (i = 1; i <= degree; ++i) { for (i = 1; i <= degree; ++i) {
sign = SGN(V[i].y); sign = SGN(V[i].y);
if (sign != old_sign) n_crossings++; if (sign != old_sign) n_crossings++;
......
...@@ -94,15 +94,13 @@ AbstractScopeWidget::AbstractScopeWidget(bool trackMouse, QWidget *parent) : ...@@ -94,15 +94,13 @@ AbstractScopeWidget::AbstractScopeWidget(bool trackMouse, QWidget *parent) :
this->setContextMenuPolicy(Qt::CustomContextMenu); this->setContextMenuPolicy(Qt::CustomContextMenu);
bool b = true; connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(customContextMenuRequested(QPoint)));
b &= connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(customContextMenuRequested(QPoint)));
connect(this, SIGNAL(signalHUDRenderingFinished(uint,uint)), this, SLOT(slotHUDRenderingFinished(uint,uint)));
b &= connect(this, SIGNAL(signalHUDRenderingFinished(uint,uint)), this, SLOT(slotHUDRenderingFinished(uint,uint))); connect(this, SIGNAL(signalScopeRenderingFinished(uint,uint)), this, SLOT(slotScopeRenderingFinished(uint,uint)));
b &= connect(this, SIGNAL(signalScopeRenderingFinished(uint,uint)), this, SLOT(slotScopeRenderingFinished(uint,uint))); connect(this, SIGNAL(signalBackgroundRenderingFinished(uint,uint)), this, SLOT(slotBackgroundRenderingFinished(uint,uint)));
b &= connect(this, SIGNAL(signalBackgroundRenderingFinished(uint,uint)), this, SLOT(slotBackgroundRenderingFinished(uint,uint))); connect(m_aRealtime, SIGNAL(toggled(bool)), this, SLOT(slotResetRealtimeFactor(bool)));
b &= connect(m_aRealtime, SIGNAL(toggled(bool)), this, SLOT(slotResetRealtimeFactor(bool))); connect(m_aAutoRefresh, SIGNAL(toggled(bool)), this, SLOT(slotAutoRefreshToggled(bool)));
b &= connect(m_aAutoRefresh, SIGNAL(toggled(bool)), this, SLOT(slotAutoRefreshToggled(bool)));
Q_ASSERT(b);
// Enable mouse tracking if desired. // Enable mouse tracking if desired.
// Causes the mouseMoved signal to be emitted when the mouse moves inside the // Causes the mouseMoved signal to be emitted when the mouse moves inside the
......
...@@ -84,11 +84,9 @@ AudioSpectrum::AudioSpectrum(QWidget *parent) : ...@@ -84,11 +84,9 @@ AudioSpectrum::AudioSpectrum(QWidget *parent) :
ui->windowFunction->addItem(i18n("Hamming window"), FFTTools::Window_Hamming); ui->windowFunction->addItem(i18n("Hamming window"), FFTTools::Window_Hamming);
bool b = true; connect(m_aResetHz, SIGNAL(triggered()), this, SLOT(slotResetMaxFreq()));
b &= connect(m_aResetHz, SIGNAL(triggered()), this, SLOT(slotResetMaxFreq())); connect(ui->windowFunction, SIGNAL(currentIndexChanged(int)), this, SLOT(forceUpdate()));
b &= connect(ui->windowFunction, SIGNAL(currentIndexChanged(int)), this, SLOT(forceUpdate())); connect(this, SIGNAL(signalMousePositionChanged()), this, SLOT(forceUpdateHUD()));
b &= connect(this, SIGNAL(signalMousePositionChanged()), this, SLOT(forceUpdateHUD()));
Q_ASSERT(b);
// Note: These strings are used in both Spectogram and AudioSpectrum. Ideally change both (if necessary) to reduce workload on translators // Note: These strings are used in both Spectogram and AudioSpectrum. Ideally change both (if necessary) to reduce workload on translators
......
...@@ -76,11 +76,9 @@ Spectrogram::Spectrogram(QWidget *parent) : ...@@ -76,11 +76,9 @@ Spectrogram::Spectrogram(QWidget *parent) :
ui->windowSize->setToolTip(i18n("A bigger window improves the accuracy at the cost of computational power.")); ui->windowSize->setToolTip(i18n("A bigger window improves the accuracy at the cost of computational power."));
ui->windowFunction->setToolTip(i18n("The rectangular window function is good for signals with equal signal strength (narrow peak), but creates more smearing. See Window function on Wikipedia.")); ui->windowFunction->setToolTip(i18n("The rectangular window function is good for signals with equal signal strength (narrow peak), but creates more smearing. See Window function on Wikipedia."));
bool b = true; connect(m_aResetHz, SIGNAL(triggered()), this, SLOT(slotResetMaxFreq()));
b &= connect(m_aResetHz, SIGNAL(triggered()), this, SLOT(slotResetMaxFreq())); connect(ui->windowFunction, SIGNAL(currentIndexChanged(int)), this, SLOT(forceUpdate()));
b &= connect(ui->windowFunction, SIGNAL(currentIndexChanged(int)), this, SLOT(forceUpdate())); connect(this, SIGNAL(signalMousePositionChanged()), this, SLOT(forceUpdateHUD()));
b &= connect(this, SIGNAL(signalMousePositionChanged()), this, SLOT(forceUpdateHUD()));
Q_ASSERT(b);
AbstractScopeWidget::init(); AbstractScopeWidget::init();
} }
......
...@@ -20,8 +20,6 @@ ...@@ -20,8 +20,6 @@
#ifdef DEBUG_AGSW #ifdef DEBUG_AGSW
#endif #endif
const int REALTIME_FPS = 30;
AbstractGfxScopeWidget::AbstractGfxScopeWidget(bool trackMouse, QWidget *parent) : AbstractGfxScopeWidget::AbstractGfxScopeWidget(bool trackMouse, QWidget *parent) :
AbstractScopeWidget(trackMouse, parent) AbstractScopeWidget(trackMouse, parent)
{ {
......
...@@ -37,16 +37,14 @@ Histogram::Histogram(QWidget *parent) : ...@@ -37,16 +37,14 @@ Histogram::Histogram(QWidget *parent) :
m_menu->addAction(m_aRec601); m_menu->addAction(m_aRec601);
m_menu->addAction(m_aRec709); m_menu->addAction(m_aRec709);
bool b = true; connect(ui->cbY, SIGNAL(toggled(bool)), this, SLOT(forceUpdateScope()));
b &= connect(ui->cbY, SIGNAL(toggled(bool)), this, SLOT(forceUpdateScope())); connect(ui->cbS, SIGNAL(toggled(bool)), this, SLOT(forceUpdateScope()));
b &= connect(ui->cbS, SIGNAL(toggled(bool)), this, SLOT(forceUpdateScope())); connect(ui->cbR, SIGNAL(toggled(bool)), this, SLOT(forceUpdateScope()));
b &= connect(ui->cbR, SIGNAL(toggled(bool)), this, SLOT(forceUpdateScope())); connect(ui->cbG, SIGNAL(toggled(bool)), this, SLOT(forceUpdateScope()));
b &= connect(ui->cbG, SIGNAL(toggled(bool)), this, SLOT(forceUpdateScope())); connect(ui->cbB, SIGNAL(toggled(bool)), this, SLOT(forceUpdateScope()));
b &= connect(ui->cbB, SIGNAL(toggled(bool)), this, SLOT(forceUpdateScope())); connect(m_aUnscaled, SIGNAL(toggled(bool)), this, SLOT(forceUpdateScope()));
b &= connect(m_aUnscaled, SIGNAL(toggled(bool)), this, SLOT(forceUpdateScope())); connect(m_aRec601, SIGNAL(toggled(bool)), this, SLOT(forceUpdateScope()));
b &= connect(m_aRec601, SIGNAL(toggled(bool)), this, SLOT(forceUpdateScope())); connect(m_aRec709, SIGNAL(toggled(bool)), this, SLOT(forceUpdateScope()));
b &= connect(m_aRec709, SIGNAL(toggled(bool)), this, SLOT(forceUpdateScope()));
Q_ASSERT(b);
init(); init();
m_histogramGenerator = new HistogramGenerator(); m_histogramGenerator = new HistogramGenerator();
......
...@@ -24,22 +24,20 @@ RGBParade::RGBParade(QWidget *parent) : ...@@ -24,22 +24,20 @@ RGBParade::RGBParade(QWidget *parent) :
ui->paintMode->addItem(i18n("RGB"), QVariant(RGBParadeGenerator::PaintMode_RGB)); ui->paintMode->addItem(i18n("RGB"), QVariant(RGBParadeGenerator::PaintMode_RGB));
ui->paintMode->addItem(i18n("White"), QVariant(RGBParadeGenerator::PaintMode_White)); ui->paintMode->addItem(i18n("White"), QVariant(RGBParadeGenerator::PaintMode_White));
bool b = true;
m_menu->addSeparator(); m_menu->addSeparator();
m_aAxis = new QAction(i18n("Draw axis"), this); m_aAxis = new QAction(i18n("Draw axis"), this);
m_aAxis->setCheckable(true); m_aAxis->setCheckable(true);
m_menu->addAction(m_aAxis); m_menu->addAction(m_aAxis);
b &= connect(m_aAxis, SIGNAL(changed()), this, SLOT(forceUpdateScope())); connect(m_aAxis, SIGNAL(changed()), this, SLOT(forceUpdateScope()));
m_aGradRef = new QAction(i18n("Gradient reference line"), this); m_aGradRef = new QAction(i18n("Gradient reference line"), this);
m_aGradRef->setCheckable(true); m_aGradRef->setCheckable(true);
m_menu->addAction(m_aGradRef); m_menu->addAction(m_aGradRef);
b &= connect(m_aGradRef, SIGNAL(changed()), this, SLOT(forceUpdateScope())); connect(m_aGradRef, SIGNAL(changed()), this, SLOT(forceUpdateScope()));
b &= connect(ui->paintMode, SIGNAL(currentIndexChanged(int)), this, SLOT(forceUpdateScope())); connect(ui->paintMode, SIGNAL(currentIndexChanged(int)), this, SLOT(forceUpdateScope()));
b &= connect(this, SIGNAL(signalMousePositionChanged()), this, SLOT(forceUpdateHUD())); connect(this, SIGNAL(signalMousePositionChanged()), this, SLOT(forceUpdateHUD()));
Q_ASSERT(b);
m_rgbParadeGenerator = new RGBParadeGenerator(); m_rgbParadeGenerator = new RGBParadeGenerator();
init(); init();
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
#include "colorcorrection/vectorscopegenerator.h" #include "colorcorrection/vectorscopegenerator.h"
const float P75 = .75; const float P75 = .75;
const unsigned char DEFAULT_Y = 255;
const QPointF YUV_R(-.147, .615); const QPointF YUV_R(-.147, .615);
const QPointF YUV_G(-.289, -.515); const QPointF YUV_G(-.289, -.515);
...@@ -65,11 +64,10 @@ Vectorscope::Vectorscope(QWidget *parent) : ...@@ -65,11 +64,10 @@ Vectorscope::Vectorscope(QWidget *parent) :
ui->sliderGain->setMinimum(0); ui->sliderGain->setMinimum(0);
ui->sliderGain->setMaximum(40); ui->sliderGain->setMaximum(40);
bool b = true; connect(ui->backgroundMode, SIGNAL(currentIndexChanged(int)), this, SLOT(slotBackgroundChanged()));
b &= connect(ui->backgroundMode, SIGNAL(currentIndexChanged(int)), this, SLOT(slotBackgroundChanged())); connect(ui->sliderGain, SIGNAL(valueChanged(int)), this, SLOT(slotGainChanged(int)));
b &= connect(ui->sliderGain, SIGNAL(valueChanged(int)), this, SLOT(slotGainChanged(int))); connect(ui->paintMode, SIGNAL(currentIndexChanged(int)), this, SLOT(forceUpdateScope()));
b &= connect(ui->paintMode, SIGNAL(currentIndexChanged(int)), this, SLOT(forceUpdateScope())); connect(this, SIGNAL(signalMousePositionChanged()), this, SLOT(forceUpdateHUD()));
b &= connect(this, SIGNAL(signalMousePositionChanged()), this, SLOT(forceUpdateHUD()));
ui->sliderGain->setValue(0); ui->sliderGain->setValue(0);
...@@ -79,24 +77,24 @@ Vectorscope::Vectorscope(QWidget *parent) : ...@@ -79,24 +77,24 @@ Vectorscope::Vectorscope(QWidget *parent) :
m_aExportBackground = new QAction(i18n("Export background"), this); m_aExportBackground = new QAction(i18n("Export background"), this);
m_menu->addAction(m_aExportBackground); m_menu->addAction(m_aExportBackground);
b &= connect(m_aExportBackground, SIGNAL(triggered()), this, SLOT(slotExportBackground())); connect(m_aExportBackground, SIGNAL(triggered()), this, SLOT(slotExportBackground()));
m_menu->addSeparator()->setText(i18n("Drawing options")); m_menu->addSeparator()->setText(i18n("Drawing options"));
m_a75PBox = new QAction(i18n("75% box"), this); m_a75PBox = new QAction(i18n("75% box"), this);
m_a75PBox->setCheckable(true); m_a75PBox->setCheckable(true);
m_menu->addAction(m_a75PBox); m_menu->addAction(m_a75PBox);
b &= connect(m_a75PBox, SIGNAL(changed()), this, SLOT(forceUpdateBackground())); connect(m_a75PBox, SIGNAL(changed()), this, SLOT(forceUpdateBackground()));
m_aAxisEnabled = new QAction(i18n("Draw axis"), this); m_aAxisEnabled = new QAction(i18n("Draw axis"), this);
m_aAxisEnabled->setCheckable(true); m_aAxisEnabled->setCheckable(true);
m_menu->addAction(m_aAxisEnabled); m_menu->addAction(m_aAxisEnabled);
b &= connect(m_aAxisEnabled, SIGNAL(changed()), this, SLOT(forceUpdateBackground())); connect(m_aAxisEnabled, SIGNAL(changed()), this, SLOT(forceUpdateBackground()));
m_aIQLines = new QAction(i18n("Draw I/Q lines"), this); m_aIQLines = new QAction(i18n("Draw I/Q lines"), this);
m_aIQLines->setCheckable(true); m_aIQLines->setCheckable(true);
m_menu->addAction(m_aIQLines); m_menu->addAction(m_aIQLines);
b &= connect(m_aIQLines, SIGNAL(changed()), this, SLOT(forceUpdateBackground())); connect(m_aIQLines, SIGNAL(changed()), this, SLOT(forceUpdateBackground()));
m_menu->addSeparator()->setText(i18n("Color Space")); m_menu->addSeparator()->setText(i18n("Color Space"));
m_aColorSpace_YPbPr = new QAction(i18n("YPbPr"), this); m_aColorSpace_YPbPr = new QAction(i18n("YPbPr"), this);
...@@ -108,10 +106,8 @@ Vectorscope::Vectorscope(QWidget *parent) : ...@@ -108,10 +106,8 @@ Vectorscope::Vectorscope(QWidget *parent) :
m_agColorSpace->addAction(m_aColorSpace_YUV); m_agColorSpace->addAction(m_aColorSpace_YUV);
m_menu->addAction(m_aColorSpace_YPbPr); m_menu->addAction(m_aColorSpace_YPbPr);
m_menu->addAction(m_aColorSpace_YUV); m_menu->addAction(m_aColorSpace_YUV);
b &= connect(m_aColorSpace_YPbPr, SIGNAL(toggled(bool)), this, SLOT(slotColorSpaceChanged())); connect(m_aColorSpace_YPbPr, SIGNAL(toggled(bool)), this, SLOT(slotColorSpaceChanged()));
b &= connect(m_aColorSpace_YUV, SIGNAL(toggled(bool)), this, SLOT(slotColorSpaceChanged())); connect(m_aColorSpace_YUV, SIGNAL(toggled(bool)), this, SLOT(slotColorSpaceChanged()));
Q_ASSERT(b);
// To make the 1.0x text show // To make the 1.0x text show
slotGainChanged(ui->sliderGain->value()); slotGainChanged(ui->sliderGain->value());
......
...@@ -47,12 +47,10 @@ Waveform::Waveform(QWidget *parent) : ...@@ -47,12 +47,10 @@ Waveform::Waveform(QWidget *parent) :
m_menu->addAction(m_aRec709); m_menu->addAction(m_aRec709);
bool b = true; connect(ui->paintMode, SIGNAL(currentIndexChanged(int)), this, SLOT(forceUpdateScope()));
b &= connect(ui->paintMode, SIGNAL(currentIndexChanged(int)), this, SLOT(forceUpdateScope())); connect(this, SIGNAL(signalMousePositionChanged()), this, SLOT(forceUpdateHUD()));
b &= connect(this, SIGNAL(signalMousePositionChanged()), this, SLOT(forceUpdateHUD())); connect(m_aRec601, SIGNAL(toggled(bool)), this, SLOT(forceUpdateScope()));
b &= connect(m_aRec601, SIGNAL(toggled(bool)), this, SLOT(forceUpdateScope())); connect(m_aRec709, SIGNAL(toggled(bool)), this, SLOT(forceUpdateScope()));
b &= connect(m_aRec709, SIGNAL(toggled(bool)), this, SLOT(forceUpdateScope()));
Q_ASSERT(b);
init(); init();
m_waveformGenerator = new WaveformGenerator(); m_waveformGenerator = new WaveformGenerator();
......
...@@ -27,11 +27,9 @@ ScopeManager::ScopeManager(MonitorManager *monitorManager) : ...@@ -27,11 +27,9 @@ ScopeManager::ScopeManager(MonitorManager *monitorManager) :
{ {
m_signalMapper = new QSignalMapper(this); m_signalMapper = new QSignalMapper(this);
bool b = true; connect(m_monitorManager, SIGNAL(checkColorScopes()), this, SLOT(slotUpdateActiveRenderer()));
b &= connect(m_monitorManager, SIGNAL(checkColorScopes()), this, SLOT(slotUpdateActiveRenderer())); connect(m_monitorManager, SIGNAL(clearScopes()), this, SLOT(slotClearColorScopes()));
b &= connect(m_monitorManager, SIGNAL(clearScopes()), this, SLOT(slotClearColorScopes())); connect(m_signalMapper, SIGNAL(mapped(QString)), this, SLOT(slotRequestFrame(QString)));
b &= connect(m_signalMapper, SIGNAL(mapped(QString)), this, SLOT(slotRequestFrame(QString)));
Q_ASSERT(b);
slotUpdateActiveRenderer(); slotUpdateActiveRenderer();
} }
...@@ -60,14 +58,11 @@ bool ScopeManager::addScope(AbstractAudioScopeWidget *audioScope, QDockWidget *a ...@@ -60,14 +58,11 @@ bool ScopeManager::addScope(AbstractAudioScopeWidget *audioScope, QDockWidget *a
asd.scopeDockWidget = audioScopeWidget; asd.scopeDockWidget = audioScopeWidget;
m_audioScopes.append(asd); m_audioScopes.append(asd);
bool b = true; connect(audioScope, SIGNAL(requestAutoRefresh(bool)), this, SLOT(slotCheckActiveScopes()));
b &= connect(audioScope, SIGNAL(requestAutoRefresh(bool)), this, SLOT(slotCheckActiveScopes()));
// b &= connect(audioScope, SIGNAL(signalFrameRequest(QString)), this, SLOT(slotRequestFrame(QString)));
if (audioScopeWidget != NULL) { if (audioScopeWidget != NULL) {
b &= connect(audioScopeWidget, SIGNAL(visibilityChanged(bool)), this, SLOT(slotCheckActiveScopes())); connect(audioScopeWidget, SIGNAL(visibilityChanged(bool)), this, SLOT(slotCheckActiveScopes()));
b &= connect(audioScopeWidget, SIGNAL(visibilityChanged(bool)), m_signalMapper, SLOT(map())); connect(audioScopeWidget, SIGNAL(visibilityChanged(bool)), m_signalMapper, SLOT(map()));
} }
Q_ASSERT(b);
added = true; added = true;
} }
...@@ -95,14 +90,12 @@ bool ScopeManager::addScope(AbstractGfxScopeWidget *colorScope, QDockWidget *col ...@@ -95,14 +90,12 @@ bool ScopeManager::addScope(AbstractGfxScopeWidget *colorScope, QDockWidget *col
gsd.scopeDockWidget = colorScopeWidget; gsd.scopeDockWidget = colorScopeWidget;
m_colorScopes.append(gsd); m_colorScopes.append(gsd);
bool b = true; connect(colorScope, SIGNAL(requestAutoRefresh(bool)), this, SLOT(slotCheckActiveScopes()));
b &= connect(colorScope, SIGNAL(requestAutoRefresh(bool)), this, SLOT(slotCheckActiveScopes())); connect(colorScope, SIGNAL(signalFrameRequest(QString)), this, SLOT(slotRequestFrame(QString)));
b &= connect(colorScope, SIGNAL(signalFrameRequest(QString)), this, SLOT(slotRequestFrame(QString)));
if (colorScopeWidget != NULL) { if (colorScopeWidget != NULL) {
b &= connect(colorScopeWidget, SIGNAL(visibilityChanged(bool)), this, SLOT(slotCheckActiveScopes())); connect(colorScopeWidget, SIGNAL(visibilityChanged(bool)), this, SLOT(slotCheckActiveScopes()));
b &= connect(colorScopeWidget, SIGNAL(visibilityChanged(bool)), m_signalMapper, SLOT(map())); connect(colorScopeWidget, SIGNAL(visibilityChanged(bool)), m_signalMapper, SLOT(map()));
} }
Q_ASSERT(b);
added = true; added = true;
} }
...@@ -190,15 +183,12 @@ void ScopeManager::slotClearColorScopes() ...@@ -190,15 +183,12 @@ void ScopeManager::slotClearColorScopes()
void ScopeManager::slotUpdateActiveRenderer() void ScopeManager::slotUpdateActiveRenderer()
{ {
bool b = true;
// Disconnect old connections // Disconnect old connections
if (m_lastConnectedRenderer != NULL) { if (m_lastConnectedRenderer != NULL) {
#ifdef DEBUG_SM #ifdef DEBUG_SM
qDebug() << "Disconnected previous renderer: " << m_lastConnectedRenderer->name(); qDebug() << "Disconnected previous renderer: " << m_lastConnectedRenderer->name();
#endif #endif
b &= m_lastConnectedRenderer->disconnect(this); m_lastConnectedRenderer->disconnect(this);
Q_ASSERT(b);
} }
m_lastConnectedRenderer = m_monitorManager->activeRenderer(); m_lastConnectedRenderer = m_monitorManager->activeRenderer();
...@@ -207,11 +197,10 @@ void ScopeManager::slotUpdateActiveRenderer() ...@@ -207,11 +197,10 @@ void ScopeManager::slotUpdateActiveRenderer()
// Connect new renderer // Connect new renderer
if (m_lastConnectedRenderer != NULL) { if (m_lastConnectedRenderer != NULL) {
b &= connect(m_lastConnectedRenderer, SIGNAL(frameUpdated(QImage)), connect(m_lastConnectedRenderer, SIGNAL(frameUpdated(QImage)),