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

#include "easyeffects_db_crosstalk_canceller.h"

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

  KConfigGroup cgmasterGroup(this->config(), QStringLiteral( "%1" ).arg( mParammasterGroup ));
  KConfigGroup cgCrosstalkCancellerinstanceIndex = cgmasterGroup.group(QStringLiteral( "CrosstalkCanceller#%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(cgCrosstalkCancellerinstanceIndex);
  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(cgCrosstalkCancellerinstanceIndex);
  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(cgCrosstalkCancellerinstanceIndex);
  addItem( itemOutputGain, QStringLiteral( "outputGain" ) );
  KConfigCompilerSignallingItem  *itemPhantomCenterOnly;
  KConfigBaseEE::ItemBool  *innerItemPhantomCenterOnly;
  innerItemPhantomCenterOnly = new KConfigBaseEE::ItemBool( currentGroup(), QStringLiteral( "phantomCenterOnly" ), mPhantomCenterOnly, false );
  itemPhantomCenterOnly = new KConfigCompilerSignallingItem(innerItemPhantomCenterOnly, this, notifyFunction, signalPhantomCenterOnlyChanged);
  itemPhantomCenterOnly->setWriteFlags(KConfigBase::Notify);
  itemPhantomCenterOnly->setGroup(cgCrosstalkCancellerinstanceIndex);
  addItem( itemPhantomCenterOnly, QStringLiteral( "phantomCenterOnly" ) );
  KConfigCompilerSignallingItem  *itemDelayUs;
  KConfigBaseEE::ItemDouble  *innerItemDelayUs;
  innerItemDelayUs = new KConfigBaseEE::ItemDouble( currentGroup(), QStringLiteral( "delayUs" ), mDelayUs, 313 );
  itemDelayUs = new KConfigCompilerSignallingItem(innerItemDelayUs, this, notifyFunction, signalDelayUsChanged);
  innerItemDelayUs->setMinValue(200);
  innerItemDelayUs->setMaxValue(500);
  itemDelayUs->setWriteFlags(KConfigBase::Notify);
  itemDelayUs->setGroup(cgCrosstalkCancellerinstanceIndex);
  addItem( itemDelayUs, QStringLiteral( "delayUs" ) );
  KConfigCompilerSignallingItem  *itemDecayDb;
  KConfigBaseEE::ItemDouble  *innerItemDecayDb;
  innerItemDecayDb = new KConfigBaseEE::ItemDouble( currentGroup(), QStringLiteral( "decayDb" ), mDecayDb, -2 );
  itemDecayDb = new KConfigCompilerSignallingItem(innerItemDecayDb, this, notifyFunction, signalDecayDbChanged);
  innerItemDecayDb->setMinValue(-6);
  innerItemDecayDb->setMaxValue(0);
  itemDecayDb->setWriteFlags(KConfigBase::Notify);
  itemDecayDb->setGroup(cgCrosstalkCancellerinstanceIndex);
  addItem( itemDecayDb, QStringLiteral( "decayDb" ) );
}

bool DbCrosstalkCanceller::defaultBypassValue_helper() const
{

  return false;
}

double DbCrosstalkCanceller::defaultInputGainValue_helper() const
{

  return 0;
}

double DbCrosstalkCanceller::defaultOutputGainValue_helper() const
{

  return 0;
}

bool DbCrosstalkCanceller::defaultPhantomCenterOnlyValue_helper() const
{

  return false;
}

double DbCrosstalkCanceller::defaultDelayUsValue_helper() const
{

  return 313;
}

double DbCrosstalkCanceller::defaultDecayDbValue_helper() const
{

  return -2;
}

DbCrosstalkCanceller::~DbCrosstalkCanceller()
{
}


void DbCrosstalkCanceller::itemChanged(quint64 signalFlag) {

  switch (signalFlag) {
  case signalBypassChanged:
    Q_EMIT bypassChanged();
    break;
  case signalInputGainChanged:
    Q_EMIT inputGainChanged();
    break;
  case signalOutputGainChanged:
    Q_EMIT outputGainChanged();
    break;
  case signalPhantomCenterOnlyChanged:
    Q_EMIT phantomCenterOnlyChanged();
    break;
  case signalDelayUsChanged:
    Q_EMIT delayUsChanged();
    break;
  case signalDecayDbChanged:
    Q_EMIT decayDbChanged();
    break;
  }
}
