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

#include "easyeffects_db_loudness.h"

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

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

  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(cgLoudnessinstanceIndex);
  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(cgLoudnessinstanceIndex);
  addItem( itemMode, QStringLiteral( "mode" ) );
  QStringList defaultfftLabels;
  defaultfftLabels.append( QString::fromUtf8( "256" ) );
  defaultfftLabels.append( QString::fromUtf8( "512" ) );
  defaultfftLabels.append( QString::fromUtf8( "1024" ) );
  defaultfftLabels.append( QString::fromUtf8( "2048" ) );
  defaultfftLabels.append( QString::fromUtf8( "4096" ) );
  defaultfftLabels.append( QString::fromUtf8( "8192" ) );
  defaultfftLabels.append( QString::fromUtf8( "16384" ) );

  KConfigCompilerSignallingItem  *itemFftLabels;
  KConfigBaseEE::ItemStringList  *innerItemFftLabels;
  innerItemFftLabels = new KConfigBaseEE::ItemStringList( currentGroup(), QStringLiteral( "fftLabels" ), mFftLabels, defaultfftLabels );
  itemFftLabels = new KConfigCompilerSignallingItem(innerItemFftLabels, this, notifyFunction, signalFftLabelsChanged);
  itemFftLabels->setWriteFlags(KConfigBase::Notify);
  itemFftLabels->setGroup(cgLoudnessinstanceIndex);
  addItem( itemFftLabels, QStringLiteral( "fftLabels" ) );
  KConfigCompilerSignallingItem  *itemFft;
  KConfigBaseEE::ItemInt  *innerItemFft;
  innerItemFft = new KConfigBaseEE::ItemInt( currentGroup(), QStringLiteral( "fft" ), mFft, 4 );
  itemFft = new KConfigCompilerSignallingItem(innerItemFft, this, notifyFunction, signalFftChanged);
  itemFft->setWriteFlags(KConfigBase::Notify);
  itemFft->setGroup(cgLoudnessinstanceIndex);
  addItem( itemFft, QStringLiteral( "fft" ) );
  QStringList defaultstdLabels;
  defaultstdLabels.append( QString::fromUtf8( "Flat" ) );
  defaultstdLabels.append( QString::fromUtf8( "ISO226-2003" ) );
  defaultstdLabels.append( QString::fromUtf8( "Fletcher-Munson" ) );
  defaultstdLabels.append( QString::fromUtf8( "Robinson-Dadson" ) );
  defaultstdLabels.append( QString::fromUtf8( "ISO226-2023" ) );

  KConfigCompilerSignallingItem  *itemStdLabels;
  KConfigBaseEE::ItemStringList  *innerItemStdLabels;
  innerItemStdLabels = new KConfigBaseEE::ItemStringList( currentGroup(), QStringLiteral( "stdLabels" ), mStdLabels, defaultstdLabels );
  itemStdLabels = new KConfigCompilerSignallingItem(innerItemStdLabels, this, notifyFunction, signalStdLabelsChanged);
  itemStdLabels->setWriteFlags(KConfigBase::Notify);
  itemStdLabels->setGroup(cgLoudnessinstanceIndex);
  addItem( itemStdLabels, QStringLiteral( "stdLabels" ) );
  KConfigCompilerSignallingItem  *itemStd;
  KConfigBaseEE::ItemInt  *innerItemStd;
  innerItemStd = new KConfigBaseEE::ItemInt( currentGroup(), QStringLiteral( "std" ), mStd, 4 );
  itemStd = new KConfigCompilerSignallingItem(innerItemStd, this, notifyFunction, signalStdChanged);
  itemStd->setWriteFlags(KConfigBase::Notify);
  itemStd->setGroup(cgLoudnessinstanceIndex);
  addItem( itemStd, QStringLiteral( "std" ) );
  KConfigCompilerSignallingItem  *itemVolume;
  KConfigBaseEE::ItemDouble  *innerItemVolume;
  innerItemVolume = new KConfigBaseEE::ItemDouble( currentGroup(), QStringLiteral( "volume" ), mVolume, 0 );
  itemVolume = new KConfigCompilerSignallingItem(innerItemVolume, this, notifyFunction, signalVolumeChanged);
  innerItemVolume->setMinValue(-83);
  innerItemVolume->setMaxValue(7);
  itemVolume->setWriteFlags(KConfigBase::Notify);
  itemVolume->setGroup(cgLoudnessinstanceIndex);
  addItem( itemVolume, QStringLiteral( "volume" ) );
  KConfigCompilerSignallingItem  *itemClipping;
  KConfigBaseEE::ItemBool  *innerItemClipping;
  innerItemClipping = new KConfigBaseEE::ItemBool( currentGroup(), QStringLiteral( "clipping" ), mClipping, false );
  itemClipping = new KConfigCompilerSignallingItem(innerItemClipping, this, notifyFunction, signalClippingChanged);
  itemClipping->setWriteFlags(KConfigBase::Notify);
  itemClipping->setGroup(cgLoudnessinstanceIndex);
  addItem( itemClipping, QStringLiteral( "clipping" ) );
  KConfigCompilerSignallingItem  *itemClippingRange;
  KConfigBaseEE::ItemDouble  *innerItemClippingRange;
  innerItemClippingRange = new KConfigBaseEE::ItemDouble( currentGroup(), QStringLiteral( "clippingRange" ), mClippingRange, 6 );
  itemClippingRange = new KConfigCompilerSignallingItem(innerItemClippingRange, this, notifyFunction, signalClippingRangeChanged);
  innerItemClippingRange->setMinValue(0);
  innerItemClippingRange->setMaxValue(24);
  itemClippingRange->setWriteFlags(KConfigBase::Notify);
  itemClippingRange->setGroup(cgLoudnessinstanceIndex);
  addItem( itemClippingRange, QStringLiteral( "clippingRange" ) );
  QStringList defaultiirApproximationLabels;
  defaultiirApproximationLabels.append( QString::fromUtf8( "Fastest" ) );
  defaultiirApproximationLabels.append( QString::fromUtf8( "Low" ) );
  defaultiirApproximationLabels.append( QString::fromUtf8( "Normal" ) );
  defaultiirApproximationLabels.append( QString::fromUtf8( "High" ) );
  defaultiirApproximationLabels.append( QString::fromUtf8( "Best" ) );

  KConfigCompilerSignallingItem  *itemIirApproximationLabels;
  KConfigBaseEE::ItemStringList  *innerItemIirApproximationLabels;
  innerItemIirApproximationLabels = new KConfigBaseEE::ItemStringList( currentGroup(), QStringLiteral( "iirApproximationLabels" ), mIirApproximationLabels, defaultiirApproximationLabels );
  itemIirApproximationLabels = new KConfigCompilerSignallingItem(innerItemIirApproximationLabels, this, notifyFunction, signalIirApproximationLabelsChanged);
  itemIirApproximationLabels->setWriteFlags(KConfigBase::Notify);
  itemIirApproximationLabels->setGroup(cgLoudnessinstanceIndex);
  addItem( itemIirApproximationLabels, QStringLiteral( "iirApproximationLabels" ) );
  KConfigCompilerSignallingItem  *itemIirApproximation;
  KConfigBaseEE::ItemInt  *innerItemIirApproximation;
  innerItemIirApproximation = new KConfigBaseEE::ItemInt( currentGroup(), QStringLiteral( "iirApproximation" ), mIirApproximation, 2 );
  itemIirApproximation = new KConfigCompilerSignallingItem(innerItemIirApproximation, this, notifyFunction, signalIirApproximationChanged);
  itemIirApproximation->setWriteFlags(KConfigBase::Notify);
  itemIirApproximation->setGroup(cgLoudnessinstanceIndex);
  addItem( itemIirApproximation, QStringLiteral( "iirApproximation" ) );
}

bool DbLoudness::defaultBypassValue_helper() const
{

  return false;
}

double DbLoudness::defaultInputGainValue_helper() const
{

  return 0;
}

double DbLoudness::defaultOutputGainValue_helper() const
{

  return 0;
}

QStringList DbLoudness::defaultModeLabelsValue_helper() const
{
  QStringList defaultmodeLabels;
  defaultmodeLabels.append( QString::fromUtf8( "FFT" ) );
  defaultmodeLabels.append( QString::fromUtf8( "IIR" ) );

  return defaultmodeLabels;
}

int DbLoudness::defaultModeValue_helper() const
{

  return 0;
}

QStringList DbLoudness::defaultFftLabelsValue_helper() const
{
  QStringList defaultfftLabels;
  defaultfftLabels.append( QString::fromUtf8( "256" ) );
  defaultfftLabels.append( QString::fromUtf8( "512" ) );
  defaultfftLabels.append( QString::fromUtf8( "1024" ) );
  defaultfftLabels.append( QString::fromUtf8( "2048" ) );
  defaultfftLabels.append( QString::fromUtf8( "4096" ) );
  defaultfftLabels.append( QString::fromUtf8( "8192" ) );
  defaultfftLabels.append( QString::fromUtf8( "16384" ) );

  return defaultfftLabels;
}

int DbLoudness::defaultFftValue_helper() const
{

  return 4;
}

QStringList DbLoudness::defaultStdLabelsValue_helper() const
{
  QStringList defaultstdLabels;
  defaultstdLabels.append( QString::fromUtf8( "Flat" ) );
  defaultstdLabels.append( QString::fromUtf8( "ISO226-2003" ) );
  defaultstdLabels.append( QString::fromUtf8( "Fletcher-Munson" ) );
  defaultstdLabels.append( QString::fromUtf8( "Robinson-Dadson" ) );
  defaultstdLabels.append( QString::fromUtf8( "ISO226-2023" ) );

  return defaultstdLabels;
}

int DbLoudness::defaultStdValue_helper() const
{

  return 4;
}

double DbLoudness::defaultVolumeValue_helper() const
{

  return 0;
}

bool DbLoudness::defaultClippingValue_helper() const
{

  return false;
}

double DbLoudness::defaultClippingRangeValue_helper() const
{

  return 6;
}

QStringList DbLoudness::defaultIirApproximationLabelsValue_helper() const
{
  QStringList defaultiirApproximationLabels;
  defaultiirApproximationLabels.append( QString::fromUtf8( "Fastest" ) );
  defaultiirApproximationLabels.append( QString::fromUtf8( "Low" ) );
  defaultiirApproximationLabels.append( QString::fromUtf8( "Normal" ) );
  defaultiirApproximationLabels.append( QString::fromUtf8( "High" ) );
  defaultiirApproximationLabels.append( QString::fromUtf8( "Best" ) );

  return defaultiirApproximationLabels;
}

int DbLoudness::defaultIirApproximationValue_helper() const
{

  return 2;
}

DbLoudness::~DbLoudness()
{
}


void DbLoudness::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 signalFftLabelsChanged:
    Q_EMIT fftLabelsChanged();
    break;
  case signalFftChanged:
    Q_EMIT fftChanged();
    break;
  case signalStdLabelsChanged:
    Q_EMIT stdLabelsChanged();
    break;
  case signalStdChanged:
    Q_EMIT stdChanged();
    break;
  case signalVolumeChanged:
    Q_EMIT volumeChanged();
    break;
  case signalClippingChanged:
    Q_EMIT clippingChanged();
    break;
  case signalClippingRangeChanged:
    Q_EMIT clippingRangeChanged();
    break;
  case signalIirApproximationLabelsChanged:
    Q_EMIT iirApproximationLabelsChanged();
    break;
  case signalIirApproximationChanged:
    Q_EMIT iirApproximationChanged();
    break;
  }
}
