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

#include "easyeffects_db_rnnoise.h"

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

  KConfigGroup cgmasterGroup(this->config(), QStringLiteral( "%1" ).arg( mParammasterGroup ));
  KConfigGroup cgRNNoiseinstanceIndex = cgmasterGroup.group(QStringLiteral( "RNNoise#%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(cgRNNoiseinstanceIndex);
  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(cgRNNoiseinstanceIndex);
  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(cgRNNoiseinstanceIndex);
  addItem( itemOutputGain, QStringLiteral( "outputGain" ) );
  KConfigCompilerSignallingItem  *itemModelName;
  KConfigBaseEE::ItemString  *innerItemModelName;
  innerItemModelName = new KConfigBaseEE::ItemString( currentGroup(), QStringLiteral( "modelName" ), mModelName, QStringLiteral( "\"\"" ) );
  itemModelName = new KConfigCompilerSignallingItem(innerItemModelName, this, notifyFunction, signalModelNameChanged);
  itemModelName->setWriteFlags(KConfigBase::Notify);
  itemModelName->setGroup(cgRNNoiseinstanceIndex);
  addItem( itemModelName, QStringLiteral( "modelName" ) );
  KConfigCompilerSignallingItem  *itemUseStandardModel;
  KConfigBaseEE::ItemBool  *innerItemUseStandardModel;
  innerItemUseStandardModel = new KConfigBaseEE::ItemBool( currentGroup(), QStringLiteral( "useStandardModel" ), mUseStandardModel, true );
  itemUseStandardModel = new KConfigCompilerSignallingItem(innerItemUseStandardModel, this, notifyFunction, signalUseStandardModelChanged);
  itemUseStandardModel->setWriteFlags(KConfigBase::Notify);
  itemUseStandardModel->setGroup(cgRNNoiseinstanceIndex);
  addItem( itemUseStandardModel, QStringLiteral( "useStandardModel" ) );
  KConfigCompilerSignallingItem  *itemEnableVad;
  KConfigBaseEE::ItemBool  *innerItemEnableVad;
  innerItemEnableVad = new KConfigBaseEE::ItemBool( currentGroup(), QStringLiteral( "enableVad" ), mEnableVad, false );
  itemEnableVad = new KConfigCompilerSignallingItem(innerItemEnableVad, this, notifyFunction, signalEnableVadChanged);
  itemEnableVad->setWriteFlags(KConfigBase::Notify);
  itemEnableVad->setGroup(cgRNNoiseinstanceIndex);
  addItem( itemEnableVad, QStringLiteral( "enableVad" ) );
  KConfigCompilerSignallingItem  *itemVadThres;
  KConfigBaseEE::ItemDouble  *innerItemVadThres;
  innerItemVadThres = new KConfigBaseEE::ItemDouble( currentGroup(), QStringLiteral( "vadThres" ), mVadThres, 50 );
  itemVadThres = new KConfigCompilerSignallingItem(innerItemVadThres, this, notifyFunction, signalVadThresChanged);
  innerItemVadThres->setMinValue(0);
  innerItemVadThres->setMaxValue(100);
  itemVadThres->setWriteFlags(KConfigBase::Notify);
  itemVadThres->setGroup(cgRNNoiseinstanceIndex);
  addItem( itemVadThres, QStringLiteral( "vadThres" ) );
  KConfigCompilerSignallingItem  *itemWet;
  KConfigBaseEE::ItemDouble  *innerItemWet;
  innerItemWet = new KConfigBaseEE::ItemDouble( currentGroup(), QStringLiteral( "wet" ), mWet, 0.0 );
  itemWet = new KConfigCompilerSignallingItem(innerItemWet, this, notifyFunction, signalWetChanged);
  innerItemWet->setMinValue(-100);
  innerItemWet->setMaxValue(20);
  itemWet->setWriteFlags(KConfigBase::Notify);
  itemWet->setGroup(cgRNNoiseinstanceIndex);
  addItem( itemWet, QStringLiteral( "wet" ) );
  KConfigCompilerSignallingItem  *itemRelease;
  KConfigBaseEE::ItemDouble  *innerItemRelease;
  innerItemRelease = new KConfigBaseEE::ItemDouble( currentGroup(), QStringLiteral( "release" ), mRelease, 20.0 );
  itemRelease = new KConfigCompilerSignallingItem(innerItemRelease, this, notifyFunction, signalReleaseChanged);
  innerItemRelease->setMinValue(0);
  innerItemRelease->setMaxValue(20000);
  itemRelease->setWriteFlags(KConfigBase::Notify);
  itemRelease->setGroup(cgRNNoiseinstanceIndex);
  addItem( itemRelease, QStringLiteral( "release" ) );
}

bool DbRNNoise::defaultBypassValue_helper() const
{

  return false;
}

double DbRNNoise::defaultInputGainValue_helper() const
{

  return 0;
}

double DbRNNoise::defaultOutputGainValue_helper() const
{

  return 0;
}

QString DbRNNoise::defaultModelNameValue_helper() const
{

  return QStringLiteral( "\"\"" );
}

bool DbRNNoise::defaultUseStandardModelValue_helper() const
{

  return true;
}

bool DbRNNoise::defaultEnableVadValue_helper() const
{

  return false;
}

double DbRNNoise::defaultVadThresValue_helper() const
{

  return 50;
}

double DbRNNoise::defaultWetValue_helper() const
{

  return 0.0;
}

double DbRNNoise::defaultReleaseValue_helper() const
{

  return 20.0;
}

DbRNNoise::~DbRNNoise()
{
}


void DbRNNoise::itemChanged(quint64 signalFlag) {

  switch (signalFlag) {
  case signalBypassChanged:
    Q_EMIT bypassChanged();
    break;
  case signalInputGainChanged:
    Q_EMIT inputGainChanged();
    break;
  case signalOutputGainChanged:
    Q_EMIT outputGainChanged();
    break;
  case signalModelNameChanged:
    Q_EMIT modelNameChanged();
    break;
  case signalUseStandardModelChanged:
    Q_EMIT useStandardModelChanged();
    break;
  case signalEnableVadChanged:
    Q_EMIT enableVadChanged();
    break;
  case signalVadThresChanged:
    Q_EMIT vadThresChanged();
    break;
  case signalWetChanged:
    Q_EMIT wetChanged();
    break;
  case signalReleaseChanged:
    Q_EMIT releaseChanged();
    break;
  }
}
