// This file is generated by kconfig_compiler_kf6 from easyeffects_db_voice_suppressor.kcfg.
// All changes you do to this file will be lost.

#include "easyeffects_db_voice_suppressor.h"

DbVoiceSuppressor::DbVoiceSuppressor( const QString & masterGroup, const QString & instanceIndex )
  : KConfigBaseEE( QStringLiteral( "easyeffects/db/voicesuppressorrc" ) )
  , mParammasterGroup(masterGroup)
  , mParaminstanceIndex(instanceIndex)
{
  KConfigCompilerSignallingItem::NotifyFunction notifyFunction = static_cast<KConfigCompilerSignallingItem::NotifyFunction>(&DbVoiceSuppressor::itemChanged);

  KConfigGroup cgmasterGroup(this->config(), QStringLiteral( "%1" ).arg( mParammasterGroup ));
  KConfigGroup cgVoiceSuppressorinstanceIndex = cgmasterGroup.group(QStringLiteral( "VoiceSuppressor#%1" ).arg( mParaminstanceIndex ));
  KConfigCompilerSignallingItem  *itemBypass;
  KConfigBaseEE::ItemBool  *innerItemBypass;
  innerItemBypass = new KConfigBaseEE::ItemBool( currentGroup(), QStringLiteral( "bypass" ), mBypass, false );
  itemBypass = new KConfigCompilerSignallingItem(innerItemBypass, this, notifyFunction, signalBypassChanged);
  itemBypass->setWriteFlags(KConfigBase::Notify);
  itemBypass->setGroup(cgVoiceSuppressorinstanceIndex);
  addItem( itemBypass, QStringLiteral( "bypass" ) );
  KConfigCompilerSignallingItem  *itemInputGain;
  KConfigBaseEE::ItemDouble  *innerItemInputGain;
  innerItemInputGain = new KConfigBaseEE::ItemDouble( currentGroup(), QStringLiteral( "inputGain" ), mInputGain, 0 );
  itemInputGain = new KConfigCompilerSignallingItem(innerItemInputGain, this, notifyFunction, signalInputGainChanged);
  innerItemInputGain->setMinValue(-36);
  innerItemInputGain->setMaxValue(36);
  itemInputGain->setWriteFlags(KConfigBase::Notify);
  itemInputGain->setGroup(cgVoiceSuppressorinstanceIndex);
  addItem( itemInputGain, QStringLiteral( "inputGain" ) );
  KConfigCompilerSignallingItem  *itemOutputGain;
  KConfigBaseEE::ItemDouble  *innerItemOutputGain;
  innerItemOutputGain = new KConfigBaseEE::ItemDouble( currentGroup(), QStringLiteral( "outputGain" ), mOutputGain, 0 );
  itemOutputGain = new KConfigCompilerSignallingItem(innerItemOutputGain, this, notifyFunction, signalOutputGainChanged);
  innerItemOutputGain->setMinValue(-36);
  innerItemOutputGain->setMaxValue(36);
  itemOutputGain->setWriteFlags(KConfigBase::Notify);
  itemOutputGain->setGroup(cgVoiceSuppressorinstanceIndex);
  addItem( itemOutputGain, QStringLiteral( "outputGain" ) );
  KConfigCompilerSignallingItem  *itemFreqStart;
  KConfigBaseEE::ItemDouble  *innerItemFreqStart;
  innerItemFreqStart = new KConfigBaseEE::ItemDouble( currentGroup(), QStringLiteral( "freqStart" ), mFreqStart, 20 );
  itemFreqStart = new KConfigCompilerSignallingItem(innerItemFreqStart, this, notifyFunction, signalFreqStartChanged);
  innerItemFreqStart->setMinValue(20);
  innerItemFreqStart->setMaxValue(22000);
  itemFreqStart->setWriteFlags(KConfigBase::Notify);
  itemFreqStart->setGroup(cgVoiceSuppressorinstanceIndex);
  addItem( itemFreqStart, QStringLiteral( "freqStart" ) );
  KConfigCompilerSignallingItem  *itemFreqEnd;
  KConfigBaseEE::ItemDouble  *innerItemFreqEnd;
  innerItemFreqEnd = new KConfigBaseEE::ItemDouble( currentGroup(), QStringLiteral( "freqEnd" ), mFreqEnd, 22000 );
  itemFreqEnd = new KConfigCompilerSignallingItem(innerItemFreqEnd, this, notifyFunction, signalFreqEndChanged);
  innerItemFreqEnd->setMinValue(20);
  innerItemFreqEnd->setMaxValue(22000);
  itemFreqEnd->setWriteFlags(KConfigBase::Notify);
  itemFreqEnd->setGroup(cgVoiceSuppressorinstanceIndex);
  addItem( itemFreqEnd, QStringLiteral( "freqEnd" ) );
  KConfigCompilerSignallingItem  *itemCorrelation;
  KConfigBaseEE::ItemDouble  *innerItemCorrelation;
  innerItemCorrelation = new KConfigBaseEE::ItemDouble( currentGroup(), QStringLiteral( "correlation" ), mCorrelation, 95 );
  itemCorrelation = new KConfigCompilerSignallingItem(innerItemCorrelation, this, notifyFunction, signalCorrelationChanged);
  innerItemCorrelation->setMinValue(1);
  innerItemCorrelation->setMaxValue(100);
  itemCorrelation->setWriteFlags(KConfigBase::Notify);
  itemCorrelation->setGroup(cgVoiceSuppressorinstanceIndex);
  addItem( itemCorrelation, QStringLiteral( "correlation" ) );
  KConfigCompilerSignallingItem  *itemPhaseDifference;
  KConfigBaseEE::ItemDouble  *innerItemPhaseDifference;
  innerItemPhaseDifference = new KConfigBaseEE::ItemDouble( currentGroup(), QStringLiteral( "phaseDifference" ), mPhaseDifference, 20 );
  itemPhaseDifference = new KConfigCompilerSignallingItem(innerItemPhaseDifference, this, notifyFunction, signalPhaseDifferenceChanged);
  innerItemPhaseDifference->setMinValue(1);
  innerItemPhaseDifference->setMaxValue(180);
  itemPhaseDifference->setWriteFlags(KConfigBase::Notify);
  itemPhaseDifference->setGroup(cgVoiceSuppressorinstanceIndex);
  addItem( itemPhaseDifference, QStringLiteral( "phaseDifference" ) );
  KConfigCompilerSignallingItem  *itemMinKurtosis;
  KConfigBaseEE::ItemDouble  *innerItemMinKurtosis;
  innerItemMinKurtosis = new KConfigBaseEE::ItemDouble( currentGroup(), QStringLiteral( "minKurtosis" ), mMinKurtosis, 1 );
  itemMinKurtosis = new KConfigCompilerSignallingItem(innerItemMinKurtosis, this, notifyFunction, signalMinKurtosisChanged);
  innerItemMinKurtosis->setMinValue(0);
  innerItemMinKurtosis->setMaxValue(100.0);
  itemMinKurtosis->setWriteFlags(KConfigBase::Notify);
  itemMinKurtosis->setGroup(cgVoiceSuppressorinstanceIndex);
  addItem( itemMinKurtosis, QStringLiteral( "minKurtosis" ) );
  KConfigCompilerSignallingItem  *itemMaxInstFreq;
  KConfigBaseEE::ItemDouble  *innerItemMaxInstFreq;
  innerItemMaxInstFreq = new KConfigBaseEE::ItemDouble( currentGroup(), QStringLiteral( "maxInstFreq" ), mMaxInstFreq, 1 );
  itemMaxInstFreq = new KConfigCompilerSignallingItem(innerItemMaxInstFreq, this, notifyFunction, signalMaxInstFreqChanged);
  innerItemMaxInstFreq->setMinValue(0);
  innerItemMaxInstFreq->setMaxValue(100.0);
  itemMaxInstFreq->setWriteFlags(KConfigBase::Notify);
  itemMaxInstFreq->setGroup(cgVoiceSuppressorinstanceIndex);
  addItem( itemMaxInstFreq, QStringLiteral( "maxInstFreq" ) );
  KConfigCompilerSignallingItem  *itemInvertedMode;
  KConfigBaseEE::ItemBool  *innerItemInvertedMode;
  innerItemInvertedMode = new KConfigBaseEE::ItemBool( currentGroup(), QStringLiteral( "invertedMode" ), mInvertedMode, false );
  itemInvertedMode = new KConfigCompilerSignallingItem(innerItemInvertedMode, this, notifyFunction, signalInvertedModeChanged);
  itemInvertedMode->setWriteFlags(KConfigBase::Notify);
  itemInvertedMode->setGroup(cgVoiceSuppressorinstanceIndex);
  addItem( itemInvertedMode, QStringLiteral( "invertedMode" ) );
}

bool DbVoiceSuppressor::defaultBypassValue_helper() const
{

  return false;
}

double DbVoiceSuppressor::defaultInputGainValue_helper() const
{

  return 0;
}

double DbVoiceSuppressor::defaultOutputGainValue_helper() const
{

  return 0;
}

double DbVoiceSuppressor::defaultFreqStartValue_helper() const
{

  return 20;
}

double DbVoiceSuppressor::defaultFreqEndValue_helper() const
{

  return 22000;
}

double DbVoiceSuppressor::defaultCorrelationValue_helper() const
{

  return 95;
}

double DbVoiceSuppressor::defaultPhaseDifferenceValue_helper() const
{

  return 20;
}

double DbVoiceSuppressor::defaultMinKurtosisValue_helper() const
{

  return 1;
}

double DbVoiceSuppressor::defaultMaxInstFreqValue_helper() const
{

  return 1;
}

bool DbVoiceSuppressor::defaultInvertedModeValue_helper() const
{

  return false;
}

DbVoiceSuppressor::~DbVoiceSuppressor()
{
}


void DbVoiceSuppressor::itemChanged(quint64 signalFlag) {

  switch (signalFlag) {
  case signalBypassChanged:
    Q_EMIT bypassChanged();
    break;
  case signalInputGainChanged:
    Q_EMIT inputGainChanged();
    break;
  case signalOutputGainChanged:
    Q_EMIT outputGainChanged();
    break;
  case signalFreqStartChanged:
    Q_EMIT freqStartChanged();
    break;
  case signalFreqEndChanged:
    Q_EMIT freqEndChanged();
    break;
  case signalCorrelationChanged:
    Q_EMIT correlationChanged();
    break;
  case signalPhaseDifferenceChanged:
    Q_EMIT phaseDifferenceChanged();
    break;
  case signalMinKurtosisChanged:
    Q_EMIT minKurtosisChanged();
    break;
  case signalMaxInstFreqChanged:
    Q_EMIT maxInstFreqChanged();
    break;
  case signalInvertedModeChanged:
    Q_EMIT invertedModeChanged();
    break;
  }
}
