Skip to content

Commit

Permalink
Fix build for "Wave Analyzer"
Browse files Browse the repository at this point in the history
Fix the build of the "Wave Analyzer" plugin. This mainly consists of namespace adjustments in several files.

Other changes:
* Use `LMMS_STRINGIFY` instead of `STRINGIFY`
* Use `Plugin::Type::Effect` instead of `Plugin::Effect`
* Use enum `KnobType::Bright26` instead of `knobBright_26`
* Forward declarations of the friend classes in `WaveAnalyzerControls.h`
  • Loading branch information
michaelgregorius committed Mar 24, 2024
1 parent 9bea603 commit 7df8e1d
Show file tree
Hide file tree
Showing 12 changed files with 99 additions and 10 deletions.
9 changes: 7 additions & 2 deletions plugins/WaveAnalyzer/WaveAnalyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,18 @@
#include "lmms_math.h"
#include "plugin_export.h"

namespace lmms
{

extern "C" {
Plugin::Descriptor PLUGIN_EXPORT WaveAnalyzer_plugin_descriptor =
{
STRINGIFY(PLUGIN_NAME),
LMMS_STRINGIFY(PLUGIN_NAME),
"Wave Analyzer",
QT_TRANSLATE_NOOP("PluginBrowser", "A simple oscilloscope effect."),
"Ian Caio <iancaio_dev/at/hotmail.com>",
0x0112,
Plugin::Effect,
Plugin::Type::Effect,
new PluginPixmapLoader("logo"),
nullptr,
nullptr
Expand Down Expand Up @@ -117,3 +120,5 @@ extern "C"
return new WaveAnalyzerEffect(parent, static_cast<const Plugin::Descriptor::SubPluginFeatures::Key *>(data));
}
}

}
5 changes: 5 additions & 0 deletions plugins/WaveAnalyzer/WaveAnalyzer.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
#include "Effect.h"
#include "WaveAnalyzerControls.h"

namespace lmms
{

class WaveAnalyzerEffect : public Effect
{
public:
Expand All @@ -46,4 +49,6 @@ class WaveAnalyzerEffect : public Effect
const unsigned int m_maxBufferSize = 4096;
};

}

#endif
5 changes: 5 additions & 0 deletions plugins/WaveAnalyzer/WaveAnalyzerClipIndicator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@

#include "embed.h"

namespace lmms::gui
{

WaveAnalyzerClipIndicator::WaveAnalyzerClipIndicator(WaveAnalyzerControls* controls, QWidget* parent) :
QWidget(parent),
m_controls(controls)
Expand Down Expand Up @@ -91,3 +94,5 @@ void WaveAnalyzerClipIndicator::paintClipLeds(QPaintEvent* pe, QPainter & painte
painter.drawPixmap(rightLed, *m_clipLedsPixmap, rightLed);
}
}

}
10 changes: 10 additions & 0 deletions plugins/WaveAnalyzer/WaveAnalyzerClipIndicator.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,14 @@
#include <QWidget>
#include <QMouseEvent>

namespace lmms
{

class WaveAnalyzerControls;

namespace gui
{

class WaveAnalyzerClipIndicator : public QWidget
{
Q_OBJECT
Expand All @@ -51,4 +57,8 @@ class WaveAnalyzerClipIndicator : public QWidget
QPixmap* m_clipLedsPixmap;
};

}

}

#endif
7 changes: 6 additions & 1 deletion plugins/WaveAnalyzer/WaveAnalyzerControlDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
#include "PixmapButton.h"
#include "WaveAnalyzerControls.h"

namespace lmms::gui
{

WaveAnalyzerControlDialog::WaveAnalyzerControlDialog(WaveAnalyzerControls* controls) :
EffectControlDialog(controls)
{
Expand Down Expand Up @@ -94,7 +97,7 @@ WaveAnalyzerControlDialog::WaveAnalyzerControlDialog(WaveAnalyzerControls* contr
comboBoxLayout->addWidget(drawingMode);

// Adds numberOfFrames Knob
Knob* framesKnob = new Knob(knobBright_26);
Knob* framesKnob = new Knob(KnobType::Bright26);
framesKnob->setLabel("Frames");
framesKnob->setModel(&controls->m_numberOfFrames);

Expand Down Expand Up @@ -141,3 +144,5 @@ WaveAnalyzerControlDialog::WaveAnalyzerControlDialog(WaveAnalyzerControls* contr
WaveAnalyzerControlDialog::~WaveAnalyzerControlDialog()
{
}

}
10 changes: 10 additions & 0 deletions plugins/WaveAnalyzer/WaveAnalyzerControlDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,14 @@

#include "EffectControlDialog.h"

namespace lmms
{

class WaveAnalyzerControls;

namespace gui
{

class WaveAnalyzerControlDialog : public EffectControlDialog
{
Q_OBJECT
Expand All @@ -37,4 +43,8 @@ class WaveAnalyzerControlDialog : public EffectControlDialog
virtual ~WaveAnalyzerControlDialog();
};

}

}

#endif
5 changes: 5 additions & 0 deletions plugins/WaveAnalyzer/WaveAnalyzerControls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@

#include "WaveAnalyzer.h"

namespace lmms
{

WaveAnalyzerControls::WaveAnalyzerControls(WaveAnalyzerEffect* effect) :
EffectControls(effect),
m_effect(effect),
Expand Down Expand Up @@ -77,3 +80,5 @@ void WaveAnalyzerControls::loadSettings(const QDomElement & _this)
void WaveAnalyzerControls::saveSettings(QDomDocument & doc, QDomElement & parent)
{
}

}
28 changes: 21 additions & 7 deletions plugins/WaveAnalyzer/WaveAnalyzerControls.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@
#include "EffectControls.h"
#include "WaveAnalyzerControlDialog.h"

namespace lmms
{

namespace gui
{
class WaveAnalyzerControlDialog;
class WaveAnalyzerLevelIndicator;
class WaveAnalyzerClipIndicator;
class WaveAnalyzerOsc;
class WaveAnalyzerWaveform;
}

class WaveAnalyzerEffect;

class WaveAnalyzerControls : public EffectControls
Expand All @@ -55,9 +67,9 @@ class WaveAnalyzerControls : public EffectControls
return 2;
}

virtual EffectControlDialog* createView()
virtual lmms::gui::EffectControlDialog* createView()
{
return new WaveAnalyzerControlDialog(this);
return new lmms::gui::WaveAnalyzerControlDialog(this);
}

signals:
Expand Down Expand Up @@ -90,11 +102,13 @@ class WaveAnalyzerControls : public EffectControls
float m_ampBufferR[BUFFER_MAX_SIZE];

friend class WaveAnalyzerEffect;
friend class WaveAnalyzerControlDialog;
friend class WaveAnalyzerLevelIndicator;
friend class WaveAnalyzerClipIndicator;
friend class WaveAnalyzerOsc;
friend class WaveAnalyzerWaveform;
friend class gui::WaveAnalyzerControlDialog;
friend class gui::WaveAnalyzerLevelIndicator;
friend class gui::WaveAnalyzerClipIndicator;
friend class gui::WaveAnalyzerOsc;
friend class gui::WaveAnalyzerWaveform;
};

}

#endif
5 changes: 5 additions & 0 deletions plugins/WaveAnalyzer/WaveAnalyzerLevelIndicator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
#include "embed.h"
#include "lmms_math.h"

namespace lmms::gui
{

WaveAnalyzerLevelIndicator::WaveAnalyzerLevelIndicator(WaveAnalyzerControls* controls, QWidget* parent) :
QWidget(parent),
m_controls(controls),
Expand Down Expand Up @@ -103,3 +106,5 @@ void WaveAnalyzerLevelIndicator::paintPeaks(QPaintEvent* pe, QPainter & painter)
QRect rightLevel(0, height, rightSize, height);
painter.drawPixmap(rightLevel, *m_levelsPixmap, rightLevel);
}

}
10 changes: 10 additions & 0 deletions plugins/WaveAnalyzer/WaveAnalyzerLevelIndicator.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,14 @@
#include <QPixmap>
#include <QWidget>

namespace lmms
{

class WaveAnalyzerControls;

namespace gui
{

class WaveAnalyzerLevelIndicator : public QWidget
{
Q_OBJECT
Expand All @@ -52,4 +58,8 @@ class WaveAnalyzerLevelIndicator : public QWidget
QPixmap* m_levelsPixmap;
};

}

}

#endif
5 changes: 5 additions & 0 deletions plugins/WaveAnalyzer/WaveAnalyzerOsc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
#include <QPainter>
#include <QPainterPath>

namespace lmms::gui
{

WaveAnalyzerOsc::WaveAnalyzerOsc(WaveAnalyzerControls* controls, QWidget* parent) :
QWidget(parent),
m_controls(controls)
Expand Down Expand Up @@ -489,3 +492,5 @@ void WaveAnalyzerWaveform::paintEvent(QPaintEvent* pe)
return;
}
}

}
10 changes: 10 additions & 0 deletions plugins/WaveAnalyzer/WaveAnalyzerOsc.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,14 @@
// Sizes
#define labelFontSize 12

namespace lmms
{

class WaveAnalyzerControls;

namespace gui
{

class WaveAnalyzerWaveform : public QWidget
{
Q_OBJECT
Expand Down Expand Up @@ -107,4 +113,8 @@ class WaveAnalyzerOsc : public QWidget
WaveAnalyzerControls* m_controls;
};

}

}

#endif

0 comments on commit 7df8e1d

Please sign in to comment.