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

#include "easyeffects_db_crossfeed.h"

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

  KConfigGroup cgmasterGroup(this->config(), QStringLiteral( "%1" ).arg( mParammasterGroup ));
  KConfigGroup cgCrossfeedinstanceIndex = cgmasterGroup.group(QStringLiteral( "Crossfeed#%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(cgCrossfeedinstanceIndex);
  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(cgCrossfeedinstanceIndex);
  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(cgCrossfeedinstanceIndex);
  addItem( itemOutputGain, QStringLiteral( "outputGain" ) );
  KConfigCompilerSignallingItem  *itemFcut;
  KConfigBaseEE::ItemInt  *innerItemFcut;
  innerItemFcut = new KConfigBaseEE::ItemInt( currentGroup(), QStringLiteral( "fcut" ), mFcut, 700 );
  itemFcut = new KConfigCompilerSignallingItem(innerItemFcut, this, notifyFunction, signalFcutChanged);
  innerItemFcut->setMinValue(300);
  innerItemFcut->setMaxValue(2000);
  itemFcut->setWriteFlags(KConfigBase::Notify);
  itemFcut->setGroup(cgCrossfeedinstanceIndex);
  addItem( itemFcut, QStringLiteral( "fcut" ) );
  KConfigCompilerSignallingItem  *itemFeed;
  KConfigBaseEE::ItemDouble  *innerItemFeed;
  innerItemFeed = new KConfigBaseEE::ItemDouble( currentGroup(), QStringLiteral( "feed" ), mFeed, 4.5 );
  itemFeed = new KConfigCompilerSignallingItem(innerItemFeed, this, notifyFunction, signalFeedChanged);
  innerItemFeed->setMinValue(1);
  innerItemFeed->setMaxValue(15);
  itemFeed->setWriteFlags(KConfigBase::Notify);
  itemFeed->setGroup(cgCrossfeedinstanceIndex);
  addItem( itemFeed, QStringLiteral( "feed" ) );
}

bool DbCrossfeed::defaultBypassValue_helper() const
{

  return false;
}

double DbCrossfeed::defaultInputGainValue_helper() const
{

  return 0;
}

double DbCrossfeed::defaultOutputGainValue_helper() const
{

  return 0;
}

int DbCrossfeed::defaultFcutValue_helper() const
{

  return 700;
}

double DbCrossfeed::defaultFeedValue_helper() const
{

  return 4.5;
}

DbCrossfeed::~DbCrossfeed()
{
}


void DbCrossfeed::itemChanged(quint64 signalFlag) {

  switch (signalFlag) {
  case signalBypassChanged:
    Q_EMIT bypassChanged();
    break;
  case signalInputGainChanged:
    Q_EMIT inputGainChanged();
    break;
  case signalOutputGainChanged:
    Q_EMIT outputGainChanged();
    break;
  case signalFcutChanged:
    Q_EMIT fcutChanged();
    break;
  case signalFeedChanged:
    Q_EMIT feedChanged();
    break;
  }
}
