#include "ffbeffect.h"
#include "globalsettings.h"
+#include <QtWidgets/QMessageBox>
const QString FFBEffect::PRERR_CAPTION("Invalid FFB parameter");
m_type = type;
}
+void FFBEffect::reportError(const QString& errorMsg) const
+{
+ QMessageBox::warning(nullptr, PRERR_CAPTION, errorMsg);
+}
+
bool FFBEffect::operator==(const FFBEffect& other) const
{
return this->type() == other.type();
virtual bool operator!=(const FFBEffect&) const;
protected:
+ virtual bool checkEnvelopeParameters(const int attackLength, const int attackLevel, const int fadeLength, const int fadeLevel) = 0;
virtual bool checkGenericParameters(const std::shared_ptr<FFBEffectParameters> params) = 0;
+ void reportError(const QString& errorMsg) const;
static const QString PRERR_CAPTION;
inline bool setParameters(const std::shared_ptr<FFBEffectParameters> params) { (void)(params); return false; }
protected:
+ bool checkEnvelopeParameters(const int attackLength, const int attackLevel, const int fadeLength, const int fadeLevel)
+ {
+ Q_UNUSED(attackLength); Q_UNUSED(attackLevel); Q_UNUSED(fadeLength); Q_UNUSED(fadeLevel);
+ return false;
+ }
bool checkGenericParameters(const std::shared_ptr<FFBEffectParameters> params) { Q_UNUSED(params); return false; }
};
bool LinuxFFBConditionEffect::setParameters(const std::shared_ptr<FFBConditionEffectParameters> params)
{
+ if (!GlobalSettings::GS()->doSanityChecks)
+ return true;
+
if (!checkGenericParameters(params))
return false;
- if (GlobalSettings::GS()->doSanityChecks) {
- if (!checkBoundsInclusive(params->center[FFBConditionEffectParameters::Axis::X], -0x7FFF, 0x7FFF)) {
- reportError("Center X out of bounds,");
- return false;
- }
- if (!checkBoundsInclusive(params->center[FFBConditionEffectParameters::Axis::Y], -0x7FFF, 0x7FFF)) {
- reportError("Center Y out of bounds,");
- return false;
- }
+ if (!checkBoundsInclusive(params->center[FFBConditionEffectParameters::Axis::X], -0x7FFF, 0x7FFF)) {
+ reportError("Center X must be within <-32767; 32767>");
+ return false;
+ }
+ if (!checkBoundsInclusive(params->center[FFBConditionEffectParameters::Axis::Y], -0x7FFF, 0x7FFF)) {
+ reportError("Center Y must be within <-32767; 32767>");
+ return false;
+ }
- if (!checkBoundsInclusive(params->deadband[FFBConditionEffectParameters::Axis::X], 0, 0xFFFF)) {
- reportError("Deadband X out of bounds.");
- return false;
- }
- if (!checkBoundsInclusive(params->deadband[FFBConditionEffectParameters::Axis::Y], 0, 0xFFFF)) {
- reportError("Deadband Y out of bounds.");
- return false;
- }
+ if (!checkBoundsInclusive(params->deadband[FFBConditionEffectParameters::Axis::X], 0, 0xFFFF)) {
+ reportError("Deadband X must be within <0; 65535>");
+ return false;
+ }
+ if (!checkBoundsInclusive(params->deadband[FFBConditionEffectParameters::Axis::Y], 0, 0xFFFF)) {
+ reportError("Deadband Ymust be within <0; 65535>");
+ return false;
+ }
- if (!checkBoundsInclusive(params->leftCoeff[FFBConditionEffectParameters::Axis::X], -0x7FFF, 0x7FFF)) {
- reportError("Left coefficient X out of bounds.");
- return false;
- }
- if (!checkBoundsInclusive(params->leftCoeff[FFBConditionEffectParameters::Axis::Y], -0x7FFF, 0x7FFF)) {
- reportError("Left coefficient Y out of bounds.");
- return false;
- }
+ if (!checkBoundsInclusive(params->leftCoeff[FFBConditionEffectParameters::Axis::X], -0x7FFF, 0x7FFF)) {
+ reportError("Left coefficient X must be within <-32767; 32767>");
+ return false;
+ }
+ if (!checkBoundsInclusive(params->leftCoeff[FFBConditionEffectParameters::Axis::Y], -0x7FFF, 0x7FFF)) {
+ reportError("Left coefficient Y must be within <-32767; 32767>");
+ return false;
+ }
- if (!checkBoundsInclusive(params->rightCoeff[FFBConditionEffectParameters::Axis::X], -0x7FFF, 0x7FFF)) {
- reportError("Right coefficient X out of bounds.");
- return false;
- }
- if (!checkBoundsInclusive(params->rightCoeff[FFBConditionEffectParameters::Axis::Y], -0x7FFF, 0x7FFF)) {
- reportError("Right coefficient Y out of bounds.");
- return false;
- }
+ if (!checkBoundsInclusive(params->rightCoeff[FFBConditionEffectParameters::Axis::X], -0x7FFF, 0x7FFF)) {
+ reportError("Right coefficient X must be within <-32767; 32767>");
+ return false;
+ }
+ if (!checkBoundsInclusive(params->rightCoeff[FFBConditionEffectParameters::Axis::Y], -0x7FFF, 0x7FFF)) {
+ reportError("Right coefficient Y must be within <-32767; 32767>");
+ return false;
+ }
- if (!checkBoundsInclusive(params->leftSat[FFBConditionEffectParameters::Axis::X], 0, 0xFFFF)) {
- reportError("Left saturation X out of bounds.");
- return false;
- }
- if (!checkBoundsInclusive(params->leftSat[FFBConditionEffectParameters::Axis::Y], 0, 0xFFFF)) {
- reportError("Left saturation Y out of bounds.");
- return false;
- }
+ if (!checkBoundsInclusive(params->leftSat[FFBConditionEffectParameters::Axis::X], 0, 0xFFFF)) {
+ reportError("Left saturation X must be within <0; 65535>");
+ return false;
+ }
+ if (!checkBoundsInclusive(params->leftSat[FFBConditionEffectParameters::Axis::Y], 0, 0xFFFF)) {
+ reportError("Left saturation Y must be within <0; 65535>");
+ return false;
+ }
- if (!checkBoundsInclusive(params->rightSat[FFBConditionEffectParameters::Axis::X], 0, 0xFFFF)) {
- reportError("Right saturation X out of bounds.");
- return false;
- }
- if (!checkBoundsInclusive(params->rightSat[FFBConditionEffectParameters::Axis::Y], 0, 0xFFFF)) {
- reportError("Right saturation Y out of bounds.");
- return false;
- }
+ if (!checkBoundsInclusive(params->rightSat[FFBConditionEffectParameters::Axis::X], 0, 0xFFFF)) {
+ reportError("Right saturation X must be within <0; 65535>");
+ return false;
+ }
+ if (!checkBoundsInclusive(params->rightSat[FFBConditionEffectParameters::Axis::Y], 0, 0xFFFF)) {
+ reportError("Right saturation Y must be within <0; 65535>");
+ return false;
+ }
- if (params->subtype == ConditionSubtypes::NONE) {
- reportError("Invalid subtype");
- return false;
- }
+ if (params->subtype == ConditionSubtypes::NONE) {
+ reportError("Invalid subtype");
+ return false;
}
m_params = params;
bool LinuxFFBConstantEffect::setParameters(const std::shared_ptr<FFBConstantEffectParameters> params)
{
+ if (!GlobalSettings::GS()->doSanityChecks)
+ return true;
+
if (!checkGenericParameters(params))
return false;
- if (GlobalSettings::GS()->doSanityChecks) {
- if (!checkBoundsInclusive(params->attackLength, 0, 0x7FFF)){
- reportError("Attack length out of bounds");
- return false;
- }
- if (!checkBoundsInclusive(params->attackLevel, 0, 0x7FFF)) {
- reportError("Attack level out of bounds");
- return false;
- } if (!checkBoundsInclusive(params->fadeLength, 0, 0x7FFF)) {
- reportError("Fade length out of bounds");
- return false;
- }
- if (!checkBoundsInclusive(params->fadeLevel, 0, 0x7FFF)) {
- reportError("Fade level out of bounds");
- return false;
- }
+ if (!checkEnvelopeParameters(params->attackLength, params->attackLevel, params->fadeLength, params->fadeLevel))
+ return false;
- if (!checkBoundsInclusive(params->level, -0x7FFF, 0x7FFF)) {
- reportError("Level out of bounds.");
- return false;
- }
+ if (!checkBoundsInclusive(params->level, -0x7FFF, 0x7FFF)) {
+ reportError("Level out of bounds.");
+ return false;
}
m_params = params;
#include "linuxffbeffect.h"
#include "globalsettings.h"
-#include <QtWidgets/QMessageBox>
LinuxFFBEffect::LinuxFFBEffect(FFBEffectTypes type) :
FFBEffect(type)
return eff;
}
-void LinuxFFBEffect::reportError(const QString& errorMsg) const
+bool LinuxFFBEffect::checkEnvelopeParameters(const int attackLength, const int attackLevel, const int fadeLength, const int fadeLevel)
{
- QMessageBox::warning(nullptr, "FFB effect error", errorMsg);
+ if (!GlobalSettings::GS()->doSanityChecks)
+ return true;
+
+ if (!checkBoundsInclusive(attackLength, 0, 0x7FFF)) {
+ reportError("Attack length must be within <0; 32767>");
+ return false;
+ }
+
+ if (!checkBoundsInclusive(attackLevel, 0, 0x7FFF)) {
+ reportError("Attack level must be within <0; 32767>");
+ return false;
+ }
+
+ if (!checkBoundsInclusive(fadeLength, 0, 0x7FFF)) {
+ reportError("Fade length must be within <0; 32767>");
+ return false;
+ }
+
+ if (!checkBoundsInclusive(fadeLevel, 0, 0x7FFF)) {
+ reportError("Fade level must be within <0; 32767>");
+ return false;
+ }
+
+ return true;
}
bool LinuxFFBEffect::checkGenericParameters(const std::shared_ptr<FFBEffectParameters> params)
}
if (!checkBoundsInclusive(params->direction, 0, 0xFFFF)) {
- reportError("Direction out of bounds.");
+ reportError("Direction must be within <0; 65535>");
return false;
}
if (!checkBoundsInclusive(params->replayDelay, 0, 0x7FFF)) {
- reportError("Replay delay out of bounds.");
+ reportError("Replay delay must be within <0; 65535>");
return false;
}
if (!checkBoundsInclusive(params->replayLength, static_cast<int64_t>(0), static_cast<int64_t>(0x7FFF))) {
- reportError("Replay length out of bounds.");
+ reportError("Replay length must be within <0; 32767>");
return false;
}
protected:
struct ff_effect* createFFStruct(const std::shared_ptr<FFBEffectParameters> params);
+ bool checkEnvelopeParameters(const int attackLength, const int attackLevel, const int fadeLength, const int fadeLevel);
bool checkGenericParameters(const std::shared_ptr<FFBEffectParameters> params);
- void reportError(const QString& errorMsg) const;
private:
bool LinuxFFBPeriodicEffect::setParameters(const std::shared_ptr<FFBPeriodicEffectParameters> params)
{
+ if (!GlobalSettings::GS()->doSanityChecks)
+ return true;
+
if (!checkGenericParameters(params))
return false;
- if (GlobalSettings::GS()->doSanityChecks) {
- if (!checkBoundsInclusive(params->attackLength, 0, 0x7FFF)) {
- reportError("Attack length out of bounds.");
- return false;
- }
-
- if (!checkBoundsInclusive(params->attackLevel, 0, 0x7FFF)) {
- reportError("Attack level out of bounds.");
- return false;
- }
-
- if (!checkBoundsInclusive(params->fadeLength, 0, 0x7FFF)) {
- reportError("Fade length out of bounds.");
- return false;
- }
-
- if (!checkBoundsInclusive(params->fadeLevel, 0, 0x7FFF)) {
- reportError("Fade level out of bounds.");
- return false;
- }
+ if (!checkEnvelopeParameters(params->attackLength, params->attackLevel, params->fadeLength, params->fadeLevel))
+ return false;
- if (!checkBoundsInclusive(params->magnitude, -0x7FFF, 0x7FFF)) {
- reportError("Magnitude out of bounds.");
- return false;
- }
+ if (!checkBoundsInclusive(params->magnitude, -0x7FFF, 0x7FFF)) {
+ reportError("Magnitude must be within <-32767; 32767>");
+ return false;
+ }
- if (!checkBoundsInclusive(params->offset, -0x7FFF, 0x7FFF)) {
- reportError("Offset out of bounds.");
- return false;
- }
+ if (!checkBoundsInclusive(params->offset, -0x7FFF, 0x7FFF)) {
+ reportError("Offset must be within <32767; 32767>");
+ return false;
+ }
- if (!checkBoundsInclusive(params->period, 0, 0x7FFF)) {
- reportError("Period out of bounds.");
- return false;
- }
+ if (!checkBoundsInclusive(params->period, 0, 0x7FFF)) {
+ reportError("Period must be within <0; 32767>");
+ return false;
+ }
- if (!checkBoundsInclusive(params->phase, 0, 0x7FFF)) {
- reportError("Phase out of bounds.");
- return false;
- }
+ if (!checkBoundsInclusive(params->phase, 0, 0x7FFF)) {
+ reportError("Phase must be within <0; 32767>");
+ return false;
+ }
- if (params->waveform == PeriodicWaveforms::NONE) {
- reportError("Invalid waveform type.");
- return false;
- }
+ if (params->waveform == PeriodicWaveforms::NONE) {
+ reportError("Invalid waveform type.");
+ return false;
}
m_params = params;
bool LinuxFFBRampEffect::setParameters(const std::shared_ptr<FFBRampEffectParameters> params)
{
+ if (!GlobalSettings::GS()->doSanityChecks)
+ return true;
+
if (!checkGenericParameters(params))
return false;
- if (GlobalSettings::GS()->doSanityChecks) {
- if (!checkBoundsInclusive(params->attackLength, 0, 0x7FFF)) {
- reportError("Attack length out of bounds.");
- return false;
- }
-
- if (!checkBoundsInclusive(params->attackLevel, 0, 0x7FFF)) {
- reportError("Attack level out of bounds.");
- return false;
- }
-
- if (!checkBoundsInclusive(params->fadeLength, 0, 0x7FFF)) {
- reportError("Fade length out of bounds.");
- return false;
- }
-
- if (!checkBoundsInclusive(params->fadeLevel, 0, 0x7FFF)) {
- reportError("Fade level out of bounds.");
- return false;
- }
+ if (!checkEnvelopeParameters(params->attackLength, params->attackLevel, params->fadeLength, params->fadeLevel))
+ return false;
- if (!checkBoundsInclusive(params->endLevel, -0x7FFF, 0x7FFF)) {
- reportError("End level out of bounds");
- return false;
- }
+ if (!checkBoundsInclusive(params->endLevel, -0x7FFF, 0x7FFF)) {
+ reportError("End level must be within <-32767; 32767>");
+ return false;
+ }
- if (!checkBoundsInclusive(params->startLevel, -0x7FFF, 0x7FFF)) {
- reportError("Start level out of bounds");
- return false;
- }
+ if (!checkBoundsInclusive(params->startLevel, -0x7FFF, 0x7FFF)) {
+ reportError("Start level must be within <-32767; 32767>");
+ return false;
}
m_params = params;
return false;
if (!checkBoundsInclusive(params->strongMagnitude, 0, 0xFFFF)) {
- reportError("Strong magnitude out of bounds");
+ reportError("Strong magnitude must be within <0; 65535>");
return false;
}
if (!checkBoundsInclusive(params->weakMagnitude, 0, 0xFFFF)) {
- reportError("Weak magnitude out of bounds");
+ reportError("Weak magnitude must be within <0; 65535>");
return false;
}
#include "sdl2ffbconditioneffect.h"
#include "globalsettings.h"
-#include <QtWidgets/QMessageBox>
SDL2FFBConditionEffect::SDL2FFBConditionEffect() :
SDL2FFBEffect(FFBEffectTypes::CONDITION)
return false;
if (!checkBoundsInclusive(params->leftSat.at(FFBConditionEffectParameters::Axis::X), 0, 0xFFFF)) {
- QMessageBox::warning(nullptr, PRERR_CAPTION, "Left X saturation must be within <0; 65535>");
+ reportError("Left X saturation must be within <0; 65535>");
return false;
}
if (!checkBoundsInclusive(params->leftSat.at(FFBConditionEffectParameters::Axis::Y), 0, 0xFFFF)) {
- QMessageBox::warning(nullptr, PRERR_CAPTION, "Left Y saturation must be within <0; 65535>");
+ reportError("Left Y saturation must be within <0; 65535>");
return false;
}
if (!checkBoundsInclusive(params->rightSat.at(FFBConditionEffectParameters::Axis::X), 0, 0xFFFF)) {
- QMessageBox::warning(nullptr, PRERR_CAPTION, "Right X saturation must be within <0; 65535>");
+ reportError("Right X saturation must be within <0; 65535>");
return false;
}
if (!checkBoundsInclusive(params->rightSat.at(FFBConditionEffectParameters::Axis::Y), 0, 0xFFFF)) {
- QMessageBox::warning(nullptr, PRERR_CAPTION, "Right Y saturation must be within <0; 65535>");
+ reportError("Right Y saturation must be within <0; 65535>");
return false;
}
if (!checkBoundsInclusive(params->leftCoeff.at(FFBConditionEffectParameters::Axis::X), -0x7FFF, 0x7FFF)) {
- QMessageBox::warning(nullptr, PRERR_CAPTION, "Left X coefficient must be within <-32767; 32767>");
+ reportError("Left X coefficient must be within <-32767; 32767>");
return false;
}
if (!checkBoundsInclusive(params->leftCoeff.at(FFBConditionEffectParameters::Axis::Y), -0x7FFF, 0x7FFF)) {
- QMessageBox::warning(nullptr, PRERR_CAPTION, "Left Y coefficient must be within <-32767; 32767>");
+ reportError("Left Y coefficient must be within <-32767; 32767>");
return false;
}
if (!checkBoundsInclusive(params->rightCoeff.at(FFBConditionEffectParameters::Axis::X), -0x7FFF, 0x7FFF)) {
- QMessageBox::warning(nullptr, PRERR_CAPTION, "Right X coefficient must be within <-32767; 32767>");
+ reportError("Right X coefficient must be within <-32767; 32767>");
return false;
}
if (!checkBoundsInclusive(params->rightCoeff.at(FFBConditionEffectParameters::Axis::Y), -0x7FFF, 0x7FFF)) {
- QMessageBox::warning(nullptr, PRERR_CAPTION, "Right Y coefficient must be within <-32767; 32767>");
+ reportError("Right Y coefficient must be within <-32767; 32767>");
return false;
}
if (!checkBoundsInclusive(params->deadband.at(FFBConditionEffectParameters::Axis::X), 0, 0xFFFF)) {
- QMessageBox::warning(nullptr, PRERR_CAPTION, "Deadband X must be within <0; 65535>");
+ reportError("Deadband X must be within <0; 65535>");
return false;
}
if (!checkBoundsInclusive(params->deadband.at(FFBConditionEffectParameters::Axis::Y), 0, 0xFFFF)) {
- QMessageBox::warning(nullptr, PRERR_CAPTION, "Deadband Y must be within <0; 65535>");
+ reportError("Deadband Y must be within <0; 65535>");
return false;
}
if (!checkBoundsInclusive(params->center.at(FFBConditionEffectParameters::Axis::X), -0x7FFF, 0x7FFF)) {
- QMessageBox::warning(nullptr, PRERR_CAPTION, "Center X must be within <-32767; 32767>");
+ reportError("Center X must be within <-32767; 32767>");
return false;
}
if (!checkBoundsInclusive(params->center.at(FFBConditionEffectParameters::Axis::Y), -0x7FFF, 0x7FFF)) {
- QMessageBox::warning(nullptr, PRERR_CAPTION, "Center Y must be within <-32767; 32767>");
+ reportError("Center Y must be within <-32767; 32767>");
return false;
}
#include "sdl2ffbconstanteffect.h"
#include "globalsettings.h"
-#include <QtWidgets/QMessageBox>
SDL2FFBConstantEffect::SDL2FFBConstantEffect() :
SDL2FFBEffect(FFBEffectTypes::CONSTANT)
return false;
if (!checkBoundsInclusive(m_params->level, -0x7FFF, 0x7FFF)) {
- QMessageBox::warning(nullptr, PRERR_CAPTION, "Level parameters must be within <-32767; 32767>");
+ reportError("Level parameters must be within <-32767; 32767>");
return false;
}
#include "sdl2ffbeffect.h"
#include "globalsettings.h"
-#include <QtWidgets/QMessageBox>
SDL_HapticEffect* SDL2FFBEffect::createFFstruct()
{
return true;
if (!checkBoundsInclusive(attackLength, 0, 0x7FFF)) {
- QMessageBox::warning(nullptr, PRERR_CAPTION, "Attack length must be within <0; 32767>");
+ reportError("Attack length must be within <0; 32767>");
return false;
}
if (!checkBoundsInclusive(attackLevel, 0, 0x7FFF)) {
- QMessageBox::warning(nullptr, PRERR_CAPTION, "Attack level must be within <0; 32767>");
+ reportError("Attack level must be within <0; 32767>");
return false;
}
if (!checkBoundsInclusive(fadeLength, 0, 0x7FFF)) {
- QMessageBox::warning(nullptr, PRERR_CAPTION, "Fade length must be within <0; 32767>");
+ reportError("Fade length must be within <0; 32767>");
return false;
}
if (!checkBoundsInclusive(fadeLevel, 0, 0x7FFF)) {
- QMessageBox::warning(nullptr, PRERR_CAPTION, "Fade level must be within <0; 32767>");
+ reportError("Fade level must be within <0; 32767>");
return false;
}
return true;
if (!checkBoundsInclusive(params->direction, 0, 36000)) {
- QMessageBox::warning(nullptr, PRERR_CAPTION, "Direction must be within <0; 36000)");
+ reportError("Direction must be within <0; 36000)");
return false;
}
if (!checkBoundsInclusive(params->replayLength, static_cast<int64_t>(0), static_cast<int64_t>(0x7FFF))) {
- QMessageBox::warning(nullptr, PRERR_CAPTION, "Replay length must be within <0; 32767>");
+ reportError("Replay length must be within <0; 32767>");
return false;
}
if (!checkBoundsInclusive(params->replayDelay, 0, 0xFFFF)) {
- QMessageBox::warning(nullptr, PRERR_CAPTION, "Replay delay must be within <0; 65535>");
+ reportError("Replay delay must be within <0; 65535>");
return false;
}
#include "sdl2ffbperiodiceffect.h"
#include "globalsettings.h"
-#include <QtWidgets/QMessageBox>
SDL2FFBPeriodicEffect::SDL2FFBPeriodicEffect() :
SDL2FFBEffect(FFBEffectTypes::PERIODIC)
return false;
if (!checkBoundsInclusive(params->period, 0, 36000)) {
- QMessageBox::warning(nullptr, PRERR_CAPTION, "Period must be within <0; 36000>");
+ reportError("Period must be within <0; 36000>");
return false;
}
if (!checkBoundsInclusive(params->magnitude, -0x7FFF, 0x7FFF)) {
- QMessageBox::warning(nullptr, PRERR_CAPTION, "Magnitude must be within <-32767; 32767>");
+ reportError("Magnitude must be within <-32767; 32767>");
return false;
}
if (!checkBoundsInclusive(params->offset, -0x7FFF, 0x7FFF)) {
- QMessageBox::warning(nullptr, PRERR_CAPTION, "Offset must be within <-32767; 32767>");
+ reportError("Offset must be within <-32767; 32767>");
return false;
}
if (!checkBoundsInclusive(params->phase, 0, 36000)) {
- QMessageBox::warning(nullptr, PRERR_CAPTION, "Phase must be withing <0; 36000>");
+ reportError("Phase must be withing <0; 36000>");
return false;
}
if (params->waveform == PeriodicWaveforms::NONE ||
params->waveform == PeriodicWaveforms::SQUARE) {
- QMessageBox::warning(nullptr, PRERR_CAPTION, "Unsupported waveform");
+ reportError("Invalid or unsupported waveform");
return false;
}
#include "sdl2ffbrampeffect.h"
#include "globalsettings.h"
-#include <QtWidgets/QMessageBox>
SDL2FFBRampEffect::SDL2FFBRampEffect() :
SDL2FFBEffect(FFBEffectTypes::RAMP)
return false;
if (checkBoundsInclusive(params->startLevel, -0x7FFF, 0x7FFF)) {
- QMessageBox::warning(nullptr, PRERR_CAPTION, "Start level must be within <-32767; 32767>");
+ reportError("Start level must be within <-32767; 32767>");
return false;
}
if (!checkBoundsInclusive(params->endLevel, -0x7FFF, 0x7FFF)) {
- QMessageBox::warning(nullptr, PRERR_CAPTION, "End level must be within <-32767; 32767>");
+ reportError("End level must be within <-32767; 32767>");
return false;
}