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

#include "easyeffects_db_streamoutputs.h"

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

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

  return s_globalDbStreamOutputs()->q;
}

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

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

  setCurrentGroup( QStringLiteral( "StreamOutputs" ) );

  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  *itemUseDefaultOutputDevice;
  KConfigBaseEE::ItemBool  *innerItemUseDefaultOutputDevice;
  innerItemUseDefaultOutputDevice = new KConfigBaseEE::ItemBool( currentGroup(), QStringLiteral( "useDefaultOutputDevice" ), mUseDefaultOutputDevice, true );
  itemUseDefaultOutputDevice = new KConfigCompilerSignallingItem(innerItemUseDefaultOutputDevice, this, notifyFunction, signalUseDefaultOutputDeviceChanged);
  itemUseDefaultOutputDevice->setWriteFlags(KConfigBase::Notify);
  addItem( itemUseDefaultOutputDevice, QStringLiteral( "useDefaultOutputDevice" ) );
  KConfigCompilerSignallingItem  *itemOutputDevice;
  KConfigBaseEE::ItemString  *innerItemOutputDevice;
  innerItemOutputDevice = new KConfigBaseEE::ItemString( currentGroup(), QStringLiteral( "outputDevice" ), mOutputDevice, "" );
  itemOutputDevice = new KConfigCompilerSignallingItem(innerItemOutputDevice, this, notifyFunction, signalOutputDeviceChanged);
  itemOutputDevice->setWriteFlags(KConfigBase::Notify);
  addItem( itemOutputDevice, QStringLiteral( "outputDevice" ) );
  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  *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" ) );
  KConfigCompilerSignallingItem  *itemLinkToVirtualSource;
  KConfigBaseEE::ItemBool  *innerItemLinkToVirtualSource;
  innerItemLinkToVirtualSource = new KConfigBaseEE::ItemBool( currentGroup(), QStringLiteral( "linkToVirtualSource" ), mLinkToVirtualSource, false );
  itemLinkToVirtualSource = new KConfigCompilerSignallingItem(innerItemLinkToVirtualSource, this, notifyFunction, signalLinkToVirtualSourceChanged);
  itemLinkToVirtualSource->setWriteFlags(KConfigBase::Notify);
  addItem( itemLinkToVirtualSource, QStringLiteral( "linkToVirtualSource" ) );
}

bool DbStreamOutputs::defaultUseDefaultOutputDeviceValue_helper()
{

  return true;
}

QString DbStreamOutputs::defaultOutputDeviceValue_helper()
{

  return "";
}

bool DbStreamOutputs::defaultShowBlocklistedAppsValue_helper()
{

  return false;
}

bool DbStreamOutputs::defaultBlocklistUsesMediaNameValue_helper()
{

  return false;
}

bool DbStreamOutputs::defaultShowPluginsListValue_helper()
{

  return true;
}

int DbStreamOutputs::defaultVisiblePageValue_helper()
{

  return 0;
}

QString DbStreamOutputs::defaultVisiblePluginValue_helper()
{

  return "";
}

int DbStreamOutputs::defaultPluginsListWidthValue_helper()
{

  return 0;
}

bool DbStreamOutputs::defaultLinkToVirtualSourceValue_helper()
{

  return false;
}

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


void DbStreamOutputs::itemChanged(quint64 signalFlag) {

  switch (signalFlag) {
  case signalPluginsChanged:
    Q_EMIT pluginsChanged();
    break;
  case signalUseDefaultOutputDeviceChanged:
    Q_EMIT useDefaultOutputDeviceChanged();
    break;
  case signalOutputDeviceChanged:
    Q_EMIT outputDeviceChanged();
    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 signalUsedPresetsChanged:
    Q_EMIT usedPresetsChanged();
    break;
  case signalMostUsedPresetsChanged:
    Q_EMIT mostUsedPresetsChanged();
    break;
  case signalPluginsListWidthChanged:
    Q_EMIT pluginsListWidthChanged();
    break;
  case signalLinkToVirtualSourceChanged:
    Q_EMIT linkToVirtualSourceChanged();
    break;
  }
}
