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

#include "easyeffects_db_crusher.h"

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

  KConfigGroup cgmasterGroup(this->config(), QStringLiteral( "%1" ).arg( mParammasterGroup ));
  KConfigGroup cgCrusherinstanceIndex = cgmasterGroup.group(QStringLiteral( "Crusher#%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(cgCrusherinstanceIndex);
  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(cgCrusherinstanceIndex);
  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(cgCrusherinstanceIndex);
  addItem( itemOutputGain, QStringLiteral( "outputGain" ) );
  QStringList defaultmodeLabels;
  defaultmodeLabels.append( QString::fromUtf8( "Linear" ) );
  defaultmodeLabels.append( QString::fromUtf8( "Logarithmic" ) );

  KConfigCompilerSignallingItem  *itemModeLabels;
  KConfigBaseEE::ItemStringList  *innerItemModeLabels;
  innerItemModeLabels = new KConfigBaseEE::ItemStringList( currentGroup(), QStringLiteral( "modeLabels" ), mModeLabels, defaultmodeLabels );
  itemModeLabels = new KConfigCompilerSignallingItem(innerItemModeLabels, this, notifyFunction, signalModeLabelsChanged);
  itemModeLabels->setWriteFlags(KConfigBase::Notify);
  itemModeLabels->setGroup(cgCrusherinstanceIndex);
  addItem( itemModeLabels, QStringLiteral( "modeLabels" ) );
  KConfigCompilerSignallingItem  *itemMode;
  KConfigBaseEE::ItemInt  *innerItemMode;
  innerItemMode = new KConfigBaseEE::ItemInt( currentGroup(), QStringLiteral( "mode" ), mMode, 0 );
  itemMode = new KConfigCompilerSignallingItem(innerItemMode, this, notifyFunction, signalModeChanged);
  itemMode->setWriteFlags(KConfigBase::Notify);
  itemMode->setGroup(cgCrusherinstanceIndex);
  addItem( itemMode, QStringLiteral( "mode" ) );
  KConfigCompilerSignallingItem  *itemBitReduction;
  KConfigBaseEE::ItemDouble  *innerItemBitReduction;
  innerItemBitReduction = new KConfigBaseEE::ItemDouble( currentGroup(), QStringLiteral( "bitReduction" ), mBitReduction, 4.0 );
  itemBitReduction = new KConfigCompilerSignallingItem(innerItemBitReduction, this, notifyFunction, signalBitReductionChanged);
  innerItemBitReduction->setMinValue(1.0);
  innerItemBitReduction->setMaxValue(16.0);
  itemBitReduction->setWriteFlags(KConfigBase::Notify);
  itemBitReduction->setGroup(cgCrusherinstanceIndex);
  addItem( itemBitReduction, QStringLiteral( "bitReduction" ) );
  KConfigCompilerSignallingItem  *itemMorph;
  KConfigBaseEE::ItemDouble  *innerItemMorph;
  innerItemMorph = new KConfigBaseEE::ItemDouble( currentGroup(), QStringLiteral( "morph" ), mMorph, 0.5 );
  itemMorph = new KConfigCompilerSignallingItem(innerItemMorph, this, notifyFunction, signalMorphChanged);
  innerItemMorph->setMinValue(0);
  innerItemMorph->setMaxValue(1);
  itemMorph->setWriteFlags(KConfigBase::Notify);
  itemMorph->setGroup(cgCrusherinstanceIndex);
  addItem( itemMorph, QStringLiteral( "morph" ) );
  KConfigCompilerSignallingItem  *itemDc;
  KConfigBaseEE::ItemDouble  *innerItemDc;
  innerItemDc = new KConfigBaseEE::ItemDouble( currentGroup(), QStringLiteral( "dc" ), mDc, 0 );
  itemDc = new KConfigCompilerSignallingItem(innerItemDc, this, notifyFunction, signalDcChanged);
  innerItemDc->setMinValue(-12.041);
  innerItemDc->setMaxValue(12.041);
  itemDc->setWriteFlags(KConfigBase::Notify);
  itemDc->setGroup(cgCrusherinstanceIndex);
  addItem( itemDc, QStringLiteral( "dc" ) );
  KConfigCompilerSignallingItem  *itemAntiAliasing;
  KConfigBaseEE::ItemDouble  *innerItemAntiAliasing;
  innerItemAntiAliasing = new KConfigBaseEE::ItemDouble( currentGroup(), QStringLiteral( "antiAliasing" ), mAntiAliasing, 0.5 );
  itemAntiAliasing = new KConfigCompilerSignallingItem(innerItemAntiAliasing, this, notifyFunction, signalAntiAliasingChanged);
  innerItemAntiAliasing->setMinValue(0);
  innerItemAntiAliasing->setMaxValue(1);
  itemAntiAliasing->setWriteFlags(KConfigBase::Notify);
  itemAntiAliasing->setGroup(cgCrusherinstanceIndex);
  addItem( itemAntiAliasing, QStringLiteral( "antiAliasing" ) );
  KConfigCompilerSignallingItem  *itemSampleReduction;
  KConfigBaseEE::ItemInt  *innerItemSampleReduction;
  innerItemSampleReduction = new KConfigBaseEE::ItemInt( currentGroup(), QStringLiteral( "sampleReduction" ), mSampleReduction, 1 );
  itemSampleReduction = new KConfigCompilerSignallingItem(innerItemSampleReduction, this, notifyFunction, signalSampleReductionChanged);
  innerItemSampleReduction->setMinValue(1);
  innerItemSampleReduction->setMaxValue(250);
  itemSampleReduction->setWriteFlags(KConfigBase::Notify);
  itemSampleReduction->setGroup(cgCrusherinstanceIndex);
  addItem( itemSampleReduction, QStringLiteral( "sampleReduction" ) );
  KConfigCompilerSignallingItem  *itemLfoActive;
  KConfigBaseEE::ItemBool  *innerItemLfoActive;
  innerItemLfoActive = new KConfigBaseEE::ItemBool( currentGroup(), QStringLiteral( "lfoActive" ), mLfoActive, false );
  itemLfoActive = new KConfigCompilerSignallingItem(innerItemLfoActive, this, notifyFunction, signalLfoActiveChanged);
  itemLfoActive->setWriteFlags(KConfigBase::Notify);
  itemLfoActive->setGroup(cgCrusherinstanceIndex);
  addItem( itemLfoActive, QStringLiteral( "lfoActive" ) );
  KConfigCompilerSignallingItem  *itemLfoRange;
  KConfigBaseEE::ItemInt  *innerItemLfoRange;
  innerItemLfoRange = new KConfigBaseEE::ItemInt( currentGroup(), QStringLiteral( "lfoRange" ), mLfoRange, 20 );
  itemLfoRange = new KConfigCompilerSignallingItem(innerItemLfoRange, this, notifyFunction, signalLfoRangeChanged);
  innerItemLfoRange->setMinValue(1);
  innerItemLfoRange->setMaxValue(250);
  itemLfoRange->setWriteFlags(KConfigBase::Notify);
  itemLfoRange->setGroup(cgCrusherinstanceIndex);
  addItem( itemLfoRange, QStringLiteral( "lfoRange" ) );
  KConfigCompilerSignallingItem  *itemLfoRate;
  KConfigBaseEE::ItemDouble  *innerItemLfoRate;
  innerItemLfoRate = new KConfigBaseEE::ItemDouble( currentGroup(), QStringLiteral( "lfoRate" ), mLfoRate, 0.3 );
  itemLfoRate = new KConfigCompilerSignallingItem(innerItemLfoRate, this, notifyFunction, signalLfoRateChanged);
  innerItemLfoRate->setMinValue(0.01);
  innerItemLfoRate->setMaxValue(200);
  itemLfoRate->setWriteFlags(KConfigBase::Notify);
  itemLfoRate->setGroup(cgCrusherinstanceIndex);
  addItem( itemLfoRate, QStringLiteral( "lfoRate" ) );
}

bool DbCrusher::defaultBypassValue_helper() const
{

  return false;
}

double DbCrusher::defaultInputGainValue_helper() const
{

  return 0;
}

double DbCrusher::defaultOutputGainValue_helper() const
{

  return 0;
}

QStringList DbCrusher::defaultModeLabelsValue_helper() const
{
  QStringList defaultmodeLabels;
  defaultmodeLabels.append( QString::fromUtf8( "Linear" ) );
  defaultmodeLabels.append( QString::fromUtf8( "Logarithmic" ) );

  return defaultmodeLabels;
}

int DbCrusher::defaultModeValue_helper() const
{

  return 0;
}

double DbCrusher::defaultBitReductionValue_helper() const
{

  return 4.0;
}

double DbCrusher::defaultMorphValue_helper() const
{

  return 0.5;
}

double DbCrusher::defaultDcValue_helper() const
{

  return 0;
}

double DbCrusher::defaultAntiAliasingValue_helper() const
{

  return 0.5;
}

int DbCrusher::defaultSampleReductionValue_helper() const
{

  return 1;
}

bool DbCrusher::defaultLfoActiveValue_helper() const
{

  return false;
}

int DbCrusher::defaultLfoRangeValue_helper() const
{

  return 20;
}

double DbCrusher::defaultLfoRateValue_helper() const
{

  return 0.3;
}

DbCrusher::~DbCrusher()
{
}


void DbCrusher::itemChanged(quint64 signalFlag) {

  switch (signalFlag) {
  case signalBypassChanged:
    Q_EMIT bypassChanged();
    break;
  case signalInputGainChanged:
    Q_EMIT inputGainChanged();
    break;
  case signalOutputGainChanged:
    Q_EMIT outputGainChanged();
    break;
  case signalModeLabelsChanged:
    Q_EMIT modeLabelsChanged();
    break;
  case signalModeChanged:
    Q_EMIT modeChanged();
    break;
  case signalBitReductionChanged:
    Q_EMIT bitReductionChanged();
    break;
  case signalMorphChanged:
    Q_EMIT morphChanged();
    break;
  case signalDcChanged:
    Q_EMIT dcChanged();
    break;
  case signalAntiAliasingChanged:
    Q_EMIT antiAliasingChanged();
    break;
  case signalSampleReductionChanged:
    Q_EMIT sampleReductionChanged();
    break;
  case signalLfoActiveChanged:
    Q_EMIT lfoActiveChanged();
    break;
  case signalLfoRangeChanged:
    Q_EMIT lfoRangeChanged();
    break;
  case signalLfoRateChanged:
    Q_EMIT lfoRateChanged();
    break;
  }
}
