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

#include "easyeffects_db_streaminputs.h"

#include <qglobal.h>
#include <QFile>
#include <QQmlEngine>

class DbStreamInputsHelper
{
  public:
    DbStreamInputsHelper() noexcept : q(nullptr) {}
    ~DbStreamInputsHelper() noexcept { delete q; q = nullptr; }
    DbStreamInputsHelper(const DbStreamInputsHelper&) = delete;
    DbStreamInputsHelper& operator=(const DbStreamInputsHelper&) = delete;
    DbStreamInputs *q;
};
Q_GLOBAL_STATIC(DbStreamInputsHelper, s_globalDbStreamInputs)
DbStreamInputs *DbStreamInputs::self()
{
  if (!s_globalDbStreamInputs()->q) {
    new DbStreamInputs;
    s_globalDbStreamInputs()->q->read();
  }

  return s_globalDbStreamInputs()->q;
}

DbStreamInputs *DbStreamInputs::create(QQmlEngine *, QJSEngine *)
{
  QQmlEngine::setObjectOwnership(self(), QQmlEngine::CppOwnership);
  return self();
}

DbStreamInputs::DbStreamInputs( )
  : KConfigBaseEE( QStringLiteral( "easyeffects/db/easyeffectsrc" ) )
{
  Q_ASSERT(!s_globalDbStreamInputs()->q);
  s_globalDbStreamInputs()->q = this;
  KConfigCompilerSignallingItem::NotifyFunction notifyFunction = static_cast<KConfigCompilerSignallingItem::NotifyFunction>(&DbStreamInputs::itemChanged);

  setCurrentGroup( QStringLiteral( "StreamInputs" ) );

  KConfigCompilerSignallingItem  *itemPlugins;
  KConfigBaseEE::ItemStringList  *innerItemPlugins;
  innerItemPlugins = new KConfigBaseEE::ItemStringList( currentGroup(), QStringLiteral( "plugins" ), mPlugins );
  itemPlugins = new KConfigCompilerSignallingItem(innerItemPlugins, this, notifyFunction, signalPluginsChanged);
  itemPlugins->setWriteFlags(KConfigBase::Notify);
  addItem( itemPlugins, QStringLiteral( "plugins" ) );
  KConfigCompilerSignallingItem  *itemUseDefaultInputDevice;
  KConfigBaseEE::ItemBool  *innerItemUseDefaultInputDevice;
  innerItemUseDefaultInputDevice = new KConfigBaseEE::ItemBool( currentGroup(), QStringLiteral( "useDefaultInputDevice" ), mUseDefaultInputDevice, true );
  itemUseDefaultInputDevice = new KConfigCompilerSignallingItem(innerItemUseDefaultInputDevice, this, notifyFunction, signalUseDefaultInputDeviceChanged);
  itemUseDefaultInputDevice->setWriteFlags(KConfigBase::Notify);
  addItem( itemUseDefaultInputDevice, QStringLiteral( "useDefaultInputDevice" ) );
  KConfigCompilerSignallingItem  *itemInputDevice;
  KConfigBaseEE::ItemString  *innerItemInputDevice;
  innerItemInputDevice = new KConfigBaseEE::ItemString( currentGroup(), QStringLiteral( "inputDevice" ), mInputDevice, "" );
  itemInputDevice = new KConfigCompilerSignallingItem(innerItemInputDevice, this, notifyFunction, signalInputDeviceChanged);
  itemInputDevice->setWriteFlags(KConfigBase::Notify);
  addItem( itemInputDevice, QStringLiteral( "inputDevice" ) );
  KConfigCompilerSignallingItem  *itemBlocklist;
  KConfigBaseEE::ItemStringList  *innerItemBlocklist;
  innerItemBlocklist = new KConfigBaseEE::ItemStringList( currentGroup(), QStringLiteral( "blocklist" ), mBlocklist );
  itemBlocklist = new KConfigCompilerSignallingItem(innerItemBlocklist, this, notifyFunction, signalBlocklistChanged);
  itemBlocklist->setWriteFlags(KConfigBase::Notify);
  addItem( itemBlocklist, QStringLiteral( "blocklist" ) );
  KConfigCompilerSignallingItem  *itemShowBlocklistedApps;
  KConfigBaseEE::ItemBool  *innerItemShowBlocklistedApps;
  innerItemShowBlocklistedApps = new KConfigBaseEE::ItemBool( currentGroup(), QStringLiteral( "showBlocklistedApps" ), mShowBlocklistedApps, false );
  itemShowBlocklistedApps = new KConfigCompilerSignallingItem(innerItemShowBlocklistedApps, this, notifyFunction, signalShowBlocklistedAppsChanged);
  itemShowBlocklistedApps->setWriteFlags(KConfigBase::Notify);
  addItem( itemShowBlocklistedApps, QStringLiteral( "showBlocklistedApps" ) );
  KConfigCompilerSignallingItem  *itemBlocklistUsesMediaName;
  KConfigBaseEE::ItemBool  *innerItemBlocklistUsesMediaName;
  innerItemBlocklistUsesMediaName = new KConfigBaseEE::ItemBool( currentGroup(), QStringLiteral( "blocklistUsesMediaName" ), mBlocklistUsesMediaName, false );
  itemBlocklistUsesMediaName = new KConfigCompilerSignallingItem(innerItemBlocklistUsesMediaName, this, notifyFunction, signalBlocklistUsesMediaNameChanged);
  itemBlocklistUsesMediaName->setWriteFlags(KConfigBase::Notify);
  addItem( itemBlocklistUsesMediaName, QStringLiteral( "blocklistUsesMediaName" ) );
  KConfigCompilerSignallingItem  *itemShowPluginsList;
  KConfigBaseEE::ItemBool  *innerItemShowPluginsList;
  innerItemShowPluginsList = new KConfigBaseEE::ItemBool( currentGroup(), QStringLiteral( "showPluginsList" ), mShowPluginsList, true );
  itemShowPluginsList = new KConfigCompilerSignallingItem(innerItemShowPluginsList, this, notifyFunction, signalShowPluginsListChanged);
  itemShowPluginsList->setWriteFlags(KConfigBase::Notify);
  addItem( itemShowPluginsList, QStringLiteral( "showPluginsList" ) );
  QList<KConfigBaseEE::ItemEnum::Choice> valuesvisiblePage;
  {
    KConfigBaseEE::ItemEnum::Choice choice;
    choice.name = QStringLiteral("streamsPage");
    valuesvisiblePage.append( choice );
  }
  {
    KConfigBaseEE::ItemEnum::Choice choice;
    choice.name = QStringLiteral("pluginsPage");
    valuesvisiblePage.append( choice );
  }
  KConfigCompilerSignallingItem  *itemVisiblePage;
  KConfigBaseEE::ItemEnum  *innerItemVisiblePage;
  innerItemVisiblePage = new KConfigBaseEE::ItemEnum( currentGroup(), QStringLiteral( "visiblePage" ), mVisiblePage, valuesvisiblePage, 0 );
  itemVisiblePage = new KConfigCompilerSignallingItem(innerItemVisiblePage, this, notifyFunction, signalVisiblePageChanged);
  itemVisiblePage->setWriteFlags(KConfigBase::Notify);
  addItem( itemVisiblePage, QStringLiteral( "visiblePage" ) );
  KConfigCompilerSignallingItem  *itemVisiblePlugin;
  KConfigBaseEE::ItemString  *innerItemVisiblePlugin;
  innerItemVisiblePlugin = new KConfigBaseEE::ItemString( currentGroup(), QStringLiteral( "visiblePlugin" ), mVisiblePlugin, "" );
  itemVisiblePlugin = new KConfigCompilerSignallingItem(innerItemVisiblePlugin, this, notifyFunction, signalVisiblePluginChanged);
  itemVisiblePlugin->setWriteFlags(KConfigBase::Notify);
  addItem( itemVisiblePlugin, QStringLiteral( "visiblePlugin" ) );
  KConfigCompilerSignallingItem  *itemListenToMic;
  KConfigBaseEE::ItemBool  *innerItemListenToMic;
  innerItemListenToMic = new KConfigBaseEE::ItemBool( currentGroup(), QStringLiteral( "listenToMic" ), mListenToMic, false );
  itemListenToMic = new KConfigCompilerSignallingItem(innerItemListenToMic, this, notifyFunction, signalListenToMicChanged);
  itemListenToMic->setWriteFlags(KConfigBase::Notify);
  addItem( itemListenToMic, QStringLiteral( "listenToMic" ) );
  KConfigCompilerSignallingItem  *itemListenToMicIncludesOutputEffects;
  KConfigBaseEE::ItemBool  *innerItemListenToMicIncludesOutputEffects;
  innerItemListenToMicIncludesOutputEffects = new KConfigBaseEE::ItemBool( currentGroup(), QStringLiteral( "listenToMicIncludesOutputEffects" ), mListenToMicIncludesOutputEffects, false );
  itemListenToMicIncludesOutputEffects = new KConfigCompilerSignallingItem(innerItemListenToMicIncludesOutputEffects, this, notifyFunction, signalListenToMicIncludesOutputEffectsChanged);
  itemListenToMicIncludesOutputEffects->setWriteFlags(KConfigBase::Notify);
  addItem( itemListenToMicIncludesOutputEffects, QStringLiteral( "listenToMicIncludesOutputEffects" ) );
  KConfigCompilerSignallingItem  *itemUsedPresets;
  KConfigBaseEE::ItemStringList  *innerItemUsedPresets;
  innerItemUsedPresets = new KConfigBaseEE::ItemStringList( currentGroup(), QStringLiteral( "usedPresets" ), mUsedPresets );
  itemUsedPresets = new KConfigCompilerSignallingItem(innerItemUsedPresets, this, notifyFunction, signalUsedPresetsChanged);
  itemUsedPresets->setWriteFlags(KConfigBase::Notify);
  addItem( itemUsedPresets, QStringLiteral( "usedPresets" ) );
  KConfigCompilerSignallingItem  *itemMostUsedPresets;
  KConfigBaseEE::ItemStringList  *innerItemMostUsedPresets;
  innerItemMostUsedPresets = new KConfigBaseEE::ItemStringList( currentGroup(), QStringLiteral( "mostUsedPresets" ), mMostUsedPresets );
  itemMostUsedPresets = new KConfigCompilerSignallingItem(innerItemMostUsedPresets, this, notifyFunction, signalMostUsedPresetsChanged);
  itemMostUsedPresets->setWriteFlags(KConfigBase::Notify);
  addItem( itemMostUsedPresets, QStringLiteral( "mostUsedPresets" ) );
  KConfigCompilerSignallingItem  *itemPluginsListWidth;
  KConfigBaseEE::ItemInt  *innerItemPluginsListWidth;
  innerItemPluginsListWidth = new KConfigBaseEE::ItemInt( currentGroup(), QStringLiteral( "pluginsListWidth" ), mPluginsListWidth, 0 );
  itemPluginsListWidth = new KConfigCompilerSignallingItem(innerItemPluginsListWidth, this, notifyFunction, signalPluginsListWidthChanged);
  itemPluginsListWidth->setWriteFlags(KConfigBase::Notify);
  addItem( itemPluginsListWidth, QStringLiteral( "pluginsListWidth" ) );
}

bool DbStreamInputs::defaultUseDefaultInputDeviceValue_helper()
{

  return true;
}

QString DbStreamInputs::defaultInputDeviceValue_helper()
{

  return "";
}

bool DbStreamInputs::defaultShowBlocklistedAppsValue_helper()
{

  return false;
}

bool DbStreamInputs::defaultBlocklistUsesMediaNameValue_helper()
{

  return false;
}

bool DbStreamInputs::defaultShowPluginsListValue_helper()
{

  return true;
}

int DbStreamInputs::defaultVisiblePageValue_helper()
{

  return 0;
}

QString DbStreamInputs::defaultVisiblePluginValue_helper()
{

  return "";
}

bool DbStreamInputs::defaultListenToMicValue_helper()
{

  return false;
}

bool DbStreamInputs::defaultListenToMicIncludesOutputEffectsValue_helper()
{

  return false;
}

int DbStreamInputs::defaultPluginsListWidthValue_helper()
{

  return 0;
}

DbStreamInputs::~DbStreamInputs()
{
  if (s_globalDbStreamInputs.exists() && !s_globalDbStreamInputs.isDestroyed()) {
    s_globalDbStreamInputs()->q = nullptr;
  }
}


void DbStreamInputs::itemChanged(quint64 signalFlag) {

  switch (signalFlag) {
  case signalPluginsChanged:
    Q_EMIT pluginsChanged();
    break;
  case signalUseDefaultInputDeviceChanged:
    Q_EMIT useDefaultInputDeviceChanged();
    break;
  case signalInputDeviceChanged:
    Q_EMIT inputDeviceChanged();
    break;
  case signalBlocklistChanged:
    Q_EMIT blocklistChanged();
    break;
  case signalShowBlocklistedAppsChanged:
    Q_EMIT showBlocklistedAppsChanged();
    break;
  case signalBlocklistUsesMediaNameChanged:
    Q_EMIT blocklistUsesMediaNameChanged();
    break;
  case signalShowPluginsListChanged:
    Q_EMIT showPluginsListChanged();
    break;
  case signalVisiblePageChanged:
    Q_EMIT visiblePageChanged();
    break;
  case signalVisiblePluginChanged:
    Q_EMIT visiblePluginChanged();
    break;
  case signalListenToMicChanged:
    Q_EMIT listenToMicChanged();
    break;
  case signalListenToMicIncludesOutputEffectsChanged:
    Q_EMIT listenToMicIncludesOutputEffectsChanged();
    break;
  case signalUsedPresetsChanged:
    Q_EMIT usedPresetsChanged();
    break;
  case signalMostUsedPresetsChanged:
    Q_EMIT mostUsedPresetsChanged();
    break;
  case signalPluginsListWidthChanged:
    Q_EMIT pluginsListWidthChanged();
    break;
  }
}
