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

#include "easyeffects_db_bass_loudness.h"

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

  KConfigGroup cgmasterGroup(this->config(), QStringLiteral( "%1" ).arg( mParammasterGroup ));
  KConfigGroup cgBassLoudnessinstanceIndex = cgmasterGroup.group(QStringLiteral( "BassLoudness#%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(cgBassLoudnessinstanceIndex);
  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(cgBassLoudnessinstanceIndex);
  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(cgBassLoudnessinstanceIndex);
  addItem( itemOutputGain, QStringLiteral( "outputGain" ) );
  KConfigCompilerSignallingItem  *itemLoudness;
  KConfigBaseEE::ItemDouble  *innerItemLoudness;
  innerItemLoudness = new KConfigBaseEE::ItemDouble( currentGroup(), QStringLiteral( "loudness" ), mLoudness, -3.1 );
  itemLoudness = new KConfigCompilerSignallingItem(innerItemLoudness, this, notifyFunction, signalLoudnessChanged);
  innerItemLoudness->setMinValue(-100);
  innerItemLoudness->setMaxValue(0);
  itemLoudness->setWriteFlags(KConfigBase::Notify);
  itemLoudness->setGroup(cgBassLoudnessinstanceIndex);
  addItem( itemLoudness, QStringLiteral( "loudness" ) );
  KConfigCompilerSignallingItem  *itemOutput;
  KConfigBaseEE::ItemDouble  *innerItemOutput;
  innerItemOutput = new KConfigBaseEE::ItemDouble( currentGroup(), QStringLiteral( "output" ), mOutput, -6 );
  itemOutput = new KConfigCompilerSignallingItem(innerItemOutput, this, notifyFunction, signalOutputChanged);
  innerItemOutput->setMinValue(-100);
  innerItemOutput->setMaxValue(0);
  itemOutput->setWriteFlags(KConfigBase::Notify);
  itemOutput->setGroup(cgBassLoudnessinstanceIndex);
  addItem( itemOutput, QStringLiteral( "output" ) );
  KConfigCompilerSignallingItem  *itemLink;
  KConfigBaseEE::ItemDouble  *innerItemLink;
  innerItemLink = new KConfigBaseEE::ItemDouble( currentGroup(), QStringLiteral( "link" ), mLink, -9.1 );
  itemLink = new KConfigCompilerSignallingItem(innerItemLink, this, notifyFunction, signalLinkChanged);
  innerItemLink->setMinValue(-100);
  innerItemLink->setMaxValue(0);
  itemLink->setWriteFlags(KConfigBase::Notify);
  itemLink->setGroup(cgBassLoudnessinstanceIndex);
  addItem( itemLink, QStringLiteral( "link" ) );
}

bool DbBassLoudness::defaultBypassValue_helper() const
{

  return false;
}

double DbBassLoudness::defaultInputGainValue_helper() const
{

  return 0;
}

double DbBassLoudness::defaultOutputGainValue_helper() const
{

  return 0;
}

double DbBassLoudness::defaultLoudnessValue_helper() const
{

  return -3.1;
}

double DbBassLoudness::defaultOutputValue_helper() const
{

  return -6;
}

double DbBassLoudness::defaultLinkValue_helper() const
{

  return -9.1;
}

DbBassLoudness::~DbBassLoudness()
{
}


void DbBassLoudness::itemChanged(quint64 signalFlag) {

  switch (signalFlag) {
  case signalBypassChanged:
    Q_EMIT bypassChanged();
    break;
  case signalInputGainChanged:
    Q_EMIT inputGainChanged();
    break;
  case signalOutputGainChanged:
    Q_EMIT outputGainChanged();
    break;
  case signalLoudnessChanged:
    Q_EMIT loudnessChanged();
    break;
  case signalOutputChanged:
    Q_EMIT outputChanged();
    break;
  case signalLinkChanged:
    Q_EMIT linkChanged();
    break;
  }
}
