当前位置: 首页>>代码示例>>C++>>正文


C++ AE_DSP_ADDON::get方法代码示例

本文整理汇总了C++中AE_DSP_ADDON::get方法的典型用法代码示例。如果您正苦于以下问题:C++ AE_DSP_ADDON::get方法的具体用法?C++ AE_DSP_ADDON::get怎么用?C++ AE_DSP_ADDON::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AE_DSP_ADDON的用法示例。


在下文中一共展示了AE_DSP_ADDON::get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: UpdateAddons

void CActiveAEDSP::UpdateAddons()
{
  AE_DSP_ADDON dspAddon;

  BinaryAddonBaseList addonInfos;
  CServiceBroker::GetBinaryAddonManager().GetAddonInfos(addonInfos, false, ADDON_ADSPDLL);
  if (addonInfos.empty())
    return;

  for (auto &addonInfo : addonInfos)
  {
    bool bEnabled = !CServiceBroker::GetAddonMgr().IsAddonDisabled(addonInfo->ID());
    if (bEnabled && (!IsKnownAudioDSPAddon(addonInfo->ID()) || !IsReadyAudioDSPAddon(addonInfo)))
    {
      std::hash<std::string> hasher;
      int iAddonId = static_cast<int>(hasher(addonInfo->ID()));
      if (iAddonId < 0)
        iAddonId = -iAddonId;

      if (IsKnownAudioDSPAddon(addonInfo->ID()))
      {
        AE_DSP_ADDON dspAddon;
        GetAudioDSPAddon(iAddonId, dspAddon);
        dspAddon->Create(iAddonId);
      }
      else
      {
        AE_DSP_ADDON dspAddon = std::make_shared<CActiveAEDSPAddon>(addonInfo);
        dspAddon.get()->Create(iAddonId);
        CSingleLock lock(m_critSection);
        // register the add-on
        if (m_addonMap.find(iAddonId) == m_addonMap.end())
        {
          m_addonMap.insert(std::make_pair(iAddonId, dspAddon));
          m_addonNameIds.insert(make_pair(addonInfo->ID(), iAddonId));
        }
      }
    }
    else if (!bEnabled && IsKnownAudioDSPAddon(addonInfo->ID()))
    {
      CLog::Log(LOGDEBUG, "Disabling AudioDSP add-on: %s", addonInfo->ID().c_str());

      CSingleLock lock(m_critSection);
      AE_DSP_ADDONMAP::iterator iter = m_addonMap.find(GetAudioDSPAddonId(addonInfo->ID()));
      if (iter != m_addonMap.end())
      {
        m_addonMap.erase(iter);
        m_addonToDestroy.push_back(dspAddon);
      }
    }
  }

  TriggerModeUpdate();
}
开发者ID:Montellese,项目名称:xbmc,代码行数:54,代码来源:ActiveAEDSP.cpp

示例2: UpdateAddons

void CActiveAEDSP::UpdateAddons()
{
  VECADDONS addons;
  AE_DSP_ADDON dspAddon;

  CAddonMgr::GetInstance().GetAddons(addons, ADDON_ADSPDLL);

  if (addons.empty())
    return;

  for (auto &addon : addons)
  {
    bool bEnabled = !CAddonMgr::GetInstance().IsAddonDisabled(addon->ID());
    if (bEnabled && (!IsKnownAudioDSPAddon(addon) || !IsReadyAudioDSPAddon(addon)))
    {
      std::hash<std::string> hasher;
      int iAddonId = static_cast<int>(hasher(addon->ID()));
      if (iAddonId < 0)
        iAddonId = -iAddonId;

      /* create and open database */
      if (!m_databaseDSP.IsOpen())
        m_databaseDSP.Open();

      if (IsKnownAudioDSPAddon(addon))
      {
        AE_DSP_ADDON dspAddon;
        GetAudioDSPAddon(iAddonId, dspAddon);
        dspAddon->Create(iAddonId);
      }
      else
      {
        AE_DSP_ADDON dspAddon = std::dynamic_pointer_cast<CActiveAEDSPAddon>(addon);
        if (!dspAddon)
        {
          CLog::Log(LOGERROR, "CActiveAEDSP::UpdateAndInitialiseAddons - severe error, incorrect add type");
          continue;
        }

        dspAddon.get()->Create(iAddonId);
        // register the add-on
        if (m_addonMap.find(iAddonId) == m_addonMap.end())
        {
          m_addonMap.insert(std::make_pair(iAddonId, dspAddon));
          m_addonNameIds.insert(make_pair(addon->ID(), iAddonId));
        }
      }
    }
  }

  TriggerModeUpdate();
}
开发者ID:LS80,项目名称:xbmc,代码行数:52,代码来源:ActiveAEDSP.cpp

示例3: UpdateAndInitialiseAudioDSPAddons

bool CActiveAEDSP::UpdateAndInitialiseAudioDSPAddons(bool bInitialiseAllAudioDSPAddons /* = false */)
{
  bool bReturn(true);
  VECADDONS map;
  VECADDONS disableAddons;
  {
    CSingleLock lock(m_critUpdateSection);
    map = m_addons;
  }

  if (map.empty())
    return false;

  for (unsigned iAddonPtr = 0; iAddonPtr < map.size(); ++iAddonPtr)
  {
    const AddonPtr dspAddon = map.at(iAddonPtr);
    bool bEnabled = !CAddonMgr::GetInstance().IsAddonDisabled(dspAddon->ID());

    if (!bEnabled && IsKnownAudioDSPAddon(dspAddon))
    {
      CSingleLock lock(m_critUpdateSection);
      /* stop the dsp addon and remove it from the db */
      StopAudioDSPAddon(dspAddon, false);
      VECADDONS::iterator addonPtr = std::find(m_addons.begin(), m_addons.end(), dspAddon);
      if (addonPtr != m_addons.end())
        m_addons.erase(addonPtr);

    }
    else if (bEnabled && (bInitialiseAllAudioDSPAddons || !IsKnownAudioDSPAddon(dspAddon) || !IsReadyAudioDSPAddon(dspAddon)))
    {
      bool bDisabled(false);

      /* register the add-on in the audio dsp db, and create the CActiveAEDSPAddon instance */
      int iAddonId = RegisterAudioDSPAddon(dspAddon);
      if (iAddonId < 0)
      {
        /* failed to register or create the add-on, disable it */
        CLog::Log(LOGWARNING, "ActiveAE DSP - %s - failed to register add-on %s, disabling it", __FUNCTION__, dspAddon->Name().c_str());
        disableAddons.push_back(dspAddon);
        bDisabled = true;
      }
      else
      {
        ADDON_STATUS status(ADDON_STATUS_UNKNOWN);
        AE_DSP_ADDON addon;
        {
          CSingleLock lock(m_critUpdateSection);
          if (!GetAudioDSPAddon(iAddonId, addon))
          {
            CLog::Log(LOGWARNING, "ActiveAE DSP - %s - failed to find add-on %s, disabling it", __FUNCTION__, dspAddon->Name().c_str());
            disableAddons.push_back(dspAddon);
            bDisabled = true;
          }
        }

        /* re-check the enabled status. newly installed dsps get disabled when they're added to the db */
        if (!bDisabled && !CAddonMgr::GetInstance().IsAddonDisabled(addon->ID()) && (status = addon->Create(iAddonId)) != ADDON_STATUS_OK)
        {
          CLog::Log(LOGWARNING, "ActiveAE DSP - %s - failed to create add-on %s, status = %d", __FUNCTION__, dspAddon->Name().c_str(), status);
          if (!addon.get() || !addon->DllLoaded() || status == ADDON_STATUS_PERMANENT_FAILURE)
          {
            /* failed to load the dll of this add-on, disable it */
            CLog::Log(LOGWARNING, "ActiveAE DSP - %s - failed to load the dll for add-on %s, disabling it", __FUNCTION__, dspAddon->Name().c_str());
            disableAddons.push_back(dspAddon);
            bDisabled = true;
          }
        }
      }

      if (bDisabled && IsActivated())
        CGUIDialogOK::ShowAndGetInput(24070, 24071, 16029, 0);
    }
  }

  /* disable add-ons that failed to initialise */
  if (!disableAddons.empty())
  {
    CSingleLock lock(m_critUpdateSection);
    for (VECADDONS::iterator itr = disableAddons.begin(); itr != disableAddons.end(); ++itr)
    {
      /* disable in the add-on db */
      CAddonMgr::GetInstance().DisableAddon((*itr)->ID());

      /* remove from the audio dsp add-on list */
      VECADDONS::iterator addonPtr = std::find(m_addons.begin(), m_addons.end(), *itr);
      if (addonPtr != m_addons.end())
        m_addons.erase(addonPtr);
    }
  }

  return bReturn;
}
开发者ID:69thelememt,项目名称:xbmc,代码行数:92,代码来源:ActiveAEDSP.cpp


注:本文中的AE_DSP_ADDON::get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。