Commit b8f6dc09 authored by Laurent Montel's avatar Laurent Montel 😁

Const'ify. Use QLatin1String

parent 3cec1c93
......@@ -324,7 +324,7 @@ void RotoWidget::keyframeTimelineFullUpdate()
}
}
void RotoWidget::setupTrackingListen(ItemInfo info)
void RotoWidget::setupTrackingListen(const ItemInfo &info)
{
if (info.startPos < GenTime()) {
// TODO: track effects
......
......@@ -81,7 +81,7 @@ private:
QList <BPoint> getPoints(int keyframe);
/** @brief Adds tracking_finished as listener for "tracking-finished" event in MLT rotoscoping filter. */
void setupTrackingListen(ItemInfo info);
void setupTrackingListen(const ItemInfo &info);
/** @brief Passes list of keyframe positions to keyframe timeline widget. */
void keyframeTimelineFullUpdate();
......
......@@ -36,7 +36,7 @@ AbstractAudioScopeWidget::AbstractAudioScopeWidget(bool trackMouse, QWidget *par
{
}
void AbstractAudioScopeWidget::slotReceiveAudio(QVector<int16_t> sampleData, int freq, int num_channels, int num_samples)
void AbstractAudioScopeWidget::slotReceiveAudio(const QVector<int16_t>& sampleData, int freq, int num_channels, int num_samples)
{
#ifdef DEBUG_AASW
qDebug() << "Received audio for " << widgetName() << ".";
......@@ -51,11 +51,13 @@ void AbstractAudioScopeWidget::slotReceiveAudio(QVector<int16_t> sampleData, int
AbstractScopeWidget::slotRenderZoneUpdated();
}
AbstractAudioScopeWidget::~AbstractAudioScopeWidget() {}
AbstractAudioScopeWidget::~AbstractAudioScopeWidget()
{
}
QImage AbstractAudioScopeWidget::renderScope(uint accelerationFactor)
{
int newData = m_newData.fetchAndStoreAcquire(0);
const int newData = m_newData.fetchAndStoreAcquire(0);
return renderAudioScope(accelerationFactor, m_audioFrame, m_freq, m_nChannels, m_nSamples, newData);
}
......
......@@ -33,7 +33,7 @@ public:
virtual ~AbstractAudioScopeWidget();
public slots:
void slotReceiveAudio(QVector<int16_t> sampleData, int freq, int num_channels, int num_samples);
void slotReceiveAudio(const QVector<int16_t> &sampleData, int freq, int num_channels, int num_samples);
protected:
/** @brief This is just a wrapper function, subclasses can use renderAudioScope. */
......@@ -44,7 +44,7 @@ protected:
when calculation has finished, to allow multi-threading.
accelerationFactor hints how much faster than usual the calculation should be accomplished, if possible. */
virtual QImage renderAudioScope(uint accelerationFactor,
const QVector<int16_t> audioFrame, const int freq, const int num_channels, const int num_samples,
const QVector<int16_t> &audioFrame, const int freq, const int num_channels, const int num_samples,
const int newData) = 0;
int m_freq;
......
......@@ -45,7 +45,7 @@ AudioSignal::~AudioSignal()
{
}
QImage AudioSignal::renderAudioScope(uint, const QVector<int16_t> audioFrame,
QImage AudioSignal::renderAudioScope(uint, const QVector<int16_t> &audioFrame,
const int, const int num_channels, const int samples, const int)
{
QTime start = QTime::currentTime();
......
......@@ -43,7 +43,7 @@ public:
QRect scopeRect();
QImage renderHUD(uint accelerationFactor);
QImage renderBackground(uint accelerationFactor);
QImage renderAudioScope(uint accelerationFactor, const QVector<int16_t> audioFrame, const int, const int num_channels, const int samples, const int);
QImage renderAudioScope(uint accelerationFactor, const QVector<int16_t> &audioFrame, const int, const int num_channels, const int samples, const int);
QString widgetName() const { return "audioSignal"; }
bool isHUDDependingOnInput() const { return false; }
......
......@@ -150,14 +150,32 @@ void AudioSpectrum::writeConfig()
scopeConfig.sync();
}
QString AudioSpectrum::widgetName() const { return QString("AudioSpectrum"); }
bool AudioSpectrum::isBackgroundDependingOnInput() const { return false; }
bool AudioSpectrum::isScopeDependingOnInput() const { return true; }
bool AudioSpectrum::isHUDDependingOnInput() const { return false; }
QString AudioSpectrum::widgetName() const
{
return QLatin1String("AudioSpectrum");
}
QImage AudioSpectrum::renderBackground(uint) { return QImage(); }
bool AudioSpectrum::isBackgroundDependingOnInput() const
{
return false;
}
bool AudioSpectrum::isScopeDependingOnInput() const
{
return true;
}
bool AudioSpectrum::isHUDDependingOnInput() const
{
return false;
}
QImage AudioSpectrum::renderBackground(uint)
{
return QImage();
}
QImage AudioSpectrum::renderAudioScope(uint, const QVector<int16_t> audioFrame, const int freq, const int num_channels,
QImage AudioSpectrum::renderAudioScope(uint, const QVector<int16_t> &audioFrame, const int freq, const int num_channels,
const int num_samples, const int)
{
if (
......
......@@ -51,7 +51,7 @@ protected:
///// Implemented methods /////
QRect scopeRect();
QImage renderHUD(uint accelerationFactor);
QImage renderAudioScope(uint accelerationFactor, const QVector<int16_t> audioFrame, const int freq, const int num_channels, const int num_samples, const int newData);
QImage renderAudioScope(uint accelerationFactor, const QVector<int16_t> &audioFrame, const int freq, const int num_channels, const int num_samples, const int newData);
QImage renderBackground(uint accelerationFactor);
bool isHUDDependingOnInput() const;
bool isScopeDependingOnInput() const;
......
......@@ -140,7 +140,10 @@ void Spectrogram::writeConfig()
scopeConfig.sync();
}
QString Spectrogram::widgetName() const { return QString("Spectrogram"); }
QString Spectrogram::widgetName() const
{
return QLatin1String("Spectrogram");
}
QRect Spectrogram::scopeRect()
{
......@@ -301,7 +304,7 @@ QImage Spectrogram::renderHUD(uint)
return QImage();
}
}
QImage Spectrogram::renderAudioScope(uint, const QVector<int16_t> audioFrame, const int freq,
QImage Spectrogram::renderAudioScope(uint, const QVector<int16_t> &audioFrame, const int freq,
const int num_channels, const int num_samples, const int newData) {
if (
audioFrame.size() > 63
......
......@@ -45,7 +45,7 @@ protected:
///// Implemented methods /////
QRect scopeRect();
QImage renderHUD(uint accelerationFactor);
QImage renderAudioScope(uint accelerationFactor, const QVector<int16_t> audioFrame, const int freq, const int num_channels, const int num_samples, const int newData);
QImage renderAudioScope(uint accelerationFactor, const QVector<int16_t> &audioFrame, const int freq, const int num_channels, const int num_samples, const int newData);
QImage renderBackground(uint accelerationFactor);
bool isHUDDependingOnInput() const;
bool isScopeDependingOnInput() const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment